add
@@ -32,7 +32,6 @@
|
||||
8340BFAF213E739D008F22E4 /* GiGaNoNetWorkView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8340BFAE213E739D008F22E4 /* GiGaNoNetWorkView.m */; };
|
||||
834127212152AEFB001DDB36 /* GIGaMaskTimeUseRecordVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 834127202152AEFB001DDB36 /* GIGaMaskTimeUseRecordVC.m */; };
|
||||
8342D9FD2131150200D16B1D /* 4481.wav in Resources */ = {isa = PBXBuildFile; fileRef = 8342D9FC2131150200D16B1D /* 4481.wav */; };
|
||||
8342FD7A2150C51100D141F4 /* GIGaFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 8342FD792150C51100D141F4 /* GIGaFileManager.m */; };
|
||||
8342FD7D2150F94600D141F4 /* AppVerionDescriptionVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 8342FD7C2150F94600D141F4 /* AppVerionDescriptionVC.m */; };
|
||||
8342FD822150FA1500D141F4 /* AppVersionDescCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8342FD802150FA1500D141F4 /* AppVersionDescCell.m */; };
|
||||
8342FD832150FA1500D141F4 /* AppVersionDescCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8342FD812150FA1500D141F4 /* AppVersionDescCell.xib */; };
|
||||
@@ -92,6 +91,24 @@
|
||||
836EE5D42136454500F0ABB2 /* RegistGetSMSCodeRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 836EE5D32136454500F0ABB2 /* RegistGetSMSCodeRequest.m */; };
|
||||
836EE5D7213645E300F0ABB2 /* GiGaBaseAPiRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 836EE5D6213645E300F0ABB2 /* GiGaBaseAPiRequest.m */; };
|
||||
836EE5DA2136716100F0ABB2 /* NSTimer+Convenience.m in Sources */ = {isa = PBXBuildFile; fileRef = 836EE5D82136716000F0ABB2 /* NSTimer+Convenience.m */; };
|
||||
8376B81A2154816800AB79F8 /* SHareTestImageVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 8376B8182154816800AB79F8 /* SHareTestImageVC.m */; };
|
||||
8376B81B2154816800AB79F8 /* SHareTestImageVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8376B8192154816800AB79F8 /* SHareTestImageVC.xib */; };
|
||||
8376B81E2154897700AB79F8 /* GIGaUserFileHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8376B81D2154897700AB79F8 /* GIGaUserFileHelper.m */; };
|
||||
8376B8202154913E00AB79F8 /* city.json in Resources */ = {isa = PBXBuildFile; fileRef = 8376B81F2154913E00AB79F8 /* city.json */; };
|
||||
8376B8232154927300AB79F8 /* GIGaMaskShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8376B8222154927300AB79F8 /* GIGaMaskShareViewController.m */; };
|
||||
8376B8282154A0A200AB79F8 /* MaskTimeEndViewImgaeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8376B8262154A0A200AB79F8 /* MaskTimeEndViewImgaeCell.m */; };
|
||||
8376B8292154A0A200AB79F8 /* MaskTimeEndViewImgaeCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8376B8272154A0A200AB79F8 /* MaskTimeEndViewImgaeCell.xib */; };
|
||||
8376B82D2154A35100AB79F8 /* MaskTimeTimeViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8376B82B2154A35100AB79F8 /* MaskTimeTimeViewCell.m */; };
|
||||
8376B82E2154A35100AB79F8 /* MaskTimeTimeViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8376B82C2154A35100AB79F8 /* MaskTimeTimeViewCell.xib */; };
|
||||
8376B8322154A39200AB79F8 /* MaskTimeEndActionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8376B8302154A39200AB79F8 /* MaskTimeEndActionViewCell.m */; };
|
||||
8376B8332154A39200AB79F8 /* MaskTimeEndActionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8376B8312154A39200AB79F8 /* MaskTimeEndActionViewCell.xib */; };
|
||||
8376B8362154C74300AB79F8 /* ShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8376B8352154C74300AB79F8 /* ShareViewController.m */; };
|
||||
8376B83B2154CE8C00AB79F8 /* MaskTimeShareViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8376B8392154CE8C00AB79F8 /* MaskTimeShareViewCell.m */; };
|
||||
8376B83C2154CE8C00AB79F8 /* MaskTimeShareViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8376B83A2154CE8C00AB79F8 /* MaskTimeShareViewCell.xib */; };
|
||||
8376B8402154CEB200AB79F8 /* MaskShareTimeMidViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8376B83E2154CEB200AB79F8 /* MaskShareTimeMidViewCell.m */; };
|
||||
8376B8412154CEB200AB79F8 /* MaskShareTimeMidViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8376B83F2154CEB200AB79F8 /* MaskShareTimeMidViewCell.xib */; };
|
||||
8376B8452154CEC800AB79F8 /* MaskShareBoootomViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8376B8432154CEC800AB79F8 /* MaskShareBoootomViewCell.m */; };
|
||||
8376B8462154CEC800AB79F8 /* MaskShareBoootomViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8376B8442154CEC800AB79F8 /* MaskShareBoootomViewCell.xib */; };
|
||||
83773FBC214769230014EE4C /* ExercisesModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 83773FBB214769230014EE4C /* ExercisesModel.m */; };
|
||||
83773FBF214791E10014EE4C /* GIGaQuestionSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 83773FBE214791E10014EE4C /* GIGaQuestionSlider.m */; };
|
||||
83773FC221479FED0014EE4C /* UIColor+HexColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 83773FC121479FED0014EE4C /* UIColor+HexColor.m */; };
|
||||
@@ -121,7 +138,6 @@
|
||||
8384F0EB21533542002C19F0 /* MaskResultMinViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8384F0EA21533542002C19F0 /* MaskResultMinViewCell.m */; };
|
||||
8384F0EE2153355A002C19F0 /* MaskResultShareViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8384F0ED2153355A002C19F0 /* MaskResultShareViewCell.m */; };
|
||||
8384F0F121538146002C19F0 /* MaskResultCandView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8384F0F021538146002C19F0 /* MaskResultCandView.m */; };
|
||||
8384F0F52153A9C3002C19F0 /* city.json in Resources */ = {isa = PBXBuildFile; fileRef = 8384F0F42153A9C3002C19F0 /* city.json */; };
|
||||
838500DC2137F3F7003514A3 /* GiGaAttributedLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 838500DB2137F3F7003514A3 /* GiGaAttributedLabel.m */; };
|
||||
838762D3214B9D120039D241 /* GIGaUserInfoAvatorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 838762D1214B9D120039D241 /* GIGaUserInfoAvatorCell.m */; };
|
||||
838762D4214B9D120039D241 /* GIGaUserInfoAvatorCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 838762D2214B9D120039D241 /* GIGaUserInfoAvatorCell.xib */; };
|
||||
@@ -241,8 +257,6 @@
|
||||
8341271F2152AEFB001DDB36 /* GIGaMaskTimeUseRecordVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIGaMaskTimeUseRecordVC.h; sourceTree = "<group>"; };
|
||||
834127202152AEFB001DDB36 /* GIGaMaskTimeUseRecordVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GIGaMaskTimeUseRecordVC.m; sourceTree = "<group>"; };
|
||||
8342D9FC2131150200D16B1D /* 4481.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = 4481.wav; sourceTree = "<group>"; };
|
||||
8342FD782150C51100D141F4 /* GIGaFileManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIGaFileManager.h; sourceTree = "<group>"; };
|
||||
8342FD792150C51100D141F4 /* GIGaFileManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GIGaFileManager.m; sourceTree = "<group>"; };
|
||||
8342FD7B2150F94600D141F4 /* AppVerionDescriptionVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppVerionDescriptionVC.h; sourceTree = "<group>"; };
|
||||
8342FD7C2150F94600D141F4 /* AppVerionDescriptionVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppVerionDescriptionVC.m; sourceTree = "<group>"; };
|
||||
8342FD7F2150FA1500D141F4 /* AppVersionDescCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppVersionDescCell.h; sourceTree = "<group>"; };
|
||||
@@ -345,6 +359,35 @@
|
||||
836EE5D6213645E300F0ABB2 /* GiGaBaseAPiRequest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaBaseAPiRequest.m; sourceTree = "<group>"; };
|
||||
836EE5D82136716000F0ABB2 /* NSTimer+Convenience.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTimer+Convenience.m"; sourceTree = "<group>"; };
|
||||
836EE5D92136716000F0ABB2 /* NSTimer+Convenience.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTimer+Convenience.h"; sourceTree = "<group>"; };
|
||||
8376B8172154816800AB79F8 /* SHareTestImageVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SHareTestImageVC.h; sourceTree = "<group>"; };
|
||||
8376B8182154816800AB79F8 /* SHareTestImageVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SHareTestImageVC.m; sourceTree = "<group>"; };
|
||||
8376B8192154816800AB79F8 /* SHareTestImageVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SHareTestImageVC.xib; sourceTree = "<group>"; };
|
||||
8376B81C2154897700AB79F8 /* GIGaUserFileHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIGaUserFileHelper.h; sourceTree = "<group>"; };
|
||||
8376B81D2154897700AB79F8 /* GIGaUserFileHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GIGaUserFileHelper.m; sourceTree = "<group>"; };
|
||||
8376B81F2154913E00AB79F8 /* city.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = city.json; sourceTree = "<group>"; };
|
||||
8376B8212154927300AB79F8 /* GIGaMaskShareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIGaMaskShareViewController.h; sourceTree = "<group>"; };
|
||||
8376B8222154927300AB79F8 /* GIGaMaskShareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GIGaMaskShareViewController.m; sourceTree = "<group>"; };
|
||||
8376B8252154A0A200AB79F8 /* MaskTimeEndViewImgaeCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MaskTimeEndViewImgaeCell.h; path = GIGA/Modules/Mask/View/MaskTimeEndViewImgaeCell.h; sourceTree = SOURCE_ROOT; };
|
||||
8376B8262154A0A200AB79F8 /* MaskTimeEndViewImgaeCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MaskTimeEndViewImgaeCell.m; path = GIGA/Modules/Mask/View/MaskTimeEndViewImgaeCell.m; sourceTree = SOURCE_ROOT; };
|
||||
8376B8272154A0A200AB79F8 /* MaskTimeEndViewImgaeCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MaskTimeEndViewImgaeCell.xib; path = GIGA/Modules/Mask/View/MaskTimeEndViewImgaeCell.xib; sourceTree = SOURCE_ROOT; };
|
||||
8376B82A2154A35100AB79F8 /* MaskTimeTimeViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskTimeTimeViewCell.h; sourceTree = "<group>"; };
|
||||
8376B82B2154A35100AB79F8 /* MaskTimeTimeViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskTimeTimeViewCell.m; sourceTree = "<group>"; };
|
||||
8376B82C2154A35100AB79F8 /* MaskTimeTimeViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MaskTimeTimeViewCell.xib; sourceTree = "<group>"; };
|
||||
8376B82F2154A39200AB79F8 /* MaskTimeEndActionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskTimeEndActionViewCell.h; sourceTree = "<group>"; };
|
||||
8376B8302154A39200AB79F8 /* MaskTimeEndActionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskTimeEndActionViewCell.m; sourceTree = "<group>"; };
|
||||
8376B8312154A39200AB79F8 /* MaskTimeEndActionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MaskTimeEndActionViewCell.xib; sourceTree = "<group>"; };
|
||||
8376B8342154C74300AB79F8 /* ShareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareViewController.h; sourceTree = "<group>"; };
|
||||
8376B8352154C74300AB79F8 /* ShareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareViewController.m; sourceTree = "<group>"; };
|
||||
8376B8382154CE8C00AB79F8 /* MaskTimeShareViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskTimeShareViewCell.h; sourceTree = "<group>"; };
|
||||
8376B8392154CE8C00AB79F8 /* MaskTimeShareViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskTimeShareViewCell.m; sourceTree = "<group>"; };
|
||||
8376B83A2154CE8C00AB79F8 /* MaskTimeShareViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MaskTimeShareViewCell.xib; sourceTree = "<group>"; };
|
||||
8376B83D2154CEB200AB79F8 /* MaskShareTimeMidViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskShareTimeMidViewCell.h; sourceTree = "<group>"; };
|
||||
8376B83E2154CEB200AB79F8 /* MaskShareTimeMidViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskShareTimeMidViewCell.m; sourceTree = "<group>"; };
|
||||
8376B83F2154CEB200AB79F8 /* MaskShareTimeMidViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MaskShareTimeMidViewCell.xib; sourceTree = "<group>"; };
|
||||
8376B8422154CEC800AB79F8 /* MaskShareBoootomViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskShareBoootomViewCell.h; sourceTree = "<group>"; };
|
||||
8376B8432154CEC800AB79F8 /* MaskShareBoootomViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskShareBoootomViewCell.m; sourceTree = "<group>"; };
|
||||
8376B8442154CEC800AB79F8 /* MaskShareBoootomViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MaskShareBoootomViewCell.xib; sourceTree = "<group>"; };
|
||||
8376B87C2154F0B100AB79F8 /* JSONModel.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = JSONModel.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
83773FBA214769230014EE4C /* ExercisesModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExercisesModel.h; sourceTree = "<group>"; };
|
||||
83773FBB214769230014EE4C /* ExercisesModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExercisesModel.m; sourceTree = "<group>"; };
|
||||
83773FBD214791E10014EE4C /* GIGaQuestionSlider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIGaQuestionSlider.h; sourceTree = "<group>"; };
|
||||
@@ -400,7 +443,6 @@
|
||||
8384F0ED2153355A002C19F0 /* MaskResultShareViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskResultShareViewCell.m; sourceTree = "<group>"; };
|
||||
8384F0EF21538146002C19F0 /* MaskResultCandView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskResultCandView.h; sourceTree = "<group>"; };
|
||||
8384F0F021538146002C19F0 /* MaskResultCandView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskResultCandView.m; sourceTree = "<group>"; };
|
||||
8384F0F42153A9C3002C19F0 /* city.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = city.json; sourceTree = "<group>"; };
|
||||
838500DA2137F3F7003514A3 /* GiGaAttributedLabel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaAttributedLabel.h; sourceTree = "<group>"; };
|
||||
838500DB2137F3F7003514A3 /* GiGaAttributedLabel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaAttributedLabel.m; sourceTree = "<group>"; };
|
||||
838762D0214B9D120039D241 /* GIGaUserInfoAvatorCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIGaUserInfoAvatorCell.h; sourceTree = "<group>"; };
|
||||
@@ -515,6 +557,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8361B41721217DA000238FEB /* Foundation.framework in Frameworks */,
|
||||
8357ADD52123F5EC000816F2 /* libsqlite3.tbd in Frameworks */,
|
||||
8361B42321217DFF00238FEB /* libresolv.tbd in Frameworks */,
|
||||
8361B42121217DF000238FEB /* UserNotifications.framework in Frameworks */,
|
||||
@@ -522,7 +565,6 @@
|
||||
8361B41D21217DCD00238FEB /* libz.tbd in Frameworks */,
|
||||
8361B41B21217DBA00238FEB /* Security.framework in Frameworks */,
|
||||
8361B41921217DAD00238FEB /* UIKit.framework in Frameworks */,
|
||||
8361B41721217DA000238FEB /* Foundation.framework in Frameworks */,
|
||||
8361B41521217D9200238FEB /* CoreGraphics.framework in Frameworks */,
|
||||
8361B41321217D7E00238FEB /* SystemConfiguration.framework in Frameworks */,
|
||||
8361B41121217CA100238FEB /* CoreTelephony.framework in Frameworks */,
|
||||
@@ -582,7 +624,7 @@
|
||||
833DE8E02150169F009D4329 /* JYAddressPicker */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8384F0F42153A9C3002C19F0 /* city.json */,
|
||||
8376B81F2154913E00AB79F8 /* city.json */,
|
||||
833DE8E12150169F009D4329 /* JYAddressPicker.h */,
|
||||
833DE8E32150169F009D4329 /* JYAddressPicker.m */,
|
||||
);
|
||||
@@ -681,6 +723,10 @@
|
||||
83346AD6212C18F50054D597 /* GiGaAppGaurdVC.m */,
|
||||
839290072134F4C40077D2E8 /* GiGaFlingCommitVC.h */,
|
||||
839290082134F4C40077D2E8 /* GiGaFlingCommitVC.m */,
|
||||
8376B8212154927300AB79F8 /* GIGaMaskShareViewController.h */,
|
||||
8376B8222154927300AB79F8 /* GIGaMaskShareViewController.m */,
|
||||
8376B8342154C74300AB79F8 /* ShareViewController.h */,
|
||||
8376B8352154C74300AB79F8 /* ShareViewController.m */,
|
||||
);
|
||||
path = Controller;
|
||||
sourceTree = "<group>";
|
||||
@@ -697,6 +743,8 @@
|
||||
8354B3832121BB00004F448F /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8376B8372154CE5B00AB79F8 /* MaskSharesViews */,
|
||||
8376B82421549FEB00AB79F8 /* MaskTimeShareCells */,
|
||||
8392900B2134F9F80077D2E8 /* GiGaCommentView.h */,
|
||||
8392900A2134F9F80077D2E8 /* GiGaCommentView.m */,
|
||||
83A2270A212A97ED00B3E75C /* MaskViewBootomWaringView.h */,
|
||||
@@ -716,8 +764,8 @@
|
||||
8357ADC82123BFCA000816F2 /* GiGaUserManager.m */,
|
||||
8357ADD62124027D000816F2 /* GiGaUserDefault.h */,
|
||||
8357ADD72124027D000816F2 /* GiGaUserDefault.m */,
|
||||
8342FD782150C51100D141F4 /* GIGaFileManager.h */,
|
||||
8342FD792150C51100D141F4 /* GIGaFileManager.m */,
|
||||
8376B81C2154897700AB79F8 /* GIGaUserFileHelper.h */,
|
||||
8376B81D2154897700AB79F8 /* GIGaUserFileHelper.m */,
|
||||
);
|
||||
path = GiGaUserDB;
|
||||
sourceTree = "<group>";
|
||||
@@ -1013,6 +1061,38 @@
|
||||
path = APi;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8376B82421549FEB00AB79F8 /* MaskTimeShareCells */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8376B8252154A0A200AB79F8 /* MaskTimeEndViewImgaeCell.h */,
|
||||
8376B8262154A0A200AB79F8 /* MaskTimeEndViewImgaeCell.m */,
|
||||
8376B8272154A0A200AB79F8 /* MaskTimeEndViewImgaeCell.xib */,
|
||||
8376B82A2154A35100AB79F8 /* MaskTimeTimeViewCell.h */,
|
||||
8376B82B2154A35100AB79F8 /* MaskTimeTimeViewCell.m */,
|
||||
8376B82C2154A35100AB79F8 /* MaskTimeTimeViewCell.xib */,
|
||||
8376B82F2154A39200AB79F8 /* MaskTimeEndActionViewCell.h */,
|
||||
8376B8302154A39200AB79F8 /* MaskTimeEndActionViewCell.m */,
|
||||
8376B8312154A39200AB79F8 /* MaskTimeEndActionViewCell.xib */,
|
||||
);
|
||||
path = MaskTimeShareCells;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8376B8372154CE5B00AB79F8 /* MaskSharesViews */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8376B8382154CE8C00AB79F8 /* MaskTimeShareViewCell.h */,
|
||||
8376B8392154CE8C00AB79F8 /* MaskTimeShareViewCell.m */,
|
||||
8376B83A2154CE8C00AB79F8 /* MaskTimeShareViewCell.xib */,
|
||||
8376B83D2154CEB200AB79F8 /* MaskShareTimeMidViewCell.h */,
|
||||
8376B83E2154CEB200AB79F8 /* MaskShareTimeMidViewCell.m */,
|
||||
8376B83F2154CEB200AB79F8 /* MaskShareTimeMidViewCell.xib */,
|
||||
8376B8422154CEC800AB79F8 /* MaskShareBoootomViewCell.h */,
|
||||
8376B8432154CEC800AB79F8 /* MaskShareBoootomViewCell.m */,
|
||||
8376B8442154CEC800AB79F8 /* MaskShareBoootomViewCell.xib */,
|
||||
);
|
||||
path = MaskSharesViews;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
83835B9D212E4335001480F2 /* MessageCenter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -1077,6 +1157,9 @@
|
||||
83835BC2212E677C001480F2 /* GiGaQuestionVC.m */,
|
||||
8384643F214A4BFF00F12B33 /* MaskTestResultVC.h */,
|
||||
83846440214A4BFF00F12B33 /* MaskTestResultVC.m */,
|
||||
8376B8172154816800AB79F8 /* SHareTestImageVC.h */,
|
||||
8376B8182154816800AB79F8 /* SHareTestImageVC.m */,
|
||||
8376B8192154816800AB79F8 /* SHareTestImageVC.xib */,
|
||||
);
|
||||
path = Controller;
|
||||
sourceTree = "<group>";
|
||||
@@ -1334,6 +1417,7 @@
|
||||
F3264CFCC2F2D369DC49BD1A /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8376B87C2154F0B100AB79F8 /* JSONModel.framework */,
|
||||
8357ADD42123F5EC000816F2 /* libsqlite3.tbd */,
|
||||
8361B42221217DFF00238FEB /* libresolv.tbd */,
|
||||
8361B42021217DF000238FEB /* UserNotifications.framework */,
|
||||
@@ -1462,32 +1546,39 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8376B8292154A0A200AB79F8 /* MaskTimeEndViewImgaeCell.xib in Resources */,
|
||||
83346AC6212BBC8C0054D597 /* GiGaRegistViewController.xib in Resources */,
|
||||
8351474C21523B7400B25A88 /* GIGaUserChangeMobleCell.xib in Resources */,
|
||||
8376B83C2154CE8C00AB79F8 /* MaskTimeShareViewCell.xib in Resources */,
|
||||
838762DE214B9F140039D241 /* GIGaUserWeChatViewCell.xib in Resources */,
|
||||
83BFAE6D213CD0E3004EF801 /* GiGaMineInfoViewCell.xib in Resources */,
|
||||
8376B81B2154816800AB79F8 /* SHareTestImageVC.xib in Resources */,
|
||||
8376B82E2154A35100AB79F8 /* MaskTimeTimeViewCell.xib in Resources */,
|
||||
8361B3D6212155C300238FEB /* LaunchScreen.storyboard in Resources */,
|
||||
838762E3214B9F580039D241 /* GiGaUserSexViewCell.xib in Resources */,
|
||||
838388DA2130046D00D14C53 /* emojizone.mp4 in Resources */,
|
||||
83A22720212AC8C100B3E75C /* GiGaUserLoginVC.xib in Resources */,
|
||||
838762D4214B9D120039D241 /* GIGaUserInfoAvatorCell.xib in Resources */,
|
||||
838388C4212F934400D14C53 /* pomodoSound.m4a in Resources */,
|
||||
8376B8462154CEC800AB79F8 /* MaskShareBoootomViewCell.xib in Resources */,
|
||||
83BFAE78213CDE91004EF801 /* GiGaSettingsViewCell.xib in Resources */,
|
||||
83346AC1212BB50A0054D597 /* PassWordResetVC.xib in Resources */,
|
||||
83BDC0592147B89900E74E0D /* GiGaAnswerViewCell.xib in Resources */,
|
||||
8351473D215215C500B25A88 /* GiGAUserInfoCell.xib in Resources */,
|
||||
83346AD1212BF5B70054D597 /* useragreement.html in Resources */,
|
||||
8376B8332154A39200AB79F8 /* MaskTimeEndActionViewCell.xib in Resources */,
|
||||
838762D9214B9EF80039D241 /* GIGaUserIDViewCell.xib in Resources */,
|
||||
838762E8214B9FA60039D241 /* GIGaUserCityViewCell.xib in Resources */,
|
||||
8342FD8B2151095100D141F4 /* AppVersionLogoCell.xib in Resources */,
|
||||
8384F0F52153A9C3002C19F0 /* city.json in Resources */,
|
||||
83BFAE68213CCF10004EF801 /* GiGaMineUserViewCell.xib in Resources */,
|
||||
8376B8202154913E00AB79F8 /* city.json in Resources */,
|
||||
8351474221521C2A00B25A88 /* GIGaChangePassVC.xib in Resources */,
|
||||
8340BFA9213E65CA008F22E4 /* GIGACommonLocalizabe.strings in Resources */,
|
||||
83835BA8212E4748001480F2 /* MAssaageCenterCell.xib in Resources */,
|
||||
8361B3D3212155C300238FEB /* Assets.xcassets in Resources */,
|
||||
8340BFA6213E6514008F22E4 /* Localizable.strings in Resources */,
|
||||
8361B3D1212155C200238FEB /* Main.storyboard in Resources */,
|
||||
8376B8412154CEB200AB79F8 /* MaskShareTimeMidViewCell.xib in Resources */,
|
||||
8340BFAB213E665D008F22E4 /* GIGAUserLocalizable.strings in Resources */,
|
||||
8342D9FD2131150200D16B1D /* 4481.wav in Resources */,
|
||||
83835BB0212E4FCD001480F2 /* MessageListViewCell.xib in Resources */,
|
||||
@@ -1544,6 +1635,7 @@
|
||||
"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/IQKeyboardManager/IQKeyboardManager.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/JSONModel/JSONModel.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/LBXScan/LBXScan.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/LKDBHelper/LKDBHelper.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/MBProgressHUD/MBProgressHUD.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/MJRefresh/MJRefresh.framework",
|
||||
@@ -1564,6 +1656,7 @@
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/IQKeyboardManager.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JSONModel.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LBXScan.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LKDBHelper.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MBProgressHUD.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJRefresh.framework",
|
||||
@@ -1597,6 +1690,7 @@
|
||||
8351474B21523B7400B25A88 /* GIGaUserChangeMobleCell.m in Sources */,
|
||||
8349585C212511040064DB6C /* AppDelegate+ThirdParty.m in Sources */,
|
||||
83048481214F489000603CE7 /* GiGaUserJobViewCell.m in Sources */,
|
||||
8376B83B2154CE8C00AB79F8 /* MaskTimeShareViewCell.m in Sources */,
|
||||
83BFAE73213CDB58004EF801 /* GiSysSettingsVC.m in Sources */,
|
||||
838762D8214B9EF80039D241 /* GIGaUserIDViewCell.m in Sources */,
|
||||
838500DC2137F3F7003514A3 /* GiGaAttributedLabel.m in Sources */,
|
||||
@@ -1609,6 +1703,7 @@
|
||||
8361B3CE212155C200238FEB /* ViewController.m in Sources */,
|
||||
8361B4382121847600238FEB /* UINavigationBar+Custom.m in Sources */,
|
||||
83BFAE6C213CD0E3004EF801 /* GiGaMineInfoViewCell.m in Sources */,
|
||||
8376B8402154CEB200AB79F8 /* MaskShareTimeMidViewCell.m in Sources */,
|
||||
8390116B214E20B2004CA790 /* LYSDateContentView.m in Sources */,
|
||||
83BC8A872148BE8A00820437 /* NYPopover.m in Sources */,
|
||||
83048486214FACE700603CE7 /* JobMaskButton.m in Sources */,
|
||||
@@ -1652,8 +1747,10 @@
|
||||
838388D3212FB7D700D14C53 /* JXTAlertController.m in Sources */,
|
||||
833DA7762122A62000A5C614 /* GiGaMaskTaskViewController.m in Sources */,
|
||||
836EE5D7213645E300F0ABB2 /* GiGaBaseAPiRequest.m in Sources */,
|
||||
8376B8232154927300AB79F8 /* GIGaMaskShareViewController.m in Sources */,
|
||||
83773FBC214769230014EE4C /* ExercisesModel.m in Sources */,
|
||||
8384F0EE2153355A002C19F0 /* MaskResultShareViewCell.m in Sources */,
|
||||
8376B8452154CEC800AB79F8 /* MaskShareBoootomViewCell.m in Sources */,
|
||||
83835BD0212E8B9C001480F2 /* GiGaQuestionModel.m in Sources */,
|
||||
83835BAF212E4FCD001480F2 /* MessageListViewCell.m in Sources */,
|
||||
8361B3D9212155C300238FEB /* main.m in Sources */,
|
||||
@@ -1666,7 +1763,9 @@
|
||||
83835BBC212E60E5001480F2 /* MessageDetailViewController.m in Sources */,
|
||||
83835BCD212E856A001480F2 /* NSString+MD5.m in Sources */,
|
||||
8340BFA2213E60DD008F22E4 /* GIGAMBHUDHelper.m in Sources */,
|
||||
8376B8322154A39200AB79F8 /* MaskTimeEndActionViewCell.m in Sources */,
|
||||
8345C13621414D3B00051717 /* NSString+Unicode.m in Sources */,
|
||||
8376B81A2154816800AB79F8 /* SHareTestImageVC.m in Sources */,
|
||||
83835BC7212E7BBF001480F2 /* GiGaNavTitileView.m in Sources */,
|
||||
8361B4322121832800238FEB /* GiGaBaseViewController.m in Sources */,
|
||||
8338F6B92142504E00B4780B /* LXCustomSwith.m in Sources */,
|
||||
@@ -1680,12 +1779,14 @@
|
||||
83835BB9212E51B0001480F2 /* GiGaSystemViewController.m in Sources */,
|
||||
8361B40421215E0C00238FEB /* LXCountTimer.m in Sources */,
|
||||
8357ADC52123BEBD000816F2 /* GiGaUser.m in Sources */,
|
||||
8376B82D2154A35100AB79F8 /* MaskTimeTimeViewCell.m in Sources */,
|
||||
83BFAE67213CCF10004EF801 /* GiGaMineUserViewCell.m in Sources */,
|
||||
8392900C2134F9F80077D2E8 /* GiGaCommentView.m in Sources */,
|
||||
839290062134F4240077D2E8 /* LXDanMuManager.m in Sources */,
|
||||
8376B81E2154897700AB79F8 /* GIGaUserFileHelper.m in Sources */,
|
||||
8376B8362154C74300AB79F8 /* ShareViewController.m in Sources */,
|
||||
833DE8E52150169F009D4329 /* JYAddressPicker.m in Sources */,
|
||||
834127212152AEFB001DDB36 /* GIGaMaskTimeUseRecordVC.m in Sources */,
|
||||
8342FD7A2150C51100D141F4 /* GIGaFileManager.m in Sources */,
|
||||
83901171214E20B2004CA790 /* LYSDatePickerLabel.m in Sources */,
|
||||
838762E2214B9F580039D241 /* GiGaUserSexViewCell.m in Sources */,
|
||||
839290052134F4240077D2E8 /* LXDanMuTrackView.m in Sources */,
|
||||
@@ -1693,6 +1794,7 @@
|
||||
83901170214E20B2004CA790 /* LYSDateHeaderViewController.m in Sources */,
|
||||
835060A5212D3536007E6220 /* AppDelegate+GiGaConfig.m in Sources */,
|
||||
835147312151E4EF00B25A88 /* GIGaAboutUsVC.m in Sources */,
|
||||
8376B8282154A0A200AB79F8 /* MaskTimeEndViewImgaeCell.m in Sources */,
|
||||
83901174214E20B2004CA790 /* LYSDateIndicatorViewController.m in Sources */,
|
||||
83E40B2B21218B6F008149C4 /* GiGaExercisesViewController.m in Sources */,
|
||||
8390117B214E20B2004CA790 /* LYSDatePickerHeaderView.m in Sources */,
|
||||
@@ -1902,6 +2004,10 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/GIGA/Common/libs/ZbarSDK/ZBarSDK",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.gigamask.ios;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE = "";
|
||||
@@ -1932,6 +2038,10 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/GIGA/Common/libs/ZbarSDK/ZBarSDK",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.gigamask.ios;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE = "";
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<key>GIGA.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>18</integer>
|
||||
<integer>19</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "app_logo@2x.png",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "masktie_clock@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "result_line@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "result_logo@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "result_moon@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "result_oillider@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "result_percent@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "result_push@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "result_time@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "result_water@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "result_waterlider@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "result_wmz@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "result_wmzzz@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "result_ylwmz@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "resultback_one@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "resultback_three@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "resultback_two@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "share_logo@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "share_one@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 4.6 KiB |
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "share_two@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 785 B |
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "sharebg_1@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 271 KiB |
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "sharebg_2@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 404 KiB |
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "sharebg_3@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 420 KiB |
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "sharebg_4@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 248 KiB |
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "sharebg_5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 346 KiB |
@@ -16,5 +16,6 @@
|
||||
-(void)removeItemAtPath:(NSString *)filePath;
|
||||
- (void)saveAdImageWithUrl:(NSString *)imageUrl imageName:(NSString *)imageName success:(void (^)(void))success
|
||||
failure:(void (^)(NSError *err))failure;
|
||||
-(void)saveImaeToAlBum:(UIImage *)image;
|
||||
|
||||
@end
|
||||
|
||||
@@ -64,5 +64,27 @@
|
||||
} });
|
||||
}
|
||||
|
||||
-(void)saveImaeToAlBum:(UIImage *)image{
|
||||
if (image != nil) {
|
||||
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)image: (UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
|
||||
|
||||
NSString *msg = nil ;
|
||||
|
||||
if(error != NULL){
|
||||
|
||||
msg = @"保存图片失败" ;
|
||||
|
||||
}else{
|
||||
|
||||
msg = @"保存图片成功,可到相册查看" ;
|
||||
|
||||
}
|
||||
[[UIApplication sharedApplication].keyWindow makeToast:msg duration:1.6 position:CSToastPositionCenter];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
//
|
||||
// GIGaFileManager.h
|
||||
// GIGaUserFileHelper.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/18.
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface GIGaFileManager : NSObject
|
||||
@interface GIGaUserFileHelper : NSObject
|
||||
|
||||
+(void)savaUserAvatorWith:(NSString *)userId image:(UIImage *)image;
|
||||
+(UIImage *)getUserAvatorWith:(NSString *)userId;
|
||||
+ (UIImage *) scaleFromImage: (UIImage *) image toSize: (CGSize) size;
|
||||
+ (UIImage *)thumbnailWithImageWithoutScale:(UIImage *)image size:(CGSize)asize;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
@@ -1,16 +1,14 @@
|
||||
|
||||
//
|
||||
// GIGaFileManager.m
|
||||
// GIGaUserFileHelper.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/18.
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "GIGaFileManager.h"
|
||||
|
||||
@implementation GIGaFileManager
|
||||
#import "GIGaUserFileHelper.h"
|
||||
|
||||
@implementation GIGaUserFileHelper
|
||||
+(void)savaUserAvatorWith:(NSString *)userId image:(UIImage *)image{
|
||||
if (!userId) {
|
||||
GILog(@"userID nil !!!");
|
||||
@@ -83,5 +81,4 @@
|
||||
return newimage;
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -11,15 +11,22 @@
|
||||
|
||||
// Include any system framework and library headers here that should be included in all compilation units.
|
||||
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
|
||||
#import "GIGA.h"
|
||||
#ifdef __OBJC__
|
||||
#import "AFNetworking.h"
|
||||
#import <JSONModel/JSONModel.h>
|
||||
#import <UMCommon/UMCommon.h>
|
||||
#import <UMAnalytics/MobClick.h>
|
||||
|
||||
#endif
|
||||
|
||||
#import "GIGA.h"
|
||||
//#import "AFNetworking.h"
|
||||
//#import <JSONModel/JSONModel.h>
|
||||
#import "UIView+Toast.h"
|
||||
#import "JXTAlertManagerHeader.h"
|
||||
#import "Masonry.h"
|
||||
#import "GiGaHelper.h"
|
||||
#import <UMCommon/UMCommon.h>
|
||||
#import <UMAnalytics/MobClick.h>
|
||||
|
||||
#import "MobClickList.h"
|
||||
#import "TTTAttributedLabel.h"
|
||||
#import "GiGaUserManager.h"
|
||||
|
||||
@@ -2,6 +2,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>NSPhotoLibraryAddUsageDescription</key>
|
||||
<string>保存图片到相册</string>
|
||||
<key>BuglyAppIDString</key>
|
||||
<string>8f49773330</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// GIGaMaskShareViewController.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "GiGaBaseViewController.h"
|
||||
|
||||
@interface GIGaMaskShareViewController : GiGaBaseViewController
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,113 @@
|
||||
//
|
||||
// GIGaMaskShareViewController.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "GIGaMaskShareViewController.h"
|
||||
#import "MaskTimeEndViewImgaeCell.h"
|
||||
#import "MaskTimeTimeViewCell.h"
|
||||
#import "MaskTimeEndActionViewCell.h"
|
||||
#import "ShareViewController.h"
|
||||
|
||||
@interface GIGaMaskShareViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation GIGaMaskShareViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self addNavTitile:@"面膜时间"];
|
||||
[self.view addSubview:self.tableView];
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.backgroundColor = [UIColor whiteColor];
|
||||
self.tableView.separatorStyle = UITableViewCellSelectionStyleNone;
|
||||
self.tableView.sectionFooterHeight = 0;
|
||||
self.tableView.estimatedSectionFooterHeight= 0;
|
||||
self.tableView.estimatedSectionHeaderHeight = 0;
|
||||
//self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0,self.view.frame.size.width, 30)];
|
||||
self.tableView.frame = CGRectMake(0,0,KMainW, self.view.frame.size.height);
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 3;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.section == 0) {
|
||||
MaskTimeEndViewImgaeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskTimeEndViewImgaeCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTimeEndViewImgaeCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
return cell;
|
||||
}else if (indexPath.section == 1){
|
||||
MaskTimeTimeViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskTimeTimeViewCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTimeTimeViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
return cell;
|
||||
|
||||
}else if (indexPath.section == 2){
|
||||
MaskTimeEndActionViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskTimeEndActionViewCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTimeEndActionViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
[cell.changeBackBtn addTarget:self action:@selector(changeBackBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
[cell.shareBtn addTarget:self action:@selector(shareBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
return cell;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.section == 0) {
|
||||
return 285;
|
||||
}else if (indexPath.section == 1){
|
||||
return 205;
|
||||
}
|
||||
|
||||
return 90;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||||
return 0.1;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
|
||||
|
||||
{ return 0.1;
|
||||
|
||||
}
|
||||
|
||||
#pragma mark changeBackBtnAction
|
||||
-(void)changeBackBtnAction{
|
||||
|
||||
}
|
||||
|
||||
#pragma mark share
|
||||
-(void)shareBtnAction{
|
||||
|
||||
ShareViewController *share = [[ShareViewController alloc] init];
|
||||
[self presentViewController:share animated:NO completion:nil];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -32,6 +32,7 @@
|
||||
#import "GiGaUserManager.h"
|
||||
#import "GiGaBaseAPiRequest.h"
|
||||
#import "MaskTestResultVC.h"
|
||||
#import "GIGaMaskShareViewController.h"
|
||||
|
||||
|
||||
@interface GiGaMaskTaskViewController ()<MaskCirCularProGressViewDelegate>
|
||||
@@ -488,18 +489,20 @@
|
||||
|
||||
#pragma mark 开始测试
|
||||
-(void)testBtnAcion:(UIButton *)btn{
|
||||
NSDictionary *dic = @{
|
||||
@"dryness":@"0.41",
|
||||
@"drynessPercent":@"41%",
|
||||
@"mask":@"",
|
||||
@"minute":@"19",
|
||||
@"oiliness":@"0.59",
|
||||
@"oilinessPercent":@"59%"
|
||||
};
|
||||
MaskTestResult *model =[[MaskTestResult alloc] initWithDictionary:dic error:nil];
|
||||
MaskTestResultVC *resultVC = [[MaskTestResultVC alloc] init];
|
||||
resultVC.model = model;
|
||||
[self.navigationController pushViewController:resultVC animated:YES];
|
||||
// NSDictionary *dic = @{
|
||||
// @"dryness":@"0.41",
|
||||
// @"drynessPercent":@"41%",
|
||||
// @"mask":@"",
|
||||
// @"minute":@"19",
|
||||
// @"oiliness":@"0.59",
|
||||
// @"oilinessPercent":@"59%"
|
||||
// };
|
||||
// MaskTestResult *model =[[MaskTestResult alloc] initWithDictionary:dic error:nil];
|
||||
// MaskTestResultVC *resultVC = [[MaskTestResultVC alloc] init];
|
||||
// resultVC.model = model;
|
||||
// [self.navigationController pushViewController:resultVC animated:YES];
|
||||
|
||||
[self showAlertGoShareMaskTime];
|
||||
|
||||
return;
|
||||
GiGaQuestionVC *questionVC = [[GiGaQuestionVC alloc] init];
|
||||
@@ -696,4 +699,23 @@
|
||||
|
||||
}
|
||||
|
||||
#pragma mark 去分享
|
||||
|
||||
-(void)showAlertGoShareMaskTime{
|
||||
|
||||
[self jxt_showAlertWithTitle:@"面膜时间" message:@"去分享我的面膜时间" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
|
||||
alertMaker.addActionCancelTitle(@"下次");
|
||||
alertMaker.addActionDefaultTitle(@"去分享");
|
||||
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
|
||||
|
||||
if (buttonIndex == 1) {
|
||||
|
||||
GIGaMaskShareViewController *shareVC = [[GIGaMaskShareViewController alloc] init];
|
||||
[self.navigationController pushViewController:shareVC animated:YES];;
|
||||
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// ShareViewController.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "GiGaBaseViewController.h"
|
||||
|
||||
@interface ShareViewController : GiGaBaseViewController
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,163 @@
|
||||
//
|
||||
// ShareViewController.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ShareViewController.h"
|
||||
#import "MaskTimeShareViewCell.h"
|
||||
#import "MaskShareTimeMidViewCell.h"
|
||||
#import "MaskShareBoootomViewCell.h"
|
||||
|
||||
|
||||
@interface ShareViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property(nonatomic,strong) UITableView *tab;
|
||||
@property(nonatomic,strong) UIImageView *backimageview ;
|
||||
@property(nonatomic) int curentImageIndex ;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation ShareViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
_curentImageIndex = 0;
|
||||
UIImageView *backimageview = [[UIImageView alloc] init];
|
||||
backimageview.frame = CGRectMake(0, 0,self.view.frame.size.width, self.view.frame.size.height);
|
||||
backimageview.userInteractionEnabled = YES;
|
||||
backimageview.image = [UIImage imageNamed:@"sharebg_1"];
|
||||
// self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"sharebg_1"]];
|
||||
self.backimageview = backimageview;
|
||||
[self.view addSubview:backimageview];
|
||||
[self creatTabUI];
|
||||
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
backBtn.frame = CGRectMake(20,44, 40, 40);
|
||||
[backBtn setImage:[UIImage imageNamed:@"btn_moment_back"] forState:UIControlStateNormal];
|
||||
backBtn.backgroundColor = [UIColor redColor];
|
||||
[backBtn addTarget:self action:@selector(backBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.view addSubview:backBtn];
|
||||
[self.view insertSubview:backimageview atIndex:0];
|
||||
|
||||
[self creatBtns];
|
||||
|
||||
}
|
||||
|
||||
-(void)creatTabUI{
|
||||
self.tab = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
|
||||
self.tab.separatorStyle = UITableViewCellSelectionStyleNone;
|
||||
self.tab.delegate = self;
|
||||
self.tab.dataSource = self;
|
||||
self.tab.backgroundColor = [UIColor clearColor];
|
||||
[self.view addSubview:self.tab];
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return 3;
|
||||
}
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.row == 0) {
|
||||
MaskTimeShareViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskTimeShareViewCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTimeShareViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
return cell;
|
||||
}else if (indexPath.row == 1){
|
||||
MaskShareTimeMidViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskShareTimeMidViewCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskShareTimeMidViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
else if (indexPath.row == 2){
|
||||
MaskShareBoootomViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskShareBoootomViewCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskShareBoootomViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.row == 0) {
|
||||
return 295;
|
||||
}else if (indexPath.row ==1){
|
||||
return 205;
|
||||
}
|
||||
return 158;
|
||||
}
|
||||
|
||||
-(void)backBtnAction{
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
-(void)creatBtns{
|
||||
|
||||
UIButton *changeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
changeBtn.backgroundColor = GIGARGB(181, 14, 14, 0.6);
|
||||
NSAttributedString *titl = [GiGaHelper stringWithText:@"更换背景" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(18) leterSpace:0];
|
||||
[changeBtn setAttributedTitle:titl forState:UIControlStateNormal];
|
||||
[changeBtn addTarget:self action:@selector(changeAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
changeBtn.layer.masksToBounds = YES;
|
||||
changeBtn.layer.cornerRadius = 4;
|
||||
[self.view addSubview:changeBtn];
|
||||
[changeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(120, 40));
|
||||
make.bottom.mas_equalTo(self.view.mas_bottom).mas_offset(-45);
|
||||
make.centerX.mas_equalTo(self.view.mas_centerX).offset(-72);
|
||||
|
||||
}];
|
||||
|
||||
UIButton *shareBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
shareBtn.backgroundColor = GIGARGB(181, 14, 14, 0.6);
|
||||
NSAttributedString *titl2 = [GiGaHelper stringWithText:@"分享" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(18) leterSpace:0];
|
||||
[shareBtn setAttributedTitle:titl2 forState:UIControlStateNormal];
|
||||
[shareBtn addTarget:self action:@selector(shareBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
shareBtn.layer.masksToBounds = YES;
|
||||
shareBtn.layer.cornerRadius = 4;
|
||||
|
||||
[self.view addSubview:shareBtn];
|
||||
[shareBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(120, 40));
|
||||
make.bottom.mas_equalTo(self.view.mas_bottom).mas_offset(-45);
|
||||
make.centerX.mas_equalTo(self.view.mas_centerX).offset(72);
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
-(void)changeAction{
|
||||
|
||||
_curentImageIndex ++;
|
||||
if (_curentImageIndex == 4) {
|
||||
_curentImageIndex = 0;
|
||||
}
|
||||
NSArray *images = @[@"sharebg_2",@"sharebg_3",@"sharebg_4",@"sharebg_5",@"sharebg_1"];
|
||||
|
||||
[self.backimageview setImage:[UIImage imageNamed: images[_curentImageIndex]]];
|
||||
|
||||
}
|
||||
|
||||
-(void)shareBtnAction{
|
||||
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -10,6 +10,9 @@
|
||||
#import "MaskResultMinViewCell.h"
|
||||
#import "MaskResultPercentCell.h"
|
||||
#import "MaskResultShareViewCell.h"
|
||||
#import "SHareTestImageVC.h"
|
||||
#import "GiGaFileNanager.h"
|
||||
|
||||
|
||||
@interface MaskTestResultVC ()
|
||||
|
||||
@@ -30,7 +33,8 @@
|
||||
self.tableView.sectionFooterHeight = 0;
|
||||
self.tableView.estimatedSectionFooterHeight= 0;
|
||||
self.tableView.estimatedSectionHeaderHeight = 0;
|
||||
self.tableView.frame = CGRectMake(0,0, KMainW, self.view.bounds.size.height - SAFE_NAV_HEIGHT);
|
||||
//self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0,self.view.frame.size.width, 30)];
|
||||
self.tableView.frame = CGRectMake(0,0,KMainW, self.view.frame.size.height);
|
||||
[self.tableView registerClass:[MaskResultPercentCell class] forCellReuseIdentifier:@"MaskResultPercentCell"];
|
||||
[self.tableView registerClass:[MaskResultMinViewCell class] forCellReuseIdentifier:@"MaskResultMinViewCell"];
|
||||
[self.tableView registerClass:[MaskResultShareViewCell class] forCellReuseIdentifier:@"MaskResultShareViewCell"];
|
||||
@@ -71,7 +75,7 @@
|
||||
if (!cell) {
|
||||
cell = [[MaskResultShareViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];;
|
||||
}
|
||||
|
||||
[cell.shareBtn addTarget:self action:@selector(shareBtnAciton) forControlEvents:UIControlEventTouchUpInside];
|
||||
[cell kidTitle:self.model.mask];
|
||||
|
||||
return cell;
|
||||
@@ -96,6 +100,42 @@
|
||||
|
||||
}
|
||||
|
||||
-(void)shareBtnAciton{
|
||||
|
||||
UIImage *image = [self saveLongImage:self.tableView];
|
||||
// SHareTestImageVC *imagevc = [[SHareTestImageVC alloc] init];
|
||||
// imagevc.image = image;
|
||||
//[self.navigationController pushViewController:imagevc animated:YES];
|
||||
|
||||
}
|
||||
|
||||
- (UIImage *)saveLongImage:(UITableView *)table {
|
||||
|
||||
UIImage* image = nil;
|
||||
// 下面方法,第一个参数表示区域大小。第二个参数表示是否是非透明的。如果需要显示半透明效果,需要传NO,否则传YES。第三个参数就是屏幕密度了,调整清晰度。
|
||||
|
||||
UIGraphicsBeginImageContextWithOptions(table.contentSize, YES, [UIScreen mainScreen].scale);
|
||||
|
||||
CGPoint savedContentOffset = table.contentOffset;
|
||||
CGRect savedFrame = table.frame;
|
||||
table.contentOffset = CGPointZero;
|
||||
table.frame = CGRectMake(0, 0, table.contentSize.width, table.contentSize.height);
|
||||
|
||||
[table.layer renderInContext: UIGraphicsGetCurrentContext()];
|
||||
|
||||
image = UIGraphicsGetImageFromCurrentImageContext();
|
||||
|
||||
table.contentOffset = savedContentOffset;
|
||||
|
||||
table.frame = savedFrame;
|
||||
|
||||
UIGraphicsEndImageContext();
|
||||
[[GiGaFileNanager shareInstance] saveImaeToAlBum:image];
|
||||
|
||||
return image;
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// SHareTestImageVC.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "GiGaBaseViewController.h"
|
||||
|
||||
@interface SHareTestImageVC : GiGaBaseViewController
|
||||
@property (nonatomic,strong) UIImage *image ;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// SHareTestImageVC.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SHareTestImageVC.h"
|
||||
|
||||
@interface SHareTestImageVC ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation SHareTestImageVC
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
UIImageView *ima = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width,self.view.frame.size.height)];
|
||||
ima.contentMode = UIViewContentModeScaleAspectFit;
|
||||
|
||||
ima.image = self.image;
|
||||
[self.view addSubview:ima];
|
||||
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
/*
|
||||
#pragma mark - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||
// Get the new view controller using [segue destinationViewController].
|
||||
// Pass the selected object to the new view controller.
|
||||
}
|
||||
*/
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
|
||||
<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="SHareTestImageVC">
|
||||
<connections>
|
||||
<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="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -202,7 +202,6 @@
|
||||
self.oilLabe.text = model.oilinessPercent;
|
||||
self.waterlabe.text = model.drynessPercent;
|
||||
|
||||
|
||||
}];
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// MaskShareBoootomViewCell.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface MaskShareBoootomViewCell : UITableViewCell
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *codeImageVIew;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// MaskShareBoootomViewCell.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MaskShareBoootomViewCell.h"
|
||||
#import "ZXingWrapper.h"
|
||||
|
||||
|
||||
@implementation MaskShareBoootomViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
UIImage *imag = [ZXingWrapper createCodeWithString:@"app_logo" size:CGSizeMake(85, 85) CodeFomart:kBarcodeFormatQRCode];
|
||||
self.codeImageVIew.image = imag;
|
||||
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
<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"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MaskShareBoootomViewCell" id="KGk-i7-Jjw" customClass="MaskShareBoootomViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="158"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="157.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="做精致女人" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LJO-K7-zpZ">
|
||||
<rect key="frame" x="33" y="32" width="85" height="24"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="17"/>
|
||||
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="从现在开始给皮肤最好的呵护" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6i0-MD-I2r">
|
||||
<rect key="frame" x="33" y="58" width="221" height="24"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="17"/>
|
||||
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GOk-wH-zsa">
|
||||
<rect key="frame" x="33" y="103" width="100" height="4"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="100" id="HgT-jl-BEp"/>
|
||||
<constraint firstAttribute="height" constant="4" id="U5M-5L-n2g"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="长按识别二维码一起加入面膜时间吧" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ema-eN-n8K">
|
||||
<rect key="frame" x="33" y="86" width="160" height="14"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="10"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="面膜时间出品" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HDM-xq-aq0">
|
||||
<rect key="frame" x="232" y="130" width="72" height="17"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="tq8-in-Amj">
|
||||
<rect key="frame" x="226" y="15" width="85" height="85"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="85" id="dP3-Bc-Lp3"/>
|
||||
<constraint firstAttribute="height" constant="85" id="mmA-lF-tro"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="LJO-K7-zpZ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="32" id="13v-0a-2uH"/>
|
||||
<constraint firstAttribute="bottom" secondItem="HDM-xq-aq0" secondAttribute="bottom" constant="10.5" id="5iM-f0-E04"/>
|
||||
<constraint firstItem="Ema-eN-n8K" firstAttribute="top" secondItem="6i0-MD-I2r" secondAttribute="bottom" constant="4" id="8KL-j5-2Mj"/>
|
||||
<constraint firstItem="tq8-in-Amj" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="B22-JQ-XO1"/>
|
||||
<constraint firstAttribute="trailing" secondItem="HDM-xq-aq0" secondAttribute="trailing" constant="16" id="KE6-Br-RHG"/>
|
||||
<constraint firstItem="GOk-wH-zsa" firstAttribute="top" secondItem="Ema-eN-n8K" secondAttribute="bottom" constant="3" id="KJy-tX-KpT"/>
|
||||
<constraint firstItem="LJO-K7-zpZ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="33" id="TNa-XG-s3h"/>
|
||||
<constraint firstItem="6i0-MD-I2r" firstAttribute="top" secondItem="LJO-K7-zpZ" secondAttribute="bottom" constant="2" id="der-vS-LaE"/>
|
||||
<constraint firstItem="GOk-wH-zsa" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" constant="17" id="feu-CD-ceE"/>
|
||||
<constraint firstItem="6i0-MD-I2r" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="33" id="fsa-Yg-uQP"/>
|
||||
<constraint firstItem="Ema-eN-n8K" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="33" id="im1-OZ-dbX"/>
|
||||
<constraint firstAttribute="trailing" secondItem="tq8-in-Amj" secondAttribute="trailing" constant="9" id="yPL-AS-Ahb"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
|
||||
<connections>
|
||||
<outlet property="codeImageVIew" destination="tq8-in-Amj" id="Axa-dF-svf"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// MaskShareTimeMidViewCell.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface MaskShareTimeMidViewCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIView *timeBackVIew;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *userIcon;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *timeLabe;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *percetLabe;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *totalLabe;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// MaskShareTimeMidViewCell.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MaskShareTimeMidViewCell.h"
|
||||
|
||||
@implementation MaskShareTimeMidViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
|
||||
self.timeBackVIew.layer.masksToBounds= NO;
|
||||
self.timeBackVIew.layer.cornerRadius =10;
|
||||
self.timeBackVIew.layer.shadowOffset = CGSizeMake(2,1);
|
||||
self.timeBackVIew.layer.shadowColor = GIGARGB(91, 91, 91, 0.6).CGColor;
|
||||
self.timeBackVIew.layer.shadowOpacity = 0.8;
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,190 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<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"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MaskShareTimeMidViewCell" id="KGk-i7-Jjw" customClass="MaskShareTimeMidViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="205"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="204.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="H7C-wU-YeM">
|
||||
<rect key="frame" x="18" y="11" width="286" height="183"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="nav_circle_avatar" translatesAutoresizingMaskIntoConstraints="NO" id="ocM-SZ-rcr">
|
||||
<rect key="frame" x="19" y="18" width="40" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="40" id="69R-Hf-2u9"/>
|
||||
<constraint firstAttribute="height" constant="40" id="n90-K1-gcI"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="面膜时间 MaskTime" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FpQ-uV-izv">
|
||||
<rect key="frame" x="75" y="20" width="130" height="20"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="14"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="result_logo" translatesAutoresizingMaskIntoConstraints="NO" id="Pgj-et-Ccy">
|
||||
<rect key="frame" x="245" y="20" width="20" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="20" id="J7J-3M-XKc"/>
|
||||
<constraint firstAttribute="height" constant="20" id="WPH-Ru-RVU"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="刚刚在「面膜时间」完成了今日皮肤护理" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lc8-n5-fHG">
|
||||
<rect key="frame" x="75" y="40" width="170" height="37"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="37" id="0dF-BN-lB7"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" red="0.66666666666666663" green="0.66666666666666663" blue="0.66666666666666663" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2bX-rt-CcO">
|
||||
<rect key="frame" x="19" y="81" width="246" height="2"/>
|
||||
<color key="backgroundColor" red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="2" id="D0z-X0-1Sv"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="今日用时" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="q9g-6l-HI7">
|
||||
<rect key="frame" x="15" y="107" width="48" height="17"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" red="0.21568627450980393" green="0.21568627450980393" blue="0.21568627450980393" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="皮肤保养度超过" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QzN-Xb-uz3">
|
||||
<rect key="frame" x="101" y="107" width="84" height="17"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="84" id="KCi-Px-w1F"/>
|
||||
<constraint firstAttribute="height" constant="17" id="eZf-hS-jWs"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="%的用户" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7R8-c2-d50">
|
||||
<rect key="frame" x="136" y="158" width="48" height="17"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="总计用时" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pKf-Uc-fSs">
|
||||
<rect key="frame" x="218" y="107" width="48" height="17"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="min" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="raB-J7-45m">
|
||||
<rect key="frame" x="245" y="158" width="21" height="17"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="17" id="MEd-UN-o3r"/>
|
||||
<constraint firstAttribute="width" constant="21" id="cM5-fO-tiO"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="17" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4Um-yz-bX8">
|
||||
<rect key="frame" x="101" y="124" width="35" height="51"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="51" id="lAz-MR-QTD"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="36"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="17" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZJ1-li-JLb">
|
||||
<rect key="frame" x="210" y="124" width="35" height="51"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="51" id="FVT-7U-mMd"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="36"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="17" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="znk-jF-QRT">
|
||||
<rect key="frame" x="15" y="123" width="35" height="51"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="51" id="TM5-Ec-HZV"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="36"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="min" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cGc-tf-vDR">
|
||||
<rect key="frame" x="42" y="158" width="21" height="17"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="7R8-c2-d50" firstAttribute="top" secondItem="QzN-Xb-uz3" secondAttribute="bottom" constant="34" id="0lQ-We-nTj"/>
|
||||
<constraint firstAttribute="trailing" secondItem="2bX-rt-CcO" secondAttribute="trailing" constant="21" id="1ac-pu-JSd"/>
|
||||
<constraint firstItem="FpQ-uV-izv" firstAttribute="leading" secondItem="ocM-SZ-rcr" secondAttribute="trailing" constant="16" id="9Pm-KS-USL"/>
|
||||
<constraint firstItem="raB-J7-45m" firstAttribute="top" secondItem="pKf-Uc-fSs" secondAttribute="bottom" constant="34" id="A2R-aP-ZgP"/>
|
||||
<constraint firstItem="cGc-tf-vDR" firstAttribute="leading" secondItem="znk-jF-QRT" secondAttribute="trailing" constant="-8" id="AhZ-Zg-9Fy"/>
|
||||
<constraint firstItem="q9g-6l-HI7" firstAttribute="leading" secondItem="H7C-wU-YeM" secondAttribute="leading" constant="15" id="C0U-Tr-eSb"/>
|
||||
<constraint firstItem="ocM-SZ-rcr" firstAttribute="leading" secondItem="H7C-wU-YeM" secondAttribute="leading" constant="19" id="C2s-Kb-4P5"/>
|
||||
<constraint firstItem="Lc8-n5-fHG" firstAttribute="top" secondItem="FpQ-uV-izv" secondAttribute="bottom" id="Esp-hD-aoV"/>
|
||||
<constraint firstItem="pKf-Uc-fSs" firstAttribute="top" secondItem="2bX-rt-CcO" secondAttribute="bottom" constant="24" id="Fym-mE-e2D"/>
|
||||
<constraint firstItem="7R8-c2-d50" firstAttribute="leading" secondItem="4Um-yz-bX8" secondAttribute="trailing" id="Gay-Lb-dlR"/>
|
||||
<constraint firstItem="raB-J7-45m" firstAttribute="leading" secondItem="ZJ1-li-JLb" secondAttribute="trailing" id="Kih-L8-D3k"/>
|
||||
<constraint firstItem="znk-jF-QRT" firstAttribute="leading" secondItem="H7C-wU-YeM" secondAttribute="leading" constant="15" id="Krh-6u-OYy"/>
|
||||
<constraint firstItem="Lc8-n5-fHG" firstAttribute="leading" secondItem="ocM-SZ-rcr" secondAttribute="trailing" constant="16" id="L9A-kw-JHx"/>
|
||||
<constraint firstItem="ocM-SZ-rcr" firstAttribute="top" secondItem="H7C-wU-YeM" secondAttribute="top" constant="18" id="MPP-Aw-eB9"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Pgj-et-Ccy" secondAttribute="trailing" constant="21" id="NMY-O3-SEV"/>
|
||||
<constraint firstItem="4Um-yz-bX8" firstAttribute="leading" secondItem="QzN-Xb-uz3" secondAttribute="leading" id="SZX-Ld-70P"/>
|
||||
<constraint firstItem="QzN-Xb-uz3" firstAttribute="centerX" secondItem="H7C-wU-YeM" secondAttribute="centerX" id="TXp-M6-XaJ"/>
|
||||
<constraint firstItem="q9g-6l-HI7" firstAttribute="top" secondItem="2bX-rt-CcO" secondAttribute="bottom" constant="24" id="Vfu-m2-O5v"/>
|
||||
<constraint firstItem="znk-jF-QRT" firstAttribute="top" secondItem="q9g-6l-HI7" secondAttribute="bottom" constant="-1" id="ZKs-zG-MlA"/>
|
||||
<constraint firstItem="ZJ1-li-JLb" firstAttribute="top" secondItem="pKf-Uc-fSs" secondAttribute="bottom" id="avQ-5O-0L4"/>
|
||||
<constraint firstAttribute="trailing" secondItem="pKf-Uc-fSs" secondAttribute="trailing" constant="20" id="d6a-S4-SfO"/>
|
||||
<constraint firstItem="Pgj-et-Ccy" firstAttribute="leading" secondItem="Lc8-n5-fHG" secondAttribute="trailing" id="ew7-LM-G47"/>
|
||||
<constraint firstItem="2bX-rt-CcO" firstAttribute="leading" secondItem="H7C-wU-YeM" secondAttribute="leading" constant="19" id="ghD-RN-ryu"/>
|
||||
<constraint firstItem="FpQ-uV-izv" firstAttribute="top" secondItem="H7C-wU-YeM" secondAttribute="top" constant="20" id="jAg-or-f1G"/>
|
||||
<constraint firstAttribute="trailing" secondItem="raB-J7-45m" secondAttribute="trailing" constant="20" id="jag-Xo-89A"/>
|
||||
<constraint firstItem="4Um-yz-bX8" firstAttribute="top" secondItem="QzN-Xb-uz3" secondAttribute="bottom" id="jpK-hB-nVh"/>
|
||||
<constraint firstItem="2bX-rt-CcO" firstAttribute="top" secondItem="Lc8-n5-fHG" secondAttribute="bottom" constant="4" id="pIR-1U-ELN"/>
|
||||
<constraint firstItem="Pgj-et-Ccy" firstAttribute="top" secondItem="H7C-wU-YeM" secondAttribute="top" constant="20" id="q21-af-X0B"/>
|
||||
<constraint firstItem="QzN-Xb-uz3" firstAttribute="top" secondItem="2bX-rt-CcO" secondAttribute="bottom" constant="24" id="sJR-WQ-HDQ"/>
|
||||
<constraint firstItem="cGc-tf-vDR" firstAttribute="top" secondItem="q9g-6l-HI7" secondAttribute="bottom" constant="34" id="wZZ-p7-gzx"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="H7C-wU-YeM" secondAttribute="bottom" constant="10.5" id="207-vp-hob"/>
|
||||
<constraint firstAttribute="trailing" secondItem="H7C-wU-YeM" secondAttribute="trailing" constant="16" id="PcA-b9-a1T"/>
|
||||
<constraint firstItem="H7C-wU-YeM" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="11" id="uaC-Jo-bEB"/>
|
||||
<constraint firstItem="H7C-wU-YeM" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="18" id="yP6-rB-mKy"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
|
||||
<connections>
|
||||
<outlet property="percetLabe" destination="4Um-yz-bX8" id="ZPZ-Pl-yXo"/>
|
||||
<outlet property="timeBackVIew" destination="H7C-wU-YeM" id="q2o-NG-UKS"/>
|
||||
<outlet property="timeLabe" destination="znk-jF-QRT" id="pii-LG-rfu"/>
|
||||
<outlet property="totalLabe" destination="ZJ1-li-JLb" id="MeX-lM-Wfv"/>
|
||||
<outlet property="userIcon" destination="ocM-SZ-rcr" id="VxR-wi-5fs"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="34" y="53.5"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="nav_circle_avatar" width="33" height="33"/>
|
||||
<image name="result_logo" width="36" height="36"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// MaskTimeShareViewCell.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface MaskTimeShareViewCell : UITableViewCell
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// MaskTimeShareViewCell.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MaskTimeShareViewCell.h"
|
||||
|
||||
@implementation MaskTimeShareViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<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"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell alpha="0.0" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MaskTimeShareViewCell" id="KGk-i7-Jjw" customClass="MaskTimeShareViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="295"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="294.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="share_logo" translatesAutoresizingMaskIntoConstraints="NO" id="hpg-24-InK">
|
||||
<rect key="frame" x="112" y="25" width="185" height="85"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="现在做些什么呢?" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rO9-ia-OyA">
|
||||
<rect key="frame" x="31" y="168" width="112" height="20"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="14"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="What are we doing now?" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ajv-9T-Bcf">
|
||||
<rect key="frame" x="31" y="195" width="142" height="17"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="12"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="share_two" translatesAutoresizingMaskIntoConstraints="NO" id="27f-OZ-xO3">
|
||||
<rect key="frame" x="33" y="224" width="198" height="35"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="198" id="kws-RO-ZT9"/>
|
||||
<constraint firstAttribute="height" constant="35" id="zzS-Dk-zsi"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="share_one" translatesAutoresizingMaskIntoConstraints="NO" id="dlk-Er-Voj">
|
||||
<rect key="frame" x="42" y="229" width="162" height="19"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="19" id="JLN-Jh-Gue"/>
|
||||
<constraint firstAttribute="width" constant="162" id="L4g-bl-Q8T"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="ajv-9T-Bcf" firstAttribute="top" secondItem="rO9-ia-OyA" secondAttribute="bottom" constant="7" id="DCd-OD-w3Y"/>
|
||||
<constraint firstItem="27f-OZ-xO3" firstAttribute="top" secondItem="ajv-9T-Bcf" secondAttribute="bottom" constant="12" id="GCK-Hn-01X"/>
|
||||
<constraint firstItem="hpg-24-InK" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="25" id="Hvq-lc-NRh"/>
|
||||
<constraint firstItem="27f-OZ-xO3" firstAttribute="leading" secondItem="dlk-Er-Voj" secondAttribute="trailing" constant="-171" id="MCZ-EA-KDw"/>
|
||||
<constraint firstItem="ajv-9T-Bcf" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="31" id="RwQ-US-zcb"/>
|
||||
<constraint firstItem="rO9-ia-OyA" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="31" id="ewW-Hj-R0x"/>
|
||||
<constraint firstAttribute="trailing" secondItem="hpg-24-InK" secondAttribute="trailing" constant="23" id="hOO-Na-GHH"/>
|
||||
<constraint firstItem="rO9-ia-OyA" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="168" id="tLv-Zy-Ptv"/>
|
||||
<constraint firstItem="27f-OZ-xO3" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="33" id="yX2-dI-Z6b"/>
|
||||
<constraint firstItem="27f-OZ-xO3" firstAttribute="top" secondItem="dlk-Er-Voj" secondAttribute="bottom" constant="-24" id="zP3-QW-JTK"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
|
||||
<point key="canvasLocation" x="34" y="53.5"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="share_logo" width="185" height="85"/>
|
||||
<image name="share_one" width="133" height="17"/>
|
||||
<image name="share_two" width="155" height="35"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// MaskTimeEndViewImgaeCell.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface MaskTimeEndViewImgaeCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIView *holdbackView;
|
||||
@property (weak, nonatomic) IBOutlet UIView *whiteBackView;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *holdImagView;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *minuteLab;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *timeLable;
|
||||
@property (weak, nonatomic) IBOutlet UIView *barholdView;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// MaskTimeEndViewImgaeCell.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MaskTimeEndViewImgaeCell.h"
|
||||
|
||||
@implementation MaskTimeEndViewImgaeCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
self.holdbackView.layer.masksToBounds = NO;
|
||||
self.holdbackView.layer.cornerRadius = 10;
|
||||
self.holdbackView.layer.shadowOffset = CGSizeMake(0, 0);
|
||||
self.holdbackView.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
self.holdbackView.layer.shadowOpacity = 0.6;
|
||||
|
||||
self.whiteBackView.layer.masksToBounds= NO;
|
||||
self.whiteBackView.layer.cornerRadius = 8;
|
||||
self.whiteBackView.layer.shadowOffset = CGSizeMake(0, 0);
|
||||
self.whiteBackView.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
self.whiteBackView.layer.shadowOpacity = 0.6;
|
||||
|
||||
self.barholdView.layer.masksToBounds= NO;
|
||||
self.barholdView.layer.cornerRadius =4;
|
||||
self.barholdView.layer.shadowOffset = CGSizeMake(0, 0);
|
||||
self.barholdView.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
self.barholdView.layer.shadowOpacity = 0.6;
|
||||
|
||||
[self bringSubviewToFront:self.barholdView];
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<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"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MaskTimeEndViewImgaeCell" id="KGk-i7-Jjw" customClass="MaskTimeEndViewImgaeCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="285"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="284.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5MU-uW-fZ2">
|
||||
<rect key="frame" x="18" y="10" width="341" height="264"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OSF-Gb-h1M">
|
||||
<rect key="frame" x="6" y="12" width="329" height="217"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_logo" translatesAutoresizingMaskIntoConstraints="NO" id="iJy-9p-48y">
|
||||
<rect key="frame" x="8" y="8" width="313" height="175"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="175" id="0Jj-uy-CDT"/>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="175" id="eW4-fY-wR5"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="iJy-9p-48y" firstAttribute="top" secondItem="OSF-Gb-h1M" secondAttribute="top" constant="8" id="LRT-Cc-miz"/>
|
||||
<constraint firstAttribute="trailing" secondItem="iJy-9p-48y" secondAttribute="trailing" constant="8" id="N0I-N3-hqs"/>
|
||||
<constraint firstAttribute="height" constant="217" id="P0C-Za-wai"/>
|
||||
<constraint firstItem="iJy-9p-48y" firstAttribute="leading" secondItem="OSF-Gb-h1M" secondAttribute="leading" constant="8" id="bl5-pV-Rq1"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zb6-lc-TeY">
|
||||
<rect key="frame" x="4" y="211" width="333" height="49"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="masktie_clock" translatesAutoresizingMaskIntoConstraints="NO" id="XnI-Fw-hHd">
|
||||
<rect key="frame" x="8" y="15" width="19" height="19"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="19" id="Hyq-pO-uTi"/>
|
||||
<constraint firstAttribute="height" constant="19" id="zbg-8l-aJI"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="17min" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="H5z-ZV-VGm">
|
||||
<rect key="frame" x="35" y="17" width="28" height="14"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="10"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="这是您敷面膜的第:10次" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o4N-kZ-Uph">
|
||||
<rect key="frame" x="193" y="17" width="111" height="14"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="10"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.62352941176470589" green="0.023529411764705882" blue="0.023529411764705882" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="o4N-kZ-Uph" firstAttribute="centerY" secondItem="zb6-lc-TeY" secondAttribute="centerY" id="93A-PJ-hWP"/>
|
||||
<constraint firstAttribute="height" constant="49" id="BAv-vl-YlP"/>
|
||||
<constraint firstItem="XnI-Fw-hHd" firstAttribute="leading" secondItem="zb6-lc-TeY" secondAttribute="leading" constant="8" id="BzP-cf-5zR"/>
|
||||
<constraint firstItem="H5z-ZV-VGm" firstAttribute="leading" secondItem="XnI-Fw-hHd" secondAttribute="trailing" constant="8" id="Ha3-Nu-4Iv"/>
|
||||
<constraint firstItem="H5z-ZV-VGm" firstAttribute="centerY" secondItem="XnI-Fw-hHd" secondAttribute="centerY" id="YjA-Yp-g3u"/>
|
||||
<constraint firstAttribute="trailing" secondItem="o4N-kZ-Uph" secondAttribute="trailing" constant="29" id="cNF-cX-ish"/>
|
||||
<constraint firstItem="XnI-Fw-hHd" firstAttribute="centerY" secondItem="zb6-lc-TeY" secondAttribute="centerY" id="yGh-8x-eCf"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.51372549019607838" green="0.039215686274509803" blue="0.039215686274509803" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="zb6-lc-TeY" secondAttribute="bottom" constant="4" id="FP5-M5-c7a"/>
|
||||
<constraint firstItem="OSF-Gb-h1M" firstAttribute="leading" secondItem="5MU-uW-fZ2" secondAttribute="leading" constant="6" id="FYg-48-nIY"/>
|
||||
<constraint firstItem="OSF-Gb-h1M" firstAttribute="top" secondItem="5MU-uW-fZ2" secondAttribute="top" constant="12" id="Fu1-T2-vXr"/>
|
||||
<constraint firstAttribute="trailing" secondItem="OSF-Gb-h1M" secondAttribute="trailing" constant="6" id="IcU-5t-pfe"/>
|
||||
<constraint firstAttribute="trailing" secondItem="zb6-lc-TeY" secondAttribute="trailing" constant="4" id="Nic-AR-2FY"/>
|
||||
<constraint firstItem="zb6-lc-TeY" firstAttribute="leading" secondItem="5MU-uW-fZ2" secondAttribute="leading" constant="4" id="dSM-NF-ts0"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="5MU-uW-fZ2" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="10" id="0IF-Ap-Efk"/>
|
||||
<constraint firstAttribute="trailing" secondItem="5MU-uW-fZ2" secondAttribute="trailing" constant="16" id="XAm-2L-3Vh"/>
|
||||
<constraint firstAttribute="bottom" secondItem="5MU-uW-fZ2" secondAttribute="bottom" constant="10.5" id="ZjP-Dh-A2T"/>
|
||||
<constraint firstItem="5MU-uW-fZ2" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="18" id="kLd-7g-18z"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
|
||||
<connections>
|
||||
<outlet property="barholdView" destination="zb6-lc-TeY" id="wpD-wR-dGj"/>
|
||||
<outlet property="holdImagView" destination="iJy-9p-48y" id="Yv1-po-ePK"/>
|
||||
<outlet property="holdbackView" destination="5MU-uW-fZ2" id="YD5-lS-uxH"/>
|
||||
<outlet property="minuteLab" destination="H5z-ZV-VGm" id="Nz3-Ms-3GO"/>
|
||||
<outlet property="timeLable" destination="o4N-kZ-Uph" id="3ZQ-7x-M8m"/>
|
||||
<outlet property="whiteBackView" destination="OSF-Gb-h1M" id="GKa-Wp-8Og"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="33.5" y="53.5"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="bg_logo" width="88" height="88"/>
|
||||
<image name="masktie_clock" width="20" height="19"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// MaskTimeEndActionViewCell.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface MaskTimeEndActionViewCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIButton *changeBackBtn;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *shareBtn;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// MaskTimeEndActionViewCell.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MaskTimeEndActionViewCell.h"
|
||||
|
||||
@implementation MaskTimeEndActionViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
self.changeBackBtn.layer.masksToBounds = YES;
|
||||
self.changeBackBtn.layer.cornerRadius = 4;
|
||||
self.shareBtn.layer.masksToBounds = YES;
|
||||
self.shareBtn.layer.cornerRadius = 4;
|
||||
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<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"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MaskTimeEndActionViewCell" id="KGk-i7-Jjw" customClass="MaskTimeEndActionViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="90"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="89.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Gqo-NQ-qFy">
|
||||
<rect key="frame" x="24" y="24" width="120" height="40"/>
|
||||
<color key="backgroundColor" red="0.70980392156862748" green="0.054901960784313725" blue="0.054901960784313725" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="TPM-XU-L0w"/>
|
||||
<constraint firstAttribute="width" constant="120" id="ZPK-wp-9E9"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
|
||||
<state key="normal" title="更换背景"/>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="scf-Jn-nCG">
|
||||
<rect key="frame" x="176" y="24" width="120" height="40"/>
|
||||
<color key="backgroundColor" red="0.70980392160000005" green="0.054901960780000002" blue="0.054901960780000002" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="Yva-pt-o9N"/>
|
||||
<constraint firstAttribute="width" constant="120" id="mNM-uk-QUs"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
|
||||
<state key="normal" title="分享"/>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="scf-Jn-nCG" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Gqo-NQ-qFy" secondAttribute="trailing" constant="32" id="MSN-NY-psb"/>
|
||||
<constraint firstItem="scf-Jn-nCG" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="fxv-dG-WQl"/>
|
||||
<constraint firstAttribute="trailing" secondItem="scf-Jn-nCG" secondAttribute="trailing" constant="24" id="iv9-Dq-7bp"/>
|
||||
<constraint firstItem="Gqo-NQ-qFy" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="sta-hl-p4d"/>
|
||||
<constraint firstItem="Gqo-NQ-qFy" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="24" id="y1w-d5-yav"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
|
||||
<connections>
|
||||
<outlet property="changeBackBtn" destination="Gqo-NQ-qFy" id="Ryz-GE-f6C"/>
|
||||
<outlet property="shareBtn" destination="scf-Jn-nCG" id="q0G-8a-zcU"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-19" y="-6"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// MaskTimeTimeViewCell.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface MaskTimeTimeViewCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIView *timeholdBack;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *timeLabe;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *percentLabe;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *totalTime;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// MaskTimeTimeViewCell.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/21.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MaskTimeTimeViewCell.h"
|
||||
|
||||
@implementation MaskTimeTimeViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
self.timeholdBack.layer.masksToBounds= NO;
|
||||
self.timeholdBack.layer.cornerRadius =10;
|
||||
self.timeholdBack.layer.shadowOffset = CGSizeMake(0,0);
|
||||
self.timeholdBack.layer.shadowColor = GIGARGB(233, 226, 226, 1).CGColor;
|
||||
self.timeholdBack.layer.shadowOpacity = 1;
|
||||
//self.timeholdBack.layer.shadowRadius = 6;
|
||||
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,177 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<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"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MaskTimeTimeViewCell" id="KGk-i7-Jjw" customClass="MaskTimeTimeViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="205"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="204.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tEV-Hx-dgE">
|
||||
<rect key="frame" x="18" y="10" width="341" height="184"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="nav_circle_avatar" translatesAutoresizingMaskIntoConstraints="NO" id="UA6-7v-cad">
|
||||
<rect key="frame" x="19" y="10" width="40" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="40" id="Moa-w9-dhr"/>
|
||||
<constraint firstAttribute="height" constant="40" id="gbw-CV-SNb"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="面膜时间 MaskTime" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oyd-JS-WRK">
|
||||
<rect key="frame" x="75" y="20" width="129.5" height="20"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="14"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="result_logo" translatesAutoresizingMaskIntoConstraints="NO" id="Yg7-YX-5c6">
|
||||
<rect key="frame" x="307" y="20" width="20" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="20" id="2NR-UX-hPa"/>
|
||||
<constraint firstAttribute="width" constant="20" id="Fk3-Ay-l6k"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="R09-WA-3qM">
|
||||
<rect key="frame" x="16" y="61" width="317" height="2"/>
|
||||
<color key="backgroundColor" red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="2" id="3Oa-hT-F5e"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="今日用时" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TkO-iO-bzM">
|
||||
<rect key="frame" x="19" y="89" width="48" height="17"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" red="0.21568627450980393" green="0.21568627450980393" blue="0.21568627450980393" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="17" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SKr-dU-xbP">
|
||||
<rect key="frame" x="18" y="110" width="35" height="50"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="b8u-xz-cpA"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="36"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="min" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5p1-hF-pIU">
|
||||
<rect key="frame" x="61" y="139" width="21" height="17"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="21" id="F4x-rY-t0V"/>
|
||||
<constraint firstAttribute="height" constant="17" id="vXI-ie-RyN"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="皮肤保养度超过" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tme-2V-NlI">
|
||||
<rect key="frame" x="128.5" y="89" width="84" height="17"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="86" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xEv-bM-Qny">
|
||||
<rect key="frame" x="128.5" y="110" width="44" height="51"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="51" id="fc4-gI-XKQ"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="36"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="总计用时" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j6s-4L-8FL">
|
||||
<rect key="frame" x="279" y="89" width="48" height="17"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="50" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Yd8-h2-8ZW">
|
||||
<rect key="frame" x="266" y="109" width="44" height="51"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="51" id="xmg-KN-Eeh"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="36"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="%的用户" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8Kf-o0-1q0">
|
||||
<rect key="frame" x="171.5" y="139" width="48" height="17"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" red="0.21568627450980393" green="0.21568627450980393" blue="0.21568627450980393" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="min" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dic-3G-CvO">
|
||||
<rect key="frame" x="307" y="139" width="21" height="17"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="17" id="7vV-ZK-S0b"/>
|
||||
<constraint firstAttribute="width" constant="21" id="8AJ-vw-Jnl"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<color key="textColor" red="0.2156862745" green="0.2156862745" blue="0.2156862745" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="TkO-iO-bzM" firstAttribute="leading" secondItem="tEV-Hx-dgE" secondAttribute="leading" constant="19" id="07E-9C-lfd"/>
|
||||
<constraint firstItem="R09-WA-3qM" firstAttribute="leading" secondItem="tEV-Hx-dgE" secondAttribute="leading" constant="16" id="2TR-Da-wDl"/>
|
||||
<constraint firstAttribute="trailing" secondItem="j6s-4L-8FL" secondAttribute="trailing" constant="14" id="5TN-i1-CKr"/>
|
||||
<constraint firstItem="xEv-bM-Qny" firstAttribute="leading" secondItem="Tme-2V-NlI" secondAttribute="leading" id="5tA-IF-4Ot"/>
|
||||
<constraint firstAttribute="trailing" secondItem="R09-WA-3qM" secondAttribute="trailing" constant="8" id="7pI-A0-tTn"/>
|
||||
<constraint firstItem="oyd-JS-WRK" firstAttribute="leading" secondItem="UA6-7v-cad" secondAttribute="trailing" constant="16" id="8jb-u4-UHB"/>
|
||||
<constraint firstItem="TkO-iO-bzM" firstAttribute="top" secondItem="R09-WA-3qM" secondAttribute="bottom" constant="26" id="9Gj-ET-CwA"/>
|
||||
<constraint firstItem="5p1-hF-pIU" firstAttribute="top" secondItem="TkO-iO-bzM" secondAttribute="bottom" constant="33" id="9kc-i7-Xdr"/>
|
||||
<constraint firstItem="SKr-dU-xbP" firstAttribute="leading" secondItem="tEV-Hx-dgE" secondAttribute="leading" constant="18" id="D80-4C-dGC"/>
|
||||
<constraint firstItem="Tme-2V-NlI" firstAttribute="centerX" secondItem="tEV-Hx-dgE" secondAttribute="centerX" id="HSk-hX-DxP"/>
|
||||
<constraint firstItem="oyd-JS-WRK" firstAttribute="top" secondItem="tEV-Hx-dgE" secondAttribute="top" constant="20" id="Hff-vJ-bki"/>
|
||||
<constraint firstItem="dic-3G-CvO" firstAttribute="top" secondItem="j6s-4L-8FL" secondAttribute="bottom" constant="33" id="Ht3-2Y-5Mb"/>
|
||||
<constraint firstItem="Tme-2V-NlI" firstAttribute="top" secondItem="R09-WA-3qM" secondAttribute="bottom" constant="26" id="KUx-Nw-4kf"/>
|
||||
<constraint firstItem="R09-WA-3qM" firstAttribute="top" secondItem="tEV-Hx-dgE" secondAttribute="top" constant="61" id="LNc-ql-jSY"/>
|
||||
<constraint firstAttribute="trailing" secondItem="dic-3G-CvO" secondAttribute="trailing" constant="13" id="Lb3-Ut-P6Z"/>
|
||||
<constraint firstItem="8Kf-o0-1q0" firstAttribute="top" secondItem="Tme-2V-NlI" secondAttribute="bottom" constant="33" id="Lev-qu-Zmr"/>
|
||||
<constraint firstItem="xEv-bM-Qny" firstAttribute="top" secondItem="Tme-2V-NlI" secondAttribute="bottom" constant="4" id="P0c-5d-JJq"/>
|
||||
<constraint firstItem="UA6-7v-cad" firstAttribute="leading" secondItem="tEV-Hx-dgE" secondAttribute="leading" constant="19" id="Tzt-3x-Lfy"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Yg7-YX-5c6" secondAttribute="trailing" constant="14" id="Usm-zC-hhp"/>
|
||||
<constraint firstItem="8Kf-o0-1q0" firstAttribute="leading" secondItem="xEv-bM-Qny" secondAttribute="trailing" constant="-1" id="VD9-bi-F2d"/>
|
||||
<constraint firstItem="Yd8-h2-8ZW" firstAttribute="top" secondItem="j6s-4L-8FL" secondAttribute="bottom" constant="3" id="XWR-b8-Nl1"/>
|
||||
<constraint firstItem="SKr-dU-xbP" firstAttribute="top" secondItem="TkO-iO-bzM" secondAttribute="bottom" constant="4" id="lYD-5E-uY3"/>
|
||||
<constraint firstItem="UA6-7v-cad" firstAttribute="top" secondItem="tEV-Hx-dgE" secondAttribute="top" constant="10" id="mLH-mh-9mJ"/>
|
||||
<constraint firstItem="dic-3G-CvO" firstAttribute="leading" secondItem="Yd8-h2-8ZW" secondAttribute="trailing" constant="-3" id="rVx-wc-qRN"/>
|
||||
<constraint firstItem="5p1-hF-pIU" firstAttribute="leading" secondItem="SKr-dU-xbP" secondAttribute="trailing" constant="8" id="sm5-de-qgC"/>
|
||||
<constraint firstItem="Yg7-YX-5c6" firstAttribute="top" secondItem="tEV-Hx-dgE" secondAttribute="top" constant="20" id="vNY-Db-SYT"/>
|
||||
<constraint firstItem="j6s-4L-8FL" firstAttribute="top" secondItem="R09-WA-3qM" secondAttribute="bottom" constant="26" id="xu2-eN-sWL"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="tEV-Hx-dgE" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="10" id="4sF-eE-m1i"/>
|
||||
<constraint firstItem="tEV-Hx-dgE" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="18" id="W9a-0l-rd2"/>
|
||||
<constraint firstAttribute="bottom" secondItem="tEV-Hx-dgE" secondAttribute="bottom" constant="10.5" id="aAW-NN-hcU"/>
|
||||
<constraint firstAttribute="trailing" secondItem="tEV-Hx-dgE" secondAttribute="trailing" constant="16" id="wGQ-AY-hUv"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
|
||||
<connections>
|
||||
<outlet property="percentLabe" destination="xEv-bM-Qny" id="xpH-i2-nJN"/>
|
||||
<outlet property="timeLabe" destination="SKr-dU-xbP" id="LAX-mi-LrF"/>
|
||||
<outlet property="timeholdBack" destination="tEV-Hx-dgE" id="oFa-dy-K2h"/>
|
||||
<outlet property="totalTime" destination="Yd8-h2-8ZW" id="3pB-KH-2ui"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="33.5" y="53.5"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="nav_circle_avatar" width="33" height="33"/>
|
||||
<image name="result_logo" width="36" height="36"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -19,7 +19,7 @@
|
||||
#import "GiGaBaseAPiRequest.h"
|
||||
#import "GiGaUserJobViewCell.h"
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import "GIGaFileManager.h"
|
||||
#import "GIGaUserFileHelper.h"
|
||||
#import "GiGaUserDefault.h"
|
||||
#import "GiGaNetManager.h"
|
||||
#import "GiGaServerConfig.h"
|
||||
@@ -470,9 +470,9 @@
|
||||
;
|
||||
|
||||
UIImage*img=[info objectForKey:UIImagePickerControllerEditedImage];
|
||||
UIImage *samall = [GIGaFileManager thumbnailWithImageWithoutScale:img size:CGSizeMake(300, 300)];
|
||||
UIImage *samall = [GIGaUserFileHelper thumbnailWithImageWithoutScale:img size:CGSizeMake(300, 300)];
|
||||
NSString *userid = [GiGaUserDefault getCurentUserId];
|
||||
[GIGaFileManager savaUserAvatorWith:userid image:samall];
|
||||
[GIGaUserFileHelper savaUserAvatorWith:userid image:samall];
|
||||
GIGaUserInfoAvatorCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
|
||||
cell.userAvator.image = samall;
|
||||
[self uploadImage:samall];
|
||||
|
||||
@@ -26,6 +26,8 @@ target 'GIGA' do
|
||||
pod 'UMCAnalytics'
|
||||
pod 'UMCSecurityPlugins'
|
||||
pod 'Socket.IO-Client-Swift', '~> 13.3.0'
|
||||
pod 'LBXScan/LBXZXing','~> 2.3'
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@ PODS:
|
||||
- JPush (3.1.0):
|
||||
- JCore (~> 1.2.0)
|
||||
- JSONModel (1.7.0)
|
||||
- LBXScan/LBXZXing (2.3):
|
||||
- LBXScan/Types (~> 2.2)
|
||||
- LBXScan/Types (2.3)
|
||||
- LKDBHelper (2.5.1):
|
||||
- LKDBHelper/standard (= 2.5.1)
|
||||
- LKDBHelper/standard (2.5.1):
|
||||
@@ -60,6 +63,7 @@ DEPENDENCIES:
|
||||
- IQKeyboardManager
|
||||
- JPush
|
||||
- JSONModel
|
||||
- LBXScan/LBXZXing (~> 2.3)
|
||||
- LKDBHelper
|
||||
- Masonry (~> 1.0.0)
|
||||
- MBProgressHUD (~> 0.9.2)
|
||||
@@ -86,6 +90,7 @@ SPEC REPOS:
|
||||
- JCore
|
||||
- JPush
|
||||
- JSONModel
|
||||
- LBXScan
|
||||
- LKDBHelper
|
||||
- Masonry
|
||||
- MBProgressHUD
|
||||
@@ -112,6 +117,7 @@ SPEC CHECKSUMS:
|
||||
JCore: 467b5b56bd367c548f88ee1b5794d94ee07ab319
|
||||
JPush: 5921e25ad13e0386351079217b009f2039084eac
|
||||
JSONModel: 840bc0fcffb24b8454d2c026bf26fea454b8e98d
|
||||
LBXScan: e51449f0832d1fe17da632af0d22adeb3cfa3543
|
||||
LKDBHelper: 9a276ba51f2e16263d46a9517e16cc9b03472664
|
||||
Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e
|
||||
MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
|
||||
@@ -130,6 +136,6 @@ SPEC CHECKSUMS:
|
||||
WechatOpenSDK: 676feec516a11173eafd1fe64b10d27babf28701
|
||||
YTKKeyValueStore: 4d002941540dd5108fa23009b71e0f2f937f7a0f
|
||||
|
||||
PODFILE CHECKSUM: 4b1cd3dab10b2ff5d5f5d0c7305d55507309ffdf
|
||||
PODFILE CHECKSUM: 04731726bf2b2bb62e9d693c6becf4b53e05bcc6
|
||||
|
||||
COCOAPODS: 1.5.0
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
//
|
||||
//
|
||||
//
|
||||
// github:https://github.com/MxABC/LBXScan
|
||||
// Created by lbxia on 15/3/4.
|
||||
// Copyright (c) 2015年 lbxia. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
@import UIKit;
|
||||
@import Foundation;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@interface LBXScanResult : NSObject
|
||||
|
||||
|
||||
- (instancetype)initWithScanString:(NSString*)str imgScan:(UIImage*)img barCodeType:(NSString*)type;
|
||||
|
||||
/**
|
||||
@brief 条码字符串
|
||||
*/
|
||||
@property (nonatomic, copy) NSString* strScanned;
|
||||
/**
|
||||
@brief 扫码图像
|
||||
*/
|
||||
@property (nonatomic, strong) UIImage* imgScanned;
|
||||
/**
|
||||
@brief 扫码码的类型,AVMetadataObjectType 如AVMetadataObjectTypeQRCode,AVMetadataObjectTypeEAN13Code等
|
||||
如果使用ZXing扫码,返回类型也已经转换成对应的AVMetadataObjectType
|
||||
*/
|
||||
@property (nonatomic, copy) NSString* strBarCodeType;
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
|
||||
|
||||
#import "LBXScanTypes.h"
|
||||
|
||||
@implementation LBXScanResult
|
||||
|
||||
- (instancetype)initWithScanString:(NSString*)str imgScan:(UIImage*)img barCodeType:(NSString*)type
|
||||
{
|
||||
if (self = [super init]) {
|
||||
|
||||
self.strScanned = str;
|
||||
self.imgScanned = img;
|
||||
self.strBarCodeType = type;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
//#import "ZXResult.h"
|
||||
#import "LBXZXCaptureDelegate.h"
|
||||
|
||||
@protocol LBXZXCaptureDelegate, ZXReader;
|
||||
@class ZXDecodeHints;
|
||||
|
||||
@interface LBXZXCapture : NSObject <AVCaptureVideoDataOutputSampleBufferDelegate, CAAction>
|
||||
|
||||
@property (nonatomic, assign) int camera;
|
||||
@property (nonatomic, strong) AVCaptureDevice *captureDevice;
|
||||
@property (nonatomic, copy) NSString *captureToFilename;
|
||||
@property (nonatomic, weak) id<LBXZXCaptureDelegate> delegate;
|
||||
@property (nonatomic, assign) AVCaptureFocusMode focusMode;
|
||||
@property (nonatomic, strong) ZXDecodeHints *hints;
|
||||
@property (nonatomic, assign) CGImageRef lastScannedImage;
|
||||
@property (nonatomic, assign) BOOL invert;
|
||||
@property (nonatomic, strong, readonly) CALayer *layer;
|
||||
@property (nonatomic, assign) BOOL mirror;
|
||||
@property (nonatomic, strong, readonly) AVCaptureVideoDataOutput *output;
|
||||
@property (nonatomic, strong) id<ZXReader> reader;
|
||||
@property (nonatomic, assign) CGFloat rotation;
|
||||
@property (nonatomic, assign, readonly) BOOL running;
|
||||
@property (nonatomic, assign) CGRect scanRect;
|
||||
@property (nonatomic, copy) NSString *sessionPreset;
|
||||
@property (nonatomic, assign) BOOL torch;
|
||||
@property (nonatomic, assign) CGAffineTransform transform;
|
||||
|
||||
- (int)back;
|
||||
- (int)front;
|
||||
- (BOOL)hasBack;
|
||||
- (BOOL)hasFront;
|
||||
- (BOOL)hasTorch;
|
||||
|
||||
- (void)setTorch:(BOOL)torch;
|
||||
|
||||
- (void)changeTorch;
|
||||
|
||||
- (CALayer *)binary;
|
||||
- (void)setBinary:(BOOL)on_off;
|
||||
|
||||
- (CALayer *)luminance;
|
||||
- (void)setLuminance:(BOOL)on_off;
|
||||
|
||||
- (void)hard_stop;
|
||||
- (void)order_skip;
|
||||
- (void)start;
|
||||
- (void)stop;
|
||||
|
||||
|
||||
//+ (ZXResult *)regocnizeImage:(UIImage*)image;
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,620 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <ImageIO/ImageIO.h>
|
||||
#import "ZXBinaryBitmap.h"
|
||||
#import "LBXZXCapture.h"
|
||||
#import "ZXCaptureDelegate.h"
|
||||
#import "ZXCGImageLuminanceSource.h"
|
||||
#import "ZXDecodeHints.h"
|
||||
#import "ZXHybridBinarizer.h"
|
||||
#import "ZXReader.h"
|
||||
#import "ZXResult.h"
|
||||
|
||||
@interface LBXZXCapture ()
|
||||
|
||||
@property (nonatomic, strong) CALayer *binaryLayer;
|
||||
@property (nonatomic, assign) BOOL cameraIsReady;
|
||||
@property (nonatomic, assign) int captureDeviceIndex;
|
||||
@property (nonatomic, strong) dispatch_queue_t captureQueue;
|
||||
@property (nonatomic, assign) BOOL hardStop;
|
||||
@property (nonatomic, strong) AVCaptureDeviceInput *input;
|
||||
@property (nonatomic, strong) AVCaptureVideoPreviewLayer *layer;
|
||||
@property (nonatomic, strong) CALayer *luminanceLayer;
|
||||
@property (nonatomic, assign) int orderInSkip;
|
||||
@property (nonatomic, assign) int orderOutSkip;
|
||||
@property (nonatomic, assign) BOOL onScreen;
|
||||
@property (nonatomic, strong) AVCaptureVideoDataOutput *output;
|
||||
@property (nonatomic, assign) BOOL running;
|
||||
@property (nonatomic, strong) AVCaptureSession *session;
|
||||
|
||||
@end
|
||||
|
||||
@implementation LBXZXCapture
|
||||
|
||||
- (LBXZXCapture *)init {
|
||||
if (self = [super init]) {
|
||||
_captureDeviceIndex = -1;
|
||||
_captureQueue = dispatch_queue_create("com.zxing.captureQueue", NULL);
|
||||
_focusMode = AVCaptureFocusModeContinuousAutoFocus;
|
||||
_hardStop = NO;
|
||||
_hints = [ZXDecodeHints hints];
|
||||
_lastScannedImage = NULL;
|
||||
_onScreen = NO;
|
||||
_orderInSkip = 0;
|
||||
_orderOutSkip = 0;
|
||||
|
||||
if (NSClassFromString(@"ZXMultiFormatReader")) {
|
||||
_reader = [NSClassFromString(@"ZXMultiFormatReader") performSelector:@selector(reader)];
|
||||
}
|
||||
|
||||
_rotation = 0.0f;
|
||||
_running = NO;
|
||||
_sessionPreset = AVCaptureSessionPresetHigh;
|
||||
_transform = CGAffineTransformIdentity;
|
||||
_scanRect = CGRectZero;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
if (_lastScannedImage) {
|
||||
CGImageRelease(_lastScannedImage);
|
||||
}
|
||||
|
||||
if (_session && _session.inputs) {
|
||||
for(AVCaptureInput *input in _session.inputs) {
|
||||
[_session removeInput:input];
|
||||
}
|
||||
|
||||
[self.layer removeFromSuperlayer];
|
||||
}
|
||||
|
||||
if (_session && _session.outputs) {
|
||||
for(AVCaptureOutput *output in _session.outputs) {
|
||||
[_session removeOutput:output];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Property Getters
|
||||
|
||||
- (CALayer *)layer {
|
||||
AVCaptureVideoPreviewLayer *layer = (AVCaptureVideoPreviewLayer *)_layer;
|
||||
if (!_layer) {
|
||||
layer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.session];
|
||||
layer.affineTransform = self.transform;
|
||||
layer.delegate = self;
|
||||
layer.videoGravity = AVLayerVideoGravityResizeAspect;
|
||||
layer.videoGravity = AVLayerVideoGravityResizeAspectFill;
|
||||
|
||||
_layer = layer;
|
||||
}
|
||||
return layer;
|
||||
}
|
||||
|
||||
- (AVCaptureVideoDataOutput *)output {
|
||||
if (!_output) {
|
||||
_output = [[AVCaptureVideoDataOutput alloc] init];
|
||||
[_output setVideoSettings:@{
|
||||
(NSString *)kCVPixelBufferPixelFormatTypeKey : [NSNumber numberWithUnsignedInt:kCVPixelFormatType_32BGRA]
|
||||
}];
|
||||
[_output setAlwaysDiscardsLateVideoFrames:YES];
|
||||
[_output setSampleBufferDelegate:self queue:_captureQueue];
|
||||
|
||||
[self.session addOutput:_output];
|
||||
}
|
||||
|
||||
return _output;
|
||||
}
|
||||
|
||||
#pragma mark - Property Setters
|
||||
|
||||
- (void)setCamera:(int)camera {
|
||||
if (_camera != camera) {
|
||||
_camera = camera;
|
||||
self.captureDeviceIndex = -1;
|
||||
self.captureDevice = nil;
|
||||
[self replaceInput];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setDelegate:(id<LBXZXCaptureDelegate>)delegate {
|
||||
_delegate = delegate;
|
||||
|
||||
// if (delegate) {
|
||||
// self.hardStop = NO;
|
||||
// }
|
||||
// [self startStop];
|
||||
}
|
||||
|
||||
- (void)setFocusMode:(AVCaptureFocusMode)focusMode {
|
||||
if ([self.input.device isFocusModeSupported:focusMode] && self.input.device.focusMode != focusMode) {
|
||||
_focusMode = focusMode;
|
||||
|
||||
[self.input.device lockForConfiguration:nil];
|
||||
self.input.device.focusMode = focusMode;
|
||||
[self.input.device unlockForConfiguration];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setLastScannedImage:(CGImageRef)lastScannedImage {
|
||||
if (_lastScannedImage) {
|
||||
CGImageRelease(_lastScannedImage);
|
||||
}
|
||||
|
||||
if (lastScannedImage) {
|
||||
CGImageRetain(lastScannedImage);
|
||||
}
|
||||
|
||||
_lastScannedImage = lastScannedImage;
|
||||
}
|
||||
|
||||
- (void)setMirror:(BOOL)mirror {
|
||||
if (_mirror != mirror) {
|
||||
_mirror = mirror;
|
||||
if (self.layer) {
|
||||
CGAffineTransform transform = self.transform;
|
||||
transform.a = - transform.a;
|
||||
self.transform = transform;
|
||||
[self.layer setAffineTransform:self.transform];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setTorch:(BOOL)torch {
|
||||
_torch = torch;
|
||||
|
||||
[self.input.device lockForConfiguration:nil];
|
||||
self.input.device.torchMode = self.torch ? AVCaptureTorchModeOn : AVCaptureTorchModeOff;
|
||||
[self.input.device unlockForConfiguration];
|
||||
}
|
||||
|
||||
- (void)changeTorch
|
||||
{
|
||||
AVCaptureTorchMode torch = self.input.device.torchMode;
|
||||
|
||||
switch (self.input.device.torchMode) {
|
||||
case AVCaptureTorchModeAuto:
|
||||
break;
|
||||
case AVCaptureTorchModeOff:
|
||||
torch = AVCaptureTorchModeOn;
|
||||
break;
|
||||
case AVCaptureTorchModeOn:
|
||||
torch = AVCaptureTorchModeOff;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
[self.input.device lockForConfiguration:nil];
|
||||
self.input.device.torchMode = torch;
|
||||
[self.input.device unlockForConfiguration];
|
||||
}
|
||||
|
||||
|
||||
- (void)setTransform:(CGAffineTransform)transform {
|
||||
_transform = transform;
|
||||
[self.layer setAffineTransform:transform];
|
||||
}
|
||||
|
||||
#pragma mark - Back, Front, Torch
|
||||
|
||||
- (int)back {
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (int)front {
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (BOOL)hasFront {
|
||||
NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
|
||||
return [devices count] > 1;
|
||||
}
|
||||
|
||||
- (BOOL)hasBack {
|
||||
NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
|
||||
return [devices count] > 0;
|
||||
}
|
||||
|
||||
- (BOOL)hasTorch {
|
||||
if ([self device]) {
|
||||
return [self device].hasTorch;
|
||||
} else {
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Binary
|
||||
|
||||
- (CALayer *)binary {
|
||||
return self.binaryLayer;
|
||||
}
|
||||
|
||||
- (void)setBinary:(BOOL)on {
|
||||
if (on && !self.binaryLayer) {
|
||||
self.binaryLayer = [CALayer layer];
|
||||
} else if (!on && self.binaryLayer) {
|
||||
self.binaryLayer = nil;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Luminance
|
||||
|
||||
- (CALayer *)luminance {
|
||||
return self.luminanceLayer;
|
||||
}
|
||||
|
||||
- (void)setLuminance:(BOOL)on {
|
||||
if (on && !self.luminanceLayer) {
|
||||
self.luminanceLayer = [CALayer layer];
|
||||
} else if (!on && self.luminanceLayer) {
|
||||
self.luminanceLayer = nil;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Start, Stop
|
||||
|
||||
- (void)hard_stop {
|
||||
self.hardStop = YES;
|
||||
|
||||
if (self.running) {
|
||||
[self stop];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)order_skip {
|
||||
self.orderInSkip = 1;
|
||||
self.orderOutSkip = 1;
|
||||
}
|
||||
|
||||
- (void)start {
|
||||
|
||||
if (self.running) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.hardStop) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.delegate || self.luminanceLayer || self.binaryLayer) {
|
||||
(void)[self output];
|
||||
}
|
||||
|
||||
if (!self.session.running) {
|
||||
static int i = 0;
|
||||
if (++i == -2) {
|
||||
abort();
|
||||
}
|
||||
|
||||
[self.session startRunning];
|
||||
}
|
||||
self.running = YES;
|
||||
}
|
||||
|
||||
- (void)stop
|
||||
{
|
||||
if (!self.running) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.session.running) {
|
||||
// [self.layer removeFromSuperlayer];
|
||||
[self.session stopRunning];
|
||||
}
|
||||
self.running = NO;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - CAAction
|
||||
|
||||
- (id<CAAction>)actionForLayer:(CALayer *)_layer forKey:(NSString *)event {
|
||||
[CATransaction setValue:[NSNumber numberWithFloat:0.0f] forKey:kCATransactionAnimationDuration];
|
||||
|
||||
if ([event isEqualToString:kCAOnOrderIn] || [event isEqualToString:kCAOnOrderOut]) {
|
||||
return self;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)runActionForKey:(NSString *)key object:(id)anObject arguments:(NSDictionary *)dict {
|
||||
if ([key isEqualToString:kCAOnOrderIn]) {
|
||||
if (self.orderInSkip) {
|
||||
self.orderInSkip--;
|
||||
return;
|
||||
}
|
||||
|
||||
self.onScreen = YES;
|
||||
// [self startStop];
|
||||
} else if ([key isEqualToString:kCAOnOrderOut]) {
|
||||
if (self.orderOutSkip) {
|
||||
self.orderOutSkip--;
|
||||
return;
|
||||
}
|
||||
|
||||
self.onScreen = NO;
|
||||
// [self startStop];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - AVCaptureVideoDataOutputSampleBufferDelegate
|
||||
|
||||
- (void)captureOutput:(AVCaptureOutput *)captureOutput
|
||||
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
||||
fromConnection:(AVCaptureConnection *)connection {
|
||||
|
||||
|
||||
@autoreleasepool {
|
||||
if (!self.cameraIsReady) {
|
||||
self.cameraIsReady = YES;
|
||||
if ([self.delegate respondsToSelector:@selector(captureCameraIsReady:)]) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.delegate LBXCaptureCameraIsReady:self];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (!self.captureToFilename && !self.luminanceLayer && !self.binaryLayer && !self.delegate) {
|
||||
return;
|
||||
}
|
||||
|
||||
CVImageBufferRef videoFrame = CMSampleBufferGetImageBuffer(sampleBuffer);
|
||||
|
||||
CGImageRef videoFrameImage = [ZXCGImageLuminanceSource createImageFromBuffer:videoFrame];
|
||||
CGImageRef rotatedImage = [self createRotatedImage:videoFrameImage degrees:self.rotation];
|
||||
CGImageRelease(videoFrameImage);
|
||||
|
||||
// If scanRect is set, crop the current image to include only the desired rect
|
||||
if (!CGRectIsEmpty(self.scanRect)) {
|
||||
CGImageRef croppedImage = CGImageCreateWithImageInRect(rotatedImage, self.scanRect);
|
||||
CFRelease(rotatedImage);
|
||||
rotatedImage = croppedImage;
|
||||
}
|
||||
|
||||
self.lastScannedImage = rotatedImage;
|
||||
|
||||
if (self.captureToFilename) {
|
||||
NSURL *url = [NSURL fileURLWithPath:self.captureToFilename];
|
||||
CGImageDestinationRef dest = CGImageDestinationCreateWithURL((__bridge CFURLRef)url, (__bridge CFStringRef)@"public.png", 1, nil);
|
||||
CGImageDestinationAddImage(dest, rotatedImage, nil);
|
||||
CGImageDestinationFinalize(dest);
|
||||
CFRelease(dest);
|
||||
self.captureToFilename = nil;
|
||||
}
|
||||
|
||||
ZXCGImageLuminanceSource *source = [[ZXCGImageLuminanceSource alloc] initWithCGImage:rotatedImage];
|
||||
CGImageRelease(rotatedImage);
|
||||
|
||||
if (self.luminanceLayer) {
|
||||
CGImageRef image = source.image;
|
||||
CGImageRetain(image);
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0), dispatch_get_main_queue(), ^{
|
||||
self.luminanceLayer.contents = (__bridge id)image;
|
||||
CGImageRelease(image);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (self.binaryLayer || self.delegate)
|
||||
{
|
||||
ZXHybridBinarizer *binarizer = [[ZXHybridBinarizer alloc] initWithSource:self.invert ? [source invert] : source];
|
||||
|
||||
if (self.binaryLayer)
|
||||
{
|
||||
CGImageRef image = [binarizer createImage];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0), dispatch_get_main_queue(), ^{
|
||||
self.binaryLayer.contents = (__bridge id)image;
|
||||
CGImageRelease(image);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if (self.delegate)
|
||||
{
|
||||
static NSInteger sampleBufferNums = 0;
|
||||
|
||||
sampleBufferNums++;
|
||||
|
||||
if (sampleBufferNums != 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSLog(@"sampleBufferNums");
|
||||
sampleBufferNums = 0;
|
||||
|
||||
ZXBinaryBitmap *bitmap = [[ZXBinaryBitmap alloc] initWithBinarizer:binarizer];
|
||||
|
||||
NSError *error;
|
||||
ZXResult *result = [self.reader decode:bitmap hints:self.hints error:&error];
|
||||
if (result) {
|
||||
// CGImageRef iOffscreen = CGBitmapContextCreateImage(context);
|
||||
UIImage* image = [UIImage imageWithCGImage: _lastScannedImage];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.delegate captureResult:self result:result scanImage:image];
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//+ (ZXResult *)regocnizeImage:(UIImage*)image
|
||||
//{
|
||||
// ZXCGImageLuminanceSource *source = [[ZXCGImageLuminanceSource alloc] initWithCGImage:image.CGImage];
|
||||
//
|
||||
// ZXHybridBinarizer *binarizer = [[ZXHybridBinarizer alloc] initWithSource: source];
|
||||
//
|
||||
// ZXBinaryBitmap *bitmap = [[ZXBinaryBitmap alloc] initWithBinarizer:binarizer];
|
||||
//
|
||||
// NSError *error;
|
||||
//
|
||||
// id<ZXReader> reader;
|
||||
//
|
||||
// if (NSClassFromString(@"ZXMultiFormatReader")) {
|
||||
// reader = [NSClassFromString(@"ZXMultiFormatReader") performSelector:@selector(reader)];
|
||||
// }
|
||||
//
|
||||
// ZXDecodeHints *_hints = [ZXDecodeHints hints];
|
||||
// ZXResult *result = [reader decode:bitmap hints:_hints error:&error];
|
||||
//
|
||||
// return result;
|
||||
//}
|
||||
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
// Adapted from http://blog.coriolis.ch/2009/09/04/arbitrary-rotation-of-a-cgimage/ and https://github.com/JanX2/CreateRotateWriteCGImage
|
||||
- (CGImageRef)createRotatedImage:(CGImageRef)original degrees:(float)degrees CF_RETURNS_RETAINED {
|
||||
if (degrees == 0.0f) {
|
||||
CGImageRetain(original);
|
||||
return original;
|
||||
} else {
|
||||
double radians = degrees * M_PI / 180;
|
||||
|
||||
#if TARGET_OS_EMBEDDED || TARGET_IPHONE_SIMULATOR
|
||||
radians = -1 * radians;
|
||||
#endif
|
||||
|
||||
size_t _width = CGImageGetWidth(original);
|
||||
size_t _height = CGImageGetHeight(original);
|
||||
|
||||
CGRect imgRect = CGRectMake(0, 0, _width, _height);
|
||||
CGAffineTransform __transform = CGAffineTransformMakeRotation(radians);
|
||||
CGRect rotatedRect = CGRectApplyAffineTransform(imgRect, __transform);
|
||||
|
||||
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
|
||||
CGContextRef context = CGBitmapContextCreate(NULL,
|
||||
rotatedRect.size.width,
|
||||
rotatedRect.size.height,
|
||||
CGImageGetBitsPerComponent(original),
|
||||
0,
|
||||
colorSpace,
|
||||
kCGBitmapAlphaInfoMask & kCGImageAlphaPremultipliedFirst);
|
||||
CGContextSetAllowsAntialiasing(context, FALSE);
|
||||
CGContextSetInterpolationQuality(context, kCGInterpolationNone);
|
||||
CGColorSpaceRelease(colorSpace);
|
||||
|
||||
CGContextTranslateCTM(context,
|
||||
+(rotatedRect.size.width/2),
|
||||
+(rotatedRect.size.height/2));
|
||||
CGContextRotateCTM(context, radians);
|
||||
|
||||
CGContextDrawImage(context, CGRectMake(-imgRect.size.width/2,
|
||||
-imgRect.size.height/2,
|
||||
imgRect.size.width,
|
||||
imgRect.size.height),
|
||||
original);
|
||||
|
||||
CGImageRef rotatedImage = CGBitmapContextCreateImage(context);
|
||||
CFRelease(context);
|
||||
|
||||
return rotatedImage;
|
||||
}
|
||||
}
|
||||
|
||||
- (AVCaptureDevice *)device {
|
||||
if (self.captureDevice) {
|
||||
return self.captureDevice;
|
||||
}
|
||||
|
||||
AVCaptureDevice *zxd = nil;
|
||||
|
||||
NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
|
||||
|
||||
if ([devices count] > 0) {
|
||||
if (self.captureDeviceIndex == -1) {
|
||||
AVCaptureDevicePosition position = AVCaptureDevicePositionBack;
|
||||
if (self.camera == self.front) {
|
||||
position = AVCaptureDevicePositionFront;
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < [devices count]; ++i) {
|
||||
AVCaptureDevice *dev = [devices objectAtIndex:i];
|
||||
if (dev.position == position) {
|
||||
self.captureDeviceIndex = i;
|
||||
zxd = dev;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!zxd && self.captureDeviceIndex != -1) {
|
||||
zxd = [devices objectAtIndex:self.captureDeviceIndex];
|
||||
}
|
||||
}
|
||||
|
||||
if (!zxd) {
|
||||
zxd = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
|
||||
}
|
||||
|
||||
self.captureDevice = zxd;
|
||||
|
||||
return zxd;
|
||||
}
|
||||
|
||||
- (void)replaceInput {
|
||||
[self.session beginConfiguration];
|
||||
|
||||
if (self.session && self.input) {
|
||||
[self.session removeInput:self.input];
|
||||
self.input = nil;
|
||||
}
|
||||
|
||||
AVCaptureDevice *zxd = [self device];
|
||||
|
||||
if (zxd) {
|
||||
self.input = [AVCaptureDeviceInput deviceInputWithDevice:zxd error:nil];
|
||||
self.focusMode = self.focusMode;
|
||||
}
|
||||
|
||||
if (self.input) {
|
||||
self.session.sessionPreset = self.sessionPreset;
|
||||
[self.session addInput:self.input];
|
||||
}
|
||||
|
||||
[self.session commitConfiguration];
|
||||
}
|
||||
|
||||
- (AVCaptureSession *)session {
|
||||
if (!_session) {
|
||||
_session = [[AVCaptureSession alloc] init];
|
||||
[self replaceInput];
|
||||
}
|
||||
|
||||
return _session;
|
||||
}
|
||||
|
||||
- (void)startStop {
|
||||
if ((!self.running && (self.delegate || self.onScreen)) ||
|
||||
(!self.output &&
|
||||
(self.delegate ||
|
||||
(self.onScreen && (self.luminanceLayer || self.binaryLayer))))) {
|
||||
[self start];
|
||||
}
|
||||
|
||||
if (self.running && !self.delegate && !self.onScreen) {
|
||||
[self stop];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@class LBXZXCapture;
|
||||
@class ZXResult;
|
||||
|
||||
@protocol LBXZXCaptureDelegate <NSObject>
|
||||
|
||||
- (void)captureResult:(LBXZXCapture *)capture result:(ZXResult *)result scanImage:(UIImage*)img;
|
||||
|
||||
@optional
|
||||
- (void)LBXCaptureSize:(LBXZXCapture *)capture
|
||||
width:(NSNumber *)width
|
||||
height:(NSNumber *)height;
|
||||
|
||||
- (void)LBXCaptureCameraIsReady:(LBXZXCapture *)capture;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXReader.h"
|
||||
|
||||
@class ZXDecodeHints;
|
||||
|
||||
/**
|
||||
* ZXMultiFormatReader is a convenience class and the main entry point into the library for most uses.
|
||||
* By default it attempts to decode all barcode formats that the library supports. Optionally, you
|
||||
* can provide a hints object to request different behavior, for example only decoding QR codes.
|
||||
*/
|
||||
@interface ZXMultiFormatReader : NSObject <ZXReader>
|
||||
|
||||
@property (nonatomic, strong) ZXDecodeHints *hints;
|
||||
|
||||
+ (id)reader;
|
||||
|
||||
/**
|
||||
* Decode an image using the state set up by calling setHints() previously. Continuous scan
|
||||
* clients will get a <b>large</b> speed increase by using this instead of decode().
|
||||
*
|
||||
* @param image The pixel data to decode
|
||||
* @return The contents of the image or nil if any errors occurred
|
||||
*/
|
||||
- (ZXResult *)decodeWithState:(ZXBinaryBitmap *)image error:(NSError **)error;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,164 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXAztecReader.h"
|
||||
#import "ZXBinaryBitmap.h"
|
||||
#import "ZXDataMatrixReader.h"
|
||||
#import "ZXDecodeHints.h"
|
||||
#import "ZXErrors.h"
|
||||
#import "ZXMaxiCodeReader.h"
|
||||
#import "ZXMultiFormatOneDReader.h"
|
||||
#import "ZXMultiFormatReader.h"
|
||||
#import "ZXPDF417Reader.h"
|
||||
#import "ZXQRCodeReader.h"
|
||||
#import "ZXResult.h"
|
||||
|
||||
@interface ZXMultiFormatReader ()
|
||||
|
||||
@property (nonatomic, strong, readonly) NSMutableArray *readers;
|
||||
|
||||
@end
|
||||
|
||||
@implementation ZXMultiFormatReader
|
||||
|
||||
- (id)init {
|
||||
if (self = [super init]) {
|
||||
_readers = [NSMutableArray array];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (id)reader {
|
||||
return [[ZXMultiFormatReader alloc] init];
|
||||
}
|
||||
|
||||
/**
|
||||
* This version of decode honors the intent of Reader.decode(BinaryBitmap) in that it
|
||||
* passes null as a hint to the decoders. However, that makes it inefficient to call repeatedly.
|
||||
* Use setHints() followed by decodeWithState() for continuous scan applications.
|
||||
*
|
||||
* @param image The pixel data to decode
|
||||
* @return The contents of the image or nil if any errors occurred
|
||||
*/
|
||||
- (ZXResult *)decode:(ZXBinaryBitmap *)image error:(NSError **)error {
|
||||
self.hints = nil;
|
||||
return [self decodeInternal:image error:error];
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode an image using the hints provided. Does not honor existing state.
|
||||
*
|
||||
* @param image The pixel data to decode
|
||||
* @param hints The hints to use, clearing the previous state.
|
||||
* @return The contents of the image or nil if any errors occurred
|
||||
*/
|
||||
- (ZXResult *)decode:(ZXBinaryBitmap *)image hints:(ZXDecodeHints *)hints error:(NSError **)error {
|
||||
self.hints = hints;
|
||||
return [self decodeInternal:image error:error];
|
||||
}
|
||||
|
||||
- (ZXResult *)decodeWithState:(ZXBinaryBitmap *)image error:(NSError **)error {
|
||||
if (self.readers == nil) {
|
||||
self.hints = nil;
|
||||
}
|
||||
return [self decodeInternal:image error:error];
|
||||
}
|
||||
|
||||
/**
|
||||
* This method adds state to the MultiFormatReader. By setting the hints once, subsequent calls
|
||||
* to decodeWithState(image) can reuse the same set of readers without reallocating memory. This
|
||||
* is important for performance in continuous scan clients.
|
||||
*
|
||||
* @param hints The set of hints to use for subsequent calls to decode(image)
|
||||
*/
|
||||
- (void)setHints:(ZXDecodeHints *)hints {
|
||||
_hints = hints;
|
||||
|
||||
BOOL tryHarder = hints != nil && hints.tryHarder;
|
||||
[self.readers removeAllObjects];
|
||||
if (hints != nil) {
|
||||
BOOL addZXOneDReader = [hints containsFormat:kBarcodeFormatUPCA] ||
|
||||
[hints containsFormat:kBarcodeFormatUPCE] ||
|
||||
[hints containsFormat:kBarcodeFormatEan13] ||
|
||||
[hints containsFormat:kBarcodeFormatEan8] ||
|
||||
[hints containsFormat:kBarcodeFormatCodabar] ||
|
||||
[hints containsFormat:kBarcodeFormatCode39] ||
|
||||
[hints containsFormat:kBarcodeFormatCode93] ||
|
||||
[hints containsFormat:kBarcodeFormatCode128] ||
|
||||
[hints containsFormat:kBarcodeFormatITF] ||
|
||||
[hints containsFormat:kBarcodeFormatRSS14] ||
|
||||
[hints containsFormat:kBarcodeFormatRSSExpanded];
|
||||
if (addZXOneDReader && !tryHarder) {
|
||||
[self.readers addObject:[[ZXMultiFormatOneDReader alloc] initWithHints:hints]];
|
||||
}
|
||||
if ([hints containsFormat:kBarcodeFormatQRCode]) {
|
||||
[self.readers addObject:[[ZXQRCodeReader alloc] init]];
|
||||
}
|
||||
if ([hints containsFormat:kBarcodeFormatDataMatrix]) {
|
||||
[self.readers addObject:[[ZXDataMatrixReader alloc] init]];
|
||||
}
|
||||
if ([hints containsFormat:kBarcodeFormatAztec]) {
|
||||
[self.readers addObject:[[ZXAztecReader alloc] init]];
|
||||
}
|
||||
if ([hints containsFormat:kBarcodeFormatPDF417]) {
|
||||
[self.readers addObject:[[ZXPDF417Reader alloc] init]];
|
||||
}
|
||||
if ([hints containsFormat:kBarcodeFormatMaxiCode]) {
|
||||
[self.readers addObject:[[ZXMaxiCodeReader alloc] init]];
|
||||
}
|
||||
if (addZXOneDReader && tryHarder) {
|
||||
[self.readers addObject:[[ZXMultiFormatOneDReader alloc] initWithHints:hints]];
|
||||
}
|
||||
}
|
||||
if ([self.readers count] == 0) {
|
||||
if (!tryHarder) {
|
||||
[self.readers addObject:[[ZXMultiFormatOneDReader alloc] initWithHints:hints]];
|
||||
}
|
||||
[self.readers addObject:[[ZXQRCodeReader alloc] init]];
|
||||
[self.readers addObject:[[ZXDataMatrixReader alloc] init]];
|
||||
[self.readers addObject:[[ZXAztecReader alloc] init]];
|
||||
[self.readers addObject:[[ZXPDF417Reader alloc] init]];
|
||||
[self.readers addObject:[[ZXMaxiCodeReader alloc] init]];
|
||||
if (tryHarder) {
|
||||
[self.readers addObject:[[ZXMultiFormatOneDReader alloc] initWithHints:hints]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)reset {
|
||||
if (self.readers != nil) {
|
||||
for (id<ZXReader> reader in self.readers) {
|
||||
[reader reset];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (ZXResult *)decodeInternal:(ZXBinaryBitmap *)image error:(NSError **)error {
|
||||
if (self.readers != nil) {
|
||||
for (id<ZXReader> reader in self.readers) {
|
||||
ZXResult *result = [reader decode:image hints:self.hints error:nil];
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (error) *error = ZXNotFoundErrorInstance();
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXWriter.h"
|
||||
|
||||
/**
|
||||
* This is a factory class which finds the appropriate Writer subclass for the BarcodeFormat
|
||||
* requested and encodes the barcode with the supplied contents.
|
||||
*/
|
||||
@interface ZXMultiFormatWriter : NSObject <ZXWriter>
|
||||
|
||||
+ (id)writer;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXAztecWriter.h"
|
||||
#import "ZXBitMatrix.h"
|
||||
#import "ZXCodaBarWriter.h"
|
||||
#import "ZXCode39Writer.h"
|
||||
#import "ZXCode128Writer.h"
|
||||
#import "ZXDataMatrixWriter.h"
|
||||
#import "ZXEAN8Writer.h"
|
||||
#import "ZXEAN13Writer.h"
|
||||
#import "ZXErrors.h"
|
||||
#import "ZXITFWriter.h"
|
||||
#import "ZXMultiFormatWriter.h"
|
||||
#import "ZXPDF417Writer.h"
|
||||
#import "ZXQRCodeWriter.h"
|
||||
#import "ZXUPCAWriter.h"
|
||||
|
||||
@implementation ZXMultiFormatWriter
|
||||
|
||||
+ (id)writer {
|
||||
return [[ZXMultiFormatWriter alloc] init];
|
||||
}
|
||||
|
||||
- (ZXBitMatrix *)encode:(NSString *)contents format:(ZXBarcodeFormat)format width:(int)width height:(int)height error:(NSError **)error {
|
||||
return [self encode:contents format:format width:width height:height hints:nil error:error];
|
||||
}
|
||||
|
||||
- (ZXBitMatrix *)encode:(NSString *)contents format:(ZXBarcodeFormat)format width:(int)width height:(int)height hints:(ZXEncodeHints *)hints error:(NSError **)error {
|
||||
id<ZXWriter> writer;
|
||||
switch (format) {
|
||||
case kBarcodeFormatEan8:
|
||||
writer = [[ZXEAN8Writer alloc] init];
|
||||
break;
|
||||
|
||||
case kBarcodeFormatEan13:
|
||||
writer = [[ZXEAN13Writer alloc] init];
|
||||
break;
|
||||
|
||||
case kBarcodeFormatUPCA:
|
||||
writer = [[ZXUPCAWriter alloc] init];
|
||||
break;
|
||||
|
||||
case kBarcodeFormatQRCode:
|
||||
writer = [[ZXQRCodeWriter alloc] init];
|
||||
break;
|
||||
|
||||
case kBarcodeFormatCode39:
|
||||
writer = [[ZXCode39Writer alloc] init];
|
||||
break;
|
||||
|
||||
case kBarcodeFormatCode128:
|
||||
writer = [[ZXCode128Writer alloc] init];
|
||||
break;
|
||||
|
||||
case kBarcodeFormatITF:
|
||||
writer = [[ZXITFWriter alloc] init];
|
||||
break;
|
||||
|
||||
case kBarcodeFormatPDF417:
|
||||
writer = [[ZXPDF417Writer alloc] init];
|
||||
break;
|
||||
|
||||
case kBarcodeFormatCodabar:
|
||||
writer = [[ZXCodaBarWriter alloc] init];
|
||||
break;
|
||||
|
||||
case kBarcodeFormatDataMatrix:
|
||||
writer = [[ZXDataMatrixWriter alloc] init];
|
||||
break;
|
||||
|
||||
case kBarcodeFormatAztec:
|
||||
writer = [[ZXAztecWriter alloc] init];
|
||||
break;
|
||||
|
||||
default:
|
||||
if (error) *error = [NSError errorWithDomain:ZXErrorDomain code:ZXWriterError userInfo:@{NSLocalizedDescriptionKey: @"No encoder available for format"}];
|
||||
return nil;
|
||||
}
|
||||
return [writer encode:contents format:format width:width height:height hints:hints error:error];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#ifndef _ZXINGOBJC_
|
||||
|
||||
#define _ZXINGOBJC_
|
||||
|
||||
#import "ZXingObjCAztec.h"
|
||||
#import "ZXingObjCCore.h"
|
||||
#import "ZXingObjCDataMatrix.h"
|
||||
#import "ZXingObjCMaxiCode.h"
|
||||
#import "ZXingObjCOneD.h"
|
||||
#import "ZXingObjCQRCode.h"
|
||||
#import "ZXingObjCPDF417.h"
|
||||
|
||||
#import "ZXMultiFormatReader.h"
|
||||
#import "ZXMultiFormatWriter.h"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXBitMatrix.h"
|
||||
#import "ZXDetectorResult.h"
|
||||
|
||||
@interface ZXAztecDetectorResult : ZXDetectorResult
|
||||
|
||||
@property (nonatomic, assign, readonly, getter = isCompact) BOOL compact;
|
||||
@property (nonatomic, assign, readonly) int nbDatablocks;
|
||||
@property (nonatomic, assign, readonly) int nbLayers;
|
||||
|
||||
- (id)initWithBits:(ZXBitMatrix *)bits
|
||||
points:(NSArray *)points
|
||||
compact:(BOOL)compact
|
||||
nbDatablocks:(int)nbDatablocks
|
||||
nbLayers:(int)nbLayers;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXAztecDetectorResult.h"
|
||||
|
||||
@implementation ZXAztecDetectorResult
|
||||
|
||||
- (id)initWithBits:(ZXBitMatrix *)bits
|
||||
points:(NSArray *)points
|
||||
compact:(BOOL)compact
|
||||
nbDatablocks:(int)nbDatablocks
|
||||
nbLayers:(int)nbLayers {
|
||||
if (self = [super initWithBits:bits points:points]) {
|
||||
_compact = compact;
|
||||
_nbDatablocks = nbDatablocks;
|
||||
_nbLayers = nbLayers;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXReader.h"
|
||||
|
||||
@class ZXBinaryBitmap, ZXDecodeHints, ZXResult;
|
||||
|
||||
/**
|
||||
* This implementation can detect and decode Aztec codes in an image.
|
||||
*/
|
||||
@interface ZXAztecReader : NSObject <ZXReader>
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXAztecDecoder.h"
|
||||
#import "ZXAztecDetector.h"
|
||||
#import "ZXAztecDetectorResult.h"
|
||||
#import "ZXAztecReader.h"
|
||||
#import "ZXBinaryBitmap.h"
|
||||
#import "ZXDecodeHints.h"
|
||||
#import "ZXDecoderResult.h"
|
||||
#import "ZXReader.h"
|
||||
#import "ZXResult.h"
|
||||
#import "ZXResultPointCallback.h"
|
||||
|
||||
@implementation ZXAztecReader
|
||||
|
||||
- (ZXResult *)decode:(ZXBinaryBitmap *)image error:(NSError **)error {
|
||||
return [self decode:image hints:nil error:error];
|
||||
}
|
||||
|
||||
- (ZXResult *)decode:(ZXBinaryBitmap *)image hints:(ZXDecodeHints *)hints error:(NSError **)error {
|
||||
ZXBitMatrix *matrix = [image blackMatrixWithError:error];
|
||||
if (!matrix) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
ZXAztecDetector *detector = [[ZXAztecDetector alloc] initWithImage:matrix];
|
||||
NSArray *points = nil;
|
||||
ZXDecoderResult *decoderResult = nil;
|
||||
|
||||
ZXAztecDetectorResult *detectorResult = [detector detectWithMirror:NO error:error];
|
||||
if (detectorResult) {
|
||||
points = detectorResult.points;
|
||||
decoderResult = [[[ZXAztecDecoder alloc] init] decode:detectorResult error:error];
|
||||
}
|
||||
|
||||
if (decoderResult == nil) {
|
||||
detectorResult = [detector detectWithMirror:YES error:nil];
|
||||
points = detectorResult.points;
|
||||
if (detectorResult) {
|
||||
decoderResult = [[[ZXAztecDecoder alloc] init] decode:detectorResult error:nil];
|
||||
}
|
||||
}
|
||||
|
||||
if (!decoderResult) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (hints != nil) {
|
||||
id <ZXResultPointCallback> rpcb = hints.resultPointCallback;
|
||||
if (rpcb != nil) {
|
||||
for (ZXResultPoint *p in points) {
|
||||
[rpcb foundPossibleResultPoint:p];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ZXResult *result = [ZXResult resultWithText:decoderResult.text rawBytes:decoderResult.rawBytes resultPoints:points format:kBarcodeFormatAztec];
|
||||
|
||||
NSMutableArray *byteSegments = decoderResult.byteSegments;
|
||||
if (byteSegments != nil) {
|
||||
[result putMetadata:kResultMetadataTypeByteSegments value:byteSegments];
|
||||
}
|
||||
NSString *ecLevel = decoderResult.ecLevel;
|
||||
if (ecLevel != nil) {
|
||||
[result putMetadata:kResultMetadataTypeErrorCorrectionLevel value:ecLevel];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)reset {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright 2013 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXWriter.h"
|
||||
|
||||
@interface ZXAztecWriter : NSObject <ZXWriter>
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright 2013 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXAztecCode.h"
|
||||
#import "ZXAztecEncoder.h"
|
||||
#import "ZXAztecWriter.h"
|
||||
#import "ZXBitMatrix.h"
|
||||
#import "ZXByteArray.h"
|
||||
#import "ZXEncodeHints.h"
|
||||
|
||||
const NSStringEncoding ZX_AZTEC_DEFAULT_ENCODING = NSISOLatin1StringEncoding;
|
||||
|
||||
@implementation ZXAztecWriter
|
||||
|
||||
- (ZXBitMatrix *)encode:(NSString *)contents format:(ZXBarcodeFormat)format width:(int)width height:(int)height error:(NSError **)error {
|
||||
return [self encode:contents format:format width:width height:height hints:nil error:error];
|
||||
}
|
||||
|
||||
- (ZXBitMatrix *)encode:(NSString *)contents format:(ZXBarcodeFormat)format width:(int)width height:(int)height hints:(ZXEncodeHints *)hints error:(NSError **)error {
|
||||
NSStringEncoding encoding = hints.encoding;
|
||||
NSNumber *eccPercent = hints.errorCorrectionPercent;
|
||||
NSNumber *layers = hints.aztecLayers;
|
||||
|
||||
return [self encode:contents
|
||||
format:format
|
||||
width:width
|
||||
height:height
|
||||
encoding:encoding == 0 ? ZX_AZTEC_DEFAULT_ENCODING : encoding
|
||||
eccPercent:eccPercent == nil ? ZX_AZTEC_DEFAULT_EC_PERCENT : [eccPercent intValue]
|
||||
layers:layers == nil ? ZX_AZTEC_DEFAULT_LAYERS : [layers intValue]];
|
||||
}
|
||||
|
||||
- (ZXBitMatrix *)encode:(NSString *)contents format:(ZXBarcodeFormat)format width:(int)width
|
||||
height:(int)height encoding:(NSStringEncoding)encoding eccPercent:(int)eccPercent layers:(int)layers {
|
||||
if (format != kBarcodeFormatAztec) {
|
||||
@throw [NSException exceptionWithName:NSInvalidArgumentException
|
||||
reason:[NSString stringWithFormat:@"Can only encode kBarcodeFormatAztec (%d), but got %d", kBarcodeFormatAztec, format]
|
||||
userInfo:nil];
|
||||
}
|
||||
|
||||
NSData *data = [contents dataUsingEncoding:encoding];
|
||||
ZXByteArray *bytes = [[ZXByteArray alloc] initWithLength:(unsigned int)[data length]];
|
||||
memcpy(bytes.array, [data bytes], bytes.length * sizeof(int8_t));
|
||||
ZXAztecCode *aztec = [ZXAztecEncoder encode:bytes minECCPercent:eccPercent userSpecifiedLayers:layers];
|
||||
return [self renderResult:aztec width:width height:height];
|
||||
}
|
||||
|
||||
- (ZXBitMatrix *)renderResult:(ZXAztecCode *)aztec width:(int)width height:(int)height {
|
||||
ZXBitMatrix *input = aztec.matrix;
|
||||
if (!input) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
int inputWidth = input.width;
|
||||
int inputHeight = input.height;
|
||||
int outputWidth = MAX(width, inputWidth);
|
||||
int outputHeight = MAX(height, inputHeight);
|
||||
|
||||
int multiple = MIN(outputWidth / inputWidth, outputHeight / inputHeight);
|
||||
int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
|
||||
int topPadding = (outputHeight - (inputHeight * multiple)) / 2;
|
||||
|
||||
ZXBitMatrix *output = [[ZXBitMatrix alloc] initWithWidth:outputWidth height:outputHeight];
|
||||
|
||||
for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
|
||||
// Write the contents of this row of the barcode
|
||||
for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
|
||||
if ([input getX:inputX y:inputY]) {
|
||||
[output setRegionAtLeft:outputX top:outputY width:multiple height:multiple];
|
||||
}
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2014 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXingObjCCore.h"
|
||||
|
||||
#ifndef _ZXINGOBJC_AZTEC_
|
||||
|
||||
#define _ZXINGOBJC_AZTEC_
|
||||
|
||||
#import "ZXAztecCode.h"
|
||||
#import "ZXAztecDecoder.h"
|
||||
#import "ZXAztecDetector.h"
|
||||
#import "ZXAztecDetectorResult.h"
|
||||
#import "ZXAztecEncoder.h"
|
||||
#import "ZXAztecHighLevelEncoder.h"
|
||||
#import "ZXAztecReader.h"
|
||||
#import "ZXAztecWriter.h"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@class ZXAztecDetectorResult, ZXBoolArray, ZXDecoderResult;
|
||||
|
||||
/**
|
||||
* The main class which implements Aztec Code decoding -- as opposed to locating and extracting
|
||||
* the Aztec Code from an image.
|
||||
*/
|
||||
@interface ZXAztecDecoder : NSObject
|
||||
|
||||
- (ZXDecoderResult *)decode:(ZXAztecDetectorResult *)detectorResult error:(NSError **)error;
|
||||
|
||||
// This method is used for testing the high-level encoder
|
||||
+ (NSString *)highLevelDecode:(ZXBoolArray *)correctedBits;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,351 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXAztecDecoder.h"
|
||||
#import "ZXAztecDetectorResult.h"
|
||||
#import "ZXBitMatrix.h"
|
||||
#import "ZXBoolArray.h"
|
||||
#import "ZXDecoderResult.h"
|
||||
#import "ZXErrors.h"
|
||||
#import "ZXGenericGF.h"
|
||||
#import "ZXIntArray.h"
|
||||
#import "ZXReedSolomonDecoder.h"
|
||||
|
||||
typedef enum {
|
||||
ZXAztecTableUpper = 0,
|
||||
ZXAztecTableLower,
|
||||
ZXAztecTableMixed,
|
||||
ZXAztecTableDigit,
|
||||
ZXAztecTablePunct,
|
||||
ZXAztecTableBinary
|
||||
} ZXAztecTable;
|
||||
|
||||
static NSString *ZX_AZTEC_UPPER_TABLE[] = {
|
||||
@"CTRL_PS", @" ", @"A", @"B", @"C", @"D", @"E", @"F", @"G", @"H", @"I", @"J", @"K", @"L", @"M", @"N", @"O", @"P",
|
||||
@"Q", @"R", @"S", @"T", @"U", @"V", @"W", @"X", @"Y", @"Z", @"CTRL_LL", @"CTRL_ML", @"CTRL_DL", @"CTRL_BS"
|
||||
};
|
||||
|
||||
static NSString *ZX_AZTEC_LOWER_TABLE[] = {
|
||||
@"CTRL_PS", @" ", @"a", @"b", @"c", @"d", @"e", @"f", @"g", @"h", @"i", @"j", @"k", @"l", @"m", @"n", @"o", @"p",
|
||||
@"q", @"r", @"s", @"t", @"u", @"v", @"w", @"x", @"y", @"z", @"CTRL_US", @"CTRL_ML", @"CTRL_DL", @"CTRL_BS"
|
||||
};
|
||||
|
||||
static NSString *ZX_AZTEC_MIXED_TABLE[] = {
|
||||
@"CTRL_PS", @" ", @"\1", @"\2", @"\3", @"\4", @"\5", @"\6", @"\7", @"\b", @"\t", @"\n",
|
||||
@"\13", @"\f", @"\r", @"\33", @"\34", @"\35", @"\36", @"\37", @"@", @"\\", @"^", @"_",
|
||||
@"`", @"|", @"~", @"\177", @"CTRL_LL", @"CTRL_UL", @"CTRL_PL", @"CTRL_BS"
|
||||
};
|
||||
|
||||
static NSString *ZX_AZTEC_PUNCT_TABLE[] = {
|
||||
@"", @"\r", @"\r\n", @". ", @", ", @": ", @"!", @"\"", @"#", @"$", @"%", @"&", @"'", @"(", @")",
|
||||
@"*", @"+", @",", @"-", @".", @"/", @":", @";", @"<", @"=", @">", @"?", @"[", @"]", @"{", @"}", @"CTRL_UL"
|
||||
};
|
||||
|
||||
static NSString *ZX_AZTEC_DIGIT_TABLE[] = {
|
||||
@"CTRL_PS", @" ", @"0", @"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9", @",", @".", @"CTRL_UL", @"CTRL_US"
|
||||
};
|
||||
|
||||
@interface ZXAztecDecoder ()
|
||||
|
||||
@property (nonatomic, strong) ZXAztecDetectorResult *ddata;
|
||||
|
||||
@end
|
||||
|
||||
@implementation ZXAztecDecoder
|
||||
|
||||
- (ZXDecoderResult *)decode:(ZXAztecDetectorResult *)detectorResult error:(NSError **)error {
|
||||
self.ddata = detectorResult;
|
||||
ZXBitMatrix *matrix = [detectorResult bits];
|
||||
ZXBoolArray *rawbits = [self extractBits:matrix];
|
||||
if (!rawbits) {
|
||||
if (error) *error = ZXFormatErrorInstance();
|
||||
return nil;
|
||||
}
|
||||
|
||||
ZXBoolArray *correctedBits = [self correctBits:rawbits error:error];
|
||||
if (!correctedBits) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSString *result = [[self class] encodedData:correctedBits];
|
||||
return [[ZXDecoderResult alloc] initWithRawBytes:nil text:result byteSegments:nil ecLevel:nil];
|
||||
}
|
||||
|
||||
+ (NSString *)highLevelDecode:(ZXBoolArray *)correctedBits {
|
||||
return [self encodedData:correctedBits];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string encoded in the aztec code bits
|
||||
*
|
||||
* @return the decoded string
|
||||
*/
|
||||
+ (NSString *)encodedData:(ZXBoolArray *)correctedBits {
|
||||
int endIndex = (int)correctedBits.length;
|
||||
ZXAztecTable latchTable = ZXAztecTableUpper; // table most recently latched to
|
||||
ZXAztecTable shiftTable = ZXAztecTableUpper; // table to use for the next read
|
||||
NSMutableString *result = [NSMutableString stringWithCapacity:20];
|
||||
int index = 0;
|
||||
while (index < endIndex) {
|
||||
if (shiftTable == ZXAztecTableBinary) {
|
||||
if (endIndex - index < 5) {
|
||||
break;
|
||||
}
|
||||
int length = [self readCode:correctedBits startIndex:index length:5];
|
||||
index += 5;
|
||||
if (length == 0) {
|
||||
if (endIndex - index < 11) {
|
||||
break;
|
||||
}
|
||||
|
||||
length = [self readCode:correctedBits startIndex:index length:11] + 31;
|
||||
index += 11;
|
||||
}
|
||||
for (int charCount = 0; charCount < length; charCount++) {
|
||||
if (endIndex - index < 8) {
|
||||
index = endIndex; // Force outer loop to exit
|
||||
break;
|
||||
}
|
||||
|
||||
int code = [self readCode:correctedBits startIndex:index length:8];
|
||||
[result appendFormat:@"%C", (unichar)code];
|
||||
index += 8;
|
||||
}
|
||||
// Go back to whatever mode we had been in
|
||||
shiftTable = latchTable;
|
||||
} else {
|
||||
int size = shiftTable == ZXAztecTableDigit ? 4 : 5;
|
||||
if (endIndex - index < size) {
|
||||
break;
|
||||
}
|
||||
int code = [self readCode:correctedBits startIndex:index length:size];
|
||||
index += size;
|
||||
NSString *str = [self character:shiftTable code:code];
|
||||
if ([str hasPrefix:@"CTRL_"]) {
|
||||
// Table changes
|
||||
shiftTable = [self table:[str characterAtIndex:5]];
|
||||
if ([str characterAtIndex:6] == 'L') {
|
||||
latchTable = shiftTable;
|
||||
}
|
||||
} else {
|
||||
[result appendString:str];
|
||||
// Go back to whatever mode we had been in
|
||||
shiftTable = latchTable;
|
||||
}
|
||||
}
|
||||
}
|
||||
return [NSString stringWithString:result];
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the table corresponding to the char passed
|
||||
*/
|
||||
+ (ZXAztecTable)table:(unichar)t {
|
||||
switch (t) {
|
||||
case 'L':
|
||||
return ZXAztecTableLower;
|
||||
case 'P':
|
||||
return ZXAztecTablePunct;
|
||||
case 'M':
|
||||
return ZXAztecTableMixed;
|
||||
case 'D':
|
||||
return ZXAztecTableDigit;
|
||||
case 'B':
|
||||
return ZXAztecTableBinary;
|
||||
case 'U':
|
||||
default:
|
||||
return ZXAztecTableUpper;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the character (or string) corresponding to the passed code in the given table
|
||||
*
|
||||
* @param table the table used
|
||||
* @param code the code of the character
|
||||
*/
|
||||
+ (NSString *)character:(ZXAztecTable)table code:(int)code {
|
||||
switch (table) {
|
||||
case ZXAztecTableUpper:
|
||||
return ZX_AZTEC_UPPER_TABLE[code];
|
||||
case ZXAztecTableLower:
|
||||
return ZX_AZTEC_LOWER_TABLE[code];
|
||||
case ZXAztecTableMixed:
|
||||
return ZX_AZTEC_MIXED_TABLE[code];
|
||||
case ZXAztecTablePunct:
|
||||
return ZX_AZTEC_PUNCT_TABLE[code];
|
||||
case ZXAztecTableDigit:
|
||||
return ZX_AZTEC_DIGIT_TABLE[code];
|
||||
default:
|
||||
// Should not reach here.
|
||||
@throw [NSException exceptionWithName:@"IllegalStateException" reason:@"Bad table" userInfo:nil];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Performs RS error correction on an array of bits.</p>
|
||||
*
|
||||
* @return the number of corrected bits, or 0 if the input contains too many errors
|
||||
*/
|
||||
- (ZXBoolArray *)correctBits:(ZXBoolArray *)rawbits error:(NSError **)error {
|
||||
ZXGenericGF *gf;
|
||||
int codewordSize;
|
||||
|
||||
if ([self.ddata nbLayers] <= 2) {
|
||||
codewordSize = 6;
|
||||
gf = [ZXGenericGF AztecData6];
|
||||
} else if ([self.ddata nbLayers] <= 8) {
|
||||
codewordSize = 8;
|
||||
gf = [ZXGenericGF AztecData8];
|
||||
} else if ([self.ddata nbLayers] <= 22) {
|
||||
codewordSize = 10;
|
||||
gf = [ZXGenericGF AztecData10];
|
||||
} else {
|
||||
codewordSize = 12;
|
||||
gf = [ZXGenericGF AztecData12];
|
||||
}
|
||||
|
||||
int numDataCodewords = [self.ddata nbDatablocks];
|
||||
int numCodewords = rawbits.length / codewordSize;
|
||||
if (numCodewords < numDataCodewords) {
|
||||
if (error) *error = ZXFormatErrorInstance();
|
||||
return 0;
|
||||
}
|
||||
int offset = rawbits.length % codewordSize;
|
||||
int numECCodewords = numCodewords - numDataCodewords;
|
||||
|
||||
ZXIntArray *dataWords = [[ZXIntArray alloc] initWithLength:numCodewords];
|
||||
for (int i = 0; i < numCodewords; i++, offset += codewordSize) {
|
||||
dataWords.array[i] = [[self class] readCode:rawbits startIndex:offset length:codewordSize];
|
||||
}
|
||||
|
||||
ZXReedSolomonDecoder *rsDecoder = [[ZXReedSolomonDecoder alloc] initWithField:gf];
|
||||
NSError *decodeError = nil;
|
||||
if (![rsDecoder decode:dataWords twoS:numECCodewords error:&decodeError]) {
|
||||
if (decodeError.code == ZXReedSolomonError) {
|
||||
if (error) *error = ZXFormatErrorInstance();
|
||||
} else {
|
||||
if (error) *error = decodeError;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Now perform the unstuffing operation.
|
||||
// First, count how many bits are going to be thrown out as stuffing
|
||||
int mask = (1 << codewordSize) - 1;
|
||||
int stuffedBits = 0;
|
||||
for (int i = 0; i < numDataCodewords; i++) {
|
||||
int32_t dataWord = dataWords.array[i];
|
||||
if (dataWord == 0 || dataWord == mask) {
|
||||
if (error) *error = ZXFormatErrorInstance();
|
||||
return 0;
|
||||
} else if (dataWord == 1 || dataWord == mask - 1) {
|
||||
stuffedBits++;
|
||||
}
|
||||
}
|
||||
|
||||
// Now, actually unpack the bits and remove the stuffing
|
||||
ZXBoolArray *correctedBits = [[ZXBoolArray alloc] initWithLength:numDataCodewords * codewordSize - stuffedBits];
|
||||
int index = 0;
|
||||
for (int i = 0; i < numDataCodewords; i++) {
|
||||
int dataWord = dataWords.array[i];
|
||||
if (dataWord == 1 || dataWord == mask - 1) {
|
||||
// next codewordSize-1 bits are all zeros or all ones
|
||||
memset(correctedBits.array + index * sizeof(BOOL), dataWord > 1, codewordSize - 1);
|
||||
index += codewordSize - 1;
|
||||
} else {
|
||||
for (int bit = codewordSize - 1; bit >= 0; --bit) {
|
||||
correctedBits.array[index++] = (dataWord & (1 << bit)) != 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return correctedBits;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the array of bits from an Aztec Code matrix
|
||||
*
|
||||
* @return the size of the array of bits
|
||||
*/
|
||||
- (ZXBoolArray *)extractBits:(ZXBitMatrix *)matrix {
|
||||
BOOL compact = self.ddata.isCompact;
|
||||
int layers = self.ddata.nbLayers;
|
||||
int baseMatrixSize = compact ? 11 + layers * 4 : 14 + layers * 4; // not including alignment lines
|
||||
ZXIntArray *alignmentMap = [[ZXIntArray alloc] initWithLength:baseMatrixSize];
|
||||
ZXBoolArray *rawbits = [[ZXBoolArray alloc] initWithLength:[self totalBitsInLayer:layers compact:compact]];
|
||||
|
||||
if (compact) {
|
||||
for (int i = 0; i < alignmentMap.length; i++) {
|
||||
alignmentMap.array[i] = i;
|
||||
}
|
||||
} else {
|
||||
int matrixSize = baseMatrixSize + 1 + 2 * ((baseMatrixSize / 2 - 1) / 15);
|
||||
int origCenter = baseMatrixSize / 2;
|
||||
int center = matrixSize / 2;
|
||||
for (int i = 0; i < origCenter; i++) {
|
||||
int newOffset = i + i / 15;
|
||||
alignmentMap.array[origCenter - i - 1] = (int32_t)(center - newOffset - 1);
|
||||
alignmentMap.array[origCenter + i] = (int32_t)(center + newOffset + 1);
|
||||
}
|
||||
}
|
||||
for (int i = 0, rowOffset = 0; i < layers; i++) {
|
||||
int rowSize = compact ? (layers - i) * 4 + 9 : (layers - i) * 4 + 12;
|
||||
// The top-left most point of this layer is <low, low> (not including alignment lines)
|
||||
int low = i * 2;
|
||||
// The bottom-right most point of this layer is <high, high> (not including alignment lines)
|
||||
int high = baseMatrixSize - 1 - low;
|
||||
// We pull bits from the two 2 x rowSize columns and two rowSize x 2 rows
|
||||
for (int j = 0; j < rowSize; j++) {
|
||||
int columnOffset = j * 2;
|
||||
for (int k = 0; k < 2; k++) {
|
||||
// left column
|
||||
rawbits.array[rowOffset + columnOffset + k] =
|
||||
[matrix getX:alignmentMap.array[low + k] y:alignmentMap.array[low + j]];
|
||||
// bottom row
|
||||
rawbits.array[rowOffset + 2 * rowSize + columnOffset + k] =
|
||||
[matrix getX:alignmentMap.array[low + j] y:alignmentMap.array[high - k]];
|
||||
// right column
|
||||
rawbits.array[rowOffset + 4 * rowSize + columnOffset + k] =
|
||||
[matrix getX:alignmentMap.array[high - k] y:alignmentMap.array[high - j]];
|
||||
// top row
|
||||
rawbits.array[rowOffset + 6 * rowSize + columnOffset + k] =
|
||||
[matrix getX:alignmentMap.array[high - j] y:alignmentMap.array[low + k]];
|
||||
}
|
||||
}
|
||||
rowOffset += rowSize * 8;
|
||||
}
|
||||
return rawbits;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a code of given length and at given index in an array of bits
|
||||
*/
|
||||
+ (int)readCode:(ZXBoolArray *)rawbits startIndex:(int)startIndex length:(int)length {
|
||||
int res = 0;
|
||||
for (int i = startIndex; i < startIndex + length; i++) {
|
||||
res <<= 1;
|
||||
if (rawbits.array[i]) {
|
||||
res |= 0x01;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
- (int)totalBitsInLayer:(int)layers compact:(BOOL)compact {
|
||||
return ((compact ? 88 : 112) + 16 * layers) * layers;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@interface ZXAztecPoint : NSObject
|
||||
|
||||
@property (nonatomic, assign, readonly) int x;
|
||||
@property (nonatomic, assign, readonly) int y;
|
||||
|
||||
- (id)initWithX:(int)x y:(int)y;
|
||||
|
||||
@end
|
||||
|
||||
@class ZXAztecDetectorResult, ZXBitMatrix;
|
||||
|
||||
/**
|
||||
* Encapsulates logic that can detect an Aztec Code in an image, even if the Aztec Code
|
||||
* is rotated or skewed, or partially obscured.
|
||||
*/
|
||||
@interface ZXAztecDetector : NSObject
|
||||
|
||||
- (id)initWithImage:(ZXBitMatrix *)image;
|
||||
|
||||
- (ZXAztecDetectorResult *)detectWithError:(NSError **)error;
|
||||
|
||||
/**
|
||||
* Detects an Aztec Code in an image.
|
||||
*
|
||||
* @return ZXAztecDetectorResult encapsulating results of detecting an Aztec Code, or nil if no Aztec Code can be found
|
||||
*/
|
||||
- (ZXAztecDetectorResult *)detectWithMirror:(BOOL)isMirror error:(NSError **)error;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,619 @@
|
||||
/*
|
||||
* Copyright 2012 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXAztecDetector.h"
|
||||
#import "ZXAztecDetectorResult.h"
|
||||
#import "ZXErrors.h"
|
||||
#import "ZXGenericGF.h"
|
||||
#import "ZXGridSampler.h"
|
||||
#import "ZXIntArray.h"
|
||||
#import "ZXMathUtils.h"
|
||||
#import "ZXReedSolomonDecoder.h"
|
||||
#import "ZXResultPoint.h"
|
||||
#import "ZXWhiteRectangleDetector.h"
|
||||
|
||||
@implementation ZXAztecPoint
|
||||
|
||||
- (id)initWithX:(int)x y:(int)y {
|
||||
if (self = [super init]) {
|
||||
_x = x;
|
||||
_y = y;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (ZXResultPoint *)toResultPoint {
|
||||
return [[ZXResultPoint alloc] initWithX:self.x y:self.y];
|
||||
}
|
||||
|
||||
- (NSString *)description {
|
||||
return [NSString stringWithFormat:@"<%d %d>", self.x, self.y];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@interface ZXAztecDetector ()
|
||||
|
||||
@property (nonatomic, assign, getter = isCompact) BOOL compact;
|
||||
@property (nonatomic, strong) ZXBitMatrix *image;
|
||||
@property (nonatomic, assign) int nbCenterLayers;
|
||||
@property (nonatomic, assign) int nbDataBlocks;
|
||||
@property (nonatomic, assign) int nbLayers;
|
||||
@property (nonatomic, assign) int shift;
|
||||
|
||||
@end
|
||||
|
||||
@implementation ZXAztecDetector
|
||||
|
||||
- (id)initWithImage:(ZXBitMatrix *)image {
|
||||
if (self = [super init]) {
|
||||
_image = image;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (ZXAztecDetectorResult *)detectWithError:(NSError **)error {
|
||||
return [self detectWithMirror:NO error:error];
|
||||
}
|
||||
|
||||
- (ZXAztecDetectorResult *)detectWithMirror:(BOOL)isMirror error:(NSError **)error {
|
||||
// 1. Get the center of the aztec matrix
|
||||
ZXAztecPoint *pCenter = [self matrixCenter];
|
||||
if (!pCenter) {
|
||||
if (error) *error = ZXNotFoundErrorInstance();
|
||||
return nil;
|
||||
}
|
||||
|
||||
// 2. Get the center points of the four diagonal points just outside the bull's eye
|
||||
// [topRight, bottomRight, bottomLeft, topLeft]
|
||||
NSMutableArray *bullsEyeCorners = [self bullsEyeCorners:pCenter];
|
||||
if (!bullsEyeCorners) {
|
||||
if (error) *error = ZXNotFoundErrorInstance();
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (isMirror) {
|
||||
ZXResultPoint *temp = bullsEyeCorners[0];
|
||||
bullsEyeCorners[0] = bullsEyeCorners[2];
|
||||
bullsEyeCorners[2] = temp;
|
||||
}
|
||||
|
||||
// 3. Get the size of the matrix and other parameters from the bull's eye
|
||||
if (![self extractParameters:bullsEyeCorners]) {
|
||||
if (error) *error = ZXNotFoundErrorInstance();
|
||||
return nil;
|
||||
}
|
||||
|
||||
// 4. Sample the grid
|
||||
ZXBitMatrix *bits = [self sampleGrid:self.image
|
||||
topLeft:bullsEyeCorners[self.shift % 4]
|
||||
topRight:bullsEyeCorners[(self.shift + 1) % 4]
|
||||
bottomRight:bullsEyeCorners[(self.shift + 2) % 4]
|
||||
bottomLeft:bullsEyeCorners[(self.shift + 3) % 4]];
|
||||
if (!bits) {
|
||||
if (error) *error = ZXNotFoundErrorInstance();
|
||||
return nil;
|
||||
}
|
||||
|
||||
// 5. Get the corners of the matrix.
|
||||
NSArray *corners = [self matrixCornerPoints:bullsEyeCorners];
|
||||
if (!corners) {
|
||||
if (error) *error = ZXNotFoundErrorInstance();
|
||||
return nil;
|
||||
}
|
||||
|
||||
return [[ZXAztecDetectorResult alloc] initWithBits:bits
|
||||
points:corners
|
||||
compact:self.compact
|
||||
nbDatablocks:self.nbDataBlocks
|
||||
nbLayers:self.nbLayers];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Extracts the number of data layers and data blocks from the layer around the bull's eye
|
||||
*/
|
||||
- (BOOL)extractParameters:(NSArray *)bullsEyeCorners {
|
||||
ZXResultPoint *p0 = bullsEyeCorners[0];
|
||||
ZXResultPoint *p1 = bullsEyeCorners[1];
|
||||
ZXResultPoint *p2 = bullsEyeCorners[2];
|
||||
ZXResultPoint *p3 = bullsEyeCorners[3];
|
||||
|
||||
if (![self isValid:p0] || ![self isValid:p1] ||
|
||||
![self isValid:p2] || ![self isValid:p3]) {
|
||||
return NO;
|
||||
}
|
||||
int length = 2 * self.nbCenterLayers;
|
||||
// Get the bits around the bull's eye
|
||||
int sides[] = {
|
||||
[self sampleLine:p0 p2:p1 size:length], // Right side
|
||||
[self sampleLine:p1 p2:p2 size:length], // Bottom
|
||||
[self sampleLine:p2 p2:p3 size:length], // Left side
|
||||
[self sampleLine:p3 p2:p0 size:length] // Top
|
||||
};
|
||||
|
||||
// bullsEyeCorners[shift] is the corner of the bulls'eye that has three
|
||||
// orientation marks.
|
||||
// sides[shift] is the row/column that goes from the corner with three
|
||||
// orientation marks to the corner with two.
|
||||
int shift = [self rotationForSides:sides length:length];
|
||||
if (shift == -1) {
|
||||
return NO;
|
||||
}
|
||||
self.shift = shift;
|
||||
|
||||
// Flatten the parameter bits into a single 28- or 40-bit long
|
||||
long parameterData = 0;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
int side = sides[(self.shift + i) % 4];
|
||||
if (self.isCompact) {
|
||||
// Each side of the form ..XXXXXXX. where Xs are parameter data
|
||||
parameterData <<= 7;
|
||||
parameterData += (side >> 1) & 0x7F;
|
||||
} else {
|
||||
// Each side of the form ..XXXXX.XXXXX. where Xs are parameter data
|
||||
parameterData <<= 10;
|
||||
parameterData += ((side >> 2) & (0x1f << 5)) + ((side >> 1) & 0x1F);
|
||||
}
|
||||
}
|
||||
|
||||
// Corrects parameter data using RS. Returns just the data portion
|
||||
// without the error correction.
|
||||
int correctedData = [self correctedParameterData:parameterData compact:self.isCompact];
|
||||
if (correctedData == -1) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (self.isCompact) {
|
||||
// 8 bits: 2 bits layers and 6 bits data blocks
|
||||
self.nbLayers = (correctedData >> 6) + 1;
|
||||
self.nbDataBlocks = (correctedData & 0x3F) + 1;
|
||||
} else {
|
||||
// 16 bits: 5 bits layers and 11 bits data blocks
|
||||
self.nbLayers = (correctedData >> 11) + 1;
|
||||
self.nbDataBlocks = (correctedData & 0x7FF) + 1;
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
int expectedCornerBits[] = {
|
||||
0xee0, // 07340 XXX .XX X.. ...
|
||||
0x1dc, // 00734 ... XXX .XX X..
|
||||
0x83b, // 04073 X.. ... XXX .XX
|
||||
0x707, // 03407 .XX X.. ... XXX
|
||||
};
|
||||
|
||||
int bitCount(uint32_t i) {
|
||||
i = i - ((i >> 1) & 0x55555555);
|
||||
i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
|
||||
return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
|
||||
}
|
||||
|
||||
- (int)rotationForSides:(const int[])sides length:(int)length {
|
||||
// In a normal pattern, we expect to See
|
||||
// ** .* D A
|
||||
// * *
|
||||
//
|
||||
// . *
|
||||
// .. .. C B
|
||||
//
|
||||
// Grab the 3 bits from each of the sides the form the locator pattern and concatenate
|
||||
// into a 12-bit integer. Start with the bit at A
|
||||
int cornerBits = 0;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
int side = sides[i];
|
||||
// XX......X where X's are orientation marks
|
||||
int t = ((side >> (length - 2)) << 1) + (side & 1);
|
||||
cornerBits = (cornerBits << 3) + t;
|
||||
}
|
||||
// Mov the bottom bit to the top, so that the three bits of the locator pattern at A are
|
||||
// together. cornerBits is now:
|
||||
// 3 orientation bits at A || 3 orientation bits at B || ... || 3 orientation bits at D
|
||||
cornerBits = ((cornerBits & 1) << 11) + (cornerBits >> 1);
|
||||
// The result shift indicates which element of BullsEyeCorners[] goes into the top-left
|
||||
// corner. Since the four rotation values have a Hamming distance of 8, we
|
||||
// can easily tolerate two errors.
|
||||
for (int shift = 0; shift < 4; shift++) {
|
||||
if (bitCount(cornerBits ^ expectedCornerBits[shift]) <= 2) {
|
||||
return shift;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Corrects the parameter bits using Reed-Solomon algorithm.
|
||||
*
|
||||
* @param parameterData parameter bits
|
||||
* @param compact true if this is a compact Aztec code
|
||||
* @return -1 if the array contains too many errors
|
||||
*/
|
||||
- (int)correctedParameterData:(long)parameterData compact:(BOOL)compact {
|
||||
int numCodewords;
|
||||
int numDataCodewords;
|
||||
|
||||
if (compact) {
|
||||
numCodewords = 7;
|
||||
numDataCodewords = 2;
|
||||
} else {
|
||||
numCodewords = 10;
|
||||
numDataCodewords = 4;
|
||||
}
|
||||
|
||||
int numECCodewords = numCodewords - numDataCodewords;
|
||||
ZXIntArray *parameterWords = [[ZXIntArray alloc] initWithLength:numCodewords];
|
||||
for (int i = numCodewords - 1; i >= 0; --i) {
|
||||
parameterWords.array[i] = (int32_t) parameterData & 0xF;
|
||||
parameterData >>= 4;
|
||||
}
|
||||
|
||||
ZXReedSolomonDecoder *rsDecoder = [[ZXReedSolomonDecoder alloc] initWithField:[ZXGenericGF AztecParam]];
|
||||
if (![rsDecoder decode:parameterWords twoS:numECCodewords error:nil]) {
|
||||
return NO;
|
||||
}
|
||||
// Toss the error correction. Just return the data as an integer
|
||||
int result = 0;
|
||||
for (int i = 0; i < numDataCodewords; i++) {
|
||||
result = (result << 4) + parameterWords.array[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the corners of a bull-eye centered on the passed point.
|
||||
* This returns the centers of the diagonal points just outside the bull's eye
|
||||
* Returns [topRight, bottomRight, bottomLeft, topLeft]
|
||||
*
|
||||
* @param pCenter Center point
|
||||
* @return The corners of the bull-eye, or nil if no valid bull-eye can be found
|
||||
*/
|
||||
- (NSMutableArray *)bullsEyeCorners:(ZXAztecPoint *)pCenter {
|
||||
ZXAztecPoint *pina = pCenter;
|
||||
ZXAztecPoint *pinb = pCenter;
|
||||
ZXAztecPoint *pinc = pCenter;
|
||||
ZXAztecPoint *pind = pCenter;
|
||||
|
||||
BOOL color = YES;
|
||||
|
||||
for (self.nbCenterLayers = 1; self.nbCenterLayers < 9; self.nbCenterLayers++) {
|
||||
ZXAztecPoint *pouta = [self firstDifferent:pina color:color dx:1 dy:-1];
|
||||
ZXAztecPoint *poutb = [self firstDifferent:pinb color:color dx:1 dy:1];
|
||||
ZXAztecPoint *poutc = [self firstDifferent:pinc color:color dx:-1 dy:1];
|
||||
ZXAztecPoint *poutd = [self firstDifferent:pind color:color dx:-1 dy:-1];
|
||||
|
||||
//d a
|
||||
//
|
||||
//c b
|
||||
|
||||
if (self.nbCenterLayers > 2) {
|
||||
float q = [self distance:poutd b:pouta] * self.nbCenterLayers / ([self distance:pind b:pina] * (self.nbCenterLayers + 2));
|
||||
if (q < 0.75 || q > 1.25 || ![self isWhiteOrBlackRectangle:pouta p2:poutb p3:poutc p4:poutd]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pina = pouta;
|
||||
pinb = poutb;
|
||||
pinc = poutc;
|
||||
pind = poutd;
|
||||
|
||||
color = !color;
|
||||
}
|
||||
|
||||
if (self.nbCenterLayers != 5 && self.nbCenterLayers != 7) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
self.compact = self.nbCenterLayers == 5;
|
||||
|
||||
// Expand the square by .5 pixel in each direction so that we're on the border
|
||||
// between the white square and the black square
|
||||
ZXResultPoint *pinax = [[ZXResultPoint alloc] initWithX:pina.x + 0.5f y:pina.y - 0.5f];
|
||||
ZXResultPoint *pinbx = [[ZXResultPoint alloc] initWithX:pinb.x + 0.5f y:pinb.y + 0.5f];
|
||||
ZXResultPoint *pincx = [[ZXResultPoint alloc] initWithX:pinc.x - 0.5f y:pinc.y + 0.5f];
|
||||
ZXResultPoint *pindx = [[ZXResultPoint alloc] initWithX:pind.x - 0.5f y:pind.y - 0.5f];
|
||||
|
||||
// Expand the square so that its corners are the centers of the points
|
||||
// just outside the bull's eye.
|
||||
return [[self expandSquare:@[pinax, pinbx, pincx, pindx]
|
||||
oldSide:2 * self.nbCenterLayers - 3
|
||||
newSide:2 * self.nbCenterLayers] mutableCopy];
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds a candidate center point of an Aztec code from an image
|
||||
*/
|
||||
- (ZXAztecPoint *)matrixCenter {
|
||||
ZXResultPoint *pointA;
|
||||
ZXResultPoint *pointB;
|
||||
ZXResultPoint *pointC;
|
||||
ZXResultPoint *pointD;
|
||||
|
||||
ZXWhiteRectangleDetector *detector = [[ZXWhiteRectangleDetector alloc] initWithImage:self.image error:nil];
|
||||
NSArray *cornerPoints = [detector detectWithError:nil];
|
||||
|
||||
if (cornerPoints) {
|
||||
pointA = cornerPoints[0];
|
||||
pointB = cornerPoints[1];
|
||||
pointC = cornerPoints[2];
|
||||
pointD = cornerPoints[3];
|
||||
} else {
|
||||
// This exception can be in case the initial rectangle is white
|
||||
// In that case, surely in the bull's eye, we try to expand the rectangle.
|
||||
int cx = self.image.width / 2;
|
||||
int cy = self.image.height / 2;
|
||||
pointA = [[self firstDifferent:[[ZXAztecPoint alloc] initWithX:cx + 7 y:cy - 7] color:NO dx:1 dy:-1] toResultPoint];
|
||||
pointB = [[self firstDifferent:[[ZXAztecPoint alloc] initWithX:cx + 7 y:cy + 7] color:NO dx:1 dy:1] toResultPoint];
|
||||
pointC = [[self firstDifferent:[[ZXAztecPoint alloc] initWithX:cx - 7 y:cy + 7] color:NO dx:-1 dy:1] toResultPoint];
|
||||
pointD = [[self firstDifferent:[[ZXAztecPoint alloc] initWithX:cx - 7 y:cy - 7] color:NO dx:-1 dy:-1] toResultPoint];
|
||||
}
|
||||
|
||||
//Compute the center of the rectangle
|
||||
int cx = [ZXMathUtils round:([pointA x] + [pointD x] + [pointB x] + [pointC x]) / 4.0f];
|
||||
int cy = [ZXMathUtils round:([pointA y] + [pointD y] + [pointB y] + [pointC y]) / 4.0f];
|
||||
|
||||
// Redetermine the white rectangle starting from previously computed center.
|
||||
// This will ensure that we end up with a white rectangle in center bull's eye
|
||||
// in order to compute a more accurate center.
|
||||
detector = [[ZXWhiteRectangleDetector alloc] initWithImage:self.image initSize:15 x:cx y:cy error:nil];
|
||||
cornerPoints = [detector detectWithError:nil];
|
||||
|
||||
if (cornerPoints) {
|
||||
pointA = cornerPoints[0];
|
||||
pointB = cornerPoints[1];
|
||||
pointC = cornerPoints[2];
|
||||
pointD = cornerPoints[3];
|
||||
} else {
|
||||
// This exception can be in case the initial rectangle is white
|
||||
// In that case we try to expand the rectangle.
|
||||
pointA = [[self firstDifferent:[[ZXAztecPoint alloc] initWithX:cx + 7 y:cy - 7] color:NO dx:1 dy:-1] toResultPoint];
|
||||
pointB = [[self firstDifferent:[[ZXAztecPoint alloc] initWithX:cx + 7 y:cy + 7] color:NO dx:1 dy:1] toResultPoint];
|
||||
pointC = [[self firstDifferent:[[ZXAztecPoint alloc] initWithX:cx - 7 y:cy + 7] color:NO dx:-1 dy:1] toResultPoint];
|
||||
pointD = [[self firstDifferent:[[ZXAztecPoint alloc] initWithX:cx - 7 y:cy - 7] color:NO dx:-1 dy:-1] toResultPoint];
|
||||
}
|
||||
|
||||
cx = [ZXMathUtils round:([pointA x] + [pointD x] + [pointB x] + [pointC x]) / 4];
|
||||
cy = [ZXMathUtils round:([pointA y] + [pointD y] + [pointB y] + [pointC y]) / 4];
|
||||
|
||||
// Recompute the center of the rectangle
|
||||
return [[ZXAztecPoint alloc] initWithX:cx y:cy];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Aztec code corners from the bull's eye corners and the parameters.
|
||||
*
|
||||
* @param bullsEyeCorners the array of bull's eye corners
|
||||
* @return the array of aztec code corners, or nil if the corner points do not fit in the image
|
||||
*/
|
||||
- (NSArray *)matrixCornerPoints:(NSArray *)bullsEyeCorners {
|
||||
return [self expandSquare:bullsEyeCorners oldSide:2 * self.nbCenterLayers newSide:[self dimension]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a BitMatrix by sampling the provided image.
|
||||
* topLeft, topRight, bottomRight, and bottomLeft are the centers of the squares on the
|
||||
* diagonal just outside the bull's eye.
|
||||
*/
|
||||
- (ZXBitMatrix *)sampleGrid:(ZXBitMatrix *)anImage
|
||||
topLeft:(ZXResultPoint *)topLeft
|
||||
topRight:(ZXResultPoint *)topRight
|
||||
bottomRight:(ZXResultPoint *)bottomRight
|
||||
bottomLeft:(ZXResultPoint *)bottomLeft {
|
||||
ZXGridSampler *sampler = [ZXGridSampler instance];
|
||||
int dimension = [self dimension];
|
||||
|
||||
float low = dimension / 2.0f - self.nbCenterLayers;
|
||||
float high = dimension / 2.0f + self.nbCenterLayers;
|
||||
|
||||
return [sampler sampleGrid:anImage
|
||||
dimensionX:dimension
|
||||
dimensionY:dimension
|
||||
p1ToX:low p1ToY:low // topleft
|
||||
p2ToX:high p2ToY:low // topright
|
||||
p3ToX:high p3ToY:high // bottomright
|
||||
p4ToX:low p4ToY:high // bottomleft
|
||||
p1FromX:topLeft.x p1FromY:topLeft.y
|
||||
p2FromX:topRight.x p2FromY:topRight.y
|
||||
p3FromX:bottomRight.x p3FromY:bottomRight.y
|
||||
p4FromX:bottomLeft.x p4FromY:bottomLeft.y
|
||||
error:nil];
|
||||
}
|
||||
|
||||
/**
|
||||
* Samples a line.
|
||||
*
|
||||
* @param p1 start point (inclusive)
|
||||
* @param p2 end point (exclusive)
|
||||
* @param size number of bits
|
||||
* @return the array of bits as an int (first bit is high-order bit of result)
|
||||
*/
|
||||
- (int)sampleLine:(ZXResultPoint *)p1 p2:(ZXResultPoint *)p2 size:(int)size {
|
||||
int result = 0;
|
||||
|
||||
float d = [self resultDistance:p1 b:p2];
|
||||
float moduleSize = d / size;
|
||||
float px = p1.x;
|
||||
float py = p1.y;
|
||||
float dx = moduleSize * (p2.x - p1.x) / d;
|
||||
float dy = moduleSize * (p2.y - p1.y) / d;
|
||||
for (int i = 0; i < size; i++) {
|
||||
if ([self.image getX:[ZXMathUtils round:px + i * dx] y:[ZXMathUtils round:py + i * dy]]) {
|
||||
result |= 1 << (size - i - 1);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if the border of the rectangle passed in parameter is compound of white points only
|
||||
* or black points only
|
||||
*/
|
||||
- (BOOL)isWhiteOrBlackRectangle:(ZXAztecPoint *)p1 p2:(ZXAztecPoint *)p2 p3:(ZXAztecPoint *)p3 p4:(ZXAztecPoint *)p4 {
|
||||
int corr = 3;
|
||||
|
||||
p1 = [[ZXAztecPoint alloc] initWithX:p1.x - corr y:p1.y + corr];
|
||||
p2 = [[ZXAztecPoint alloc] initWithX:p2.x - corr y:p2.y - corr];
|
||||
p3 = [[ZXAztecPoint alloc] initWithX:p3.x + corr y:p3.y - corr];
|
||||
p4 = [[ZXAztecPoint alloc] initWithX:p4.x + corr y:p4.y + corr];
|
||||
|
||||
int cInit = [self color:p4 p2:p1];
|
||||
|
||||
if (cInit == 0) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
int c = [self color:p1 p2:p2];
|
||||
|
||||
if (c != cInit) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
c = [self color:p2 p2:p3];
|
||||
|
||||
if (c != cInit) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
c = [self color:p3 p2:p4];
|
||||
|
||||
return c == cInit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the color of a segment
|
||||
*
|
||||
* @return 1 if segment more than 90% black, -1 if segment is more than 90% white, 0 else
|
||||
*/
|
||||
- (int)color:(ZXAztecPoint *)p1 p2:(ZXAztecPoint *)p2 {
|
||||
float d = [self distance:p1 b:p2];
|
||||
float dx = (p2.x - p1.x) / d;
|
||||
float dy = (p2.y - p1.y) / d;
|
||||
int error = 0;
|
||||
|
||||
float px = p1.x;
|
||||
float py = p1.y;
|
||||
|
||||
BOOL colorModel = [self.image getX:p1.x y:p1.y];
|
||||
|
||||
for (int i = 0; i < d; i++) {
|
||||
px += dx;
|
||||
py += dy;
|
||||
if ([self.image getX:[ZXMathUtils round:px] y:[ZXMathUtils round:py]] != colorModel) {
|
||||
error++;
|
||||
}
|
||||
}
|
||||
|
||||
float errRatio = (float)error / d;
|
||||
|
||||
if (errRatio > 0.1f && errRatio < 0.9f) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (errRatio <= 0.1f) == colorModel ? 1 : -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the coordinate of the first point with a different color in the given direction
|
||||
*/
|
||||
- (ZXAztecPoint *)firstDifferent:(ZXAztecPoint *)init color:(BOOL)color dx:(int)dx dy:(int)dy {
|
||||
int x = init.x + dx;
|
||||
int y = init.y + dy;
|
||||
|
||||
while ([self isValidX:x y:y] && [self.image getX:x y:y] == color) {
|
||||
x += dx;
|
||||
y += dy;
|
||||
}
|
||||
|
||||
x -= dx;
|
||||
y -= dy;
|
||||
|
||||
while ([self isValidX:x y:y] && [self.image getX:x y:y] == color) {
|
||||
x += dx;
|
||||
}
|
||||
x -= dx;
|
||||
|
||||
while ([self isValidX:x y:y] && [self.image getX:x y:y] == color) {
|
||||
y += dy;
|
||||
}
|
||||
y -= dy;
|
||||
|
||||
return [[ZXAztecPoint alloc] initWithX:x y:y];
|
||||
}
|
||||
|
||||
/**
|
||||
* Expand the square represented by the corner points by pushing out equally in all directions
|
||||
*
|
||||
* @param cornerPoints the corners of the square, which has the bull's eye at its center
|
||||
* @param oldSide the original length of the side of the square in the target bit matrix
|
||||
* @param newSide the new length of the size of the square in the target bit matrix
|
||||
* @return the corners of the expanded square
|
||||
*/
|
||||
- (NSArray *)expandSquare:(NSArray *)cornerPoints oldSide:(float)oldSide newSide:(float)newSide {
|
||||
ZXResultPoint *cornerPoints0 = (ZXResultPoint *)cornerPoints[0];
|
||||
ZXResultPoint *cornerPoints1 = (ZXResultPoint *)cornerPoints[1];
|
||||
ZXResultPoint *cornerPoints2 = (ZXResultPoint *)cornerPoints[2];
|
||||
ZXResultPoint *cornerPoints3 = (ZXResultPoint *)cornerPoints[3];
|
||||
|
||||
float ratio = newSide / (2 * oldSide);
|
||||
float dx = cornerPoints0.x - cornerPoints2.x;
|
||||
float dy = cornerPoints0.y - cornerPoints2.y;
|
||||
float centerx = (cornerPoints0.x + cornerPoints2.x) / 2.0f;
|
||||
float centery = (cornerPoints0.y + cornerPoints2.y) / 2.0f;
|
||||
|
||||
ZXResultPoint *result0 = [[ZXResultPoint alloc] initWithX:centerx + ratio * dx y:centery + ratio * dy];
|
||||
ZXResultPoint *result2 = [[ZXResultPoint alloc] initWithX:centerx - ratio * dx y:centery - ratio * dy];
|
||||
|
||||
dx = cornerPoints1.x - cornerPoints3.x;
|
||||
dy = cornerPoints1.y - cornerPoints3.y;
|
||||
centerx = (cornerPoints1.x + cornerPoints3.x) / 2.0f;
|
||||
centery = (cornerPoints1.y + cornerPoints3.y) / 2.0f;
|
||||
ZXResultPoint *result1 = [[ZXResultPoint alloc] initWithX:centerx + ratio * dx y:centery + ratio * dy];
|
||||
ZXResultPoint *result3 = [[ZXResultPoint alloc] initWithX:centerx - ratio * dx y:centery - ratio * dy];
|
||||
|
||||
return @[result0, result1, result2, result3];
|
||||
}
|
||||
|
||||
- (BOOL)isValidX:(int)x y:(int)y {
|
||||
return x >= 0 && x < self.image.width && y > 0 && y < self.image.height;
|
||||
}
|
||||
|
||||
- (BOOL)isValid:(ZXResultPoint *)point {
|
||||
int x = [ZXMathUtils round:point.x];
|
||||
int y = [ZXMathUtils round:point.y];
|
||||
return [self isValidX:x y:y];
|
||||
}
|
||||
|
||||
- (float)distance:(ZXAztecPoint *)a b:(ZXAztecPoint *)b {
|
||||
return [ZXMathUtils distance:a.x aY:a.y bX:b.x bY:b.y];
|
||||
}
|
||||
|
||||
- (float)resultDistance:(ZXResultPoint *)a b:(ZXResultPoint *)b {
|
||||
return [ZXMathUtils distance:a.x aY:a.y bX:b.x bY:b.y];
|
||||
}
|
||||
|
||||
- (int)dimension {
|
||||
if (self.compact) {
|
||||
return 4 * self.nbLayers + 11;
|
||||
}
|
||||
if (self.nbLayers <= 4) {
|
||||
return 4 * self.nbLayers + 15;
|
||||
}
|
||||
return 4 * self.nbLayers + 2 * ((self.nbLayers-4)/8 + 1) + 15;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright 2014 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXAztecToken.h"
|
||||
|
||||
@interface ZXAztecBinaryShiftToken : ZXAztecToken
|
||||
|
||||
- (id)initWithPrevious:(ZXAztecToken *)previous binaryShiftStart:(int)binaryShiftStart binaryShiftByteCount:(int)binaryShiftByteCount;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2014 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXAztecBinaryShiftToken.h"
|
||||
#import "ZXBitArray.h"
|
||||
#import "ZXByteArray.h"
|
||||
|
||||
@interface ZXAztecBinaryShiftToken ()
|
||||
|
||||
@property (nonatomic, assign, readonly) int16_t binaryShiftStart;
|
||||
@property (nonatomic, assign, readonly) int16_t binaryShiftByteCount;
|
||||
|
||||
@end
|
||||
|
||||
@implementation ZXAztecBinaryShiftToken
|
||||
|
||||
- (id)initWithPrevious:(ZXAztecToken *)previous binaryShiftStart:(int)binaryShiftStart binaryShiftByteCount:(int)binaryShiftByteCount {
|
||||
if (self = [super initWithPrevious:previous]) {
|
||||
_binaryShiftStart = (int16_t) binaryShiftStart;
|
||||
_binaryShiftByteCount = (int16_t) binaryShiftByteCount;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)appendTo:(ZXBitArray *)bitArray text:(ZXByteArray *)text {
|
||||
for (int i = 0; i < self.binaryShiftByteCount; i++) {
|
||||
if (i == 0 || (i == 31 && self.binaryShiftByteCount <= 62)) {
|
||||
// We need a header before the first character, and before
|
||||
// character 31 when the total byte code is <= 62
|
||||
[bitArray appendBits:31 numBits:5]; // BINARY_SHIFT
|
||||
if (self.binaryShiftByteCount > 62) {
|
||||
[bitArray appendBits:self.binaryShiftByteCount - 31 numBits:16];
|
||||
} else if (i == 0) {
|
||||
// 1 <= binaryShiftByteCode <= 62
|
||||
[bitArray appendBits:MIN(self.binaryShiftByteCount, 31) numBits:5];
|
||||
} else {
|
||||
// 32 <= binaryShiftCount <= 62 and i == 31
|
||||
[bitArray appendBits:self.binaryShiftByteCount - 31 numBits:5];
|
||||
}
|
||||
}
|
||||
[bitArray appendBits:text.array[self.binaryShiftStart + i] numBits:8];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright 2013 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@class ZXBitMatrix;
|
||||
|
||||
/**
|
||||
* Aztec 2D code representation
|
||||
*/
|
||||
@interface ZXAztecCode : NSObject
|
||||
|
||||
/**
|
||||
* Number of data codewords
|
||||
*/
|
||||
@property (nonatomic, assign) int codeWords;
|
||||
|
||||
/**
|
||||
* Compact or full symbol indicator
|
||||
*/
|
||||
@property (nonatomic, assign, getter = isCompact) BOOL compact;
|
||||
|
||||
/**
|
||||
* Number of levels
|
||||
*/
|
||||
@property (nonatomic, assign) int layers;
|
||||
|
||||
/**
|
||||
* The symbol image
|
||||
*/
|
||||
@property (nonatomic, strong) ZXBitMatrix *matrix;
|
||||
|
||||
/**
|
||||
* Size in pixels (width and height)
|
||||
*/
|
||||
@property (nonatomic, assign) int size;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright 2013 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ZXAztecCode.h"
|
||||
|
||||
@implementation ZXAztecCode
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2013 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
extern const int ZX_AZTEC_DEFAULT_EC_PERCENT;
|
||||
extern const int ZX_AZTEC_DEFAULT_LAYERS;
|
||||
|
||||
@class ZXAztecCode, ZXBitArray, ZXByteArray, ZXGenericGF;
|
||||
|
||||
/**
|
||||
* Generates Aztec 2D barcodes.
|
||||
*/
|
||||
@interface ZXAztecEncoder : NSObject
|
||||
|
||||
/**
|
||||
* Encodes the given binary content as an Aztec symbol
|
||||
*
|
||||
* @param data input data string
|
||||
* @return Aztec symbol matrix with metadata
|
||||
*/
|
||||
+ (ZXAztecCode *)encode:(ZXByteArray *)data;
|
||||
|
||||
/**
|
||||
* Encodes the given binary content as an Aztec symbol
|
||||
*
|
||||
* @param data input data string
|
||||
* @param minECCPercent minimal percentage of error check words (According to ISO/IEC 24778:2008,
|
||||
* a minimum of 23% + 3 words is recommended)
|
||||
* @param userSpecifiedLayers if non-zero, a user-specified value for the number of layers
|
||||
* @return Aztec symbol matrix with metadata
|
||||
*/
|
||||
+ (ZXAztecCode *)encode:(ZXByteArray *)data
|
||||
minECCPercent:(int)minECCPercent
|
||||
userSpecifiedLayers:(int)userSpecifiedLayers;
|
||||
|
||||
@end
|
||||