Commit f762147a authored by huanglu's avatar huanglu

feat: ios

parent b63715ac
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
"babel-plugin-root-import",
{
"paths": [
{
"rootPathSuffix": "./src/",
"rootPathPrefix": "@/"
}
]
}
]
]
};
......@@ -16,6 +16,50 @@
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
2DCD954D1E0B4F2C00145EB5 /* GeekTeacherWorkTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* GeekTeacherWorkTests.m */; };
4B3F807E686F59C0CFF244D1 /* libPods-GeekTeacherWork-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 39A9586CECA978AFB9D75B72 /* libPods-GeekTeacherWork-tvOS.a */; };
4D958820754B5B5FA9BE77D5 /* libPods-GeekTeacherWorkTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70DD74937556FCFEB21E14EB /* libPods-GeekTeacherWorkTests.a */; };
708FD5F3252DCF1000678FB0 /* CaptureSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD5EF252DCF1000678FB0 /* CaptureSessionManager.m */; };
708FD5F4252DCF1000678FB0 /* CaptureSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD5EF252DCF1000678FB0 /* CaptureSessionManager.m */; };
708FD5F5252DCF1000678FB0 /* Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD5F0252DCF1000678FB0 /* Constants.m */; };
708FD5F6252DCF1000678FB0 /* Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD5F0252DCF1000678FB0 /* Constants.m */; };
708FD5FD252DCF2F00678FB0 /* CameraStyleKitClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD5FB252DCF2F00678FB0 /* CameraStyleKitClass.m */; };
708FD5FE252DCF2F00678FB0 /* CameraStyleKitClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD5FB252DCF2F00678FB0 /* CameraStyleKitClass.m */; };
708FD60F252DCF3E00678FB0 /* CameraShutterButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD603252DCF3E00678FB0 /* CameraShutterButton.m */; };
708FD610252DCF3E00678FB0 /* CameraShutterButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD603252DCF3E00678FB0 /* CameraShutterButton.m */; };
708FD611252DCF3E00678FB0 /* LaunchCameraButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD605252DCF3E00678FB0 /* LaunchCameraButton.m */; };
708FD612252DCF3E00678FB0 /* LaunchCameraButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD605252DCF3E00678FB0 /* LaunchCameraButton.m */; };
708FD613252DCF3E00678FB0 /* CameraFlashButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD606252DCF3E00678FB0 /* CameraFlashButton.m */; };
708FD614252DCF3E00678FB0 /* CameraFlashButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD606252DCF3E00678FB0 /* CameraFlashButton.m */; };
708FD615252DCF3E00678FB0 /* CameraToggleButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD609252DCF3E00678FB0 /* CameraToggleButton.m */; };
708FD616252DCF3E00678FB0 /* CameraToggleButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD609252DCF3E00678FB0 /* CameraToggleButton.m */; };
708FD617252DCF3E00678FB0 /* CameraFocalReticule.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD60B252DCF3E00678FB0 /* CameraFocalReticule.m */; };
708FD618252DCF3E00678FB0 /* CameraFocalReticule.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD60B252DCF3E00678FB0 /* CameraFocalReticule.m */; };
708FD619252DCF3E00678FB0 /* CameraDismissButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD60E252DCF3E00678FB0 /* CameraDismissButton.m */; };
708FD61A252DCF3E00678FB0 /* CameraDismissButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD60E252DCF3E00678FB0 /* CameraDismissButton.m */; };
708FD621252DCF4C00678FB0 /* CameraSessionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD620252DCF4C00678FB0 /* CameraSessionView.m */; };
708FD622252DCF4C00678FB0 /* CameraSessionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD620252DCF4C00678FB0 /* CameraSessionView.m */; };
708FD635252DD35200678FB0 /* GeekUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD633252DD35200678FB0 /* GeekUtil.m */; };
708FD636252DD35200678FB0 /* GeekUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD633252DD35200678FB0 /* GeekUtil.m */; };
708FD63E252DD35A00678FB0 /* GeekWorkResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD63D252DD35A00678FB0 /* GeekWorkResult.m */; };
708FD63F252DD35A00678FB0 /* GeekWorkResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD63D252DD35A00678FB0 /* GeekWorkResult.m */; };
708FD652252DD36D00678FB0 /* picture.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 708FD644252DD36900678FB0 /* picture.xcassets */; };
708FD653252DD36D00678FB0 /* picture.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 708FD644252DD36900678FB0 /* picture.xcassets */; };
708FD654252DD36D00678FB0 /* GeekWorkItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD646252DD36A00678FB0 /* GeekWorkItemView.m */; };
708FD655252DD36D00678FB0 /* GeekWorkItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD646252DD36A00678FB0 /* GeekWorkItemView.m */; };
708FD656252DD36D00678FB0 /* GeekWorkPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD647252DD36B00678FB0 /* GeekWorkPicker.m */; };
708FD657252DD36D00678FB0 /* GeekWorkPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD647252DD36B00678FB0 /* GeekWorkPicker.m */; };
708FD658252DD36D00678FB0 /* GeekWorkAnswerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD649252DD36B00678FB0 /* GeekWorkAnswerView.m */; };
708FD659252DD36D00678FB0 /* GeekWorkAnswerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD649252DD36B00678FB0 /* GeekWorkAnswerView.m */; };
708FD65A252DD36D00678FB0 /* GeekImageScannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD64A252DD36B00678FB0 /* GeekImageScannerView.m */; };
708FD65B252DD36D00678FB0 /* GeekImageScannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD64A252DD36B00678FB0 /* GeekImageScannerView.m */; };
708FD65C252DD36D00678FB0 /* GeekPickerEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD64B252DD36B00678FB0 /* GeekPickerEventEmitter.m */; };
708FD65D252DD36D00678FB0 /* GeekPickerEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD64B252DD36B00678FB0 /* GeekPickerEventEmitter.m */; };
708FD65E252DD36D00678FB0 /* GeekCameraVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 708FD650252DD36D00678FB0 /* GeekCameraVC.xib */; };
708FD65F252DD36D00678FB0 /* GeekCameraVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 708FD650252DD36D00678FB0 /* GeekCameraVC.xib */; };
708FD660252DD36D00678FB0 /* GeekCameraVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD651252DD36D00678FB0 /* GeekCameraVC.m */; };
708FD661252DD36D00678FB0 /* GeekCameraVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 708FD651252DD36D00678FB0 /* GeekCameraVC.m */; };
A2A46FB35A7655BF966A0151 /* libPods-GeekTeacherWork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5EC6C1572D43CB203755F0AF /* libPods-GeekTeacherWork.a */; };
FD0E2F06D13C3701CD538649 /* libPods-GeekTeacherWork-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5645F291BF26ECD8F8C28BD2 /* libPods-GeekTeacherWork-tvOSTests.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -36,7 +80,6 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; };
00E356EE1AD99517003FC87E /* GeekTeacherWorkTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GeekTeacherWorkTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* GeekTeacherWorkTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GeekTeacherWorkTests.m; sourceTree = "<group>"; };
......@@ -47,8 +90,59 @@
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = GeekTeacherWork/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = GeekTeacherWork/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = GeekTeacherWork/main.m; sourceTree = "<group>"; };
1CEC319D5474B05EE4D2CB04 /* Pods-GeekTeacherWork-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GeekTeacherWork-tvOS.release.xcconfig"; path = "Target Support Files/Pods-GeekTeacherWork-tvOS/Pods-GeekTeacherWork-tvOS.release.xcconfig"; sourceTree = "<group>"; };
1FA6A958EB07E37AC6A5B376 /* Pods-GeekTeacherWork.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GeekTeacherWork.debug.xcconfig"; path = "Target Support Files/Pods-GeekTeacherWork/Pods-GeekTeacherWork.debug.xcconfig"; sourceTree = "<group>"; };
2D02E47B1E0B4A5D006451C7 /* GeekTeacherWork-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "GeekTeacherWork-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2D02E4901E0B4A5D006451C7 /* GeekTeacherWork-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "GeekTeacherWork-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
39A9586CECA978AFB9D75B72 /* libPods-GeekTeacherWork-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GeekTeacherWork-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3D9BFC5F6CB18250D5885C06 /* Pods-GeekTeacherWorkTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GeekTeacherWorkTests.release.xcconfig"; path = "Target Support Files/Pods-GeekTeacherWorkTests/Pods-GeekTeacherWorkTests.release.xcconfig"; sourceTree = "<group>"; };
523386C03BE711C572D692D1 /* Pods-GeekTeacherWork-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GeekTeacherWork-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-GeekTeacherWork-tvOS/Pods-GeekTeacherWork-tvOS.debug.xcconfig"; sourceTree = "<group>"; };
5645F291BF26ECD8F8C28BD2 /* libPods-GeekTeacherWork-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GeekTeacherWork-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5EC6C1572D43CB203755F0AF /* libPods-GeekTeacherWork.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GeekTeacherWork.a"; sourceTree = BUILT_PRODUCTS_DIR; };
708FD5EF252DCF1000678FB0 /* CaptureSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CaptureSessionManager.m; sourceTree = "<group>"; };
708FD5F0252DCF1000678FB0 /* Constants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Constants.m; sourceTree = "<group>"; };
708FD5F1252DCF1000678FB0 /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = "<group>"; };
708FD5F2252DCF1000678FB0 /* CaptureSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CaptureSessionManager.h; sourceTree = "<group>"; };
708FD5FB252DCF2F00678FB0 /* CameraStyleKitClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CameraStyleKitClass.m; sourceTree = "<group>"; };
708FD5FC252DCF2F00678FB0 /* CameraStyleKitClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CameraStyleKitClass.h; sourceTree = "<group>"; };
708FD603252DCF3E00678FB0 /* CameraShutterButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CameraShutterButton.m; sourceTree = "<group>"; };
708FD604252DCF3E00678FB0 /* CameraToggleButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CameraToggleButton.h; sourceTree = "<group>"; };
708FD605252DCF3E00678FB0 /* LaunchCameraButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LaunchCameraButton.m; sourceTree = "<group>"; };
708FD606252DCF3E00678FB0 /* CameraFlashButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CameraFlashButton.m; sourceTree = "<group>"; };
708FD607252DCF3E00678FB0 /* CameraDismissButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CameraDismissButton.h; sourceTree = "<group>"; };
708FD608252DCF3E00678FB0 /* CameraShutterButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CameraShutterButton.h; sourceTree = "<group>"; };
708FD609252DCF3E00678FB0 /* CameraToggleButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CameraToggleButton.m; sourceTree = "<group>"; };
708FD60A252DCF3E00678FB0 /* LaunchCameraButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LaunchCameraButton.h; sourceTree = "<group>"; };
708FD60B252DCF3E00678FB0 /* CameraFocalReticule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CameraFocalReticule.m; sourceTree = "<group>"; };
708FD60C252DCF3E00678FB0 /* CameraFocalReticule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CameraFocalReticule.h; sourceTree = "<group>"; };
708FD60D252DCF3E00678FB0 /* CameraFlashButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CameraFlashButton.h; sourceTree = "<group>"; };
708FD60E252DCF3E00678FB0 /* CameraDismissButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CameraDismissButton.m; sourceTree = "<group>"; };
708FD61F252DCF4C00678FB0 /* CameraSessionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CameraSessionView.h; sourceTree = "<group>"; };
708FD620252DCF4C00678FB0 /* CameraSessionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CameraSessionView.m; sourceTree = "<group>"; };
708FD633252DD35200678FB0 /* GeekUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeekUtil.m; sourceTree = "<group>"; };
708FD634252DD35200678FB0 /* GeekUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeekUtil.h; sourceTree = "<group>"; };
708FD63B252DD35A00678FB0 /* GeekWorkModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeekWorkModel.h; sourceTree = "<group>"; };
708FD63C252DD35A00678FB0 /* GeekWorkResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeekWorkResult.h; sourceTree = "<group>"; };
708FD63D252DD35A00678FB0 /* GeekWorkResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeekWorkResult.m; sourceTree = "<group>"; };
708FD644252DD36900678FB0 /* picture.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = picture.xcassets; sourceTree = "<group>"; };
708FD645252DD36900678FB0 /* GeekCameraVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeekCameraVC.h; sourceTree = "<group>"; };
708FD646252DD36A00678FB0 /* GeekWorkItemView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeekWorkItemView.m; sourceTree = "<group>"; };
708FD647252DD36B00678FB0 /* GeekWorkPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeekWorkPicker.m; sourceTree = "<group>"; };
708FD648252DD36B00678FB0 /* GeekImageScannerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeekImageScannerView.h; sourceTree = "<group>"; };
708FD649252DD36B00678FB0 /* GeekWorkAnswerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeekWorkAnswerView.m; sourceTree = "<group>"; };
708FD64A252DD36B00678FB0 /* GeekImageScannerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeekImageScannerView.m; sourceTree = "<group>"; };
708FD64B252DD36B00678FB0 /* GeekPickerEventEmitter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeekPickerEventEmitter.m; sourceTree = "<group>"; };
708FD64C252DD36C00678FB0 /* GeekWorkPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeekWorkPicker.h; sourceTree = "<group>"; };
708FD64D252DD36C00678FB0 /* GeekPickerEventEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeekPickerEventEmitter.h; sourceTree = "<group>"; };
708FD64E252DD36C00678FB0 /* GeekWorkItemView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeekWorkItemView.h; sourceTree = "<group>"; };
708FD64F252DD36D00678FB0 /* GeekWorkAnswerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeekWorkAnswerView.h; sourceTree = "<group>"; };
708FD650252DD36D00678FB0 /* GeekCameraVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = GeekCameraVC.xib; sourceTree = "<group>"; };
708FD651252DD36D00678FB0 /* GeekCameraVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeekCameraVC.m; sourceTree = "<group>"; };
70DD74937556FCFEB21E14EB /* libPods-GeekTeacherWorkTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GeekTeacherWorkTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
740D9AA661EF86368646175B /* Pods-GeekTeacherWorkTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GeekTeacherWorkTests.debug.xcconfig"; path = "Target Support Files/Pods-GeekTeacherWorkTests/Pods-GeekTeacherWorkTests.debug.xcconfig"; sourceTree = "<group>"; };
899799DC375D9A636B06CFDB /* Pods-GeekTeacherWork.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GeekTeacherWork.release.xcconfig"; path = "Target Support Files/Pods-GeekTeacherWork/Pods-GeekTeacherWork.release.xcconfig"; sourceTree = "<group>"; };
B715DC2510AEBFE1DD587FA7 /* Pods-GeekTeacherWork-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GeekTeacherWork-tvOSTests.debug.xcconfig"; path = "Target Support Files/Pods-GeekTeacherWork-tvOSTests/Pods-GeekTeacherWork-tvOSTests.debug.xcconfig"; sourceTree = "<group>"; };
BCAFDCB6B2A4782FF3E7148C /* Pods-GeekTeacherWork-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GeekTeacherWork-tvOSTests.release.xcconfig"; path = "Target Support Files/Pods-GeekTeacherWork-tvOSTests/Pods-GeekTeacherWork-tvOSTests.release.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
/* End PBXFileReference section */
......@@ -58,6 +152,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4D958820754B5B5FA9BE77D5 /* libPods-GeekTeacherWorkTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -65,6 +160,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A2A46FB35A7655BF966A0151 /* libPods-GeekTeacherWork.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -72,6 +168,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4B3F807E686F59C0CFF244D1 /* libPods-GeekTeacherWork-tvOS.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -79,6 +176,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FD0E2F06D13C3701CD538649 /* libPods-GeekTeacherWork-tvOSTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -102,10 +200,26 @@
name = "Supporting Files";
sourceTree = "<group>";
};
1125D46CBE48DEB7ABCA0837 /* Pods */ = {
isa = PBXGroup;
children = (
1FA6A958EB07E37AC6A5B376 /* Pods-GeekTeacherWork.debug.xcconfig */,
899799DC375D9A636B06CFDB /* Pods-GeekTeacherWork.release.xcconfig */,
523386C03BE711C572D692D1 /* Pods-GeekTeacherWork-tvOS.debug.xcconfig */,
1CEC319D5474B05EE4D2CB04 /* Pods-GeekTeacherWork-tvOS.release.xcconfig */,
B715DC2510AEBFE1DD587FA7 /* Pods-GeekTeacherWork-tvOSTests.debug.xcconfig */,
BCAFDCB6B2A4782FF3E7148C /* Pods-GeekTeacherWork-tvOSTests.release.xcconfig */,
740D9AA661EF86368646175B /* Pods-GeekTeacherWorkTests.debug.xcconfig */,
3D9BFC5F6CB18250D5885C06 /* Pods-GeekTeacherWorkTests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
13B07FAE1A68108700A75B9A /* GeekTeacherWork */ = {
isa = PBXGroup;
children = (
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
708FD5E9252DCEF300678FB0 /* CustomizableCamera */,
708FD5DC252DCE7C00678FB0 /* GeekPicture */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.m */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
......@@ -121,10 +235,109 @@
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
5EC6C1572D43CB203755F0AF /* libPods-GeekTeacherWork.a */,
39A9586CECA978AFB9D75B72 /* libPods-GeekTeacherWork-tvOS.a */,
5645F291BF26ECD8F8C28BD2 /* libPods-GeekTeacherWork-tvOSTests.a */,
70DD74937556FCFEB21E14EB /* libPods-GeekTeacherWorkTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
708FD5DC252DCE7C00678FB0 /* GeekPicture */ = {
isa = PBXGroup;
children = (
708FD645252DD36900678FB0 /* GeekCameraVC.h */,
708FD651252DD36D00678FB0 /* GeekCameraVC.m */,
708FD650252DD36D00678FB0 /* GeekCameraVC.xib */,
708FD648252DD36B00678FB0 /* GeekImageScannerView.h */,
708FD64A252DD36B00678FB0 /* GeekImageScannerView.m */,
708FD64D252DD36C00678FB0 /* GeekPickerEventEmitter.h */,
708FD64B252DD36B00678FB0 /* GeekPickerEventEmitter.m */,
708FD64F252DD36D00678FB0 /* GeekWorkAnswerView.h */,
708FD649252DD36B00678FB0 /* GeekWorkAnswerView.m */,
708FD64E252DD36C00678FB0 /* GeekWorkItemView.h */,
708FD646252DD36A00678FB0 /* GeekWorkItemView.m */,
708FD64C252DD36C00678FB0 /* GeekWorkPicker.h */,
708FD647252DD36B00678FB0 /* GeekWorkPicker.m */,
708FD644252DD36900678FB0 /* picture.xcassets */,
708FD63B252DD35A00678FB0 /* GeekWorkModel.h */,
708FD63C252DD35A00678FB0 /* GeekWorkResult.h */,
708FD63D252DD35A00678FB0 /* GeekWorkResult.m */,
708FD634252DD35200678FB0 /* GeekUtil.h */,
708FD633252DD35200678FB0 /* GeekUtil.m */,
);
name = GeekPicture;
path = GeekTeacherWork/GeekPicture;
sourceTree = "<group>";
};
708FD5E9252DCEF300678FB0 /* CustomizableCamera */ = {
isa = PBXGroup;
children = (
708FD5EA252DCEF300678FB0 /* Model Classes */,
708FD5EB252DCEF300678FB0 /* Graphical Assets */,
708FD5EE252DCEF300678FB0 /* Camera View */,
);
name = CustomizableCamera;
path = GeekTeacherWork/CustomizableCamera;
sourceTree = "<group>";
};
708FD5EA252DCEF300678FB0 /* Model Classes */ = {
isa = PBXGroup;
children = (
708FD5F2252DCF1000678FB0 /* CaptureSessionManager.h */,
708FD5EF252DCF1000678FB0 /* CaptureSessionManager.m */,
708FD5F1252DCF1000678FB0 /* Constants.h */,
708FD5F0252DCF1000678FB0 /* Constants.m */,
);
path = "Model Classes";
sourceTree = "<group>";
};
708FD5EB252DCEF300678FB0 /* Graphical Assets */ = {
isa = PBXGroup;
children = (
708FD5EC252DCEF300678FB0 /* UI Assets */,
708FD5ED252DCEF300678FB0 /* CameraViewComponents */,
);
path = "Graphical Assets";
sourceTree = "<group>";
};
708FD5EC252DCEF300678FB0 /* UI Assets */ = {
isa = PBXGroup;
children = (
708FD5FC252DCF2F00678FB0 /* CameraStyleKitClass.h */,
708FD5FB252DCF2F00678FB0 /* CameraStyleKitClass.m */,
);
path = "UI Assets";
sourceTree = "<group>";
};
708FD5ED252DCEF300678FB0 /* CameraViewComponents */ = {
isa = PBXGroup;
children = (
708FD607252DCF3E00678FB0 /* CameraDismissButton.h */,
708FD60E252DCF3E00678FB0 /* CameraDismissButton.m */,
708FD60D252DCF3E00678FB0 /* CameraFlashButton.h */,
708FD606252DCF3E00678FB0 /* CameraFlashButton.m */,
708FD60C252DCF3E00678FB0 /* CameraFocalReticule.h */,
708FD60B252DCF3E00678FB0 /* CameraFocalReticule.m */,
708FD608252DCF3E00678FB0 /* CameraShutterButton.h */,
708FD603252DCF3E00678FB0 /* CameraShutterButton.m */,
708FD604252DCF3E00678FB0 /* CameraToggleButton.h */,
708FD609252DCF3E00678FB0 /* CameraToggleButton.m */,
708FD60A252DCF3E00678FB0 /* LaunchCameraButton.h */,
708FD605252DCF3E00678FB0 /* LaunchCameraButton.m */,
);
path = CameraViewComponents;
sourceTree = "<group>";
};
708FD5EE252DCEF300678FB0 /* Camera View */ = {
isa = PBXGroup;
children = (
708FD61F252DCF4C00678FB0 /* CameraSessionView.h */,
708FD620252DCF4C00678FB0 /* CameraSessionView.m */,
);
path = "Camera View";
sourceTree = "<group>";
};
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
......@@ -140,6 +353,7 @@
00E356EF1AD99517003FC87E /* GeekTeacherWorkTests */,
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
1125D46CBE48DEB7ABCA0837 /* Pods */,
);
indentWidth = 2;
sourceTree = "<group>";
......@@ -164,6 +378,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "GeekTeacherWorkTests" */;
buildPhases = (
ED6784100F9B91AFBF8A673A /* [CP] Check Pods Manifest.lock */,
00E356EA1AD99517003FC87E /* Sources */,
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
......@@ -182,6 +397,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "GeekTeacherWork" */;
buildPhases = (
A9DAD6AECDE30843E616FD38 /* [CP] Check Pods Manifest.lock */,
FD10A7F022414F080027D42C /* Start Packager */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
......@@ -193,7 +409,7 @@
dependencies = (
);
name = GeekTeacherWork;
productName = "GeekTeacherWork";
productName = GeekTeacherWork;
productReference = 13B07F961A680F5B00A75B9A /* GeekTeacherWork.app */;
productType = "com.apple.product-type.application";
};
......@@ -201,6 +417,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "GeekTeacherWork-tvOS" */;
buildPhases = (
EF0069FF25C643655237FD3F /* [CP] Check Pods Manifest.lock */,
FD10A7F122414F3F0027D42C /* Start Packager */,
2D02E4771E0B4A5D006451C7 /* Sources */,
2D02E4781E0B4A5D006451C7 /* Frameworks */,
......@@ -220,6 +437,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "GeekTeacherWork-tvOSTests" */;
buildPhases = (
7EAAB7153FE6FBCFBF4F4953 /* [CP] Check Pods Manifest.lock */,
2D02E48C1E0B4A5D006451C7 /* Sources */,
2D02E48D1E0B4A5D006451C7 /* Frameworks */,
2D02E48E1E0B4A5D006451C7 /* Resources */,
......@@ -245,11 +463,16 @@
TargetAttributes = {
00E356ED1AD99517003FC87E = {
CreatedOnToolsVersion = 6.2;
DevelopmentTeam = N88J7PT4L3;
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = N88J7PT4L3;
ProvisioningStyle = Automatic;
};
2D02E47A1E0B4A5D006451C7 = {
CreatedOnToolsVersion = 8.2.1;
ProvisioningStyle = Automatic;
ProvisioningStyle = Manual;
};
2D02E48F1E0B4A5D006451C7 = {
CreatedOnToolsVersion = 8.2.1;
......@@ -263,6 +486,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
......@@ -293,6 +517,8 @@
files = (
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
708FD652252DD36D00678FB0 /* picture.xcassets in Resources */,
708FD65E252DD36D00678FB0 /* GeekCameraVC.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -300,7 +526,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
708FD653252DD36D00678FB0 /* picture.xcassets in Resources */,
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */,
708FD65F252DD36D00678FB0 /* GeekCameraVC.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -342,6 +570,94 @@
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
};
7EAAB7153FE6FBCFBF4F4953 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-GeekTeacherWork-tvOSTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
A9DAD6AECDE30843E616FD38 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-GeekTeacherWork-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
ED6784100F9B91AFBF8A673A /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-GeekTeacherWorkTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
EF0069FF25C643655237FD3F /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-GeekTeacherWork-tvOS-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
FD10A7F022414F080027D42C /* Start Packager */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
......@@ -395,8 +711,26 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
708FD635252DD35200678FB0 /* GeekUtil.m in Sources */,
708FD611252DCF3E00678FB0 /* LaunchCameraButton.m in Sources */,
708FD613252DCF3E00678FB0 /* CameraFlashButton.m in Sources */,
708FD654252DD36D00678FB0 /* GeekWorkItemView.m in Sources */,
708FD60F252DCF3E00678FB0 /* CameraShutterButton.m in Sources */,
708FD617252DCF3E00678FB0 /* CameraFocalReticule.m in Sources */,
708FD658252DD36D00678FB0 /* GeekWorkAnswerView.m in Sources */,
708FD660252DD36D00678FB0 /* GeekCameraVC.m in Sources */,
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
708FD65C252DD36D00678FB0 /* GeekPickerEventEmitter.m in Sources */,
708FD5FD252DCF2F00678FB0 /* CameraStyleKitClass.m in Sources */,
708FD656252DD36D00678FB0 /* GeekWorkPicker.m in Sources */,
708FD621252DCF4C00678FB0 /* CameraSessionView.m in Sources */,
708FD65A252DD36D00678FB0 /* GeekImageScannerView.m in Sources */,
13B07FC11A68108700A75B9A /* main.m in Sources */,
708FD63E252DD35A00678FB0 /* GeekWorkResult.m in Sources */,
708FD619252DCF3E00678FB0 /* CameraDismissButton.m in Sources */,
708FD615252DCF3E00678FB0 /* CameraToggleButton.m in Sources */,
708FD5F3252DCF1000678FB0 /* CaptureSessionManager.m in Sources */,
708FD5F5252DCF1000678FB0 /* Constants.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -404,8 +738,26 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
708FD636252DD35200678FB0 /* GeekUtil.m in Sources */,
708FD612252DCF3E00678FB0 /* LaunchCameraButton.m in Sources */,
708FD614252DCF3E00678FB0 /* CameraFlashButton.m in Sources */,
708FD655252DD36D00678FB0 /* GeekWorkItemView.m in Sources */,
708FD610252DCF3E00678FB0 /* CameraShutterButton.m in Sources */,
708FD618252DCF3E00678FB0 /* CameraFocalReticule.m in Sources */,
708FD659252DD36D00678FB0 /* GeekWorkAnswerView.m in Sources */,
708FD661252DD36D00678FB0 /* GeekCameraVC.m in Sources */,
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */,
708FD65D252DD36D00678FB0 /* GeekPickerEventEmitter.m in Sources */,
708FD5FE252DCF2F00678FB0 /* CameraStyleKitClass.m in Sources */,
708FD657252DD36D00678FB0 /* GeekWorkPicker.m in Sources */,
708FD622252DCF4C00678FB0 /* CameraSessionView.m in Sources */,
708FD65B252DD36D00678FB0 /* GeekImageScannerView.m in Sources */,
2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */,
708FD63F252DD35A00678FB0 /* GeekWorkResult.m in Sources */,
708FD61A252DCF3E00678FB0 /* CameraDismissButton.m in Sources */,
708FD616252DCF3E00678FB0 /* CameraToggleButton.m in Sources */,
708FD5F4252DCF1000678FB0 /* CaptureSessionManager.m in Sources */,
708FD5F6252DCF1000678FB0 /* Constants.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -447,8 +799,10 @@
/* Begin XCBuildConfiguration section */
00E356F61AD99517003FC87E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 740D9AA661EF86368646175B /* Pods-GeekTeacherWorkTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = N88J7PT4L3;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
......@@ -469,9 +823,11 @@
};
00E356F71AD99517003FC87E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3D9BFC5F6CB18250D5885C06 /* Pods-GeekTeacherWorkTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
DEVELOPMENT_TEAM = N88J7PT4L3;
INFOPLIST_FILE = GeekTeacherWorkTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
......@@ -488,10 +844,14 @@
};
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1FA6A958EB07E37AC6A5B376 /* Pods-GeekTeacherWork.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = N88J7PT4L3;
INFOPLIST_FILE = GeekTeacherWork/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
......@@ -499,17 +859,22 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = com.geek.onlinework;
PRODUCT_NAME = GeekTeacherWork;
PROVISIONING_PROFILE_SPECIFIER = "";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 899799DC375D9A636B06CFDB /* Pods-GeekTeacherWork.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = N88J7PT4L3;
INFOPLIST_FILE = GeekTeacherWork/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
......@@ -517,14 +882,16 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = com.geek.onlinework;
PRODUCT_NAME = GeekTeacherWork;
PROVISIONING_PROFILE_SPECIFIER = "";
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
2D02E4971E0B4A5E006451C7 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 523386C03BE711C572D692D1 /* Pods-GeekTeacherWork-tvOS.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
......@@ -532,7 +899,9 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CODE_SIGN_STYLE = Manual;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = "";
ENABLE_TESTABILITY = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "GeekTeacherWork-tvOS/Info.plist";
......@@ -542,8 +911,9 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.GeekTeacherWork-tvOS";
PRODUCT_BUNDLE_IDENTIFIER = com.geek.onlinework;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.2;
......@@ -552,6 +922,7 @@
};
2D02E4981E0B4A5E006451C7 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1CEC319D5474B05EE4D2CB04 /* Pods-GeekTeacherWork-tvOS.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
......@@ -559,8 +930,10 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CODE_SIGN_STYLE = Manual;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = "";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "GeekTeacherWork-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
......@@ -569,8 +942,9 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.GeekTeacherWork-tvOS";
PRODUCT_BUNDLE_IDENTIFIER = com.geek.onlinework;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.2;
......@@ -579,6 +953,7 @@
};
2D02E4991E0B4A5E006451C7 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = B715DC2510AEBFE1DD587FA7 /* Pods-GeekTeacherWork-tvOSTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
......@@ -605,6 +980,7 @@
};
2D02E49A1E0B4A5E006451C7 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BCAFDCB6B2A4782FF3E7148C /* Pods-GeekTeacherWork-tvOSTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
......
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:GeekTeacherWork.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
//
// CACameraSessionDelegate.h
//
// Created by Christopher Cohen & Gabriel Alvarado on 1/23/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import <UIKit/UIKit.h>
@class CameraSessionView;
///Protocol Definition
@protocol CACameraSessionDelegate <NSObject>
@optional
- (void)didCaptureImage:(UIImage *)image;
@optional
- (void)didCaptureImageWithData:(NSData *)imageData;
@optional
- (void)didCloseCamera:(CameraSessionView *)camera;
@end
@interface CameraSessionView : UIView
//Delegate Property
@property (nonatomic, weak) id <CACameraSessionDelegate> delegate;
//API Functions
- (void)setTopBarColor:(UIColor *)topBarColor;
- (void)hideFlashButton;
- (void)hideCameraToggleButton;
- (void)hideDismissButton;
@end
//
// CACameraSessionDelegate.h
//
// Created by Christopher Cohen & Gabriel Alvarado on 1/23/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import "CameraSessionView.h"
#import "CaptureSessionManager.h"
#import <ImageIO/ImageIO.h>
//Custom UI classes
#import "CameraShutterButton.h"
#import "CameraToggleButton.h"
#import "CameraFlashButton.h"
#import "CameraDismissButton.h"
#import "CameraFocalReticule.h"
#import "Constants.h"
@interface CameraSessionView () <CaptureSessionManagerDelegate>
{
//Size of the UI elements variables
CGSize shutterButtonSize;
CGSize topBarSize;
CGSize barButtonItemSize;
//Variable vith the current camera being used (Rear/Front)
CameraType cameraBeingUsed;
}
//Primative Properties
@property (readwrite) BOOL animationInProgress;
@property (readwrite) BOOL cameraToggleHidden;
@property (readwrite) BOOL cameraFlashHidden;
@property (readwrite) BOOL cameraDismissHidden;
//Object References
@property (nonatomic, strong) CaptureSessionManager *captureManager;
@property (nonatomic, strong) CameraShutterButton *cameraShutter;
@property (nonatomic, strong) CameraToggleButton *cameraToggle;
@property (nonatomic, strong) CameraFlashButton *cameraFlash;
@property (nonatomic, strong) CameraDismissButton *cameraDismiss;
@property (nonatomic, strong) CameraFocalReticule *focalReticule;
@property (nonatomic, strong) UIView *topBarView;
@property (nonatomic, strong) UIColor *topBarBackgroundColor;
//Temporary/Diagnostic properties
@property (nonatomic, strong) UILabel *ISOLabel, *apertureLabel, *shutterSpeedLabel;
@end
@implementation CameraSessionView
-(void)drawRect:(CGRect)rect {
if (self) {
_animationInProgress = NO;
[self setupCaptureManager:RearFacingCamera];
cameraBeingUsed = RearFacingCamera;
[self composeInterface];
[[_captureManager captureSession] startRunning];
}
}
-(instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
return self;
}
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
return self;
}
#pragma mark - Setup
-(void)setupCaptureManager:(CameraType)camera {
// remove existing input
AVCaptureInput* currentCameraInput = [self.captureManager.captureSession.inputs objectAtIndex:0];
[self.captureManager.captureSession removeInput:currentCameraInput];
_captureManager = nil;
//Create and configure 'CaptureSessionManager' object
_captureManager = [CaptureSessionManager new];
// indicate that some changes will be made to the session
[self.captureManager.captureSession beginConfiguration];
if (_captureManager) {
//Configure
[_captureManager setDelegate:self];
[_captureManager initiateCaptureSessionForCamera:camera];
[_captureManager addStillImageOutput];
[_captureManager addVideoPreviewLayer];
[self.captureManager.captureSession commitConfiguration];
//Preview Layer setup
CGRect layerRect = self.layer.bounds;
[_captureManager.previewLayer setBounds:layerRect];
[_captureManager.previewLayer setPosition:CGPointMake(CGRectGetMidX(layerRect),CGRectGetMidY(layerRect))];
//Apply animation effect to the camera's preview layer
CATransition *applicationLoadViewIn =[CATransition animation];
[applicationLoadViewIn setDuration:0.6];
[applicationLoadViewIn setType:kCATransitionReveal];
[applicationLoadViewIn setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
[_captureManager.previewLayer addAnimation:applicationLoadViewIn forKey:kCATransitionReveal];
//Add to self.view's layer
[self.layer addSublayer:_captureManager.previewLayer];
}
}
-(void)composeInterface {
//Define adaptable sizing variables for UI elements to the right device family (iPhone or iPad)
if ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad )
{
//Declare the sizing of the UI elements for iPad
shutterButtonSize = CGSizeMake(self.bounds.size.width * 0.1, self.bounds.size.width * 0.1);
topBarSize = CGSizeMake(self.frame.size.width, self.frame.size.height * 0.06);
barButtonItemSize = CGSizeMake([[UIScreen mainScreen] bounds].size.height * 0.04, [[UIScreen mainScreen] bounds].size.height * 0.04);
} else
{
//Declare the sizing of the UI elements for iPhone
shutterButtonSize = CGSizeMake(80, 80);
topBarSize = CGSizeMake(self.frame.size.width, 40);
barButtonItemSize = CGSizeMake(35, 35);
}
//Create shutter button
_cameraShutter = [CameraShutterButton new];
if (_captureManager) {
//Button Visual attribution
_cameraShutter.frame = (CGRect){0,0, shutterButtonSize};
_cameraShutter.center = CGPointMake(self.frame.size.width/2, self.frame.size.height*0.875);
_cameraShutter.tag = ShutterButtonTag;
_cameraShutter.backgroundColor = [UIColor clearColor];
//Button target
[_cameraShutter addTarget:self action:@selector(inputManager:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:_cameraShutter];
}
//Create the top bar and add the buttons to it
_topBarView = [UIView new];
if (_topBarView) {
//Setup visual attribution for bar
_topBarView.frame = (CGRect){0,0, topBarSize};
_topBarView.backgroundColor = _topBarBackgroundColor == nil ? [UIColor colorWithRed: 0.176 green: 0.478 blue: 0.529 alpha: 0.64] : _topBarBackgroundColor;
[self addSubview:_topBarView];
//Add the flash button
_cameraFlash = [CameraFlashButton new];
_cameraFlash.hidden = _cameraFlashHidden;
if (_cameraFlash) {
_cameraFlash.frame = (CGRect){0,0, barButtonItemSize};
_cameraFlash.center = CGPointMake(_topBarView.center.x * 0.80, _topBarView.center.y);
_cameraFlash.tag = FlashButtonTag;
if ( UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad ) [_topBarView addSubview:_cameraFlash];
}
//Add the camera toggle button
_cameraToggle = [CameraToggleButton new];
_cameraToggle.hidden = _cameraToggleHidden;
if (_cameraToggle) {
_cameraToggle.frame = (CGRect){0,0, barButtonItemSize};
_cameraToggle.center = CGPointMake(_topBarView.center.x * 1.20, _topBarView.center.y);
_cameraToggle.tag = ToggleButtonTag;
[_topBarView addSubview:_cameraToggle];
}
//Add the camera dismiss button
_cameraDismiss = [CameraDismissButton new];
_cameraDismiss.hidden = _cameraDismissHidden;
if (_cameraDismiss) {
_cameraDismiss.frame = (CGRect){0,0, barButtonItemSize};
_cameraDismiss.center = CGPointMake(20, _topBarView.center.y);
_cameraDismiss.tag = DismissButtonTag;
[_topBarView addSubview:_cameraDismiss];
}
//Attribute and configure all buttons in the bar's subview
for (UIButton *button in _topBarView.subviews) {
button.backgroundColor = [UIColor clearColor];
[button addTarget:self action:@selector(inputManager:) forControlEvents:UIControlEventTouchUpInside];
}
}
//Create the focus reticule UIView
_focalReticule = [CameraFocalReticule new];
if (_focalReticule) {
_focalReticule.frame = (CGRect){0,0, 60, 60};
_focalReticule.backgroundColor = [UIColor clearColor];
_focalReticule.hidden = YES;
[self addSubview:_focalReticule];
}
//Create the gesture recognizer for the focus tap
UITapGestureRecognizer *singleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(focusGesture:)];
if (singleTapGestureRecognizer) [self addGestureRecognizer:singleTapGestureRecognizer];
}
#pragma mark - User Interaction
-(void)inputManager:(id)sender {
//If animation is in progress, ignore input
if (_animationInProgress) return;
//If sender does not inherit from 'UIButton', return
if (![sender isKindOfClass:[UIButton class]]) return;
//Input manager switch
switch ([(UIButton *)sender tag]) {
case ShutterButtonTag: [self onTapShutterButton]; return;
case ToggleButtonTag: [self onTapToggleButton]; return;
case FlashButtonTag: [self onTapFlashButton]; return;
case DismissButtonTag: [self onTapDismissButton]; return;
}
}
- (void)onTapShutterButton {
//Animate shutter release
[self animateShutterRelease];
//Capture image from camera
[_captureManager captureStillImage];
}
- (void)onTapFlashButton {
BOOL enable = !self.captureManager.isTorchEnabled;
self.captureManager.enableTorch = enable;
}
- (void)onTapToggleButton {
if (cameraBeingUsed == RearFacingCamera) {
[self setupCaptureManager:FrontFacingCamera];
cameraBeingUsed = FrontFacingCamera;
[self composeInterface];
[[_captureManager captureSession] startRunning];
_cameraFlash.hidden = YES;
} else {
[self setupCaptureManager:RearFacingCamera];
cameraBeingUsed = RearFacingCamera;
[self composeInterface];
[[_captureManager captureSession] startRunning];
_cameraFlash.hidden = NO;
}
}
- (void)onTapDismissButton {
[self.captureManager stop];
if (self.delegate && [self.delegate respondsToSelector:@selector(didCloseCamera:)]) {
[self.delegate didCloseCamera:self];
}
}
- (void)focusGesture:(id)sender {
if ([sender isKindOfClass:[UITapGestureRecognizer class]]) {
UITapGestureRecognizer *tap = sender;
if (tap.state == UIGestureRecognizerStateRecognized) {
CGPoint location = [sender locationInView:self];
[self focusAtPoint:location completionHandler:^{
[self animateFocusReticuleToPoint:location];
}];
}
}
}
#pragma mark - Animation
- (void)animateShutterRelease {
_animationInProgress = YES; //Disables input manager
[UIView animateWithDuration:.1 animations:^{
self->_cameraShutter.transform = CGAffineTransformMakeScale(1.25, 1.25);
} completion:^(BOOL finished) {
[UIView animateWithDuration:.1 animations:^{
self->_cameraShutter.transform = CGAffineTransformMakeScale(1, 1);
} completion:^(BOOL finished) {
self->_animationInProgress = NO; //Enables input manager
}];
}];
}
- (void)animateFocusReticuleToPoint:(CGPoint)targetPoint
{
_animationInProgress = YES; //Disables input manager
[self.focalReticule setCenter:targetPoint];
self.focalReticule.alpha = 0.0;
self.focalReticule.hidden = NO;
[UIView animateWithDuration:0.4 animations:^{
self.focalReticule.alpha = 1.0;
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.4 animations:^{
self.focalReticule.alpha = 0.0;
}completion:^(BOOL finished) {
self->_animationInProgress = NO; //Enables input manager
}];
}];
}
#pragma mark - Camera Session Manager Delegate Methods
-(void)cameraSessionManagerDidCaptureImage
{
if (self.delegate)
{
if ([self.delegate respondsToSelector:@selector(didCaptureImage:)])
[self.delegate didCaptureImage:[[self captureManager] stillImage]];
if ([self.delegate respondsToSelector:@selector(didCaptureImageWithData:)])
[self.delegate didCaptureImageWithData:[[self captureManager] stillImageData]];
}
}
-(void)cameraSessionManagerFailedToCaptureImage {
}
-(void)cameraSessionManagerDidReportAvailability:(BOOL)deviceAvailability forCameraType:(CameraType)cameraType {
}
-(void)cameraSessionManagerDidReportDeviceStatistics:(CameraStatistics)deviceStatistics {
}
#pragma mark - Helper Methods
- (void)focusAtPoint:(CGPoint)point completionHandler:(void(^)(void))completionHandler
{
AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];;
CGPoint pointOfInterest = CGPointZero;
CGSize frameSize = self.bounds.size;
pointOfInterest = CGPointMake(point.y / frameSize.height, 1.f - (point.x / frameSize.width));
if ([device isFocusPointOfInterestSupported] && [device isFocusModeSupported:AVCaptureFocusModeAutoFocus]) {
//Lock camera for configuration if possible
NSError *error;
if ([device lockForConfiguration:&error]) {
if ([device isWhiteBalanceModeSupported:AVCaptureWhiteBalanceModeAutoWhiteBalance]) {
[device setWhiteBalanceMode:AVCaptureWhiteBalanceModeAutoWhiteBalance];
}
if ([device isFocusModeSupported:AVCaptureFocusModeContinuousAutoFocus]) {
[device setFocusMode:AVCaptureFocusModeAutoFocus];
[device setFocusPointOfInterest:pointOfInterest];
}
if([device isExposurePointOfInterestSupported] && [device isExposureModeSupported:AVCaptureExposureModeContinuousAutoExposure]) {
[device setExposurePointOfInterest:pointOfInterest];
[device setExposureMode:AVCaptureExposureModeContinuousAutoExposure];
}
[device unlockForConfiguration];
completionHandler();
}
}
else { completionHandler(); }
}
#pragma mark - API Functions
- (void)setTopBarColor:(UIColor *)topBarColor
{
_topBarBackgroundColor = topBarColor;
}
- (void)hideFlashButton
{
_cameraFlashHidden = YES;
}
- (void)hideCameraToggleButton
{
_cameraToggleHidden = YES;
}
- (void)hideDismissButton
{
_cameraDismissHidden = YES;
}
@end
//
// CameraDismissButton.h
// CameraWithAVFoundation
//
// Created by Gabriel Alvarado on 1/24/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CameraDismissButton : UIButton
@end
//
// CameraDismissButton.m
// CameraWithAVFoundation
//
// Created by Gabriel Alvarado on 1/24/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import "CameraDismissButton.h"
#import "CameraStyleKitClass.h"
@implementation CameraDismissButton
- (void)drawRect:(CGRect)rect {
[CameraStyleKitClass drawCameraDismissWithFrame:self.bounds];
}
@end
//
// CameraFlashButton.h
// CameraWithAVFoundation
//
// Created by Gabriel Alvarado on 1/24/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CameraFlashButton : UIButton
@end
//
// CameraFlashButton.m
// CameraWithAVFoundation
//
// Created by Gabriel Alvarado on 1/24/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import "CameraFlashButton.h"
#import "CameraStyleKitClass.h"
@implementation CameraFlashButton
- (void)drawRect:(CGRect)rect {
[CameraStyleKitClass drawCameraFlashWithFrame:self.bounds];
}
@end
//
// CameraFocusIndicator.h
// CameraWithAVFoundation
//
// Created by Gabriel Alvarado on 1/25/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CameraFocalReticule : UIView
@end
//
// CameraFocusIndicator.m
// CameraWithAVFoundation
//
// Created by Gabriel Alvarado on 1/25/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import "CameraFocalReticule.h"
#import "CameraStyleKitClass.h"
@implementation CameraFocalReticule
- (void)drawRect:(CGRect)rect {
[CameraStyleKitClass drawCameraFocusWithFrame:self.bounds];
}
@end
//
// CameraShutterButton.h
// CameraWithAVFoundation
//
// Created by Gabriel Alvarado on 1/24/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CameraShutterButton : UIButton
@end
//
// CameraShutterButton.m
// CameraWithAVFoundation
//
// Created by Gabriel Alvarado on 1/24/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import "CameraShutterButton.h"
#import "CameraStyleKitClass.h"
@implementation CameraShutterButton
- (void)drawRect:(CGRect)rect {
[CameraStyleKitClass drawCameraShutterWithFrame:self.bounds];
}
@end
//
// CameraToggleButton.h
// CameraWithAVFoundation
//
// Created by Gabriel Alvarado on 1/24/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CameraToggleButton : UIButton
@end
//
// CameraToggleButton.m
// CameraWithAVFoundation
//
// Created by Gabriel Alvarado on 1/24/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import "CameraToggleButton.h"
#import "CameraStyleKitClass.h"
@implementation CameraToggleButton
- (void)drawRect:(CGRect)rect {
[CameraStyleKitClass drawCameraToggleWithFrame:self.bounds];
}
@end
//
// LaunchCameraButton.h
// CameraWithAVFoundation
//
// Created by Gabriel Alvarado on 2/18/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LaunchCameraButton : UIButton
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
@end
//
// LaunchCameraButton.m
// CameraWithAVFoundation
//
// Created by Gabriel Alvarado on 2/18/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import "LaunchCameraButton.h"
#import "CameraStyleKitClass.h"
@interface LaunchCameraButton ()
@property BOOL isPressed;
@end
@implementation LaunchCameraButton
- (void)drawRect:(CGRect)rect
{
[CameraStyleKitClass drawLaunchCameraWithFrame:self.bounds pressed:self.isPressed];
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
self.isPressed = YES;
[self setNeedsDisplay];
[super touchesBegan:touches withEvent:event];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
self.isPressed = NO;
[self setNeedsDisplay];
[super touchesEnded:touches withEvent:event];
}
@end
//
// CameraStyleKitClass.h
// iOS Cam
//
// Created by Gabriel Alvarado on 2/22/15.
// Copyright (c) 2015 CompanyName. All rights reserved.
//
// Generated by PaintCode (www.paintcodeapp.com)
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface CameraStyleKitClass : NSObject
// Drawing Methods
+ (void)drawCameraShutterWithFrame: (CGRect)frame;
+ (void)drawCameraFlashWithFrame: (CGRect)frame;
+ (void)drawCameraToggleWithFrame: (CGRect)frame;
+ (void)drawCameraDismissWithFrame: (CGRect)frame;
+ (void)drawCameraTopBarWithFrame: (CGRect)frame;
+ (void)drawCameraFocusWithFrame: (CGRect)frame;
+ (void)drawLaunchCameraWithFrame: (CGRect)frame pressed: (BOOL)pressed;
@end
//
// CameraStyleKitClass.m
// iOS Cam
//
// Created by Gabriel Alvarado on 2/22/15.
// Copyright (c) 2015 CompanyName. All rights reserved.
//
// Generated by PaintCode (www.paintcodeapp.com)
//
#import "CameraStyleKitClass.h"
@implementation CameraStyleKitClass
#pragma mark Initialization
+ (void)initialize
{
}
#pragma mark Drawing Methods
+ (void)drawCameraShutterWithFrame: (CGRect)frame
{
//// General Declarations
CGContextRef context = UIGraphicsGetCurrentContext();
//// Color Declarations
UIColor* color0 = [UIColor colorWithRed: 1 green: 1 blue: 1 alpha: 1];
UIColor* color1 = [UIColor colorWithRed: 0.812 green: 0.812 blue: 0.812 alpha: 0.62];
//// Subframes
CGRect page1 = CGRectMake(CGRectGetMinX(frame) + floor(CGRectGetWidth(frame) * 0.03691 + 0.12) + 0.38, CGRectGetMinY(frame) + floor(CGRectGetHeight(frame) * 0.03466 + 0.43) + 0.07, floor(CGRectGetWidth(frame) * 0.96691 + 0.12) - floor(CGRectGetWidth(frame) * 0.03691 + 0.12), floor(CGRectGetHeight(frame) * 0.96466 + 0.43) - floor(CGRectGetHeight(frame) * 0.03466 + 0.43));
//// Page-1
{
//// Portrait
{
CGContextSaveGState(context);
CGContextSetAlpha(context, 0.62);
CGContextBeginTransparencyLayer(context, NULL);
//// CameraShutterVector Drawing
UIBezierPath* cameraShutterVectorPath = [UIBezierPath bezierPathWithOvalInRect: CGRectMake(CGRectGetMinX(page1) + floor(CGRectGetWidth(page1) * 0.00000 + 0.5), CGRectGetMinY(page1) + floor(CGRectGetHeight(page1) * 0.00000 + 0.5), floor(CGRectGetWidth(page1) * 1.00000 + 0.5) - floor(CGRectGetWidth(page1) * 0.00000 + 0.5), floor(CGRectGetHeight(page1) * 1.00000 + 0.5) - floor(CGRectGetHeight(page1) * 0.00000 + 0.5))];
[color1 setFill];
[cameraShutterVectorPath fill];
[color0 setStroke];
cameraShutterVectorPath.lineWidth = 3;
[cameraShutterVectorPath stroke];
CGContextEndTransparencyLayer(context);
CGContextRestoreGState(context);
}
}
}
+ (void)drawCameraFlashWithFrame: (CGRect)frame
{
//// General Declarations
CGContextRef context = UIGraphicsGetCurrentContext();
//// Color Declarations
UIColor* color = [UIColor colorWithRed: 1 green: 1 blue: 1 alpha: 1];
//// Subframes
CGRect page1 = CGRectMake(CGRectGetMinX(frame) + floor(CGRectGetWidth(frame) * 0.16636 + 0.23) + 0.27, CGRectGetMinY(frame) + floor(CGRectGetHeight(frame) * 0.03852 + 0.2) + 0.3, floor(CGRectGetWidth(frame) * 0.83136 + 0.23) - floor(CGRectGetWidth(frame) * 0.16636 + 0.23), floor(CGRectGetHeight(frame) * 0.96352 + 0.2) - floor(CGRectGetHeight(frame) * 0.03852 + 0.2));
//// Page-1
{
//// Portrait
{
CGContextSaveGState(context);
CGContextSetAlpha(context, 0.8);
CGContextBeginTransparencyLayer(context, NULL);
//// FlashVector Drawing
UIBezierPath* flashVectorPath = UIBezierPath.bezierPath;
[flashVectorPath moveToPoint: CGPointMake(CGRectGetMinX(page1) + 1.00000 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.00000 * CGRectGetHeight(page1))];
[flashVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.17944 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.45268 * CGRectGetHeight(page1))];
[flashVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.45896 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.55598 * CGRectGetHeight(page1))];
[flashVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.00000 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 1.00000 * CGRectGetHeight(page1))];
[flashVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.90397 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.55854 * CGRectGetHeight(page1))];
[flashVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.64845 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.45124 * CGRectGetHeight(page1))];
[flashVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 1.00000 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.00000 * CGRectGetHeight(page1))];
[flashVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 1.00000 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.00000 * CGRectGetHeight(page1))];
[flashVectorPath closePath];
flashVectorPath.miterLimit = 4;
flashVectorPath.usesEvenOddFillRule = YES;
[color setFill];
[flashVectorPath fill];
CGContextEndTransparencyLayer(context);
CGContextRestoreGState(context);
}
}
}
+ (void)drawCameraToggleWithFrame: (CGRect)frame
{
//// General Declarations
CGContextRef context = UIGraphicsGetCurrentContext();
//// Color Declarations
UIColor* color2 = [UIColor colorWithRed: 1 green: 1 blue: 1 alpha: 1];
//// Subframes
CGRect page1 = CGRectMake(CGRectGetMinX(frame) + floor(CGRectGetWidth(frame) * 0.02908 - 0.32) + 0.82, CGRectGetMinY(frame) + floor(CGRectGetHeight(frame) * 0.01817 + 0.13) + 0.37, floor(CGRectGetWidth(frame) * 0.97408 - 0.32) - floor(CGRectGetWidth(frame) * 0.02908 - 0.32), floor(CGRectGetHeight(frame) * 0.98317 + 0.13) - floor(CGRectGetHeight(frame) * 0.01817 + 0.13));
//// Page-1
{
//// Portrait
{
CGContextSaveGState(context);
CGContextSetAlpha(context, 0.8);
CGContextBeginTransparencyLayer(context, NULL);
//// CameraToggleVector Drawing
UIBezierPath* cameraToggleVectorPath = UIBezierPath.bezierPath;
[cameraToggleVectorPath moveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.78093 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.29844 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.71159 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.23289 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.78093 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.26224 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.74989 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.23289 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.28882 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.23289 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.21947 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.29844 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.25052 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.23289 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.21947 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.26224 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.21947 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.69811 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.28882 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.76367 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.21947 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.73432 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.25052 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.76367 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.71159 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.76367 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.78093 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.69811 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.74989 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.76367 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.78093 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.73432 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.78093 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.29844 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.78093 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.29844 * CGRectGetHeight(page1))];
[cameraToggleVectorPath closePath];
[cameraToggleVectorPath moveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.50025 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.35839 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.64822 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.49827 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.58197 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.35839 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.64822 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.42102 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.50025 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.63816 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.64822 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.57553 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.58197 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.63816 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.35229 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.49827 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.41853 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.63816 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.35229 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.57553 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.50025 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.35839 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.35229 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.42102 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.41853 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.35839 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.50025 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.35839 * CGRectGetHeight(page1))];
[cameraToggleVectorPath closePath];
[cameraToggleVectorPath moveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.50025 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.39265 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.61199 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.49828 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.56196 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.39265 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.61199 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.43994 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.50025 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.60391 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.61199 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.55662 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.56196 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.60391 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.38852 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.49828 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.43854 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.60391 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.38852 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.55662 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.50025 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.39265 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.38852 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.43994 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.43854 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.39265 * CGRectGetHeight(page1))];
[cameraToggleVectorPath closePath];
[cameraToggleVectorPath moveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.44509 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 1.00000 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.55331 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.93945 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.46313 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 1.00000 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.55331 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.95963 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.44509 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.87890 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.55331 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.91927 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.46313 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.87890 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.44509 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.93945 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.43560 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.87890 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.44509 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.91927 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.44509 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 1.00000 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.44509 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.95963 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.43560 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 1.00000 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.44509 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 1.00000 * CGRectGetHeight(page1))];
[cameraToggleVectorPath closePath];
[cameraToggleVectorPath moveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.54376 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.96935 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.56951 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.94150 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.55898 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.95916 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.56951 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.94915 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.53831 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.91011 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.56951 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.93296 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.55641 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.92149 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.93710 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.49845 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.76177 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.89176 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.93710 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.71446 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.80324 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.20083 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.93710 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.38156 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.88576 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.27600 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.56357 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.08956 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.73905 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.14237 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.65600 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.10229 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.56113 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.06055 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.56233 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.07897 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.56113 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.06849 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.56380 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.02956 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.56113 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.05211 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.56248 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.04081 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 1.00000 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.49845 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.80982 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.05919 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 1.00000 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.25782 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.54376 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.96936 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 1.00000 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.74557 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.79941 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.94839 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.54376 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.96935 * CGRectGetHeight(page1))];
[cameraToggleVectorPath closePath];
[cameraToggleVectorPath moveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.43424 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.96708 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.00000 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.49844 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.18917 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.93664 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.00000 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.73843 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.46250 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.02706 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.00000 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.24931 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.20387 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.04519 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.42790 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.06054 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.44266 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.03911 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.42790 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.05148 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.45250 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.08762 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.42790 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.06800 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.43790 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.07770 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.06290 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.49844 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.23344 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.11001 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.06290 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.28540 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.43318 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.90687 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.06290 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.70518 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.22349 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.87646 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.43628 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.94150 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.43462 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.91929 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.43628 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.93215 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.43424 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.96708 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.43628 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.94858 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.43533 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.95769 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.43424 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.96708 * CGRectGetHeight(page1))];
[cameraToggleVectorPath closePath];
[cameraToggleVectorPath moveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.54911 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.12110 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.44090 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.06055 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.53107 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.12110 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.44090 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.08073 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.54911 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.00000 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.44090 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.04037 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.53107 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.00000 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.54911 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.06055 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.55860 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.00000 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.54911 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.04037 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.54911 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.12110 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.54911 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.08073 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.55860 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.12110 * CGRectGetHeight(page1))];
[cameraToggleVectorPath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.54911 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.12110 * CGRectGetHeight(page1))];
[cameraToggleVectorPath closePath];
cameraToggleVectorPath.miterLimit = 4;
cameraToggleVectorPath.usesEvenOddFillRule = YES;
[color2 setFill];
[cameraToggleVectorPath fill];
CGContextEndTransparencyLayer(context);
CGContextRestoreGState(context);
}
}
}
+ (void)drawCameraDismissWithFrame: (CGRect)frame
{
//// General Declarations
CGContextRef context = UIGraphicsGetCurrentContext();
//// Color Declarations
UIColor* color3 = [UIColor colorWithRed: 1 green: 1 blue: 1 alpha: 1];
//// Subframes
CGRect page1 = CGRectMake(CGRectGetMinX(frame) + floor(CGRectGetWidth(frame) * 0.07703 + 0.09) + 0.41, CGRectGetMinY(frame) + floor(CGRectGetHeight(frame) * 0.07659 + 0.5) + 0, floor(CGRectGetWidth(frame) * 0.92543 + 0.41) - floor(CGRectGetWidth(frame) * 0.07703 + 0.09) - 0.32, floor(CGRectGetHeight(frame) * 0.92499 - 0.18) - floor(CGRectGetHeight(frame) * 0.07659 + 0.5) + 0.68);
//// Page-1
{
//// Portrait
{
CGContextSaveGState(context);
CGContextSetAlpha(context, 0.8);
CGContextBeginTransparencyLayer(context, NULL);
//// Shape Drawing
UIBezierPath* shapePath = UIBezierPath.bezierPath;
[shapePath moveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.00789 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.13838 * CGRectGetHeight(page1))];
[shapePath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.32328 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.45377 * CGRectGetHeight(page1))];
[shapePath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.32225 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.55004 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.37044 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.50178 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.36996 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.50197 * CGRectGetHeight(page1))];
[shapePath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.00000 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.87228 * CGRectGetHeight(page1))];
[shapePath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.12772 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 1.00000 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.03587 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.92109 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.07891 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.96413 * CGRectGetHeight(page1))];
[shapePath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.44996 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.67775 * CGRectGetHeight(page1))];
[shapePath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.54623 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.67672 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.49833 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.62970 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.49837 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.62962 * CGRectGetHeight(page1))];
[shapePath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.86162 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.99211 * CGRectGetHeight(page1))];
[shapePath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.99211 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.86162 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.91121 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.95519 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.95519 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.91121 * CGRectGetHeight(page1))];
[shapePath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.67672 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.54623 * CGRectGetHeight(page1))];
[shapePath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.67775 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.44996 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.62944 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.49883 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.62919 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.49872 * CGRectGetHeight(page1))];
[shapePath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 1.00000 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.12772 * CGRectGetHeight(page1))];
[shapePath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.87228 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.00000 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.96413 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.07891 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.92109 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.03587 * CGRectGetHeight(page1))];
[shapePath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.55004 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.32225 * CGRectGetHeight(page1))];
[shapePath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.45377 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.32328 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.50206 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.37032 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.50186 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.37051 * CGRectGetHeight(page1))];
[shapePath addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.13838 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.00789 * CGRectGetHeight(page1))];
[shapePath addCurveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.00789 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.13838 * CGRectGetHeight(page1)) controlPoint1: CGPointMake(CGRectGetMinX(page1) + 0.08879 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.04481 * CGRectGetHeight(page1)) controlPoint2: CGPointMake(CGRectGetMinX(page1) + 0.04481 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.08879 * CGRectGetHeight(page1))];
[shapePath closePath];
shapePath.miterLimit = 4;
shapePath.usesEvenOddFillRule = YES;
[color3 setFill];
[shapePath fill];
CGContextEndTransparencyLayer(context);
CGContextRestoreGState(context);
}
}
}
+ (void)drawCameraTopBarWithFrame: (CGRect)frame
{
//// General Declarations
CGContextRef context = UIGraphicsGetCurrentContext();
//// Color Declarations
UIColor* color4 = [UIColor colorWithRed: 0.176 green: 0.478 blue: 0.529 alpha: 0.64];
//// Subframes
CGRect page1 = CGRectMake(CGRectGetMinX(frame) + floor(CGRectGetWidth(frame) * 0.00000 + 0.5), CGRectGetMinY(frame) + floor(CGRectGetHeight(frame) * -0.00176 + 0.15) + 0.35, floor(CGRectGetWidth(frame) * 1.00000 + 0.5) - floor(CGRectGetWidth(frame) * 0.00000 + 0.5), floor(CGRectGetHeight(frame) * 0.99824 + 0.15) - floor(CGRectGetHeight(frame) * -0.00176 + 0.15));
//// Page-1
{
//// Portrait
{
CGContextSaveGState(context);
CGContextSetAlpha(context, 0.64);
CGContextBeginTransparencyLayer(context, NULL);
//// TopBar Drawing
UIBezierPath* topBarPath = [UIBezierPath bezierPathWithRect: CGRectMake(CGRectGetMinX(page1) + floor(CGRectGetWidth(page1) * 0.00000 + 0.5), CGRectGetMinY(page1) + floor(CGRectGetHeight(page1) * 0.00000 + 0.5), floor(CGRectGetWidth(page1) * 1.00000 + 0.5) - floor(CGRectGetWidth(page1) * 0.00000 + 0.5), floor(CGRectGetHeight(page1) * 1.00000 + 0.5) - floor(CGRectGetHeight(page1) * 0.00000 + 0.5))];
[color4 setFill];
[topBarPath fill];
CGContextEndTransparencyLayer(context);
CGContextRestoreGState(context);
}
}
}
+ (void)drawCameraFocusWithFrame: (CGRect)frame
{
//// Color Declarations
UIColor* color0 = [UIColor colorWithRed: 1 green: 1 blue: 1 alpha: 1];
UIColor* color6 = [UIColor colorWithRed: 0.521 green: 0.521 blue: 0.521 alpha: 1];
//// Subframes
CGRect page1 = CGRectMake(CGRectGetMinX(frame) + floor(CGRectGetWidth(frame) * 0.03763 - 0.03) + 0.53, CGRectGetMinY(frame) + floor(CGRectGetHeight(frame) * 0.03815 + 0.13) + 0.37, floor(CGRectGetWidth(frame) * 0.96263 - 0.03) - floor(CGRectGetWidth(frame) * 0.03763 - 0.03), floor(CGRectGetHeight(frame) * 0.96315 + 0.13) - floor(CGRectGetHeight(frame) * 0.03815 + 0.13));
//// Page-1
{
//// Portrait
{
//// Group 4
{
//// Rectangle-6 Drawing
UIBezierPath* rectangle6Path = [UIBezierPath bezierPathWithRect: CGRectMake(CGRectGetMinX(page1) + floor(CGRectGetWidth(page1) * 0.00000 + 0.5), CGRectGetMinY(page1) + floor(CGRectGetHeight(page1) * 0.00000 + 0.5), floor(CGRectGetWidth(page1) * 1.00000 + 0.5) - floor(CGRectGetWidth(page1) * 0.00000 + 0.5), floor(CGRectGetHeight(page1) * 1.00000 + 0.5) - floor(CGRectGetHeight(page1) * 0.00000 + 0.5))];
[color6 setStroke];
rectangle6Path.lineWidth = 3;
[rectangle6Path stroke];
//// Rectangle-2 Drawing
UIBezierPath* rectangle2Path = UIBezierPath.bezierPath;
[rectangle2Path moveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.10711 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.06860 * CGRectGetHeight(page1))];
[rectangle2Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.89268 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.06860 * CGRectGetHeight(page1))];
[rectangle2Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.83737 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.12403 * CGRectGetHeight(page1))];
[rectangle2Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.16245 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.12403 * CGRectGetHeight(page1))];
[rectangle2Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.10711 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.06860 * CGRectGetHeight(page1))];
[rectangle2Path closePath];
rectangle2Path.miterLimit = 4;
rectangle2Path.usesEvenOddFillRule = YES;
[color0 setFill];
[rectangle2Path fill];
//// Rectangle-4 Drawing
UIBezierPath* rectangle4Path = UIBezierPath.bezierPath;
[rectangle4Path moveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.93140 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.10715 * CGRectGetHeight(page1))];
[rectangle4Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.93140 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.89279 * CGRectGetHeight(page1))];
[rectangle4Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.87597 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.83746 * CGRectGetHeight(page1))];
[rectangle4Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.87597 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.16255 * CGRectGetHeight(page1))];
[rectangle4Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.93140 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.10715 * CGRectGetHeight(page1))];
[rectangle4Path closePath];
rectangle4Path.miterLimit = 4;
rectangle4Path.usesEvenOddFillRule = YES;
[color0 setFill];
[rectangle4Path fill];
//// Rectangle-8 Drawing
UIBezierPath* rectangle8Path = UIBezierPath.bezierPath;
[rectangle8Path moveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.06860 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.89279 * CGRectGetHeight(page1))];
[rectangle8Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.06860 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.10717 * CGRectGetHeight(page1))];
[rectangle8Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.12403 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.16274 * CGRectGetHeight(page1))];
[rectangle8Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.12403 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.83738 * CGRectGetHeight(page1))];
[rectangle8Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.06860 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.89279 * CGRectGetHeight(page1))];
[rectangle8Path closePath];
rectangle8Path.miterLimit = 4;
rectangle8Path.usesEvenOddFillRule = YES;
[color0 setFill];
[rectangle8Path fill];
//// Rectangle-5 Drawing
UIBezierPath* rectangle5Path = UIBezierPath.bezierPath;
[rectangle5Path moveToPoint: CGPointMake(CGRectGetMinX(page1) + 0.89293 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.93140 * CGRectGetHeight(page1))];
[rectangle5Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.10727 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.93140 * CGRectGetHeight(page1))];
[rectangle5Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.16282 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.87597 * CGRectGetHeight(page1))];
[rectangle5Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.83743 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.87597 * CGRectGetHeight(page1))];
[rectangle5Path addLineToPoint: CGPointMake(CGRectGetMinX(page1) + 0.89293 * CGRectGetWidth(page1), CGRectGetMinY(page1) + 0.93140 * CGRectGetHeight(page1))];
[rectangle5Path closePath];
rectangle5Path.miterLimit = 4;
rectangle5Path.usesEvenOddFillRule = YES;
[color0 setFill];
[rectangle5Path fill];
}
}
}
}
+ (void)drawLaunchCameraWithFrame: (CGRect)frame pressed: (BOOL)pressed
{
//// General Declarations
CGContextRef context = UIGraphicsGetCurrentContext();
//// Color Declarations
UIColor* color0 = [UIColor colorWithRed: 1 green: 1 blue: 1 alpha: 1];
UIColor* color6 = [UIColor colorWithRed: 0.521 green: 0.521 blue: 0.521 alpha: 1];
UIColor* color7 = [UIColor colorWithRed: 0.69 green: 0.769 blue: 0.871 alpha: 0.78];
UIColor* color8 = [UIColor colorWithRed: 0.225 green: 0.225 blue: 0.225 alpha: 1];
//// Subframes
CGRect page1 = CGRectMake(CGRectGetMinX(frame) + 9, CGRectGetMinY(frame) + 9.97, floor((CGRectGetWidth(frame) - 9) * 1.28692 + 0.5), floor((CGRectGetHeight(frame) - 9.97) * 0.88715 + 10.44) - 9.94);
CGRect page2 = CGRectMake(CGRectGetMinX(frame) + 9, CGRectGetMinY(frame) + 9.97, floor((CGRectGetWidth(frame) - 9) * 1.28692 + 0.5), floor((CGRectGetHeight(frame) - 9.97) * 0.88715 + 10.44) - 9.94);
//// Page-1
{
//// Artboard-1
{
//// Rectangle-1-+-Launch-Camera 2
{
//// Rectangle-1 Drawing
UIBezierPath* rectangle1Path = [UIBezierPath bezierPathWithRoundedRect: CGRectMake(CGRectGetMinX(page1) + floor(CGRectGetWidth(page1) * 0.00000 + 0.5), CGRectGetMinY(page1) + floor(CGRectGetHeight(page1) * 0.00000 + 0.5), floor(CGRectGetWidth(page1) * 0.74754 + 0.5) - floor(CGRectGetWidth(page1) * 0.00000 + 0.5), floor(CGRectGetHeight(page1) * 1.00000 + 0.5) - floor(CGRectGetHeight(page1) * 0.00000 + 0.5)) cornerRadius: 8];
[color0 setFill];
[rectangle1Path fill];
[color6 setStroke];
rectangle1Path.lineWidth = 3;
[rectangle1Path stroke];
//// Rectangle 2 Drawing
CGRect rectangle2Rect = CGRectMake(CGRectGetMinX(page1) + floor(CGRectGetWidth(page1) * 0.14754 + 0.5), CGRectGetMinY(page1) + floor(CGRectGetHeight(page1) * 0.30592 + 0.22) + 0.28, floor(CGRectGetWidth(page1) * 1.00000 + 0.5) - floor(CGRectGetWidth(page1) * 0.14754 + 0.5), floor(CGRectGetHeight(page1) * 0.86930 + 0.22) - floor(CGRectGetHeight(page1) * 0.30592 + 0.22));
NSMutableParagraphStyle* rectangle2Style = NSMutableParagraphStyle.defaultParagraphStyle.mutableCopy;
rectangle2Style.alignment = NSTextAlignmentLeft;
NSDictionary* rectangle2FontAttributes = @{NSFontAttributeName: [UIFont fontWithName: @"HelveticaNeue-Light" size: 20], NSForegroundColorAttributeName: color8, NSParagraphStyleAttributeName: rectangle2Style};
[@"Launch Camera" drawInRect: rectangle2Rect withAttributes: rectangle2FontAttributes];
}
}
}
//// Page-
{
CGContextSaveGState(context);
CGContextTranslateCTM(context, CGRectGetMinX(frame) + 9.5, CGRectGetMinY(frame) + 9.5);
//// Artboard-
{
CGContextSaveGState(context);
CGContextTranslateCTM(context, 2, 2);
//// Rectangle-1-+-Launch-Camera 3
{
}
CGContextRestoreGState(context);
}
CGContextRestoreGState(context);
}
if (pressed)
{
//// Page- 2
{
//// Artboard- 2
{
//// Rectangle-1-+-Launch-Camera 4
{
//// Rectangle- Drawing
UIBezierPath* rectanglePath = [UIBezierPath bezierPathWithRoundedRect: CGRectMake(CGRectGetMinX(page2) + floor(CGRectGetWidth(page2) * 0.00000 + 0.5), CGRectGetMinY(page2) + floor(CGRectGetHeight(page2) * 0.00000 + 0.5), floor(CGRectGetWidth(page2) * 0.74754 + 0.5) - floor(CGRectGetWidth(page2) * 0.00000 + 0.5), floor(CGRectGetHeight(page2) * 1.00000 + 0.5) - floor(CGRectGetHeight(page2) * 0.00000 + 0.5)) cornerRadius: 8];
[color7 setFill];
[rectanglePath fill];
[color7 setStroke];
rectanglePath.lineWidth = 3;
[rectanglePath stroke];
//// Rectangle 3 Drawing
CGRect rectangle3Rect = CGRectMake(CGRectGetMinX(page2) + floor(CGRectGetWidth(page2) * 0.14754 + 0.5), CGRectGetMinY(page2) + floor(CGRectGetHeight(page2) * 0.30592 + 0.22) + 0.28, floor(CGRectGetWidth(page2) * 1.00000 + 0.5) - floor(CGRectGetWidth(page2) * 0.14754 + 0.5), floor(CGRectGetHeight(page2) * 0.86930 + 0.22) - floor(CGRectGetHeight(page2) * 0.30592 + 0.22));
NSMutableParagraphStyle* rectangle3Style = NSMutableParagraphStyle.defaultParagraphStyle.mutableCopy;
rectangle3Style.alignment = NSTextAlignmentLeft;
NSDictionary* rectangle3FontAttributes = @{NSFontAttributeName: [UIFont fontWithName: @"HelveticaNeue-Light" size: 20], NSForegroundColorAttributeName: color0, NSParagraphStyleAttributeName: rectangle3Style};
[@"Launch Camera" drawInRect: rectangle3Rect withAttributes: rectangle3FontAttributes];
}
}
}
}
}
@end
//
// CaptureSessionManager.h
// CameraWithAVFoundation
//
// Created by Gabriel Alvarado on 4/16/14.
// Copyright (c) 2014 Gabriel Alvarado. All rights reserved.
//
#define kImageCapturedSuccessfully @"imageCapturedSuccessfully"
#import "Constants.h"
#import <AVFoundation/AVFoundation.h>
#import <Foundation/Foundation.h>
///Protocol Definition
@protocol CaptureSessionManagerDelegate <NSObject>
@required - (void)cameraSessionManagerDidCaptureImage;
@required - (void)cameraSessionManagerFailedToCaptureImage;
@required - (void)cameraSessionManagerDidReportAvailability:(BOOL)deviceAvailability forCameraType:(CameraType)cameraType;
@required - (void)cameraSessionManagerDidReportDeviceStatistics:(CameraStatistics)deviceStatistics; //Report every .125 seconds
@end
@interface CaptureSessionManager : NSObject
//Weak pointers
@property (nonatomic, weak) id<CaptureSessionManagerDelegate>delegate;
@property (nonatomic, weak) AVCaptureDevice *activeCamera;
//Strong Pointers
@property (nonatomic, strong) AVCaptureVideoPreviewLayer *previewLayer;
@property (nonatomic, strong) AVCaptureSession *captureSession;
@property (nonatomic, strong) AVCaptureStillImageOutput *stillImageOutput;
@property (nonatomic, strong) UIImage *stillImage;
@property (nonatomic, strong) NSData *stillImageData;
//Primative Variables
@property (nonatomic,assign,getter=isTorchEnabled) BOOL enableTorch;
//API Methods
- (void)addStillImageOutput;
- (void)captureStillImage;
- (void)addVideoPreviewLayer;
- (void)initiateCaptureSessionForCamera:(CameraType)cameraType;
- (void)stop;
@end
//
// CaptureSessionManager.m
// CameraWithAVFoundation
//
// Created by Gabriel Alvarado on 4/16/14.
// Copyright (c) 2014 Gabriel Alvarado. All rights reserved.
//
#import "CaptureSessionManager.h"
#import <ImageIO/ImageIO.h>
@implementation CaptureSessionManager
#pragma mark Capture Session Configuration
- (id)init {
if ((self = [super init])) {
[self setCaptureSession:[[AVCaptureSession alloc] init]];
_captureSession.sessionPreset = AVCaptureSessionPresetHigh;
}
return self;
}
- (void)addVideoPreviewLayer {
[self setPreviewLayer:[[AVCaptureVideoPreviewLayer alloc] initWithSession:[self captureSession]]];
[[self previewLayer] setVideoGravity:AVLayerVideoGravityResizeAspectFill];
}
- (void)initiateCaptureSessionForCamera:(CameraType)cameraType {
//Iterate through devices and assign 'active camera' per parameter
for (AVCaptureDevice *device in AVCaptureDevice.devices) if ([device hasMediaType:AVMediaTypeVideo]) {
switch (cameraType) {
case RearFacingCamera: if ([device position] == AVCaptureDevicePositionBack) _activeCamera = device; break;
case FrontFacingCamera: if ([device position] == AVCaptureDevicePositionFront) _activeCamera = device; break;
}
}
NSError *error = nil;
BOOL deviceAvailability = YES;
AVCaptureDeviceInput *cameraDeviceInput = [AVCaptureDeviceInput deviceInputWithDevice:_activeCamera error:&error];
if (!error && [[self captureSession] canAddInput:cameraDeviceInput]) [[self captureSession] addInput:cameraDeviceInput];
else deviceAvailability = NO;
//Report camera device availability
if (self.delegate) [self.delegate cameraSessionManagerDidReportAvailability:deviceAvailability forCameraType:cameraType];
// [self initiateStatisticsReportWithInterval:.125];
}
-(void)initiateStatisticsReportWithInterval:(CGFloat)interval {
__block id blockSafeSelf = self;
[[NSOperationQueue new] addOperationWithBlock:^{
do {
[NSThread sleepForTimeInterval:interval];
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
if (self.delegate) [self.delegate cameraSessionManagerDidReportDeviceStatistics:cameraStatisticsMake(_activeCamera.lensAperture, CMTimeGetSeconds(_activeCamera.exposureDuration), _activeCamera.ISO, _activeCamera.lensPosition)];
}];
} while (blockSafeSelf);
}];
}
- (void)addStillImageOutput
{
[self setStillImageOutput:[[AVCaptureStillImageOutput alloc] init]];
NSDictionary *outputSettings = [[NSDictionary alloc] initWithObjectsAndKeys:AVVideoCodecJPEG,AVVideoCodecKey,nil];
[[self stillImageOutput] setOutputSettings:outputSettings];
[self getOrientationAdaptedCaptureConnection];
[[self captureSession] addOutput:[self stillImageOutput]];
AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
if ([device isFocusModeSupported:AVCaptureFocusModeContinuousAutoFocus])
{
[device lockForConfiguration:nil];
[device setFocusMode:AVCaptureFocusModeContinuousAutoFocus];
[device unlockForConfiguration];
}
}
- (void)captureStillImage
{
AVCaptureConnection *videoConnection = [self getOrientationAdaptedCaptureConnection];
if (videoConnection) {
[[self stillImageOutput] captureStillImageAsynchronouslyFromConnection:videoConnection completionHandler:
^(CMSampleBufferRef imageSampleBuffer, NSError *error) {
CFDictionaryRef exifAttachments = CMGetAttachment(imageSampleBuffer, kCGImagePropertyExifDictionary, NULL);
if (exifAttachments) {
//Attachements Found
} else {
//No Attachments
}
NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer];
UIImage *image = [[UIImage alloc] initWithData:imageData];
[self setStillImage:image];
[self setStillImageData:imageData];
if (self.delegate)
[self.delegate cameraSessionManagerDidCaptureImage];
}];
}
//Turn off the flash if on
AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
if ([device hasTorch])
{
[device lockForConfiguration:nil];
[device setTorchMode:AVCaptureTorchModeOff];
[device unlockForConfiguration];
}
}
- (void)setEnableTorch:(BOOL)enableTorch
{
_enableTorch = enableTorch;
AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
if ([device hasTorch] && [device hasFlash])
{
[device lockForConfiguration:nil];
if (enableTorch) { [device setTorchMode:AVCaptureTorchModeOn]; }
else { [device setTorchMode:AVCaptureTorchModeOff]; }
[device unlockForConfiguration];
}
}
#pragma mark - Helper Method(s)
- (void)assignVideoOrienationForVideoConnection:(AVCaptureConnection *)videoConnection
{
AVCaptureVideoOrientation newOrientation;
// switch ([[UIDevice currentDevice] orientation]) {
// case UIDeviceOrientationPortrait:
// newOrientation = AVCaptureVideoOrientationPortrait;
// break;
// case UIDeviceOrientationPortraitUpsideDown:
// newOrientation = AVCaptureVideoOrientationPortraitUpsideDown;
// break;
// case UIDeviceOrientationLandscapeLeft:
// newOrientation = AVCaptureVideoOrientationLandscapeRight;
// break;
// case UIDeviceOrientationLandscapeRight:
// newOrientation = AVCaptureVideoOrientationLandscapeLeft;
// break;
// default:
newOrientation = AVCaptureVideoOrientationPortrait;
// }
[videoConnection setVideoOrientation: newOrientation];
}
- (AVCaptureConnection *)getOrientationAdaptedCaptureConnection
{
AVCaptureConnection *videoConnection = nil;
for (AVCaptureConnection *connection in [[self stillImageOutput] connections]) {
for (AVCaptureInputPort *port in [connection inputPorts]) {
if ([[port mediaType] isEqual:AVMediaTypeVideo] ) {
videoConnection = connection;
[self assignVideoOrienationForVideoConnection:videoConnection];
break;
}
}
if (videoConnection) {
[self assignVideoOrienationForVideoConnection:videoConnection];
break;
}
}
return videoConnection;
}
#pragma mark - Cleanup Functions
// stop the camera, otherwise it will lead to memory crashes
- (void)stop
{
[self.captureSession stopRunning];
if(self.captureSession.inputs.count > 0) {
AVCaptureInput* input = [self.captureSession.inputs objectAtIndex:0];
[self.captureSession removeInput:input];
}
if(self.captureSession.outputs.count > 0) {
AVCaptureVideoDataOutput* output = [self.captureSession.outputs objectAtIndex:0];
[self.captureSession removeOutput:output];
}
}
- (void)dealloc {
[self stop];
}
@end
//
// Constants.h
// CameraWithAVFoundation
//
// Created by Christopher Cohen on 1/24/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface Constants : NSObject
///Type Definitions
typedef NS_ENUM(BOOL, CameraType) {
FrontFacingCamera,
RearFacingCamera,
};
typedef NS_ENUM(NSInteger, BarButtonTag) {
ShutterButtonTag,
ToggleButtonTag,
FlashButtonTag,
DismissButtonTag,
};
typedef struct {
CGFloat ISO;
CGFloat exposureDuration;
CGFloat aperture;
CGFloat lensPosition;
} CameraStatistics;
///Function Prototype declarations
CameraStatistics cameraStatisticsMake(float aperture, float exposureDuration, float ISO, float lensPostion);
@end
//
// Constants.m
// CameraWithAVFoundation
//
// Created by Christopher Cohen on 1/29/15.
// Copyright (c) 2015 Gabriel Alvarado. All rights reserved.
//
#import "Constants.h"
@implementation Constants
CameraStatistics cameraStatisticsMake(float aperture, float exposureDuration, float ISO, float lensPostion) {
CameraStatistics cameraStatistics;
cameraStatistics.aperture = aperture;
cameraStatistics.exposureDuration = exposureDuration;
cameraStatistics.ISO = ISO;
cameraStatistics.lensPosition = lensPostion;
return cameraStatistics;
}
@end
//
// GeekCameraVC.h
// GeekWorkCorrection
//
// Created by hl on 2020/9/14.
// Copyright © 2020 Facebook. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GeekWorkModel.h"
NS_ASSUME_NONNULL_BEGIN
typedef void(^PickerImageBlock)(UIImage *image);
typedef void(^PickerSuccessBlock)(BOOL success, NSArray<GeekWorkResult *> * _Nullable results);
@interface GeekCameraVC : UIViewController
@property (nonatomic, copy) PickerImageBlock imageBlock;
@property (nonatomic, copy) PickerSuccessBlock successBlock;
- (void) showPreviewWork:(NSArray<GeekWorkResult *> *)models image:(NSString *)imgUrl;
- (void) hiddenImagePreview;
@end
NS_ASSUME_NONNULL_END
//
// GeekCameraVC.m
// GeekWorkCorrection
//
// Created by hl on 2020/9/14.
// Copyright © 2020 Facebook. All rights reserved.
//
#import "GeekCameraVC.h"
#import <AVFoundation/AVFoundation.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import "CameraSessionView.h"
#import "GeekImageScannerView.h"
#import "GeekWorkAnswerView.h"
#import <YYModel.h>
#import <Masonry.h>
@interface GeekCameraVC ()<CACameraSessionDelegate>
//预览层
@property (nonatomic , strong) CameraSessionView *cameraView;
@property (weak, nonatomic) IBOutlet UIView *pagerView;
@property (nonatomic, copy) NSArray *models;
@property (nonatomic, strong) GeekImageScannerView *scannerView;
@end
@implementation GeekCameraVC
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
}
- (void)viewDidLoad {
[super viewDidLoad];
[self configViews];
}
- (void) hiddenImagePreview {
[self.scannerView removeFromSuperview];
}
#pragma mark - init views
- (void) configViews {
[self.pagerView addSubview:self.cameraView];
}
#pragma mark - lazy
- (CameraSessionView *) cameraView {
if (!_cameraView) {
_cameraView = [[CameraSessionView alloc] initWithFrame:CGRectZero];
_cameraView.delegate = self;
CATransition *applicationLoadViewIn =[CATransition animation];
[applicationLoadViewIn setDuration:0.6];
[applicationLoadViewIn setType:kCATransitionReveal];
[applicationLoadViewIn setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
[[_cameraView layer] addAnimation:applicationLoadViewIn forKey:kCATransitionReveal];
[_cameraView setTopBarColor:[[UIColor whiteColor] colorWithAlphaComponent:0.2]];
[_cameraView hideCameraToggleButton];
}
return _cameraView;
}
-(void)didCaptureImage:(UIImage *)image {
GeekImageScannerView *scannerView = [[GeekImageScannerView alloc] initWithFrame:self.pagerView.bounds];
[self.pagerView addSubview:scannerView];
scannerView.imageView.frame = scannerView.bounds;
[scannerView setImage:image];
scannerView.cancelBlock = ^(GeekImageScannerView *scannerView) {
[scannerView removeFromSuperview];
};
__weak typeof(self) weakSelf = self;
scannerView.okBlock = ^(GeekImageScannerView *scannerView, UIImage *image) {
if (weakSelf.imageBlock) {
weakSelf.imageBlock(image);
}
};
self.scannerView = scannerView;
}
-(void)didCaptureImageWithData:(NSData *)imageData {
NSLog(@"CAPTURED IMAGE DATA");
}
- (void) didCloseCamera:(CameraSessionView *)camera {
[self dismissViewControllerAnimated:true completion:nil];
}
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
self.cameraView.frame = self.pagerView.bounds;
}
// 预览图片并修改答案
- (void) showPreviewWork:(NSArray *)models image:(NSString *)imgUrl {
GeekWorkAnswerView *answerView = [[GeekWorkAnswerView alloc] init];
self.models = models;
answerView.results = models;
answerView.imgUrl = imgUrl;
__weak typeof(self) weakSelf = self;
__weak typeof(answerView) weakView = answerView;
answerView.handleBlock = ^(BOOL isOK, NSArray<GeekWorkResult *> * _Nullable results) {
__strong typeof(weakSelf) strongSelf = weakSelf;
__strong typeof(weakView) strongView = weakView;
if (isOK) {
if (self.successBlock) {
strongSelf.successBlock(true, weakView.results);
}
} else {
[strongView removeFromSuperview];
}
};
[self.pagerView addSubview:answerView];
[answerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(0);
make.bottom.mas_equalTo(0);
make.left.mas_equalTo(0);
make.right.mas_equalTo(0);
}];
}
#pragma mark - 获取通知信息
-(void) handleNotification:(NSNotification *)notification {
NSDictionary *info = notification.userInfo;
NSArray<GeekWorkResult *> *models = [info valueForKey:@"result"];
NSString *imageUrl = [info valueForKey:@"image"];
[self showPreviewWork:models image:imageUrl];
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.3" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="GeekCameraVC">
<connections>
<outlet property="pagerView" destination="aSO-pt-jXy" id="gSc-Vb-mpi"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aSO-pt-jXy">
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="bottom" secondItem="aSO-pt-jXy" secondAttribute="bottom" id="8c9-hf-rE1"/>
<constraint firstItem="aSO-pt-jXy" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" id="REc-Nn-cSH"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="aSO-pt-jXy" secondAttribute="trailing" id="TBe-jA-iRW"/>
<constraint firstItem="aSO-pt-jXy" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="kd8-ty-wKy"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
<point key="canvasLocation" x="139" y="89"/>
</view>
</objects>
</document>
//
// GeekImageScannerView.h
// GeekWorkCorrection
//
// Created by hl on 2020/9/15.
// Copyright © 2020 Facebook. All rights reserved.
//
#import <UIKit/UIKit.h>
@class GeekImageScannerView;
typedef void(^TapCancelBlock)(GeekImageScannerView * _Nullable scannerView);
typedef void(^TapOkBlock)(GeekImageScannerView * _Nullable scannerView, UIImage * _Nullable image);
NS_ASSUME_NONNULL_BEGIN
@interface GeekImageScannerView : UIView
@property (nonatomic, strong) UIImage *image;
@property (nonatomic, strong, readonly) UIImageView *imageView;
@property (nonatomic, copy) TapOkBlock okBlock;
@property (nonatomic, copy) TapCancelBlock cancelBlock;
@end
NS_ASSUME_NONNULL_END
//
// GeekImageScannerView.m
// GeekWorkCorrection
//
// Created by hl on 2020/9/15.
// Copyright © 2020 Facebook. All rights reserved.
//
#import "GeekImageScannerView.h"
@interface GeekImageScannerView ()<UIScrollViewDelegate>
@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) UIButton *cancelButton;
@property (nonatomic, strong) UIButton *okButton;
@property (nonatomic, strong) UIScrollView *scrollView;
@end
@implementation GeekImageScannerView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
self.layer.masksToBounds = NO;
self.backgroundColor = [UIColor blackColor];
[self addSubview:self.scrollView];
[self addSubview:self.cancelButton];
[self addSubview:self.okButton];
[self.scrollView addSubview:self.imageView];
}
return self;
}
#pragma mark - public
- (void)setImage:(__kindof UIImage *)image {
_image = image;
self.imageView.image = image;
}
- (void)reset {
self.imageView.image = nil;
self.imageView.frame = CGRectZero;
}
#pragma mark - getters
- (UIImageView *)imageView {
if (!_imageView) {
_imageView = [UIImageView new];
_imageView.contentMode = UIViewContentModeScaleAspectFill;
_imageView.layer.masksToBounds = YES;
}
return _imageView;
}
- (UIButton *) cancelButton {
if (!_cancelButton) {
_cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_cancelButton setImage:[UIImage imageNamed:@"close"] forState:UIControlStateNormal];
[_cancelButton addTarget:self action:@selector(handleCancel) forControlEvents:UIControlEventTouchUpInside];
}
return _cancelButton;
}
- (UIButton *) okButton {
if (!_okButton) {
_okButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_okButton setImage:[UIImage imageNamed:@"ok"] forState:UIControlStateNormal];
[_okButton addTarget:self action:@selector(handleOk) forControlEvents:UIControlEventTouchUpInside];
}
return _okButton;
}
- (UIScrollView *)scrollView {
if (!_scrollView) {
_scrollView = [[UIScrollView alloc] initWithFrame:self.bounds];
_scrollView.showsHorizontalScrollIndicator = NO;
_scrollView.showsVerticalScrollIndicator = NO;
_scrollView.decelerationRate = UIScrollViewDecelerationRateFast;
_scrollView.minimumZoomScale = 1;
_scrollView.maximumZoomScale = 3;
_scrollView.alwaysBounceHorizontal = NO;
_scrollView.alwaysBounceVertical = NO;
_scrollView.delegate = self;
if (@available(iOS 11.0, *)) {
_scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
}
return _scrollView;
}
#pragma mark -- UIScrollViewDelegate
//返回需要缩放的视图控件 缩放过程中
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return self.imageView;
}
//开始缩放
- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view{
NSLog(@"开始缩放");
}
//结束缩放
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale{
NSLog(@"结束缩放");
}
//缩放中
- (void)scrollViewDidZoom:(UIScrollView *)scrollView {
// 延中心点缩放
CGRect imageViewFrame = self.imageView.frame;
CGFloat width = imageViewFrame.size.width,
height = imageViewFrame.size.height,
sHeight = scrollView.bounds.size.height,
sWidth = scrollView.bounds.size.width;
if (height > sHeight) {
imageViewFrame.origin.y = 0;
} else {
imageViewFrame.origin.y = (sHeight - height) / 2.0;
}
if (width > sWidth) {
imageViewFrame.origin.x = 0;
} else {
imageViewFrame.origin.x = (sWidth - width) / 2.0;
}
self.imageView.frame = imageViewFrame;
}
- (void) layoutSubviews {
[super layoutSubviews];
self.okButton.frame = CGRectMake(CGRectGetWidth(self.frame) - 55, CGRectGetHeight(self.frame) - 50, 45, 40);
self.cancelButton.frame = CGRectMake(10, CGRectGetHeight(self.frame) - 50, 45, 40);
self.scrollView.frame = self.bounds;
}
#pragma mark - actions
- (void) handleOk {
if (self.okBlock) {
self.okBlock(self, self.image);
}
}
- (void) handleCancel {
if (self.cancelBlock) {
self.cancelBlock(self);
}
}
@end
//
// GeekPickerEventEmitter.h
// GeekWorkCorrection
//
// Created by hl on 2020/9/16.
// Copyright © 2020 Facebook. All rights reserved.
//
#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>
NS_ASSUME_NONNULL_BEGIN
@interface GeekPickerEventEmitter : RCTEventEmitter<RCTBridgeModule>
@end
NS_ASSUME_NONNULL_END
//
// GeekPickerEventEmitter.m
// GeekWorkCorrection
//
// Created by hl on 2020/9/16.
// Copyright © 2020 Facebook. All rights reserved.
//
#import "GeekPickerEventEmitter.h"
@implementation GeekPickerEventEmitter
//NSString *NOTIFICATION_IMAGE = @"geek_image_picker";
//NSString *NOTIFICATION_ANSWER = @"geek_image_work_picker";
RCT_EXPORT_MODULE();
- (NSArray<NSString *> *)supportedEvents
{
return @[@"GeekWorkPicker"];
}
- (void) startObserving {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(workEventReminderReceived:) name:@"home_work_uploaded" object:nil];
}
- (void) stopObserving {
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"home_work_uploaded" object:nil];
}
- (void)workEventReminderReceived:(NSNotification *)notification
{
NSDictionary *info = notification.userInfo;
[self sendEventWithName:@"GeekWorkPicker" body:info];
}
@end
//
// GeekUtil.h
// GeekWorkCorrection
//
// Created by hl on 2020/9/15.
// Copyright © 2020 Facebook. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GeekWorkModel.h"
NS_ASSUME_NONNULL_BEGIN
typedef void(^GeekPickerImageBlock)(NSString *imgPath);
typedef void(^GeekPickerChangeWorkBlock)(NSArray<GeekWorkResult *> *res);
@interface GeekUtil : NSObject
+ (NSString *) saveImageTosandBox:(UIImage *)image;
+ (void) postNotification:(NSString *)name info:(id)info;
+ (void) postImage:(NSString *)img;
//+ (void) observerWorkImageNotification:(GeekPickerImageBlock)block;
+ (void) postChangeWorkInfo:(NSArray<GeekWorkResult *> *)models image:(NSString *)img;
//+ (void) observerChangeWork:(GeekPickerChangeWorkBlock)block;
@end
NS_ASSUME_NONNULL_END
//
// GeekUtil.m
// GeekWorkCorrection
//
// Created by hl on 2020/9/15.
// Copyright © 2020 Facebook. All rights reserved.
//
#import "GeekUtil.h"
NSString *NOTIFICATION_IMAGE = @"home_work_uploaded";
@implementation GeekUtil
+ (NSString *) saveImageTosandBox:(UIImage *)image {
NSData *data = UIImageJPEGRepresentation(image, 1);
if (!data) {
data = UIImagePNGRepresentation(image);
}
NSString *cachesDir = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
NSString *filePath = [cachesDir stringByAppendingPathComponent:
[NSString stringWithFormat:@"%@.png", [[NSUUID UUID] UUIDString]]]; // 保存文件的名称
BOOL result =[data writeToFile:filePath atomically:YES]; // 保存成功会返回YES
if (result == YES) {
NSLog(@"保存成功");
return [NSString stringWithFormat:@"file://%@", filePath];
}
return nil;
}
+ (void) postNotification:(NSString *)name info:(id)info {
[[NSNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:info];
}
+ (void) postImage:(NSString *)img {
[GeekUtil postNotification:NOTIFICATION_IMAGE info:@{
@"image": img,
@"type": @"uploadImage"
}];
}
+ (void) postChangeWorkInfo:(NSArray<GeekWorkResult *> *)models image:(NSString *)img {
[GeekUtil postNotification:NOTIFICATION_IMAGE info:@{
@"works": [models yy_modelToJSONObject],
@"image": img,
@"type": @"uploadWork"
}];
}
+ (void) observerNotificationHandle:(NSNotification *)notify {
[GeekUtil postNotification:@"home_work_uploaded" info:notify.userInfo];
}
@end
//
// GeekWorkAnswerView.h
// GeekWorkCorrection
//
// Created by hl on 2020/9/15.
// Copyright © 2020 Facebook. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GeekWorkModel.h"
typedef void(^WorkHandleBlock)(BOOL isOK, NSArray<GeekWorkResult *> * _Nullable results);
NS_ASSUME_NONNULL_BEGIN
@interface GeekWorkAnswerView : UIView
@property (nonatomic, copy) NSString *imgUrl;
@property (nonatomic, strong) NSArray<GeekWorkResult *> *results;
- (void) refreshViews;
@property (nonatomic, copy) WorkHandleBlock handleBlock;
@end
NS_ASSUME_NONNULL_END
//
// GeekWorkAnswerView.m
// GeekWorkCorrection
//
// Created by hl on 2020/9/15.
// Copyright © 2020 Facebook. All rights reserved.
//
#import "GeekWorkAnswerView.h"
#import "GeekWorkItemView.h"
#import <SDWebImage.h>
@interface GeekWorkAnswerView ()
@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) UIView *contentView;
@property (nonatomic, strong) NSMutableArray *itemViews;
@property (nonatomic, strong) UIButton *okButton;
@property (nonatomic, strong) UIButton *cancelButton;
@end
@implementation GeekWorkAnswerView
- (instancetype) initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.itemViews = [NSMutableArray array];
[self.contentView addSubview:self.imageView];
self.backgroundColor = [UIColor blackColor];
[self addSubview:self.contentView];
[self configToolViews];
}
return self;
}
#pragma mark - lazy
- (UIImageView *) imageView {
if (!_imageView) {
_imageView = [[UIImageView alloc] initWithFrame:self.contentView.bounds];
_imageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _imageView;
}
- (UIButton *) okButton {
if (!_okButton) {
_okButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_okButton setTitle:@"确定" forState:UIControlStateNormal];
[_okButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_okButton addTarget:self action:@selector(handleOk) forControlEvents:UIControlEventTouchUpInside];
}
return _okButton;
}
- (UIButton *) cancelButton {
if (!_cancelButton) {
_cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_cancelButton setTitle:@"取消" forState:UIControlStateNormal];
[_cancelButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_cancelButton addTarget:self action:@selector(handleCancel) forControlEvents:UIControlEventTouchUpInside];
}
return _cancelButton;
}
- (UIView *) contentView {
if (!_contentView ) {
_contentView = [[UIView alloc] initWithFrame:CGRectZero];
_contentView.center = self.center;
}
return _contentView;
}
#pragma mark - 添加工具栏
- (void) configToolViews {
[self addSubview:self.okButton];
[self addSubview:self.cancelButton];
}
#pragma mark -
- (void) setResults:(NSArray<GeekWorkResult *> *)results {
_results = results;
for (UIView *sView in self.itemViews) {
[sView removeFromSuperview];
}
[self.itemViews removeAllObjects];
for (GeekWorkResult *res in results) {
__weak typeof(self) weakSelf = self;
GeekWorkItemView *itemView = [[GeekWorkItemView alloc] initWithResult:res];
itemView.changeBlock = ^(NSString * _Nonnull result) {
__strong typeof(weakSelf) strongSelf = weakSelf ;
res.answer = result;
strongSelf.results = results;
[strongSelf refreshViews];
};
[self.itemViews addObject:itemView];
[self.contentView addSubview:itemView];
}
}
- (void) refreshViews {
for (GeekWorkItemView *itmView in self.itemViews) {
[itmView layoutSelf];
}
}
- (void) setImgUrl:(NSString *)imgUrl {
_imgUrl = imgUrl;
NSURL *img = [NSURL URLWithString:imgUrl];
[self.imageView sd_setImageWithURL: img];
}
#pragma mark -
- (void) layoutSubviews {
[super layoutSubviews];
self.contentView.frame = CGRectMake(0, 0, CGRectGetWidth(self.frame), CGRectGetHeight(self.frame) * 210.0 / 297.0);
self.contentView.center = self.center;
self.imageView.frame = self.contentView.bounds;
for (GeekWorkItemView *itemView in self.itemViews) {
[itemView layoutSelf];
}
self.okButton.frame = CGRectMake(10, CGRectGetHeight(self.frame) - 50, 45, 40);
self.cancelButton.frame = CGRectMake(CGRectGetWidth(self.frame) - 55, CGRectGetHeight(self.frame) - 50, 45, 40);
}
#pragma mark - actions
- (void) handleOk {
if (self.handleBlock) {
self.handleBlock(true, self.results);
}
}
- (void) handleCancel {
if (self.handleBlock) {
self.handleBlock(false, self.results);
}
}
@end
//
// GeekWorkItemView.h
// GeekWorkCorrection
//
// Created by hl on 2020/9/15.
// Copyright © 2020 Facebook. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GeekWorkModel.h"
NS_ASSUME_NONNULL_BEGIN
typedef void(^ChangeResultBlock)(NSString *result);
@interface GeekWorkItemView : UIView
- (instancetype) initWithResult:(GeekWorkResult *)model;
- (void) setWorkResult:(GeekWorkResult *)result;
- (void) layoutSelf;
@property (nonatomic , copy) ChangeResultBlock changeBlock;
@property (nonatomic, strong) UIColor *borderColor;
@end
NS_ASSUME_NONNULL_END
//
// GeekWorkItemView.m
// GeekWorkCorrection
//
// Created by hl on 2020/9/15.
// Copyright © 2020 Facebook. All rights reserved.
//
#import "GeekWorkItemView.h"
#import <LCActionSheet.h>
@interface GeekWorkItemView ()<LCActionSheetDelegate>
@property (nonatomic, strong) UIView *seperateView;
@property (nonatomic, strong) GeekWorkResult *result;
@property (nonatomic, strong) UILabel *answerLabel;
@end
@implementation GeekWorkItemView
- (instancetype) initWithResult:(GeekWorkResult *)model {
if (self = [super init]) {
self.result = model;
}
return self;
}
- (instancetype) initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self addSubview:self.seperateView];
[self addSubview:self.answerLabel];
}
return self;
}
- (void) addSelfToTargetView:(UIView *)taget result:(GeekWorkResult* )result {
UIView *parentView = taget;
if (result && parentView) {
}
}
- (void) setWorkResult:(GeekWorkResult *)result {
self.result = result;
}
#pragma mark - lazy
- (UIView *) seperateView {
if (!_seperateView) {
_seperateView = [[UIView alloc] initWithFrame:CGRectZero];
_seperateView.backgroundColor = [UIColor blueColor];
}
return _seperateView;
}
- (UILabel *) answerLabel {
if (!_answerLabel) {
_answerLabel = [[UILabel alloc] init];
_answerLabel.textColor = [UIColor greenColor];
_answerLabel.font = [UIFont systemFontOfSize:18];
_answerLabel.textAlignment = NSTextAlignmentCenter;
_answerLabel.layer.borderWidth = 1.f;
_answerLabel.layer.borderColor = [[UIColor blueColor] CGColor];
_answerLabel.userInteractionEnabled = true;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(changeAnswer:)];
[_answerLabel addGestureRecognizer:tap];
}
return _answerLabel;
}
- (void) setResult:(GeekWorkResult *)result {
_result = result;
}
- (void) layoutSubviews {
[super layoutSubviews];
[self subViewsLayout];
}
- (void) layoutSelf {
[self setNeedsLayout];
[self layoutIfNeeded];
}
- (void) subViewsLayout {
self.answerLabel.text = self.result.answer;
CGRect frame = CGRectZero;
CGSize pSize = self.superview.frame.size;
CGFloat xPoint = 10;
CGFloat yPoint = self.result.y1 / 297.0 * pSize.height;
CGFloat height = self.result.y2 / 297.0 * pSize.height - self.result.y1 / 297.0 * pSize.height;
frame.origin.y = yPoint;
frame.origin.x = xPoint;
frame.size.height = height;
frame.size.width = pSize.width - xPoint * 2;
self.frame = frame;
self.answerLabel.text = self.result.answer;
// 将parentView 的坐标转到 当前视图
CGRect labelFrame = CGRectZero;
CGFloat answerStartX = self.result.sAnserX / 210.0 * pSize.width - frame.origin.x;
CGFloat answerStartY = self.result.sAnserY / 297.0 * pSize.height - frame.origin.y;
CGFloat answerEndX = self.result.eAnserX / 210.0 * pSize.width - frame.origin.x;
CGFloat answerEndY = self.result.eAnserY / 297.0 * pSize.height - frame.origin.y;
labelFrame = CGRectMake(answerStartX, answerStartY, answerEndX - answerStartX, answerEndY - answerStartY);
self.answerLabel.frame = labelFrame;
self.seperateView.frame = CGRectMake(0, CGRectGetHeight(self.frame) - 1, CGRectGetWidth(self.frame), 1);
}
#pragma mark -
- (void) changeAnswer:(id) sender {
LCActionSheet *actionSheet = [LCActionSheet sheetWithTitle:@"选择要更改的答案"
cancelButtonTitle:@"取消" clicked:^(LCActionSheet * _Nonnull actionSheet, NSInteger buttonIndex) {
if (buttonIndex - 1 < self.result.chooses.count) {
if (self.changeBlock) {
self.changeBlock(self.result.chooses[buttonIndex - 1]);
}
}
}
otherButtonTitleArray:self.result.chooses];
[actionSheet show];
}
@end
//
// GeekWorkModel.h
// GeekWorkCorrection
//
// Created by hl on 2020/9/15.
// Copyright © 2020 Facebook. All rights reserved.
//
#ifndef GeekWorkModel_h
#define GeekWorkModel_h
#import <YYModel.h>
#import "GeekWorkResult.h"
#endif /* GeekWorkModel_h */
//
// GeekWorkPicker.h
// GeekWorkCorrection
//
// Created by hl on 2020/9/14.
// Copyright © 2020 Facebook. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
NS_ASSUME_NONNULL_BEGIN
@interface GeekWorkPicker : NSObject <RCTBridgeModule>
@end
NS_ASSUME_NONNULL_END
//
// GeekWorkPicker.m
// GeekWorkCorrection
//
// Created by hl on 2020/9/14.
// Copyright © 2020 Facebook. All rights reserved.
//
#import "GeekWorkPicker.h"
#import <UIKit/UIKit.h>
#import "GeekCameraVC.h"
#import "GeekWorkModel.h"
#import "GeekWorkAnswerView.h"
#import "GeekUtil.h"
#import <SVProgressHUD.h>
@interface GeekWorkPicker ()<UINavigationControllerDelegate, UIImagePickerControllerDelegate>
@property (nonatomic, strong) GeekCameraVC *picker;
@end
@implementation GeekWorkPicker
RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD(openWorkPicker) {
[self showPicker];
}
RCT_EXPORT_METHOD(showWorkResult:(NSString *)imageUrl
result:(id)result){
[SVProgressHUD dismiss];
[self.picker hiddenImagePreview];
NSArray<GeekWorkResult *> *models = [NSArray yy_modelArrayWithClass:[GeekWorkResult class] json:result];
if (self.picker) {
[self.picker showPreviewWork:models image:imageUrl];
__weak typeof(self) weakSelf = self;
self.picker.successBlock = ^(BOOL success, NSArray<GeekWorkResult *> *results) {
if (success) {
[GeekUtil postChangeWorkInfo:results image:@""];
[weakSelf.picker dismissViewControllerAnimated:true completion:nil];
}
};
}
}
- (dispatch_queue_t)methodQueue
{
return dispatch_get_main_queue();
}
- (void) showPicker {
// self.picker = [[GeekCameraVC alloc] init];
// self.picker.modalPresentationStyle = UIModalPresentationFullScreen;
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self;
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:picker animated:YES completion:nil];
// self.picker.imageBlock = ^(UIImage * _Nonnull image) {
// NSString *imgPath = [GeekUtil saveImageTosandBox:image];
// [GeekUtil postImage:imgPath];
// [SVProgressHUD showWithStatus:@"正在上传图片"];
// };
}
- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<UIImagePickerControllerInfoKey,id> *)info {
// NSString *imgPath = [GeekUtil saveImageTosandBox:image];
// [GeekUtil postImage:imgPath];
// [SVProgressHUD showWithStatus:@"正在上传图片"];
[picker dismissViewControllerAnimated:true completion:nil];
UIImage *img = [info valueForKey:UIImagePickerControllerOriginalImage];
NSString *imgPath = [GeekUtil saveImageTosandBox:img];
[GeekUtil postImage:imgPath];
[SVProgressHUD showWithStatus:@"正在上传图片"];
}
@end
//
// GeekWorkResult.h
// GeekWorkCorrection
//
// Created by hl on 2020/9/15.
// Copyright © 2020 Facebook. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef enum : NSUInteger {
WorkResultTypeChoose,
WorkResultTypeText,
WorkResultTypeInput,
} WorkResultType;
@interface GeekWorkResult : NSObject
@property (nonatomic, assign) WorkResultType workType;
@property (nonatomic, copy) NSArray *chooses;
@property (nonatomic, strong) NSString *answer;
@property (nonatomic, assign) CGFloat y1;
@property (nonatomic, assign) CGFloat y2;
@property (nonatomic , assign) CGFloat sAnserX;
@property (nonatomic , assign) CGFloat sAnserY;
@property (nonatomic , assign) CGFloat eAnserX;
@property (nonatomic , assign) CGFloat eAnserY;
@end
NS_ASSUME_NONNULL_END
//
// GeekWorkResult.m
// GeekWorkCorrection
//
// Created by hl on 2020/9/15.
// Copyright © 2020 Facebook. All rights reserved.
//
#import "GeekWorkResult.h"
@implementation GeekWorkResult
+ (NSDictionary *)modelContainerPropertyGenericClass {
return @{
@"chooses" : [NSString class]
};
}
@end
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "back.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "close.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "focus.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ok (2).png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
PODS:
- Base64 (1.1.2)
- boost-for-react-native (1.63.0)
- CodePush (1000.0.0):
- Base64 (~> 1.1)
- JWT (~> 3.0.0-beta.7)
- React
- SSZipArchive (~> 2.1)
- DoubleConversion (1.1.6)
- FBLazyVector (0.61.5)
- FBReactNativeSpec (0.61.5):
- Folly (= 2018.10.22.00)
- RCTRequired (= 0.61.5)
- RCTTypeSafety (= 0.61.5)
- React-Core (= 0.61.5)
- React-jsi (= 0.61.5)
- ReactCommon/turbomodule/core (= 0.61.5)
- Folly (2018.10.22.00):
- boost-for-react-native
- DoubleConversion
- Folly/Default (= 2018.10.22.00)
- glog
- Folly/Default (2018.10.22.00):
- boost-for-react-native
- DoubleConversion
- glog
- glog (0.3.5)
- JWT (3.0.0-beta.12):
- Base64 (~> 1.1.2)
- libwebp (1.1.0):
- libwebp/demux (= 1.1.0)
- libwebp/mux (= 1.1.0)
- libwebp/webp (= 1.1.0)
- libwebp/demux (1.1.0):
- libwebp/webp
- libwebp/mux (1.1.0):
- libwebp/demux
- libwebp/webp (1.1.0)
- RCTRequired (0.61.5)
- RCTTypeSafety (0.61.5):
- FBLazyVector (= 0.61.5)
- Folly (= 2018.10.22.00)
- RCTRequired (= 0.61.5)
- React-Core (= 0.61.5)
- React (0.61.5):
- React-Core (= 0.61.5)
- React-Core/DevSupport (= 0.61.5)
- React-Core/RCTWebSocket (= 0.61.5)
- React-RCTActionSheet (= 0.61.5)
- React-RCTAnimation (= 0.61.5)
- React-RCTBlob (= 0.61.5)
- React-RCTImage (= 0.61.5)
- React-RCTLinking (= 0.61.5)
- React-RCTNetwork (= 0.61.5)
- React-RCTSettings (= 0.61.5)
- React-RCTText (= 0.61.5)
- React-RCTVibration (= 0.61.5)
- React-Core (0.61.5):
- Folly (= 2018.10.22.00)
- glog
- React-Core/Default (= 0.61.5)
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsiexecutor (= 0.61.5)
- Yoga
- React-Core/CoreModulesHeaders (0.61.5):
- Folly (= 2018.10.22.00)
- glog
- React-Core/Default
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsiexecutor (= 0.61.5)
- Yoga
- React-Core/Default (0.61.5):
- Folly (= 2018.10.22.00)
- glog
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsiexecutor (= 0.61.5)
- Yoga
- React-Core/DevSupport (0.61.5):
- Folly (= 2018.10.22.00)
- glog
- React-Core/Default (= 0.61.5)
- React-Core/RCTWebSocket (= 0.61.5)
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsiexecutor (= 0.61.5)
- React-jsinspector (= 0.61.5)
- Yoga
- React-Core/RCTActionSheetHeaders (0.61.5):
- Folly (= 2018.10.22.00)
- glog
- React-Core/Default
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsiexecutor (= 0.61.5)
- Yoga
- React-Core/RCTAnimationHeaders (0.61.5):
- Folly (= 2018.10.22.00)
- glog
- React-Core/Default
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsiexecutor (= 0.61.5)
- Yoga
- React-Core/RCTBlobHeaders (0.61.5):
- Folly (= 2018.10.22.00)
- glog
- React-Core/Default
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsiexecutor (= 0.61.5)
- Yoga
- React-Core/RCTImageHeaders (0.61.5):
- Folly (= 2018.10.22.00)
- glog
- React-Core/Default
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsiexecutor (= 0.61.5)
- Yoga
- React-Core/RCTLinkingHeaders (0.61.5):
- Folly (= 2018.10.22.00)
- glog
- React-Core/Default
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsiexecutor (= 0.61.5)
- Yoga
- React-Core/RCTNetworkHeaders (0.61.5):
- Folly (= 2018.10.22.00)
- glog
- React-Core/Default
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsiexecutor (= 0.61.5)
- Yoga
- React-Core/RCTSettingsHeaders (0.61.5):
- Folly (= 2018.10.22.00)
- glog
- React-Core/Default
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsiexecutor (= 0.61.5)
- Yoga
- React-Core/RCTTextHeaders (0.61.5):
- Folly (= 2018.10.22.00)
- glog
- React-Core/Default
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsiexecutor (= 0.61.5)
- Yoga
- React-Core/RCTVibrationHeaders (0.61.5):
- Folly (= 2018.10.22.00)
- glog
- React-Core/Default
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsiexecutor (= 0.61.5)
- Yoga
- React-Core/RCTWebSocket (0.61.5):
- Folly (= 2018.10.22.00)
- glog
- React-Core/Default (= 0.61.5)
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsiexecutor (= 0.61.5)
- Yoga
- React-CoreModules (0.61.5):
- FBReactNativeSpec (= 0.61.5)
- Folly (= 2018.10.22.00)
- RCTTypeSafety (= 0.61.5)
- React-Core/CoreModulesHeaders (= 0.61.5)
- React-RCTImage (= 0.61.5)
- ReactCommon/turbomodule/core (= 0.61.5)
- React-cxxreact (0.61.5):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React-jsinspector (= 0.61.5)
- React-jsi (0.61.5):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React-jsi/Default (= 0.61.5)
- React-jsi/Default (0.61.5):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React-jsiexecutor (0.61.5):
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsinspector (0.61.5)
- react-native-safe-area-context (3.1.8):
- React-Core
- react-native-version-number (0.3.6):
- React
- react-native-viewpager (3.3.1):
- React
- React-RCTActionSheet (0.61.5):
- React-Core/RCTActionSheetHeaders (= 0.61.5)
- React-RCTAnimation (0.61.5):
- React-Core/RCTAnimationHeaders (= 0.61.5)
- React-RCTBlob (0.61.5):
- React-Core/RCTBlobHeaders (= 0.61.5)
- React-Core/RCTWebSocket (= 0.61.5)
- React-jsi (= 0.61.5)
- React-RCTNetwork (= 0.61.5)
- React-RCTImage (0.61.5):
- React-Core/RCTImageHeaders (= 0.61.5)
- React-RCTNetwork (= 0.61.5)
- React-RCTLinking (0.61.5):
- React-Core/RCTLinkingHeaders (= 0.61.5)
- React-RCTNetwork (0.61.5):
- React-Core/RCTNetworkHeaders (= 0.61.5)
- React-RCTSettings (0.61.5):
- React-Core/RCTSettingsHeaders (= 0.61.5)
- React-RCTText (0.61.5):
- React-Core/RCTTextHeaders (= 0.61.5)
- React-RCTVibration (0.61.5):
- React-Core/RCTVibrationHeaders (= 0.61.5)
- ReactCommon/jscallinvoker (0.61.5):
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React-cxxreact (= 0.61.5)
- ReactCommon/turbomodule/core (0.61.5):
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React-Core (= 0.61.5)
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- ReactCommon/jscallinvoker (= 0.61.5)
- ReactNativeART (1.2.0):
- React
- rn-fetch-blob (0.12.0):
- React-Core
- RNCAsyncStorage (1.12.0):
- React
- RNCMaskedView (0.1.10):
- React
- RNFastImage (8.3.2):
- React
- SDWebImage (~> 5.8)
- SDWebImageWebPCoder (~> 0.6.1)
- RNGestureHandler (1.8.0):
- React
- RNReanimated (1.13.1):
- React
- RNScreens (2.11.0):
- React
- SDWebImage (5.9.0):
- SDWebImage/Core (= 5.9.0)
- SDWebImage/Core (5.9.0)
- SDWebImageWebPCoder (0.6.1):
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.7)
- SSZipArchive (2.2.3)
- Yoga (1.14.0)
DEPENDENCIES:
- CodePush (from `../node_modules/react-native-code-push`)
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)
- Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
- React (from `../node_modules/react-native/`)
- React-Core (from `../node_modules/react-native/`)
- React-Core/DevSupport (from `../node_modules/react-native/`)
- React-Core/RCTWebSocket (from `../node_modules/react-native/`)
- React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
- React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- react-native-version-number (from `../node_modules/react-native-version-number`)
- "react-native-viewpager (from `../node_modules/@react-native-community/viewpager`)"
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
- React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
- React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
- React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
- React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
- React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
- React-RCTText (from `../node_modules/react-native/Libraries/Text`)
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
- ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- "ReactNativeART (from `../node_modules/@react-native-community/art`)"
- rn-fetch-blob (from `../node_modules/rn-fetch-blob`)
- "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)"
- "RNCMaskedView (from `../node_modules/@react-native-community/masked-view`)"
- RNFastImage (from `../node_modules/react-native-fast-image`)
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNReanimated (from `../node_modules/react-native-reanimated`)
- RNScreens (from `../node_modules/react-native-screens`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
SPEC REPOS:
trunk:
- Base64
- boost-for-react-native
- JWT
- libwebp
- SDWebImage
- SDWebImageWebPCoder
- SSZipArchive
EXTERNAL SOURCES:
CodePush:
:path: "../node_modules/react-native-code-push"
DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
FBLazyVector:
:path: "../node_modules/react-native/Libraries/FBLazyVector"
FBReactNativeSpec:
:path: "../node_modules/react-native/Libraries/FBReactNativeSpec"
Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
RCTRequired:
:path: "../node_modules/react-native/Libraries/RCTRequired"
RCTTypeSafety:
:path: "../node_modules/react-native/Libraries/TypeSafety"
React:
:path: "../node_modules/react-native/"
React-Core:
:path: "../node_modules/react-native/"
React-CoreModules:
:path: "../node_modules/react-native/React/CoreModules"
React-cxxreact:
:path: "../node_modules/react-native/ReactCommon/cxxreact"
React-jsi:
:path: "../node_modules/react-native/ReactCommon/jsi"
React-jsiexecutor:
:path: "../node_modules/react-native/ReactCommon/jsiexecutor"
React-jsinspector:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
react-native-version-number:
:path: "../node_modules/react-native-version-number"
react-native-viewpager:
:path: "../node_modules/@react-native-community/viewpager"
React-RCTActionSheet:
:path: "../node_modules/react-native/Libraries/ActionSheetIOS"
React-RCTAnimation:
:path: "../node_modules/react-native/Libraries/NativeAnimation"
React-RCTBlob:
:path: "../node_modules/react-native/Libraries/Blob"
React-RCTImage:
:path: "../node_modules/react-native/Libraries/Image"
React-RCTLinking:
:path: "../node_modules/react-native/Libraries/LinkingIOS"
React-RCTNetwork:
:path: "../node_modules/react-native/Libraries/Network"
React-RCTSettings:
:path: "../node_modules/react-native/Libraries/Settings"
React-RCTText:
:path: "../node_modules/react-native/Libraries/Text"
React-RCTVibration:
:path: "../node_modules/react-native/Libraries/Vibration"
ReactCommon:
:path: "../node_modules/react-native/ReactCommon"
ReactNativeART:
:path: "../node_modules/@react-native-community/art"
rn-fetch-blob:
:path: "../node_modules/rn-fetch-blob"
RNCAsyncStorage:
:path: "../node_modules/@react-native-community/async-storage"
RNCMaskedView:
:path: "../node_modules/@react-native-community/masked-view"
RNFastImage:
:path: "../node_modules/react-native-fast-image"
RNGestureHandler:
:path: "../node_modules/react-native-gesture-handler"
RNReanimated:
:path: "../node_modules/react-native-reanimated"
RNScreens:
:path: "../node_modules/react-native-screens"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"
SPEC CHECKSUMS:
Base64: cecfb41a004124895a7bcee567a89bae5a89d49b
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
CodePush: 94a4a4e71ed30793296632f7024a74fc53d6bccf
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
FBLazyVector: aaeaf388755e4f29cd74acbc9e3b8da6d807c37f
FBReactNativeSpec: 118d0d177724c2d67f08a59136eb29ef5943ec75
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
JWT: 9b5c05abbcc1a0e69c3c91e1655b3387fc7e581d
libwebp: 946cb3063cea9236285f7e9a8505d806d30e07f3
RCTRequired: b153add4da6e7dbc44aebf93f3cf4fcae392ddf1
RCTTypeSafety: 9aa1b91d7f9310fc6eadc3cf95126ffe818af320
React: b6a59ef847b2b40bb6e0180a97d0ca716969ac78
React-Core: 688b451f7d616cc1134ac95295b593d1b5158a04
React-CoreModules: d04f8494c1a328b69ec11db9d1137d667f916dcb
React-cxxreact: d0f7bcafa196ae410e5300736b424455e7fb7ba7
React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7
React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386
React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0
react-native-safe-area-context: 79fea126c6830c85f65947c223a5e3058a666937
react-native-version-number: b415bbec6a13f2df62bf978e85bc0d699462f37f
react-native-viewpager: f730c1d175a2c1ae789464855d4a2c14247d3109
React-RCTActionSheet: 600b4d10e3aea0913b5a92256d2719c0cdd26d76
React-RCTAnimation: 791a87558389c80908ed06cc5dfc5e7920dfa360
React-RCTBlob: d89293cc0236d9cb0933d85e430b0bbe81ad1d72
React-RCTImage: 6b8e8df449eb7c814c99a92d6b52de6fe39dea4e
React-RCTLinking: 121bb231c7503cf9094f4d8461b96a130fabf4a5
React-RCTNetwork: fb353640aafcee84ca8b78957297bd395f065c9a
React-RCTSettings: 8db258ea2a5efee381fcf7a6d5044e2f8b68b640
React-RCTText: 9ccc88273e9a3aacff5094d2175a605efa854dbe
React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad
ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd
ReactNativeART: 78edc68dd4a1e675338cd0cd113319cf3a65f2ab
rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba
RNCAsyncStorage: 2a692bcb9b69b76a2f1a95f33db057129700af64
RNCMaskedView: 5a8ec07677aa885546a0d98da336457e2bea557f
RNFastImage: e19ba191922e7dab9d932a4d59d62d76660aa222
RNGestureHandler: 7a5833d0f788dbd107fbb913e09aa0c1ff333c39
RNReanimated: dd8c286ab5dd4ba36d3a7fef8bff7e08711b5476
RNScreens: 0e91da98ab26d5d04c7b59a9b6bd694124caf88c
SDWebImage: 62ae4a18473520c67b79e9724c31a63599cc9423
SDWebImageWebPCoder: d0dac55073088d24b2ac1b191a71a8f8d0adac21
SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9
Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b
PODFILE CHECKSUM: 7c6653c14e1b7c83f5335ef9d27a049ac0bdd625
COCOAPODS: 1.9.1
......@@ -7,7 +7,13 @@
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
"lint": "eslint .",
"codepushserver": "sed -ig 's#BuildConfig.DEBUG#BuildConfig.DEBUG,https://hot.jkwljy.com#g' node_modules/react-native-code-push/package.json",
"codepushsdk": "npm run script.sh",
"geek": "node ./script.js",
"postinstall": "npm run geek",
"build-ios": "react-native bundle --platform ios --entry-file index.js --bundle-output ./bundle/ios/main.jsbundle --assets-dest ./bundle/ios --dev false",
"build-android": "cd android && ./gradlew assembleRelease"
},
"dependencies": {
"@geek/request": "^1.0.0",
......@@ -47,7 +53,6 @@
"babel-jest": "^26.3.0",
"babel-plugin-root-import": "^6.5.0",
"eslint": "^7.9.0",
"jest": "^26.4.2",
"metro-react-native-babel-preset": "^0.63.0",
"react-test-renderer": "16.9.0",
"typescript": "^4.0.2"
......
const fs = require('fs')
const path = require('path')
const CODE_PUSH_ENDPOINT = 'https://hot.jkwljy.com'
function replaceFile (relativePath) {
const realPath = path.resolve(__dirname, ...relativePath.split('/'))
fs.writeFileSync(
realPath,
fs.readFileSync(realPath, { encoding: 'utf-8' })
// .replace(/BuildConfig\.DEBUG\)/, `BuildConfig.DEBUG, \\"${CODE_PUSH_ENDPOINT}\\")`)
.replace(/(BuildConfig\.DEBUG, \\\"http\:\/\/119\.27\.181\.101\:3000\\\"\))|(BuildConfig\.DEBUG\))/, `BuildConfig.DEBUG, \\"${CODE_PUSH_ENDPOINT}\\")`)
)
}
replaceFile('node_modules/react-native-code-push/package.json')
replaceFile('node_modules/react-native-code-push/react-native.config.js')
\ No newline at end of file
......@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'
import { View, Text } from "react-native";
import { TouchableHighlight } from 'react-native-gesture-handler';
import { withStackScreen } from '@/hooks';
// import { showWorkPicker } from '@/rn-module/work-correct';
import { showWorkPicker } from '@/rn-module/work-correct';
const Home = (props: any) => {
......@@ -14,7 +14,7 @@ const Home = (props: any) => {
return (
<View style={{ flex: 1 }}>
<TouchableHighlight onPress={() => {
// showWorkPicker(123)
showWorkPicker(123)
}}>
<View>
<Text style={{ height: 60, backgroundColor: 'blue' }}>tap ll</Text>
......
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react",
"lib": ["es6"],
"moduleResolution": "node",
"noEmit": true,
"strict": true,
"target": "esnext",
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": [
"node_modules",
"babel.config.js",
"metro.config.js",
"jest.config.js"
]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment