Compare commits
No commits in common. "master" and "0.6.2" have entirely different histories.
@ -1 +0,0 @@
|
||||
2.3
|
||||
@ -12,18 +12,16 @@
|
||||
6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
|
||||
6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; };
|
||||
6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; };
|
||||
6003F59E195388D20070C39A /* PNObjAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* PNObjAppDelegate.m */; };
|
||||
6003F5A7195388D20070C39A /* PNObjViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* PNObjViewController.m */; };
|
||||
6003F59E195388D20070C39A /* PNObjectAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* PNObjectAppDelegate.m */; };
|
||||
6003F5A7195388D20070C39A /* PNObjectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* PNObjectViewController.m */; };
|
||||
6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; };
|
||||
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; };
|
||||
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
|
||||
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
|
||||
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
|
||||
6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
|
||||
68119C961E155BAA00E066C7 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68119C951E155BAA00E066C7 /* Security.framework */; };
|
||||
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
|
||||
BCF991672BE36A8FE7F43A6B /* libPods-PNObject_Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E7FCF35EF87A5BDD07CA6CD2 /* libPods-PNObject_Tests.a */; };
|
||||
C52729592D50CEDEC002ADC9 /* libPods-PNObject_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0ABF8340F735722CEE937FA3 /* libPods-PNObject_Example.a */; };
|
||||
DA43246C4FB8B8B587FC2343 /* Pods_PNObject_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CB6B6AE8DC4C8FBEC56DD55 /* Pods_PNObject_Tests.framework */; };
|
||||
E1806AD43C05C089D52D136E /* Pods_PNObject_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D73089A9DA261B19C7C342EA /* Pods_PNObject_Example.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@ -37,10 +35,9 @@
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0ABF8340F735722CEE937FA3 /* libPods-PNObject_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PNObject_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
116AF818F8117B91EF290C9A /* Pods-PNObject_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNObject_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.release.xcconfig"; sourceTree = "<group>"; };
|
||||
2661CEE1F223361CD1DACC25 /* PNObject.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = PNObject.podspec; path = ../PNObject.podspec; sourceTree = "<group>"; };
|
||||
3E392C278361604C1602CAF0 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
|
||||
02B34A3054AF72076F57C9F2 /* Pods-PNObject_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNObject_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.release.xcconfig"; sourceTree = "<group>"; };
|
||||
0D4ADFA41B2B242C25CEC692 /* Pods-PNObject_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNObject_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
5CB6B6AE8DC4C8FBEC56DD55 /* Pods_PNObject_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PNObject_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
6003F58A195388D20070C39A /* PNObject_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PNObject_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
@ -49,10 +46,10 @@
|
||||
6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
6003F59B195388D20070C39A /* PNObject-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PNObject-Prefix.pch"; sourceTree = "<group>"; };
|
||||
6003F59C195388D20070C39A /* PNObjAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PNObjAppDelegate.h; sourceTree = "<group>"; };
|
||||
6003F59D195388D20070C39A /* PNObjAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PNObjAppDelegate.m; sourceTree = "<group>"; };
|
||||
6003F5A5195388D20070C39A /* PNObjViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PNObjViewController.h; sourceTree = "<group>"; };
|
||||
6003F5A6195388D20070C39A /* PNObjViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PNObjViewController.m; sourceTree = "<group>"; };
|
||||
6003F59C195388D20070C39A /* PNObjectAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PNObjectAppDelegate.h; sourceTree = "<group>"; };
|
||||
6003F59D195388D20070C39A /* PNObjectAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PNObjectAppDelegate.m; sourceTree = "<group>"; };
|
||||
6003F5A5195388D20070C39A /* PNObjectViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PNObjectViewController.h; sourceTree = "<group>"; };
|
||||
6003F5A6195388D20070C39A /* PNObjectViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PNObjectViewController.m; sourceTree = "<group>"; };
|
||||
6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
6003F5AE195388D20070C39A /* PNObject_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PNObject_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
|
||||
@ -60,14 +57,13 @@
|
||||
6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; };
|
||||
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
|
||||
68119C951E155BAA00E066C7 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
|
||||
681A32481E2CFB7300DF98BF /* PNObject_Example.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = PNObject_Example.entitlements; sourceTree = "<group>"; };
|
||||
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
|
||||
A90E0E5930707E3F83662328 /* Pods-PNObject_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNObject_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
C0F786F6B0C2234E3B3A5F30 /* Pods-PNObject_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNObject_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
C6D958A9E3E6FFB7818A72C7 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
|
||||
E20844B85780704FB196FA2A /* Pods-PNObject_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNObject_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
E7FCF35EF87A5BDD07CA6CD2 /* libPods-PNObject_Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PNObject_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
6ADA851464A35438E6A21617 /* Pods-PNObject_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNObject_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
75FCB4EFD17838CCA4C93E4A /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
|
||||
8C017F9292D546DE8DBC84F8 /* PNObject.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = PNObject.podspec; path = ../PNObject.podspec; sourceTree = "<group>"; };
|
||||
9984F97E974B595ED43BA3E3 /* Pods-PNObject_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNObject_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
BA17B1571B43FAFAA8B45B6D /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
|
||||
D73089A9DA261B19C7C342EA /* Pods_PNObject_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PNObject_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DE7587A588720F0590F50755 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -75,11 +71,10 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
68119C961E155BAA00E066C7 /* Security.framework in Frameworks */,
|
||||
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */,
|
||||
6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
|
||||
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
|
||||
C52729592D50CEDEC002ADC9 /* libPods-PNObject_Example.a in Frameworks */,
|
||||
E1806AD43C05C089D52D136E /* Pods_PNObject_Example.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -90,7 +85,7 @@
|
||||
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
|
||||
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
|
||||
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
|
||||
BCF991672BE36A8FE7F43A6B /* libPods-PNObject_Tests.a in Frameworks */,
|
||||
DA43246C4FB8B8B587FC2343 /* Pods_PNObject_Tests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -100,13 +95,12 @@
|
||||
6003F581195388D10070C39A = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
681A32481E2CFB7300DF98BF /* PNObject_Example.entitlements */,
|
||||
60FF7A9C1954A5C5007DD14C /* Podspec Metadata */,
|
||||
6003F593195388D20070C39A /* Example for PNObject */,
|
||||
6003F5B5195388D20070C39A /* Tests */,
|
||||
6003F58C195388D20070C39A /* Frameworks */,
|
||||
6003F58B195388D20070C39A /* Products */,
|
||||
977F1D998CB9116027C75157 /* Pods */,
|
||||
700947C2A719D2A125954296 /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@ -122,13 +116,13 @@
|
||||
6003F58C195388D20070C39A /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
68119C951E155BAA00E066C7 /* Security.framework */,
|
||||
6003F58D195388D20070C39A /* Foundation.framework */,
|
||||
6003F58F195388D20070C39A /* CoreGraphics.framework */,
|
||||
6003F591195388D20070C39A /* UIKit.framework */,
|
||||
6003F5AF195388D20070C39A /* XCTest.framework */,
|
||||
0ABF8340F735722CEE937FA3 /* libPods-PNObject_Example.a */,
|
||||
E7FCF35EF87A5BDD07CA6CD2 /* libPods-PNObject_Tests.a */,
|
||||
DE7587A588720F0590F50755 /* Pods.framework */,
|
||||
D73089A9DA261B19C7C342EA /* Pods_PNObject_Example.framework */,
|
||||
5CB6B6AE8DC4C8FBEC56DD55 /* Pods_PNObject_Tests.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@ -136,11 +130,10 @@
|
||||
6003F593195388D20070C39A /* Example for PNObject */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6003F59C195388D20070C39A /* PNObjAppDelegate.h */,
|
||||
6003F59D195388D20070C39A /* PNObjAppDelegate.m */,
|
||||
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */,
|
||||
6003F5A5195388D20070C39A /* PNObjViewController.h */,
|
||||
6003F5A6195388D20070C39A /* PNObjViewController.m */,
|
||||
6003F59C195388D20070C39A /* PNObjectAppDelegate.h */,
|
||||
6003F59D195388D20070C39A /* PNObjectAppDelegate.m */,
|
||||
6003F5A5195388D20070C39A /* PNObjectViewController.h */,
|
||||
6003F5A6195388D20070C39A /* PNObjectViewController.m */,
|
||||
6003F5A8195388D20070C39A /* Images.xcassets */,
|
||||
6003F594195388D20070C39A /* Supporting Files */,
|
||||
);
|
||||
@ -181,20 +174,20 @@
|
||||
60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2661CEE1F223361CD1DACC25 /* PNObject.podspec */,
|
||||
3E392C278361604C1602CAF0 /* README.md */,
|
||||
C6D958A9E3E6FFB7818A72C7 /* LICENSE */,
|
||||
8C017F9292D546DE8DBC84F8 /* PNObject.podspec */,
|
||||
BA17B1571B43FAFAA8B45B6D /* README.md */,
|
||||
75FCB4EFD17838CCA4C93E4A /* LICENSE */,
|
||||
);
|
||||
name = "Podspec Metadata";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
977F1D998CB9116027C75157 /* Pods */ = {
|
||||
700947C2A719D2A125954296 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E20844B85780704FB196FA2A /* Pods-PNObject_Example.debug.xcconfig */,
|
||||
116AF818F8117B91EF290C9A /* Pods-PNObject_Example.release.xcconfig */,
|
||||
A90E0E5930707E3F83662328 /* Pods-PNObject_Tests.debug.xcconfig */,
|
||||
C0F786F6B0C2234E3B3A5F30 /* Pods-PNObject_Tests.release.xcconfig */,
|
||||
6ADA851464A35438E6A21617 /* Pods-PNObject_Example.debug.xcconfig */,
|
||||
02B34A3054AF72076F57C9F2 /* Pods-PNObject_Example.release.xcconfig */,
|
||||
0D4ADFA41B2B242C25CEC692 /* Pods-PNObject_Tests.debug.xcconfig */,
|
||||
9984F97E974B595ED43BA3E3 /* Pods-PNObject_Tests.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
@ -206,12 +199,13 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "PNObject_Example" */;
|
||||
buildPhases = (
|
||||
E4CE079F616C61EA34D08B8B /* [CP] Check Pods Manifest.lock */,
|
||||
647B517E2FE18AF68E8B23C3 /* 📦 Check Pods Manifest.lock */,
|
||||
6003F586195388D20070C39A /* Sources */,
|
||||
6003F587195388D20070C39A /* Frameworks */,
|
||||
6003F588195388D20070C39A /* Resources */,
|
||||
C40CC8D7B1996A567BE82827 /* [CP] Embed Pods Frameworks */,
|
||||
614EA73ED5E0ED0F8684468C /* [CP] Copy Pods Resources */,
|
||||
43252B3B955A9E6FDF55EF8C /* 📦 Embed Pods Frameworks */,
|
||||
12D318BA313DC2FC036858CF /* 📦 Copy Pods Resources */,
|
||||
5B0DE642CBEC93B376D9DE7D /* Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@ -226,12 +220,13 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "PNObject_Tests" */;
|
||||
buildPhases = (
|
||||
3FF38AA7E586B22171D1A118 /* [CP] Check Pods Manifest.lock */,
|
||||
13BC374C48C25E4BE960A7C4 /* 📦 Check Pods Manifest.lock */,
|
||||
6003F5AA195388D20070C39A /* Sources */,
|
||||
6003F5AB195388D20070C39A /* Frameworks */,
|
||||
6003F5AC195388D20070C39A /* Resources */,
|
||||
746A765B48FD98342716D81F /* [CP] Embed Pods Frameworks */,
|
||||
21411FBE0FE21EC75B6AB1E3 /* [CP] Copy Pods Resources */,
|
||||
66B08B1481C5994108A958AF /* 📦 Embed Pods Frameworks */,
|
||||
5B13AE8F18948BE84DDA2DC9 /* 📦 Copy Pods Resources */,
|
||||
1B536F1CF4938475D823C8DD /* Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@ -249,8 +244,8 @@
|
||||
6003F582195388D10070C39A /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
CLASSPREFIX = PNObj;
|
||||
LastUpgradeCheck = 0820;
|
||||
CLASSPREFIX = PNObject;
|
||||
LastUpgradeCheck = 0720;
|
||||
ORGANIZATIONNAME = "Giuseppe Nucifora";
|
||||
TargetAttributes = {
|
||||
6003F589195388D20070C39A = {
|
||||
@ -290,7 +285,6 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */,
|
||||
6003F5A9195388D20070C39A /* Images.xcassets in Resources */,
|
||||
6003F598195388D20070C39A /* InfoPlist.strings in Resources */,
|
||||
);
|
||||
@ -307,65 +301,44 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
21411FBE0FE21EC75B6AB1E3 /* [CP] Copy Pods Resources */ = {
|
||||
12D318BA313DC2FC036858CF /* 📦 Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
name = "📦 Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
3FF38AA7E586B22171D1A118 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-PNObject_Tests-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
614EA73ED5E0ED0F8684468C /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-resources.sh",
|
||||
"${PODS_ROOT}/FBSDKCoreKit/FacebookSDKStrings.bundle",
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
746A765B48FD98342716D81F /* [CP] Embed Pods Frameworks */ = {
|
||||
13BC374C48C25E4BE960A7C4 /* 📦 Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
name = "📦 Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
1B536F1CF4938475D823C8DD /* Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@ -373,14 +346,14 @@
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
C40CC8D7B1996A567BE82827 /* [CP] Embed Pods Frameworks */ = {
|
||||
43252B3B955A9E6FDF55EF8C /* 📦 Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
buildActionMask = 12;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
name = "📦 Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@ -388,22 +361,64 @@
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
E4CE079F616C61EA34D08B8B /* [CP] Check Pods Manifest.lock */ = {
|
||||
5B0DE642CBEC93B376D9DE7D /* Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
name = "Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-PNObject_Example-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
5B13AE8F18948BE84DDA2DC9 /* 📦 Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "📦 Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
647B517E2FE18AF68E8B23C3 /* 📦 Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "📦 Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
66B08B1481C5994108A958AF /* 📦 Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "📦 Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
@ -413,8 +428,8 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6003F59E195388D20070C39A /* PNObjAppDelegate.m in Sources */,
|
||||
6003F5A7195388D20070C39A /* PNObjViewController.m in Sources */,
|
||||
6003F59E195388D20070C39A /* PNObjectAppDelegate.m in Sources */,
|
||||
6003F5A7195388D20070C39A /* PNObjectViewController.m in Sources */,
|
||||
6003F59A195388D20070C39A /* main.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@ -470,31 +485,27 @@
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
@ -514,25 +525,20 @@
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
@ -541,15 +547,14 @@
|
||||
};
|
||||
6003F5C0195388D20070C39A /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = E20844B85780704FB196FA2A /* Pods-PNObject_Example.debug.xcconfig */;
|
||||
baseConfigurationReference = 6ADA851464A35438E6A21617 /* Pods-PNObject_Example.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
CODE_SIGN_ENTITLEMENTS = PNObject_Example.entitlements;
|
||||
DEVELOPMENT_TEAM = 825G85A28E;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "PNObject/PNObject-Prefix.pch";
|
||||
INFOPLIST_FILE = "PNObject/PNObject-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MODULE_NAME = ExampleApp;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@ -559,15 +564,14 @@
|
||||
};
|
||||
6003F5C1195388D20070C39A /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 116AF818F8117B91EF290C9A /* Pods-PNObject_Example.release.xcconfig */;
|
||||
baseConfigurationReference = 02B34A3054AF72076F57C9F2 /* Pods-PNObject_Example.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
CODE_SIGN_ENTITLEMENTS = PNObject_Example.entitlements;
|
||||
DEVELOPMENT_TEAM = 825G85A28E;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "PNObject/PNObject-Prefix.pch";
|
||||
INFOPLIST_FILE = "PNObject/PNObject-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MODULE_NAME = ExampleApp;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@ -577,7 +581,7 @@
|
||||
};
|
||||
6003F5C3195388D20070C39A /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = A90E0E5930707E3F83662328 /* Pods-PNObject_Tests.debug.xcconfig */;
|
||||
baseConfigurationReference = 0D4ADFA41B2B242C25CEC692 /* Pods-PNObject_Tests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
@ -601,7 +605,7 @@
|
||||
};
|
||||
6003F5C4195388D20070C39A /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C0F786F6B0C2234E3B3A5F30 /* Pods-PNObject_Tests.release.xcconfig */;
|
||||
baseConfigurationReference = 9984F97E974B595ED43BA3E3 /* Pods-PNObject_Tests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0820"
|
||||
LastUpgradeVersion = "0730"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@ -71,7 +71,29 @@
|
||||
ReferencedContainer = "container:PNObject.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<EnvironmentVariables>
|
||||
<EnvironmentVariable
|
||||
key = "NSZombieEnabled"
|
||||
value = "YES"
|
||||
isEnabled = "YES">
|
||||
</EnvironmentVariable>
|
||||
<EnvironmentVariable
|
||||
key = "NSAutoreleaseFreedObjectCheckEnabled"
|
||||
value = "YES"
|
||||
isEnabled = "YES">
|
||||
</EnvironmentVariable>
|
||||
<EnvironmentVariable
|
||||
key = "NSDebugEnabled"
|
||||
value = "YES"
|
||||
isEnabled = "YES">
|
||||
</EnvironmentVariable>
|
||||
</EnvironmentVariables>
|
||||
<AdditionalOptions>
|
||||
<AdditionalOption
|
||||
key = "NSZombieEnabled"
|
||||
value = "YES"
|
||||
isEnabled = "YES">
|
||||
</AdditionalOption>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
{
|
||||
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "0D16AB9035733B66D1E42542FCF79AEB110EE3F1",
|
||||
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
|
||||
|
||||
},
|
||||
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
|
||||
"0D16AB9035733B66D1E42542FCF79AEB110EE3F1" : 0,
|
||||
"AEB0552E99BCD7202184FC09F243A3865259D36E" : 0
|
||||
},
|
||||
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "F9984EE9-FBF8-4451-8C8E-EB0CA1AB5EC0",
|
||||
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
|
||||
"0D16AB9035733B66D1E42542FCF79AEB110EE3F1" : "PNObject\/",
|
||||
"AEB0552E99BCD7202184FC09F243A3865259D36E" : "..\/..\/..\/Purplenetwork\/GIT\/iOS\/packman-ios"
|
||||
},
|
||||
"DVTSourceControlWorkspaceBlueprintNameKey" : "PNObject",
|
||||
"DVTSourceControlWorkspaceBlueprintVersion" : 204,
|
||||
"DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Example\/PNObject.xcworkspace",
|
||||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
|
||||
{
|
||||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "git.giuseppenucifora.com:giuseppenucifora\/PNObject.git",
|
||||
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
|
||||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "0D16AB9035733B66D1E42542FCF79AEB110EE3F1"
|
||||
},
|
||||
{
|
||||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "git.giuseppenucifora.com:purplenetwork\/packman-ios.git",
|
||||
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
|
||||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "AEB0552E99BCD7202184FC09F243A3865259D36E"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,152 +1,128 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
},
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Icon-40.png",
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-40@2x.png",
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-60@2x.png",
|
||||
"size" : "60x60",
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-72.png",
|
||||
"size" : "72x72",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-72@2x.png",
|
||||
"size" : "72x72",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-76.png",
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-76@2x.png",
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-Small-50.png",
|
||||
"size" : "50x50",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-Small-50@2x.png",
|
||||
"size" : "50x50",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-Small.png",
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-Small@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon.png",
|
||||
"size" : "57x57",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon@2x.png",
|
||||
"size" : "57x57",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-Small@3x.png",
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-40@3x.png",
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-60@3x.png",
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-40@2x.png",
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-Small.png",
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-40@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "57x57",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-Small@2x.png",
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"size" : "57x57",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-60@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-60@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-Small.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-Small@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-40.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "50x50",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-Small-50.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "50x50",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-Small-50@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "72x72",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-72.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "72x72",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-72@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-76.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-83.5@2x.png",
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "NotificationIcon@2x.png",
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "NotificationIcon@3x.png",
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"filename" : "NotificationIcon~ipad.png",
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "NotificationIcon~ipad@2x.png",
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
}
|
||||
]
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 163 B After Width: | Height: | Size: 188 B |
|
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 353 B |
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 523 B |
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 523 B |
|
Before Width: | Height: | Size: 816 B After Width: | Height: | Size: 958 B |
|
Before Width: | Height: | Size: 281 B After Width: | Height: | Size: 317 B |
|
Before Width: | Height: | Size: 581 B After Width: | Height: | Size: 722 B |
|
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 341 B |
|
Before Width: | Height: | Size: 609 B After Width: | Height: | Size: 782 B |
|
Before Width: | Height: | Size: 656 B After Width: | Height: | Size: 899 B |
|
Before Width: | Height: | Size: 180 B After Width: | Height: | Size: 245 B |
|
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 458 B |
|
Before Width: | Height: | Size: 127 B After Width: | Height: | Size: 170 B |
|
Before Width: | Height: | Size: 225 B After Width: | Height: | Size: 263 B |
|
Before Width: | Height: | Size: 285 B After Width: | Height: | Size: 387 B |
|
Before Width: | Height: | Size: 159 B After Width: | Height: | Size: 261 B |
|
Before Width: | Height: | Size: 448 B After Width: | Height: | Size: 505 B |
|
Before Width: | Height: | Size: 163 B |
|
Before Width: | Height: | Size: 238 B |
|
Before Width: | Height: | Size: 106 B |
|
Before Width: | Height: | Size: 163 B |
@ -1,162 +1,162 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
},
|
||||
"images" : [
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Default.png",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "1x",
|
||||
"extent" : "full-screen"
|
||||
"orientation" : "portrait",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Default@2x.png",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"minimum-system-version" : "7.0",
|
||||
"extent" : "full-screen"
|
||||
"orientation" : "portrait",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"filename" : "Default-568h@2x.png",
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "retina4",
|
||||
"scale" : "2x",
|
||||
"extent" : "full-screen"
|
||||
"filename" : "Default-568h@2x.png",
|
||||
"orientation" : "portrait",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"filename" : "Default-568h@2x.png",
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "retina4",
|
||||
"scale" : "2x",
|
||||
"filename" : "Default-568h@2x.png",
|
||||
"minimum-system-version" : "7.0",
|
||||
"extent" : "full-screen"
|
||||
"orientation" : "portrait",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"filename" : "Default@2x.png",
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"extent" : "full-screen"
|
||||
"filename" : "Default@2x.png",
|
||||
"orientation" : "portrait",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"extent" : "to-status-bar",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Default~ipad.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"extent" : "to-status-bar"
|
||||
"orientation" : "portrait",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"extent" : "to-status-bar",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Default~ipad@2x.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"extent" : "to-status-bar"
|
||||
"orientation" : "portrait",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"extent" : "to-status-bar",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Default~ipad~landscape.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"extent" : "to-status-bar"
|
||||
"orientation" : "landscape",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"extent" : "to-status-bar",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Default~ipad~landscape@2x.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"extent" : "to-status-bar"
|
||||
"orientation" : "landscape",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Default~ipad~nostatusbar.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"minimum-system-version" : "7.0",
|
||||
"extent" : "full-screen"
|
||||
"orientation" : "portrait",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Default~ipad~nostatusbar.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"extent" : "full-screen"
|
||||
"orientation" : "portrait",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Default~ipad~nostatusbar@2x.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"minimum-system-version" : "7.0",
|
||||
"extent" : "full-screen"
|
||||
"orientation" : "portrait",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Default~ipad~nostatusbar@2x.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"extent" : "full-screen"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"filename" : "Default~ipad~landscape~nostatusbar.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"minimum-system-version" : "7.0",
|
||||
"extent" : "full-screen"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"filename" : "Default~ipad~landscape~nostatusbar.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"extent" : "full-screen"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"filename" : "Default~ipad~landscape~nostatusbar@2x.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"minimum-system-version" : "7.0",
|
||||
"extent" : "full-screen"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"filename" : "Default~ipad~landscape~nostatusbar@2x.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"extent" : "full-screen"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Default~ipad~landscape~nostatusbar.png",
|
||||
"minimum-system-version" : "7.0",
|
||||
"orientation" : "landscape",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Default~ipad~landscape~nostatusbar.png",
|
||||
"orientation" : "landscape",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Default~ipad~landscape~nostatusbar@2x.png",
|
||||
"minimum-system-version" : "7.0",
|
||||
"orientation" : "landscape",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Default~ipad~landscape~nostatusbar@2x.png",
|
||||
"orientation" : "landscape",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "736h",
|
||||
"filename" : "Default-Portrait-736h@3x.png",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "736h",
|
||||
"scale" : "3x",
|
||||
"minimum-system-version" : "8.0",
|
||||
"extent" : "full-screen"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"filename" : "Default-Landscape-736h@3x.png",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "736h",
|
||||
"scale" : "3x",
|
||||
"minimum-system-version" : "8.0",
|
||||
"extent" : "full-screen"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"filename" : "Default-667h@2x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "736h",
|
||||
"filename" : "Default-Landscape-736h@3x.png",
|
||||
"minimum-system-version" : "8.0",
|
||||
"orientation" : "landscape",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "667h",
|
||||
"scale" : "2x",
|
||||
"filename" : "Default-667h@2x.png",
|
||||
"minimum-system-version" : "8.0",
|
||||
"extent" : "full-screen"
|
||||
"orientation" : "portrait",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 58 KiB |
@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="whP-gf-Uak">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="wQg-tq-qST">
|
||||
<objects>
|
||||
<viewController id="whP-gf-Uak" customClass="PNObjViewController" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="uEw-UM-LJ8"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="Mvr-aV-6Um"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="TpU-gO-2f1">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="305" y="433"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@ -1,15 +0,0 @@
|
||||
//
|
||||
// PNObjAppDelegate.h
|
||||
// PNObject
|
||||
//
|
||||
// Created by Giuseppe Nucifora on 12/28/2016.
|
||||
// Copyright (c) 2016 Giuseppe Nucifora. All rights reserved.
|
||||
//
|
||||
|
||||
@import UIKit;
|
||||
|
||||
@interface PNObjAppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
@end
|
||||
@ -1,13 +0,0 @@
|
||||
//
|
||||
// PNObjViewController.h
|
||||
// PNObject
|
||||
//
|
||||
// Created by Giuseppe Nucifora on 12/28/2016.
|
||||
// Copyright (c) 2016 Giuseppe Nucifora. All rights reserved.
|
||||
//
|
||||
|
||||
@import UIKit;
|
||||
|
||||
@interface PNObjViewController : UIViewController
|
||||
|
||||
@end
|
||||
@ -24,25 +24,6 @@
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
@ -83,6 +64,26 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UIRequiresFullScreen</key>
|
||||
<true/>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
||||
15
Example/PNObject/PNObjectAppDelegate.h
Normal file
@ -0,0 +1,15 @@
|
||||
//
|
||||
// PNObjectAppDelegate.h
|
||||
// PNObject
|
||||
//
|
||||
// Created by Giuseppe Nucifora on 12/28/2015.
|
||||
// Copyright (c) 2015 Giuseppe Nucifora. All rights reserved.
|
||||
//
|
||||
|
||||
@import UIKit;
|
||||
|
||||
@interface PNObjectAppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
@end
|
||||
@ -1,27 +1,28 @@
|
||||
//
|
||||
// PNObjAppDelegate.m
|
||||
// PNObjectAppDelegate.m
|
||||
// PNObject
|
||||
//
|
||||
// Created by Giuseppe Nucifora on 12/28/2016.
|
||||
// Copyright (c) 2016 Giuseppe Nucifora. All rights reserved.
|
||||
// Created by Giuseppe Nucifora on 12/28/2015.
|
||||
// Copyright (c) 2015 Giuseppe Nucifora. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PNObjAppDelegate.h"
|
||||
#import "PNObjectAppDelegate.h"
|
||||
#import "PNObjectViewController.h"
|
||||
|
||||
#import <PNObject/PNUser.h>
|
||||
#import <PNObject/PNAddress.h>
|
||||
#import <PNObject/PNObject+PNObjectConnection.h>
|
||||
#import "PNObjViewController.h"
|
||||
#import "PNObject.h"
|
||||
#import "PNUser.h"
|
||||
#import "PNAddress.h"
|
||||
#import "PNObject+PNObjectConnection.h"
|
||||
|
||||
#import <FBSDKCoreKit/FBSDKCoreKit.h>
|
||||
#import <FBSDKLoginKit/FBSDKLoginKit.h>
|
||||
#import <FBSDKShareKit/FBSDKShareKit.h>
|
||||
#import "UIDevice-Hardware.h"
|
||||
|
||||
#import <PNObject/PNInstallation.h>
|
||||
#import <NSDate_Utils/NSDate+NSDate_Util.h>
|
||||
#import "PNInstallation.h"
|
||||
|
||||
@implementation PNObjAppDelegate
|
||||
|
||||
@implementation PNObjectAppDelegate
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
@ -33,24 +34,18 @@
|
||||
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
// Override point for customization after application launch.
|
||||
|
||||
[PNObjectConfig initSharedInstanceForEnvironments:@{EnvironmentDevelopment : @{BaseUrl:@"http://pnobject.local/",EndpointPath:@"api/v1/"},
|
||||
EnvironmentStage : @{BaseUrl:@"http://pnobject.stage.it/",EndpointPath:@"api/v1/"},
|
||||
EnvironmentProduction : @{BaseUrl:@"http://pnobject.prod.it/",EndpointPath:@"api/v1/"},
|
||||
} userSubclass:[PNUser class] withOauthMode:OAuthModeClientCredential];
|
||||
|
||||
[[PNObjectConfig sharedInstance] setClientID:@"xxxxxxxxx" clientSecret:@"xxxxxxxxxxxx" forEnv:EnvironmentStage];
|
||||
[[PNObjectConfig sharedInstance] setClientID:@"xxxxxxxxx" clientSecret:@"xxxxxxxxxxxx" forEnv:EnvironmentProduction];
|
||||
|
||||
[PNObjectConfig initSharedInstanceForEnvironments:@{EnvironmentDevelopment : @"http://packman.local/app_dev.php/api/v1/",
|
||||
EnvironmentStage : @"https://packman.ppreview.it/app_stage.php/api/v1/",
|
||||
EnvironmentProduction : @"http://packman.ppreview.it/app_stage.php/api/v1/"
|
||||
} userSubclass:[PNUser class] withOauth:YES];
|
||||
[[PNObjectConfig sharedInstance] setHTTPHeaderValue:@"application/x-www-form-urlencoded" forKey:@"Content-Type"];
|
||||
[[PNObjectConfig sharedInstance] setClientID:@"1_pqjo2w5k7j4g8skco408oc048w8so0ws840gcg8k8gwsgk0g4" clientSecret:@"10w0vg2v6eggooc4wks4w4s0wkwok0wkck0w888so0o80g88w8" forEnv:EnvironmentProduction];
|
||||
#ifdef DEBUG
|
||||
[[PNObjectConfig sharedInstance] setEnvironment:EnvironmentStage];
|
||||
//[[PNObjectConfig sharedInstance] setHTTPHeaderValue:@"XMLHttpRequest" forKey:@"X-Request-With"];
|
||||
|
||||
NSLogDebug(@"%@",[[PNObjectConfig sharedInstance] baseUrl]);
|
||||
NSLogDebug(@"%@",[[PNObjectConfig sharedInstance] endPointPath]);
|
||||
NSLogDebug(@"%@",[[PNObjectConfig sharedInstance] endPointUrl]);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
PNObjViewController *viewController = [[PNObjViewController alloc] init];
|
||||
PNObjectViewController *viewController = [[PNObjectViewController alloc] init];
|
||||
|
||||
switch ([[UIDevice currentDevice] deviceFamily]) {
|
||||
case UIDeviceFamilyiPhone:
|
||||
@ -74,23 +69,6 @@
|
||||
_window.backgroundColor = [UIColor whiteColor];
|
||||
[_window makeKeyAndVisible];
|
||||
|
||||
/*[PNUser loginCurrentUserWithEmail:@"socials2@giuseppenucifora.com" password:@"asdasdasd" withBlockSuccess:^(PNUser * _Nullable responseObject) {
|
||||
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
|
||||
}];*/
|
||||
|
||||
if ([PNUser currentUser] && [[PNUser currentUser] isAuthenticated]) {
|
||||
NSLogDebug(@"Login in corso...");
|
||||
[[PNUser currentUser] reloadFormServerWithBlockSuccess:^(PNUser * _Nullable currentUser) {
|
||||
NSLogDebug(@"Login Success...");
|
||||
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
NSLogDebug(@"Login in error...");
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
@ -111,10 +89,8 @@
|
||||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application
|
||||
{
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
||||
[FBSDKAppEvents activateApp];
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application
|
||||
@ -132,6 +108,7 @@
|
||||
annotation:annotation];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Remote Notification
|
||||
|
||||
- (void) application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
|
||||
@ -141,70 +118,25 @@
|
||||
|
||||
[installation saveLocally];
|
||||
|
||||
NSLogDebug(@"%@",installation);
|
||||
NSLog(@"%@",installation);
|
||||
|
||||
NSLogDebug(@"%@",[installation JSONFormObject]);
|
||||
NSLog(@"%@",[installation JSONFormObject]);
|
||||
|
||||
//[installation setUser:nil];
|
||||
|
||||
[self updateDeviceUser];
|
||||
|
||||
}
|
||||
|
||||
- (void) updateDeviceUser {
|
||||
|
||||
if ([PNUser currentUser] && [[PNUser currentUser] isAuthenticated]) {
|
||||
[[PNInstallation currentInstallation] setUser:[PNUser currentUser]];
|
||||
}
|
||||
else {
|
||||
[[PNInstallation currentInstallation] setUser:nil];
|
||||
}
|
||||
|
||||
if (![[PNInstallation currentInstallation] registeredAt] || [[NSDate date] isLaterThanDate:[[[PNInstallation currentInstallation] lastTokenUpdate] dateByAddingDays:1]]) {
|
||||
[self registerRemoteDevice];
|
||||
}
|
||||
else if ([[PNInstallation currentInstallation] updatedAt] || [[NSDate date] isLaterThanDate:[[[PNInstallation currentInstallation] updatedAt] dateByAddingMinutes:30]]) {
|
||||
[self updateRemoteDevice];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) registerRemoteDevice {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[[PNInstallation currentInstallation] registerDeviceWithBlockProgress:^(NSProgress * _Nonnull uploadProgress) {
|
||||
|
||||
} Success:^(BOOL response) {
|
||||
NSLogDebug(@"device registrato");
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
NSLogDebug(@"device non registrato");
|
||||
}];
|
||||
});
|
||||
}
|
||||
|
||||
- (void) updateRemoteDevice {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[[PNInstallation currentInstallation] updateDeviceWithBlockProgress:^(NSProgress * _Nonnull uploadProgress) {
|
||||
|
||||
} Success:^(BOOL response) {
|
||||
NSLogDebug(@"device aggiornato");
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
NSLogDebug(@"device non aggiornato");
|
||||
}];
|
||||
});
|
||||
}
|
||||
|
||||
- (void) application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
|
||||
|
||||
NSLogDebug(@"%@",notificationSettings);
|
||||
NSLog(@"%@",notificationSettings);
|
||||
}
|
||||
|
||||
- (void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
|
||||
|
||||
NSLogDebug(@"%@",userInfo);
|
||||
NSLog(@"%@",userInfo);
|
||||
}
|
||||
|
||||
- (void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
|
||||
|
||||
NSLogDebug(@"%@",userInfo);
|
||||
NSLog(@"%@",userInfo);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
13
Example/PNObject/PNObjectViewController.h
Normal file
@ -0,0 +1,13 @@
|
||||
//
|
||||
// PNObjectViewController.h
|
||||
// PNObject
|
||||
//
|
||||
// Created by Giuseppe Nucifora on 12/28/2015.
|
||||
// Copyright (c) 2015 Giuseppe Nucifora. All rights reserved.
|
||||
//
|
||||
|
||||
@import UIKit;
|
||||
|
||||
@interface PNObjectViewController : UIViewController
|
||||
|
||||
@end
|
||||
@ -1,19 +1,19 @@
|
||||
//
|
||||
// PNObjViewController.m
|
||||
// PNObjectViewController.m
|
||||
// PNObject
|
||||
//
|
||||
// Created by Giuseppe Nucifora on 12/28/2016.
|
||||
// Copyright (c) 2016 Giuseppe Nucifora. All rights reserved.
|
||||
// Created by Giuseppe Nucifora on 12/28/2015.
|
||||
// Copyright (c) 2015 Giuseppe Nucifora. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PNObjViewController.h"
|
||||
#import <PNObject/PNObject.h>
|
||||
#import <PNObject/PNUser.h>
|
||||
#import <PNObject/PNAddress.h>
|
||||
#import <PNObject/PNObject+PNObjectConnection.h>
|
||||
#import "PNObjectViewController.h"
|
||||
#import <PureLayout/PureLayout.h>
|
||||
#import "PNObject.h"
|
||||
#import "PNUser.h"
|
||||
#import "PNAddress.h"
|
||||
#import "PNObject+PNObjectConnection.h"
|
||||
|
||||
@interface PNObjViewController ()
|
||||
@interface PNObjectViewController ()
|
||||
|
||||
@property (nonatomic) BOOL didSetupConstraints;
|
||||
|
||||
@ -23,14 +23,14 @@
|
||||
|
||||
@property (nonatomic, strong) UIButton *cancelToken;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation PNObjViewController
|
||||
@implementation PNObjectViewController
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
|
||||
_refreshToken = [UIButton newAutoLayoutView];
|
||||
[_refreshToken addTarget:self action:@selector(refreshTokenAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
@ -102,26 +102,66 @@
|
||||
|
||||
- (void) apiCallAction {
|
||||
|
||||
PNObjcPassword *password = [PNObjcPassword new];
|
||||
/*PNObjcPassword *password = [PNObjcPassword new];
|
||||
[password setPassword:@"asdasdasd"];
|
||||
[password setConfirmPassword:@"asdasdasd"];
|
||||
|
||||
PNUser *user = [PNUser new];
|
||||
[user setFirstName:@"Test"];
|
||||
[user setLastName:@"Test"];
|
||||
[user setEmail:@"pnobject@pnobject.com"];
|
||||
User *user = [User new];
|
||||
[user setFirstName:@"Giuseppe"];
|
||||
[user setLastName:@"Nuficora"];
|
||||
[user setEmail:@"packman5@giuseppenucifora.com"];
|
||||
[user setPassword:password];
|
||||
[user setHasAcceptedNewsletter:YES];
|
||||
[user setHasAcceptedPrivacy:YES];
|
||||
*/
|
||||
//[user saveLocally];
|
||||
|
||||
[user saveLocally];
|
||||
NSLog(@"%@",[[PNUser currentUser] JSONFormObject]);
|
||||
//NSLog(@"%@",[user JSONObjectMap]);
|
||||
/*[user registerWithBlockSuccess:^(PNUser * _Nullable responseObject) {
|
||||
|
||||
NSLogDebug(@"%@",[[PNUser currentUser] JSONFormObject]);
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
|
||||
}];*/
|
||||
|
||||
/*[[User currentUser] socialLoginWithBlockSuccessFromViewController:self
|
||||
blockSuccess:^(PNUser * _Nullable responseObject) {
|
||||
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
|
||||
}];*/
|
||||
|
||||
//User * user = [User currentUser];
|
||||
|
||||
//if ([user isAuthenticated]) {
|
||||
|
||||
/*[User loginCurrentUserWithEmail:@"demo@packman.example" password:@"demo@packman.example" withBlockSuccess:^(PNUser * _Nullable responseObject) {
|
||||
|
||||
NSLog(@"response : %@",responseObject);
|
||||
|
||||
NSLog(@"%@",[User currentUser]);
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
NSLog(@"response : %@",error);
|
||||
}];*/
|
||||
|
||||
[PNUser socialLoginWithBlockSuccess:^(PNUser * _Nullable responseObject) {
|
||||
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
|
||||
}];
|
||||
|
||||
|
||||
|
||||
/*[User resetPasswordForEmail:@"packman@giuseppenucifora.com" Progress:^(NSProgress * _Nonnull uploadProgress) {
|
||||
|
||||
} Success:^(NSDictionary * _Nullable responseObject) {
|
||||
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
|
||||
}];*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)didReceiveMemoryWarning
|
||||
{
|
||||
[super didReceiveMemoryWarning];
|
||||
@ -2,16 +2,16 @@
|
||||
// main.m
|
||||
// PNObject
|
||||
//
|
||||
// Created by Giuseppe Nucifora on 12/28/2016.
|
||||
// Copyright (c) 2016 Giuseppe Nucifora. All rights reserved.
|
||||
// Created by Giuseppe Nucifora on 12/28/2015.
|
||||
// Copyright (c) 2015 Giuseppe Nucifora. All rights reserved.
|
||||
//
|
||||
|
||||
@import UIKit;
|
||||
#import "PNObjAppDelegate.h"
|
||||
#import "PNObjectAppDelegate.h"
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
@autoreleasepool {
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([PNObjAppDelegate class]));
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([PNObjectAppDelegate class]));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>aps-environment</key>
|
||||
<string>development</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@ -1,13 +1,28 @@
|
||||
platform :ios, '9.0'
|
||||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
use_frameworks!
|
||||
|
||||
target 'PNObject_Example' do
|
||||
pod 'PNObject', :path => '../'
|
||||
pod "PNObject", :path => "../"
|
||||
pod 'PEAR-FileManager-iOS'
|
||||
pod 'NSDate_Utils'
|
||||
pod 'UIDevice-Utils'
|
||||
pod 'AFNetworking'
|
||||
pod 'nv-ios-http-status'
|
||||
pod 'NSString-Helper'
|
||||
pod 'CodFis-Helper'
|
||||
pod 'StrongestPasswordValidator'
|
||||
pod 'PureLayout'
|
||||
pod 'FBSDKCoreKit'
|
||||
pod 'FBSDKShareKit'
|
||||
pod 'FBSDKLoginKit'
|
||||
|
||||
end
|
||||
|
||||
target 'PNObject_Tests' do
|
||||
inherit! :search_paths
|
||||
pod "PNObject", :path => "../"
|
||||
|
||||
pod 'Specta'
|
||||
pod 'Expecta'
|
||||
end
|
||||
pod 'FBSnapshotTestCase'
|
||||
pod 'Expecta+Snapshots'
|
||||
end
|
||||
|
||||
@ -14,57 +14,80 @@ PODS:
|
||||
- AFNetworking/Serialization (3.1.0)
|
||||
- AFNetworking/UIKit (3.1.0):
|
||||
- AFNetworking/NSURLSession
|
||||
- Bolts (1.9.0):
|
||||
- Bolts/AppLinks (= 1.9.0)
|
||||
- Bolts/Tasks (= 1.9.0)
|
||||
- Bolts/AppLinks (1.9.0):
|
||||
- Bolts (1.7.0):
|
||||
- Bolts/AppLinks (= 1.7.0)
|
||||
- Bolts/Tasks (= 1.7.0)
|
||||
- Bolts/AppLinks (1.7.0):
|
||||
- Bolts/Tasks
|
||||
- Bolts/Tasks (1.9.0)
|
||||
- Bolts/Tasks (1.7.0)
|
||||
- CocoaSecurity (1.2.4)
|
||||
- CodFis-Helper (0.1.3)
|
||||
- DDDKeychainWrapper (1.0.0)
|
||||
- DJLocalization (1.2.2):
|
||||
- DJLocalization/Core (= 1.2.2)
|
||||
- DJLocalization/Core (1.2.2)
|
||||
- Expecta (1.0.6)
|
||||
- FBSDKCoreKit (4.29.0):
|
||||
- Bolts (~> 1.7)
|
||||
- FBSDKLoginKit (4.29.0):
|
||||
- DJLocalization (1.2.0):
|
||||
- JRSwizzle
|
||||
- Expecta (1.0.5)
|
||||
- Expecta+Snapshots (3.0.0):
|
||||
- Expecta (~> 1.0)
|
||||
- FBSnapshotTestCase/Core (~> 2.0)
|
||||
- Specta (~> 1.0)
|
||||
- FBSDKCoreKit (4.10.1):
|
||||
- Bolts (~> 1.5)
|
||||
- FBSDKLoginKit (4.10.1):
|
||||
- FBSDKCoreKit
|
||||
- FBSDKShareKit (4.29.0):
|
||||
- FBSDKShareKit (4.10.1):
|
||||
- FBSDKCoreKit
|
||||
- NSDataAES (0.2.2)
|
||||
- NSDate_Utils (1.1.0):
|
||||
- DJLocalization
|
||||
- FBSnapshotTestCase (2.1.0):
|
||||
- FBSnapshotTestCase/SwiftSupport (= 2.1.0)
|
||||
- FBSnapshotTestCase/Core (2.1.0)
|
||||
- FBSnapshotTestCase/SwiftSupport (2.1.0):
|
||||
- FBSnapshotTestCase/Core
|
||||
- JRSwizzle (1.0)
|
||||
- NACrypto (1.0.6)
|
||||
- NSDate_Utils (0.1.3)
|
||||
- NSString-Helper (1.0.5)
|
||||
- NSUserDefaults-AESEncryptor (0.0.4):
|
||||
- CocoaSecurity (~> 1.2.2)
|
||||
- nv-ios-http-status (0.0.1)
|
||||
- PEAR-FileManager-iOS (1.3.1)
|
||||
- PNObject (1.3.4):
|
||||
- PNObject (0.5.7):
|
||||
- AFNetworking
|
||||
- CodFis-Helper
|
||||
- DDDKeychainWrapper
|
||||
- DJLocalization
|
||||
- FBSDKCoreKit
|
||||
- FBSDKLoginKit
|
||||
- FBSDKShareKit
|
||||
- NSDataAES
|
||||
- NACrypto
|
||||
- NSDate_Utils
|
||||
- NSString-Helper
|
||||
- NSUserDefaults-AESEncryptor
|
||||
- nv-ios-http-status
|
||||
- PEAR-FileManager-iOS
|
||||
- RZDataBinding
|
||||
- StrongestPasswordValidator
|
||||
- UIDevice-Utils
|
||||
- PureLayout (3.0.2)
|
||||
- RZDataBinding (2.1.0)
|
||||
- Specta (1.0.7)
|
||||
- PureLayout (3.0.1)
|
||||
- RZDataBinding (2.0.3)
|
||||
- Specta (1.0.5)
|
||||
- StrongestPasswordValidator (0.1.2)
|
||||
- UIDevice-Utils (1.0.0)
|
||||
- UIDevice-Utils (0.1.5)
|
||||
|
||||
DEPENDENCIES:
|
||||
- AFNetworking
|
||||
- CodFis-Helper
|
||||
- Expecta
|
||||
- Expecta+Snapshots
|
||||
- FBSDKCoreKit
|
||||
- FBSDKLoginKit
|
||||
- FBSDKShareKit
|
||||
- FBSnapshotTestCase
|
||||
- NSDate_Utils
|
||||
- NSString-Helper
|
||||
- nv-ios-http-status
|
||||
- PEAR-FileManager-iOS
|
||||
- PNObject (from `../`)
|
||||
- PureLayout
|
||||
- Specta
|
||||
- StrongestPasswordValidator
|
||||
- UIDevice-Utils
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
PNObject:
|
||||
@ -72,26 +95,28 @@ EXTERNAL SOURCES:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
|
||||
Bolts: ac6567323eac61e203f6a9763667d0f711be34c8
|
||||
Bolts: a0058fa3b331c5a1e4402d534f2dae36dbff31e4
|
||||
CocoaSecurity: d288a6f87e0f363823d2cb83e753814a6944f71a
|
||||
CodFis-Helper: 28be4c74d7202542459d72354f59b1215871de87
|
||||
DDDKeychainWrapper: e681a4daba6448786fa83b4941f58102a33b1897
|
||||
DJLocalization: 0c84029af375647d4104a42ae36be87194c46c47
|
||||
Expecta: 3b6bd90a64b9a1dcb0b70aa0e10a7f8f631667d5
|
||||
FBSDKCoreKit: 6f139173dc63a1deaff4430a55f2fe5bb222d2af
|
||||
FBSDKLoginKit: 56a057ca6822535ea0faa25f57a7c41edb697fd4
|
||||
FBSDKShareKit: 18a2cd118aef11dd657fe7e8b64bae5c719088b2
|
||||
NSDataAES: 967ea3337476a80e9838a533c25d570a06855ed0
|
||||
NSDate_Utils: c858a89da6e204ecf53aca48dbccb4da4d25bc9e
|
||||
DJLocalization: 55ab1d1ee4ac2eb3ec4e3a8a93145fd9d10ae6eb
|
||||
Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe
|
||||
Expecta+Snapshots: c343f410c7a6392f3e22e78f94c44b6c0749a516
|
||||
FBSDKCoreKit: d2aaed5e9ab7d8d6301c533376a1fbff1cf3deb5
|
||||
FBSDKLoginKit: 699ff169080e3072de4b9b0faca90bf23dc36deb
|
||||
FBSDKShareKit: 2fd887cce0056bdda91f99b2021d724a4fed8e88
|
||||
FBSnapshotTestCase: 366ecd378511d7716c79991cd8067d1eed23578d
|
||||
JRSwizzle: dd5ead5d913a0f29e7f558200165849f006bb1e3
|
||||
NACrypto: ce3900f1775f1b0cc27ce7c4953b94c598a74149
|
||||
NSDate_Utils: 68669d2c81f310ee13026c791f4f0ed227b94c65
|
||||
NSString-Helper: 459e1b6a62b3bf7db10f01b0d102548608e945c4
|
||||
NSUserDefaults-AESEncryptor: da02cfef056f1e18ebe2748767915f08b274c9c5
|
||||
nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f
|
||||
PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3
|
||||
PNObject: 8dc560680a7a48060ed309b019ca4fc41505cc07
|
||||
PureLayout: 4d550abe49a94f24c2808b9b95db9131685fe4cd
|
||||
RZDataBinding: 6981e90ddaae2f5e02028323b1043f8c31013109
|
||||
Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66
|
||||
PNObject: 9567f1c80c154eb17798e2b9f572a707c407d7b5
|
||||
PureLayout: f35f5384c9c4e4479df041dbe33ad7577b71ddfb
|
||||
RZDataBinding: 00d468ebe667f02c2bd5416f87b4b5d826188c4d
|
||||
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2
|
||||
StrongestPasswordValidator: 921e42615bdf353513c6f925bffd4fc29865dbd7
|
||||
UIDevice-Utils: ff37bd042127117572d6ce4c5ff074f4f54ab5ed
|
||||
UIDevice-Utils: a87bbaed53a74d503deb3e25511c9a4d865b92ea
|
||||
|
||||
PODFILE CHECKSUM: fcd5d1cf3426c7c9c5b3e5edcd4b8e5402ee7f2e
|
||||
|
||||
COCOAPODS: 1.3.1
|
||||
COCOAPODS: 0.39.0
|
||||
|
||||
@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/*!
|
||||
A block that will be called when a token is cancelled.
|
||||
*/
|
||||
typedef void(^BFCancellationBlock)(void);
|
||||
typedef void(^BFCancellationBlock)();
|
||||
|
||||
/*!
|
||||
The consumer view of a CancellationToken.
|
||||
|
||||
4
Example/Pods/Bolts/Bolts/Common/BFExecutor.h
generated
@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
Returns a new executor that uses the given block to execute continuations.
|
||||
@param block The block to use.
|
||||
*/
|
||||
+ (instancetype)executorWithBlock:(void(^)(void(^block)(void)))block;
|
||||
+ (instancetype)executorWithBlock:(void(^)(void(^block)()))block;
|
||||
|
||||
/*!
|
||||
Returns a new executor that runs continuations on the given queue.
|
||||
@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
Runs the given block using this executor's particular strategy.
|
||||
@param block The block to execute.
|
||||
*/
|
||||
- (void)execute:(void(^)(void))block;
|
||||
- (void)execute:(void(^)())block;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
20
Example/Pods/Bolts/Bolts/Common/BFExecutor.m
generated
@ -34,12 +34,12 @@ __attribute__((noinline)) static size_t remaining_stack_size(size_t *restrict to
|
||||
// NOTE: If the function is inlined, this value could be incorrect
|
||||
uint8_t *frameAddr = __builtin_frame_address(0);
|
||||
|
||||
return (*totalSize) - (size_t)(endStack - frameAddr);
|
||||
return (*totalSize) - (endStack - frameAddr);
|
||||
}
|
||||
|
||||
@interface BFExecutor ()
|
||||
|
||||
@property (nonatomic, copy) void(^block)(void(^block)(void));
|
||||
@property (nonatomic, copy) void(^block)(void(^block)());
|
||||
|
||||
@end
|
||||
|
||||
@ -51,7 +51,7 @@ __attribute__((noinline)) static size_t remaining_stack_size(size_t *restrict to
|
||||
static BFExecutor *defaultExecutor = NULL;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
defaultExecutor = [self executorWithBlock:^void(void(^block)(void)) {
|
||||
defaultExecutor = [self executorWithBlock:^void(void(^block)()) {
|
||||
// We prefer to run everything possible immediately, so that there is callstack information
|
||||
// when debugging. However, we don't want the stack to get too deep, so if the remaining stack space
|
||||
// is less than 10% of the total space, we dispatch to another GCD queue.
|
||||
@ -74,7 +74,7 @@ __attribute__((noinline)) static size_t remaining_stack_size(size_t *restrict to
|
||||
static BFExecutor *immediateExecutor = NULL;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
immediateExecutor = [self executorWithBlock:^void(void(^block)(void)) {
|
||||
immediateExecutor = [self executorWithBlock:^void(void(^block)()) {
|
||||
block();
|
||||
}];
|
||||
});
|
||||
@ -85,7 +85,7 @@ __attribute__((noinline)) static size_t remaining_stack_size(size_t *restrict to
|
||||
static BFExecutor *mainThreadExecutor = NULL;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
mainThreadExecutor = [self executorWithBlock:^void(void(^block)(void)) {
|
||||
mainThreadExecutor = [self executorWithBlock:^void(void(^block)()) {
|
||||
if (![NSThread isMainThread]) {
|
||||
dispatch_async(dispatch_get_main_queue(), block);
|
||||
} else {
|
||||
@ -98,25 +98,25 @@ __attribute__((noinline)) static size_t remaining_stack_size(size_t *restrict to
|
||||
return mainThreadExecutor;
|
||||
}
|
||||
|
||||
+ (instancetype)executorWithBlock:(void(^)(void(^block)(void)))block {
|
||||
+ (instancetype)executorWithBlock:(void(^)(void(^block)()))block {
|
||||
return [[self alloc] initWithBlock:block];
|
||||
}
|
||||
|
||||
+ (instancetype)executorWithDispatchQueue:(dispatch_queue_t)queue {
|
||||
return [self executorWithBlock:^void(void(^block)(void)) {
|
||||
return [self executorWithBlock:^void(void(^block)()) {
|
||||
dispatch_async(queue, block);
|
||||
}];
|
||||
}
|
||||
|
||||
+ (instancetype)executorWithOperationQueue:(NSOperationQueue *)queue {
|
||||
return [self executorWithBlock:^void(void(^block)(void)) {
|
||||
return [self executorWithBlock:^void(void(^block)()) {
|
||||
[queue addOperation:[NSBlockOperation blockOperationWithBlock:block]];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Initializer
|
||||
|
||||
- (instancetype)initWithBlock:(void(^)(void(^block)(void)))block {
|
||||
- (instancetype)initWithBlock:(void(^)(void(^block)()))block {
|
||||
self = [super init];
|
||||
if (!self) return self;
|
||||
|
||||
@ -127,7 +127,7 @@ __attribute__((noinline)) static size_t remaining_stack_size(size_t *restrict to
|
||||
|
||||
#pragma mark - Execution
|
||||
|
||||
- (void)execute:(void(^)(void))block {
|
||||
- (void)execute:(void(^)())block {
|
||||
self.block(block);
|
||||
}
|
||||
|
||||
|
||||
25
Example/Pods/Bolts/Bolts/Common/BFGeneric.h
generated
@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
This exists to use along with `BFTask` and `BFTaskCompletionSource`.
|
||||
|
||||
Instead of returning a `BFTask` with no generic type, or a generic type of 'NSNull'
|
||||
when there is no usable result from a task, we use the type 'BFVoid', which will always have a value of `nil`.
|
||||
|
||||
This allows you to provide a more enforced API contract to the caller,
|
||||
as sending any message to `BFVoid` will result in a compile time error.
|
||||
*/
|
||||
@class _BFVoid_Nonexistant;
|
||||
typedef _BFVoid_Nonexistant *BFVoid;
|
||||
71
Example/Pods/Bolts/Bolts/Common/BFTask.h
generated
@ -11,7 +11,6 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <Bolts/BFCancellationToken.h>
|
||||
#import <Bolts/BFGeneric.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@ -25,12 +24,23 @@ extern NSString *const BFTaskErrorDomain;
|
||||
*/
|
||||
extern NSInteger const kBFMultipleErrorsError;
|
||||
|
||||
/*!
|
||||
An exception that is thrown if there was multiple exceptions on <BFTask taskForCompletionOfAllTasks:>.
|
||||
*/
|
||||
extern NSString *const BFTaskMultipleExceptionsException;
|
||||
|
||||
/*!
|
||||
An error userInfo key used if there were multiple errors on <BFTask taskForCompletionOfAllTasks:>.
|
||||
Value type is `NSArray<NSError *> *`.
|
||||
*/
|
||||
extern NSString *const BFTaskMultipleErrorsUserInfoKey;
|
||||
|
||||
/*!
|
||||
An error userInfo key used if there were multiple exceptions on <BFTask taskForCompletionOfAllTasks:>.
|
||||
Value type is `NSArray<NSException *> *`.
|
||||
*/
|
||||
extern NSString *const BFTaskMultipleExceptionsUserInfoKey;
|
||||
|
||||
@class BFExecutor;
|
||||
@class BFTask;
|
||||
|
||||
@ -44,7 +54,7 @@ extern NSString *const BFTaskMultipleErrorsUserInfoKey;
|
||||
/*!
|
||||
A block that can act as a continuation for a task.
|
||||
*/
|
||||
typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *t);
|
||||
typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *task);
|
||||
|
||||
/*!
|
||||
Creates a task that is already completed with the given result.
|
||||
@ -58,6 +68,12 @@ typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *t);
|
||||
*/
|
||||
+ (instancetype)taskWithError:(NSError *)error;
|
||||
|
||||
/*!
|
||||
Creates a task that is already completed with the given exception.
|
||||
@param exception The exception for the task.
|
||||
*/
|
||||
+ (instancetype)taskWithException:(NSException *)exception;
|
||||
|
||||
/*!
|
||||
Creates a task that is already cancelled.
|
||||
*/
|
||||
@ -91,7 +107,7 @@ typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *t);
|
||||
@param millis The approximate number of milliseconds to wait before the
|
||||
task will be finished (with result == nil).
|
||||
*/
|
||||
+ (BFTask<BFVoid> *)taskWithDelay:(int)millis;
|
||||
+ (instancetype)taskWithDelay:(int)millis;
|
||||
|
||||
/*!
|
||||
Returns a task that will be completed a certain amount of time in the future.
|
||||
@ -99,7 +115,7 @@ typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *t);
|
||||
task will be finished (with result == nil).
|
||||
@param token The cancellation token (optional).
|
||||
*/
|
||||
+ (BFTask<BFVoid> *)taskWithDelay:(int)millis cancellationToken:(nullable BFCancellationToken *)token;
|
||||
+ (instancetype)taskWithDelay:(int)millis cancellationToken:(nullable BFCancellationToken *)token;
|
||||
|
||||
/*!
|
||||
Returns a task that will be completed after the given block completes with
|
||||
@ -111,7 +127,7 @@ typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *t);
|
||||
If block returns a BFTask, then the task returned from
|
||||
this method will not be completed until that task is completed.
|
||||
*/
|
||||
+ (instancetype)taskFromExecutor:(BFExecutor *)executor withBlock:(nullable id (^)(void))block;
|
||||
+ (instancetype)taskFromExecutor:(BFExecutor *)executor withBlock:(nullable id (^)())block;
|
||||
|
||||
// Properties that will be set on the task once it is completed.
|
||||
|
||||
@ -125,13 +141,18 @@ typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *t);
|
||||
*/
|
||||
@property (nullable, nonatomic, strong, readonly) NSError *error;
|
||||
|
||||
/*!
|
||||
The exception of a failed task.
|
||||
*/
|
||||
@property (nullable, nonatomic, strong, readonly) NSException *exception;
|
||||
|
||||
/*!
|
||||
Whether this task has been cancelled.
|
||||
*/
|
||||
@property (nonatomic, assign, readonly, getter=isCancelled) BOOL cancelled;
|
||||
|
||||
/*!
|
||||
Whether this task has completed due to an error.
|
||||
Whether this task has completed due to an error or exception.
|
||||
*/
|
||||
@property (nonatomic, assign, readonly, getter=isFaulted) BOOL faulted;
|
||||
|
||||
@ -151,7 +172,7 @@ typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *t);
|
||||
If block returns a BFTask, then the task returned from
|
||||
this method will not be completed until that task is completed.
|
||||
*/
|
||||
- (BFTask *)continueWithBlock:(BFContinuationBlock)block NS_SWIFT_NAME(continueWith(block:));
|
||||
- (BFTask *)continueWithBlock:(BFContinuationBlock)block;
|
||||
|
||||
/*!
|
||||
Enqueues the given block to be run once this task is complete.
|
||||
@ -165,8 +186,7 @@ typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *t);
|
||||
If block returns a BFTask, then the task returned from
|
||||
this method will not be completed until that task is completed.
|
||||
*/
|
||||
- (BFTask *)continueWithBlock:(BFContinuationBlock)block
|
||||
cancellationToken:(nullable BFCancellationToken *)cancellationToken NS_SWIFT_NAME(continueWith(block:cancellationToken:));
|
||||
- (BFTask *)continueWithBlock:(BFContinuationBlock)block cancellationToken:(nullable BFCancellationToken *)cancellationToken;
|
||||
|
||||
/*!
|
||||
Enqueues the given block to be run once this task is complete.
|
||||
@ -177,9 +197,7 @@ typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *t);
|
||||
If block returns a BFTask, then the task returned from
|
||||
this method will not be completed until that task is completed.
|
||||
*/
|
||||
- (BFTask *)continueWithExecutor:(BFExecutor *)executor
|
||||
withBlock:(BFContinuationBlock)block NS_SWIFT_NAME(continueWith(executor:block:));
|
||||
|
||||
- (BFTask *)continueWithExecutor:(BFExecutor *)executor withBlock:(BFContinuationBlock)block;
|
||||
/*!
|
||||
Enqueues the given block to be run once this task is complete.
|
||||
@param executor A BFExecutor responsible for determining how the
|
||||
@ -192,12 +210,11 @@ typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *t);
|
||||
*/
|
||||
- (BFTask *)continueWithExecutor:(BFExecutor *)executor
|
||||
block:(BFContinuationBlock)block
|
||||
cancellationToken:(nullable BFCancellationToken *)cancellationToken
|
||||
NS_SWIFT_NAME(continueWith(executor:block:cancellationToken:));
|
||||
cancellationToken:(nullable BFCancellationToken *)cancellationToken;
|
||||
|
||||
/*!
|
||||
Identical to continueWithBlock:, except that the block is only run
|
||||
if this task did not produce a cancellation or an error.
|
||||
if this task did not produce a cancellation, error, or exception.
|
||||
If it did, then the failure will be propagated to the returned
|
||||
task.
|
||||
@param block The block to be run once this task is complete.
|
||||
@ -205,11 +222,11 @@ NS_SWIFT_NAME(continueWith(executor:block:cancellationToken:));
|
||||
If block returns a BFTask, then the task returned from
|
||||
this method will not be completed until that task is completed.
|
||||
*/
|
||||
- (BFTask *)continueWithSuccessBlock:(BFContinuationBlock)block NS_SWIFT_NAME(continueOnSuccessWith(block:));
|
||||
- (BFTask *)continueWithSuccessBlock:(BFContinuationBlock)block;
|
||||
|
||||
/*!
|
||||
Identical to continueWithBlock:, except that the block is only run
|
||||
if this task did not produce a cancellation or an error.
|
||||
if this task did not produce a cancellation, error, or exception.
|
||||
If it did, then the failure will be propagated to the returned
|
||||
task.
|
||||
@param block The block to be run once this task is complete.
|
||||
@ -218,14 +235,13 @@ NS_SWIFT_NAME(continueWith(executor:block:cancellationToken:));
|
||||
If block returns a BFTask, then the task returned from
|
||||
this method will not be completed until that task is completed.
|
||||
*/
|
||||
- (BFTask *)continueWithSuccessBlock:(BFContinuationBlock)block
|
||||
cancellationToken:(nullable BFCancellationToken *)cancellationToken
|
||||
NS_SWIFT_NAME(continueOnSuccessWith(block:cancellationToken:));
|
||||
- (BFTask *)continueWithSuccessBlock:(BFContinuationBlock)block cancellationToken:(nullable BFCancellationToken *)cancellationToken;
|
||||
|
||||
/*!
|
||||
Identical to continueWithExecutor:withBlock:, except that the block
|
||||
is only run if this task did not produce a cancellation, error, or an error.
|
||||
If it did, then the failure will be propagated to the returned task.
|
||||
is only run if this task did not produce a cancellation, error, or
|
||||
exception. If it did, then the failure will be propagated to the
|
||||
returned task.
|
||||
@param executor A BFExecutor responsible for determining how the
|
||||
continuation block will be run.
|
||||
@param block The block to be run once this task is complete.
|
||||
@ -233,13 +249,13 @@ NS_SWIFT_NAME(continueOnSuccessWith(block:cancellationToken:));
|
||||
If block returns a BFTask, then the task returned from
|
||||
this method will not be completed until that task is completed.
|
||||
*/
|
||||
- (BFTask *)continueWithExecutor:(BFExecutor *)executor
|
||||
withSuccessBlock:(BFContinuationBlock)block NS_SWIFT_NAME(continueOnSuccessWith(executor:block:));
|
||||
- (BFTask *)continueWithExecutor:(BFExecutor *)executor withSuccessBlock:(BFContinuationBlock)block;
|
||||
|
||||
/*!
|
||||
Identical to continueWithExecutor:withBlock:, except that the block
|
||||
is only run if this task did not produce a cancellation or an error.
|
||||
If it did, then the failure will be propagated to the returned task.
|
||||
is only run if this task did not produce a cancellation, error, or
|
||||
exception. If it did, then the failure will be propagated to the
|
||||
returned task.
|
||||
@param executor A BFExecutor responsible for determining how the
|
||||
continuation block will be run.
|
||||
@param block The block to be run once this task is complete.
|
||||
@ -250,8 +266,7 @@ NS_SWIFT_NAME(continueOnSuccessWith(block:cancellationToken:));
|
||||
*/
|
||||
- (BFTask *)continueWithExecutor:(BFExecutor *)executor
|
||||
successBlock:(BFContinuationBlock)block
|
||||
cancellationToken:(nullable BFCancellationToken *)cancellationToken
|
||||
NS_SWIFT_NAME(continueOnSuccessWith(executor:block:cancellationToken:));
|
||||
cancellationToken:(nullable BFCancellationToken *)cancellationToken;
|
||||
|
||||
/*!
|
||||
Waits until this operation is completed.
|
||||
|
||||
112
Example/Pods/Bolts/Bolts/Common/BFTask.m
generated
@ -23,12 +23,15 @@ __attribute__ ((noinline)) void warnBlockingOperationOnMainThread() {
|
||||
|
||||
NSString *const BFTaskErrorDomain = @"bolts";
|
||||
NSInteger const kBFMultipleErrorsError = 80175001;
|
||||
NSString *const BFTaskMultipleExceptionsException = @"BFMultipleExceptionsException";
|
||||
|
||||
NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
NSString *const BFTaskMultipleExceptionsUserInfoKey = @"exceptions";
|
||||
|
||||
@interface BFTask () {
|
||||
id _result;
|
||||
NSError *_error;
|
||||
NSException *_exception;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign, readwrite, getter=isCancelled) BOOL cancelled;
|
||||
@ -56,7 +59,7 @@ NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithResult:(nullable id)result {
|
||||
- (instancetype)initWithResult:(id)result {
|
||||
self = [super init];
|
||||
if (!self) return self;
|
||||
|
||||
@ -74,6 +77,15 @@ NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithException:(NSException *)exception {
|
||||
self = [super init];
|
||||
if (!self) return self;
|
||||
|
||||
[self trySetException:exception];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initCancelled {
|
||||
self = [super init];
|
||||
if (!self) return self;
|
||||
@ -93,6 +105,10 @@ NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
return [[self alloc] initWithError:error];
|
||||
}
|
||||
|
||||
+ (instancetype)taskWithException:(NSException *)exception {
|
||||
return [[self alloc] initWithException:exception];
|
||||
}
|
||||
|
||||
+ (instancetype)cancelledTask {
|
||||
return [[self alloc] initCancelled];
|
||||
}
|
||||
@ -106,20 +122,35 @@ NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
__block int32_t cancelled = 0;
|
||||
NSObject *lock = [[NSObject alloc] init];
|
||||
NSMutableArray *errors = [NSMutableArray array];
|
||||
NSMutableArray *exceptions = [NSMutableArray array];
|
||||
|
||||
BFTaskCompletionSource *tcs = [BFTaskCompletionSource taskCompletionSource];
|
||||
for (BFTask *task in tasks) {
|
||||
[task continueWithBlock:^id(BFTask *t) {
|
||||
if (t.error) {
|
||||
[task continueWithBlock:^id(BFTask *task) {
|
||||
if (task.exception) {
|
||||
@synchronized (lock) {
|
||||
[errors addObject:t.error];
|
||||
[exceptions addObject:task.exception];
|
||||
}
|
||||
} else if (t.cancelled) {
|
||||
} else if (task.error) {
|
||||
@synchronized (lock) {
|
||||
[errors addObject:task.error];
|
||||
}
|
||||
} else if (task.cancelled) {
|
||||
OSAtomicIncrement32Barrier(&cancelled);
|
||||
}
|
||||
|
||||
if (OSAtomicDecrement32Barrier(&total) == 0) {
|
||||
if (errors.count > 0) {
|
||||
if (exceptions.count > 0) {
|
||||
if (exceptions.count == 1) {
|
||||
tcs.exception = [exceptions firstObject];
|
||||
} else {
|
||||
NSException *exception =
|
||||
[NSException exceptionWithName:BFTaskMultipleExceptionsException
|
||||
reason:@"There were multiple exceptions."
|
||||
userInfo:@{ BFTaskMultipleExceptionsUserInfoKey: exceptions }];
|
||||
tcs.exception = exception;
|
||||
}
|
||||
} else if (errors.count > 0) {
|
||||
if (errors.count == 1) {
|
||||
tcs.error = [errors firstObject];
|
||||
} else {
|
||||
@ -141,7 +172,7 @@ NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
}
|
||||
|
||||
+ (instancetype)taskForCompletionOfAllTasksWithResults:(nullable NSArray<BFTask *> *)tasks {
|
||||
return [[self taskForCompletionOfAllTasks:tasks] continueWithSuccessBlock:^id(BFTask * __unused task) {
|
||||
return [[self taskForCompletionOfAllTasks:tasks] continueWithSuccessBlock:^id(BFTask *task) {
|
||||
return [tasks valueForKey:@"result"];
|
||||
}];
|
||||
}
|
||||
@ -158,19 +189,24 @@ NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
|
||||
NSObject *lock = [NSObject new];
|
||||
NSMutableArray<NSError *> *errors = [NSMutableArray new];
|
||||
NSMutableArray<NSException *> *exceptions = [NSMutableArray new];
|
||||
|
||||
BFTaskCompletionSource *source = [BFTaskCompletionSource taskCompletionSource];
|
||||
for (BFTask *task in tasks) {
|
||||
[task continueWithBlock:^id(BFTask *t) {
|
||||
if (t.error != nil) {
|
||||
[task continueWithBlock:^id(BFTask *task) {
|
||||
if (task.exception != nil) {
|
||||
@synchronized(lock) {
|
||||
[errors addObject:t.error];
|
||||
[exceptions addObject:task.exception];
|
||||
}
|
||||
} else if (t.cancelled) {
|
||||
} else if (task.error != nil) {
|
||||
@synchronized(lock) {
|
||||
[errors addObject:task.error];
|
||||
}
|
||||
} else if (task.cancelled) {
|
||||
OSAtomicIncrement32Barrier(&cancelled);
|
||||
} else {
|
||||
if(OSAtomicCompareAndSwap32Barrier(0, 1, &completed)) {
|
||||
[source setResult:t.result];
|
||||
[source setResult:task.result];
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,6 +214,16 @@ NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
OSAtomicCompareAndSwap32Barrier(0, 1, &completed)) {
|
||||
if (cancelled > 0) {
|
||||
[source cancel];
|
||||
} else if (exceptions.count > 0) {
|
||||
if (exceptions.count == 1) {
|
||||
source.exception = exceptions.firstObject;
|
||||
} else {
|
||||
NSException *exception =
|
||||
[NSException exceptionWithName:BFTaskMultipleExceptionsException
|
||||
reason:@"There were multiple exceptions."
|
||||
userInfo:@{ @"exceptions": exceptions }];
|
||||
source.exception = exception;
|
||||
}
|
||||
} else if (errors.count > 0) {
|
||||
if (errors.count == 1) {
|
||||
source.error = errors.firstObject;
|
||||
@ -197,7 +243,7 @@ NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
}
|
||||
|
||||
|
||||
+ (BFTask<BFVoid> *)taskWithDelay:(int)millis {
|
||||
+ (instancetype)taskWithDelay:(int)millis {
|
||||
BFTaskCompletionSource *tcs = [BFTaskCompletionSource taskCompletionSource];
|
||||
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, millis * NSEC_PER_MSEC);
|
||||
dispatch_after(popTime, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){
|
||||
@ -206,7 +252,7 @@ NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
return tcs.task;
|
||||
}
|
||||
|
||||
+ (BFTask<BFVoid> *)taskWithDelay:(int)millis cancellationToken:(nullable BFCancellationToken *)token {
|
||||
+ (instancetype)taskWithDelay:(int)millis cancellationToken:(nullable BFCancellationToken *)token {
|
||||
if (token.cancellationRequested) {
|
||||
return [BFTask cancelledTask];
|
||||
}
|
||||
@ -223,7 +269,7 @@ NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
return tcs.task;
|
||||
}
|
||||
|
||||
+ (instancetype)taskFromExecutor:(BFExecutor *)executor withBlock:(nullable id (^)(void))block {
|
||||
+ (instancetype)taskFromExecutor:(BFExecutor *)executor withBlock:(nullable id (^)())block {
|
||||
return [[self taskWithResult:nil] continueWithExecutor:executor withBlock:^id(BFTask *task) {
|
||||
return block();
|
||||
}];
|
||||
@ -268,6 +314,25 @@ NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
}
|
||||
}
|
||||
|
||||
- (nullable NSException *)exception {
|
||||
@synchronized(self.lock) {
|
||||
return _exception;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)trySetException:(NSException *)exception {
|
||||
@synchronized(self.lock) {
|
||||
if (self.completed) {
|
||||
return NO;
|
||||
}
|
||||
self.completed = YES;
|
||||
self.faulted = YES;
|
||||
_exception = exception;
|
||||
[self runContinuations];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)isCancelled {
|
||||
@synchronized(self.lock) {
|
||||
return _cancelled;
|
||||
@ -303,7 +368,7 @@ NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
[self.condition lock];
|
||||
[self.condition broadcast];
|
||||
[self.condition unlock];
|
||||
for (void (^callback)(void) in self.callbacks) {
|
||||
for (void (^callback)() in self.callbacks) {
|
||||
callback();
|
||||
}
|
||||
[self.callbacks removeAllObjects];
|
||||
@ -328,12 +393,21 @@ NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
return;
|
||||
}
|
||||
|
||||
id result = block(self);
|
||||
id result = nil;
|
||||
@try {
|
||||
result = block(self);
|
||||
} @catch (NSException *exception) {
|
||||
tcs.exception = exception;
|
||||
return;
|
||||
}
|
||||
|
||||
if ([result isKindOfClass:[BFTask class]]) {
|
||||
|
||||
id (^setupWithTask) (BFTask *) = ^id(BFTask *task) {
|
||||
if (cancellationToken.cancellationRequested || task.cancelled) {
|
||||
[tcs cancel];
|
||||
} else if (task.exception) {
|
||||
tcs.exception = task.exception;
|
||||
} else if (task.error) {
|
||||
tcs.error = task.error;
|
||||
} else {
|
||||
@ -425,11 +499,7 @@ NSString *const BFTaskMultipleErrorsUserInfoKey = @"errors";
|
||||
}
|
||||
[self.condition lock];
|
||||
}
|
||||
// TODO: (nlutsenko) Restructure this to use Bolts-Swift thread access synchronization architecture
|
||||
// In the meantime, it's absolutely safe to get `_completed` aka an ivar, as long as it's a `BOOL` aka less than word size.
|
||||
while (!_completed) {
|
||||
[self.condition wait];
|
||||
}
|
||||
[self.condition unlock];
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class BFTask<__covariant ResultType>;
|
||||
@class BFTask<ResultType>;
|
||||
|
||||
/*!
|
||||
A BFTaskCompletionSource represents the producer side of tasks.
|
||||
@ -36,14 +36,21 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
Attempting to set this for a completed task will raise an exception.
|
||||
@param result The result of the task.
|
||||
*/
|
||||
- (void)setResult:(nullable ResultType)result NS_SWIFT_NAME(set(result:));
|
||||
- (void)setResult:(nullable ResultType)result;
|
||||
|
||||
/*!
|
||||
Completes the task by setting the error.
|
||||
Attempting to set this for a completed task will raise an exception.
|
||||
@param error The error for the task.
|
||||
*/
|
||||
- (void)setError:(NSError *)error NS_SWIFT_NAME(set(error:));
|
||||
- (void)setError:(NSError *)error;
|
||||
|
||||
/*!
|
||||
Completes the task by setting an exception.
|
||||
Attempting to set this for a completed task will raise an exception.
|
||||
@param exception The exception for the task.
|
||||
*/
|
||||
- (void)setException:(NSException *)exception;
|
||||
|
||||
/*!
|
||||
Completes the task by marking it as cancelled.
|
||||
@ -55,14 +62,21 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
Sets the result of the task if it wasn't already completed.
|
||||
@returns whether the new value was set.
|
||||
*/
|
||||
- (BOOL)trySetResult:(nullable ResultType)result NS_SWIFT_NAME(trySet(result:));
|
||||
- (BOOL)trySetResult:(nullable ResultType)result;
|
||||
|
||||
/*!
|
||||
Sets the error of the task if it wasn't already completed.
|
||||
@param error The error for the task.
|
||||
@returns whether the new value was set.
|
||||
*/
|
||||
- (BOOL)trySetError:(NSError *)error NS_SWIFT_NAME(trySet(error:));
|
||||
- (BOOL)trySetError:(NSError *)error;
|
||||
|
||||
/*!
|
||||
Sets the exception of the task if it wasn't already completed.
|
||||
@param exception The exception for the task.
|
||||
@returns whether the new value was set.
|
||||
*/
|
||||
- (BOOL)trySetException:(NSException *)exception;
|
||||
|
||||
/*!
|
||||
Sets the cancellation state of the task if it wasn't already completed.
|
||||
|
||||
@ -18,6 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (BOOL)trySetResult:(nullable id)result;
|
||||
- (BOOL)trySetError:(NSError *)error;
|
||||
- (BOOL)trySetException:(NSException *)exception;
|
||||
- (BOOL)trySetCancelled;
|
||||
|
||||
@end
|
||||
@ -55,6 +56,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setException:(NSException *)exception {
|
||||
if (![self.task trySetException:exception]) {
|
||||
[NSException raise:NSInternalInconsistencyException
|
||||
format:@"Cannot set the exception on a completed task."];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)cancel {
|
||||
if (![self.task trySetCancelled]) {
|
||||
[NSException raise:NSInternalInconsistencyException
|
||||
@ -70,6 +78,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
return [self.task trySetError:error];
|
||||
}
|
||||
|
||||
- (BOOL)trySetException:(NSException *)exception {
|
||||
return [self.task trySetException:exception];
|
||||
}
|
||||
|
||||
- (BOOL)trySetCancelled {
|
||||
return [self.task trySetCancelled];
|
||||
}
|
||||
|
||||
1
Example/Pods/Bolts/Bolts/Common/Bolts.h
generated
@ -12,7 +12,6 @@
|
||||
#import <Bolts/BFCancellationTokenRegistration.h>
|
||||
#import <Bolts/BFCancellationTokenSource.h>
|
||||
#import <Bolts/BFExecutor.h>
|
||||
#import <Bolts/BFGeneric.h>
|
||||
#import <Bolts/BFTask.h>
|
||||
#import <Bolts/BFTaskCompletionSource.h>
|
||||
|
||||
|
||||
2
Example/Pods/Bolts/Bolts/Common/Bolts.m
generated
@ -12,6 +12,6 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
NSString *const BoltsFrameworkVersionString = @"1.9.0";
|
||||
NSString *const BoltsFrameworkVersionString = @"1.7.0";
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
21
Example/Pods/Bolts/Bolts/iOS/BFAppLinkNavigation.h
generated
@ -33,7 +33,6 @@ typedef NS_ENUM(NSInteger, BFAppLinkNavigationType) {
|
||||
custom requests with additional navigation and app data attached to them by
|
||||
creating BFAppLinkNavigations themselves.
|
||||
*/
|
||||
NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension")
|
||||
@interface BFAppLinkNavigation : NSObject
|
||||
|
||||
/*!
|
||||
@ -58,12 +57,6 @@ NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension")
|
||||
extras:(NSDictionary *)extras
|
||||
appLinkData:(NSDictionary *)appLinkData;
|
||||
|
||||
/*!
|
||||
Creates an NSDictionary with the correct format for iOS callback URLs,
|
||||
to be used as 'appLinkData' argument in the call to navigationWithAppLink:extras:appLinkData:
|
||||
*/
|
||||
+ (NSDictionary *)callbackAppLinkDataForAppWithName:(NSString *)appName url:(NSString *)url;
|
||||
|
||||
/*! Performs the navigation */
|
||||
- (BFAppLinkNavigationType)navigate:(NSError **)error;
|
||||
|
||||
@ -76,20 +69,6 @@ NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension")
|
||||
/*! Navigates to a BFAppLink and returns whether it opened in-app or in-browser */
|
||||
+ (BFAppLinkNavigationType)navigateToAppLink:(BFAppLink *)link error:(NSError **)error;
|
||||
|
||||
/*!
|
||||
Returns a BFAppLinkNavigationType based on a BFAppLink.
|
||||
It's essentially a no-side-effect version of navigateToAppLink:error:,
|
||||
allowing apps to determine flow based on the link type (e.g. open an
|
||||
internal web view instead of going straight to the browser for regular links.)
|
||||
*/
|
||||
+ (BFAppLinkNavigationType)navigationTypeForLink:(BFAppLink *)link;
|
||||
|
||||
/*!
|
||||
Return navigation type for current instance.
|
||||
No-side-effect version of navigate:
|
||||
*/
|
||||
- (BFAppLinkNavigationType)navigationType;
|
||||
|
||||
/*! Navigates to a URL (an asynchronous action) and returns a BFNavigationType */
|
||||
+ (BFTask *)navigateToURLInBackground:(NSURL *)destination;
|
||||
|
||||
|
||||
43
Example/Pods/Bolts/Bolts/iOS/BFAppLinkNavigation.m
generated
@ -8,7 +8,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#import "BFAppLinkNavigation.h"
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import <Bolts/Bolts.h>
|
||||
|
||||
@ -20,9 +20,6 @@ FOUNDATION_EXPORT NSString *const BFAppLinkTargetKeyName;
|
||||
FOUNDATION_EXPORT NSString *const BFAppLinkUserAgentKeyName;
|
||||
FOUNDATION_EXPORT NSString *const BFAppLinkExtrasKeyName;
|
||||
FOUNDATION_EXPORT NSString *const BFAppLinkVersionKeyName;
|
||||
FOUNDATION_EXPORT NSString *const BFAppLinkRefererAppLink;
|
||||
FOUNDATION_EXPORT NSString *const BFAppLinkRefererAppName;
|
||||
FOUNDATION_EXPORT NSString *const BFAppLinkRefererUrl;
|
||||
|
||||
static id<BFAppLinkResolving> defaultResolver;
|
||||
|
||||
@ -46,10 +43,6 @@ static id<BFAppLinkResolving> defaultResolver;
|
||||
return navigation;
|
||||
}
|
||||
|
||||
+ (NSDictionary *)callbackAppLinkDataForAppWithName:(NSString *)appName url:(NSString *)url {
|
||||
return @{BFAppLinkRefererAppLink: @{BFAppLinkRefererAppName: appName, BFAppLinkRefererUrl: url}};
|
||||
}
|
||||
|
||||
- (NSString *)stringByEscapingQueryString:(NSString *)string {
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_0 || __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9
|
||||
return [string stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
|
||||
@ -236,40 +229,6 @@ static id<BFAppLinkResolving> defaultResolver;
|
||||
appLinkData:nil] navigate:error];
|
||||
}
|
||||
|
||||
+ (BFAppLinkNavigationType)navigationTypeForLink:(BFAppLink *)link {
|
||||
return [[self navigationWithAppLink:link extras:nil appLinkData:nil] navigationType];
|
||||
}
|
||||
|
||||
- (BFAppLinkNavigationType)navigationType {
|
||||
BFAppLinkTarget *eligibleTarget = nil;
|
||||
for (BFAppLinkTarget *target in self.appLink.targets) {
|
||||
if ([[UIApplication sharedApplication] canOpenURL:target.URL]) {
|
||||
eligibleTarget = target;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (eligibleTarget != nil) {
|
||||
NSURL *appLinkURL = [self appLinkURLWithTargetURL:eligibleTarget.URL error:nil];
|
||||
if (appLinkURL != nil) {
|
||||
return BFAppLinkNavigationTypeApp;
|
||||
} else {
|
||||
return BFAppLinkNavigationTypeFailure;
|
||||
}
|
||||
}
|
||||
|
||||
if (self.appLink.webURL != nil) {
|
||||
NSURL *appLinkURL = [self appLinkURLWithTargetURL:eligibleTarget.URL error:nil];
|
||||
if (appLinkURL != nil) {
|
||||
return BFAppLinkNavigationTypeBrowser;
|
||||
} else {
|
||||
return BFAppLinkNavigationTypeFailure;
|
||||
}
|
||||
}
|
||||
|
||||
return BFAppLinkNavigationTypeFailure;
|
||||
}
|
||||
|
||||
+ (id<BFAppLinkResolving>)defaultResolver {
|
||||
if (defaultResolver) {
|
||||
return defaultResolver;
|
||||
|
||||
@ -25,6 +25,6 @@
|
||||
@param url The URL to resolve into an App Link.
|
||||
@returns A BFTask that will return a BFAppLink for the given URL.
|
||||
*/
|
||||
- (BFTask *)appLinkFromURLInBackground:(NSURL *)url NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension");
|
||||
- (BFTask *)appLinkFromURLInBackground:(NSURL *)url;
|
||||
|
||||
@end
|
||||
|
||||
@ -40,7 +40,6 @@
|
||||
A controller class that implements default behavior for a BFAppLinkReturnToRefererView, including
|
||||
the ability to display the view above the navigation bar for navigation-based apps.
|
||||
*/
|
||||
NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension")
|
||||
@interface BFAppLinkReturnToRefererController : NSObject <BFAppLinkReturnToRefererViewDelegate>
|
||||
|
||||
/*!
|
||||
|
||||
@ -48,7 +48,6 @@ typedef NS_ENUM(NSUInteger, BFIncludeStatusBarInSize) {
|
||||
rather than navigating away. If the view is provided an App Link that does not contain
|
||||
referer data, it will have zero size and no UI will be displayed.
|
||||
*/
|
||||
NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension")
|
||||
@interface BFAppLinkReturnToRefererView : UIView
|
||||
|
||||
/*!
|
||||
|
||||
4
Example/Pods/Bolts/Bolts/iOS/BFURL.m
generated
@ -55,11 +55,11 @@
|
||||
NSString *refererAppName = refererAppLink[BFAppLinkRefererAppName];
|
||||
|
||||
if (refererURLString && refererAppName) {
|
||||
BFAppLinkTarget *appLinkTarget = [BFAppLinkTarget appLinkTargetWithURL:[NSURL URLWithString:refererURLString]
|
||||
BFAppLinkTarget *target = [BFAppLinkTarget appLinkTargetWithURL:[NSURL URLWithString:refererURLString]
|
||||
appStoreId:nil
|
||||
appName:refererAppName];
|
||||
_appLinkReferer = [BFAppLink appLinkWithSourceURL:[NSURL URLWithString:refererURLString]
|
||||
targets:@[ appLinkTarget ]
|
||||
targets:@[ target ]
|
||||
webURL:nil
|
||||
isBackToReferrer:YES];
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@ static NSString *const BFWebViewAppLinkResolverShouldFallbackKey = @"should_fall
|
||||
}];
|
||||
}
|
||||
|
||||
- (BFTask *)appLinkFromURLInBackground:(NSURL *)url NS_EXTENSION_UNAVAILABLE_IOS("") {
|
||||
- (BFTask *)appLinkFromURLInBackground:(NSURL *)url {
|
||||
return [[self followRedirects:url] continueWithExecutor:[BFExecutor mainThreadExecutor]
|
||||
withSuccessBlock:^id(BFTask *task) {
|
||||
NSData *responseData = task.result[@"data"];
|
||||
@ -200,7 +200,7 @@ static NSString *const BFWebViewAppLinkResolverShouldFallbackKey = @"should_fall
|
||||
continue;
|
||||
}
|
||||
NSMutableDictionary *root = al;
|
||||
for (NSUInteger i = 1; i < nameComponents.count; i++) {
|
||||
for (int i = 1; i < nameComponents.count; i++) {
|
||||
NSMutableArray *children = root[nameComponents[i]];
|
||||
if (!children) {
|
||||
children = [NSMutableArray array];
|
||||
@ -237,17 +237,26 @@ static NSString *const BFWebViewAppLinkResolverShouldFallbackKey = @"should_fall
|
||||
NSMutableArray *linkTargets = [NSMutableArray array];
|
||||
|
||||
NSArray *platformData = nil;
|
||||
|
||||
const UIUserInterfaceIdiom idiom = UI_USER_INTERFACE_IDIOM();
|
||||
if (idiom == UIUserInterfaceIdiomPad) {
|
||||
switch (UI_USER_INTERFACE_IDIOM()) {
|
||||
case UIUserInterfaceIdiomPad:
|
||||
platformData = @[ appLinkDict[BFWebViewAppLinkResolverIPadKey] ?: @{},
|
||||
appLinkDict[BFWebViewAppLinkResolverIOSKey] ?: @{} ];
|
||||
} else if (idiom == UIUserInterfaceIdiomPhone) {
|
||||
break;
|
||||
case UIUserInterfaceIdiomPhone:
|
||||
platformData = @[ appLinkDict[BFWebViewAppLinkResolverIPhoneKey] ?: @{},
|
||||
appLinkDict[BFWebViewAppLinkResolverIOSKey] ?: @{} ];
|
||||
} else {
|
||||
break;
|
||||
#ifdef __TVOS_9_0
|
||||
case UIUserInterfaceIdiomTV:
|
||||
#endif
|
||||
#ifdef __IPHONE_9_3
|
||||
case UIUserInterfaceIdiomCarPlay:
|
||||
#endif
|
||||
case UIUserInterfaceIdiomUnspecified:
|
||||
default:
|
||||
// Future-proofing. Other User Interface idioms should only hit ios.
|
||||
platformData = @[ appLinkDict[BFWebViewAppLinkResolverIOSKey] ?: @{} ];
|
||||
break;
|
||||
}
|
||||
|
||||
for (NSArray *platformObjects in platformData) {
|
||||
|
||||
85
Example/Pods/CocoaSecurity/CocoaSecurity/CocoaSecurity.h
generated
Normal file
@ -0,0 +1,85 @@
|
||||
/*
|
||||
CocoaSecurity 1.1
|
||||
|
||||
Created by Kelp on 12/5/12.
|
||||
Copyright (c) 2012 Kelp http://kelp.phate.org/
|
||||
MIT License
|
||||
|
||||
CocoaSecurity is core. It provides AES encrypt, AES decrypt, Hash(MD5, HmacMD5, SHA1~SHA512, HmacSHA1~HmacSHA512) messages.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Foundation/NSException.h>
|
||||
|
||||
|
||||
#pragma mark - CocoaSecurityResult
|
||||
@interface CocoaSecurityResult : NSObject
|
||||
|
||||
@property (strong, nonatomic, readonly) NSData *data;
|
||||
@property (strong, nonatomic, readonly) NSString *utf8String;
|
||||
@property (strong, nonatomic, readonly) NSString *hex;
|
||||
@property (strong, nonatomic, readonly) NSString *hexLower;
|
||||
@property (strong, nonatomic, readonly) NSString *base64;
|
||||
|
||||
- (id)initWithBytes:(unsigned char[])initData length:(NSUInteger)length;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
#pragma mark - CocoaSecurity
|
||||
@interface CocoaSecurity : NSObject
|
||||
#pragma mark - AES Encrypt
|
||||
+ (CocoaSecurityResult *)aesEncrypt:(NSString *)data key:(NSString *)key;
|
||||
+ (CocoaSecurityResult *)aesEncrypt:(NSString *)data hexKey:(NSString *)key hexIv:(NSString *)iv;
|
||||
+ (CocoaSecurityResult *)aesEncrypt:(NSString *)data key:(NSData *)key iv:(NSData *)iv;
|
||||
+ (CocoaSecurityResult *)aesEncryptWithData:(NSData *)data key:(NSData *)key iv:(NSData *)iv;
|
||||
#pragma mark AES Decrypt
|
||||
+ (CocoaSecurityResult *)aesDecryptWithBase64:(NSString *)data key:(NSString *)key;
|
||||
+ (CocoaSecurityResult *)aesDecryptWithBase64:(NSString *)data hexKey:(NSString *)key hexIv:(NSString *)iv;
|
||||
+ (CocoaSecurityResult *)aesDecryptWithBase64:(NSString *)data key:(NSData *)key iv:(NSData *)iv;
|
||||
+ (CocoaSecurityResult *)aesDecryptWithData:(NSData *)data key:(NSData *)key iv:(NSData *)iv;
|
||||
|
||||
#pragma mark - MD5
|
||||
+ (CocoaSecurityResult *)md5:(NSString *)hashString;
|
||||
+ (CocoaSecurityResult *)md5WithData:(NSData *)hashData;
|
||||
#pragma mark HMAC-MD5
|
||||
+ (CocoaSecurityResult *)hmacMd5:(NSString *)hashString hmacKey:(NSString *)key;
|
||||
+ (CocoaSecurityResult *)hmacMd5WithData:(NSData *)hashData hmacKey:(NSString *)key;
|
||||
|
||||
#pragma mark - SHA
|
||||
+ (CocoaSecurityResult *)sha1:(NSString *)hashString;
|
||||
+ (CocoaSecurityResult *)sha1WithData:(NSData *)hashData;
|
||||
+ (CocoaSecurityResult *)sha224:(NSString *)hashString;
|
||||
+ (CocoaSecurityResult *)sha224WithData:(NSData *)hashData;
|
||||
+ (CocoaSecurityResult *)sha256:(NSString *)hashString;
|
||||
+ (CocoaSecurityResult *)sha256WithData:(NSData *)hashData;
|
||||
+ (CocoaSecurityResult *)sha384:(NSString *)hashString;
|
||||
+ (CocoaSecurityResult *)sha384WithData:(NSData *)hashData;
|
||||
+ (CocoaSecurityResult *)sha512:(NSString *)hashString;
|
||||
+ (CocoaSecurityResult *)sha512WithData:(NSData *)hashData;
|
||||
#pragma mark HMAC-SHA
|
||||
+ (CocoaSecurityResult *)hmacSha1:(NSString *)hashString hmacKey:(NSString *)key;
|
||||
+ (CocoaSecurityResult *)hmacSha1WithData:(NSData *)hashData hmacKey:(NSString *)key;
|
||||
+ (CocoaSecurityResult *)hmacSha224:(NSString *)hashString hmacKey:(NSString *)key;
|
||||
+ (CocoaSecurityResult *)hmacSha224WithData:(NSData *)hashData hmacKey:(NSString *)key;
|
||||
+ (CocoaSecurityResult *)hmacSha256:(NSString *)hashString hmacKey:(NSString *)key;
|
||||
+ (CocoaSecurityResult *)hmacSha256WithData:(NSData *)hashData hmacKey:(NSString *)key;
|
||||
+ (CocoaSecurityResult *)hmacSha384:(NSString *)hashString hmacKey:(NSString *)key;
|
||||
+ (CocoaSecurityResult *)hmacSha384WithData:(NSData *)hashData hmacKey:(NSString *)key;
|
||||
+ (CocoaSecurityResult *)hmacSha512:(NSString *)hashString hmacKey:(NSString *)key;
|
||||
+ (CocoaSecurityResult *)hmacSha512WithData:(NSData *)hashData hmacKey:(NSString *)key;
|
||||
@end
|
||||
|
||||
|
||||
#pragma mark - CocoaSecurityEncoder
|
||||
@interface CocoaSecurityEncoder : NSObject
|
||||
- (NSString *)base64:(NSData *)data;
|
||||
- (NSString *)hex:(NSData *)data useLower:(BOOL)isOutputLower;
|
||||
@end
|
||||
|
||||
|
||||
#pragma mark - CocoaSecurityDecoder
|
||||
@interface CocoaSecurityDecoder : NSObject
|
||||
- (NSData *)base64:(NSString *)data;
|
||||
- (NSData *)hex:(NSString *)data;
|
||||
@end
|
||||
508
Example/Pods/CocoaSecurity/CocoaSecurity/CocoaSecurity.m
generated
Normal file
@ -0,0 +1,508 @@
|
||||
//
|
||||
// CocoaSecurity.m
|
||||
//
|
||||
// Created by Kelp on 12/5/12.
|
||||
// Copyright (c) 2012 Kelp http://kelp.phate.org/
|
||||
// MIT License
|
||||
//
|
||||
|
||||
#import "CocoaSecurity.h"
|
||||
#import <CommonCrypto/CommonHMAC.h>
|
||||
#import <CommonCrypto/CommonCryptor.h>
|
||||
#import "Base64.h"
|
||||
|
||||
#pragma mark - CocoaSecurity
|
||||
@implementation CocoaSecurity
|
||||
|
||||
|
||||
#pragma mark - AES Encrypt
|
||||
// default AES Encrypt, key -> SHA384(key).sub(0, 32), iv -> SHA384(key).sub(32, 16)
|
||||
+ (CocoaSecurityResult *)aesEncrypt:(NSString *)data key:(NSString *)key
|
||||
{
|
||||
CocoaSecurityResult * sha = [self sha384:key];
|
||||
NSData *aesKey = [sha.data subdataWithRange:NSMakeRange(0, 32)];
|
||||
NSData *aesIv = [sha.data subdataWithRange:NSMakeRange(32, 16)];
|
||||
|
||||
return [self aesEncrypt:data key:aesKey iv:aesIv];
|
||||
}
|
||||
#pragma mark AES Encrypt 128, 192, 256
|
||||
+ (CocoaSecurityResult *)aesEncrypt:(NSString *)data hexKey:(NSString *)key hexIv:(NSString *)iv
|
||||
{
|
||||
CocoaSecurityDecoder *decoder = [CocoaSecurityDecoder new];
|
||||
NSData *aesKey = [decoder hex:key];
|
||||
NSData *aesIv = [decoder hex:iv];
|
||||
|
||||
return [self aesEncrypt:data key:aesKey iv:aesIv];
|
||||
}
|
||||
+ (CocoaSecurityResult *)aesEncrypt:(NSString *)data key:(NSData *)key iv:(NSData *)iv
|
||||
{
|
||||
return [self aesEncryptWithData:[data dataUsingEncoding:NSUTF8StringEncoding] key:key iv:iv];
|
||||
}
|
||||
+ (CocoaSecurityResult *)aesEncryptWithData:(NSData *)data key:(NSData *)key iv:(NSData *)iv
|
||||
{
|
||||
// check length of key and iv
|
||||
if ([iv length] != 16) {
|
||||
@throw [NSException exceptionWithName:@"Cocoa Security"
|
||||
reason:@"Length of iv is wrong. Length of iv should be 16(128bits)"
|
||||
userInfo:nil];
|
||||
}
|
||||
if ([key length] != 16 && [key length] != 24 && [key length] != 32 ) {
|
||||
@throw [NSException exceptionWithName:@"Cocoa Security"
|
||||
reason:@"Length of key is wrong. Length of iv should be 16, 24 or 32(128, 192 or 256bits)"
|
||||
userInfo:nil];
|
||||
}
|
||||
|
||||
// setup output buffer
|
||||
size_t bufferSize = [data length] + kCCBlockSizeAES128;
|
||||
void *buffer = malloc(bufferSize);
|
||||
|
||||
// do encrypt
|
||||
size_t encryptedSize = 0;
|
||||
CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt,
|
||||
kCCAlgorithmAES128,
|
||||
kCCOptionPKCS7Padding,
|
||||
[key bytes], // Key
|
||||
[key length], // kCCKeySizeAES
|
||||
[iv bytes], // IV
|
||||
[data bytes],
|
||||
[data length],
|
||||
buffer,
|
||||
bufferSize,
|
||||
&encryptedSize);
|
||||
if (cryptStatus == kCCSuccess) {
|
||||
CocoaSecurityResult *result = [[CocoaSecurityResult alloc] initWithBytes:buffer length:encryptedSize];
|
||||
free(buffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
free(buffer);
|
||||
@throw [NSException exceptionWithName:@"Cocoa Security"
|
||||
reason:@"Encrypt Error!"
|
||||
userInfo:nil];
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
#pragma mark - AES Decrypt
|
||||
// default AES Decrypt, key -> SHA384(key).sub(0, 32), iv -> SHA384(key).sub(32, 16)
|
||||
+ (CocoaSecurityResult *)aesDecryptWithBase64:(NSString *)data key:(NSString *)key
|
||||
{
|
||||
CocoaSecurityResult * sha = [self sha384:key];
|
||||
NSData *aesKey = [sha.data subdataWithRange:NSMakeRange(0, 32)];
|
||||
NSData *aesIv = [sha.data subdataWithRange:NSMakeRange(32, 16)];
|
||||
|
||||
return [self aesDecryptWithBase64:data key:aesKey iv:aesIv];
|
||||
}
|
||||
#pragma mark AES Decrypt 128, 192, 256
|
||||
+ (CocoaSecurityResult *)aesDecryptWithBase64:(NSString *)data hexKey:(NSString *)key hexIv:(NSString *)iv
|
||||
{
|
||||
CocoaSecurityDecoder *decoder = [CocoaSecurityDecoder new];
|
||||
NSData *aesKey = [decoder hex:key];
|
||||
NSData *aesIv = [decoder hex:iv];
|
||||
|
||||
return [self aesDecryptWithBase64:data key:aesKey iv:aesIv];
|
||||
}
|
||||
+ (CocoaSecurityResult *)aesDecryptWithBase64:(NSString *)data key:(NSData *)key iv:(NSData *)iv
|
||||
{
|
||||
CocoaSecurityDecoder *decoder = [CocoaSecurityDecoder new];
|
||||
return [self aesDecryptWithData:[decoder base64:data] key:key iv:iv];
|
||||
}
|
||||
+ (CocoaSecurityResult *)aesDecryptWithData:(NSData *)data key:(NSData *)key iv:(NSData *)iv
|
||||
{
|
||||
// check length of key and iv
|
||||
if ([iv length] != 16) {
|
||||
@throw [NSException exceptionWithName:@"Cocoa Security"
|
||||
reason:@"Length of iv is wrong. Length of iv should be 16(128bits)"
|
||||
userInfo:nil];
|
||||
}
|
||||
if ([key length] != 16 && [key length] != 24 && [key length] != 32 ) {
|
||||
@throw [NSException exceptionWithName:@"Cocoa Security"
|
||||
reason:@"Length of key is wrong. Length of iv should be 16, 24 or 32(128, 192 or 256bits)"
|
||||
userInfo:nil];
|
||||
}
|
||||
|
||||
// setup output buffer
|
||||
size_t bufferSize = [data length] + kCCBlockSizeAES128;
|
||||
void *buffer = malloc(bufferSize);
|
||||
|
||||
// do encrypt
|
||||
size_t encryptedSize = 0;
|
||||
CCCryptorStatus cryptStatus = CCCrypt(kCCDecrypt,
|
||||
kCCAlgorithmAES128,
|
||||
kCCOptionPKCS7Padding,
|
||||
[key bytes], // Key
|
||||
[key length], // kCCKeySizeAES
|
||||
[iv bytes], // IV
|
||||
[data bytes],
|
||||
[data length],
|
||||
buffer,
|
||||
bufferSize,
|
||||
&encryptedSize);
|
||||
if (cryptStatus == kCCSuccess) {
|
||||
CocoaSecurityResult *result = [[CocoaSecurityResult alloc] initWithBytes:buffer length:encryptedSize];
|
||||
free(buffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
free(buffer);
|
||||
@throw [NSException exceptionWithName:@"Cocoa Security"
|
||||
reason:@"Decrypt Error!"
|
||||
userInfo:nil];
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - MD5
|
||||
+ (CocoaSecurityResult *)md5:(NSString *)hashString
|
||||
{
|
||||
return [self md5WithData:[hashString dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
}
|
||||
+ (CocoaSecurityResult *)md5WithData:(NSData *)hashData
|
||||
{
|
||||
unsigned char *digest;
|
||||
digest = malloc(CC_MD5_DIGEST_LENGTH);
|
||||
|
||||
CC_MD5([hashData bytes], (CC_LONG)[hashData length], digest);
|
||||
CocoaSecurityResult *result = [[CocoaSecurityResult alloc] initWithBytes:digest length:CC_MD5_DIGEST_LENGTH];
|
||||
free(digest);
|
||||
|
||||
return result;
|
||||
}
|
||||
#pragma mark - HMAC-MD5
|
||||
+ (CocoaSecurityResult *)hmacMd5:(NSString *)hashString hmacKey:(NSString *)key
|
||||
{
|
||||
return [self hmacMd5WithData:[hashString dataUsingEncoding:NSUTF8StringEncoding] hmacKey:key];
|
||||
}
|
||||
+ (CocoaSecurityResult *)hmacMd5WithData:(NSData *)hashData hmacKey:(NSString *)key
|
||||
{
|
||||
unsigned char *digest;
|
||||
digest = malloc(CC_MD5_DIGEST_LENGTH);
|
||||
const char *cKey = [key cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
CCHmac(kCCHmacAlgMD5, cKey, strlen(cKey), [hashData bytes], [hashData length], digest);
|
||||
CocoaSecurityResult *result = [[CocoaSecurityResult alloc] initWithBytes:digest length:CC_MD5_DIGEST_LENGTH];
|
||||
free(digest);
|
||||
cKey = nil;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - SHA1
|
||||
+ (CocoaSecurityResult *)sha1:(NSString *)hashString
|
||||
{
|
||||
return [self sha1WithData:[hashString dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
}
|
||||
+ (CocoaSecurityResult *)sha1WithData:(NSData *)hashData
|
||||
{
|
||||
unsigned char *digest;
|
||||
digest = malloc(CC_SHA1_DIGEST_LENGTH);
|
||||
|
||||
CC_SHA1([hashData bytes], (CC_LONG)[hashData length], digest);
|
||||
CocoaSecurityResult *result = [[CocoaSecurityResult alloc] initWithBytes:digest length:CC_SHA1_DIGEST_LENGTH];
|
||||
free(digest);
|
||||
|
||||
return result;
|
||||
}
|
||||
#pragma mark SHA224
|
||||
+ (CocoaSecurityResult *)sha224:(NSString *)hashString
|
||||
{
|
||||
return [self sha224WithData:[hashString dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
}
|
||||
+ (CocoaSecurityResult *)sha224WithData:(NSData *)hashData
|
||||
{
|
||||
unsigned char *digest;
|
||||
digest = malloc(CC_SHA224_DIGEST_LENGTH);
|
||||
|
||||
CC_SHA224([hashData bytes], (CC_LONG)[hashData length], digest);
|
||||
CocoaSecurityResult *result = [[CocoaSecurityResult alloc] initWithBytes:digest length:CC_SHA224_DIGEST_LENGTH];
|
||||
free(digest);
|
||||
|
||||
return result;
|
||||
}
|
||||
#pragma mark SHA256
|
||||
+ (CocoaSecurityResult *)sha256:(NSString *)hashString
|
||||
{
|
||||
return [self sha256WithData:[hashString dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
}
|
||||
+ (CocoaSecurityResult *)sha256WithData:(NSData *)hashData
|
||||
{
|
||||
unsigned char *digest;
|
||||
digest = malloc(CC_SHA256_DIGEST_LENGTH);
|
||||
|
||||
CC_SHA256([hashData bytes], (CC_LONG)[hashData length], digest);
|
||||
CocoaSecurityResult *result = [[CocoaSecurityResult alloc] initWithBytes:digest length:CC_SHA256_DIGEST_LENGTH];
|
||||
free(digest);
|
||||
|
||||
return result;
|
||||
}
|
||||
#pragma mark SHA384
|
||||
+ (CocoaSecurityResult *)sha384:(NSString *)hashString
|
||||
{
|
||||
return [self sha384WithData:[hashString dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
}
|
||||
+ (CocoaSecurityResult *)sha384WithData:(NSData *)hashData
|
||||
{
|
||||
unsigned char *digest;
|
||||
digest = malloc(CC_SHA384_DIGEST_LENGTH);
|
||||
|
||||
CC_SHA384([hashData bytes], (CC_LONG)[hashData length], digest);
|
||||
CocoaSecurityResult *result = [[CocoaSecurityResult alloc] initWithBytes:digest length:CC_SHA384_DIGEST_LENGTH];
|
||||
free(digest);
|
||||
|
||||
return result;
|
||||
}
|
||||
#pragma mark SHA512
|
||||
+ (CocoaSecurityResult *)sha512:(NSString *)hashString
|
||||
{
|
||||
return [self sha512WithData:[hashString dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
}
|
||||
+ (CocoaSecurityResult *)sha512WithData:(NSData *)hashData
|
||||
{
|
||||
unsigned char *digest;
|
||||
digest = malloc(CC_SHA512_DIGEST_LENGTH);
|
||||
|
||||
CC_SHA512([hashData bytes], (CC_LONG)[hashData length], digest);
|
||||
CocoaSecurityResult *result = [[CocoaSecurityResult alloc] initWithBytes:digest length:CC_SHA512_DIGEST_LENGTH];
|
||||
free(digest);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - HMAC-SHA1
|
||||
+ (CocoaSecurityResult *)hmacSha1:(NSString *)hashString hmacKey:(NSString *)key
|
||||
{
|
||||
return [self hmacSha1WithData:[hashString dataUsingEncoding:NSUTF8StringEncoding] hmacKey:key];
|
||||
}
|
||||
+ (CocoaSecurityResult *)hmacSha1WithData:(NSData *)hashData hmacKey:(NSString *)key
|
||||
{
|
||||
unsigned char *digest;
|
||||
digest = malloc(CC_SHA1_DIGEST_LENGTH);
|
||||
const char *cKey = [key cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
CCHmac(kCCHmacAlgSHA1, cKey, strlen(cKey), [hashData bytes], [hashData length], digest);
|
||||
CocoaSecurityResult *result = [[CocoaSecurityResult alloc] initWithBytes:digest length:CC_SHA1_DIGEST_LENGTH];
|
||||
free(digest);
|
||||
cKey = nil;
|
||||
|
||||
return result;
|
||||
}
|
||||
#pragma mark HMAC-SHA224
|
||||
+ (CocoaSecurityResult *)hmacSha224:(NSString *)hashString hmacKey:(NSString *)key
|
||||
{
|
||||
return [self hmacSha224WithData:[hashString dataUsingEncoding:NSUTF8StringEncoding] hmacKey:key];
|
||||
}
|
||||
+ (CocoaSecurityResult *)hmacSha224WithData:(NSData *)hashData hmacKey:(NSString *)key
|
||||
{
|
||||
unsigned char *digest;
|
||||
digest = malloc(CC_SHA224_DIGEST_LENGTH);
|
||||
const char *cKey = [key cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
CCHmac(kCCHmacAlgSHA224, cKey, strlen(cKey), [hashData bytes], [hashData length], digest);
|
||||
CocoaSecurityResult *result = [[CocoaSecurityResult alloc] initWithBytes:digest length:CC_SHA224_DIGEST_LENGTH];
|
||||
free(digest);
|
||||
cKey = nil;
|
||||
|
||||
return result;
|
||||
}
|
||||
#pragma mark HMAC-SHA256
|
||||
+ (CocoaSecurityResult *)hmacSha256:(NSString *)hashString hmacKey:(NSString *)key
|
||||
{
|
||||
return [self hmacSha256WithData:[hashString dataUsingEncoding:NSUTF8StringEncoding] hmacKey:key];
|
||||
}
|
||||
+ (CocoaSecurityResult *)hmacSha256WithData:(NSData *)hashData hmacKey:(NSString *)key
|
||||
{
|
||||
unsigned char *digest;
|
||||
digest = malloc(CC_SHA256_DIGEST_LENGTH);
|
||||
const char *cKey = [key cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
CCHmac(kCCHmacAlgSHA256, cKey, strlen(cKey), [hashData bytes], [hashData length], digest);
|
||||
CocoaSecurityResult *result = [[CocoaSecurityResult alloc] initWithBytes:digest length:CC_SHA256_DIGEST_LENGTH];
|
||||
free(digest);
|
||||
cKey = nil;
|
||||
|
||||
return result;
|
||||
}
|
||||
#pragma mark HMAC-SHA384
|
||||
+ (CocoaSecurityResult *)hmacSha384:(NSString *)hashString hmacKey:(NSString *)key
|
||||
{
|
||||
return [self hmacSha384WithData:[hashString dataUsingEncoding:NSUTF8StringEncoding] hmacKey:key];
|
||||
}
|
||||
+ (CocoaSecurityResult *)hmacSha384WithData:(NSData *)hashData hmacKey:(NSString *)key
|
||||
{
|
||||
unsigned char *digest;
|
||||
digest = malloc(CC_SHA384_DIGEST_LENGTH);
|
||||
const char *cKey = [key cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
CCHmac(kCCHmacAlgSHA384, cKey, strlen(cKey), [hashData bytes], [hashData length], digest);
|
||||
CocoaSecurityResult *result = [[CocoaSecurityResult alloc] initWithBytes:digest length:CC_SHA384_DIGEST_LENGTH];
|
||||
free(digest);
|
||||
cKey = nil;
|
||||
|
||||
return result;
|
||||
}
|
||||
#pragma mark HMAC-SHA512
|
||||
+ (CocoaSecurityResult *)hmacSha512:(NSString *)hashString hmacKey:(NSString *)key
|
||||
{
|
||||
return [self hmacSha512WithData:[hashString dataUsingEncoding:NSUTF8StringEncoding] hmacKey:key];
|
||||
}
|
||||
+ (CocoaSecurityResult *)hmacSha512WithData:(NSData *)hashData hmacKey:(NSString *)key
|
||||
{
|
||||
unsigned char *digest;
|
||||
digest = malloc(CC_SHA512_DIGEST_LENGTH);
|
||||
const char *cKey = [key cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
CCHmac(kCCHmacAlgSHA512, cKey, strlen(cKey), [hashData bytes], [hashData length], digest);
|
||||
CocoaSecurityResult *result = [[CocoaSecurityResult alloc] initWithBytes:digest length:CC_SHA512_DIGEST_LENGTH];
|
||||
free(digest);
|
||||
cKey = nil;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
#pragma mark - CocoaSecurityResult
|
||||
@implementation CocoaSecurityResult
|
||||
|
||||
@synthesize data = _data;
|
||||
|
||||
#pragma mark - Init
|
||||
- (id)initWithBytes:(unsigned char[])initData length:(NSUInteger)length
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_data = [NSData dataWithBytes:initData length:length];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark UTF8 String
|
||||
// convert CocoaSecurityResult to UTF8 string
|
||||
- (NSString *)utf8String
|
||||
{
|
||||
NSString *result = [[NSString alloc] initWithData:_data encoding:NSUTF8StringEncoding];
|
||||
return result;
|
||||
}
|
||||
|
||||
#pragma mark HEX
|
||||
// convert CocoaSecurityResult to HEX string
|
||||
- (NSString *)hex
|
||||
{
|
||||
CocoaSecurityEncoder *encoder = [CocoaSecurityEncoder new];
|
||||
return [encoder hex:_data useLower:false];
|
||||
}
|
||||
- (NSString *)hexLower
|
||||
{
|
||||
CocoaSecurityEncoder *encoder = [CocoaSecurityEncoder new];
|
||||
return [encoder hex:_data useLower:true];
|
||||
}
|
||||
|
||||
#pragma mark Base64
|
||||
// convert CocoaSecurityResult to Base64 string
|
||||
- (NSString *)base64
|
||||
{
|
||||
CocoaSecurityEncoder *encoder = [CocoaSecurityEncoder new];
|
||||
return [encoder base64:_data];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
#pragma mark - CocoaSecurityEncoder
|
||||
@implementation CocoaSecurityEncoder
|
||||
|
||||
// convert NSData to Base64
|
||||
- (NSString *)base64:(NSData *)data
|
||||
{
|
||||
return [data base64EncodedString];
|
||||
}
|
||||
|
||||
// convert NSData to hex string
|
||||
- (NSString *)hex:(NSData *)data useLower:(BOOL)isOutputLower
|
||||
{
|
||||
if (data.length == 0) { return nil; }
|
||||
|
||||
static const char HexEncodeCharsLower[] = "0123456789abcdef";
|
||||
static const char HexEncodeChars[] = "0123456789ABCDEF";
|
||||
char *resultData;
|
||||
// malloc result data
|
||||
resultData = malloc([data length] * 2 +1);
|
||||
// convert imgData(NSData) to char[]
|
||||
unsigned char *sourceData = ((unsigned char *)[data bytes]);
|
||||
NSUInteger length = [data length];
|
||||
|
||||
if (isOutputLower) {
|
||||
for (NSUInteger index = 0; index < length; index++) {
|
||||
// set result data
|
||||
resultData[index * 2] = HexEncodeCharsLower[(sourceData[index] >> 4)];
|
||||
resultData[index * 2 + 1] = HexEncodeCharsLower[(sourceData[index] % 0x10)];
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (NSUInteger index = 0; index < length; index++) {
|
||||
// set result data
|
||||
resultData[index * 2] = HexEncodeChars[(sourceData[index] >> 4)];
|
||||
resultData[index * 2 + 1] = HexEncodeChars[(sourceData[index] % 0x10)];
|
||||
}
|
||||
}
|
||||
resultData[[data length] * 2] = 0;
|
||||
|
||||
// convert result(char[]) to NSString
|
||||
NSString *result = [NSString stringWithCString:resultData encoding:NSASCIIStringEncoding];
|
||||
sourceData = nil;
|
||||
free(resultData);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - CocoaSecurityDecoder
|
||||
@implementation CocoaSecurityDecoder
|
||||
- (NSData *)base64:(NSString *)string
|
||||
{
|
||||
return [NSData dataWithBase64EncodedString:string];
|
||||
}
|
||||
- (NSData *)hex:(NSString *)data
|
||||
{
|
||||
if (data.length == 0) { return nil; }
|
||||
|
||||
static const unsigned char HexDecodeChars[] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, //49
|
||||
2, 3, 4, 5, 6, 7, 8, 9, 0, 0, //59
|
||||
0, 0, 0, 0, 0, 10, 11, 12, 13, 14,
|
||||
15, 0, 0, 0, 0, 0, 0, 0, 0, 0, //79
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 10, 11, 12, //99
|
||||
13, 14, 15
|
||||
};
|
||||
|
||||
// convert data(NSString) to CString
|
||||
const char *source = [data cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
// malloc buffer
|
||||
unsigned char *buffer;
|
||||
NSUInteger length = strlen(source) / 2;
|
||||
buffer = malloc(length);
|
||||
for (NSUInteger index = 0; index < length; index++) {
|
||||
buffer[index] = (HexDecodeChars[source[index * 2]] << 4) + (HexDecodeChars[source[index * 2 + 1]]);
|
||||
}
|
||||
// init result NSData
|
||||
NSData *result = [NSData dataWithBytes:buffer length:length];
|
||||
free(buffer);
|
||||
source = nil;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
8
Example/Pods/CocoaSecurity/LICENSE
generated
Normal file
@ -0,0 +1,8 @@
|
||||
The MIT License (MIT)
|
||||
Copyright (c) 2013 Kelp https://github.com/kelp404
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
111
Example/Pods/CocoaSecurity/README.md
generated
Normal file
@ -0,0 +1,111 @@
|
||||
#CocoaSecurity [](http://travis-ci.org/#!/kelp404/CocoaSecurity)
|
||||
|
||||
Kelp https://twitter.com/kelp404/
|
||||
[MIT License][mit]
|
||||
[MIT]: http://www.opensource.org/licenses/mit-license.php
|
||||
|
||||
|
||||
CocoaSecurity include 4 classes, `CocoaSecurity`, `CocoaSecurityResult`, `CocoaSecurityEncoder` and `CocoaSecurityDecoder`.
|
||||
|
||||
##CocoaSecurity
|
||||
CocoaSecurity is core. It provides AES encrypt, AES decrypt, Hash(MD5, HmacMD5, SHA1~SHA512, HmacSHA1~HmacSHA512) messages.
|
||||
|
||||
**MD5:**
|
||||
```objective-c
|
||||
CocoaSecurityResult *md5 = [CocoaSecurity md5:@"kelp"];
|
||||
|
||||
// md5.hex = 'C40C69779E15780ADAE46C45EB451E23'
|
||||
// md5.hexLower = 'c40c69779e15780adae46c45eb451e23'
|
||||
// md5.base64 = 'xAxpd54VeAra5GxF60UeIw=='
|
||||
```
|
||||
**SHA256:**
|
||||
```objective-c
|
||||
CocoaSecurityResult *sha256 = [CocoaSecurity sha256:@"kelp"];
|
||||
|
||||
// sha256.hexLower = '280f8bb8c43d532f389ef0e2a5321220b0782b065205dcdfcb8d8f02ed5115b9'
|
||||
// sha256.base64 = 'KA+LuMQ9Uy84nvDipTISILB4KwZSBdzfy42PAu1RFbk='
|
||||
```
|
||||
**default AES Encrypt:**<br/>
|
||||
key -> SHA384(key).sub(0, 32)<br/>
|
||||
iv -> SHA384(key).sub(32, 16)
|
||||
```objective-c
|
||||
CocoaSecurityResult *aesDefault = [CocoaSecurity aesEncrypt:@"kelp" key:@"key"];
|
||||
|
||||
// aesDefault.base64 = 'ez9uubPneV1d2+rpjnabJw=='
|
||||
```
|
||||
**AES256 Encrypt & Decrypt:**
|
||||
```objective-c
|
||||
CocoaSecurityResult *aes256 = [CocoaSecurity aesEncrypt:@"kelp"
|
||||
hexKey:@"280f8bb8c43d532f389ef0e2a5321220b0782b065205dcdfcb8d8f02ed5115b9"
|
||||
hexIv:@"CC0A69779E15780ADAE46C45EB451A23"];
|
||||
// aes256.base64 = 'WQYg5qvcGyCBY3IF0hPsoQ=='
|
||||
|
||||
CocoaSecurityResult *aes256Decrypt = [CocoaSecurity aesDecryptWithBase64:@"WQYg5qvcGyCBY3IF0hPsoQ=="
|
||||
hexKey:@"280f8bb8c43d532f389ef0e2a5321220b0782b065205dcdfcb8d8f02ed5115b9"
|
||||
hexIv:@"CC0A69779E15780ADAE46C45EB451A23"];
|
||||
// aes256Decrypt.utf8String = 'kelp'
|
||||
```
|
||||
|
||||
|
||||
##CocoaSecurityResult
|
||||
CocoaSecurityResult is the result class of CocoaSecurity. It provides convert result data to NSData, NSString, HEX string, Base64 string.
|
||||
|
||||
```objective-c
|
||||
@property (strong, nonatomic, readonly) NSData *data;
|
||||
@property (strong, nonatomic, readonly) NSString *utf8String;
|
||||
@property (strong, nonatomic, readonly) NSString *hex;
|
||||
@property (strong, nonatomic, readonly) NSString *hexLower;
|
||||
@property (strong, nonatomic, readonly) NSString *base64;
|
||||
```
|
||||
|
||||
|
||||
##CocoaSecurityEncoder
|
||||
CocoaSecurityEncoder provides convert NSData to HEX string, Base64 string.
|
||||
|
||||
```objective-c
|
||||
- (NSString *)base64:(NSData *)data;
|
||||
- (NSString *)hex:(NSData *)data useLower:(BOOL)isOutputLower;
|
||||
```
|
||||
**example:**
|
||||
```objective-c
|
||||
CocoaSecurityEncoder *encoder = [CocoaSecurityEncoder new];
|
||||
NSString *str1 = [encoder hex:[@"kelp" dataUsingEncoding:NSUTF8StringEncoding] useLower:NO];
|
||||
// str1 = '6B656C70'
|
||||
NSString *str2 = [encoder base64:[@"kelp" dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
// str2 = 'a2VscA=='
|
||||
```
|
||||
|
||||
##CocoaSecurityDecoder
|
||||
CocoaSecurityEncoder provides convert HEX string or Base64 string to NSData.
|
||||
|
||||
```objective-c
|
||||
- (NSData *)base64:(NSString *)data;
|
||||
- (NSData *)hex:(NSString *)data;
|
||||
```
|
||||
**example:**
|
||||
```objective-c
|
||||
CocoaSecurityDecoder *decoder = [CocoaSecurityDecoder new];
|
||||
NSData *data1 = [decoder hex:@"CC0A69779E15780ADAE46C45EB451A23"];
|
||||
// data1 = <cc0a6977 9e15780a dae46c45 eb451a23>
|
||||
NSData *data2 = [decoder base64:@"zT1PS64MnXIUDCUiy13RRg=="];
|
||||
// data2 = <cd3d4f4b ae0c9d72 140c2522 cb5dd146>
|
||||
```
|
||||
|
||||
|
||||
##Installation
|
||||
1. **git:**
|
||||
```
|
||||
$ git clone git://github.com/kelp404/CocoaSecurity.git
|
||||
$ cd CocoaSecurity
|
||||
$ git submodule update --init
|
||||
```
|
||||
|
||||
2. **<a href="http://cocoapods.org/?q=CocoaSecurity" target="_blank">CocoadPods</a>:**
|
||||
add `Podfile` in your project path
|
||||
```
|
||||
platform :ios
|
||||
pod 'CocoaSecurity'
|
||||
```
|
||||
```
|
||||
$ pod install
|
||||
```
|
||||
53
Example/Pods/CocoaSecurity/submodules/Base64/Base64/Base64.h
generated
Normal file
@ -0,0 +1,53 @@
|
||||
//
|
||||
// Base64.h
|
||||
//
|
||||
// Version 1.2
|
||||
//
|
||||
// Created by Nick Lockwood on 12/01/2012.
|
||||
// Copyright (C) 2012 Charcoal Design
|
||||
//
|
||||
// Distributed under the permissive zlib License
|
||||
// Get the latest version from here:
|
||||
//
|
||||
// https://github.com/nicklockwood/Base64
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an acknowledgment in the product documentation would be
|
||||
// appreciated but is not required.
|
||||
//
|
||||
// 2. Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source distribution.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
@interface NSData (Base64)
|
||||
|
||||
+ (NSData *)dataWithBase64EncodedString:(NSString *)string;
|
||||
- (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth;
|
||||
- (NSString *)base64EncodedString;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface NSString (Base64)
|
||||
|
||||
+ (NSString *)stringWithBase64EncodedString:(NSString *)string;
|
||||
- (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth;
|
||||
- (NSString *)base64EncodedString;
|
||||
- (NSString *)base64DecodedString;
|
||||
- (NSData *)base64DecodedData;
|
||||
|
||||
@end
|
||||
167
Example/Pods/CocoaSecurity/submodules/Base64/Base64/Base64.m
generated
Normal file
@ -0,0 +1,167 @@
|
||||
//
|
||||
// Base64.m
|
||||
//
|
||||
// Version 1.2
|
||||
//
|
||||
// Created by Nick Lockwood on 12/01/2012.
|
||||
// Copyright (C) 2012 Charcoal Design
|
||||
//
|
||||
// Distributed under the permissive zlib License
|
||||
// Get the latest version from here:
|
||||
//
|
||||
// https://github.com/nicklockwood/Base64
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an aacknowledgment in the product documentation would be
|
||||
// appreciated but is not required.
|
||||
//
|
||||
// 2. Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source distribution.
|
||||
//
|
||||
|
||||
#import "Base64.h"
|
||||
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wselector"
|
||||
|
||||
|
||||
#import <Availability.h>
|
||||
#if !__has_feature(objc_arc)
|
||||
#error This library requires automatic reference counting
|
||||
#endif
|
||||
|
||||
|
||||
@implementation NSData (Base64)
|
||||
|
||||
+ (NSData *)dataWithBase64EncodedString:(NSString *)string
|
||||
{
|
||||
if (![string length]) return nil;
|
||||
|
||||
NSData *decoded = nil;
|
||||
|
||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_9 || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0
|
||||
|
||||
if (![NSData instancesRespondToSelector:@selector(initWithBase64EncodedString:options:)])
|
||||
{
|
||||
decoded = [[self alloc] initWithBase64Encoding:[string stringByReplacingOccurrencesOfString:@"[^A-Za-z0-9+/=]" withString:@"" options:NSRegularExpressionSearch range:NSMakeRange(0, [string length])]];
|
||||
}
|
||||
else
|
||||
|
||||
#endif
|
||||
|
||||
{
|
||||
decoded = [[self alloc] initWithBase64EncodedString:string options:NSDataBase64DecodingIgnoreUnknownCharacters];
|
||||
}
|
||||
|
||||
return [decoded length]? decoded: nil;
|
||||
}
|
||||
|
||||
- (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth
|
||||
{
|
||||
if (![self length]) return nil;
|
||||
|
||||
NSString *encoded = nil;
|
||||
|
||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_9 || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0
|
||||
|
||||
if (![NSData instancesRespondToSelector:@selector(base64EncodedStringWithOptions:)])
|
||||
{
|
||||
encoded = [self base64Encoding];
|
||||
}
|
||||
else
|
||||
|
||||
#endif
|
||||
|
||||
{
|
||||
switch (wrapWidth)
|
||||
{
|
||||
case 64:
|
||||
{
|
||||
return [self base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
|
||||
}
|
||||
case 76:
|
||||
{
|
||||
return [self base64EncodedStringWithOptions:NSDataBase64Encoding76CharacterLineLength];
|
||||
}
|
||||
default:
|
||||
{
|
||||
encoded = [self base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!wrapWidth || wrapWidth >= [encoded length])
|
||||
{
|
||||
return encoded;
|
||||
}
|
||||
|
||||
wrapWidth = (wrapWidth / 4) * 4;
|
||||
NSMutableString *result = [NSMutableString string];
|
||||
for (NSUInteger i = 0; i < [encoded length]; i+= wrapWidth)
|
||||
{
|
||||
if (i + wrapWidth >= [encoded length])
|
||||
{
|
||||
[result appendString:[encoded substringFromIndex:i]];
|
||||
break;
|
||||
}
|
||||
[result appendString:[encoded substringWithRange:NSMakeRange(i, wrapWidth)]];
|
||||
[result appendString:@"\r\n"];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (NSString *)base64EncodedString
|
||||
{
|
||||
return [self base64EncodedStringWithWrapWidth:0];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation NSString (Base64)
|
||||
|
||||
+ (NSString *)stringWithBase64EncodedString:(NSString *)string
|
||||
{
|
||||
NSData *data = [NSData dataWithBase64EncodedString:string];
|
||||
if (data)
|
||||
{
|
||||
return [[self alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth
|
||||
{
|
||||
NSData *data = [self dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
|
||||
return [data base64EncodedStringWithWrapWidth:wrapWidth];
|
||||
}
|
||||
|
||||
- (NSString *)base64EncodedString
|
||||
{
|
||||
NSData *data = [self dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
|
||||
return [data base64EncodedString];
|
||||
}
|
||||
|
||||
- (NSString *)base64DecodedString
|
||||
{
|
||||
return [NSString stringWithBase64EncodedString:self];
|
||||
}
|
||||
|
||||
- (NSData *)base64DecodedData
|
||||
{
|
||||
return [NSData dataWithBase64EncodedString:self];
|
||||
}
|
||||
|
||||
@end
|
||||
@ -1,46 +0,0 @@
|
||||
//
|
||||
// DDDKeychainWrapper.h
|
||||
// Aksel Dybdal
|
||||
//
|
||||
// Created by Aksel Dybdal on 02.04.14.
|
||||
// Copyright (c) 2014 Aksel Dybdal. All rights reserved.
|
||||
//
|
||||
|
||||
/**
|
||||
A small wrapper for Keychain access.
|
||||
|
||||
Inspired by:
|
||||
http://useyourloaf.com/blog/2010/03/29/simple-iphone-keychain-access.html
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface DDDKeychainWrapper : NSObject
|
||||
|
||||
+ (void)setString:(NSString *)string forKey:(NSString *)key;
|
||||
+ (NSString *)stringForKey:(NSString *)key;
|
||||
|
||||
+ (void)setDate:(NSDate *)date forKey:(NSString *)key;
|
||||
+ (NSDate *)dateForKey:(NSString *)key;
|
||||
|
||||
+ (void)setData:(NSData *)data forKey:(NSString *)key;
|
||||
+ (NSData *)dataForKey:(NSString *)key;
|
||||
|
||||
+ (void)setArray:(NSArray *)array forKey:(NSString *)key;
|
||||
+ (NSArray *)arrayForKey:(NSString *)key;
|
||||
|
||||
+ (void)setDictionary:(NSDictionary *)dictionary forKey:(NSString *)key;
|
||||
+ (NSDictionary *)dictionaryForKey:(NSString *)key;
|
||||
|
||||
+ (void)setNumber:(NSNumber *)number forKey:(NSString *)key;
|
||||
+ (NSNumber *)numberForKey:(NSString *)key;
|
||||
|
||||
+ (void)setBoolean:(BOOL)boolean forKey:(NSString *)key;
|
||||
+ (BOOL)booleanForKey:(NSString *)key;
|
||||
|
||||
+ (void)setObject:(id)object forKey:(NSString *)key;
|
||||
+ (id)objectForKey:(NSString *)key;
|
||||
|
||||
+ (void)wipeKeychain;
|
||||
|
||||
@end
|
||||
@ -1,373 +0,0 @@
|
||||
//
|
||||
// DDDKeychainWrapper.m
|
||||
// Aksel Dybdal
|
||||
//
|
||||
// Created by Aksel Dybdal on 02.04.14.
|
||||
// Copyright (c) 2014 Aksel Dybdal. All rights reserved.
|
||||
//
|
||||
|
||||
#import "DDDKeychainWrapper.h"
|
||||
#import <Security/Security.h>
|
||||
|
||||
typedef NS_ENUM(NSUInteger, DDDKeychainWrapperErrorCode) {
|
||||
DDDKeychainWrapperErrorCreatingKeychainValue = 1,
|
||||
DDDKeychainWrapperErrorUpdatingKeychainValue,
|
||||
DDDKeychainWrapperErrorDeletingKeychainValue,
|
||||
DDDKeychainWrapperErrorSearchingKeychainValue
|
||||
};
|
||||
|
||||
NSString *const kDDDKeychainWrapperServiceName = @"com.dddkeychainwrapper.keychainService";
|
||||
NSString *const kDDDKeychainWrapperErrorDomain = @"DDDKeychainWrapperErrorDomain";
|
||||
|
||||
#ifdef DEBUG
|
||||
# warning "Including NSLog"
|
||||
# define DDDLOG(s, ...) NSLog(s, ## __VA_ARGS__)
|
||||
#else
|
||||
# define DDDLOG(s, ...) while(0){}
|
||||
#endif
|
||||
|
||||
@implementation DDDKeychainWrapper
|
||||
|
||||
|
||||
#pragma mark - String
|
||||
|
||||
+ (void)setString:(NSString *)string forKey:(NSString *)key
|
||||
{
|
||||
NSData *stringData = [string dataUsingEncoding:NSUTF8StringEncoding];
|
||||
[self setData:stringData forIdentifier:key];
|
||||
}
|
||||
|
||||
+ (NSString *)stringForKey:(NSString *)key
|
||||
{
|
||||
NSData *stringData = [self dataForIdentifier:key];
|
||||
return [[NSString alloc] initWithData:stringData encoding:NSUTF8StringEncoding];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Date
|
||||
|
||||
+ (void)setDate:(NSDate *)date forKey:(NSString *)key
|
||||
{
|
||||
NSData *dateData = [NSKeyedArchiver archivedDataWithRootObject:date];
|
||||
[self setData:dateData forIdentifier:key];
|
||||
}
|
||||
|
||||
+ (NSDate *)dateForKey:(NSString *)key
|
||||
{
|
||||
NSData *dateData = [self dataForIdentifier:key];
|
||||
return (NSDate *)[NSKeyedUnarchiver unarchiveObjectWithData:dateData];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Data
|
||||
|
||||
+ (void)setData:(NSData *)data forKey:(NSString *)key
|
||||
{
|
||||
[self setData:data forIdentifier:key];
|
||||
}
|
||||
|
||||
+ (NSData *)dataForKey:(NSString *)key
|
||||
{
|
||||
return [self dataForIdentifier:key];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Array
|
||||
|
||||
+ (void)setArray:(NSArray *)array forKey:(NSString *)key
|
||||
{
|
||||
for (id obj in array) {
|
||||
NSAssert([obj conformsToProtocol:@protocol(NSCoding)], @"Objects must confirm to NSCoding protocol in order to be stored in keychain");
|
||||
}
|
||||
|
||||
NSData *arrayData = [NSKeyedArchiver archivedDataWithRootObject:array];
|
||||
[self setData:arrayData forIdentifier:key];
|
||||
}
|
||||
|
||||
+ (NSArray *)arrayForKey:(NSString *)key
|
||||
{
|
||||
NSData *arrayData = [self dataForIdentifier:key];
|
||||
return (NSArray *)[NSKeyedUnarchiver unarchiveObjectWithData:arrayData];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Dictionary
|
||||
|
||||
+ (void)setDictionary:(NSDictionary *)dictionary forKey:(NSString *)key
|
||||
{
|
||||
[dictionary enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
|
||||
NSAssert([key conformsToProtocol:@protocol(NSCoding)], @"Keys must confirm to NSCoding protocol in order to be stored in keychain");
|
||||
NSAssert([obj conformsToProtocol:@protocol(NSCoding)], @"Objects must confirm to NSCoding protocol in order to be stored in keychain");
|
||||
}];
|
||||
|
||||
NSData *dictionaryData = [NSKeyedArchiver archivedDataWithRootObject:dictionary];
|
||||
[self setData:dictionaryData forIdentifier:key];
|
||||
}
|
||||
|
||||
+ (NSDictionary *)dictionaryForKey:(NSString *)key
|
||||
{
|
||||
NSData *dictionaryData = [self dataForIdentifier:key];
|
||||
return (NSDictionary *)[NSKeyedUnarchiver unarchiveObjectWithData:dictionaryData];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Number
|
||||
|
||||
+ (void)setNumber:(NSNumber *)number forKey:(NSString *)key
|
||||
{
|
||||
NSData *numberData = [NSKeyedArchiver archivedDataWithRootObject:number];
|
||||
[self setData:numberData forIdentifier:key];
|
||||
}
|
||||
|
||||
+ (NSNumber *)numberForKey:(NSString *)key
|
||||
{
|
||||
NSData *numberData = [self dataForIdentifier:key];
|
||||
return (NSNumber *)[NSKeyedUnarchiver unarchiveObjectWithData:numberData];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - BOOL
|
||||
|
||||
+ (void)setBoolean:(BOOL)boolean forKey:(NSString *)key
|
||||
{
|
||||
NSNumber *boolNumber = [NSNumber numberWithBool:boolean];
|
||||
[self setNumber:boolNumber forKey:key];
|
||||
}
|
||||
|
||||
+ (BOOL)booleanForKey:(NSString *)key
|
||||
{
|
||||
NSNumber *boolNumber = [self numberForKey:key];
|
||||
return [boolNumber boolValue];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Object
|
||||
|
||||
+ (void)setObject:(id)object forKey:(NSString *)key
|
||||
{
|
||||
NSAssert([object conformsToProtocol:@protocol(NSCoding)], @"Object must confirm to NSCoding protocol in order to be stored in keychain");
|
||||
|
||||
NSData *objectData = [NSKeyedArchiver archivedDataWithRootObject:object];
|
||||
[self setData:objectData forIdentifier:key];
|
||||
}
|
||||
|
||||
+ (id)objectForKey:(NSString *)key
|
||||
{
|
||||
NSData *objectData = [self dataForIdentifier:key];
|
||||
return (id)[NSKeyedUnarchiver unarchiveObjectWithData:objectData];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Clear Keychain
|
||||
|
||||
+ (void)wipeKeychain
|
||||
{
|
||||
NSArray *secItemClasses = @[(__bridge id)kSecClassGenericPassword,
|
||||
(__bridge id)kSecClassInternetPassword,
|
||||
(__bridge id)kSecClassCertificate,
|
||||
(__bridge id)kSecClassKey,
|
||||
(__bridge id)kSecClassIdentity];
|
||||
|
||||
for (id secItemClass in secItemClasses) {
|
||||
NSDictionary *spec = @{(__bridge id)kSecClass: (id)secItemClass};
|
||||
SecItemDelete((__bridge CFDictionaryRef)spec);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
+ (void)setData:(NSData *)data forIdentifier:(NSString *)identifier
|
||||
{
|
||||
NSError *error = nil;
|
||||
|
||||
// If no data provided we assume we want to delete the value
|
||||
if (nil == data || NO == [data bytes]) {
|
||||
[self deleteKeychainValueForIdentifier:identifier error:&error];
|
||||
if (error) {
|
||||
DDDLOG(@"Error deleting keychain value for key: \"%@\" Error: %@", identifier, [error localizedDescription]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// We first look up the key in order to see if we need to update or create the value
|
||||
if ([self searchKeychainCopyMatching:identifier error:&error]) {
|
||||
if (error) {
|
||||
DDDLOG(@"Error finding keychain value for key: \"%@\" Error: %@", identifier, [error localizedDescription]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (![self updateKeychainValue:data forIdentifier:identifier error:&error]) {
|
||||
DDDLOG(@"Error updating keychain value for key: \"%@\" Error: %@", identifier, [error localizedDescription]);
|
||||
}
|
||||
} else {
|
||||
if (![self createKeychainValue:data forIdentifier:identifier error:&error]) {
|
||||
DDDLOG(@"Error creating keychain value for key: \"%@\" Error: %@", identifier, [error localizedDescription]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSData *)dataForIdentifier:(NSString *)identifier
|
||||
{
|
||||
NSError *error = nil;
|
||||
NSData *stringData = [self searchKeychainCopyMatching:identifier error:&error];
|
||||
if (error) {
|
||||
DDDLOG(@"Error finding keychain value for key: \"%@\" Error: %@", identifier, [error localizedDescription]);
|
||||
return nil;
|
||||
}
|
||||
return stringData;
|
||||
}
|
||||
|
||||
+ (NSMutableDictionary *)newSearchDictionary:(NSString *)identifier
|
||||
{
|
||||
NSMutableDictionary *searchDictionary = [[NSMutableDictionary alloc] init];
|
||||
|
||||
[searchDictionary setObject:(__bridge id)kSecClassGenericPassword forKey:(__bridge id)kSecClass];
|
||||
|
||||
NSData *encodedIdentifier = [identifier dataUsingEncoding:NSUTF8StringEncoding];
|
||||
[searchDictionary setObject:encodedIdentifier forKey:(__bridge id)kSecAttrGeneric];
|
||||
[searchDictionary setObject:encodedIdentifier forKey:(__bridge id)kSecAttrAccount];
|
||||
[searchDictionary setObject:(__bridge id)kSecAttrAccessibleAfterFirstUnlock forKey:(__bridge id)kSecAttrAccessible];
|
||||
[searchDictionary setObject:kDDDKeychainWrapperServiceName forKey:(__bridge id)kSecAttrService];
|
||||
|
||||
return searchDictionary;
|
||||
}
|
||||
|
||||
+ (NSData *)searchKeychainCopyMatching:(NSString *)identifier error:(NSError **)error
|
||||
{
|
||||
NSMutableDictionary *searchDictionary = [self newSearchDictionary:identifier];
|
||||
|
||||
[searchDictionary setObject:(__bridge id)kSecMatchLimitOne forKey:(__bridge id)kSecMatchLimit];
|
||||
[searchDictionary setObject:(__bridge id)kCFBooleanTrue forKey:(__bridge id)kSecReturnData];
|
||||
|
||||
CFDataRef result;
|
||||
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)searchDictionary, (CFTypeRef *)&result);
|
||||
|
||||
if (status != errSecSuccess) {
|
||||
[self keychainError:error forStatus:status domain:DDDKeychainWrapperErrorSearchingKeychainValue];
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSData *data = (__bridge NSData *)result;
|
||||
return data;
|
||||
}
|
||||
|
||||
+ (BOOL)createKeychainValue:(NSData *)data forIdentifier:(NSString *)identifier error:(NSError **)error
|
||||
{
|
||||
NSMutableDictionary *dictionary = [self newSearchDictionary:identifier];
|
||||
[dictionary setObject:data forKey:(__bridge id)kSecValueData];
|
||||
|
||||
OSStatus status = SecItemAdd((__bridge CFDictionaryRef)dictionary, NULL);
|
||||
|
||||
if (status == errSecSuccess) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
[self keychainError:error forStatus:status domain:DDDKeychainWrapperErrorCreatingKeychainValue];
|
||||
return NO;
|
||||
}
|
||||
|
||||
+ (BOOL)updateKeychainValue:(NSData *)data forIdentifier:(NSString *)identifier error:(NSError **)error
|
||||
{
|
||||
NSMutableDictionary *searchDictionary = [self newSearchDictionary:identifier];
|
||||
NSMutableDictionary *updateDictionary = [[NSMutableDictionary alloc] init];
|
||||
[updateDictionary setObject:data forKey:(__bridge id)kSecValueData];
|
||||
|
||||
OSStatus status = SecItemUpdate((__bridge CFDictionaryRef)searchDictionary,
|
||||
(__bridge CFDictionaryRef)updateDictionary);
|
||||
|
||||
if (status == errSecSuccess) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
[self keychainError:error forStatus:status domain:DDDKeychainWrapperErrorUpdatingKeychainValue];
|
||||
return NO;
|
||||
}
|
||||
|
||||
+ (BOOL)deleteKeychainValueForIdentifier:(NSString *)identifier error:(NSError **)error
|
||||
{
|
||||
NSMutableDictionary *searchDictionary = [self newSearchDictionary:identifier];
|
||||
OSStatus status = SecItemDelete((__bridge CFDictionaryRef)searchDictionary);
|
||||
|
||||
if (status == errSecSuccess) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
[self keychainError:error forStatus:status domain:DDDKeychainWrapperErrorDeletingKeychainValue];
|
||||
return NO;
|
||||
}
|
||||
|
||||
#pragma mark - Error
|
||||
|
||||
+ (void)keychainError:(NSError **)error forStatus:(OSStatus)status domain:(NSUInteger)domain
|
||||
{
|
||||
NSString *errorString = @"";
|
||||
|
||||
switch (status) {
|
||||
case errSecUnimplemented:
|
||||
errorString = @"Function or operation not implemented.";
|
||||
break;
|
||||
|
||||
case errSecIO:
|
||||
errorString = @"I/O error (bummers)";
|
||||
break;
|
||||
|
||||
case errSecOpWr:
|
||||
errorString = @"File already open with write permission";
|
||||
break;
|
||||
|
||||
case errSecParam:
|
||||
errorString = @"One or more parameters passed to a function where not valid.";
|
||||
break;
|
||||
|
||||
case errSecAllocate:
|
||||
errorString = @"Failed to allocate memory.";
|
||||
break;
|
||||
|
||||
case errSecUserCanceled:
|
||||
errorString = @"User canceled the operation.";
|
||||
break;
|
||||
|
||||
case errSecBadReq:
|
||||
errorString = @"Bad parameter or invalid state for operation.";
|
||||
break;
|
||||
|
||||
case errSecInternalComponent:
|
||||
errorString = @"errSecInternalComponent";
|
||||
break;
|
||||
|
||||
case errSecNotAvailable:
|
||||
errorString = @"No keychain is available. You may need to restart your computer.";
|
||||
break;
|
||||
|
||||
case errSecDuplicateItem:
|
||||
errorString = @"The specified item already exists in the keychain.";
|
||||
break;
|
||||
|
||||
case errSecItemNotFound:
|
||||
errorString = @"The specified item could not be found in the keychain.";
|
||||
break;
|
||||
|
||||
case errSecInteractionNotAllowed:
|
||||
errorString = @"User interaction is not allowed.";
|
||||
break;
|
||||
|
||||
case errSecDecode:
|
||||
errorString = @"Unable to decode the provided data.";
|
||||
break;
|
||||
|
||||
case errSecAuthFailed:
|
||||
errorString = @"The user name or passphrase you entered is not correct.";
|
||||
break;
|
||||
|
||||
default:
|
||||
errorString = @"Unknown error";
|
||||
break;
|
||||
}
|
||||
|
||||
*error = [NSError errorWithDomain:kDDDKeychainWrapperErrorDomain
|
||||
code:domain
|
||||
userInfo:@{NSLocalizedDescriptionKey: errorString}];
|
||||
}
|
||||
|
||||
@end
|
||||
47
Example/Pods/DDDKeychainWrapper/README.md
generated
@ -1,47 +0,0 @@
|
||||
# DDDKeychainWrapper
|
||||
|
||||
[](https://travis-ci.org/axldyb/DDDKeychainWrapper)
|
||||
[](http://cocoadocs.org/docsets/DDDKeychainWrapper)
|
||||
[](http://cocoadocs.org/docsets/DDDKeychainWrapper)
|
||||
[](http://cocoadocs.org/docsets/DDDKeychainWrapper)
|
||||
|
||||
## Usage
|
||||
|
||||
Storing your sensitive data in the keychain can take up a lot of time and effort. It should be easy to just drop something in there and retrive it with a few simple lines of code. DDDKeychainWrapper offers this simplicity and here is how we do it:
|
||||
|
||||
```objective-c
|
||||
// Writing to the Keychain
|
||||
[DDDKeychainWrapper setString:@"Secret string" forKey:@"my_key"];
|
||||
|
||||
// Reading from the Keychain
|
||||
NSString *secretString = [DDDKeychainWrapper stringForKey:@"my_key"];
|
||||
```
|
||||
|
||||
DDDKeychainWrapper has support for the following types
|
||||
|
||||
* NSString
|
||||
* NSDate
|
||||
* NSData
|
||||
* NSArray
|
||||
* NSDictionary
|
||||
* NSNumber
|
||||
* BOOL
|
||||
* Objects (Must confirm to NSCoding)
|
||||
|
||||
A method for wiping the keychain data inserted via the wrapper exists as well.
|
||||
|
||||
## Installation
|
||||
|
||||
DDDKeychainWrapper is available through [CocoaPods](http://cocoapods.org). To install
|
||||
it, simply add the following line to your Podfile:
|
||||
|
||||
pod "DDDKeychainWrapper"
|
||||
|
||||
## Author
|
||||
|
||||
axldyb, aksel.dybdal@shortcut.no
|
||||
|
||||
## License
|
||||
|
||||
DDDKeychainWrapper is available under the MIT license. See the LICENSE file for more info.
|
||||
|
||||
@ -10,4 +10,7 @@
|
||||
|
||||
@interface DJLocalizableString : NSString
|
||||
|
||||
- (NSUInteger)length;
|
||||
- (unichar)characterAtIndex:(NSUInteger)index;
|
||||
|
||||
@end
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
*
|
||||
* @param key The localization key
|
||||
* @param comment The localization value
|
||||
*
|
||||
* @return The localized string
|
||||
*/
|
||||
- (NSString *)localizedStoryboardStringForKey:(NSString *)key value:(NSString *)comment;
|
||||
|
||||
@ -8,19 +8,14 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#define DJLocalizedString(key, comment) \
|
||||
[DJLocalizationSystem.shared localizedStringForKey:(key) value: @"" table: nil]
|
||||
#define DJLocalizedStringFromTable(key, tbl, comment) \
|
||||
[DJLocalizationSystem.shared localizedStringForKey:(key) value: @"" table:(tbl)]
|
||||
|
||||
// replace Apple's macros with our own
|
||||
#undef NSLocalizedString
|
||||
#define NSLocalizedString(key, comment) \
|
||||
DJLocalizedString(key, comment)
|
||||
[DJLocalizationSystem.shared localizedStringForKey:(key) value: @"" table: nil]
|
||||
|
||||
#undef NSLocalizedStringFromTable
|
||||
#define NSLocalizedStringFromTable(key, tbl, comment) \
|
||||
DJLocalizedStringFromTable(key, tbl, comment)
|
||||
[DJLocalizationSystem.shared localizedStringForKey:(key) value:@"" table:(tbl)]
|
||||
|
||||
@interface DJLocalizationSystem : NSObject
|
||||
|
||||
@ -29,7 +24,7 @@
|
||||
*
|
||||
* @return A localization system instance
|
||||
*/
|
||||
@property (class, nonnull, readonly) DJLocalizationSystem *shared;
|
||||
+ (instancetype)shared;
|
||||
|
||||
/*!
|
||||
* Get the localized string for a given key/value
|
||||
@ -39,7 +34,7 @@
|
||||
* @param tableName The localization table name
|
||||
* @return The localized string
|
||||
*/
|
||||
- (nonnull NSString *)localizedStringForKey:(nullable NSString *)key value:(nullable NSString *)comment table:(nullable NSString *)tableName;
|
||||
- (NSString *)localizedStringForKey:(NSString *)key value:(NSString *)comment table:(NSString *)tableName;
|
||||
|
||||
/*!
|
||||
* Get the localized string for a given key/value in the specified bundle
|
||||
@ -49,7 +44,7 @@
|
||||
* @param bundle The bundle to search in
|
||||
* @return The localized string
|
||||
*/
|
||||
- (nonnull NSString *)localizedStringForKey:(nullable NSString *)key value:(nullable NSString *)comment table:(nullable NSString *)tableName bundle:(nonnull NSBundle *)bundle;
|
||||
- (NSString *)localizedStringForKey:(NSString *)key value:(NSString *)comment table:(NSString *)tableName bundle:(NSBundle *)bundle;
|
||||
|
||||
/*!
|
||||
* Reset the localization to the system's default language
|
||||
@ -59,11 +54,11 @@
|
||||
/*!
|
||||
* The bundle for the currently active language
|
||||
*/
|
||||
@property (nonatomic, readonly, nonnull) NSBundle *bundle;
|
||||
@property (nonatomic, readonly) NSBundle *bundle;
|
||||
|
||||
/*!
|
||||
* The currently active language
|
||||
*/
|
||||
@property (nonatomic, strong, nonnull) NSString *language;
|
||||
@property (nonatomic, strong) NSString *language;
|
||||
|
||||
@end
|
||||
|
||||
@ -16,6 +16,6 @@
|
||||
* @param name The storyboard's name
|
||||
* @return The desired storyboard
|
||||
*/
|
||||
+ (nonnull instancetype)dj_storyboardWithName:(nonnull NSString *)name;
|
||||
+ (instancetype)dj_storyboardWithName:(NSString *)name;
|
||||
|
||||
@end
|
||||
|
||||
13
Example/Pods/DJLocalization/README.md
generated
@ -25,11 +25,6 @@ it, simply add the following line to your Podfile:
|
||||
|
||||
pod "DJLocalization"
|
||||
|
||||
For Swift, use:
|
||||
|
||||
pod "DJLocalization/Swift"
|
||||
|
||||
|
||||
### Manually
|
||||
|
||||
_**Important note if your project doesn't use ARC**: you must add the `-fobjc-arc` compiler flag to all 'DJLocalization' files in Target Settings > Build Phases > Compile Sources._
|
||||
@ -42,17 +37,11 @@ _**Important note if your project doesn't use ARC**: you must add the `-fobjc-ar
|
||||
|
||||
Then simply add the following import to your prefix header, or any file where you use the NSLocalizedString macro (or variants).
|
||||
|
||||
@import DJLocalization;
|
||||
#import <DJLocalization/DJLocalization.h>
|
||||
|
||||
#####*Important:*
|
||||
You must import the header wherever you use the NSLocalizedString macro, as this header replaces the default NSLocalizedString macro with a custom one. If you don't, runtime switching of languages won't work.
|
||||
|
||||
### Localization
|
||||
|
||||
Use your normal localization workflow and everything should work correctly. For code strings use `NSLocalizedString`, for storyboards use Base Internationalization.
|
||||
|
||||
As mentioned before, `NSLocalizedString` will only work correctly if you first include the correct headers. If you want a bit more safety, the library provides some extra macros `DJLocalizedString` that provide the same functionality as the overridden `NSLocalizedString` macros. This way you'll get a compilation error if you forget to include the headers.
|
||||
|
||||
### Switching languages
|
||||
|
||||
At runtime, you can switch the language at any time by setting the language property:
|
||||
|
||||
14
Example/Pods/Expecta+Snapshots/EXPMatchers+FBSnapshotTest.h
generated
Normal file
@ -0,0 +1,14 @@
|
||||
#import <Expecta/Expecta.h>
|
||||
#import "ExpectaObject+FBSnapshotTest.h"
|
||||
|
||||
@interface EXPExpectFBSnapshotTest : NSObject
|
||||
@end
|
||||
|
||||
/// Set the default folder for image tests to run in
|
||||
extern void setGlobalReferenceImageDir(char *reference);
|
||||
|
||||
EXPMatcherInterface(haveValidSnapshot, (void));
|
||||
EXPMatcherInterface(recordSnapshot, (void));
|
||||
|
||||
EXPMatcherInterface(haveValidSnapshotNamed, (NSString *snapshot));
|
||||
EXPMatcherInterface(recordSnapshotNamed, (NSString *snapshot));
|
||||
284
Example/Pods/Expecta+Snapshots/EXPMatchers+FBSnapshotTest.m
generated
Normal file
@ -0,0 +1,284 @@
|
||||
#import "EXPMatchers+FBSnapshotTest.h"
|
||||
#import <Expecta/EXPMatcherHelpers.h>
|
||||
#import <FBSnapshotTestCase/FBSnapshotTestController.h>
|
||||
|
||||
@interface EXPExpectFBSnapshotTest()
|
||||
@property (nonatomic, strong) NSString *referenceImagesDirectory;
|
||||
@end
|
||||
|
||||
@implementation EXPExpectFBSnapshotTest
|
||||
|
||||
+ (id)instance
|
||||
{
|
||||
static EXPExpectFBSnapshotTest *instance = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
instance = [[self alloc] init];
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
|
||||
+ (BOOL)compareSnapshotOfViewOrLayer:(id)viewOrLayer snapshot:(NSString *)snapshot testCase:(id)testCase record:(BOOL)record referenceDirectory:(NSString *)referenceDirectory error:(NSError **)error
|
||||
|
||||
{
|
||||
FBSnapshotTestController *snapshotController = [[FBSnapshotTestController alloc] initWithTestClass:[testCase class]];
|
||||
snapshotController.recordMode = record;
|
||||
snapshotController.referenceImagesDirectory = referenceDirectory;
|
||||
snapshotController.usesDrawViewHierarchyInRect = [Expecta usesDrawViewHierarchyInRect];
|
||||
|
||||
if (! snapshotController.referenceImagesDirectory) {
|
||||
[NSException raise:@"Missing value for referenceImagesDirectory" format:@"Call [[EXPExpectFBSnapshotTest instance] setReferenceImagesDirectory"];
|
||||
}
|
||||
|
||||
return [snapshotController compareSnapshotOfViewOrLayer:viewOrLayer
|
||||
selector:NSSelectorFromString(snapshot)
|
||||
identifier:nil
|
||||
tolerance:0
|
||||
error:error];
|
||||
}
|
||||
|
||||
+ (NSString *)combinedError:(NSString *)message test:(NSString *)test error:(NSError *)error
|
||||
{
|
||||
NSAssert(message, @"missing message");
|
||||
NSAssert(test, @"missing test name");
|
||||
|
||||
NSMutableArray *ary = [NSMutableArray array];
|
||||
|
||||
[ary addObject:[NSString stringWithFormat:@"%@ %@", message, test]];
|
||||
|
||||
for(NSString *key in error.userInfo.keyEnumerator) {
|
||||
[ary addObject:[NSString stringWithFormat:@" %@: %@", key, [error.userInfo valueForKey:key]]];
|
||||
}
|
||||
|
||||
return [ary componentsJoinedByString:@"\n"];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
void setGlobalReferenceImageDir(char *reference) {
|
||||
NSString *referenceImagesDirectory = [NSString stringWithFormat:@"%s", reference];
|
||||
[[EXPExpectFBSnapshotTest instance] setReferenceImagesDirectory:referenceImagesDirectory];
|
||||
};
|
||||
|
||||
@interface EXPExpect(ReferenceDirExtension)
|
||||
- (NSString *)_getDefaultReferenceDirectory;
|
||||
@end
|
||||
|
||||
@implementation EXPExpect(ReferenceDirExtension)
|
||||
|
||||
- (NSString *)_getDefaultReferenceDirectory
|
||||
{
|
||||
NSString *globalReference = [[EXPExpectFBSnapshotTest instance] referenceImagesDirectory];
|
||||
if (globalReference) {
|
||||
return globalReference;
|
||||
}
|
||||
|
||||
// Search the test file's path to find the first folder with the substring "tests"
|
||||
// then append "/ReferenceImages" and use that
|
||||
|
||||
NSString *testFileName = [NSString stringWithCString:self.fileName encoding:NSUTF8StringEncoding];
|
||||
NSArray *pathComponents = [testFileName pathComponents];
|
||||
|
||||
for (NSString *folder in pathComponents) {
|
||||
if ([folder.lowercaseString rangeOfString:@"tests"].location != NSNotFound) {
|
||||
|
||||
NSArray *folderPathComponents = [pathComponents subarrayWithRange:NSMakeRange(0, [pathComponents indexOfObject:folder] + 1)];
|
||||
return [NSString stringWithFormat:@"%@/ReferenceImages", [folderPathComponents componentsJoinedByString:@"/"]];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[NSException raise:@"Could not infer reference image folder" format:@"You should provide a reference dir using setGlobalReferenceImageDir(FB_REFERENCE_IMAGE_DIR);"];
|
||||
return nil;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
#import <Specta/Specta.h>
|
||||
#import <Specta/SpectaUtility.h>
|
||||
#import <Specta/SPTExample.h>
|
||||
|
||||
NSString *sanitizedTestPath();
|
||||
|
||||
NSString *sanitizedTestPath(){
|
||||
id compiledExample = [[NSThread currentThread] threadDictionary][@"SPTCurrentSpec"]; // SPTSpec
|
||||
NSString *name;
|
||||
if ([compiledExample respondsToSelector:@selector(name)]) {
|
||||
// Specta 0.3 syntax
|
||||
name = [compiledExample performSelector:@selector(name)];
|
||||
} else if ([compiledExample respondsToSelector:@selector(fileName)]) {
|
||||
// Specta 0.2 syntax
|
||||
name = [compiledExample performSelector:@selector(fileName)];
|
||||
}
|
||||
name = [[[[name componentsSeparatedByString:@" test_"] lastObject] stringByReplacingOccurrencesOfString:@"__" withString:@"_"] stringByReplacingOccurrencesOfString:@"]" withString:@""];
|
||||
return name;
|
||||
}
|
||||
|
||||
EXPMatcherImplementationBegin(haveValidSnapshot, (void)){
|
||||
__block NSError *error = nil;
|
||||
|
||||
prerequisite(^BOOL{
|
||||
return actual;
|
||||
});
|
||||
|
||||
|
||||
match(^BOOL{
|
||||
NSString *referenceImageDir = [self _getDefaultReferenceDirectory];
|
||||
NSString *name = sanitizedTestPath();
|
||||
if ([actual isKindOfClass:UIViewController.class]) {
|
||||
[actual beginAppearanceTransition:YES animated:NO];
|
||||
[actual endAppearanceTransition];
|
||||
|
||||
actual = [actual view];
|
||||
}
|
||||
|
||||
return [EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:name testCase:[self testCase] record:NO referenceDirectory:referenceImageDir error:&error];
|
||||
});
|
||||
|
||||
failureMessageForTo(^NSString *{
|
||||
if (!actual) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"Nil was passed into haveValidSnapshot." test:sanitizedTestPath() error:nil];
|
||||
}
|
||||
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"expected a matching snapshot in" test:sanitizedTestPath() error:error];
|
||||
});
|
||||
|
||||
failureMessageForNotTo(^NSString *{
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"expected to not have a matching snapshot in" test:sanitizedTestPath() error:error];
|
||||
});
|
||||
}
|
||||
EXPMatcherImplementationEnd
|
||||
|
||||
EXPMatcherImplementationBegin(recordSnapshot, (void)) {
|
||||
__block NSError *error = nil;
|
||||
|
||||
BOOL actualIsViewLayerOrViewController = ([actual isKindOfClass:UIView.class] || [actual isKindOfClass:CALayer.class] || [actual isKindOfClass:UIViewController.class]);
|
||||
|
||||
prerequisite(^BOOL{
|
||||
return actual && actualIsViewLayerOrViewController;
|
||||
});
|
||||
|
||||
match(^BOOL{
|
||||
NSString *referenceImageDir = [self _getDefaultReferenceDirectory];
|
||||
|
||||
// For view controllers do the viewWill/viewDid dance, then pass view through
|
||||
if ([actual isKindOfClass:UIViewController.class]) {
|
||||
|
||||
[actual beginAppearanceTransition:YES animated:NO];
|
||||
[actual endAppearanceTransition];
|
||||
actual = [actual view];
|
||||
}
|
||||
|
||||
[EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:sanitizedTestPath() testCase:[self testCase] record:YES referenceDirectory:referenceImageDir error:&error];
|
||||
return NO;
|
||||
});
|
||||
|
||||
failureMessageForTo(^NSString *{
|
||||
if (!actual) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"Nil was passed into recordSnapshot." test:sanitizedTestPath() error:nil];
|
||||
}
|
||||
|
||||
if (!actualIsViewLayerOrViewController) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"Expected a View, Layer or View Controller." test:sanitizedTestPath() error:nil];
|
||||
}
|
||||
if (error) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"expected to record a snapshot in" test:sanitizedTestPath() error:error];
|
||||
} else {
|
||||
return [NSString stringWithFormat:@"snapshot %@ successfully recorded, replace recordSnapshot with a check", sanitizedTestPath()];
|
||||
}
|
||||
});
|
||||
|
||||
failureMessageForNotTo(^NSString *{
|
||||
if (error) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"expected to record a snapshot in" test:sanitizedTestPath() error:error];
|
||||
} else {
|
||||
return [NSString stringWithFormat:@"snapshot %@ successfully recorded, replace recordSnapshot with a check", sanitizedTestPath()];
|
||||
}
|
||||
});
|
||||
}
|
||||
EXPMatcherImplementationEnd
|
||||
|
||||
EXPMatcherImplementationBegin(haveValidSnapshotNamed, (NSString *snapshot)){
|
||||
BOOL snapshotIsNil = (snapshot == nil);
|
||||
__block NSError *error = nil;
|
||||
|
||||
prerequisite(^BOOL{
|
||||
return actual && !(snapshotIsNil);
|
||||
});
|
||||
|
||||
match(^BOOL{
|
||||
NSString *referenceImageDir = [self _getDefaultReferenceDirectory];
|
||||
if ([actual isKindOfClass:UIViewController.class]) {
|
||||
[actual beginAppearanceTransition:YES animated:NO];
|
||||
[actual endAppearanceTransition];
|
||||
|
||||
actual = [actual view];
|
||||
}
|
||||
return [EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:snapshot testCase:[self testCase] record:NO referenceDirectory:referenceImageDir error:&error];
|
||||
});
|
||||
|
||||
failureMessageForTo(^NSString *{
|
||||
if (!actual) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"Nil was passed into haveValidSnapshotNamed." test:sanitizedTestPath() error:nil];
|
||||
}
|
||||
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"expected a matching snapshot named" test:snapshot error:error];
|
||||
|
||||
});
|
||||
|
||||
failureMessageForNotTo(^NSString *{
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"expected not to have a matching snapshot named" test:snapshot error:error];
|
||||
});
|
||||
}
|
||||
EXPMatcherImplementationEnd
|
||||
|
||||
EXPMatcherImplementationBegin(recordSnapshotNamed, (NSString *snapshot)) {
|
||||
BOOL snapshotExists = (snapshot != nil);
|
||||
BOOL actualIsViewLayerOrViewController = ([actual isKindOfClass:UIView.class] || [actual isKindOfClass:CALayer.class] || [actual isKindOfClass:UIViewController.class]);
|
||||
__block NSError *error = nil;
|
||||
id actualRef = actual;
|
||||
|
||||
prerequisite(^BOOL{
|
||||
return actualRef && snapshotExists && actualIsViewLayerOrViewController;
|
||||
});
|
||||
|
||||
match(^BOOL{
|
||||
NSString *referenceImageDir = [self _getDefaultReferenceDirectory];
|
||||
|
||||
// For view controllers do the viewWill/viewDid dance, then pass view through
|
||||
if ([actual isKindOfClass:UIViewController.class]) {
|
||||
[actual beginAppearanceTransition:YES animated:NO];
|
||||
[actual endAppearanceTransition];
|
||||
actual = [actual view];
|
||||
}
|
||||
|
||||
[EXPExpectFBSnapshotTest compareSnapshotOfViewOrLayer:actual snapshot:snapshot testCase:[self testCase] record:YES referenceDirectory:referenceImageDir error:&error];
|
||||
return NO;
|
||||
});
|
||||
|
||||
failureMessageForTo(^NSString *{
|
||||
if (!actual) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"Nil was passed into recordSnapshotNamed." test:sanitizedTestPath() error:nil];
|
||||
}
|
||||
if (!actualIsViewLayerOrViewController) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"Expected a View, Layer or View Controller." test:snapshot error:nil];
|
||||
}
|
||||
if (error) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"expected to record a matching snapshot named" test:snapshot error:error];
|
||||
} else {
|
||||
return [NSString stringWithFormat:@"snapshot %@ successfully recorded, replace recordSnapshot with a check", snapshot];
|
||||
}
|
||||
});
|
||||
|
||||
failureMessageForNotTo(^NSString *{
|
||||
if (!actualIsViewLayerOrViewController) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"Expected a View, Layer or View Controller." test:snapshot error:nil];
|
||||
}
|
||||
if (error) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"expected to record a matching snapshot named" test:snapshot error:error];
|
||||
} else {
|
||||
return [NSString stringWithFormat:@"snapshot %@ successfully recorded, replace recordSnapshot with a check", snapshot];
|
||||
}
|
||||
});
|
||||
}
|
||||
EXPMatcherImplementationEnd
|
||||
17
Example/Pods/Expecta+Snapshots/ExpectaObject+FBSnapshotTest.h
generated
Normal file
@ -0,0 +1,17 @@
|
||||
//
|
||||
// ExpectaObject+FBSnapshotTest.h
|
||||
// Expecta+Snapshots
|
||||
//
|
||||
// Created by John Boiles on 8/3/15.
|
||||
// Copyright (c) 2015 Expecta+Snapshots All rights reserved.
|
||||
//
|
||||
|
||||
#import <Expecta/ExpectaObject.h>
|
||||
|
||||
@interface Expecta (FBSnapshotTest)
|
||||
|
||||
+ (void)setUsesDrawViewHierarchyInRect:(BOOL)usesDrawViewHierarchyInRect;
|
||||
|
||||
+ (BOOL)usesDrawViewHierarchyInRect;
|
||||
|
||||
@end
|
||||
25
Example/Pods/Expecta+Snapshots/ExpectaObject+FBSnapshotTest.m
generated
Normal file
@ -0,0 +1,25 @@
|
||||
//
|
||||
// ExpectaObject+FBSnapshotTest.m
|
||||
// Expecta+Snapshots
|
||||
//
|
||||
// Created by John Boiles on 8/3/15.
|
||||
// Copyright (c) 2015 Expecta+Snapshots All rights reserved.
|
||||
//
|
||||
|
||||
#import "ExpectaObject+FBSnapshotTest.h"
|
||||
#import <objc/runtime.h>
|
||||
|
||||
static NSString const *kUsesDrawViewHierarchyInRectKey = @"ExpectaObject+FBSnapshotTest.usesDrawViewHierarchyInRect";
|
||||
|
||||
@implementation Expecta (FBSnapshotTest)
|
||||
|
||||
+ (void)setUsesDrawViewHierarchyInRect:(BOOL)usesDrawViewHierarchyInRect {
|
||||
objc_setAssociatedObject(self, (__bridge const void *)(kUsesDrawViewHierarchyInRectKey), @(usesDrawViewHierarchyInRect), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
|
||||
+ (BOOL)usesDrawViewHierarchyInRect {
|
||||
NSNumber *usesDrawViewHierarchyInRect = objc_getAssociatedObject(self, (__bridge const void *)(kUsesDrawViewHierarchyInRectKey));
|
||||
return usesDrawViewHierarchyInRect.boolValue;
|
||||
}
|
||||
|
||||
@end
|
||||
22
Example/Pods/Expecta+Snapshots/LICENSE.md
generated
Normal file
@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014 Daniel Doubrovkine, Artsy Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
87
Example/Pods/Expecta+Snapshots/README.md
generated
Normal file
@ -0,0 +1,87 @@
|
||||
Expecta Matchers for FBSnapshotTestCase
|
||||
=======================================
|
||||
|
||||
[Expecta](https://github.com/specta/expecta) matchers for [ios-snapshot-test-case](https://github.com/facebook/ios-snapshot-test-case).
|
||||
|
||||
[](https://travis-ci.org/dblock/ios-snapshot-test-case-expecta)
|
||||
|
||||
### Usage
|
||||
|
||||
Add `Expecta+Snapshots` to your Podfile, the latest `FBSnapshotTestCase` will come in as a dependency.
|
||||
|
||||
``` ruby
|
||||
pod 'Expecta+Snapshots'
|
||||
```
|
||||
|
||||
### App setup
|
||||
|
||||
Use `expect(view).to.recordSnapshotNamed(@"unique snapshot name")` to record a snapshot and `expect(view).to.haveValidSnapshotNamed(@"unique snapshot name")` to check it.
|
||||
|
||||
If you project was compiled with Specta included, you have two extra methods that use the spec hierarchy to generate the snapshot name for you: `recordSnapshot()` and `haveValidSnapshot()`. You should only call these once per `it()` block.
|
||||
|
||||
If you need the `usesDrawViewHierarchyInRect` property in order to correctly render UIVisualEffect, UIAppearance and Size Classes, call `[Expecta setUsesDrawViewHierarchyInRect:NO];` inside `beforeAll`.
|
||||
|
||||
``` Objective-C
|
||||
#define EXP_SHORTHAND
|
||||
#include <Specta/Specta.h>
|
||||
#include <Expecta/Expecta.h>
|
||||
#include <Expecta+Snapshots/EXPMatchers+FBSnapshotTest.h>
|
||||
#include "FBExampleView.h"
|
||||
|
||||
SpecBegin(FBExampleView)
|
||||
|
||||
describe(@"manual matching", ^{
|
||||
|
||||
it(@"matches view", ^{
|
||||
FBExampleView *view = [[FBExampleView alloc] initWithFrame:CGRectMake(0, 0, 64, 64)];
|
||||
expect(view).to.recordSnapshotNamed(@"FBExampleView");
|
||||
expect(view).to.haveValidSnapshotNamed(@"FBExampleView");
|
||||
});
|
||||
|
||||
it(@"doesn't match a view", ^{
|
||||
FBExampleView *view = [[FBExampleView alloc] initWithFrame:CGRectMake(0, 0, 64, 64)];
|
||||
expect(view).toNot.haveValidSnapshotNamed(@"FBExampleViewDoesNotExist");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe(@"test name derived matching", ^{
|
||||
|
||||
it(@"matches view", ^{
|
||||
FBExampleView *view = [[FBExampleView alloc] initWithFrame:CGRectMake(0, 0, 64, 64)];
|
||||
expect(view).to.recordSnapshot();
|
||||
expect(view).to.haveValidSnapshot();
|
||||
});
|
||||
|
||||
it(@"doesn't match a view", ^{
|
||||
FBExampleView *view = [[FBExampleView alloc] initWithFrame:CGRectMake(0, 0, 64, 64)];
|
||||
expect(view).toNot.haveValidSnapshot();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
SpecEnd
|
||||
```
|
||||
|
||||
### Sane defaults
|
||||
|
||||
`EXPMatchers+FBSnapshotTest` will automatically figure out the tests folder, and [add a reference image](https://github.com/dblock/ios-snapshot-test-case-expecta/blob/master/EXPMatchers%2BFBSnapshotTest.m#L84-L85) directory, if you'd like to override this, you should include a `beforeAll` block setting the `setGlobalReferenceImageDir` in each file containing tests.
|
||||
|
||||
```
|
||||
beforeAll(^{
|
||||
setGlobalReferenceImageDir(FB_REFERENCE_IMAGE_DIR);
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
A complete project can be found in [FBSnapshotTestCaseDemo](FBSnapshotTestCaseDemo).
|
||||
|
||||
Notably, take a look at [FBSnapshotTestCaseDemoSpecs.m](FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoSpecs.m) for a complete example, which is an expanded Specta version version of [FBSnapshotTestCaseDemoTests.m](https://github.com/facebook/ios-snapshot-test-case/blob/master/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests.m).
|
||||
|
||||
Finally you can consult the tests for [ARTiledImageView](https://github.com/dblock/ARTiledImageView/tree/master/IntegrationTests) or [NAMapKit](https://github.com/neilang/NAMapKit/tree/master/Demo/DemoTests).
|
||||
|
||||
### License
|
||||
|
||||
MIT, see [LICENSE](LICENSE.md)
|
||||
8
Example/Pods/Expecta/Expecta/EXPDefines.h
generated
@ -9,9 +9,9 @@
|
||||
#ifndef Expecta_EXPDefines_h
|
||||
#define Expecta_EXPDefines_h
|
||||
|
||||
typedef void (^EXPBasicBlock)(void);
|
||||
typedef id (^EXPIdBlock)(void);
|
||||
typedef BOOL (^EXPBoolBlock)(void);
|
||||
typedef NSString *(^EXPStringBlock)(void);
|
||||
typedef void (^EXPBasicBlock)();
|
||||
typedef id (^EXPIdBlock)();
|
||||
typedef BOOL (^EXPBoolBlock)();
|
||||
typedef NSString *(^EXPStringBlock)();
|
||||
|
||||
#endif
|
||||
|
||||
@ -10,10 +10,6 @@ EXPMatcherImplementationBegin(respondTo, (SEL expected)) {
|
||||
});
|
||||
|
||||
match(^BOOL {
|
||||
if ([actual respondsToSelector:@selector(instancesRespondToSelector:)] &&
|
||||
[actual instancesRespondToSelector:expected]) {
|
||||
return YES;
|
||||
}
|
||||
return [actual respondsToSelector:expected];
|
||||
});
|
||||
|
||||
|
||||
140
Example/Pods/Expecta/README.md
generated
@ -1,8 +1,13 @@
|
||||
# Expecta [](https://travis-ci.org/specta/expecta) [](http://cocoadocs.org/docsets/Expecta/)
|
||||
#Expecta
|
||||
|
||||
[](https://travis-ci.org/specta/expecta)
|
||||
[](http://cocoadocs.org/docsets/Expecta/)
|
||||
[](http://cocoadocs.org/docsets/Expecta/)
|
||||
[](https://www.apache.org/licenses/LICENSE-2.0.html)
|
||||
|
||||
A matcher framework for Objective-C and Cocoa.
|
||||
|
||||
## FEATURES
|
||||
## Introduction
|
||||
|
||||
The main advantage of using Expecta over other matcher frameworks is that you do not have to specify the data types. Also, the syntax of Expecta matchers is much more readable and does not suffer from parenthesitis.
|
||||
|
||||
@ -13,10 +18,63 @@ expect([bar isBar]).to.equal(YES);
|
||||
expect(baz).to.equal(3.14159);
|
||||
```
|
||||
|
||||
Expecta is framework-agnostic: it works well with XCTest and XCTest-compatible test frameworks such as [Specta](http://github.com/petejkim/specta/), or [Kiwi](https://github.com/kiwi-bdd/Kiwi/).
|
||||
Expecta is framework-agnostic: it works well with XCTest and XCTest-compatible test frameworks such as [Specta](http://github.com/petejkim/specta/).
|
||||
|
||||
|
||||
## MATCHERS
|
||||
## Installation
|
||||
|
||||
You can setup Expecta using [Carthage](https://github.com/Carthage/Carthage), [CocoaPods](http://github.com/CocoaPods/CocoaPods) or [completely manually](#setting-up-manually).
|
||||
|
||||
### Carthage
|
||||
|
||||
1. Add Expecta to your project's `Cartfile.private`:
|
||||
|
||||
```ruby
|
||||
github "specta/expecta" "master"
|
||||
```
|
||||
|
||||
2. Run `carthage update` in your project directory.
|
||||
3. Drag the appropriate **Expecta.framework** for your platform (located in `Carthage/Build/`) into your application’s Xcode project, and add it to your test target(s).
|
||||
|
||||
### CocoaPods
|
||||
|
||||
1. Add Expecta to your project's `Podfile`:
|
||||
|
||||
```ruby
|
||||
target :MyApp do
|
||||
# Your app's dependencies
|
||||
end
|
||||
|
||||
target :MyAppTests do
|
||||
pod 'Expecta', '~> 1.0.0'
|
||||
end
|
||||
```
|
||||
|
||||
2. Run `pod update` or `pod install` in your project directory.
|
||||
|
||||
### Setting Up Manually
|
||||
|
||||
1. Clone Expecta from Github.
|
||||
2. Run `rake` in your project directory to build the frameworks and libraries.
|
||||
3. Add a Cocoa or Cocoa Touch Unit Testing Bundle target to your Xcode project if you don't already have one.
|
||||
4. For **OS X projects**, copy and add `Expecta.framework` in the `Products/osx` folder to your project's test target.
|
||||
|
||||
For **iOS projects**, copy and add `Expecta.framework` in the `Products/ios` folder to your project's test target.
|
||||
|
||||
You can also use `libExpecta.a` if you prefer to link Expecta as a static library — iOS 7.x and below require this.
|
||||
|
||||
6. Add `-ObjC` and `-all_load` to the **Other Linker Flags** build setting for the test target in your Xcode project.
|
||||
7. You can now use Expecta in your test classes by adding the following import:
|
||||
|
||||
```objective-c
|
||||
@import Expecta; // If you're using Expecta.framework
|
||||
|
||||
// OR
|
||||
|
||||
#import <Expecta/Expecta.h> // If you're using the static library, or the framework
|
||||
```
|
||||
|
||||
## Built-in Matchers
|
||||
|
||||
> `expect(x).to.equal(y);` compares objects or primitives x and y and passes if they are identical (==) or equivalent isEqual:).
|
||||
|
||||
@ -74,13 +132,13 @@ Expecta is framework-agnostic: it works well with XCTest and XCTest-compatible t
|
||||
|
||||
> `expect(x).to.match(y);` passes if an instance of NSString `x` matches regular expression (given as NSString) `y` one or more times.
|
||||
|
||||
### Inverting Matchers
|
||||
## Inverting Matchers
|
||||
|
||||
Every matcher's criteria can be inverted by prepending `.notTo` or `.toNot`:
|
||||
|
||||
>`expect(x).notTo.equal(y);` compares objects or primitives x and y and passes if they are *not* equivalent.
|
||||
|
||||
### Asynchronous Testing
|
||||
## Asynchronous Testing
|
||||
|
||||
Every matcher can be made to perform asynchronous testing by prepending `.will`, `.willNot` or `after(...)`:
|
||||
|
||||
@ -114,14 +172,14 @@ describe(@"Foo", ^{
|
||||
});
|
||||
```
|
||||
|
||||
### Forced Failing
|
||||
## Forced Failing
|
||||
|
||||
You can fail a test by using the `failure` attribute. This can be used to test branching.
|
||||
|
||||
> `failure(@"This should not happen");` outright fails a test.
|
||||
|
||||
|
||||
### WRITING NEW MATCHERS
|
||||
## Writing New Matchers
|
||||
|
||||
Writing a new matcher is easy with special macros provided by Expecta. Take a look at how `.beKindOf()` matcher is defined:
|
||||
|
||||
@ -188,7 +246,7 @@ EXPMatcherImplementationBegin(beKindOf, (Class expected)) {
|
||||
EXPMatcherImplementationEnd
|
||||
```
|
||||
|
||||
## DYNAMIC PREDICATE MATCHERS
|
||||
## Dynamic Predicate Matchers
|
||||
|
||||
It is possible to add predicate matchers by simply defining the matcher interface, with the matcher implementation being handled at runtime by delegating to the predicate method on your object.
|
||||
|
||||
@ -224,68 +282,6 @@ You can now write your assertion as follows:
|
||||
expect(lightSwitch).isTurnedOn();
|
||||
```
|
||||
|
||||
## INSTALLATION
|
||||
|
||||
You can setup Expecta using [CocoaPods](http://github.com/CocoaPods/CocoaPods), [Carthage](https://github.com/Carthage/Carthage) or [completely manually](#setting-up-manually).
|
||||
|
||||
### CocoaPods
|
||||
|
||||
1. Add Expecta to your project's `Podfile`:
|
||||
|
||||
```ruby
|
||||
target :MyApp do
|
||||
# your app dependencies
|
||||
|
||||
target :MyAppTests do
|
||||
inherit! search_paths
|
||||
|
||||
pod 'Expecta', '~> 1.0'
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
### Carthage
|
||||
|
||||
1. Add Expecta to your project's `Cartfile.private`:
|
||||
|
||||
```ruby
|
||||
github "specta/expecta" "master"
|
||||
```
|
||||
|
||||
2. Run `carthage update` in your project directory.
|
||||
3. Drag the appropriate **Expecta.framework** for your platform (located in `Carthage/Build/`) into your application’s Xcode project, and add it to your test target(s).
|
||||
|
||||
|
||||
2. Run `pod update` or `pod install` in your project directory.
|
||||
|
||||
### Setting Up Manually
|
||||
|
||||
1. Clone Expecta from Github.
|
||||
2. Run `rake` in your project directory to build the frameworks and libraries.
|
||||
3. Add a Cocoa or Cocoa Touch Unit Testing Bundle target to your Xcode project if you don't already have one.
|
||||
4. For **OS X projects**, copy and add `Expecta.framework` in the `Products/osx` folder to your project's test target.
|
||||
|
||||
For **iOS projects**, copy and add `Expecta.framework` in the `Products/ios` folder to your project's test target.
|
||||
|
||||
You can also use `libExpecta.a` if you prefer to link Expecta as a static library — iOS 7.x and below require this.
|
||||
|
||||
6. Add `-ObjC` and `-all_load` to the **Other Linker Flags** build setting for the test target in your Xcode project.
|
||||
7. You can now use Expecta in your test classes by adding the following import:
|
||||
|
||||
```objective-c
|
||||
@import Expecta; // If you're using Expecta.framework
|
||||
|
||||
// OR
|
||||
|
||||
#import <Expecta/Expecta.h> // If you're using the static library, or the framework
|
||||
```
|
||||
|
||||
## STATUS
|
||||
|
||||
Expecta, and Specta are considered done projects, there are no plans for _active_ development on the project at the moment aside from ensuring future Xcode compatability.
|
||||
Therefore it is a stable dependency, but will not be moving into the Swift world. If you are looking for that, we recommend you consider [Quick](https://github.com/quick/quick) and [Nimble](https://github.com/quick/nimble).
|
||||
|
||||
|
||||
## Contribution Guidelines
|
||||
|
||||
* Please use only spaces and indent 2 spaces at a time.
|
||||
@ -294,4 +290,4 @@ Therefore it is a stable dependency, but will not be moving into the Swift world
|
||||
|
||||
## License
|
||||
|
||||
Copyright (c) 2012-2016 [Specta Team](https://github.com/specta?tab=members). This software is licensed under the [MIT License](http://github.com/specta/specta/raw/master/LICENSE).
|
||||
Copyright (c) 2012-2015 [Specta Team](https://github.com/specta?tab=members). This software is licensed under the [MIT License](http://github.com/specta/specta/raw/master/LICENSE).
|
||||
|
||||
@ -22,20 +22,18 @@
|
||||
#import <FBSDKCoreKit/FBSDKGraphRequestConnection.h>
|
||||
#import <FBSDKCoreKit/FBSDKMacros.h>
|
||||
|
||||
/**
|
||||
Notification indicating that the `currentAccessToken` has changed.
|
||||
|
||||
the userInfo dictionary of the notification will contain keys
|
||||
/*!
|
||||
@abstract Notification indicating that the `currentAccessToken` has changed.
|
||||
@discussion the userInfo dictionary of the notification will contain keys
|
||||
`FBSDKAccessTokenChangeOldKey` and
|
||||
`FBSDKAccessTokenChangeNewKey`.
|
||||
*/
|
||||
FBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeNotification;
|
||||
|
||||
/**
|
||||
A key in the notification's userInfo that will be set
|
||||
/*!
|
||||
@abstract A key in the notification's userInfo that will be set
|
||||
if and only if the user ID changed between the old and new tokens.
|
||||
|
||||
Token refreshes can occur automatically with the SDK
|
||||
@discussion Token refreshes can occur automatically with the SDK
|
||||
which do not change the user. If you're only interested in user
|
||||
changes (such as logging out), you should check for the existence
|
||||
of this key. The value is a NSNumber with a boolValue.
|
||||
@ -47,76 +45,74 @@ FBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeNotification;
|
||||
FBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeUserID;
|
||||
|
||||
/*
|
||||
key in notification's userInfo object for getting the old token.
|
||||
|
||||
If there was no old token, the key will not be present.
|
||||
@abstract key in notification's userInfo object for getting the old token.
|
||||
@discussion If there was no old token, the key will not be present.
|
||||
*/
|
||||
FBSDK_EXTERN NSString *const FBSDKAccessTokenChangeOldKey;
|
||||
|
||||
/*
|
||||
key in notification's userInfo object for getting the new token.
|
||||
|
||||
If there is no new token, the key will not be present.
|
||||
@abstract key in notification's userInfo object for getting the new token.
|
||||
@discussion If there is no new token, the key will not be present.
|
||||
*/
|
||||
FBSDK_EXTERN NSString *const FBSDKAccessTokenChangeNewKey;
|
||||
|
||||
|
||||
/**
|
||||
Represents an immutable access token for using Facebook services.
|
||||
/*!
|
||||
@class FBSDKAccessToken
|
||||
@abstract Represents an immutable access token for using Facebook services.
|
||||
*/
|
||||
@interface FBSDKAccessToken : NSObject<FBSDKCopying, NSSecureCoding>
|
||||
|
||||
/**
|
||||
Returns the app ID.
|
||||
/*!
|
||||
@abstract Returns the app ID.
|
||||
*/
|
||||
@property (readonly, copy, nonatomic) NSString *appID;
|
||||
|
||||
/**
|
||||
Returns the known declined permissions.
|
||||
/*!
|
||||
@abstract Returns the known declined permissions.
|
||||
*/
|
||||
@property (readonly, copy, nonatomic) NSSet *declinedPermissions;
|
||||
|
||||
/**
|
||||
Returns the expiration date.
|
||||
/*!
|
||||
@abstract Returns the expiration date.
|
||||
*/
|
||||
@property (readonly, copy, nonatomic) NSDate *expirationDate;
|
||||
|
||||
/**
|
||||
Returns the known granted permissions.
|
||||
/*!
|
||||
@abstract Returns the known granted permissions.
|
||||
*/
|
||||
@property (readonly, copy, nonatomic) NSSet *permissions;
|
||||
|
||||
/**
|
||||
Returns the date the token was last refreshed.
|
||||
/*!
|
||||
@abstract Returns the date the token was last refreshed.
|
||||
*/
|
||||
@property (readonly, copy, nonatomic) NSDate *refreshDate;
|
||||
|
||||
/**
|
||||
Returns the opaque token string.
|
||||
/*!
|
||||
@abstract Returns the opaque token string.
|
||||
*/
|
||||
@property (readonly, copy, nonatomic) NSString *tokenString;
|
||||
|
||||
/**
|
||||
Returns the user ID.
|
||||
/*!
|
||||
@abstract Returns the user ID.
|
||||
*/
|
||||
@property (readonly, copy, nonatomic) NSString *userID;
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
+ (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
Initializes a new instance.
|
||||
- Parameter tokenString: the opaque token string.
|
||||
- Parameter permissions: the granted permissions. Note this is converted to NSSet and is only
|
||||
/*!
|
||||
@abstract Initializes a new instance.
|
||||
@param tokenString the opaque token string.
|
||||
@param permissions the granted permissions. Note this is converted to NSSet and is only
|
||||
an NSArray for the convenience of literal syntax.
|
||||
- Parameter declinedPermissions: the declined permissions. Note this is converted to NSSet and is only
|
||||
@param declinedPermissions the declined permissions. Note this is converted to NSSet and is only
|
||||
an NSArray for the convenience of literal syntax.
|
||||
- Parameter appID: the app ID.
|
||||
- Parameter userID: the user ID.
|
||||
- Parameter expirationDate: the optional expiration date (defaults to distantFuture).
|
||||
- Parameter refreshDate: the optional date the token was last refreshed (defaults to today).
|
||||
|
||||
This initializer should only be used for advanced apps that
|
||||
@param appID the app ID.
|
||||
@param userID the user ID.
|
||||
@param expirationDate the optional expiration date (defaults to distantFuture).
|
||||
@param refreshDate the optional date the token was last refreshed (defaults to today).
|
||||
@discussion This initializer should only be used for advanced apps that
|
||||
manage tokens explicitly. Typical login flows only need to use `FBSDKLoginManager`
|
||||
along with `+currentAccessToken`.
|
||||
*/
|
||||
@ -129,41 +125,38 @@ FBSDK_EXTERN NSString *const FBSDKAccessTokenChangeNewKey;
|
||||
refreshDate:(NSDate *)refreshDate
|
||||
NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
/**
|
||||
Convenience getter to determine if a permission has been granted
|
||||
- Parameter permission: The permission to check.
|
||||
/*!
|
||||
@abstract Convenience getter to determine if a permission has been granted
|
||||
@param permission The permission to check.
|
||||
*/
|
||||
- (BOOL)hasGranted:(NSString *)permission;
|
||||
|
||||
/**
|
||||
Compares the receiver to another FBSDKAccessToken
|
||||
- Parameter token: The other token
|
||||
- Returns: YES if the receiver's values are equal to the other token's values; otherwise NO
|
||||
/*!
|
||||
@abstract Compares the receiver to another FBSDKAccessToken
|
||||
@param token The other token
|
||||
@return YES if the receiver's values are equal to the other token's values; otherwise NO
|
||||
*/
|
||||
- (BOOL)isEqualToAccessToken:(FBSDKAccessToken *)token;
|
||||
|
||||
/**
|
||||
Returns the "global" access token that represents the currently logged in user.
|
||||
|
||||
The `currentAccessToken` is a convenient representation of the token of the
|
||||
/*!
|
||||
@abstract Returns the "global" access token that represents the currently logged in user.
|
||||
@discussion The `currentAccessToken` is a convenient representation of the token of the
|
||||
current user and is used by other SDK components (like `FBSDKLoginManager`).
|
||||
*/
|
||||
+ (FBSDKAccessToken *)currentAccessToken;
|
||||
|
||||
/**
|
||||
Sets the "global" access token that represents the currently logged in user.
|
||||
- Parameter token: The access token to set.
|
||||
|
||||
This will broadcast a notification and save the token to the app keychain.
|
||||
/*!
|
||||
@abstract Sets the "global" access token that represents the currently logged in user.
|
||||
@param token The access token to set.
|
||||
@discussion This will broadcast a notification and save the token to the app keychain.
|
||||
*/
|
||||
+ (void)setCurrentAccessToken:(FBSDKAccessToken *)token;
|
||||
|
||||
/**
|
||||
Refresh the current access token's permission state and extend the token's expiration date,
|
||||
/*!
|
||||
@abstract Refresh the current access token's permission state and extend the token's expiration date,
|
||||
if possible.
|
||||
- Parameter completionHandler: an optional callback handler that can surface any errors related to permission refreshing.
|
||||
|
||||
On a successful refresh, the currentAccessToken will be updated so you typically only need to
|
||||
@param completionHandler an optional callback handler that can surface any errors related to permission refreshing.
|
||||
@discussion On a successful refresh, the currentAccessToken will be updated so you typically only need to
|
||||
observe the `FBSDKAccessTokenDidChangeNotification` notification.
|
||||
|
||||
If a token is already expired, it cannot be refreshed.
|
||||
|
||||
@ -88,7 +88,7 @@ static FBSDKAccessToken *g_currentAccessToken;
|
||||
g_currentAccessToken = token;
|
||||
|
||||
// Only need to keep current session in web view for the case when token is current
|
||||
// When token is abandoned cookies must to be cleaned up immediately
|
||||
// When token is abandoned cookies must to be cleaned up immediatelly
|
||||
if (token == nil) {
|
||||
[FBSDKInternalUtility deleteFacebookCookies];
|
||||
}
|
||||
|
||||
@ -18,124 +18,114 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <FBSDKCoreKit/FBSDKGraphRequestConnection.h>
|
||||
|
||||
#import "FBSDKMacros.h"
|
||||
|
||||
@class FBSDKAccessToken;
|
||||
@class FBSDKGraphRequest;
|
||||
|
||||
/** NSNotificationCenter name indicating a result of a failed log flush attempt. The posted object will be an NSError instance. */
|
||||
/*! @abstract NSNotificationCenter name indicating a result of a failed log flush attempt. The posted object will be an NSError instance. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventsLoggingResultNotification;
|
||||
|
||||
/** optional plist key ("FacebookLoggingOverrideAppID") for setting `loggingOverrideAppID` */
|
||||
/*! @abstract optional plist key ("FacebookLoggingOverrideAppID") for setting `loggingOverrideAppID` */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventsOverrideAppIDBundleKey;
|
||||
|
||||
/**
|
||||
/*!
|
||||
|
||||
NS_ENUM (NSUInteger, FBSDKAppEventsFlushBehavior)
|
||||
@typedef NS_ENUM (NSUInteger, FBSDKAppEventsFlushBehavior)
|
||||
|
||||
Specifies when `FBSDKAppEvents` sends log events to the server.
|
||||
@abstract Specifies when `FBSDKAppEvents` sends log events to the server.
|
||||
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, FBSDKAppEventsFlushBehavior)
|
||||
{
|
||||
|
||||
/** Flush automatically: periodically (once a minute or every 100 logged events) and always at app reactivation. */
|
||||
/*! Flush automatically: periodically (once a minute or every 100 logged events) and always at app reactivation. */
|
||||
FBSDKAppEventsFlushBehaviorAuto = 0,
|
||||
|
||||
/** Only flush when the `flush` method is called. When an app is moved to background/terminated, the
|
||||
/*! Only flush when the `flush` method is called. When an app is moved to background/terminated, the
|
||||
events are persisted and re-established at activation, but they will only be written with an
|
||||
explicit call to `flush`. */
|
||||
FBSDKAppEventsFlushBehaviorExplicitOnly,
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
/*!
|
||||
@methodgroup Predefined event names for logging events common to many apps. Logging occurs through the `logEvent` family of methods on `FBSDKAppEvents`.
|
||||
Common event parameters are provided in the `FBSDKAppEventsParameterNames*` constants.
|
||||
*/
|
||||
|
||||
/** Log this event when the user has achieved a level in the app. */
|
||||
/*! Log this event when the user has achieved a level in the app. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventNameAchievedLevel;
|
||||
|
||||
/** Log this event when the user has entered their payment info. */
|
||||
/*! Log this event when the user has entered their payment info. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventNameAddedPaymentInfo;
|
||||
|
||||
/** Log this event when the user has added an item to their cart. The valueToSum passed to logEvent should be the item's price. */
|
||||
/*! Log this event when the user has added an item to their cart. The valueToSum passed to logEvent should be the item's price. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventNameAddedToCart;
|
||||
|
||||
/** Log this event when the user has added an item to their wishlist. The valueToSum passed to logEvent should be the item's price. */
|
||||
/*! Log this event when the user has added an item to their wishlist. The valueToSum passed to logEvent should be the item's price. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventNameAddedToWishlist;
|
||||
|
||||
/** Log this event when a user has completed registration with the app. */
|
||||
/*! Log this event when a user has completed registration with the app. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventNameCompletedRegistration;
|
||||
|
||||
/** Log this event when the user has completed a tutorial in the app. */
|
||||
/*! Log this event when the user has completed a tutorial in the app. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventNameCompletedTutorial;
|
||||
|
||||
/** Log this event when the user has entered the checkout process. The valueToSum passed to logEvent should be the total price in the cart. */
|
||||
/*! Log this event when the user has entered the checkout process. The valueToSum passed to logEvent should be the total price in the cart. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventNameInitiatedCheckout;
|
||||
|
||||
/** Log this event when the user has rated an item in the app. The valueToSum passed to logEvent should be the numeric rating. */
|
||||
/*! Log this event when the user has rated an item in the app. The valueToSum passed to logEvent should be the numeric rating. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventNameRated;
|
||||
|
||||
/** Log this event when a user has performed a search within the app. */
|
||||
/*! Log this event when a user has performed a search within the app. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventNameSearched;
|
||||
|
||||
/** Log this event when the user has spent app credits. The valueToSum passed to logEvent should be the number of credits spent. */
|
||||
/*! Log this event when the user has spent app credits. The valueToSum passed to logEvent should be the number of credits spent. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventNameSpentCredits;
|
||||
|
||||
/** Log this event when the user has unlocked an achievement in the app. */
|
||||
/*! Log this event when the user has unlocked an achievement in the app. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventNameUnlockedAchievement;
|
||||
|
||||
/** Log this event when a user has viewed a form of content in the app. */
|
||||
/*! Log this event when a user has viewed a form of content in the app. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventNameViewedContent;
|
||||
|
||||
/**
|
||||
/*!
|
||||
@methodgroup Predefined event name parameters for common additional information to accompany events logged through the `logEvent` family
|
||||
of methods on `FBSDKAppEvents`. Common event names are provided in the `FBAppEventName*` constants.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Parameter key used to specify data for the one or more pieces of content being logged about.
|
||||
* Data should be a JSON encoded string.
|
||||
* Example:
|
||||
* "[{\"id\": \"1234\", \"quantity\": 2, \"item_price\": 5.99}, {\"id\": \"5678\", \"quantity\": 1, \"item_price\": 9.99}]"
|
||||
*/
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameContent;
|
||||
|
||||
/** Parameter key used to specify an ID for the specific piece of content being logged about. Could be an EAN, article identifier, etc., depending on the nature of the app. */
|
||||
/*! Parameter key used to specify an ID for the specific piece of content being logged about. Could be an EAN, article identifier, etc., depending on the nature of the app. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameContentID;
|
||||
|
||||
/** Parameter key used to specify a generic content type/family for the logged event, e.g. "music", "photo", "video". Options to use will vary based upon what the app is all about. */
|
||||
/*! Parameter key used to specify a generic content type/family for the logged event, e.g. "music", "photo", "video". Options to use will vary based upon what the app is all about. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameContentType;
|
||||
|
||||
/** Parameter key used to specify currency used with logged event. E.g. "USD", "EUR", "GBP". See ISO-4217 for specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>. */
|
||||
/*! Parameter key used to specify currency used with logged event. E.g. "USD", "EUR", "GBP". See ISO-4217 for specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameCurrency;
|
||||
|
||||
/** Parameter key used to specify a description appropriate to the event being logged. E.g., the name of the achievement unlocked in the `FBAppEventNameAchievementUnlocked` event. */
|
||||
/*! Parameter key used to specify a description appropriate to the event being logged. E.g., the name of the achievement unlocked in the `FBAppEventNameAchievementUnlocked` event. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameDescription;
|
||||
|
||||
/** Parameter key used to specify the level achieved in a `FBAppEventNameAchieved` event. */
|
||||
/*! Parameter key used to specify the level achieved in a `FBAppEventNameAchieved` event. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameLevel;
|
||||
|
||||
/** Parameter key used to specify the maximum rating available for the `FBAppEventNameRate` event. E.g., "5" or "10". */
|
||||
/*! Parameter key used to specify the maximum rating available for the `FBAppEventNameRate` event. E.g., "5" or "10". */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameMaxRatingValue;
|
||||
|
||||
/** Parameter key used to specify how many items are being processed for an `FBAppEventNameInitiatedCheckout` or `FBAppEventNamePurchased` event. */
|
||||
/*! Parameter key used to specify how many items are being processed for an `FBAppEventNameInitiatedCheckout` or `FBAppEventNamePurchased` event. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameNumItems;
|
||||
|
||||
/** Parameter key used to specify whether payment info is available for the `FBAppEventNameInitiatedCheckout` event. `FBSDKAppEventParameterValueYes` and `FBSDKAppEventParameterValueNo` are good canonical values to use for this parameter. */
|
||||
/*! Parameter key used to specify whether payment info is available for the `FBAppEventNameInitiatedCheckout` event. `FBSDKAppEventParameterValueYes` and `FBSDKAppEventParameterValueNo` are good canonical values to use for this parameter. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventParameterNamePaymentInfoAvailable;
|
||||
|
||||
/** Parameter key used to specify method user has used to register for the app, e.g., "Facebook", "email", "Twitter", etc */
|
||||
/*! Parameter key used to specify method user has used to register for the app, e.g., "Facebook", "email", "Twitter", etc */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameRegistrationMethod;
|
||||
|
||||
/** Parameter key used to specify the string provided by the user for a search operation. */
|
||||
/*! Parameter key used to specify the string provided by the user for a search operation. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameSearchString;
|
||||
|
||||
/** Parameter key used to specify whether the activity being logged about was successful or not. `FBSDKAppEventParameterValueYes` and `FBSDKAppEventParameterValueNo` are good canonical values to use for this parameter. */
|
||||
/*! Parameter key used to specify whether the activity being logged about was successful or not. `FBSDKAppEventParameterValueYes` and `FBSDKAppEventParameterValueNo` are good canonical values to use for this parameter. */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameSuccess;
|
||||
|
||||
/*
|
||||
@ -143,21 +133,22 @@ FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameSuccess;
|
||||
of methods on `FBSDKAppEvents`. Common event parameters are provided in the `FBSDKAppEventParameterName*` constants.
|
||||
*/
|
||||
|
||||
/** Yes-valued parameter value to be used with parameter keys that need a Yes/No value */
|
||||
/*! Yes-valued parameter value to be used with parameter keys that need a Yes/No value */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueYes;
|
||||
|
||||
/** No-valued parameter value to be used with parameter keys that need a Yes/No value */
|
||||
/*! No-valued parameter value to be used with parameter keys that need a Yes/No value */
|
||||
FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueNo;
|
||||
|
||||
|
||||
/**
|
||||
/*!
|
||||
|
||||
@class FBSDKAppEvents
|
||||
|
||||
@abstract
|
||||
Client-side event logging for specialized application analytics available through Facebook App Insights
|
||||
and for use with Facebook Ads conversion tracking and optimization.
|
||||
|
||||
|
||||
|
||||
@discussion
|
||||
The `FBSDKAppEvents` static class has a few related roles:
|
||||
|
||||
+ Logging predefined and application-defined events to Facebook App Insights with a
|
||||
@ -205,39 +196,42 @@ FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueNo;
|
||||
* Basic event logging
|
||||
*/
|
||||
|
||||
/**
|
||||
/*!
|
||||
|
||||
@abstract
|
||||
Log an event with just an eventName.
|
||||
|
||||
- Parameter eventName: The name of the event to record. Limitations on number of events and name length
|
||||
@param eventName The name of the event to record. Limitations on number of events and name length
|
||||
are given in the `FBSDKAppEvents` documentation.
|
||||
|
||||
*/
|
||||
+ (void)logEvent:(NSString *)eventName;
|
||||
|
||||
/**
|
||||
/*!
|
||||
|
||||
@abstract
|
||||
Log an event with an eventName and a numeric value to be aggregated with other events of this name.
|
||||
|
||||
- Parameter eventName: The name of the event to record. Limitations on number of events and name length
|
||||
@param eventName The name of the event to record. Limitations on number of events and name length
|
||||
are given in the `FBSDKAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants.
|
||||
|
||||
- Parameter valueToSum: Amount to be aggregated into all events of this eventName, and App Insights will report
|
||||
@param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report
|
||||
the cumulative and average value of this amount.
|
||||
*/
|
||||
+ (void)logEvent:(NSString *)eventName
|
||||
valueToSum:(double)valueToSum;
|
||||
|
||||
|
||||
/**
|
||||
/*!
|
||||
|
||||
@abstract
|
||||
Log an event with an eventName and a set of key/value pairs in the parameters dictionary.
|
||||
Parameter limitations are described above.
|
||||
|
||||
- Parameter eventName: The name of the event to record. Limitations on number of events and name construction
|
||||
@param eventName The name of the event to record. Limitations on number of events and name construction
|
||||
are given in the `FBSDKAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants.
|
||||
|
||||
- Parameter parameters: Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
|
||||
@param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
|
||||
be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of
|
||||
parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names
|
||||
are provided in `FBSDKAppEventParameterName*` constants.
|
||||
@ -245,18 +239,19 @@ FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueNo;
|
||||
+ (void)logEvent:(NSString *)eventName
|
||||
parameters:(NSDictionary *)parameters;
|
||||
|
||||
/**
|
||||
/*!
|
||||
|
||||
@abstract
|
||||
Log an event with an eventName, a numeric value to be aggregated with other events of this name,
|
||||
and a set of key/value pairs in the parameters dictionary.
|
||||
|
||||
- Parameter eventName: The name of the event to record. Limitations on number of events and name construction
|
||||
@param eventName The name of the event to record. Limitations on number of events and name construction
|
||||
are given in the `FBSDKAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants.
|
||||
|
||||
- Parameter valueToSum: Amount to be aggregated into all events of this eventName, and App Insights will report
|
||||
@param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report
|
||||
the cumulative and average value of this amount.
|
||||
|
||||
- Parameter parameters: Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
|
||||
@param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
|
||||
be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of
|
||||
parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names
|
||||
are provided in `FBSDKAppEventParameterName*` constants.
|
||||
@ -267,25 +262,26 @@ FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueNo;
|
||||
parameters:(NSDictionary *)parameters;
|
||||
|
||||
|
||||
/**
|
||||
/*!
|
||||
|
||||
@abstract
|
||||
Log an event with an eventName, a numeric value to be aggregated with other events of this name,
|
||||
and a set of key/value pairs in the parameters dictionary. Providing session lets the developer
|
||||
target a particular <FBSession>. If nil is provided, then `[FBSession activeSession]` will be used.
|
||||
|
||||
- Parameter eventName: The name of the event to record. Limitations on number of events and name construction
|
||||
@param eventName The name of the event to record. Limitations on number of events and name construction
|
||||
are given in the `FBSDKAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants.
|
||||
|
||||
- Parameter valueToSum: Amount to be aggregated into all events of this eventName, and App Insights will report
|
||||
@param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report
|
||||
the cumulative and average value of this amount. Note that this is an NSNumber, and a value of `nil` denotes
|
||||
that this event doesn't have a value associated with it for summation.
|
||||
|
||||
- Parameter parameters: Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
|
||||
@param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
|
||||
be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of
|
||||
parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names
|
||||
are provided in `FBSDKAppEventParameterName*` constants.
|
||||
|
||||
- Parameter accessToken: The optional access token to log the event as.
|
||||
@param accessToken The optional access token to log the event as.
|
||||
*/
|
||||
+ (void)logEvent:(NSString *)eventName
|
||||
valueToSum:(NSNumber *)valueToSum
|
||||
@ -296,42 +292,42 @@ FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueNo;
|
||||
* Purchase logging
|
||||
*/
|
||||
|
||||
/**
|
||||
/*!
|
||||
|
||||
@abstract
|
||||
Log a purchase of the specified amount, in the specified currency.
|
||||
|
||||
- Parameter purchaseAmount: Purchase amount to be logged, as expressed in the specified currency. This value
|
||||
@param purchaseAmount Purchase amount to be logged, as expressed in the specified currency. This value
|
||||
will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346).
|
||||
|
||||
- Parameter currency: Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for
|
||||
@param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for
|
||||
specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>.
|
||||
|
||||
|
||||
This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set
|
||||
@discussion This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set
|
||||
to `FBSDKAppEventsFlushBehaviorExplicitOnly`.
|
||||
|
||||
*/
|
||||
+ (void)logPurchase:(double)purchaseAmount
|
||||
currency:(NSString *)currency;
|
||||
|
||||
/**
|
||||
/*!
|
||||
|
||||
@abstract
|
||||
Log a purchase of the specified amount, in the specified currency, also providing a set of
|
||||
additional characteristics describing the purchase.
|
||||
|
||||
- Parameter purchaseAmount: Purchase amount to be logged, as expressed in the specified currency.This value
|
||||
@param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value
|
||||
will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346).
|
||||
|
||||
- Parameter currency: Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for
|
||||
@param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for
|
||||
specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>.
|
||||
|
||||
- Parameter parameters: Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
|
||||
@param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
|
||||
be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of
|
||||
parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names
|
||||
are provided in `FBSDKAppEventParameterName*` constants.
|
||||
|
||||
|
||||
This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set
|
||||
@discussion This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set
|
||||
to `FBSDKAppEventsFlushBehaviorExplicitOnly`.
|
||||
|
||||
*/
|
||||
@ -339,26 +335,26 @@ FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueNo;
|
||||
currency:(NSString *)currency
|
||||
parameters:(NSDictionary *)parameters;
|
||||
|
||||
/**
|
||||
/*!
|
||||
|
||||
@abstract
|
||||
Log a purchase of the specified amount, in the specified currency, also providing a set of
|
||||
additional characteristics describing the purchase, as well as an <FBSession> to log to.
|
||||
|
||||
- Parameter purchaseAmount: Purchase amount to be logged, as expressed in the specified currency.This value
|
||||
@param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value
|
||||
will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346).
|
||||
|
||||
- Parameter currency: Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for
|
||||
@param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for
|
||||
specific values. One reference for these is <http://en.wikipedia.org/wiki/ISO_4217>.
|
||||
|
||||
- Parameter parameters: Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
|
||||
@param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must
|
||||
be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of
|
||||
parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names
|
||||
are provided in `FBSDKAppEventParameterName*` constants.
|
||||
|
||||
- Parameter accessToken: The optional access token to log the event as.
|
||||
@param accessToken The optional access token to log the event as.
|
||||
|
||||
|
||||
This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set
|
||||
@discussion This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set
|
||||
to `FBSDKAppEventsFlushBehaviorExplicitOnly`.
|
||||
|
||||
*/
|
||||
@ -367,39 +363,16 @@ FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueNo;
|
||||
parameters:(NSDictionary *)parameters
|
||||
accessToken:(FBSDKAccessToken *)accessToken;
|
||||
|
||||
/*!
|
||||
|
||||
/*
|
||||
* Push Notifications Logging
|
||||
*/
|
||||
|
||||
/**
|
||||
Log an app event that tracks that the application was open via Push Notification.
|
||||
|
||||
- Parameter payload: Notification payload received via `UIApplicationDelegate`.
|
||||
*/
|
||||
+ (void)logPushNotificationOpen:(NSDictionary *)payload;
|
||||
|
||||
/**
|
||||
Log an app event that tracks that a custom action was taken from a push notification.
|
||||
|
||||
- Parameter payload: Notification payload received via `UIApplicationDelegate`.
|
||||
- Parameter action: Name of the action that was taken.
|
||||
*/
|
||||
+ (void)logPushNotificationOpen:(NSDictionary *)payload action:(NSString *)action;
|
||||
|
||||
/**
|
||||
|
||||
Notifies the events system that the app has launched and, when appropriate, logs an "activated app" event.
|
||||
This function is called automatically from FBSDKApplicationDelegate applicationDidBecomeActive, unless
|
||||
one overrides 'FacebookAutoLogAppEventsEnabled' key to false in the project info plist file.
|
||||
In case 'FacebookAutoLogAppEventsEnabled' is set to false, then it should typically be placed in the
|
||||
@abstract
|
||||
Notifies the events system that the app has launched and, when appropriate, logs an "activated app" event. Should typically be placed in the
|
||||
app delegates' `applicationDidBecomeActive:` method.
|
||||
|
||||
This method also takes care of logging the event indicating the first time this app has been launched, which, among other things, is used to
|
||||
track user acquisition and app install ads conversions.
|
||||
|
||||
|
||||
|
||||
@discussion
|
||||
`activateApp` will not log an event on every app launch, since launches happen every time the app is backgrounded and then foregrounded.
|
||||
"activated app" events will be logged when the app has not been active for more than 60 seconds. This method also causes a "deactivated app"
|
||||
event to be logged when sessions are "completed", and these events are logged with the session length, with an indication of how much
|
||||
@ -408,44 +381,31 @@ FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueNo;
|
||||
*/
|
||||
+ (void)activateApp;
|
||||
|
||||
/*
|
||||
* Push Notifications Registration
|
||||
*/
|
||||
|
||||
/**
|
||||
Sets and sends device token to register the current application for push notifications.
|
||||
|
||||
|
||||
|
||||
Sets and sends a device token from `NSData` representation that you get from `UIApplicationDelegate.-application:didRegisterForRemoteNotificationsWithDeviceToken:`.
|
||||
|
||||
- Parameter deviceToken: Device token data.
|
||||
*/
|
||||
+ (void)setPushNotificationsDeviceToken:(NSData *)deviceToken;
|
||||
|
||||
/*
|
||||
* Control over event batching/flushing
|
||||
*/
|
||||
|
||||
/**
|
||||
/*!
|
||||
|
||||
@abstract
|
||||
Get the current event flushing behavior specifying when events are sent back to Facebook servers.
|
||||
*/
|
||||
+ (FBSDKAppEventsFlushBehavior)flushBehavior;
|
||||
|
||||
/**
|
||||
/*!
|
||||
|
||||
@abstract
|
||||
Set the current event flushing behavior specifying when events are sent back to Facebook servers.
|
||||
|
||||
- Parameter flushBehavior: The desired `FBSDKAppEventsFlushBehavior` to be used.
|
||||
@param flushBehavior The desired `FBSDKAppEventsFlushBehavior` to be used.
|
||||
*/
|
||||
+ (void)setFlushBehavior:(FBSDKAppEventsFlushBehavior)flushBehavior;
|
||||
|
||||
/**
|
||||
/*!
|
||||
@abstract
|
||||
Set the 'override' App ID for App Event logging.
|
||||
|
||||
|
||||
|
||||
@discussion
|
||||
In some cases, apps want to use one Facebook App ID for login and social presence and another
|
||||
for App Event logging. (An example is if multiple apps from the same company share an app ID for login, but
|
||||
want distinct logging.) By default, this value is `nil`, and defers to the `FBSDKAppEventsOverrideAppIDBundleKey`
|
||||
@ -454,36 +414,37 @@ FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueNo;
|
||||
This should be set before any other calls are made to `FBSDKAppEvents`. Thus, you should set it in your application
|
||||
delegate's `application:didFinishLaunchingWithOptions:` delegate.
|
||||
|
||||
- Parameter appID: The Facebook App ID to be used for App Event logging.
|
||||
@param appID The Facebook App ID to be used for App Event logging.
|
||||
*/
|
||||
+ (void)setLoggingOverrideAppID:(NSString *)appID;
|
||||
|
||||
/**
|
||||
/*!
|
||||
@abstract
|
||||
Get the 'override' App ID for App Event logging.
|
||||
|
||||
|
||||
- See:setLoggingOverrideAppID:
|
||||
@see setLoggingOverrideAppID:
|
||||
|
||||
*/
|
||||
+ (NSString *)loggingOverrideAppID;
|
||||
|
||||
|
||||
/**
|
||||
/*!
|
||||
@abstract
|
||||
Explicitly kick off flushing of events to Facebook. This is an asynchronous method, but it does initiate an immediate
|
||||
kick off. Server failures will be reported through the NotificationCenter with notification ID `FBSDKAppEventsLoggingResultNotification`.
|
||||
*/
|
||||
+ (void)flush;
|
||||
|
||||
/**
|
||||
/*!
|
||||
@abstract
|
||||
Creates a request representing the Graph API call to retrieve a Custom Audience "third party ID" for the app's Facebook user.
|
||||
Callers will send this ID back to their own servers, collect up a set to create a Facebook Custom Audience with,
|
||||
and then use the resultant Custom Audience to target ads.
|
||||
|
||||
- Parameter accessToken: The access token to use to establish the user's identity for users logged into Facebook through this app.
|
||||
@param accessToken The access token to use to establish the user's identity for users logged into Facebook through this app.
|
||||
If `nil`, then the `[FBSDKAccessToken currentAccessToken]` is used.
|
||||
|
||||
|
||||
|
||||
@discussion
|
||||
The JSON in the request's response will include an "custom_audience_third_party_id" key/value pair, with the value being the ID retrieved.
|
||||
This ID is an encrypted encoding of the Facebook user's ID and the invoking Facebook app ID.
|
||||
Multiple calls with the same user will return different IDs, thus these IDs cannot be used to correlate behavior
|
||||
@ -498,26 +459,4 @@ FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueNo;
|
||||
via the `[FBSDKSettings limitEventAndDataUsage]` flag, or a specific Facebook user cannot be identified.
|
||||
*/
|
||||
+ (FBSDKGraphRequest *)requestForCustomAudienceThirdPartyIDWithAccessToken:(FBSDKAccessToken *)accessToken;
|
||||
|
||||
/*
|
||||
Sets a custom user ID to associate with all app events.
|
||||
|
||||
The userID is persisted until it is cleared by passing nil.
|
||||
*/
|
||||
+ (void)setUserID:(NSString *)userID;
|
||||
|
||||
/*
|
||||
Returns the set custom user ID.
|
||||
*/
|
||||
+ (NSString *)userID;
|
||||
|
||||
/*
|
||||
Sends a request to update the properties for the current user, set by `setUserID:`
|
||||
|
||||
You must call `FBSDKAppEvents setUserID:` before making this call.
|
||||
- Parameter properties: the custom user properties
|
||||
- Parameter handler: the optional completion handler
|
||||
*/
|
||||
+ (void)updateUserProperties:(NSDictionary *)properties handler:(FBSDKGraphRequestHandler)handler;
|
||||
|
||||
@end
|
||||
|
||||