diff --git a/Example/PNObject.xcodeproj/project.pbxproj b/Example/PNObject.xcodeproj/project.pbxproj index 02ccb74..5f7f8b6 100644 --- a/Example/PNObject.xcodeproj/project.pbxproj +++ b/Example/PNObject.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 53C421B84353460222F804A8 /* Pods_PNObject_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EDBFECABE1A134EE7367CBB /* Pods_PNObject_Tests.framework */; }; 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; @@ -22,7 +21,8 @@ 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; - AA9A7961F721D2808331C31C /* Pods_PNObject_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 735A2BAFE207F03633333189 /* Pods_PNObject_Example.framework */; }; + 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 */ @@ -36,10 +36,10 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 36ECBD74F99336E5BDC21E3B /* 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 = ""; }; - 3989914EE9D4AE7262889F3C /* 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 = ""; }; - 3CBA2C7C904FFAB75D5BD363 /* 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 = ""; }; - 6003F58A195388D20070C39A /* PNObject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = PNObject.app; path = PNObject_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 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 = ""; }; + 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 = ""; }; + 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; }; 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; @@ -52,19 +52,20 @@ 6003F5A5195388D20070C39A /* PNObjectViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PNObjectViewController.h; sourceTree = ""; }; 6003F5A6195388D20070C39A /* PNObjectViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PNObjectViewController.m; sourceTree = ""; }; 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 6003F5AE195388D20070C39A /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = Tests.xctest; path = PNObject_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 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; }; 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; - 735A2BAFE207F03633333189 /* Pods_PNObject_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PNObject_Example.framework; 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 = ""; }; 75FCB4EFD17838CCA4C93E4A /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 8C017F9292D546DE8DBC84F8 /* PNObject.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = PNObject.podspec; path = ../PNObject.podspec; sourceTree = ""; }; - 9EDBFECABE1A134EE7367CBB /* Pods_PNObject_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PNObject_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 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 = ""; }; BA17B1571B43FAFAA8B45B6D /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; - F3DC4DA0142F06ED6D3AF9C8 /* 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 = ""; }; + 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,7 +76,7 @@ 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, - AA9A7961F721D2808331C31C /* Pods_PNObject_Example.framework in Frameworks */, + E1806AD43C05C089D52D136E /* Pods_PNObject_Example.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -86,24 +87,13 @@ 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, - 53C421B84353460222F804A8 /* Pods_PNObject_Tests.framework in Frameworks */, + DA43246C4FB8B8B587FC2343 /* Pods_PNObject_Tests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 4962A3B245BAF62C3D480A46 /* Pods */ = { - isa = PBXGroup; - children = ( - 36ECBD74F99336E5BDC21E3B /* Pods-PNObject_Example.debug.xcconfig */, - 3989914EE9D4AE7262889F3C /* Pods-PNObject_Example.release.xcconfig */, - F3DC4DA0142F06ED6D3AF9C8 /* Pods-PNObject_Tests.debug.xcconfig */, - 3CBA2C7C904FFAB75D5BD363 /* Pods-PNObject_Tests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; 6003F581195388D10070C39A = { isa = PBXGroup; children = ( @@ -112,15 +102,15 @@ 6003F5B5195388D20070C39A /* Tests */, 6003F58C195388D20070C39A /* Frameworks */, 6003F58B195388D20070C39A /* Products */, - 4962A3B245BAF62C3D480A46 /* Pods */, + 700947C2A719D2A125954296 /* Pods */, ); sourceTree = ""; }; 6003F58B195388D20070C39A /* Products */ = { isa = PBXGroup; children = ( - 6003F58A195388D20070C39A /* PNObject.app */, - 6003F5AE195388D20070C39A /* Tests.xctest */, + 6003F58A195388D20070C39A /* PNObject_Example.app */, + 6003F5AE195388D20070C39A /* PNObject_Tests.xctest */, ); name = Products; sourceTree = ""; @@ -132,8 +122,9 @@ 6003F58F195388D20070C39A /* CoreGraphics.framework */, 6003F591195388D20070C39A /* UIKit.framework */, 6003F5AF195388D20070C39A /* XCTest.framework */, - 735A2BAFE207F03633333189 /* Pods_PNObject_Example.framework */, - 9EDBFECABE1A134EE7367CBB /* Pods_PNObject_Tests.framework */, + DE7587A588720F0590F50755 /* Pods.framework */, + D73089A9DA261B19C7C342EA /* Pods_PNObject_Example.framework */, + 5CB6B6AE8DC4C8FBEC56DD55 /* Pods_PNObject_Tests.framework */, ); name = Frameworks; sourceTree = ""; @@ -193,6 +184,17 @@ name = "Podspec Metadata"; sourceTree = ""; }; + 700947C2A719D2A125954296 /* Pods */ = { + isa = PBXGroup; + children = ( + 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 = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -200,12 +202,12 @@ isa = PBXNativeTarget; buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "PNObject_Example" */; buildPhases = ( - 4DAADC552762DC37B4B8CD02 /* Check Pods Manifest.lock */, + 647B517E2FE18AF68E8B23C3 /* Check Pods Manifest.lock */, 6003F586195388D20070C39A /* Sources */, 6003F587195388D20070C39A /* Frameworks */, 6003F588195388D20070C39A /* Resources */, - EE64BB7B652F34D3170ABF9E /* Embed Pods Frameworks */, - 185F28E1CE0B5816FEC13A0C /* Copy Pods Resources */, + 43252B3B955A9E6FDF55EF8C /* Embed Pods Frameworks */, + 12D318BA313DC2FC036858CF /* Copy Pods Resources */, ); buildRules = ( ); @@ -213,19 +215,19 @@ ); name = PNObject_Example; productName = PNObject; - productReference = 6003F58A195388D20070C39A /* PNObject.app */; + productReference = 6003F58A195388D20070C39A /* PNObject_Example.app */; productType = "com.apple.product-type.application"; }; 6003F5AD195388D20070C39A /* PNObject_Tests */ = { isa = PBXNativeTarget; buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "PNObject_Tests" */; buildPhases = ( - 729AC854342281E271E708EB /* Check Pods Manifest.lock */, + 13BC374C48C25E4BE960A7C4 /* Check Pods Manifest.lock */, 6003F5AA195388D20070C39A /* Sources */, 6003F5AB195388D20070C39A /* Frameworks */, 6003F5AC195388D20070C39A /* Resources */, - 8D4BB440B1F5DACCBCE0EC39 /* Embed Pods Frameworks */, - F02880F07CE819D7B69A779C /* Copy Pods Resources */, + 66B08B1481C5994108A958AF /* Embed Pods Frameworks */, + 5B13AE8F18948BE84DDA2DC9 /* Copy Pods Resources */, ); buildRules = ( ); @@ -234,7 +236,7 @@ ); name = PNObject_Tests; productName = PNObjectTests; - productReference = 6003F5AE195388D20070C39A /* Tests.xctest */; + productReference = 6003F5AE195388D20070C39A /* PNObject_Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ @@ -293,7 +295,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 185F28E1CE0B5816FEC13A0C /* Copy Pods Resources */ = { + 12D318BA313DC2FC036858CF /* Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -308,7 +310,7 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 4DAADC552762DC37B4B8CD02 /* Check Pods Manifest.lock */ = { + 13BC374C48C25E4BE960A7C4 /* Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -323,37 +325,7 @@ 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; }; - 729AC854342281E271E708EB /* 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; - }; - 8D4BB440B1F5DACCBCE0EC39 /* 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; - }; - EE64BB7B652F34D3170ABF9E /* Embed Pods Frameworks */ = { + 43252B3B955A9E6FDF55EF8C /* Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -368,7 +340,7 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - F02880F07CE819D7B69A779C /* Copy Pods Resources */ = { + 5B13AE8F18948BE84DDA2DC9 /* Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -383,6 +355,36 @@ 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 */ /* Begin PBXSourcesBuildPhase section */ @@ -508,7 +510,7 @@ }; 6003F5C0195388D20070C39A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 36ECBD74F99336E5BDC21E3B /* Pods-PNObject_Example.debug.xcconfig */; + baseConfigurationReference = 6ADA851464A35438E6A21617 /* Pods-PNObject_Example.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; @@ -523,7 +525,7 @@ }; 6003F5C1195388D20070C39A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3989914EE9D4AE7262889F3C /* Pods-PNObject_Example.release.xcconfig */; + baseConfigurationReference = 02B34A3054AF72076F57C9F2 /* Pods-PNObject_Example.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; @@ -538,7 +540,7 @@ }; 6003F5C3195388D20070C39A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F3DC4DA0142F06ED6D3AF9C8 /* Pods-PNObject_Tests.debug.xcconfig */; + baseConfigurationReference = 0D4ADFA41B2B242C25CEC692 /* Pods-PNObject_Tests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; FRAMEWORK_SEARCH_PATHS = ( @@ -561,7 +563,7 @@ }; 6003F5C4195388D20070C39A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3CBA2C7C904FFAB75D5BD363 /* Pods-PNObject_Tests.release.xcconfig */; + baseConfigurationReference = 9984F97E974B595ED43BA3E3 /* Pods-PNObject_Tests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; FRAMEWORK_SEARCH_PATHS = ( diff --git a/Example/PNObject.xcworkspace/contents.xcworkspacedata b/Example/PNObject.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..ad21fe8 --- /dev/null +++ b/Example/PNObject.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Example/PNObject/PNObjectViewController.m b/Example/PNObject/PNObjectViewController.m index d7584ad..079ef37 100644 --- a/Example/PNObject/PNObjectViewController.m +++ b/Example/PNObject/PNObjectViewController.m @@ -7,6 +7,7 @@ // #import "PNObjectViewController.h" +//#import "PNObject.h" @interface PNObjectViewController () diff --git a/Example/Podfile b/Example/Podfile index b5e45ee..eb2cad1 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -1,11 +1,17 @@ source 'https://github.com/CocoaPods/Specs.git' use_frameworks! -target 'PNObject_Example', :exclusive => true do + + +target 'PNObject_Example' do pod "PNObject", :path => "../" + pod 'PEAR-FileManager-iOS' + pod 'NSDate_Utils' + pod 'UIDevice-Utils' + pod 'AFNetworking' end -target 'PNObject_Tests', :exclusive => true do +target 'PNObject_Tests' do pod "PNObject", :path => "../" pod 'Specta' diff --git a/Example/Podfile.lock b/Example/Podfile.lock new file mode 100644 index 0000000..095972a --- /dev/null +++ b/Example/Podfile.lock @@ -0,0 +1,60 @@ +PODS: + - AFNetworking (3.0.4): + - AFNetworking/NSURLSession (= 3.0.4) + - AFNetworking/Reachability (= 3.0.4) + - AFNetworking/Security (= 3.0.4) + - AFNetworking/Serialization (= 3.0.4) + - AFNetworking/UIKit (= 3.0.4) + - AFNetworking/NSURLSession (3.0.4): + - AFNetworking/Reachability + - AFNetworking/Security + - AFNetworking/Serialization + - AFNetworking/Reachability (3.0.4) + - AFNetworking/Security (3.0.4) + - AFNetworking/Serialization (3.0.4) + - AFNetworking/UIKit (3.0.4): + - AFNetworking/NSURLSession + - Expecta (1.0.5) + - Expecta+Snapshots (2.0.0): + - Expecta (~> 1.0) + - FBSnapshotTestCase/Core (~> 2.0.3) + - FBSnapshotTestCase (2.0.7): + - FBSnapshotTestCase/SwiftSupport (= 2.0.7) + - FBSnapshotTestCase/Core (2.0.7) + - FBSnapshotTestCase/SwiftSupport (2.0.7): + - FBSnapshotTestCase/Core + - NSDate_Utils (0.1.0) + - PEAR-FileManager-iOS (1.3.1) + - PNObject (0.1.0) + - Specta (1.0.5) + - UIDevice-Utils (0.1.2) + +DEPENDENCIES: + - AFNetworking + - Expecta + - Expecta+Snapshots + - FBSnapshotTestCase + - NSDate_Utils + - PEAR-FileManager-iOS + - PNObject (from `../`) + - Specta + - UIDevice-Utils + +EXTERNAL SOURCES: + PNObject: + :path: "../" + +SPEC CHECKSUMS: + AFNetworking: a0075feb321559dc78d9d85b55d11caa19eabb93 + Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe + Expecta+Snapshots: 29b38dd695bc72a0ed2bea833937d78df41943ba + FBSnapshotTestCase: 7e85180d0d141a0cf472352edda7e80d7eaeb547 + NSDate_Utils: 4a57f91094123d5b7600c7de8c9ad9e1d43306a3 + PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3 + PNObject: c76ad7edcc1e09717e48eb9554f6d6eb422ea70e + Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2 + UIDevice-Utils: 14362004e88f8cc05d8ec68369724a5972faadec + +PODFILE CHECKSUM: 6a156edc70605054ee3ec9b0a6d6af416e100bf0 + +COCOAPODS: 1.0.0.beta.1 diff --git a/Example/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h b/Example/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h new file mode 100644 index 0000000..55ed92e --- /dev/null +++ b/Example/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h @@ -0,0 +1,295 @@ +// AFHTTPSessionManager.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import +#if !TARGET_OS_WATCH +#import +#endif +#import + +#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV +#import +#else +#import +#endif + +#import "AFURLSessionManager.h" + +/** + `AFHTTPSessionManager` is a subclass of `AFURLSessionManager` with convenience methods for making HTTP requests. When a `baseURL` is provided, requests made with the `GET` / `POST` / et al. convenience methods can be made with relative paths. + + ## Subclassing Notes + + Developers targeting iOS 7 or Mac OS X 10.9 or later that deal extensively with a web service are encouraged to subclass `AFHTTPSessionManager`, providing a class method that returns a shared singleton object on which authentication and other configuration can be shared across the application. + + For developers targeting iOS 6 or Mac OS X 10.8 or earlier, `AFHTTPRequestOperationManager` may be used to similar effect. + + ## Methods to Override + + To change the behavior of all data task operation construction, which is also used in the `GET` / `POST` / et al. convenience methods, override `dataTaskWithRequest:completionHandler:`. + + ## Serialization + + Requests created by an HTTP client will contain default headers and encode parameters according to the `requestSerializer` property, which is an object conforming to ``. + + Responses received from the server are automatically validated and serialized by the `responseSerializers` property, which is an object conforming to `` + + ## URL Construction Using Relative Paths + + For HTTP convenience methods, the request serializer constructs URLs from the path relative to the `-baseURL`, using `NSURL +URLWithString:relativeToURL:`, when provided. If `baseURL` is `nil`, `path` needs to resolve to a valid `NSURL` object using `NSURL +URLWithString:`. + + Below are a few examples of how `baseURL` and relative paths interact: + + NSURL *baseURL = [NSURL URLWithString:@"http://example.com/v1/"]; + [NSURL URLWithString:@"foo" relativeToURL:baseURL]; // http://example.com/v1/foo + [NSURL URLWithString:@"foo?bar=baz" relativeToURL:baseURL]; // http://example.com/v1/foo?bar=baz + [NSURL URLWithString:@"/foo" relativeToURL:baseURL]; // http://example.com/foo + [NSURL URLWithString:@"foo/" relativeToURL:baseURL]; // http://example.com/v1/foo + [NSURL URLWithString:@"/foo/" relativeToURL:baseURL]; // http://example.com/foo/ + [NSURL URLWithString:@"http://example2.com/" relativeToURL:baseURL]; // http://example2.com/ + + Also important to note is that a trailing slash will be added to any `baseURL` without one. This would otherwise cause unexpected behavior when constructing URLs using paths without a leading slash. + + @warning Managers for background sessions must be owned for the duration of their use. This can be accomplished by creating an application-wide or shared singleton instance. + */ + +NS_ASSUME_NONNULL_BEGIN + +@interface AFHTTPSessionManager : AFURLSessionManager + +/** + The URL used to construct requests from relative paths in methods like `requestWithMethod:URLString:parameters:`, and the `GET` / `POST` / et al. convenience methods. + */ +@property (readonly, nonatomic, strong, nullable) NSURL *baseURL; + +/** + Requests created with `requestWithMethod:URLString:parameters:` & `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:` are constructed with a set of default headers using a parameter serialization specified by this property. By default, this is set to an instance of `AFHTTPRequestSerializer`, which serializes query string parameters for `GET`, `HEAD`, and `DELETE` requests, or otherwise URL-form-encodes HTTP message bodies. + + @warning `requestSerializer` must not be `nil`. + */ +@property (nonatomic, strong) AFHTTPRequestSerializer * requestSerializer; + +/** + Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an instance of `AFJSONResponseSerializer`. + + @warning `responseSerializer` must not be `nil`. + */ +@property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; + +///--------------------- +/// @name Initialization +///--------------------- + +/** + Creates and returns an `AFHTTPSessionManager` object. + */ ++ (instancetype)manager; + +/** + Initializes an `AFHTTPSessionManager` object with the specified base URL. + + @param url The base URL for the HTTP client. + + @return The newly-initialized HTTP client + */ +- (instancetype)initWithBaseURL:(nullable NSURL *)url; + +/** + Initializes an `AFHTTPSessionManager` object with the specified base URL. + + This is the designated initializer. + + @param url The base URL for the HTTP client. + @param configuration The configuration used to create the managed session. + + @return The newly-initialized HTTP client + */ +- (instancetype)initWithBaseURL:(nullable NSURL *)url + sessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER; + +///--------------------------- +/// @name Making HTTP Requests +///--------------------------- + +/** + Creates and runs an `NSURLSessionDataTask` with a `GET` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; + + +/** + Creates and runs an `NSURLSessionDataTask` with a `GET` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param progress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: + */ +- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString + parameters:(nullable id)parameters + progress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgress + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `HEAD` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes a single arguments: the data task. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `POST` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; + +/** + Creates and runs an `NSURLSessionDataTask` with a `POST` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param progress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: + */ +- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + progress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgress + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + constructingBodyWithBlock:(nullable void (^)(id formData))block + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; + +/** + Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. + @param progress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: + */ +- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + constructingBodyWithBlock:(nullable void (^)(id formData))block + progress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgress + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `PUT` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `PATCH` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `DELETE` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Example/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m b/Example/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m new file mode 100644 index 0000000..a28cc6e --- /dev/null +++ b/Example/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m @@ -0,0 +1,361 @@ +// AFHTTPSessionManager.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "AFHTTPSessionManager.h" + +#import "AFURLRequestSerialization.h" +#import "AFURLResponseSerialization.h" + +#import +#import +#import + +#import +#import +#import +#import +#import + +#if TARGET_OS_IOS || TARGET_OS_TV +#import +#elif TARGET_OS_WATCH +#import +#endif + +@interface AFHTTPSessionManager () +@property (readwrite, nonatomic, strong) NSURL *baseURL; +@end + +@implementation AFHTTPSessionManager +@dynamic responseSerializer; + ++ (instancetype)manager { + return [[[self class] alloc] initWithBaseURL:nil]; +} + +- (instancetype)init { + return [self initWithBaseURL:nil]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url { + return [self initWithBaseURL:url sessionConfiguration:nil]; +} + +- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration { + return [self initWithBaseURL:nil sessionConfiguration:configuration]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url + sessionConfiguration:(NSURLSessionConfiguration *)configuration +{ + self = [super initWithSessionConfiguration:configuration]; + if (!self) { + return nil; + } + + // Ensure terminal slash for baseURL path, so that NSURL +URLWithString:relativeToURL: works as expected + if ([[url path] length] > 0 && ![[url absoluteString] hasSuffix:@"/"]) { + url = [url URLByAppendingPathComponent:@""]; + } + + self.baseURL = url; + + self.requestSerializer = [AFHTTPRequestSerializer serializer]; + self.responseSerializer = [AFJSONResponseSerializer serializer]; + + return self; +} + +#pragma mark - + +- (void)setRequestSerializer:(AFHTTPRequestSerializer *)requestSerializer { + NSParameterAssert(requestSerializer); + + _requestSerializer = requestSerializer; +} + +- (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer { + NSParameterAssert(responseSerializer); + + [super setResponseSerializer:responseSerializer]; +} + +#pragma mark - + +- (NSURLSessionDataTask *)GET:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +{ + + return [self GET:URLString parameters:parameters progress:nil success:success failure:failure]; +} + +- (NSURLSessionDataTask *)GET:(NSString *)URLString + parameters:(id)parameters + progress:(void (^)(NSProgress * _Nonnull))downloadProgress + success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success + failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure +{ + + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"GET" + URLString:URLString + parameters:parameters + uploadProgress:nil + downloadProgress:downloadProgress + success:success + failure:failure]; + + [dataTask resume]; + + return dataTask; +} + +- (NSURLSessionDataTask *)HEAD:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +{ + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:^(NSURLSessionDataTask *task, __unused id responseObject) { + if (success) { + success(task); + } + } failure:failure]; + + [dataTask resume]; + + return dataTask; +} + +- (NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +{ + return [self POST:URLString parameters:parameters progress:nil success:success failure:failure]; +} + +- (NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(id)parameters + progress:(void (^)(NSProgress * _Nonnull))uploadProgress + success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success + failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure +{ + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"POST" URLString:URLString parameters:parameters uploadProgress:uploadProgress downloadProgress:nil success:success failure:failure]; + + [dataTask resume]; + + return dataTask; +} + +- (NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + constructingBodyWithBlock:(nullable void (^)(id _Nonnull))block + success:(nullable void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure +{ + return [self POST:URLString parameters:parameters constructingBodyWithBlock:block progress:nil success:success failure:failure]; +} + +- (NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(id)parameters + constructingBodyWithBlock:(void (^)(id formData))block + progress:(nullable void (^)(NSProgress * _Nonnull))uploadProgress + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +{ + NSError *serializationError = nil; + NSMutableURLRequest *request = [self.requestSerializer multipartFormRequestWithMethod:@"POST" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters constructingBodyWithBlock:block error:&serializationError]; + if (serializationError) { + if (failure) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{ + failure(nil, serializationError); + }); +#pragma clang diagnostic pop + } + + return nil; + } + + __block NSURLSessionDataTask *task = [self uploadTaskWithStreamedRequest:request progress:uploadProgress completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) { + if (error) { + if (failure) { + failure(task, error); + } + } else { + if (success) { + success(task, responseObject); + } + } + }]; + + [task resume]; + + return task; +} + +- (NSURLSessionDataTask *)PUT:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +{ + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure]; + + [dataTask resume]; + + return dataTask; +} + +- (NSURLSessionDataTask *)PATCH:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +{ + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure]; + + [dataTask resume]; + + return dataTask; +} + +- (NSURLSessionDataTask *)DELETE:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +{ + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"DELETE" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure]; + + [dataTask resume]; + + return dataTask; +} + +- (NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(id)parameters + uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgress + downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgress + success:(void (^)(NSURLSessionDataTask *, id))success + failure:(void (^)(NSURLSessionDataTask *, NSError *))failure +{ + NSError *serializationError = nil; + NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:method URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:&serializationError]; + if (serializationError) { + if (failure) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{ + failure(nil, serializationError); + }); +#pragma clang diagnostic pop + } + + return nil; + } + + __block NSURLSessionDataTask *dataTask = nil; + dataTask = [self dataTaskWithRequest:request + uploadProgress:uploadProgress + downloadProgress:downloadProgress + completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) { + if (error) { + if (failure) { + failure(dataTask, error); + } + } else { + if (success) { + success(dataTask, responseObject); + } + } + }]; + + return dataTask; +} + +#pragma mark - NSObject + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@: %p, baseURL: %@, session: %@, operationQueue: %@>", NSStringFromClass([self class]), self, [self.baseURL absoluteString], self.session, self.operationQueue]; +} + +#pragma mark - NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)initWithCoder:(NSCoder *)decoder { + NSURL *baseURL = [decoder decodeObjectOfClass:[NSURL class] forKey:NSStringFromSelector(@selector(baseURL))]; + NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"]; + if (!configuration) { + NSString *configurationIdentifier = [decoder decodeObjectOfClass:[NSString class] forKey:@"identifier"]; + if (configurationIdentifier) { +#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1100) + configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:configurationIdentifier]; +#else + configuration = [NSURLSessionConfiguration backgroundSessionConfiguration:configurationIdentifier]; +#endif + } + } + + self = [self initWithBaseURL:baseURL sessionConfiguration:configuration]; + if (!self) { + return nil; + } + + self.requestSerializer = [decoder decodeObjectOfClass:[AFHTTPRequestSerializer class] forKey:NSStringFromSelector(@selector(requestSerializer))]; + self.responseSerializer = [decoder decodeObjectOfClass:[AFHTTPResponseSerializer class] forKey:NSStringFromSelector(@selector(responseSerializer))]; + AFSecurityPolicy *decodedPolicy = [decoder decodeObjectOfClass:[AFSecurityPolicy class] forKey:NSStringFromSelector(@selector(securityPolicy))]; + if (decodedPolicy) { + self.securityPolicy = decodedPolicy; + } + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeObject:self.baseURL forKey:NSStringFromSelector(@selector(baseURL))]; + if ([self.session.configuration conformsToProtocol:@protocol(NSCoding)]) { + [coder encodeObject:self.session.configuration forKey:@"sessionConfiguration"]; + } else { + [coder encodeObject:self.session.configuration.identifier forKey:@"identifier"]; + } + [coder encodeObject:self.requestSerializer forKey:NSStringFromSelector(@selector(requestSerializer))]; + [coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))]; + [coder encodeObject:self.securityPolicy forKey:NSStringFromSelector(@selector(securityPolicy))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFHTTPSessionManager *HTTPClient = [[[self class] allocWithZone:zone] initWithBaseURL:self.baseURL sessionConfiguration:self.session.configuration]; + + HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone]; + HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone]; + HTTPClient.securityPolicy = [self.securityPolicy copyWithZone:zone]; + return HTTPClient; +} + +@end diff --git a/Example/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h b/Example/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h new file mode 100644 index 0000000..4cf0496 --- /dev/null +++ b/Example/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h @@ -0,0 +1,206 @@ +// AFNetworkReachabilityManager.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#if !TARGET_OS_WATCH +#import + +typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) { + AFNetworkReachabilityStatusUnknown = -1, + AFNetworkReachabilityStatusNotReachable = 0, + AFNetworkReachabilityStatusReachableViaWWAN = 1, + AFNetworkReachabilityStatusReachableViaWiFi = 2, +}; + +NS_ASSUME_NONNULL_BEGIN + +/** + `AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces. + + Reachability can be used to determine background information about why a network operation failed, or to trigger a network operation retrying when a connection is established. It should not be used to prevent a user from initiating a network request, as it's possible that an initial request may be required to establish reachability. + + See Apple's Reachability Sample Code (https://developer.apple.com/library/ios/samplecode/reachability/) + + @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined. + */ +@interface AFNetworkReachabilityManager : NSObject + +/** + The current network reachability status. + */ +@property (readonly, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus; + +/** + Whether or not the network is currently reachable. + */ +@property (readonly, nonatomic, assign, getter = isReachable) BOOL reachable; + +/** + Whether or not the network is currently reachable via WWAN. + */ +@property (readonly, nonatomic, assign, getter = isReachableViaWWAN) BOOL reachableViaWWAN; + +/** + Whether or not the network is currently reachable via WiFi. + */ +@property (readonly, nonatomic, assign, getter = isReachableViaWiFi) BOOL reachableViaWiFi; + +///--------------------- +/// @name Initialization +///--------------------- + +/** + Returns the shared network reachability manager. + */ ++ (instancetype)sharedManager; + +/** + Creates and returns a network reachability manager with the default socket address. + + @return An initialized network reachability manager, actively monitoring the default socket address. + */ ++ (instancetype)manager; + +/** + Creates and returns a network reachability manager for the specified domain. + + @param domain The domain used to evaluate network reachability. + + @return An initialized network reachability manager, actively monitoring the specified domain. + */ ++ (instancetype)managerForDomain:(NSString *)domain; + +/** + Creates and returns a network reachability manager for the socket address. + + @param address The socket address (`sockaddr_in6`) used to evaluate network reachability. + + @return An initialized network reachability manager, actively monitoring the specified socket address. + */ ++ (instancetype)managerForAddress:(const void *)address; + +/** + Initializes an instance of a network reachability manager from the specified reachability object. + + @param reachability The reachability object to monitor. + + @return An initialized network reachability manager, actively monitoring the specified reachability. + */ +- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER; + +///-------------------------------------------------- +/// @name Starting & Stopping Reachability Monitoring +///-------------------------------------------------- + +/** + Starts monitoring for changes in network reachability status. + */ +- (void)startMonitoring; + +/** + Stops monitoring for changes in network reachability status. + */ +- (void)stopMonitoring; + +///------------------------------------------------- +/// @name Getting Localized Reachability Description +///------------------------------------------------- + +/** + Returns a localized string representation of the current network reachability status. + */ +- (NSString *)localizedNetworkReachabilityStatusString; + +///--------------------------------------------------- +/// @name Setting Network Reachability Change Callback +///--------------------------------------------------- + +/** + Sets a callback to be executed when the network availability of the `baseURL` host changes. + + @param block A block object to be executed when the network availability of the `baseURL` host changes.. This block has no return value and takes a single argument which represents the various reachability states from the device to the `baseURL`. + */ +- (void)setReachabilityStatusChangeBlock:(nullable void (^)(AFNetworkReachabilityStatus status))block; + +@end + +///---------------- +/// @name Constants +///---------------- + +/** + ## Network Reachability + + The following constants are provided by `AFNetworkReachabilityManager` as possible network reachability statuses. + + enum { + AFNetworkReachabilityStatusUnknown, + AFNetworkReachabilityStatusNotReachable, + AFNetworkReachabilityStatusReachableViaWWAN, + AFNetworkReachabilityStatusReachableViaWiFi, + } + + `AFNetworkReachabilityStatusUnknown` + The `baseURL` host reachability is not known. + + `AFNetworkReachabilityStatusNotReachable` + The `baseURL` host cannot be reached. + + `AFNetworkReachabilityStatusReachableViaWWAN` + The `baseURL` host can be reached via a cellular connection, such as EDGE or GPRS. + + `AFNetworkReachabilityStatusReachableViaWiFi` + The `baseURL` host can be reached via a Wi-Fi connection. + + ### Keys for Notification UserInfo Dictionary + + Strings that are used as keys in a `userInfo` dictionary in a network reachability status change notification. + + `AFNetworkingReachabilityNotificationStatusItem` + A key in the userInfo dictionary in a `AFNetworkingReachabilityDidChangeNotification` notification. + The corresponding value is an `NSNumber` object representing the `AFNetworkReachabilityStatus` value for the current reachability status. + */ + +///-------------------- +/// @name Notifications +///-------------------- + +/** + Posted when network reachability changes. + This notification assigns no notification object. The `userInfo` dictionary contains an `NSNumber` object under the `AFNetworkingReachabilityNotificationStatusItem` key, representing the `AFNetworkReachabilityStatus` value for the current network reachability. + + @warning In order for network reachability to be monitored, include the `SystemConfiguration` framework in the active target's "Link Binary With Library" build phase, and add `#import ` to the header prefix of the project (`Prefix.pch`). + */ +FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityDidChangeNotification; +FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityNotificationStatusItem; + +///-------------------- +/// @name Functions +///-------------------- + +/** + Returns a localized string representation of an `AFNetworkReachabilityStatus` value. + */ +FOUNDATION_EXPORT NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status); + +NS_ASSUME_NONNULL_END +#endif diff --git a/Example/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m b/Example/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m new file mode 100644 index 0000000..5fba0f7 --- /dev/null +++ b/Example/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m @@ -0,0 +1,260 @@ +// AFNetworkReachabilityManager.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "AFNetworkReachabilityManager.h" +#if !TARGET_OS_WATCH + +#import +#import +#import +#import +#import + +NSString * const AFNetworkingReachabilityDidChangeNotification = @"com.alamofire.networking.reachability.change"; +NSString * const AFNetworkingReachabilityNotificationStatusItem = @"AFNetworkingReachabilityNotificationStatusItem"; + +typedef void (^AFNetworkReachabilityStatusBlock)(AFNetworkReachabilityStatus status); + +NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status) { + switch (status) { + case AFNetworkReachabilityStatusNotReachable: + return NSLocalizedStringFromTable(@"Not Reachable", @"AFNetworking", nil); + case AFNetworkReachabilityStatusReachableViaWWAN: + return NSLocalizedStringFromTable(@"Reachable via WWAN", @"AFNetworking", nil); + case AFNetworkReachabilityStatusReachableViaWiFi: + return NSLocalizedStringFromTable(@"Reachable via WiFi", @"AFNetworking", nil); + case AFNetworkReachabilityStatusUnknown: + default: + return NSLocalizedStringFromTable(@"Unknown", @"AFNetworking", nil); + } +} + +static AFNetworkReachabilityStatus AFNetworkReachabilityStatusForFlags(SCNetworkReachabilityFlags flags) { + BOOL isReachable = ((flags & kSCNetworkReachabilityFlagsReachable) != 0); + BOOL needsConnection = ((flags & kSCNetworkReachabilityFlagsConnectionRequired) != 0); + BOOL canConnectionAutomatically = (((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || ((flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)); + BOOL canConnectWithoutUserInteraction = (canConnectionAutomatically && (flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0); + BOOL isNetworkReachable = (isReachable && (!needsConnection || canConnectWithoutUserInteraction)); + + AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusUnknown; + if (isNetworkReachable == NO) { + status = AFNetworkReachabilityStatusNotReachable; + } +#if TARGET_OS_IPHONE + else if ((flags & kSCNetworkReachabilityFlagsIsWWAN) != 0) { + status = AFNetworkReachabilityStatusReachableViaWWAN; + } +#endif + else { + status = AFNetworkReachabilityStatusReachableViaWiFi; + } + + return status; +} + +/** + * Queue a status change notification for the main thread. + * + * This is done to ensure that the notifications are received in the same order + * as they are sent. If notifications are sent directly, it is possible that + * a queued notification (for an earlier status condition) is processed after + * the later update, resulting in the listener being left in the wrong state. + */ +static void AFPostReachabilityStatusChange(SCNetworkReachabilityFlags flags, AFNetworkReachabilityStatusBlock block) { + AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags); + dispatch_async(dispatch_get_main_queue(), ^{ + if (block) { + block(status); + } + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + NSDictionary *userInfo = @{ AFNetworkingReachabilityNotificationStatusItem: @(status) }; + [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:userInfo]; + }); +} + +static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) { + AFPostReachabilityStatusChange(flags, (__bridge AFNetworkReachabilityStatusBlock)info); +} + + +static const void * AFNetworkReachabilityRetainCallback(const void *info) { + return Block_copy(info); +} + +static void AFNetworkReachabilityReleaseCallback(const void *info) { + if (info) { + Block_release(info); + } +} + +@interface AFNetworkReachabilityManager () +@property (readwrite, nonatomic, strong) id networkReachability; +@property (readwrite, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus; +@property (readwrite, nonatomic, copy) AFNetworkReachabilityStatusBlock networkReachabilityStatusBlock; +@end + +@implementation AFNetworkReachabilityManager + ++ (instancetype)sharedManager { + static AFNetworkReachabilityManager *_sharedManager = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _sharedManager = [self manager]; + }); + + return _sharedManager; +} + +#ifndef __clang_analyzer__ ++ (instancetype)managerForDomain:(NSString *)domain { + SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, [domain UTF8String]); + + AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability]; + + return manager; +} +#endif + +#ifndef __clang_analyzer__ ++ (instancetype)managerForAddress:(const void *)address { + SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)address); + AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability]; + + return manager; +} +#endif + ++ (instancetype)manager +{ +#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) + struct sockaddr_in6 address; + bzero(&address, sizeof(address)); + address.sin6_len = sizeof(address); + address.sin6_family = AF_INET6; +#else + struct sockaddr_in address; + bzero(&address, sizeof(address)); + address.sin_len = sizeof(address); + address.sin_family = AF_INET; +#endif + return [self managerForAddress:&address]; +} + +- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability { + self = [super init]; + if (!self) { + return nil; + } + + self.networkReachability = CFBridgingRelease(reachability); + self.networkReachabilityStatus = AFNetworkReachabilityStatusUnknown; + + return self; +} + +- (instancetype)init NS_UNAVAILABLE +{ + return nil; +} + +- (void)dealloc { + [self stopMonitoring]; +} + +#pragma mark - + +- (BOOL)isReachable { + return [self isReachableViaWWAN] || [self isReachableViaWiFi]; +} + +- (BOOL)isReachableViaWWAN { + return self.networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWWAN; +} + +- (BOOL)isReachableViaWiFi { + return self.networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWiFi; +} + +#pragma mark - + +- (void)startMonitoring { + [self stopMonitoring]; + + if (!self.networkReachability) { + return; + } + + __weak __typeof(self)weakSelf = self; + AFNetworkReachabilityStatusBlock callback = ^(AFNetworkReachabilityStatus status) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + + strongSelf.networkReachabilityStatus = status; + if (strongSelf.networkReachabilityStatusBlock) { + strongSelf.networkReachabilityStatusBlock(status); + } + + }; + + id networkReachability = self.networkReachability; + SCNetworkReachabilityContext context = {0, (__bridge void *)callback, AFNetworkReachabilityRetainCallback, AFNetworkReachabilityReleaseCallback, NULL}; + SCNetworkReachabilitySetCallback((__bridge SCNetworkReachabilityRef)networkReachability, AFNetworkReachabilityCallback, &context); + SCNetworkReachabilityScheduleWithRunLoop((__bridge SCNetworkReachabilityRef)networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes); + + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0),^{ + SCNetworkReachabilityFlags flags; + if (SCNetworkReachabilityGetFlags((__bridge SCNetworkReachabilityRef)networkReachability, &flags)) { + AFPostReachabilityStatusChange(flags, callback); + } + }); +} + +- (void)stopMonitoring { + if (!self.networkReachability) { + return; + } + + SCNetworkReachabilityUnscheduleFromRunLoop((__bridge SCNetworkReachabilityRef)self.networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes); +} + +#pragma mark - + +- (NSString *)localizedNetworkReachabilityStatusString { + return AFStringFromNetworkReachabilityStatus(self.networkReachabilityStatus); +} + +#pragma mark - + +- (void)setReachabilityStatusChangeBlock:(void (^)(AFNetworkReachabilityStatus status))block { + self.networkReachabilityStatusBlock = block; +} + +#pragma mark - NSKeyValueObserving + ++ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key { + if ([key isEqualToString:@"reachable"] || [key isEqualToString:@"reachableViaWWAN"] || [key isEqualToString:@"reachableViaWiFi"]) { + return [NSSet setWithObject:@"networkReachabilityStatus"]; + } + + return [super keyPathsForValuesAffectingValueForKey:key]; +} + +@end +#endif diff --git a/Example/Pods/AFNetworking/AFNetworking/AFNetworking.h b/Example/Pods/AFNetworking/AFNetworking/AFNetworking.h new file mode 100644 index 0000000..e2fb2f4 --- /dev/null +++ b/Example/Pods/AFNetworking/AFNetworking/AFNetworking.h @@ -0,0 +1,41 @@ +// AFNetworking.h +// +// Copyright (c) 2013 AFNetworking (http://afnetworking.com/) +// +// 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. + +#import +#import +#import + +#ifndef _AFNETWORKING_ + #define _AFNETWORKING_ + + #import "AFURLRequestSerialization.h" + #import "AFURLResponseSerialization.h" + #import "AFSecurityPolicy.h" + +#if !TARGET_OS_WATCH + #import "AFNetworkReachabilityManager.h" +#endif + + #import "AFURLSessionManager.h" + #import "AFHTTPSessionManager.h" + +#endif /* _AFNETWORKING_ */ diff --git a/Example/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h b/Example/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h new file mode 100644 index 0000000..90fa212 --- /dev/null +++ b/Example/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h @@ -0,0 +1,154 @@ +// AFSecurityPolicy.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import +#import + +typedef NS_ENUM(NSUInteger, AFSSLPinningMode) { + AFSSLPinningModeNone, + AFSSLPinningModePublicKey, + AFSSLPinningModeCertificate, +}; + +/** + `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections. + + Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled. + */ + +NS_ASSUME_NONNULL_BEGIN + +@interface AFSecurityPolicy : NSObject + +/** + The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`. + */ +@property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode; + +/** + The certificates used to evaluate server trust according to the SSL pinning mode. + + By default, this property is set to any (`.cer`) certificates included in the target compiling AFNetworking. Note that if you are using AFNetworking as embedded framework, no certificates will be pinned by default. Use `certificatesInBundle` to load certificates from your target, and then create a new policy by calling `policyWithPinningMode:withPinnedCertificates`. + + Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches. + */ +@property (nonatomic, strong, nullable) NSSet *pinnedCertificates; + +/** + Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`. + */ +@property (nonatomic, assign) BOOL allowInvalidCertificates; + +/** + Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`. + */ +@property (nonatomic, assign) BOOL validatesDomainName; + +///----------------------------------------- +/// @name Getting Certificates from the Bundle +///----------------------------------------- + +/** + Returns any certificates included in the bundle. If you are using AFNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`. + + @return The certificates included in the given bundle. + */ ++ (NSSet *)certificatesInBundle:(NSBundle *)bundle; + +///----------------------------------------- +/// @name Getting Specific Security Policies +///----------------------------------------- + +/** + Returns the shared default security policy, which does not allow invalid certificates, validates domain name, and does not validate against pinned certificates or public keys. + + @return The default security policy. + */ ++ (instancetype)defaultPolicy; + +///--------------------- +/// @name Initialization +///--------------------- + +/** + Creates and returns a security policy with the specified pinning mode. + + @param pinningMode The SSL pinning mode. + + @return A new security policy. + */ ++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode; + +/** + Creates and returns a security policy with the specified pinning mode. + + @param pinningMode The SSL pinning mode. + @param pinnedCertificates The certificates to pin against. + + @return A new security policy. + */ ++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates; + +///------------------------------ +/// @name Evaluating Server Trust +///------------------------------ + +/** + Whether or not the specified server trust should be accepted, based on the security policy. + + This method should be used when responding to an authentication challenge from a server. + + @param serverTrust The X.509 certificate trust of the server. + @param domain The domain of serverTrust. If `nil`, the domain will not be validated. + + @return Whether or not to trust the server. + */ +- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust + forDomain:(nullable NSString *)domain; + +@end + +NS_ASSUME_NONNULL_END + +///---------------- +/// @name Constants +///---------------- + +/** + ## SSL Pinning Modes + + The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes. + + enum { + AFSSLPinningModeNone, + AFSSLPinningModePublicKey, + AFSSLPinningModeCertificate, + } + + `AFSSLPinningModeNone` + Do not used pinned certificates to validate servers. + + `AFSSLPinningModePublicKey` + Validate host certificates against public keys of pinned certificates. + + `AFSSLPinningModeCertificate` + Validate host certificates against pinned certificates. +*/ diff --git a/Example/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m b/Example/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m new file mode 100644 index 0000000..3704cca --- /dev/null +++ b/Example/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m @@ -0,0 +1,353 @@ +// AFSecurityPolicy.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "AFSecurityPolicy.h" + +#import + +#if !TARGET_OS_IOS && !TARGET_OS_WATCH && !TARGET_OS_TV +static NSData * AFSecKeyGetData(SecKeyRef key) { + CFDataRef data = NULL; + + __Require_noErr_Quiet(SecItemExport(key, kSecFormatUnknown, kSecItemPemArmour, NULL, &data), _out); + + return (__bridge_transfer NSData *)data; + +_out: + if (data) { + CFRelease(data); + } + + return nil; +} +#endif + +static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) { +#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV + return [(__bridge id)key1 isEqual:(__bridge id)key2]; +#else + return [AFSecKeyGetData(key1) isEqual:AFSecKeyGetData(key2)]; +#endif +} + +static id AFPublicKeyForCertificate(NSData *certificate) { + id allowedPublicKey = nil; + SecCertificateRef allowedCertificate; + SecCertificateRef allowedCertificates[1]; + CFArrayRef tempCertificates = nil; + SecPolicyRef policy = nil; + SecTrustRef allowedTrust = nil; + SecTrustResultType result; + + allowedCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificate); + __Require_Quiet(allowedCertificate != NULL, _out); + + allowedCertificates[0] = allowedCertificate; + tempCertificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 1, NULL); + + policy = SecPolicyCreateBasicX509(); + __Require_noErr_Quiet(SecTrustCreateWithCertificates(tempCertificates, policy, &allowedTrust), _out); + __Require_noErr_Quiet(SecTrustEvaluate(allowedTrust, &result), _out); + + allowedPublicKey = (__bridge_transfer id)SecTrustCopyPublicKey(allowedTrust); + +_out: + if (allowedTrust) { + CFRelease(allowedTrust); + } + + if (policy) { + CFRelease(policy); + } + + if (tempCertificates) { + CFRelease(tempCertificates); + } + + if (allowedCertificate) { + CFRelease(allowedCertificate); + } + + return allowedPublicKey; +} + +static BOOL AFServerTrustIsValid(SecTrustRef serverTrust) { + BOOL isValid = NO; + SecTrustResultType result; + __Require_noErr_Quiet(SecTrustEvaluate(serverTrust, &result), _out); + + isValid = (result == kSecTrustResultUnspecified || result == kSecTrustResultProceed); + +_out: + return isValid; +} + +static NSArray * AFCertificateTrustChainForServerTrust(SecTrustRef serverTrust) { + CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust); + NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount]; + + for (CFIndex i = 0; i < certificateCount; i++) { + SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i); + [trustChain addObject:(__bridge_transfer NSData *)SecCertificateCopyData(certificate)]; + } + + return [NSArray arrayWithArray:trustChain]; +} + +static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { + SecPolicyRef policy = SecPolicyCreateBasicX509(); + CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust); + NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount]; + for (CFIndex i = 0; i < certificateCount; i++) { + SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i); + + SecCertificateRef someCertificates[] = {certificate}; + CFArrayRef certificates = CFArrayCreate(NULL, (const void **)someCertificates, 1, NULL); + + SecTrustRef trust; + __Require_noErr_Quiet(SecTrustCreateWithCertificates(certificates, policy, &trust), _out); + + SecTrustResultType result; + __Require_noErr_Quiet(SecTrustEvaluate(trust, &result), _out); + + [trustChain addObject:(__bridge_transfer id)SecTrustCopyPublicKey(trust)]; + + _out: + if (trust) { + CFRelease(trust); + } + + if (certificates) { + CFRelease(certificates); + } + + continue; + } + CFRelease(policy); + + return [NSArray arrayWithArray:trustChain]; +} + +#pragma mark - + +@interface AFSecurityPolicy() +@property (readwrite, nonatomic, assign) AFSSLPinningMode SSLPinningMode; +@property (readwrite, nonatomic, strong) NSSet *pinnedPublicKeys; +@end + +@implementation AFSecurityPolicy + ++ (NSSet *)certificatesInBundle:(NSBundle *)bundle { + NSArray *paths = [bundle pathsForResourcesOfType:@"cer" inDirectory:@"."]; + + NSMutableSet *certificates = [NSMutableSet setWithCapacity:[paths count]]; + for (NSString *path in paths) { + NSData *certificateData = [NSData dataWithContentsOfFile:path]; + [certificates addObject:certificateData]; + } + + return [NSSet setWithSet:certificates]; +} + ++ (NSSet *)defaultPinnedCertificates { + static NSSet *_defaultPinnedCertificates = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + NSBundle *bundle = [NSBundle bundleForClass:[self class]]; + _defaultPinnedCertificates = [self certificatesInBundle:bundle]; + }); + + return _defaultPinnedCertificates; +} + ++ (instancetype)defaultPolicy { + AFSecurityPolicy *securityPolicy = [[self alloc] init]; + securityPolicy.SSLPinningMode = AFSSLPinningModeNone; + + return securityPolicy; +} + ++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode { + return [self policyWithPinningMode:pinningMode withPinnedCertificates:[self defaultPinnedCertificates]]; +} + ++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates { + AFSecurityPolicy *securityPolicy = [[self alloc] init]; + securityPolicy.SSLPinningMode = pinningMode; + + [securityPolicy setPinnedCertificates:pinnedCertificates]; + + return securityPolicy; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.validatesDomainName = YES; + + return self; +} + +- (void)setPinnedCertificates:(NSSet *)pinnedCertificates { + _pinnedCertificates = pinnedCertificates; + + if (self.pinnedCertificates) { + NSMutableSet *mutablePinnedPublicKeys = [NSMutableSet setWithCapacity:[self.pinnedCertificates count]]; + for (NSData *certificate in self.pinnedCertificates) { + id publicKey = AFPublicKeyForCertificate(certificate); + if (!publicKey) { + continue; + } + [mutablePinnedPublicKeys addObject:publicKey]; + } + self.pinnedPublicKeys = [NSSet setWithSet:mutablePinnedPublicKeys]; + } else { + self.pinnedPublicKeys = nil; + } +} + +#pragma mark - + +- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust + forDomain:(NSString *)domain +{ + if (domain && self.allowInvalidCertificates && self.validatesDomainName && (self.SSLPinningMode == AFSSLPinningModeNone || [self.pinnedCertificates count] == 0)) { + // https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/NetworkingTopics/Articles/OverridingSSLChainValidationCorrectly.html + // According to the docs, you should only trust your provided certs for evaluation. + // Pinned certificates are added to the trust. Without pinned certificates, + // there is nothing to evaluate against. + // + // From Apple Docs: + // "Do not implicitly trust self-signed certificates as anchors (kSecTrustOptionImplicitAnchors). + // Instead, add your own (self-signed) CA certificate to the list of trusted anchors." + NSLog(@"In order to validate a domain name for self signed certificates, you MUST use pinning."); + return NO; + } + + NSMutableArray *policies = [NSMutableArray array]; + if (self.validatesDomainName) { + [policies addObject:(__bridge_transfer id)SecPolicyCreateSSL(true, (__bridge CFStringRef)domain)]; + } else { + [policies addObject:(__bridge_transfer id)SecPolicyCreateBasicX509()]; + } + + SecTrustSetPolicies(serverTrust, (__bridge CFArrayRef)policies); + + if (self.SSLPinningMode == AFSSLPinningModeNone) { + return self.allowInvalidCertificates || AFServerTrustIsValid(serverTrust); + } else if (!AFServerTrustIsValid(serverTrust) && !self.allowInvalidCertificates) { + return NO; + } + + switch (self.SSLPinningMode) { + case AFSSLPinningModeNone: + default: + return NO; + case AFSSLPinningModeCertificate: { + NSMutableArray *pinnedCertificates = [NSMutableArray array]; + for (NSData *certificateData in self.pinnedCertificates) { + [pinnedCertificates addObject:(__bridge_transfer id)SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificateData)]; + } + SecTrustSetAnchorCertificates(serverTrust, (__bridge CFArrayRef)pinnedCertificates); + + if (!AFServerTrustIsValid(serverTrust)) { + return NO; + } + + // obtain the chain after being validated, which *should* contain the pinned certificate in the last position (if it's the Root CA) + NSArray *serverCertificates = AFCertificateTrustChainForServerTrust(serverTrust); + + for (NSData *trustChainCertificate in [serverCertificates reverseObjectEnumerator]) { + if ([self.pinnedCertificates containsObject:trustChainCertificate]) { + return YES; + } + } + + return NO; + } + case AFSSLPinningModePublicKey: { + NSUInteger trustedPublicKeyCount = 0; + NSArray *publicKeys = AFPublicKeyTrustChainForServerTrust(serverTrust); + + for (id trustChainPublicKey in publicKeys) { + for (id pinnedPublicKey in self.pinnedPublicKeys) { + if (AFSecKeyIsEqualToKey((__bridge SecKeyRef)trustChainPublicKey, (__bridge SecKeyRef)pinnedPublicKey)) { + trustedPublicKeyCount += 1; + } + } + } + return trustedPublicKeyCount > 0; + } + } + + return NO; +} + +#pragma mark - NSKeyValueObserving + ++ (NSSet *)keyPathsForValuesAffectingPinnedPublicKeys { + return [NSSet setWithObject:@"pinnedCertificates"]; +} + +#pragma mark - NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)initWithCoder:(NSCoder *)decoder { + + self = [self init]; + if (!self) { + return nil; + } + + self.SSLPinningMode = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(SSLPinningMode))] unsignedIntegerValue]; + self.allowInvalidCertificates = [decoder decodeBoolForKey:NSStringFromSelector(@selector(allowInvalidCertificates))]; + self.validatesDomainName = [decoder decodeBoolForKey:NSStringFromSelector(@selector(validatesDomainName))]; + self.pinnedCertificates = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(pinnedCertificates))]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [coder encodeObject:[NSNumber numberWithUnsignedInteger:self.SSLPinningMode] forKey:NSStringFromSelector(@selector(SSLPinningMode))]; + [coder encodeBool:self.allowInvalidCertificates forKey:NSStringFromSelector(@selector(allowInvalidCertificates))]; + [coder encodeBool:self.validatesDomainName forKey:NSStringFromSelector(@selector(validatesDomainName))]; + [coder encodeObject:self.pinnedCertificates forKey:NSStringFromSelector(@selector(pinnedCertificates))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFSecurityPolicy *securityPolicy = [[[self class] allocWithZone:zone] init]; + securityPolicy.SSLPinningMode = self.SSLPinningMode; + securityPolicy.allowInvalidCertificates = self.allowInvalidCertificates; + securityPolicy.validatesDomainName = self.validatesDomainName; + securityPolicy.pinnedCertificates = [self.pinnedCertificates copyWithZone:zone]; + + return securityPolicy; +} + +@end diff --git a/Example/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h b/Example/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h new file mode 100644 index 0000000..134b7dd --- /dev/null +++ b/Example/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h @@ -0,0 +1,454 @@ +// AFURLRequestSerialization.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import +#import + +#if TARGET_OS_IOS || TARGET_OS_TV +#import +#elif TARGET_OS_WATCH +#import +#endif + +NS_ASSUME_NONNULL_BEGIN + +/** + The `AFURLRequestSerialization` protocol is adopted by an object that encodes parameters for a specified HTTP requests. Request serializers may encode parameters as query strings, HTTP bodies, setting the appropriate HTTP header fields as necessary. + + For example, a JSON request serializer may set the HTTP body of the request to a JSON representation, and set the `Content-Type` HTTP header field value to `application/json`. + */ +@protocol AFURLRequestSerialization + +/** + Returns a request with the specified parameters encoded into a copy of the original request. + + @param request The original request. + @param parameters The parameters to be encoded. + @param error The error that occurred while attempting to encode the request parameters. + + @return A serialized request. + */ +- (nullable NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request + withParameters:(nullable id)parameters + error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW; + +@end + +#pragma mark - + +/** + + */ +typedef NS_ENUM(NSUInteger, AFHTTPRequestQueryStringSerializationStyle) { + AFHTTPRequestQueryStringDefaultStyle = 0, +}; + +@protocol AFMultipartFormData; + +/** + `AFHTTPRequestSerializer` conforms to the `AFURLRequestSerialization` & `AFURLResponseSerialization` protocols, offering a concrete base implementation of query string / URL form-encoded parameter serialization and default request headers, as well as response status code and content type validation. + + Any request or response serializer dealing with HTTP is encouraged to subclass `AFHTTPRequestSerializer` in order to ensure consistent default behavior. + */ +@interface AFHTTPRequestSerializer : NSObject + +/** + The string encoding used to serialize parameters. `NSUTF8StringEncoding` by default. + */ +@property (nonatomic, assign) NSStringEncoding stringEncoding; + +/** + Whether created requests can use the device’s cellular radio (if present). `YES` by default. + + @see NSMutableURLRequest -setAllowsCellularAccess: + */ +@property (nonatomic, assign) BOOL allowsCellularAccess; + +/** + The cache policy of created requests. `NSURLRequestUseProtocolCachePolicy` by default. + + @see NSMutableURLRequest -setCachePolicy: + */ +@property (nonatomic, assign) NSURLRequestCachePolicy cachePolicy; + +/** + Whether created requests should use the default cookie handling. `YES` by default. + + @see NSMutableURLRequest -setHTTPShouldHandleCookies: + */ +@property (nonatomic, assign) BOOL HTTPShouldHandleCookies; + +/** + Whether created requests can continue transmitting data before receiving a response from an earlier transmission. `NO` by default + + @see NSMutableURLRequest -setHTTPShouldUsePipelining: + */ +@property (nonatomic, assign) BOOL HTTPShouldUsePipelining; + +/** + The network service type for created requests. `NSURLNetworkServiceTypeDefault` by default. + + @see NSMutableURLRequest -setNetworkServiceType: + */ +@property (nonatomic, assign) NSURLRequestNetworkServiceType networkServiceType; + +/** + The timeout interval, in seconds, for created requests. The default timeout interval is 60 seconds. + + @see NSMutableURLRequest -setTimeoutInterval: + */ +@property (nonatomic, assign) NSTimeInterval timeoutInterval; + +///--------------------------------------- +/// @name Configuring HTTP Request Headers +///--------------------------------------- + +/** + Default HTTP header field values to be applied to serialized requests. By default, these include the following: + + - `Accept-Language` with the contents of `NSLocale +preferredLanguages` + - `User-Agent` with the contents of various bundle identifiers and OS designations + + @discussion To add or remove default request headers, use `setValue:forHTTPHeaderField:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *HTTPRequestHeaders; + +/** + Creates and returns a serializer with default configuration. + */ ++ (instancetype)serializer; + +/** + Sets the value for the HTTP headers set in request objects made by the HTTP client. If `nil`, removes the existing value for that header. + + @param field The HTTP header to set a default value for + @param value The value set as default for the specified header, or `nil` + */ +- (void)setValue:(nullable NSString *)value +forHTTPHeaderField:(NSString *)field; + +/** + Returns the value for the HTTP headers set in the request serializer. + + @param field The HTTP header to retrieve the default value for + + @return The value set as default for the specified header, or `nil` + */ +- (nullable NSString *)valueForHTTPHeaderField:(NSString *)field; + +/** + Sets the "Authorization" HTTP header set in request objects made by the HTTP client to a basic authentication value with Base64-encoded username and password. This overwrites any existing value for this header. + + @param username The HTTP basic auth username + @param password The HTTP basic auth password + */ +- (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username + password:(NSString *)password; + +/** + Clears any existing value for the "Authorization" HTTP header. + */ +- (void)clearAuthorizationHeader; + +///------------------------------------------------------- +/// @name Configuring Query String Parameter Serialization +///------------------------------------------------------- + +/** + HTTP methods for which serialized requests will encode parameters as a query string. `GET`, `HEAD`, and `DELETE` by default. + */ +@property (nonatomic, strong) NSSet *HTTPMethodsEncodingParametersInURI; + +/** + Set the method of query string serialization according to one of the pre-defined styles. + + @param style The serialization style. + + @see AFHTTPRequestQueryStringSerializationStyle + */ +- (void)setQueryStringSerializationWithStyle:(AFHTTPRequestQueryStringSerializationStyle)style; + +/** + Set the a custom method of query string serialization according to the specified block. + + @param block A block that defines a process of encoding parameters into a query string. This block returns the query string and takes three arguments: the request, the parameters to encode, and the error that occurred when attempting to encode parameters for the given request. + */ +- (void)setQueryStringSerializationWithBlock:(nullable NSString * (^)(NSURLRequest *request, id parameters, NSError * __autoreleasing *error))block; + +///------------------------------- +/// @name Creating Request Objects +///------------------------------- + +/** + Creates an `NSMutableURLRequest` object with the specified HTTP method and URL string. + + If the HTTP method is `GET`, `HEAD`, or `DELETE`, the parameters will be used to construct a url-encoded query string that is appended to the request's URL. Otherwise, the parameters will be encoded according to the value of the `parameterEncoding` property, and set as the request body. + + @param method The HTTP method for the request, such as `GET`, `POST`, `PUT`, or `DELETE`. This parameter must not be `nil`. + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be either set as a query string for `GET` requests, or the request HTTP body. + @param error The error that occurred while constructing the request. + + @return An `NSMutableURLRequest` object. + */ +- (NSMutableURLRequest *)requestWithMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(nullable id)parameters + error:(NSError * _Nullable __autoreleasing *)error; + +/** + Creates an `NSMutableURLRequest` object with the specified HTTP method and URLString, and constructs a `multipart/form-data` HTTP body, using the specified parameters and multipart form data block. See http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2 + + Multipart form requests are automatically streamed, reading files directly from disk along with in-memory data in a single HTTP body. The resulting `NSMutableURLRequest` object has an `HTTPBodyStream` property, so refrain from setting `HTTPBodyStream` or `HTTPBody` on this request object, as it will clear out the multipart form body stream. + + @param method The HTTP method for the request. This parameter must not be `GET` or `HEAD`, or `nil`. + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded and set in the request HTTP body. + @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. + @param error The error that occurred while constructing the request. + + @return An `NSMutableURLRequest` object + */ +- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(nullable NSDictionary *)parameters + constructingBodyWithBlock:(nullable void (^)(id formData))block + error:(NSError * _Nullable __autoreleasing *)error; + +/** + Creates an `NSMutableURLRequest` by removing the `HTTPBodyStream` from a request, and asynchronously writing its contents into the specified file, invoking the completion handler when finished. + + @param request The multipart form request. The `HTTPBodyStream` property of `request` must not be `nil`. + @param fileURL The file URL to write multipart form contents to. + @param handler A handler block to execute. + + @discussion There is a bug in `NSURLSessionTask` that causes requests to not send a `Content-Length` header when streaming contents from an HTTP body, which is notably problematic when interacting with the Amazon S3 webservice. As a workaround, this method takes a request constructed with `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:error:`, or any other request with an `HTTPBodyStream`, writes the contents to the specified file and returns a copy of the original request with the `HTTPBodyStream` property set to `nil`. From here, the file can either be passed to `AFURLSessionManager -uploadTaskWithRequest:fromFile:progress:completionHandler:`, or have its contents read into an `NSData` that's assigned to the `HTTPBody` property of the request. + + @see https://github.com/AFNetworking/AFNetworking/issues/1398 + */ +- (NSMutableURLRequest *)requestWithMultipartFormRequest:(NSURLRequest *)request + writingStreamContentsToFile:(NSURL *)fileURL + completionHandler:(nullable void (^)(NSError * _Nullable error))handler; + +@end + +#pragma mark - + +/** + The `AFMultipartFormData` protocol defines the methods supported by the parameter in the block argument of `AFHTTPRequestSerializer -multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:`. + */ +@protocol AFMultipartFormData + +/** + Appends the HTTP header `Content-Disposition: file; filename=#{generated filename}; name=#{name}"` and `Content-Type: #{generated mimeType}`, followed by the encoded file data and the multipart form boundary. + + The filename and MIME type for this data in the form will be automatically generated, using the last path component of the `fileURL` and system associated MIME type for the `fileURL` extension, respectively. + + @param fileURL The URL corresponding to the file whose content will be appended to the form. This parameter must not be `nil`. + @param name The name to be associated with the specified data. This parameter must not be `nil`. + @param error If an error occurs, upon return contains an `NSError` object that describes the problem. + + @return `YES` if the file data was successfully appended, otherwise `NO`. + */ +- (BOOL)appendPartWithFileURL:(NSURL *)fileURL + name:(NSString *)name + error:(NSError * _Nullable __autoreleasing *)error; + +/** + Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the encoded file data and the multipart form boundary. + + @param fileURL The URL corresponding to the file whose content will be appended to the form. This parameter must not be `nil`. + @param name The name to be associated with the specified data. This parameter must not be `nil`. + @param fileName The file name to be used in the `Content-Disposition` header. This parameter must not be `nil`. + @param mimeType The declared MIME type of the file data. This parameter must not be `nil`. + @param error If an error occurs, upon return contains an `NSError` object that describes the problem. + + @return `YES` if the file data was successfully appended otherwise `NO`. + */ +- (BOOL)appendPartWithFileURL:(NSURL *)fileURL + name:(NSString *)name + fileName:(NSString *)fileName + mimeType:(NSString *)mimeType + error:(NSError * _Nullable __autoreleasing *)error; + +/** + Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the data from the input stream and the multipart form boundary. + + @param inputStream The input stream to be appended to the form data + @param name The name to be associated with the specified input stream. This parameter must not be `nil`. + @param fileName The filename to be associated with the specified input stream. This parameter must not be `nil`. + @param length The length of the specified input stream in bytes. + @param mimeType The MIME type of the specified data. (For example, the MIME type for a JPEG image is image/jpeg.) For a list of valid MIME types, see http://www.iana.org/assignments/media-types/. This parameter must not be `nil`. + */ +- (void)appendPartWithInputStream:(nullable NSInputStream *)inputStream + name:(NSString *)name + fileName:(NSString *)fileName + length:(int64_t)length + mimeType:(NSString *)mimeType; + +/** + Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the encoded file data and the multipart form boundary. + + @param data The data to be encoded and appended to the form data. + @param name The name to be associated with the specified data. This parameter must not be `nil`. + @param fileName The filename to be associated with the specified data. This parameter must not be `nil`. + @param mimeType The MIME type of the specified data. (For example, the MIME type for a JPEG image is image/jpeg.) For a list of valid MIME types, see http://www.iana.org/assignments/media-types/. This parameter must not be `nil`. + */ +- (void)appendPartWithFileData:(NSData *)data + name:(NSString *)name + fileName:(NSString *)fileName + mimeType:(NSString *)mimeType; + +/** + Appends the HTTP headers `Content-Disposition: form-data; name=#{name}"`, followed by the encoded data and the multipart form boundary. + + @param data The data to be encoded and appended to the form data. + @param name The name to be associated with the specified data. This parameter must not be `nil`. + */ + +- (void)appendPartWithFormData:(NSData *)data + name:(NSString *)name; + + +/** + Appends HTTP headers, followed by the encoded data and the multipart form boundary. + + @param headers The HTTP headers to be appended to the form data. + @param body The data to be encoded and appended to the form data. This parameter must not be `nil`. + */ +- (void)appendPartWithHeaders:(nullable NSDictionary *)headers + body:(NSData *)body; + +/** + Throttles request bandwidth by limiting the packet size and adding a delay for each chunk read from the upload stream. + + When uploading over a 3G or EDGE connection, requests may fail with "request body stream exhausted". Setting a maximum packet size and delay according to the recommended values (`kAFUploadStream3GSuggestedPacketSize` and `kAFUploadStream3GSuggestedDelay`) lowers the risk of the input stream exceeding its allocated bandwidth. Unfortunately, there is no definite way to distinguish between a 3G, EDGE, or LTE connection over `NSURLConnection`. As such, it is not recommended that you throttle bandwidth based solely on network reachability. Instead, you should consider checking for the "request body stream exhausted" in a failure block, and then retrying the request with throttled bandwidth. + + @param numberOfBytes Maximum packet size, in number of bytes. The default packet size for an input stream is 16kb. + @param delay Duration of delay each time a packet is read. By default, no delay is set. + */ +- (void)throttleBandwidthWithPacketSize:(NSUInteger)numberOfBytes + delay:(NSTimeInterval)delay; + +@end + +#pragma mark - + +/** + `AFJSONRequestSerializer` is a subclass of `AFHTTPRequestSerializer` that encodes parameters as JSON using `NSJSONSerialization`, setting the `Content-Type` of the encoded request to `application/json`. + */ +@interface AFJSONRequestSerializer : AFHTTPRequestSerializer + +/** + Options for writing the request JSON data from Foundation objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONWritingOptions". `0` by default. + */ +@property (nonatomic, assign) NSJSONWritingOptions writingOptions; + +/** + Creates and returns a JSON serializer with specified reading and writing options. + + @param writingOptions The specified JSON writing options. + */ ++ (instancetype)serializerWithWritingOptions:(NSJSONWritingOptions)writingOptions; + +@end + +#pragma mark - + +/** + `AFPropertyListRequestSerializer` is a subclass of `AFHTTPRequestSerializer` that encodes parameters as JSON using `NSPropertyListSerializer`, setting the `Content-Type` of the encoded request to `application/x-plist`. + */ +@interface AFPropertyListRequestSerializer : AFHTTPRequestSerializer + +/** + The property list format. Possible values are described in "NSPropertyListFormat". + */ +@property (nonatomic, assign) NSPropertyListFormat format; + +/** + @warning The `writeOptions` property is currently unused. + */ +@property (nonatomic, assign) NSPropertyListWriteOptions writeOptions; + +/** + Creates and returns a property list serializer with a specified format, read options, and write options. + + @param format The property list format. + @param writeOptions The property list write options. + + @warning The `writeOptions` property is currently unused. + */ ++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format + writeOptions:(NSPropertyListWriteOptions)writeOptions; + +@end + +#pragma mark - + +///---------------- +/// @name Constants +///---------------- + +/** + ## Error Domains + + The following error domain is predefined. + + - `NSString * const AFURLRequestSerializationErrorDomain` + + ### Constants + + `AFURLRequestSerializationErrorDomain` + AFURLRequestSerializer errors. Error codes for `AFURLRequestSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`. + */ +FOUNDATION_EXPORT NSString * const AFURLRequestSerializationErrorDomain; + +/** + ## User info dictionary keys + + These keys may exist in the user info dictionary, in addition to those defined for NSError. + + - `NSString * const AFNetworkingOperationFailingURLRequestErrorKey` + + ### Constants + + `AFNetworkingOperationFailingURLRequestErrorKey` + The corresponding value is an `NSURLRequest` containing the request of the operation associated with an error. This key is only present in the `AFURLRequestSerializationErrorDomain`. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLRequestErrorKey; + +/** + ## Throttling Bandwidth for HTTP Request Input Streams + + @see -throttleBandwidthWithPacketSize:delay: + + ### Constants + + `kAFUploadStream3GSuggestedPacketSize` + Maximum packet size, in number of bytes. Equal to 16kb. + + `kAFUploadStream3GSuggestedDelay` + Duration of delay each time a packet is read. Equal to 0.2 seconds. + */ +FOUNDATION_EXPORT NSUInteger const kAFUploadStream3GSuggestedPacketSize; +FOUNDATION_EXPORT NSTimeInterval const kAFUploadStream3GSuggestedDelay; + +NS_ASSUME_NONNULL_END diff --git a/Example/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m b/Example/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m new file mode 100644 index 0000000..bbab7c4 --- /dev/null +++ b/Example/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m @@ -0,0 +1,1376 @@ +// AFURLRequestSerialization.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "AFURLRequestSerialization.h" + +#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV +#import +#else +#import +#endif + +NSString * const AFURLRequestSerializationErrorDomain = @"com.alamofire.error.serialization.request"; +NSString * const AFNetworkingOperationFailingURLRequestErrorKey = @"com.alamofire.serialization.request.error.response"; + +typedef NSString * (^AFQueryStringSerializationBlock)(NSURLRequest *request, id parameters, NSError *__autoreleasing *error); + +/** + Returns a percent-escaped string following RFC 3986 for a query string key or value. + RFC 3986 states that the following characters are "reserved" characters. + - General Delimiters: ":", "#", "[", "]", "@", "?", "/" + - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" + + In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow + query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/" + should be percent-escaped in the query string. + - parameter string: The string to be percent-escaped. + - returns: The percent-escaped string. + */ +static NSString * AFPercentEscapedStringFromString(NSString *string) { + static NSString * const kAFCharactersGeneralDelimitersToEncode = @":#[]@"; // does not include "?" or "/" due to RFC 3986 - Section 3.4 + static NSString * const kAFCharactersSubDelimitersToEncode = @"!$&'()*+,;="; + + NSMutableCharacterSet * allowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy]; + [allowedCharacterSet removeCharactersInString:[kAFCharactersGeneralDelimitersToEncode stringByAppendingString:kAFCharactersSubDelimitersToEncode]]; + + // FIXME: https://github.com/AFNetworking/AFNetworking/pull/3028 + // return [string stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; + + static NSUInteger const batchSize = 50; + + NSUInteger index = 0; + NSMutableString *escaped = @"".mutableCopy; + + while (index < string.length) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu" + NSUInteger length = MIN(string.length - index, batchSize); +#pragma GCC diagnostic pop + NSRange range = NSMakeRange(index, length); + + // To avoid breaking up character sequences such as 👴🏻👮🏽 + range = [string rangeOfComposedCharacterSequencesForRange:range]; + + NSString *substring = [string substringWithRange:range]; + NSString *encoded = [substring stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; + [escaped appendString:encoded]; + + index += range.length; + } + + return escaped; +} + +#pragma mark - + +@interface AFQueryStringPair : NSObject +@property (readwrite, nonatomic, strong) id field; +@property (readwrite, nonatomic, strong) id value; + +- (instancetype)initWithField:(id)field value:(id)value; + +- (NSString *)URLEncodedStringValue; +@end + +@implementation AFQueryStringPair + +- (instancetype)initWithField:(id)field value:(id)value { + self = [super init]; + if (!self) { + return nil; + } + + self.field = field; + self.value = value; + + return self; +} + +- (NSString *)URLEncodedStringValue { + if (!self.value || [self.value isEqual:[NSNull null]]) { + return AFPercentEscapedStringFromString([self.field description]); + } else { + return [NSString stringWithFormat:@"%@=%@", AFPercentEscapedStringFromString([self.field description]), AFPercentEscapedStringFromString([self.value description])]; + } +} + +@end + +#pragma mark - + +FOUNDATION_EXPORT NSArray * AFQueryStringPairsFromDictionary(NSDictionary *dictionary); +FOUNDATION_EXPORT NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value); + +static NSString * AFQueryStringFromParameters(NSDictionary *parameters) { + NSMutableArray *mutablePairs = [NSMutableArray array]; + for (AFQueryStringPair *pair in AFQueryStringPairsFromDictionary(parameters)) { + [mutablePairs addObject:[pair URLEncodedStringValue]]; + } + + return [mutablePairs componentsJoinedByString:@"&"]; +} + +NSArray * AFQueryStringPairsFromDictionary(NSDictionary *dictionary) { + return AFQueryStringPairsFromKeyAndValue(nil, dictionary); +} + +NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value) { + NSMutableArray *mutableQueryStringComponents = [NSMutableArray array]; + + NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"description" ascending:YES selector:@selector(compare:)]; + + if ([value isKindOfClass:[NSDictionary class]]) { + NSDictionary *dictionary = value; + // Sort dictionary keys to ensure consistent ordering in query string, which is important when deserializing potentially ambiguous sequences, such as an array of dictionaries + for (id nestedKey in [dictionary.allKeys sortedArrayUsingDescriptors:@[ sortDescriptor ]]) { + id nestedValue = dictionary[nestedKey]; + if (nestedValue) { + [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue((key ? [NSString stringWithFormat:@"%@[%@]", key, nestedKey] : nestedKey), nestedValue)]; + } + } + } else if ([value isKindOfClass:[NSArray class]]) { + NSArray *array = value; + for (id nestedValue in array) { + [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue([NSString stringWithFormat:@"%@[]", key], nestedValue)]; + } + } else if ([value isKindOfClass:[NSSet class]]) { + NSSet *set = value; + for (id obj in [set sortedArrayUsingDescriptors:@[ sortDescriptor ]]) { + [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue(key, obj)]; + } + } else { + [mutableQueryStringComponents addObject:[[AFQueryStringPair alloc] initWithField:key value:value]]; + } + + return mutableQueryStringComponents; +} + +#pragma mark - + +@interface AFStreamingMultipartFormData : NSObject +- (instancetype)initWithURLRequest:(NSMutableURLRequest *)urlRequest + stringEncoding:(NSStringEncoding)encoding; + +- (NSMutableURLRequest *)requestByFinalizingMultipartFormData; +@end + +#pragma mark - + +static NSArray * AFHTTPRequestSerializerObservedKeyPaths() { + static NSArray *_AFHTTPRequestSerializerObservedKeyPaths = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _AFHTTPRequestSerializerObservedKeyPaths = @[NSStringFromSelector(@selector(allowsCellularAccess)), NSStringFromSelector(@selector(cachePolicy)), NSStringFromSelector(@selector(HTTPShouldHandleCookies)), NSStringFromSelector(@selector(HTTPShouldUsePipelining)), NSStringFromSelector(@selector(networkServiceType)), NSStringFromSelector(@selector(timeoutInterval))]; + }); + + return _AFHTTPRequestSerializerObservedKeyPaths; +} + +static void *AFHTTPRequestSerializerObserverContext = &AFHTTPRequestSerializerObserverContext; + +@interface AFHTTPRequestSerializer () +@property (readwrite, nonatomic, strong) NSMutableSet *mutableObservedChangedKeyPaths; +@property (readwrite, nonatomic, strong) NSMutableDictionary *mutableHTTPRequestHeaders; +@property (readwrite, nonatomic, assign) AFHTTPRequestQueryStringSerializationStyle queryStringSerializationStyle; +@property (readwrite, nonatomic, copy) AFQueryStringSerializationBlock queryStringSerialization; +@end + +@implementation AFHTTPRequestSerializer + ++ (instancetype)serializer { + return [[self alloc] init]; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.stringEncoding = NSUTF8StringEncoding; + + self.mutableHTTPRequestHeaders = [NSMutableDictionary dictionary]; + + // Accept-Language HTTP Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 + NSMutableArray *acceptLanguagesComponents = [NSMutableArray array]; + [[NSLocale preferredLanguages] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + float q = 1.0f - (idx * 0.1f); + [acceptLanguagesComponents addObject:[NSString stringWithFormat:@"%@;q=%0.1g", obj, q]]; + *stop = q <= 0.5f; + }]; + [self setValue:[acceptLanguagesComponents componentsJoinedByString:@", "] forHTTPHeaderField:@"Accept-Language"]; + + NSString *userAgent = nil; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" +#if TARGET_OS_IOS + // User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43 + userAgent = [NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]]; +#elif TARGET_OS_WATCH + // User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43 + userAgent = [NSString stringWithFormat:@"%@/%@ (%@; watchOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[WKInterfaceDevice currentDevice] model], [[WKInterfaceDevice currentDevice] systemVersion], [[WKInterfaceDevice currentDevice] screenScale]]; +#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) + userAgent = [NSString stringWithFormat:@"%@/%@ (Mac OS X %@)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[NSProcessInfo processInfo] operatingSystemVersionString]]; +#endif +#pragma clang diagnostic pop + if (userAgent) { + if (![userAgent canBeConvertedToEncoding:NSASCIIStringEncoding]) { + NSMutableString *mutableUserAgent = [userAgent mutableCopy]; + if (CFStringTransform((__bridge CFMutableStringRef)(mutableUserAgent), NULL, (__bridge CFStringRef)@"Any-Latin; Latin-ASCII; [:^ASCII:] Remove", false)) { + userAgent = mutableUserAgent; + } + } + [self setValue:userAgent forHTTPHeaderField:@"User-Agent"]; + } + + // HTTP Method Definitions; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + self.HTTPMethodsEncodingParametersInURI = [NSSet setWithObjects:@"GET", @"HEAD", @"DELETE", nil]; + + self.mutableObservedChangedKeyPaths = [NSMutableSet set]; + for (NSString *keyPath in AFHTTPRequestSerializerObservedKeyPaths()) { + if ([self respondsToSelector:NSSelectorFromString(keyPath)]) { + [self addObserver:self forKeyPath:keyPath options:NSKeyValueObservingOptionNew context:AFHTTPRequestSerializerObserverContext]; + } + } + + return self; +} + +- (void)dealloc { + for (NSString *keyPath in AFHTTPRequestSerializerObservedKeyPaths()) { + if ([self respondsToSelector:NSSelectorFromString(keyPath)]) { + [self removeObserver:self forKeyPath:keyPath context:AFHTTPRequestSerializerObserverContext]; + } + } +} + +#pragma mark - + +// Workarounds for crashing behavior using Key-Value Observing with XCTest +// See https://github.com/AFNetworking/AFNetworking/issues/2523 + +- (void)setAllowsCellularAccess:(BOOL)allowsCellularAccess { + [self willChangeValueForKey:NSStringFromSelector(@selector(allowsCellularAccess))]; + _allowsCellularAccess = allowsCellularAccess; + [self didChangeValueForKey:NSStringFromSelector(@selector(allowsCellularAccess))]; +} + +- (void)setCachePolicy:(NSURLRequestCachePolicy)cachePolicy { + [self willChangeValueForKey:NSStringFromSelector(@selector(cachePolicy))]; + _cachePolicy = cachePolicy; + [self didChangeValueForKey:NSStringFromSelector(@selector(cachePolicy))]; +} + +- (void)setHTTPShouldHandleCookies:(BOOL)HTTPShouldHandleCookies { + [self willChangeValueForKey:NSStringFromSelector(@selector(HTTPShouldHandleCookies))]; + _HTTPShouldHandleCookies = HTTPShouldHandleCookies; + [self didChangeValueForKey:NSStringFromSelector(@selector(HTTPShouldHandleCookies))]; +} + +- (void)setHTTPShouldUsePipelining:(BOOL)HTTPShouldUsePipelining { + [self willChangeValueForKey:NSStringFromSelector(@selector(HTTPShouldUsePipelining))]; + _HTTPShouldUsePipelining = HTTPShouldUsePipelining; + [self didChangeValueForKey:NSStringFromSelector(@selector(HTTPShouldUsePipelining))]; +} + +- (void)setNetworkServiceType:(NSURLRequestNetworkServiceType)networkServiceType { + [self willChangeValueForKey:NSStringFromSelector(@selector(networkServiceType))]; + _networkServiceType = networkServiceType; + [self didChangeValueForKey:NSStringFromSelector(@selector(networkServiceType))]; +} + +- (void)setTimeoutInterval:(NSTimeInterval)timeoutInterval { + [self willChangeValueForKey:NSStringFromSelector(@selector(timeoutInterval))]; + _timeoutInterval = timeoutInterval; + [self didChangeValueForKey:NSStringFromSelector(@selector(timeoutInterval))]; +} + +#pragma mark - + +- (NSDictionary *)HTTPRequestHeaders { + return [NSDictionary dictionaryWithDictionary:self.mutableHTTPRequestHeaders]; +} + +- (void)setValue:(NSString *)value +forHTTPHeaderField:(NSString *)field +{ + [self.mutableHTTPRequestHeaders setValue:value forKey:field]; +} + +- (NSString *)valueForHTTPHeaderField:(NSString *)field { + return [self.mutableHTTPRequestHeaders valueForKey:field]; +} + +- (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username + password:(NSString *)password +{ + NSData *basicAuthCredentials = [[NSString stringWithFormat:@"%@:%@", username, password] dataUsingEncoding:NSUTF8StringEncoding]; + NSString *base64AuthCredentials = [basicAuthCredentials base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0]; + [self setValue:[NSString stringWithFormat:@"Basic %@", base64AuthCredentials] forHTTPHeaderField:@"Authorization"]; +} + +- (void)clearAuthorizationHeader { + [self.mutableHTTPRequestHeaders removeObjectForKey:@"Authorization"]; +} + +#pragma mark - + +- (void)setQueryStringSerializationWithStyle:(AFHTTPRequestQueryStringSerializationStyle)style { + self.queryStringSerializationStyle = style; + self.queryStringSerialization = nil; +} + +- (void)setQueryStringSerializationWithBlock:(NSString *(^)(NSURLRequest *, id, NSError *__autoreleasing *))block { + self.queryStringSerialization = block; +} + +#pragma mark - + +- (NSMutableURLRequest *)requestWithMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(id)parameters + error:(NSError *__autoreleasing *)error +{ + NSParameterAssert(method); + NSParameterAssert(URLString); + + NSURL *url = [NSURL URLWithString:URLString]; + + NSParameterAssert(url); + + NSMutableURLRequest *mutableRequest = [[NSMutableURLRequest alloc] initWithURL:url]; + mutableRequest.HTTPMethod = method; + + for (NSString *keyPath in AFHTTPRequestSerializerObservedKeyPaths()) { + if ([self.mutableObservedChangedKeyPaths containsObject:keyPath]) { + [mutableRequest setValue:[self valueForKeyPath:keyPath] forKey:keyPath]; + } + } + + mutableRequest = [[self requestBySerializingRequest:mutableRequest withParameters:parameters error:error] mutableCopy]; + + return mutableRequest; +} + +- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(NSDictionary *)parameters + constructingBodyWithBlock:(void (^)(id formData))block + error:(NSError *__autoreleasing *)error +{ + NSParameterAssert(method); + NSParameterAssert(![method isEqualToString:@"GET"] && ![method isEqualToString:@"HEAD"]); + + NSMutableURLRequest *mutableRequest = [self requestWithMethod:method URLString:URLString parameters:nil error:error]; + + __block AFStreamingMultipartFormData *formData = [[AFStreamingMultipartFormData alloc] initWithURLRequest:mutableRequest stringEncoding:NSUTF8StringEncoding]; + + if (parameters) { + for (AFQueryStringPair *pair in AFQueryStringPairsFromDictionary(parameters)) { + NSData *data = nil; + if ([pair.value isKindOfClass:[NSData class]]) { + data = pair.value; + } else if ([pair.value isEqual:[NSNull null]]) { + data = [NSData data]; + } else { + data = [[pair.value description] dataUsingEncoding:self.stringEncoding]; + } + + if (data) { + [formData appendPartWithFormData:data name:[pair.field description]]; + } + } + } + + if (block) { + block(formData); + } + + return [formData requestByFinalizingMultipartFormData]; +} + +- (NSMutableURLRequest *)requestWithMultipartFormRequest:(NSURLRequest *)request + writingStreamContentsToFile:(NSURL *)fileURL + completionHandler:(void (^)(NSError *error))handler +{ + NSParameterAssert(request.HTTPBodyStream); + NSParameterAssert([fileURL isFileURL]); + + NSInputStream *inputStream = request.HTTPBodyStream; + NSOutputStream *outputStream = [[NSOutputStream alloc] initWithURL:fileURL append:NO]; + __block NSError *error = nil; + + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + [inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; + [outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; + + [inputStream open]; + [outputStream open]; + + while ([inputStream hasBytesAvailable] && [outputStream hasSpaceAvailable]) { + uint8_t buffer[1024]; + + NSInteger bytesRead = [inputStream read:buffer maxLength:1024]; + if (inputStream.streamError || bytesRead < 0) { + error = inputStream.streamError; + break; + } + + NSInteger bytesWritten = [outputStream write:buffer maxLength:(NSUInteger)bytesRead]; + if (outputStream.streamError || bytesWritten < 0) { + error = outputStream.streamError; + break; + } + + if (bytesRead == 0 && bytesWritten == 0) { + break; + } + } + + [outputStream close]; + [inputStream close]; + + if (handler) { + dispatch_async(dispatch_get_main_queue(), ^{ + handler(error); + }); + } + }); + + NSMutableURLRequest *mutableRequest = [request mutableCopy]; + mutableRequest.HTTPBodyStream = nil; + + return mutableRequest; +} + +#pragma mark - AFURLRequestSerialization + +- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request + withParameters:(id)parameters + error:(NSError *__autoreleasing *)error +{ + NSParameterAssert(request); + + NSMutableURLRequest *mutableRequest = [request mutableCopy]; + + [self.HTTPRequestHeaders enumerateKeysAndObjectsUsingBlock:^(id field, id value, BOOL * __unused stop) { + if (![request valueForHTTPHeaderField:field]) { + [mutableRequest setValue:value forHTTPHeaderField:field]; + } + }]; + + NSString *query = nil; + if (parameters) { + if (self.queryStringSerialization) { + NSError *serializationError; + query = self.queryStringSerialization(request, parameters, &serializationError); + + if (serializationError) { + if (error) { + *error = serializationError; + } + + return nil; + } + } else { + switch (self.queryStringSerializationStyle) { + case AFHTTPRequestQueryStringDefaultStyle: + query = AFQueryStringFromParameters(parameters); + break; + } + } + } + + if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) { + if (query) { + mutableRequest.URL = [NSURL URLWithString:[[mutableRequest.URL absoluteString] stringByAppendingFormat:mutableRequest.URL.query ? @"&%@" : @"?%@", query]]; + } + } else { + // #2864: an empty string is a valid x-www-form-urlencoded payload + if (!query) { + query = @""; + } + if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) { + [mutableRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; + } + [mutableRequest setHTTPBody:[query dataUsingEncoding:self.stringEncoding]]; + } + + return mutableRequest; +} + +#pragma mark - NSKeyValueObserving + ++ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key { + if ([AFHTTPRequestSerializerObservedKeyPaths() containsObject:key]) { + return NO; + } + + return [super automaticallyNotifiesObserversForKey:key]; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath + ofObject:(__unused id)object + change:(NSDictionary *)change + context:(void *)context +{ + if (context == AFHTTPRequestSerializerObserverContext) { + if ([change[NSKeyValueChangeNewKey] isEqual:[NSNull null]]) { + [self.mutableObservedChangedKeyPaths removeObject:keyPath]; + } else { + [self.mutableObservedChangedKeyPaths addObject:keyPath]; + } + } +} + +#pragma mark - NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [self init]; + if (!self) { + return nil; + } + + self.mutableHTTPRequestHeaders = [[decoder decodeObjectOfClass:[NSDictionary class] forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))] mutableCopy]; + self.queryStringSerializationStyle = (AFHTTPRequestQueryStringSerializationStyle)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))] unsignedIntegerValue]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [coder encodeObject:self.mutableHTTPRequestHeaders forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))]; + [coder encodeInteger:self.queryStringSerializationStyle forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFHTTPRequestSerializer *serializer = [[[self class] allocWithZone:zone] init]; + serializer.mutableHTTPRequestHeaders = [self.mutableHTTPRequestHeaders mutableCopyWithZone:zone]; + serializer.queryStringSerializationStyle = self.queryStringSerializationStyle; + serializer.queryStringSerialization = self.queryStringSerialization; + + return serializer; +} + +@end + +#pragma mark - + +static NSString * AFCreateMultipartFormBoundary() { + return [NSString stringWithFormat:@"Boundary+%08X%08X", arc4random(), arc4random()]; +} + +static NSString * const kAFMultipartFormCRLF = @"\r\n"; + +static inline NSString * AFMultipartFormInitialBoundary(NSString *boundary) { + return [NSString stringWithFormat:@"--%@%@", boundary, kAFMultipartFormCRLF]; +} + +static inline NSString * AFMultipartFormEncapsulationBoundary(NSString *boundary) { + return [NSString stringWithFormat:@"%@--%@%@", kAFMultipartFormCRLF, boundary, kAFMultipartFormCRLF]; +} + +static inline NSString * AFMultipartFormFinalBoundary(NSString *boundary) { + return [NSString stringWithFormat:@"%@--%@--%@", kAFMultipartFormCRLF, boundary, kAFMultipartFormCRLF]; +} + +static inline NSString * AFContentTypeForPathExtension(NSString *extension) { + NSString *UTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)extension, NULL); + NSString *contentType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)UTI, kUTTagClassMIMEType); + if (!contentType) { + return @"application/octet-stream"; + } else { + return contentType; + } +} + +NSUInteger const kAFUploadStream3GSuggestedPacketSize = 1024 * 16; +NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2; + +@interface AFHTTPBodyPart : NSObject +@property (nonatomic, assign) NSStringEncoding stringEncoding; +@property (nonatomic, strong) NSDictionary *headers; +@property (nonatomic, copy) NSString *boundary; +@property (nonatomic, strong) id body; +@property (nonatomic, assign) unsigned long long bodyContentLength; +@property (nonatomic, strong) NSInputStream *inputStream; + +@property (nonatomic, assign) BOOL hasInitialBoundary; +@property (nonatomic, assign) BOOL hasFinalBoundary; + +@property (readonly, nonatomic, assign, getter = hasBytesAvailable) BOOL bytesAvailable; +@property (readonly, nonatomic, assign) unsigned long long contentLength; + +- (NSInteger)read:(uint8_t *)buffer + maxLength:(NSUInteger)length; +@end + +@interface AFMultipartBodyStream : NSInputStream +@property (nonatomic, assign) NSUInteger numberOfBytesInPacket; +@property (nonatomic, assign) NSTimeInterval delay; +@property (nonatomic, strong) NSInputStream *inputStream; +@property (readonly, nonatomic, assign) unsigned long long contentLength; +@property (readonly, nonatomic, assign, getter = isEmpty) BOOL empty; + +- (instancetype)initWithStringEncoding:(NSStringEncoding)encoding; +- (void)setInitialAndFinalBoundaries; +- (void)appendHTTPBodyPart:(AFHTTPBodyPart *)bodyPart; +@end + +#pragma mark - + +@interface AFStreamingMultipartFormData () +@property (readwrite, nonatomic, copy) NSMutableURLRequest *request; +@property (readwrite, nonatomic, assign) NSStringEncoding stringEncoding; +@property (readwrite, nonatomic, copy) NSString *boundary; +@property (readwrite, nonatomic, strong) AFMultipartBodyStream *bodyStream; +@end + +@implementation AFStreamingMultipartFormData + +- (instancetype)initWithURLRequest:(NSMutableURLRequest *)urlRequest + stringEncoding:(NSStringEncoding)encoding +{ + self = [super init]; + if (!self) { + return nil; + } + + self.request = urlRequest; + self.stringEncoding = encoding; + self.boundary = AFCreateMultipartFormBoundary(); + self.bodyStream = [[AFMultipartBodyStream alloc] initWithStringEncoding:encoding]; + + return self; +} + +- (BOOL)appendPartWithFileURL:(NSURL *)fileURL + name:(NSString *)name + error:(NSError * __autoreleasing *)error +{ + NSParameterAssert(fileURL); + NSParameterAssert(name); + + NSString *fileName = [fileURL lastPathComponent]; + NSString *mimeType = AFContentTypeForPathExtension([fileURL pathExtension]); + + return [self appendPartWithFileURL:fileURL name:name fileName:fileName mimeType:mimeType error:error]; +} + +- (BOOL)appendPartWithFileURL:(NSURL *)fileURL + name:(NSString *)name + fileName:(NSString *)fileName + mimeType:(NSString *)mimeType + error:(NSError * __autoreleasing *)error +{ + NSParameterAssert(fileURL); + NSParameterAssert(name); + NSParameterAssert(fileName); + NSParameterAssert(mimeType); + + if (![fileURL isFileURL]) { + NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey: NSLocalizedStringFromTable(@"Expected URL to be a file URL", @"AFNetworking", nil)}; + if (error) { + *error = [[NSError alloc] initWithDomain:AFURLRequestSerializationErrorDomain code:NSURLErrorBadURL userInfo:userInfo]; + } + + return NO; + } else if ([fileURL checkResourceIsReachableAndReturnError:error] == NO) { + NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey: NSLocalizedStringFromTable(@"File URL not reachable.", @"AFNetworking", nil)}; + if (error) { + *error = [[NSError alloc] initWithDomain:AFURLRequestSerializationErrorDomain code:NSURLErrorBadURL userInfo:userInfo]; + } + + return NO; + } + + NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[fileURL path] error:error]; + if (!fileAttributes) { + return NO; + } + + NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary]; + [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"]; + [mutableHeaders setValue:mimeType forKey:@"Content-Type"]; + + AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init]; + bodyPart.stringEncoding = self.stringEncoding; + bodyPart.headers = mutableHeaders; + bodyPart.boundary = self.boundary; + bodyPart.body = fileURL; + bodyPart.bodyContentLength = [fileAttributes[NSFileSize] unsignedLongLongValue]; + [self.bodyStream appendHTTPBodyPart:bodyPart]; + + return YES; +} + +- (void)appendPartWithInputStream:(NSInputStream *)inputStream + name:(NSString *)name + fileName:(NSString *)fileName + length:(int64_t)length + mimeType:(NSString *)mimeType +{ + NSParameterAssert(name); + NSParameterAssert(fileName); + NSParameterAssert(mimeType); + + NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary]; + [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"]; + [mutableHeaders setValue:mimeType forKey:@"Content-Type"]; + + AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init]; + bodyPart.stringEncoding = self.stringEncoding; + bodyPart.headers = mutableHeaders; + bodyPart.boundary = self.boundary; + bodyPart.body = inputStream; + + bodyPart.bodyContentLength = (unsigned long long)length; + + [self.bodyStream appendHTTPBodyPart:bodyPart]; +} + +- (void)appendPartWithFileData:(NSData *)data + name:(NSString *)name + fileName:(NSString *)fileName + mimeType:(NSString *)mimeType +{ + NSParameterAssert(name); + NSParameterAssert(fileName); + NSParameterAssert(mimeType); + + NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary]; + [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"]; + [mutableHeaders setValue:mimeType forKey:@"Content-Type"]; + + [self appendPartWithHeaders:mutableHeaders body:data]; +} + +- (void)appendPartWithFormData:(NSData *)data + name:(NSString *)name +{ + NSParameterAssert(name); + + NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary]; + [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"", name] forKey:@"Content-Disposition"]; + + [self appendPartWithHeaders:mutableHeaders body:data]; +} + +- (void)appendPartWithHeaders:(NSDictionary *)headers + body:(NSData *)body +{ + NSParameterAssert(body); + + AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init]; + bodyPart.stringEncoding = self.stringEncoding; + bodyPart.headers = headers; + bodyPart.boundary = self.boundary; + bodyPart.bodyContentLength = [body length]; + bodyPart.body = body; + + [self.bodyStream appendHTTPBodyPart:bodyPart]; +} + +- (void)throttleBandwidthWithPacketSize:(NSUInteger)numberOfBytes + delay:(NSTimeInterval)delay +{ + self.bodyStream.numberOfBytesInPacket = numberOfBytes; + self.bodyStream.delay = delay; +} + +- (NSMutableURLRequest *)requestByFinalizingMultipartFormData { + if ([self.bodyStream isEmpty]) { + return self.request; + } + + // Reset the initial and final boundaries to ensure correct Content-Length + [self.bodyStream setInitialAndFinalBoundaries]; + [self.request setHTTPBodyStream:self.bodyStream]; + + [self.request setValue:[NSString stringWithFormat:@"multipart/form-data; boundary=%@", self.boundary] forHTTPHeaderField:@"Content-Type"]; + [self.request setValue:[NSString stringWithFormat:@"%llu", [self.bodyStream contentLength]] forHTTPHeaderField:@"Content-Length"]; + + return self.request; +} + +@end + +#pragma mark - + +@interface NSStream () +@property (readwrite) NSStreamStatus streamStatus; +@property (readwrite, copy) NSError *streamError; +@end + +@interface AFMultipartBodyStream () +@property (readwrite, nonatomic, assign) NSStringEncoding stringEncoding; +@property (readwrite, nonatomic, strong) NSMutableArray *HTTPBodyParts; +@property (readwrite, nonatomic, strong) NSEnumerator *HTTPBodyPartEnumerator; +@property (readwrite, nonatomic, strong) AFHTTPBodyPart *currentHTTPBodyPart; +@property (readwrite, nonatomic, strong) NSOutputStream *outputStream; +@property (readwrite, nonatomic, strong) NSMutableData *buffer; +@end + +@implementation AFMultipartBodyStream +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wimplicit-atomic-properties" +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1100) +@synthesize delegate; +#endif +@synthesize streamStatus; +@synthesize streamError; +#pragma clang diagnostic pop + +- (instancetype)initWithStringEncoding:(NSStringEncoding)encoding { + self = [super init]; + if (!self) { + return nil; + } + + self.stringEncoding = encoding; + self.HTTPBodyParts = [NSMutableArray array]; + self.numberOfBytesInPacket = NSIntegerMax; + + return self; +} + +- (void)setInitialAndFinalBoundaries { + if ([self.HTTPBodyParts count] > 0) { + for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) { + bodyPart.hasInitialBoundary = NO; + bodyPart.hasFinalBoundary = NO; + } + + [[self.HTTPBodyParts firstObject] setHasInitialBoundary:YES]; + [[self.HTTPBodyParts lastObject] setHasFinalBoundary:YES]; + } +} + +- (void)appendHTTPBodyPart:(AFHTTPBodyPart *)bodyPart { + [self.HTTPBodyParts addObject:bodyPart]; +} + +- (BOOL)isEmpty { + return [self.HTTPBodyParts count] == 0; +} + +#pragma mark - NSInputStream + +- (NSInteger)read:(uint8_t *)buffer + maxLength:(NSUInteger)length +{ + if ([self streamStatus] == NSStreamStatusClosed) { + return 0; + } + + NSInteger totalNumberOfBytesRead = 0; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + while ((NSUInteger)totalNumberOfBytesRead < MIN(length, self.numberOfBytesInPacket)) { + if (!self.currentHTTPBodyPart || ![self.currentHTTPBodyPart hasBytesAvailable]) { + if (!(self.currentHTTPBodyPart = [self.HTTPBodyPartEnumerator nextObject])) { + break; + } + } else { + NSUInteger maxLength = MIN(length, self.numberOfBytesInPacket) - (NSUInteger)totalNumberOfBytesRead; + NSInteger numberOfBytesRead = [self.currentHTTPBodyPart read:&buffer[totalNumberOfBytesRead] maxLength:maxLength]; + if (numberOfBytesRead == -1) { + self.streamError = self.currentHTTPBodyPart.inputStream.streamError; + break; + } else { + totalNumberOfBytesRead += numberOfBytesRead; + + if (self.delay > 0.0f) { + [NSThread sleepForTimeInterval:self.delay]; + } + } + } + } +#pragma clang diagnostic pop + + return totalNumberOfBytesRead; +} + +- (BOOL)getBuffer:(__unused uint8_t **)buffer + length:(__unused NSUInteger *)len +{ + return NO; +} + +- (BOOL)hasBytesAvailable { + return [self streamStatus] == NSStreamStatusOpen; +} + +#pragma mark - NSStream + +- (void)open { + if (self.streamStatus == NSStreamStatusOpen) { + return; + } + + self.streamStatus = NSStreamStatusOpen; + + [self setInitialAndFinalBoundaries]; + self.HTTPBodyPartEnumerator = [self.HTTPBodyParts objectEnumerator]; +} + +- (void)close { + self.streamStatus = NSStreamStatusClosed; +} + +- (id)propertyForKey:(__unused NSString *)key { + return nil; +} + +- (BOOL)setProperty:(__unused id)property + forKey:(__unused NSString *)key +{ + return NO; +} + +- (void)scheduleInRunLoop:(__unused NSRunLoop *)aRunLoop + forMode:(__unused NSString *)mode +{} + +- (void)removeFromRunLoop:(__unused NSRunLoop *)aRunLoop + forMode:(__unused NSString *)mode +{} + +- (unsigned long long)contentLength { + unsigned long long length = 0; + for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) { + length += [bodyPart contentLength]; + } + + return length; +} + +#pragma mark - Undocumented CFReadStream Bridged Methods + +- (void)_scheduleInCFRunLoop:(__unused CFRunLoopRef)aRunLoop + forMode:(__unused CFStringRef)aMode +{} + +- (void)_unscheduleFromCFRunLoop:(__unused CFRunLoopRef)aRunLoop + forMode:(__unused CFStringRef)aMode +{} + +- (BOOL)_setCFClientFlags:(__unused CFOptionFlags)inFlags + callback:(__unused CFReadStreamClientCallBack)inCallback + context:(__unused CFStreamClientContext *)inContext { + return NO; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFMultipartBodyStream *bodyStreamCopy = [[[self class] allocWithZone:zone] initWithStringEncoding:self.stringEncoding]; + + for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) { + [bodyStreamCopy appendHTTPBodyPart:[bodyPart copy]]; + } + + [bodyStreamCopy setInitialAndFinalBoundaries]; + + return bodyStreamCopy; +} + +@end + +#pragma mark - + +typedef enum { + AFEncapsulationBoundaryPhase = 1, + AFHeaderPhase = 2, + AFBodyPhase = 3, + AFFinalBoundaryPhase = 4, +} AFHTTPBodyPartReadPhase; + +@interface AFHTTPBodyPart () { + AFHTTPBodyPartReadPhase _phase; + NSInputStream *_inputStream; + unsigned long long _phaseReadOffset; +} + +- (BOOL)transitionToNextPhase; +- (NSInteger)readData:(NSData *)data + intoBuffer:(uint8_t *)buffer + maxLength:(NSUInteger)length; +@end + +@implementation AFHTTPBodyPart + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + [self transitionToNextPhase]; + + return self; +} + +- (void)dealloc { + if (_inputStream) { + [_inputStream close]; + _inputStream = nil; + } +} + +- (NSInputStream *)inputStream { + if (!_inputStream) { + if ([self.body isKindOfClass:[NSData class]]) { + _inputStream = [NSInputStream inputStreamWithData:self.body]; + } else if ([self.body isKindOfClass:[NSURL class]]) { + _inputStream = [NSInputStream inputStreamWithURL:self.body]; + } else if ([self.body isKindOfClass:[NSInputStream class]]) { + _inputStream = self.body; + } else { + _inputStream = [NSInputStream inputStreamWithData:[NSData data]]; + } + } + + return _inputStream; +} + +- (NSString *)stringForHeaders { + NSMutableString *headerString = [NSMutableString string]; + for (NSString *field in [self.headers allKeys]) { + [headerString appendString:[NSString stringWithFormat:@"%@: %@%@", field, [self.headers valueForKey:field], kAFMultipartFormCRLF]]; + } + [headerString appendString:kAFMultipartFormCRLF]; + + return [NSString stringWithString:headerString]; +} + +- (unsigned long long)contentLength { + unsigned long long length = 0; + + NSData *encapsulationBoundaryData = [([self hasInitialBoundary] ? AFMultipartFormInitialBoundary(self.boundary) : AFMultipartFormEncapsulationBoundary(self.boundary)) dataUsingEncoding:self.stringEncoding]; + length += [encapsulationBoundaryData length]; + + NSData *headersData = [[self stringForHeaders] dataUsingEncoding:self.stringEncoding]; + length += [headersData length]; + + length += _bodyContentLength; + + NSData *closingBoundaryData = ([self hasFinalBoundary] ? [AFMultipartFormFinalBoundary(self.boundary) dataUsingEncoding:self.stringEncoding] : [NSData data]); + length += [closingBoundaryData length]; + + return length; +} + +- (BOOL)hasBytesAvailable { + // Allows `read:maxLength:` to be called again if `AFMultipartFormFinalBoundary` doesn't fit into the available buffer + if (_phase == AFFinalBoundaryPhase) { + return YES; + } + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcovered-switch-default" + switch (self.inputStream.streamStatus) { + case NSStreamStatusNotOpen: + case NSStreamStatusOpening: + case NSStreamStatusOpen: + case NSStreamStatusReading: + case NSStreamStatusWriting: + return YES; + case NSStreamStatusAtEnd: + case NSStreamStatusClosed: + case NSStreamStatusError: + default: + return NO; + } +#pragma clang diagnostic pop +} + +- (NSInteger)read:(uint8_t *)buffer + maxLength:(NSUInteger)length +{ + NSInteger totalNumberOfBytesRead = 0; + + if (_phase == AFEncapsulationBoundaryPhase) { + NSData *encapsulationBoundaryData = [([self hasInitialBoundary] ? AFMultipartFormInitialBoundary(self.boundary) : AFMultipartFormEncapsulationBoundary(self.boundary)) dataUsingEncoding:self.stringEncoding]; + totalNumberOfBytesRead += [self readData:encapsulationBoundaryData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)]; + } + + if (_phase == AFHeaderPhase) { + NSData *headersData = [[self stringForHeaders] dataUsingEncoding:self.stringEncoding]; + totalNumberOfBytesRead += [self readData:headersData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)]; + } + + if (_phase == AFBodyPhase) { + NSInteger numberOfBytesRead = 0; + + numberOfBytesRead = [self.inputStream read:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)]; + if (numberOfBytesRead == -1) { + return -1; + } else { + totalNumberOfBytesRead += numberOfBytesRead; + + if ([self.inputStream streamStatus] >= NSStreamStatusAtEnd) { + [self transitionToNextPhase]; + } + } + } + + if (_phase == AFFinalBoundaryPhase) { + NSData *closingBoundaryData = ([self hasFinalBoundary] ? [AFMultipartFormFinalBoundary(self.boundary) dataUsingEncoding:self.stringEncoding] : [NSData data]); + totalNumberOfBytesRead += [self readData:closingBoundaryData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)]; + } + + return totalNumberOfBytesRead; +} + +- (NSInteger)readData:(NSData *)data + intoBuffer:(uint8_t *)buffer + maxLength:(NSUInteger)length +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + NSRange range = NSMakeRange((NSUInteger)_phaseReadOffset, MIN([data length] - ((NSUInteger)_phaseReadOffset), length)); + [data getBytes:buffer range:range]; +#pragma clang diagnostic pop + + _phaseReadOffset += range.length; + + if (((NSUInteger)_phaseReadOffset) >= [data length]) { + [self transitionToNextPhase]; + } + + return (NSInteger)range.length; +} + +- (BOOL)transitionToNextPhase { + if (![[NSThread currentThread] isMainThread]) { + dispatch_sync(dispatch_get_main_queue(), ^{ + [self transitionToNextPhase]; + }); + return YES; + } + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcovered-switch-default" + switch (_phase) { + case AFEncapsulationBoundaryPhase: + _phase = AFHeaderPhase; + break; + case AFHeaderPhase: + [self.inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; + [self.inputStream open]; + _phase = AFBodyPhase; + break; + case AFBodyPhase: + [self.inputStream close]; + _phase = AFFinalBoundaryPhase; + break; + case AFFinalBoundaryPhase: + default: + _phase = AFEncapsulationBoundaryPhase; + break; + } + _phaseReadOffset = 0; +#pragma clang diagnostic pop + + return YES; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFHTTPBodyPart *bodyPart = [[[self class] allocWithZone:zone] init]; + + bodyPart.stringEncoding = self.stringEncoding; + bodyPart.headers = self.headers; + bodyPart.bodyContentLength = self.bodyContentLength; + bodyPart.body = self.body; + bodyPart.boundary = self.boundary; + + return bodyPart; +} + +@end + +#pragma mark - + +@implementation AFJSONRequestSerializer + ++ (instancetype)serializer { + return [self serializerWithWritingOptions:(NSJSONWritingOptions)0]; +} + ++ (instancetype)serializerWithWritingOptions:(NSJSONWritingOptions)writingOptions +{ + AFJSONRequestSerializer *serializer = [[self alloc] init]; + serializer.writingOptions = writingOptions; + + return serializer; +} + +#pragma mark - AFURLRequestSerialization + +- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request + withParameters:(id)parameters + error:(NSError *__autoreleasing *)error +{ + NSParameterAssert(request); + + if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) { + return [super requestBySerializingRequest:request withParameters:parameters error:error]; + } + + NSMutableURLRequest *mutableRequest = [request mutableCopy]; + + [self.HTTPRequestHeaders enumerateKeysAndObjectsUsingBlock:^(id field, id value, BOOL * __unused stop) { + if (![request valueForHTTPHeaderField:field]) { + [mutableRequest setValue:value forHTTPHeaderField:field]; + } + }]; + + if (parameters) { + if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) { + [mutableRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; + } + + [mutableRequest setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:self.writingOptions error:error]]; + } + + return mutableRequest; +} + +#pragma mark - NSSecureCoding + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + + self.writingOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(writingOptions))] unsignedIntegerValue]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeInteger:self.writingOptions forKey:NSStringFromSelector(@selector(writingOptions))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFJSONRequestSerializer *serializer = [super copyWithZone:zone]; + serializer.writingOptions = self.writingOptions; + + return serializer; +} + +@end + +#pragma mark - + +@implementation AFPropertyListRequestSerializer + ++ (instancetype)serializer { + return [self serializerWithFormat:NSPropertyListXMLFormat_v1_0 writeOptions:0]; +} + ++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format + writeOptions:(NSPropertyListWriteOptions)writeOptions +{ + AFPropertyListRequestSerializer *serializer = [[self alloc] init]; + serializer.format = format; + serializer.writeOptions = writeOptions; + + return serializer; +} + +#pragma mark - AFURLRequestSerializer + +- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request + withParameters:(id)parameters + error:(NSError *__autoreleasing *)error +{ + NSParameterAssert(request); + + if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) { + return [super requestBySerializingRequest:request withParameters:parameters error:error]; + } + + NSMutableURLRequest *mutableRequest = [request mutableCopy]; + + [self.HTTPRequestHeaders enumerateKeysAndObjectsUsingBlock:^(id field, id value, BOOL * __unused stop) { + if (![request valueForHTTPHeaderField:field]) { + [mutableRequest setValue:value forHTTPHeaderField:field]; + } + }]; + + if (parameters) { + if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) { + [mutableRequest setValue:@"application/x-plist" forHTTPHeaderField:@"Content-Type"]; + } + + [mutableRequest setHTTPBody:[NSPropertyListSerialization dataWithPropertyList:parameters format:self.format options:self.writeOptions error:error]]; + } + + return mutableRequest; +} + +#pragma mark - NSSecureCoding + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + + self.format = (NSPropertyListFormat)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue]; + self.writeOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(writeOptions))] unsignedIntegerValue]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeInteger:self.format forKey:NSStringFromSelector(@selector(format))]; + [coder encodeObject:@(self.writeOptions) forKey:NSStringFromSelector(@selector(writeOptions))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFPropertyListRequestSerializer *serializer = [super copyWithZone:zone]; + serializer.format = self.format; + serializer.writeOptions = self.writeOptions; + + return serializer; +} + +@end diff --git a/Example/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h b/Example/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h new file mode 100644 index 0000000..f9e14c6 --- /dev/null +++ b/Example/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h @@ -0,0 +1,311 @@ +// AFURLResponseSerialization.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + The `AFURLResponseSerialization` protocol is adopted by an object that decodes data into a more useful object representation, according to details in the server response. Response serializers may additionally perform validation on the incoming response and data. + + For example, a JSON response serializer may check for an acceptable status code (`2XX` range) and content type (`application/json`), decoding a valid JSON response into an object. + */ +@protocol AFURLResponseSerialization + +/** + The response object decoded from the data associated with a specified response. + + @param response The response to be processed. + @param data The response data to be decoded. + @param error The error that occurred while attempting to decode the response data. + + @return The object decoded from the specified response data. + */ +- (nullable id)responseObjectForResponse:(nullable NSURLResponse *)response + data:(nullable NSData *)data + error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW; + +@end + +#pragma mark - + +/** + `AFHTTPResponseSerializer` conforms to the `AFURLRequestSerialization` & `AFURLResponseSerialization` protocols, offering a concrete base implementation of query string / URL form-encoded parameter serialization and default request headers, as well as response status code and content type validation. + + Any request or response serializer dealing with HTTP is encouraged to subclass `AFHTTPResponseSerializer` in order to ensure consistent default behavior. + */ +@interface AFHTTPResponseSerializer : NSObject + +- (instancetype)init; + +/** + The string encoding used to serialize data received from the server, when no string encoding is specified by the response. `NSUTF8StringEncoding` by default. + */ +@property (nonatomic, assign) NSStringEncoding stringEncoding; + +/** + Creates and returns a serializer with default configuration. + */ ++ (instancetype)serializer; + +///----------------------------------------- +/// @name Configuring Response Serialization +///----------------------------------------- + +/** + The acceptable HTTP status codes for responses. When non-`nil`, responses with status codes not contained by the set will result in an error during validation. + + See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html + */ +@property (nonatomic, copy, nullable) NSIndexSet *acceptableStatusCodes; + +/** + The acceptable MIME types for responses. When non-`nil`, responses with a `Content-Type` with MIME types that do not intersect with the set will result in an error during validation. + */ +@property (nonatomic, copy, nullable) NSSet *acceptableContentTypes; + +/** + Validates the specified response and data. + + In its base implementation, this method checks for an acceptable status code and content type. Subclasses may wish to add other domain-specific checks. + + @param response The response to be validated. + @param data The data associated with the response. + @param error The error that occurred while attempting to validate the response. + + @return `YES` if the response is valid, otherwise `NO`. + */ +- (BOOL)validateResponse:(nullable NSHTTPURLResponse *)response + data:(nullable NSData *)data + error:(NSError * _Nullable __autoreleasing *)error; + +@end + +#pragma mark - + + +/** + `AFJSONResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes JSON responses. + + By default, `AFJSONResponseSerializer` accepts the following MIME types, which includes the official standard, `application/json`, as well as other commonly-used types: + + - `application/json` + - `text/json` + - `text/javascript` + */ +@interface AFJSONResponseSerializer : AFHTTPResponseSerializer + +- (instancetype)init; + +/** + Options for reading the response JSON data and creating the Foundation objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default. + */ +@property (nonatomic, assign) NSJSONReadingOptions readingOptions; + +/** + Whether to remove keys with `NSNull` values from response JSON. Defaults to `NO`. + */ +@property (nonatomic, assign) BOOL removesKeysWithNullValues; + +/** + Creates and returns a JSON serializer with specified reading and writing options. + + @param readingOptions The specified JSON reading options. + */ ++ (instancetype)serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions; + +@end + +#pragma mark - + +/** + `AFXMLParserResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLParser` objects. + + By default, `AFXMLParserResponseSerializer` accepts the following MIME types, which includes the official standard, `application/xml`, as well as other commonly-used types: + + - `application/xml` + - `text/xml` + */ +@interface AFXMLParserResponseSerializer : AFHTTPResponseSerializer + +@end + +#pragma mark - + +#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED + +/** + `AFXMLDocumentResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLDocument` objects. + + By default, `AFXMLDocumentResponseSerializer` accepts the following MIME types, which includes the official standard, `application/xml`, as well as other commonly-used types: + + - `application/xml` + - `text/xml` + */ +@interface AFXMLDocumentResponseSerializer : AFHTTPResponseSerializer + +- (instancetype)init; + +/** + Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default. + */ +@property (nonatomic, assign) NSUInteger options; + +/** + Creates and returns an XML document serializer with the specified options. + + @param mask The XML document options. + */ ++ (instancetype)serializerWithXMLDocumentOptions:(NSUInteger)mask; + +@end + +#endif + +#pragma mark - + +/** + `AFPropertyListResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLDocument` objects. + + By default, `AFPropertyListResponseSerializer` accepts the following MIME types: + + - `application/x-plist` + */ +@interface AFPropertyListResponseSerializer : AFHTTPResponseSerializer + +- (instancetype)init; + +/** + The property list format. Possible values are described in "NSPropertyListFormat". + */ +@property (nonatomic, assign) NSPropertyListFormat format; + +/** + The property list reading options. Possible values are described in "NSPropertyListMutabilityOptions." + */ +@property (nonatomic, assign) NSPropertyListReadOptions readOptions; + +/** + Creates and returns a property list serializer with a specified format, read options, and write options. + + @param format The property list format. + @param readOptions The property list reading options. + */ ++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format + readOptions:(NSPropertyListReadOptions)readOptions; + +@end + +#pragma mark - + +/** + `AFImageResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes image responses. + + By default, `AFImageResponseSerializer` accepts the following MIME types, which correspond to the image formats supported by UIImage or NSImage: + + - `image/tiff` + - `image/jpeg` + - `image/gif` + - `image/png` + - `image/ico` + - `image/x-icon` + - `image/bmp` + - `image/x-bmp` + - `image/x-xbitmap` + - `image/x-win-bitmap` + */ +@interface AFImageResponseSerializer : AFHTTPResponseSerializer + +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH +/** + The scale factor used when interpreting the image data to construct `responseImage`. Specifying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the size property. This is set to the value of scale of the main screen by default, which automatically scales images for retina displays, for instance. + */ +@property (nonatomic, assign) CGFloat imageScale; + +/** + Whether to automatically inflate response image data for compressed formats (such as PNG or JPEG). Enabling this can significantly improve drawing performance on iOS when used with `setCompletionBlockWithSuccess:failure:`, as it allows a bitmap representation to be constructed in the background rather than on the main thread. `YES` by default. + */ +@property (nonatomic, assign) BOOL automaticallyInflatesResponseImage; +#endif + +@end + +#pragma mark - + +/** + `AFCompoundSerializer` is a subclass of `AFHTTPResponseSerializer` that delegates the response serialization to the first `AFHTTPResponseSerializer` object that returns an object for `responseObjectForResponse:data:error:`, falling back on the default behavior of `AFHTTPResponseSerializer`. This is useful for supporting multiple potential types and structures of server responses with a single serializer. + */ +@interface AFCompoundResponseSerializer : AFHTTPResponseSerializer + +/** + The component response serializers. + */ +@property (readonly, nonatomic, copy) NSArray > *responseSerializers; + +/** + Creates and returns a compound serializer comprised of the specified response serializers. + + @warning Each response serializer specified must be a subclass of `AFHTTPResponseSerializer`, and response to `-validateResponse:data:error:`. + */ ++ (instancetype)compoundSerializerWithResponseSerializers:(NSArray > *)responseSerializers; + +@end + +///---------------- +/// @name Constants +///---------------- + +/** + ## Error Domains + + The following error domain is predefined. + + - `NSString * const AFURLResponseSerializationErrorDomain` + + ### Constants + + `AFURLResponseSerializationErrorDomain` + AFURLResponseSerializer errors. Error codes for `AFURLResponseSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`. + */ +FOUNDATION_EXPORT NSString * const AFURLResponseSerializationErrorDomain; + +/** + ## User info dictionary keys + + These keys may exist in the user info dictionary, in addition to those defined for NSError. + + - `NSString * const AFNetworkingOperationFailingURLResponseErrorKey` + - `NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey` + + ### Constants + + `AFNetworkingOperationFailingURLResponseErrorKey` + The corresponding value is an `NSURLResponse` containing the response of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`. + + `AFNetworkingOperationFailingURLResponseDataErrorKey` + The corresponding value is an `NSData` containing the original data of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseErrorKey; + +FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey; + +NS_ASSUME_NONNULL_END diff --git a/Example/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m b/Example/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m new file mode 100755 index 0000000..ef5e334 --- /dev/null +++ b/Example/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m @@ -0,0 +1,828 @@ +// AFURLResponseSerialization.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "AFURLResponseSerialization.h" + +#import + +#if TARGET_OS_IOS +#import +#elif TARGET_OS_WATCH +#import +#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) +#import +#endif + +NSString * const AFURLResponseSerializationErrorDomain = @"com.alamofire.error.serialization.response"; +NSString * const AFNetworkingOperationFailingURLResponseErrorKey = @"com.alamofire.serialization.response.error.response"; +NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey = @"com.alamofire.serialization.response.error.data"; + +static NSError * AFErrorWithUnderlyingError(NSError *error, NSError *underlyingError) { + if (!error) { + return underlyingError; + } + + if (!underlyingError || error.userInfo[NSUnderlyingErrorKey]) { + return error; + } + + NSMutableDictionary *mutableUserInfo = [error.userInfo mutableCopy]; + mutableUserInfo[NSUnderlyingErrorKey] = underlyingError; + + return [[NSError alloc] initWithDomain:error.domain code:error.code userInfo:mutableUserInfo]; +} + +static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger code, NSString *domain) { + if ([error.domain isEqualToString:domain] && error.code == code) { + return YES; + } else if (error.userInfo[NSUnderlyingErrorKey]) { + return AFErrorOrUnderlyingErrorHasCodeInDomain(error.userInfo[NSUnderlyingErrorKey], code, domain); + } + + return NO; +} + +static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions) { + if ([JSONObject isKindOfClass:[NSArray class]]) { + NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:[(NSArray *)JSONObject count]]; + for (id value in (NSArray *)JSONObject) { + [mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)]; + } + + return (readingOptions & NSJSONReadingMutableContainers) ? mutableArray : [NSArray arrayWithArray:mutableArray]; + } else if ([JSONObject isKindOfClass:[NSDictionary class]]) { + NSMutableDictionary *mutableDictionary = [NSMutableDictionary dictionaryWithDictionary:JSONObject]; + for (id key in [(NSDictionary *)JSONObject allKeys]) { + id value = (NSDictionary *)JSONObject[key]; + if (!value || [value isEqual:[NSNull null]]) { + [mutableDictionary removeObjectForKey:key]; + } else if ([value isKindOfClass:[NSArray class]] || [value isKindOfClass:[NSDictionary class]]) { + mutableDictionary[key] = AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions); + } + } + + return (readingOptions & NSJSONReadingMutableContainers) ? mutableDictionary : [NSDictionary dictionaryWithDictionary:mutableDictionary]; + } + + return JSONObject; +} + +@implementation AFHTTPResponseSerializer + ++ (instancetype)serializer { + return [[self alloc] init]; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.stringEncoding = NSUTF8StringEncoding; + + self.acceptableStatusCodes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(200, 100)]; + self.acceptableContentTypes = nil; + + return self; +} + +#pragma mark - + +- (BOOL)validateResponse:(NSHTTPURLResponse *)response + data:(NSData *)data + error:(NSError * __autoreleasing *)error +{ + BOOL responseIsValid = YES; + NSError *validationError = nil; + + if (response && [response isKindOfClass:[NSHTTPURLResponse class]]) { + if (self.acceptableContentTypes && ![self.acceptableContentTypes containsObject:[response MIMEType]]) { + if ([data length] > 0 && [response URL]) { + NSMutableDictionary *mutableUserInfo = [@{ + NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: unacceptable content-type: %@", @"AFNetworking", nil), [response MIMEType]], + NSURLErrorFailingURLErrorKey:[response URL], + AFNetworkingOperationFailingURLResponseErrorKey: response, + } mutableCopy]; + if (data) { + mutableUserInfo[AFNetworkingOperationFailingURLResponseDataErrorKey] = data; + } + + validationError = AFErrorWithUnderlyingError([NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:mutableUserInfo], validationError); + } + + responseIsValid = NO; + } + + if (self.acceptableStatusCodes && ![self.acceptableStatusCodes containsIndex:(NSUInteger)response.statusCode] && [response URL]) { + NSMutableDictionary *mutableUserInfo = [@{ + NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: %@ (%ld)", @"AFNetworking", nil), [NSHTTPURLResponse localizedStringForStatusCode:response.statusCode], (long)response.statusCode], + NSURLErrorFailingURLErrorKey:[response URL], + AFNetworkingOperationFailingURLResponseErrorKey: response, + } mutableCopy]; + + if (data) { + mutableUserInfo[AFNetworkingOperationFailingURLResponseDataErrorKey] = data; + } + + validationError = AFErrorWithUnderlyingError([NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorBadServerResponse userInfo:mutableUserInfo], validationError); + + responseIsValid = NO; + } + } + + if (error && !responseIsValid) { + *error = validationError; + } + + return responseIsValid; +} + +#pragma mark - AFURLResponseSerialization + +- (id)responseObjectForResponse:(NSURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + [self validateResponse:(NSHTTPURLResponse *)response data:data error:error]; + + return data; +} + +#pragma mark - NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [self init]; + if (!self) { + return nil; + } + + self.acceptableStatusCodes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableStatusCodes))]; + self.acceptableContentTypes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableContentTypes))]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [coder encodeObject:self.acceptableStatusCodes forKey:NSStringFromSelector(@selector(acceptableStatusCodes))]; + [coder encodeObject:self.acceptableContentTypes forKey:NSStringFromSelector(@selector(acceptableContentTypes))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFHTTPResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + serializer.acceptableStatusCodes = [self.acceptableStatusCodes copyWithZone:zone]; + serializer.acceptableContentTypes = [self.acceptableContentTypes copyWithZone:zone]; + + return serializer; +} + +@end + +#pragma mark - + +@implementation AFJSONResponseSerializer + ++ (instancetype)serializer { + return [self serializerWithReadingOptions:(NSJSONReadingOptions)0]; +} + ++ (instancetype)serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions { + AFJSONResponseSerializer *serializer = [[self alloc] init]; + serializer.readingOptions = readingOptions; + + return serializer; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", nil]; + + return self; +} + +#pragma mark - AFURLResponseSerialization + +- (id)responseObjectForResponse:(NSURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { + if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { + return nil; + } + } + + // Workaround for behavior of Rails to return a single space for `head :ok` (a workaround for a bug in Safari), which is not interpreted as valid input by NSJSONSerialization. + // See https://github.com/rails/rails/issues/1742 + NSStringEncoding stringEncoding = self.stringEncoding; + if (response.textEncodingName) { + CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName); + if (encoding != kCFStringEncodingInvalidId) { + stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding); + } + } + + id responseObject = nil; + NSError *serializationError = nil; + @autoreleasepool { + NSString *responseString = [[NSString alloc] initWithData:data encoding:stringEncoding]; + if (responseString && ![responseString isEqualToString:@" "]) { + // Workaround for a bug in NSJSONSerialization when Unicode character escape codes are used instead of the actual character + // See http://stackoverflow.com/a/12843465/157142 + data = [responseString dataUsingEncoding:NSUTF8StringEncoding]; + + if (data) { + if ([data length] > 0) { + responseObject = [NSJSONSerialization JSONObjectWithData:data options:self.readingOptions error:&serializationError]; + } else { + return nil; + } + } else { + NSDictionary *userInfo = @{ + NSLocalizedDescriptionKey: NSLocalizedStringFromTable(@"Data failed decoding as a UTF-8 string", @"AFNetworking", nil), + NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Could not decode string: %@", @"AFNetworking", nil), responseString] + }; + + serializationError = [NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:userInfo]; + } + } + } + + if (self.removesKeysWithNullValues && responseObject) { + responseObject = AFJSONObjectByRemovingKeysWithNullValues(responseObject, self.readingOptions); + } + + if (error) { + *error = AFErrorWithUnderlyingError(serializationError, *error); + } + + return responseObject; +} + +#pragma mark - NSSecureCoding + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + + self.readingOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(readingOptions))] unsignedIntegerValue]; + self.removesKeysWithNullValues = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(removesKeysWithNullValues))] boolValue]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeObject:@(self.readingOptions) forKey:NSStringFromSelector(@selector(readingOptions))]; + [coder encodeObject:@(self.removesKeysWithNullValues) forKey:NSStringFromSelector(@selector(removesKeysWithNullValues))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFJSONResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + serializer.readingOptions = self.readingOptions; + serializer.removesKeysWithNullValues = self.removesKeysWithNullValues; + + return serializer; +} + +@end + +#pragma mark - + +@implementation AFXMLParserResponseSerializer + ++ (instancetype)serializer { + AFXMLParserResponseSerializer *serializer = [[self alloc] init]; + + return serializer; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/xml", @"text/xml", nil]; + + return self; +} + +#pragma mark - AFURLResponseSerialization + +- (id)responseObjectForResponse:(NSHTTPURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { + if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { + return nil; + } + } + + return [[NSXMLParser alloc] initWithData:data]; +} + +@end + +#pragma mark - + +#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED + +@implementation AFXMLDocumentResponseSerializer + ++ (instancetype)serializer { + return [self serializerWithXMLDocumentOptions:0]; +} + ++ (instancetype)serializerWithXMLDocumentOptions:(NSUInteger)mask { + AFXMLDocumentResponseSerializer *serializer = [[self alloc] init]; + serializer.options = mask; + + return serializer; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/xml", @"text/xml", nil]; + + return self; +} + +#pragma mark - AFURLResponseSerialization + +- (id)responseObjectForResponse:(NSURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { + if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { + return nil; + } + } + + NSError *serializationError = nil; + NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:data options:self.options error:&serializationError]; + + if (error) { + *error = AFErrorWithUnderlyingError(serializationError, *error); + } + + return document; +} + +#pragma mark - NSSecureCoding + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + + self.options = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(options))] unsignedIntegerValue]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeObject:@(self.options) forKey:NSStringFromSelector(@selector(options))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFXMLDocumentResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + serializer.options = self.options; + + return serializer; +} + +@end + +#endif + +#pragma mark - + +@implementation AFPropertyListResponseSerializer + ++ (instancetype)serializer { + return [self serializerWithFormat:NSPropertyListXMLFormat_v1_0 readOptions:0]; +} + ++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format + readOptions:(NSPropertyListReadOptions)readOptions +{ + AFPropertyListResponseSerializer *serializer = [[self alloc] init]; + serializer.format = format; + serializer.readOptions = readOptions; + + return serializer; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/x-plist", nil]; + + return self; +} + +#pragma mark - AFURLResponseSerialization + +- (id)responseObjectForResponse:(NSURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { + if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { + return nil; + } + } + + id responseObject; + NSError *serializationError = nil; + + if (data) { + responseObject = [NSPropertyListSerialization propertyListWithData:data options:self.readOptions format:NULL error:&serializationError]; + } + + if (error) { + *error = AFErrorWithUnderlyingError(serializationError, *error); + } + + return responseObject; +} + +#pragma mark - NSSecureCoding + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + + self.format = (NSPropertyListFormat)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue]; + self.readOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(readOptions))] unsignedIntegerValue]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeObject:@(self.format) forKey:NSStringFromSelector(@selector(format))]; + [coder encodeObject:@(self.readOptions) forKey:NSStringFromSelector(@selector(readOptions))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFPropertyListResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + serializer.format = self.format; + serializer.readOptions = self.readOptions; + + return serializer; +} + +@end + +#pragma mark - + +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH +#import +#import + +@interface UIImage (AFNetworkingSafeImageLoading) ++ (UIImage *)af_safeImageWithData:(NSData *)data; +@end + +static NSLock* imageLock = nil; + +@implementation UIImage (AFNetworkingSafeImageLoading) + ++ (UIImage *)af_safeImageWithData:(NSData *)data { + UIImage* image = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + imageLock = [[NSLock alloc] init]; + }); + + [imageLock lock]; + image = [UIImage imageWithData:data]; + [imageLock unlock]; + return image; +} + +@end + +static UIImage * AFImageWithDataAtScale(NSData *data, CGFloat scale) { + UIImage *image = [UIImage af_safeImageWithData:data]; + if (image.images) { + return image; + } + + return [[UIImage alloc] initWithCGImage:[image CGImage] scale:scale orientation:image.imageOrientation]; +} + +static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *response, NSData *data, CGFloat scale) { + if (!data || [data length] == 0) { + return nil; + } + + CGImageRef imageRef = NULL; + CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData((__bridge CFDataRef)data); + + if ([response.MIMEType isEqualToString:@"image/png"]) { + imageRef = CGImageCreateWithPNGDataProvider(dataProvider, NULL, true, kCGRenderingIntentDefault); + } else if ([response.MIMEType isEqualToString:@"image/jpeg"]) { + imageRef = CGImageCreateWithJPEGDataProvider(dataProvider, NULL, true, kCGRenderingIntentDefault); + + if (imageRef) { + CGColorSpaceRef imageColorSpace = CGImageGetColorSpace(imageRef); + CGColorSpaceModel imageColorSpaceModel = CGColorSpaceGetModel(imageColorSpace); + + // CGImageCreateWithJPEGDataProvider does not properly handle CMKY, so fall back to AFImageWithDataAtScale + if (imageColorSpaceModel == kCGColorSpaceModelCMYK) { + CGImageRelease(imageRef); + imageRef = NULL; + } + } + } + + CGDataProviderRelease(dataProvider); + + UIImage *image = AFImageWithDataAtScale(data, scale); + if (!imageRef) { + if (image.images || !image) { + return image; + } + + imageRef = CGImageCreateCopy([image CGImage]); + if (!imageRef) { + return nil; + } + } + + size_t width = CGImageGetWidth(imageRef); + size_t height = CGImageGetHeight(imageRef); + size_t bitsPerComponent = CGImageGetBitsPerComponent(imageRef); + + if (width * height > 1024 * 1024 || bitsPerComponent > 8) { + CGImageRelease(imageRef); + + return image; + } + + // CGImageGetBytesPerRow() calculates incorrectly in iOS 5.0, so defer to CGBitmapContextCreate + size_t bytesPerRow = 0; + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGColorSpaceModel colorSpaceModel = CGColorSpaceGetModel(colorSpace); + CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef); + + if (colorSpaceModel == kCGColorSpaceModelRGB) { + uint32_t alpha = (bitmapInfo & kCGBitmapAlphaInfoMask); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wassign-enum" + if (alpha == kCGImageAlphaNone) { + bitmapInfo &= ~kCGBitmapAlphaInfoMask; + bitmapInfo |= kCGImageAlphaNoneSkipFirst; + } else if (!(alpha == kCGImageAlphaNoneSkipFirst || alpha == kCGImageAlphaNoneSkipLast)) { + bitmapInfo &= ~kCGBitmapAlphaInfoMask; + bitmapInfo |= kCGImageAlphaPremultipliedFirst; + } +#pragma clang diagnostic pop + } + + CGContextRef context = CGBitmapContextCreate(NULL, width, height, bitsPerComponent, bytesPerRow, colorSpace, bitmapInfo); + + CGColorSpaceRelease(colorSpace); + + if (!context) { + CGImageRelease(imageRef); + + return image; + } + + CGContextDrawImage(context, CGRectMake(0.0f, 0.0f, width, height), imageRef); + CGImageRef inflatedImageRef = CGBitmapContextCreateImage(context); + + CGContextRelease(context); + + UIImage *inflatedImage = [[UIImage alloc] initWithCGImage:inflatedImageRef scale:scale orientation:image.imageOrientation]; + + CGImageRelease(inflatedImageRef); + CGImageRelease(imageRef); + + return inflatedImage; +} +#endif + + +@implementation AFImageResponseSerializer + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"image/tiff", @"image/jpeg", @"image/gif", @"image/png", @"image/ico", @"image/x-icon", @"image/bmp", @"image/x-bmp", @"image/x-xbitmap", @"image/x-win-bitmap", nil]; + +#if TARGET_OS_IOS || TARGET_OS_TV + self.imageScale = [[UIScreen mainScreen] scale]; + self.automaticallyInflatesResponseImage = YES; +#elif TARGET_OS_WATCH + self.imageScale = [[WKInterfaceDevice currentDevice] screenScale]; + self.automaticallyInflatesResponseImage = YES; +#endif + + return self; +} + +#pragma mark - AFURLResponseSerializer + +- (id)responseObjectForResponse:(NSURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { + if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { + return nil; + } + } + +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH + if (self.automaticallyInflatesResponseImage) { + return AFInflatedImageFromResponseWithDataAtScale((NSHTTPURLResponse *)response, data, self.imageScale); + } else { + return AFImageWithDataAtScale(data, self.imageScale); + } +#else + // Ensure that the image is set to it's correct pixel width and height + NSBitmapImageRep *bitimage = [[NSBitmapImageRep alloc] initWithData:data]; + NSImage *image = [[NSImage alloc] initWithSize:NSMakeSize([bitimage pixelsWide], [bitimage pixelsHigh])]; + [image addRepresentation:bitimage]; + + return image; +#endif + + return nil; +} + +#pragma mark - NSSecureCoding + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH + NSNumber *imageScale = [decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(imageScale))]; +#if CGFLOAT_IS_DOUBLE + self.imageScale = [imageScale doubleValue]; +#else + self.imageScale = [imageScale floatValue]; +#endif + + self.automaticallyInflatesResponseImage = [decoder decodeBoolForKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))]; +#endif + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH + [coder encodeObject:@(self.imageScale) forKey:NSStringFromSelector(@selector(imageScale))]; + [coder encodeBool:self.automaticallyInflatesResponseImage forKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))]; +#endif +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFImageResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH + serializer.imageScale = self.imageScale; + serializer.automaticallyInflatesResponseImage = self.automaticallyInflatesResponseImage; +#endif + + return serializer; +} + +@end + +#pragma mark - + +@interface AFCompoundResponseSerializer () +@property (readwrite, nonatomic, copy) NSArray *responseSerializers; +@end + +@implementation AFCompoundResponseSerializer + ++ (instancetype)compoundSerializerWithResponseSerializers:(NSArray *)responseSerializers { + AFCompoundResponseSerializer *serializer = [[self alloc] init]; + serializer.responseSerializers = responseSerializers; + + return serializer; +} + +#pragma mark - AFURLResponseSerialization + +- (id)responseObjectForResponse:(NSURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + for (id serializer in self.responseSerializers) { + if (![serializer isKindOfClass:[AFHTTPResponseSerializer class]]) { + continue; + } + + NSError *serializerError = nil; + id responseObject = [serializer responseObjectForResponse:response data:data error:&serializerError]; + if (responseObject) { + if (error) { + *error = AFErrorWithUnderlyingError(serializerError, *error); + } + + return responseObject; + } + } + + return [super responseObjectForResponse:response data:data error:error]; +} + +#pragma mark - NSSecureCoding + +- (instancetype)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + + self.responseSerializers = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(responseSerializers))]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeObject:self.responseSerializers forKey:NSStringFromSelector(@selector(responseSerializers))]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + AFCompoundResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + serializer.responseSerializers = self.responseSerializers; + + return serializer; +} + +@end diff --git a/Example/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h b/Example/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h new file mode 100644 index 0000000..be91828 --- /dev/null +++ b/Example/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h @@ -0,0 +1,499 @@ +// AFURLSessionManager.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + + +#import + +#import "AFURLResponseSerialization.h" +#import "AFURLRequestSerialization.h" +#import "AFSecurityPolicy.h" +#if !TARGET_OS_WATCH +#import "AFNetworkReachabilityManager.h" +#endif + +/** + `AFURLSessionManager` creates and manages an `NSURLSession` object based on a specified `NSURLSessionConfiguration` object, which conforms to ``, ``, ``, and ``. + + ## Subclassing Notes + + This is the base class for `AFHTTPSessionManager`, which adds functionality specific to making HTTP requests. If you are looking to extend `AFURLSessionManager` specifically for HTTP, consider subclassing `AFHTTPSessionManager` instead. + + ## NSURLSession & NSURLSessionTask Delegate Methods + + `AFURLSessionManager` implements the following delegate methods: + + ### `NSURLSessionDelegate` + + - `URLSession:didBecomeInvalidWithError:` + - `URLSession:didReceiveChallenge:completionHandler:` + - `URLSessionDidFinishEventsForBackgroundURLSession:` + + ### `NSURLSessionTaskDelegate` + + - `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:` + - `URLSession:task:didReceiveChallenge:completionHandler:` + - `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:` + - `URLSession:task:didCompleteWithError:` + + ### `NSURLSessionDataDelegate` + + - `URLSession:dataTask:didReceiveResponse:completionHandler:` + - `URLSession:dataTask:didBecomeDownloadTask:` + - `URLSession:dataTask:didReceiveData:` + - `URLSession:dataTask:willCacheResponse:completionHandler:` + + ### `NSURLSessionDownloadDelegate` + + - `URLSession:downloadTask:didFinishDownloadingToURL:` + - `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:` + - `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:` + + If any of these methods are overridden in a subclass, they _must_ call the `super` implementation first. + + ## Network Reachability Monitoring + + Network reachability status and change monitoring is available through the `reachabilityManager` property. Applications may choose to monitor network reachability conditions in order to prevent or suspend any outbound requests. See `AFNetworkReachabilityManager` for more details. + + ## NSCoding Caveats + + - Encoded managers do not include any block properties. Be sure to set delegate callback blocks when using `-initWithCoder:` or `NSKeyedUnarchiver`. + + ## NSCopying Caveats + + - `-copy` and `-copyWithZone:` return a new manager with a new `NSURLSession` created from the configuration of the original. + - Operation copies do not include any delegate callback blocks, as they often strongly captures a reference to `self`, which would otherwise have the unintuitive side-effect of pointing to the _original_ session manager when copied. + + @warning Managers for background sessions must be owned for the duration of their use. This can be accomplished by creating an application-wide or shared singleton instance. + */ + +NS_ASSUME_NONNULL_BEGIN + +@interface AFURLSessionManager : NSObject + +/** + The managed session. + */ +@property (readonly, nonatomic, strong) NSURLSession *session; + +/** + The operation queue on which delegate callbacks are run. + */ +@property (readonly, nonatomic, strong) NSOperationQueue *operationQueue; + +/** + Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an instance of `AFJSONResponseSerializer`. + + @warning `responseSerializer` must not be `nil`. + */ +@property (nonatomic, strong) id responseSerializer; + +///------------------------------- +/// @name Managing Security Policy +///------------------------------- + +/** + The security policy used by created session to evaluate server trust for secure connections. `AFURLSessionManager` uses the `defaultPolicy` unless otherwise specified. + */ +@property (nonatomic, strong) AFSecurityPolicy *securityPolicy; + +#if !TARGET_OS_WATCH +///-------------------------------------- +/// @name Monitoring Network Reachability +///-------------------------------------- + +/** + The network reachability manager. `AFURLSessionManager` uses the `sharedManager` by default. + */ +@property (readwrite, nonatomic, strong) AFNetworkReachabilityManager *reachabilityManager; +#endif + +///---------------------------- +/// @name Getting Session Tasks +///---------------------------- + +/** + The data, upload, and download tasks currently run by the managed session. + */ +@property (readonly, nonatomic, strong) NSArray *tasks; + +/** + The data tasks currently run by the managed session. + */ +@property (readonly, nonatomic, strong) NSArray *dataTasks; + +/** + The upload tasks currently run by the managed session. + */ +@property (readonly, nonatomic, strong) NSArray *uploadTasks; + +/** + The download tasks currently run by the managed session. + */ +@property (readonly, nonatomic, strong) NSArray *downloadTasks; + +///------------------------------- +/// @name Managing Callback Queues +///------------------------------- + +/** + The dispatch queue for `completionBlock`. If `NULL` (default), the main queue is used. + */ +@property (nonatomic, strong, nullable) dispatch_queue_t completionQueue; + +/** + The dispatch group for `completionBlock`. If `NULL` (default), a private dispatch group is used. + */ +@property (nonatomic, strong, nullable) dispatch_group_t completionGroup; + +///--------------------------------- +/// @name Working Around System Bugs +///--------------------------------- + +/** + Whether to attempt to retry creation of upload tasks for background sessions when initial call returns `nil`. `NO` by default. + + @bug As of iOS 7.0, there is a bug where upload tasks created for background tasks are sometimes `nil`. As a workaround, if this property is `YES`, AFNetworking will follow Apple's recommendation to try creating the task again. + + @see https://github.com/AFNetworking/AFNetworking/issues/1675 + */ +@property (nonatomic, assign) BOOL attemptsToRecreateUploadTasksForBackgroundSessions; + +///--------------------- +/// @name Initialization +///--------------------- + +/** + Creates and returns a manager for a session created with the specified configuration. This is the designated initializer. + + @param configuration The configuration used to create the managed session. + + @return A manager for a newly-created session. + */ +- (instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER; + +/** + Invalidates the managed session, optionally canceling pending tasks. + + @param cancelPendingTasks Whether or not to cancel pending tasks. + */ +- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks; + +///------------------------- +/// @name Running Data Tasks +///------------------------- + +/** + Creates an `NSURLSessionDataTask` with the specified request. + + @param request The HTTP request for the request. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + */ +- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +/** + Creates an `NSURLSessionDataTask` with the specified request. + + @param request The HTTP request for the request. + @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param downloadProgress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + */ +- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request + uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock + downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +///--------------------------- +/// @name Running Upload Tasks +///--------------------------- + +/** + Creates an `NSURLSessionUploadTask` with the specified request for a local file. + + @param request The HTTP request for the request. + @param fileURL A URL to the local file to be uploaded. + @param progress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + + @see `attemptsToRecreateUploadTasksForBackgroundSessions` + */ +- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request + fromFile:(NSURL *)fileURL + progress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +/** + Creates an `NSURLSessionUploadTask` with the specified request for an HTTP body. + + @param request The HTTP request for the request. + @param bodyData A data object containing the HTTP body to be uploaded. + @param progress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + */ +- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request + fromData:(nullable NSData *)bodyData + progress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +/** + Creates an `NSURLSessionUploadTask` with the specified streaming request. + + @param request The HTTP request for the request. + @param progress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + */ +- (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request + progress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +///----------------------------- +/// @name Running Download Tasks +///----------------------------- + +/** + Creates an `NSURLSessionDownloadTask` with the specified request. + + @param request The HTTP request for the request. + @param progress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. + @param destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL. + @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any. + + @warning If using a background `NSURLSessionConfiguration` on iOS, these blocks will be lost when the app is terminated. Background sessions may prefer to use `-setDownloadTaskDidFinishDownloadingBlock:` to specify the URL for saving the downloaded file, rather than the destination block of this method. + */ +- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request + progress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock + destination:(nullable NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination + completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * _Nullable filePath, NSError * _Nullable error))completionHandler; + +/** + Creates an `NSURLSessionDownloadTask` with the specified resume data. + + @param resumeData The data used to resume downloading. + @param progress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. + @param destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL. + @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any. + */ +- (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData + progress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock + destination:(nullable NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination + completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * _Nullable filePath, NSError * _Nullable error))completionHandler; + +///--------------------------------- +/// @name Getting Progress for Tasks +///--------------------------------- + +/** + Returns the upload progress of the specified task. + + @param task The session task. Must not be `nil`. + + @return An `NSProgress` object reporting the upload progress of a task, or `nil` if the progress is unavailable. + */ +- (nullable NSProgress *)uploadProgressForTask:(NSURLSessionTask *)task; + +/** + Returns the download progress of the specified task. + + @param task The session task. Must not be `nil`. + + @return An `NSProgress` object reporting the download progress of a task, or `nil` if the progress is unavailable. + */ +- (nullable NSProgress *)downloadProgressForTask:(NSURLSessionTask *)task; + +///----------------------------------------- +/// @name Setting Session Delegate Callbacks +///----------------------------------------- + +/** + Sets a block to be executed when the managed session becomes invalid, as handled by the `NSURLSessionDelegate` method `URLSession:didBecomeInvalidWithError:`. + + @param block A block object to be executed when the managed session becomes invalid. The block has no return value, and takes two arguments: the session, and the error related to the cause of invalidation. + */ +- (void)setSessionDidBecomeInvalidBlock:(nullable void (^)(NSURLSession *session, NSError *error))block; + +/** + Sets a block to be executed when a connection level authentication challenge has occurred, as handled by the `NSURLSessionDelegate` method `URLSession:didReceiveChallenge:completionHandler:`. + + @param block A block object to be executed when a connection level authentication challenge has occurred. The block returns the disposition of the authentication challenge, and takes three arguments: the session, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge. + */ +- (void)setSessionDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block; + +///-------------------------------------- +/// @name Setting Task Delegate Callbacks +///-------------------------------------- + +/** + Sets a block to be executed when a task requires a new request body stream to send to the remote server, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:needNewBodyStream:`. + + @param block A block object to be executed when a task requires a new request body stream. + */ +- (void)setTaskNeedNewBodyStreamBlock:(nullable NSInputStream * (^)(NSURLSession *session, NSURLSessionTask *task))block; + +/** + Sets a block to be executed when an HTTP request is attempting to perform a redirection to a different URL, as handled by the `NSURLSessionTaskDelegate` method `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:`. + + @param block A block object to be executed when an HTTP request is attempting to perform a redirection to a different URL. The block returns the request to be made for the redirection, and takes four arguments: the session, the task, the redirection response, and the request corresponding to the redirection response. + */ +- (void)setTaskWillPerformHTTPRedirectionBlock:(nullable NSURLRequest * (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block; + +/** + Sets a block to be executed when a session task has received a request specific authentication challenge, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didReceiveChallenge:completionHandler:`. + + @param block A block object to be executed when a session task has received a request specific authentication challenge. The block returns the disposition of the authentication challenge, and takes four arguments: the session, the task, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge. + */ +- (void)setTaskDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block; + +/** + Sets a block to be executed periodically to track upload progress, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`. + + @param block A block object to be called when an undetermined number of bytes have been uploaded to the server. This block has no return value and takes five arguments: the session, the task, the number of bytes written since the last time the upload progress block was called, the total bytes written, and the total bytes expected to be written during the request, as initially determined by the length of the HTTP body. This block may be called multiple times, and will execute on the main thread. + */ +- (void)setTaskDidSendBodyDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))block; + +/** + Sets a block to be executed as the last message related to a specific task, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didCompleteWithError:`. + + @param block A block object to be executed when a session task is completed. The block has no return value, and takes three arguments: the session, the task, and any error that occurred in the process of executing the task. + */ +- (void)setTaskDidCompleteBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, NSError * _Nullable error))block; + +///------------------------------------------- +/// @name Setting Data Task Delegate Callbacks +///------------------------------------------- + +/** + Sets a block to be executed when a data task has received a response, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didReceiveResponse:completionHandler:`. + + @param block A block object to be executed when a data task has received a response. The block returns the disposition of the session response, and takes three arguments: the session, the data task, and the received response. + */ +- (void)setDataTaskDidReceiveResponseBlock:(nullable NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block; + +/** + Sets a block to be executed when a data task has become a download task, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didBecomeDownloadTask:`. + + @param block A block object to be executed when a data task has become a download task. The block has no return value, and takes three arguments: the session, the data task, and the download task it has become. + */ +- (void)setDataTaskDidBecomeDownloadTaskBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask))block; + +/** + Sets a block to be executed when a data task receives data, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didReceiveData:`. + + @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the session, the data task, and the data received. This block may be called multiple times, and will execute on the session manager operation queue. + */ +- (void)setDataTaskDidReceiveDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data))block; + +/** + Sets a block to be executed to determine the caching behavior of a data task, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:willCacheResponse:completionHandler:`. + + @param block A block object to be executed to determine the caching behavior of a data task. The block returns the response to cache, and takes three arguments: the session, the data task, and the proposed cached URL response. + */ +- (void)setDataTaskWillCacheResponseBlock:(nullable NSCachedURLResponse * (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse))block; + +/** + Sets a block to be executed once all messages enqueued for a session have been delivered, as handled by the `NSURLSessionDataDelegate` method `URLSessionDidFinishEventsForBackgroundURLSession:`. + + @param block A block object to be executed once all messages enqueued for a session have been delivered. The block has no return value and takes a single argument: the session. + */ +- (void)setDidFinishEventsForBackgroundURLSessionBlock:(nullable void (^)(NSURLSession *session))block; + +///----------------------------------------------- +/// @name Setting Download Task Delegate Callbacks +///----------------------------------------------- + +/** + Sets a block to be executed when a download task has completed a download, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didFinishDownloadingToURL:`. + + @param block A block object to be executed when a download task has completed. The block returns the URL the download should be moved to, and takes three arguments: the session, the download task, and the temporary location of the downloaded file. If the file manager encounters an error while attempting to move the temporary file to the destination, an `AFURLSessionDownloadTaskDidFailToMoveFileNotification` will be posted, with the download task as its object, and the user info of the error. + */ +- (void)setDownloadTaskDidFinishDownloadingBlock:(nullable NSURL * _Nullable (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block; + +/** + Sets a block to be executed periodically to track download progress, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:`. + + @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes five arguments: the session, the download task, the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the session manager operation queue. + */ +- (void)setDownloadTaskDidWriteDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))block; + +/** + Sets a block to be executed when a download task has been resumed, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`. + + @param block A block object to be executed when a download task has been resumed. The block has no return value and takes four arguments: the session, the download task, the file offset of the resumed download, and the total number of bytes expected to be downloaded. + */ +- (void)setDownloadTaskDidResumeBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes))block; + +@end + +///-------------------- +/// @name Notifications +///-------------------- + +/** + Posted when a task resumes. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidResumeNotification; + +/** + Posted when a task finishes executing. Includes a userInfo dictionary with additional information about the task. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteNotification; + +/** + Posted when a task suspends its execution. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidSuspendNotification; + +/** + Posted when a session is invalidated. + */ +FOUNDATION_EXPORT NSString * const AFURLSessionDidInvalidateNotification; + +/** + Posted when a session download task encountered an error when moving the temporary download file to a specified destination. + */ +FOUNDATION_EXPORT NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification; + +/** + The raw response data of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if response data exists for the task. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteResponseDataKey; + +/** + The serialized response object of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if the response was serialized. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey; + +/** + The response serializer used to serialize the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if the task has an associated response serializer. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey; + +/** + The file path associated with the download task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if an the response data has been stored directly to disk. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteAssetPathKey; + +/** + Any error associated with the task, or the serialization of the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if an error exists. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteErrorKey; + +NS_ASSUME_NONNULL_END diff --git a/Example/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m b/Example/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m new file mode 100644 index 0000000..de447ae --- /dev/null +++ b/Example/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m @@ -0,0 +1,1244 @@ +// AFURLSessionManager.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "AFURLSessionManager.h" +#import + +#ifndef NSFoundationVersionNumber_iOS_8_0 +#define NSFoundationVersionNumber_With_Fixed_5871104061079552_bug 1140.11 +#else +#define NSFoundationVersionNumber_With_Fixed_5871104061079552_bug NSFoundationVersionNumber_iOS_8_0 +#endif + +static dispatch_queue_t url_session_manager_creation_queue() { + static dispatch_queue_t af_url_session_manager_creation_queue; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + af_url_session_manager_creation_queue = dispatch_queue_create("com.alamofire.networking.session.manager.creation", DISPATCH_QUEUE_SERIAL); + }); + + return af_url_session_manager_creation_queue; +} + +static void url_session_manager_create_task_safely(dispatch_block_t block) { + if (NSFoundationVersionNumber < NSFoundationVersionNumber_With_Fixed_5871104061079552_bug) { + // Fix of bug + // Open Radar:http://openradar.appspot.com/radar?id=5871104061079552 (status: Fixed in iOS8) + // Issue about:https://github.com/AFNetworking/AFNetworking/issues/2093 + dispatch_sync(url_session_manager_creation_queue(), block); + } else { + block(); + } +} + +static dispatch_queue_t url_session_manager_processing_queue() { + static dispatch_queue_t af_url_session_manager_processing_queue; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + af_url_session_manager_processing_queue = dispatch_queue_create("com.alamofire.networking.session.manager.processing", DISPATCH_QUEUE_CONCURRENT); + }); + + return af_url_session_manager_processing_queue; +} + +static dispatch_group_t url_session_manager_completion_group() { + static dispatch_group_t af_url_session_manager_completion_group; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + af_url_session_manager_completion_group = dispatch_group_create(); + }); + + return af_url_session_manager_completion_group; +} + +NSString * const AFNetworkingTaskDidResumeNotification = @"com.alamofire.networking.task.resume"; +NSString * const AFNetworkingTaskDidCompleteNotification = @"com.alamofire.networking.task.complete"; +NSString * const AFNetworkingTaskDidSuspendNotification = @"com.alamofire.networking.task.suspend"; +NSString * const AFURLSessionDidInvalidateNotification = @"com.alamofire.networking.session.invalidate"; +NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification = @"com.alamofire.networking.session.download.file-manager-error"; + +NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey = @"com.alamofire.networking.task.complete.serializedresponse"; +NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey = @"com.alamofire.networking.task.complete.responseserializer"; +NSString * const AFNetworkingTaskDidCompleteResponseDataKey = @"com.alamofire.networking.complete.finish.responsedata"; +NSString * const AFNetworkingTaskDidCompleteErrorKey = @"com.alamofire.networking.task.complete.error"; +NSString * const AFNetworkingTaskDidCompleteAssetPathKey = @"com.alamofire.networking.task.complete.assetpath"; + +static NSString * const AFURLSessionManagerLockName = @"com.alamofire.networking.session.manager.lock"; + +static NSUInteger const AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask = 3; + +static void * AFTaskStateChangedContext = &AFTaskStateChangedContext; + +typedef void (^AFURLSessionDidBecomeInvalidBlock)(NSURLSession *session, NSError *error); +typedef NSURLSessionAuthChallengeDisposition (^AFURLSessionDidReceiveAuthenticationChallengeBlock)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential); + +typedef NSURLRequest * (^AFURLSessionTaskWillPerformHTTPRedirectionBlock)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request); +typedef NSURLSessionAuthChallengeDisposition (^AFURLSessionTaskDidReceiveAuthenticationChallengeBlock)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential); +typedef void (^AFURLSessionDidFinishEventsForBackgroundURLSessionBlock)(NSURLSession *session); + +typedef NSInputStream * (^AFURLSessionTaskNeedNewBodyStreamBlock)(NSURLSession *session, NSURLSessionTask *task); +typedef void (^AFURLSessionTaskDidSendBodyDataBlock)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend); +typedef void (^AFURLSessionTaskDidCompleteBlock)(NSURLSession *session, NSURLSessionTask *task, NSError *error); + +typedef NSURLSessionResponseDisposition (^AFURLSessionDataTaskDidReceiveResponseBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response); +typedef void (^AFURLSessionDataTaskDidBecomeDownloadTaskBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask); +typedef void (^AFURLSessionDataTaskDidReceiveDataBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data); +typedef NSCachedURLResponse * (^AFURLSessionDataTaskWillCacheResponseBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse); + +typedef NSURL * (^AFURLSessionDownloadTaskDidFinishDownloadingBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location); +typedef void (^AFURLSessionDownloadTaskDidWriteDataBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite); +typedef void (^AFURLSessionDownloadTaskDidResumeBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes); +typedef void (^AFURLSessionTaskProgressBlock)(NSProgress *); + +typedef void (^AFURLSessionTaskCompletionHandler)(NSURLResponse *response, id responseObject, NSError *error); + + +#pragma mark - + +@interface AFURLSessionManagerTaskDelegate : NSObject +@property (nonatomic, weak) AFURLSessionManager *manager; +@property (nonatomic, strong) NSMutableData *mutableData; +@property (nonatomic, strong) NSProgress *uploadProgress; +@property (nonatomic, strong) NSProgress *downloadProgress; +@property (nonatomic, copy) NSURL *downloadFileURL; +@property (nonatomic, copy) AFURLSessionDownloadTaskDidFinishDownloadingBlock downloadTaskDidFinishDownloading; +@property (nonatomic, copy) AFURLSessionTaskProgressBlock uploadProgressBlock; +@property (nonatomic, copy) AFURLSessionTaskProgressBlock downloadProgressBlock; +@property (nonatomic, copy) AFURLSessionTaskCompletionHandler completionHandler; +@end + +@implementation AFURLSessionManagerTaskDelegate + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.mutableData = [NSMutableData data]; + self.uploadProgress = [[NSProgress alloc] initWithParent:nil userInfo:nil]; + self.uploadProgress.totalUnitCount = NSURLSessionTransferSizeUnknown; + + self.downloadProgress = [[NSProgress alloc] initWithParent:nil userInfo:nil]; + self.downloadProgress.totalUnitCount = NSURLSessionTransferSizeUnknown; + return self; +} + +#pragma mark - NSProgress Tracking + +- (void)setupProgressForTask:(NSURLSessionTask *)task { + __weak __typeof__(task) weakTask = task; + + self.uploadProgress.totalUnitCount = task.countOfBytesExpectedToSend; + self.downloadProgress.totalUnitCount = task.countOfBytesExpectedToReceive; + [self.uploadProgress setCancellable:YES]; + [self.uploadProgress setCancellationHandler:^{ + __typeof__(weakTask) strongTask = weakTask; + [strongTask cancel]; + }]; + [self.uploadProgress setPausable:YES]; + [self.uploadProgress setPausingHandler:^{ + __typeof__(weakTask) strongTask = weakTask; + [strongTask suspend]; + }]; + if ([self.uploadProgress respondsToSelector:@selector(setResumingHandler:)]) { + [self.uploadProgress setResumingHandler:^{ + __typeof__(weakTask) strongTask = weakTask; + [strongTask resume]; + }]; + } + + [self.downloadProgress setCancellable:YES]; + [self.downloadProgress setCancellationHandler:^{ + __typeof__(weakTask) strongTask = weakTask; + [strongTask cancel]; + }]; + [self.downloadProgress setPausable:YES]; + [self.downloadProgress setPausingHandler:^{ + __typeof__(weakTask) strongTask = weakTask; + [strongTask suspend]; + }]; + + if ([self.downloadProgress respondsToSelector:@selector(setResumingHandler:)]) { + [self.downloadProgress setResumingHandler:^{ + __typeof__(weakTask) strongTask = weakTask; + [strongTask resume]; + }]; + } + + [task addObserver:self + forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived)) + options:NSKeyValueObservingOptionNew + context:NULL]; + [task addObserver:self + forKeyPath:NSStringFromSelector(@selector(countOfBytesExpectedToReceive)) + options:NSKeyValueObservingOptionNew + context:NULL]; + + [task addObserver:self + forKeyPath:NSStringFromSelector(@selector(countOfBytesSent)) + options:NSKeyValueObservingOptionNew + context:NULL]; + [task addObserver:self + forKeyPath:NSStringFromSelector(@selector(countOfBytesExpectedToSend)) + options:NSKeyValueObservingOptionNew + context:NULL]; + + [self.downloadProgress addObserver:self + forKeyPath:NSStringFromSelector(@selector(fractionCompleted)) + options:NSKeyValueObservingOptionNew + context:NULL]; + [self.uploadProgress addObserver:self + forKeyPath:NSStringFromSelector(@selector(fractionCompleted)) + options:NSKeyValueObservingOptionNew + context:NULL]; +} + +- (void)cleanUpProgressForTask:(NSURLSessionTask *)task { + [task removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))]; + [task removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesExpectedToReceive))]; + [task removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))]; + [task removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesExpectedToSend))]; + [self.downloadProgress removeObserver:self forKeyPath:NSStringFromSelector(@selector(fractionCompleted))]; + [self.uploadProgress removeObserver:self forKeyPath:NSStringFromSelector(@selector(fractionCompleted))]; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { + if ([object isKindOfClass:[NSURLSessionTask class]]) { + if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) { + self.downloadProgress.completedUnitCount = [change[@"new"] longLongValue]; + } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesExpectedToReceive))]) { + self.downloadProgress.totalUnitCount = [change[@"new"] longLongValue]; + } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) { + self.uploadProgress.completedUnitCount = [change[@"new"] longLongValue]; + } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesExpectedToSend))]) { + self.uploadProgress.totalUnitCount = [change[@"new"] longLongValue]; + } + } + else if ([object isEqual:self.downloadProgress]) { + if (self.downloadProgressBlock) { + self.downloadProgressBlock(object); + } + } + else if ([object isEqual:self.uploadProgress]) { + if (self.uploadProgressBlock) { + self.uploadProgressBlock(object); + } + } +} + +#pragma mark - NSURLSessionTaskDelegate + +- (void)URLSession:(__unused NSURLSession *)session + task:(NSURLSessionTask *)task +didCompleteWithError:(NSError *)error +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + __strong AFURLSessionManager *manager = self.manager; + + __block id responseObject = nil; + + __block NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; + userInfo[AFNetworkingTaskDidCompleteResponseSerializerKey] = manager.responseSerializer; + + //Performance Improvement from #2672 + NSData *data = nil; + if (self.mutableData) { + data = [self.mutableData copy]; + //We no longer need the reference, so nil it out to gain back some memory. + self.mutableData = nil; + } + + if (self.downloadFileURL) { + userInfo[AFNetworkingTaskDidCompleteAssetPathKey] = self.downloadFileURL; + } else if (data) { + userInfo[AFNetworkingTaskDidCompleteResponseDataKey] = data; + } + + if (error) { + userInfo[AFNetworkingTaskDidCompleteErrorKey] = error; + + dispatch_group_async(manager.completionGroup ?: url_session_manager_completion_group(), manager.completionQueue ?: dispatch_get_main_queue(), ^{ + if (self.completionHandler) { + self.completionHandler(task.response, responseObject, error); + } + + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidCompleteNotification object:task userInfo:userInfo]; + }); + }); + } else { + dispatch_async(url_session_manager_processing_queue(), ^{ + NSError *serializationError = nil; + responseObject = [manager.responseSerializer responseObjectForResponse:task.response data:data error:&serializationError]; + + if (self.downloadFileURL) { + responseObject = self.downloadFileURL; + } + + if (responseObject) { + userInfo[AFNetworkingTaskDidCompleteSerializedResponseKey] = responseObject; + } + + if (serializationError) { + userInfo[AFNetworkingTaskDidCompleteErrorKey] = serializationError; + } + + dispatch_group_async(manager.completionGroup ?: url_session_manager_completion_group(), manager.completionQueue ?: dispatch_get_main_queue(), ^{ + if (self.completionHandler) { + self.completionHandler(task.response, responseObject, serializationError); + } + + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidCompleteNotification object:task userInfo:userInfo]; + }); + }); + }); + } +#pragma clang diagnostic pop +} + +#pragma mark - NSURLSessionDataTaskDelegate + +- (void)URLSession:(__unused NSURLSession *)session + dataTask:(__unused NSURLSessionDataTask *)dataTask + didReceiveData:(NSData *)data +{ + [self.mutableData appendData:data]; +} + +#pragma mark - NSURLSessionDownloadTaskDelegate + +- (void)URLSession:(NSURLSession *)session + downloadTask:(NSURLSessionDownloadTask *)downloadTask +didFinishDownloadingToURL:(NSURL *)location +{ + NSError *fileManagerError = nil; + self.downloadFileURL = nil; + + if (self.downloadTaskDidFinishDownloading) { + self.downloadFileURL = self.downloadTaskDidFinishDownloading(session, downloadTask, location); + if (self.downloadFileURL) { + [[NSFileManager defaultManager] moveItemAtURL:location toURL:self.downloadFileURL error:&fileManagerError]; + + if (fileManagerError) { + [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:fileManagerError.userInfo]; + } + } + } +} + +@end + +#pragma mark - + +/** + * A workaround for issues related to key-value observing the `state` of an `NSURLSessionTask`. + * + * See: + * - https://github.com/AFNetworking/AFNetworking/issues/1477 + * - https://github.com/AFNetworking/AFNetworking/issues/2638 + * - https://github.com/AFNetworking/AFNetworking/pull/2702 + */ + +static inline void af_swizzleSelector(Class theClass, SEL originalSelector, SEL swizzledSelector) { + Method originalMethod = class_getInstanceMethod(theClass, originalSelector); + Method swizzledMethod = class_getInstanceMethod(theClass, swizzledSelector); + method_exchangeImplementations(originalMethod, swizzledMethod); +} + +static inline BOOL af_addMethod(Class theClass, SEL selector, Method method) { + return class_addMethod(theClass, selector, method_getImplementation(method), method_getTypeEncoding(method)); +} + +static NSString * const AFNSURLSessionTaskDidResumeNotification = @"com.alamofire.networking.nsurlsessiontask.resume"; +static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofire.networking.nsurlsessiontask.suspend"; + +@interface _AFURLSessionTaskSwizzling : NSObject + +@end + +@implementation _AFURLSessionTaskSwizzling + ++ (void)load { + /** + WARNING: Trouble Ahead + https://github.com/AFNetworking/AFNetworking/pull/2702 + */ + + if (NSClassFromString(@"NSURLSessionTask")) { + /** + iOS 7 and iOS 8 differ in NSURLSessionTask implementation, which makes the next bit of code a bit tricky. + Many Unit Tests have been built to validate as much of this behavior has possible. + Here is what we know: + - NSURLSessionTasks are implemented with class clusters, meaning the class you request from the API isn't actually the type of class you will get back. + - Simply referencing `[NSURLSessionTask class]` will not work. You need to ask an `NSURLSession` to actually create an object, and grab the class from there. + - On iOS 7, `localDataTask` is a `__NSCFLocalDataTask`, which inherits from `__NSCFLocalSessionTask`, which inherits from `__NSCFURLSessionTask`. + - On iOS 8, `localDataTask` is a `__NSCFLocalDataTask`, which inherits from `__NSCFLocalSessionTask`, which inherits from `NSURLSessionTask`. + - On iOS 7, `__NSCFLocalSessionTask` and `__NSCFURLSessionTask` are the only two classes that have their own implementations of `resume` and `suspend`, and `__NSCFLocalSessionTask` DOES NOT CALL SUPER. This means both classes need to be swizzled. + - On iOS 8, `NSURLSessionTask` is the only class that implements `resume` and `suspend`. This means this is the only class that needs to be swizzled. + - Because `NSURLSessionTask` is not involved in the class hierarchy for every version of iOS, its easier to add the swizzled methods to a dummy class and manage them there. + + Some Assumptions: + - No implementations of `resume` or `suspend` call super. If this were to change in a future version of iOS, we'd need to handle it. + - No background task classes override `resume` or `suspend` + + The current solution: + 1) Grab an instance of `__NSCFLocalDataTask` by asking an instance of `NSURLSession` for a data task. + 2) Grab a pointer to the original implementation of `af_resume` + 3) Check to see if the current class has an implementation of resume. If so, continue to step 4. + 4) Grab the super class of the current class. + 5) Grab a pointer for the current class to the current implementation of `resume`. + 6) Grab a pointer for the super class to the current implementation of `resume`. + 7) If the current class implementation of `resume` is not equal to the super class implementation of `resume` AND the current implementation of `resume` is not equal to the original implementation of `af_resume`, THEN swizzle the methods + 8) Set the current class to the super class, and repeat steps 3-8 + */ + NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration ephemeralSessionConfiguration]; + NSURLSession * session = [NSURLSession sessionWithConfiguration:configuration]; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wnonnull" + NSURLSessionDataTask *localDataTask = [session dataTaskWithURL:nil]; +#pragma clang diagnostic pop + IMP originalAFResumeIMP = method_getImplementation(class_getInstanceMethod([self class], @selector(af_resume))); + Class currentClass = [localDataTask class]; + + while (class_getInstanceMethod(currentClass, @selector(resume))) { + Class superClass = [currentClass superclass]; + IMP classResumeIMP = method_getImplementation(class_getInstanceMethod(currentClass, @selector(resume))); + IMP superclassResumeIMP = method_getImplementation(class_getInstanceMethod(superClass, @selector(resume))); + if (classResumeIMP != superclassResumeIMP && + originalAFResumeIMP != classResumeIMP) { + [self swizzleResumeAndSuspendMethodForClass:currentClass]; + } + currentClass = [currentClass superclass]; + } + + [localDataTask cancel]; + [session finishTasksAndInvalidate]; + } +} + ++ (void)swizzleResumeAndSuspendMethodForClass:(Class)theClass { + Method afResumeMethod = class_getInstanceMethod(self, @selector(af_resume)); + Method afSuspendMethod = class_getInstanceMethod(self, @selector(af_suspend)); + + if (af_addMethod(theClass, @selector(af_resume), afResumeMethod)) { + af_swizzleSelector(theClass, @selector(resume), @selector(af_resume)); + } + + if (af_addMethod(theClass, @selector(af_suspend), afSuspendMethod)) { + af_swizzleSelector(theClass, @selector(suspend), @selector(af_suspend)); + } +} + +- (NSURLSessionTaskState)state { + NSAssert(NO, @"State method should never be called in the actual dummy class"); + return NSURLSessionTaskStateCanceling; +} + +- (void)af_resume { + NSAssert([self respondsToSelector:@selector(state)], @"Does not respond to state"); + NSURLSessionTaskState state = [self state]; + [self af_resume]; + + if (state != NSURLSessionTaskStateRunning) { + [[NSNotificationCenter defaultCenter] postNotificationName:AFNSURLSessionTaskDidResumeNotification object:self]; + } +} + +- (void)af_suspend { + NSAssert([self respondsToSelector:@selector(state)], @"Does not respond to state"); + NSURLSessionTaskState state = [self state]; + [self af_suspend]; + + if (state != NSURLSessionTaskStateSuspended) { + [[NSNotificationCenter defaultCenter] postNotificationName:AFNSURLSessionTaskDidSuspendNotification object:self]; + } +} +@end + +#pragma mark - + +@interface AFURLSessionManager () +@property (readwrite, nonatomic, strong) NSURLSessionConfiguration *sessionConfiguration; +@property (readwrite, nonatomic, strong) NSOperationQueue *operationQueue; +@property (readwrite, nonatomic, strong) NSURLSession *session; +@property (readwrite, nonatomic, strong) NSMutableDictionary *mutableTaskDelegatesKeyedByTaskIdentifier; +@property (readonly, nonatomic, copy) NSString *taskDescriptionForSessionTasks; +@property (readwrite, nonatomic, strong) NSLock *lock; +@property (readwrite, nonatomic, copy) AFURLSessionDidBecomeInvalidBlock sessionDidBecomeInvalid; +@property (readwrite, nonatomic, copy) AFURLSessionDidReceiveAuthenticationChallengeBlock sessionDidReceiveAuthenticationChallenge; +@property (readwrite, nonatomic, copy) AFURLSessionDidFinishEventsForBackgroundURLSessionBlock didFinishEventsForBackgroundURLSession; +@property (readwrite, nonatomic, copy) AFURLSessionTaskWillPerformHTTPRedirectionBlock taskWillPerformHTTPRedirection; +@property (readwrite, nonatomic, copy) AFURLSessionTaskDidReceiveAuthenticationChallengeBlock taskDidReceiveAuthenticationChallenge; +@property (readwrite, nonatomic, copy) AFURLSessionTaskNeedNewBodyStreamBlock taskNeedNewBodyStream; +@property (readwrite, nonatomic, copy) AFURLSessionTaskDidSendBodyDataBlock taskDidSendBodyData; +@property (readwrite, nonatomic, copy) AFURLSessionTaskDidCompleteBlock taskDidComplete; +@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidReceiveResponseBlock dataTaskDidReceiveResponse; +@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidBecomeDownloadTaskBlock dataTaskDidBecomeDownloadTask; +@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidReceiveDataBlock dataTaskDidReceiveData; +@property (readwrite, nonatomic, copy) AFURLSessionDataTaskWillCacheResponseBlock dataTaskWillCacheResponse; +@property (readwrite, nonatomic, copy) AFURLSessionDownloadTaskDidFinishDownloadingBlock downloadTaskDidFinishDownloading; +@property (readwrite, nonatomic, copy) AFURLSessionDownloadTaskDidWriteDataBlock downloadTaskDidWriteData; +@property (readwrite, nonatomic, copy) AFURLSessionDownloadTaskDidResumeBlock downloadTaskDidResume; +@end + +@implementation AFURLSessionManager + +- (instancetype)init { + return [self initWithSessionConfiguration:nil]; +} + +- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration { + self = [super init]; + if (!self) { + return nil; + } + + if (!configuration) { + configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; + } + + self.sessionConfiguration = configuration; + + self.operationQueue = [[NSOperationQueue alloc] init]; + self.operationQueue.maxConcurrentOperationCount = 1; + + self.session = [NSURLSession sessionWithConfiguration:self.sessionConfiguration delegate:self delegateQueue:self.operationQueue]; + + self.responseSerializer = [AFJSONResponseSerializer serializer]; + + self.securityPolicy = [AFSecurityPolicy defaultPolicy]; + +#if !TARGET_OS_WATCH + self.reachabilityManager = [AFNetworkReachabilityManager sharedManager]; +#endif + + self.mutableTaskDelegatesKeyedByTaskIdentifier = [[NSMutableDictionary alloc] init]; + + self.lock = [[NSLock alloc] init]; + self.lock.name = AFURLSessionManagerLockName; + + [self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) { + for (NSURLSessionDataTask *task in dataTasks) { + [self addDelegateForDataTask:task uploadProgress:nil downloadProgress:nil completionHandler:nil]; + } + + for (NSURLSessionUploadTask *uploadTask in uploadTasks) { + [self addDelegateForUploadTask:uploadTask progress:nil completionHandler:nil]; + } + + for (NSURLSessionDownloadTask *downloadTask in downloadTasks) { + [self addDelegateForDownloadTask:downloadTask progress:nil destination:nil completionHandler:nil]; + } + }]; + + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +#pragma mark - + +- (NSString *)taskDescriptionForSessionTasks { + return [NSString stringWithFormat:@"%p", self]; +} + +- (void)taskDidResume:(NSNotification *)notification { + NSURLSessionTask *task = notification.object; + if ([task respondsToSelector:@selector(taskDescription)]) { + if ([task.taskDescription isEqualToString:self.taskDescriptionForSessionTasks]) { + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidResumeNotification object:task]; + }); + } + } +} + +- (void)taskDidSuspend:(NSNotification *)notification { + NSURLSessionTask *task = notification.object; + if ([task respondsToSelector:@selector(taskDescription)]) { + if ([task.taskDescription isEqualToString:self.taskDescriptionForSessionTasks]) { + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidSuspendNotification object:task]; + }); + } + } +} + +#pragma mark - + +- (AFURLSessionManagerTaskDelegate *)delegateForTask:(NSURLSessionTask *)task { + NSParameterAssert(task); + + AFURLSessionManagerTaskDelegate *delegate = nil; + [self.lock lock]; + delegate = self.mutableTaskDelegatesKeyedByTaskIdentifier[@(task.taskIdentifier)]; + [self.lock unlock]; + + return delegate; +} + +- (void)setDelegate:(AFURLSessionManagerTaskDelegate *)delegate + forTask:(NSURLSessionTask *)task +{ + NSParameterAssert(task); + NSParameterAssert(delegate); + + [self.lock lock]; + self.mutableTaskDelegatesKeyedByTaskIdentifier[@(task.taskIdentifier)] = delegate; + [delegate setupProgressForTask:task]; + [self addNotificationObserverForTask:task]; + [self.lock unlock]; +} + +- (void)addDelegateForDataTask:(NSURLSessionDataTask *)dataTask + uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock + downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init]; + delegate.manager = self; + delegate.completionHandler = completionHandler; + + dataTask.taskDescription = self.taskDescriptionForSessionTasks; + [self setDelegate:delegate forTask:dataTask]; + + delegate.uploadProgressBlock = uploadProgressBlock; + delegate.downloadProgressBlock = downloadProgressBlock; +} + +- (void)addDelegateForUploadTask:(NSURLSessionUploadTask *)uploadTask + progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init]; + delegate.manager = self; + delegate.completionHandler = completionHandler; + + uploadTask.taskDescription = self.taskDescriptionForSessionTasks; + + [self setDelegate:delegate forTask:uploadTask]; + + delegate.uploadProgressBlock = uploadProgressBlock; +} + +- (void)addDelegateForDownloadTask:(NSURLSessionDownloadTask *)downloadTask + progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock + destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination + completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler +{ + AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init]; + delegate.manager = self; + delegate.completionHandler = completionHandler; + + if (destination) { + delegate.downloadTaskDidFinishDownloading = ^NSURL * (NSURLSession * __unused session, NSURLSessionDownloadTask *task, NSURL *location) { + return destination(location, task.response); + }; + } + + downloadTask.taskDescription = self.taskDescriptionForSessionTasks; + + [self setDelegate:delegate forTask:downloadTask]; + + delegate.downloadProgressBlock = downloadProgressBlock; +} + +- (void)removeDelegateForTask:(NSURLSessionTask *)task { + NSParameterAssert(task); + + AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task]; + [self.lock lock]; + [delegate cleanUpProgressForTask:task]; + [self removeNotificationObserverForTask:task]; + [self.mutableTaskDelegatesKeyedByTaskIdentifier removeObjectForKey:@(task.taskIdentifier)]; + [self.lock unlock]; +} + +#pragma mark - + +- (NSArray *)tasksForKeyPath:(NSString *)keyPath { + __block NSArray *tasks = nil; + dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); + [self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) { + if ([keyPath isEqualToString:NSStringFromSelector(@selector(dataTasks))]) { + tasks = dataTasks; + } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(uploadTasks))]) { + tasks = uploadTasks; + } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(downloadTasks))]) { + tasks = downloadTasks; + } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(tasks))]) { + tasks = [@[dataTasks, uploadTasks, downloadTasks] valueForKeyPath:@"@unionOfArrays.self"]; + } + + dispatch_semaphore_signal(semaphore); + }]; + + dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); + + return tasks; +} + +- (NSArray *)tasks { + return [self tasksForKeyPath:NSStringFromSelector(_cmd)]; +} + +- (NSArray *)dataTasks { + return [self tasksForKeyPath:NSStringFromSelector(_cmd)]; +} + +- (NSArray *)uploadTasks { + return [self tasksForKeyPath:NSStringFromSelector(_cmd)]; +} + +- (NSArray *)downloadTasks { + return [self tasksForKeyPath:NSStringFromSelector(_cmd)]; +} + +#pragma mark - + +- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks { + dispatch_async(dispatch_get_main_queue(), ^{ + if (cancelPendingTasks) { + [self.session invalidateAndCancel]; + } else { + [self.session finishTasksAndInvalidate]; + } + }); +} + +#pragma mark - + +- (void)setResponseSerializer:(id )responseSerializer { + NSParameterAssert(responseSerializer); + + _responseSerializer = responseSerializer; +} + +#pragma mark - +- (void)addNotificationObserverForTask:(NSURLSessionTask *)task { + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidResume:) name:AFNSURLSessionTaskDidResumeNotification object:task]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidSuspend:) name:AFNSURLSessionTaskDidSuspendNotification object:task]; +} + +- (void)removeNotificationObserverForTask:(NSURLSessionTask *)task { + [[NSNotificationCenter defaultCenter] removeObserver:self name:AFNSURLSessionTaskDidSuspendNotification object:task]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:AFNSURLSessionTaskDidResumeNotification object:task]; +} + +#pragma mark - + +- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + return [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:completionHandler]; +} + +- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request + uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock + downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler { + + __block NSURLSessionDataTask *dataTask = nil; + url_session_manager_create_task_safely(^{ + dataTask = [self.session dataTaskWithRequest:request]; + }); + + [self addDelegateForDataTask:dataTask uploadProgress:uploadProgressBlock downloadProgress:downloadProgressBlock completionHandler:completionHandler]; + + return dataTask; +} + +#pragma mark - + +- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request + fromFile:(NSURL *)fileURL + progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + __block NSURLSessionUploadTask *uploadTask = nil; + url_session_manager_create_task_safely(^{ + uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL]; + }); + + if (!uploadTask && self.attemptsToRecreateUploadTasksForBackgroundSessions && self.session.configuration.identifier) { + for (NSUInteger attempts = 0; !uploadTask && attempts < AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask; attempts++) { + uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL]; + } + } + + [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; + + return uploadTask; +} + +- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request + fromData:(NSData *)bodyData + progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + __block NSURLSessionUploadTask *uploadTask = nil; + url_session_manager_create_task_safely(^{ + uploadTask = [self.session uploadTaskWithRequest:request fromData:bodyData]; + }); + + [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; + + return uploadTask; +} + +- (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request + progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + __block NSURLSessionUploadTask *uploadTask = nil; + url_session_manager_create_task_safely(^{ + uploadTask = [self.session uploadTaskWithStreamedRequest:request]; + }); + + [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; + + return uploadTask; +} + +#pragma mark - + +- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request + progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock + destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination + completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler +{ + __block NSURLSessionDownloadTask *downloadTask = nil; + url_session_manager_create_task_safely(^{ + downloadTask = [self.session downloadTaskWithRequest:request]; + }); + + [self addDelegateForDownloadTask:downloadTask progress:downloadProgressBlock destination:destination completionHandler:completionHandler]; + + return downloadTask; +} + +- (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData + progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock + destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination + completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler +{ + __block NSURLSessionDownloadTask *downloadTask = nil; + url_session_manager_create_task_safely(^{ + downloadTask = [self.session downloadTaskWithResumeData:resumeData]; + }); + + [self addDelegateForDownloadTask:downloadTask progress:downloadProgressBlock destination:destination completionHandler:completionHandler]; + + return downloadTask; +} + +#pragma mark - +- (NSProgress *)uploadProgressForTask:(NSURLSessionTask *)task { + return [[self delegateForTask:task] uploadProgress]; +} + +- (NSProgress *)downloadProgressForTask:(NSURLSessionTask *)task { + return [[self delegateForTask:task] downloadProgress]; +} + +#pragma mark - + +- (void)setSessionDidBecomeInvalidBlock:(void (^)(NSURLSession *session, NSError *error))block { + self.sessionDidBecomeInvalid = block; +} + +- (void)setSessionDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential))block { + self.sessionDidReceiveAuthenticationChallenge = block; +} + +- (void)setDidFinishEventsForBackgroundURLSessionBlock:(void (^)(NSURLSession *session))block { + self.didFinishEventsForBackgroundURLSession = block; +} + +#pragma mark - + +- (void)setTaskNeedNewBodyStreamBlock:(NSInputStream * (^)(NSURLSession *session, NSURLSessionTask *task))block { + self.taskNeedNewBodyStream = block; +} + +- (void)setTaskWillPerformHTTPRedirectionBlock:(NSURLRequest * (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block { + self.taskWillPerformHTTPRedirection = block; +} + +- (void)setTaskDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential))block { + self.taskDidReceiveAuthenticationChallenge = block; +} + +- (void)setTaskDidSendBodyDataBlock:(void (^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))block { + self.taskDidSendBodyData = block; +} + +- (void)setTaskDidCompleteBlock:(void (^)(NSURLSession *session, NSURLSessionTask *task, NSError *error))block { + self.taskDidComplete = block; +} + +#pragma mark - + +- (void)setDataTaskDidReceiveResponseBlock:(NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block { + self.dataTaskDidReceiveResponse = block; +} + +- (void)setDataTaskDidBecomeDownloadTaskBlock:(void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask))block { + self.dataTaskDidBecomeDownloadTask = block; +} + +- (void)setDataTaskDidReceiveDataBlock:(void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data))block { + self.dataTaskDidReceiveData = block; +} + +- (void)setDataTaskWillCacheResponseBlock:(NSCachedURLResponse * (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse))block { + self.dataTaskWillCacheResponse = block; +} + +#pragma mark - + +- (void)setDownloadTaskDidFinishDownloadingBlock:(NSURL * (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block { + self.downloadTaskDidFinishDownloading = block; +} + +- (void)setDownloadTaskDidWriteDataBlock:(void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))block { + self.downloadTaskDidWriteData = block; +} + +- (void)setDownloadTaskDidResumeBlock:(void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes))block { + self.downloadTaskDidResume = block; +} + +#pragma mark - NSObject + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@: %p, session: %@, operationQueue: %@>", NSStringFromClass([self class]), self, self.session, self.operationQueue]; +} + +- (BOOL)respondsToSelector:(SEL)selector { + if (selector == @selector(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:)) { + return self.taskWillPerformHTTPRedirection != nil; + } else if (selector == @selector(URLSession:dataTask:didReceiveResponse:completionHandler:)) { + return self.dataTaskDidReceiveResponse != nil; + } else if (selector == @selector(URLSession:dataTask:willCacheResponse:completionHandler:)) { + return self.dataTaskWillCacheResponse != nil; + } else if (selector == @selector(URLSessionDidFinishEventsForBackgroundURLSession:)) { + return self.didFinishEventsForBackgroundURLSession != nil; + } + + return [[self class] instancesRespondToSelector:selector]; +} + +#pragma mark - NSURLSessionDelegate + +- (void)URLSession:(NSURLSession *)session +didBecomeInvalidWithError:(NSError *)error +{ + if (self.sessionDidBecomeInvalid) { + self.sessionDidBecomeInvalid(session, error); + } + + [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDidInvalidateNotification object:session]; +} + +- (void)URLSession:(NSURLSession *)session +didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge + completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler +{ + NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling; + __block NSURLCredential *credential = nil; + + if (self.sessionDidReceiveAuthenticationChallenge) { + disposition = self.sessionDidReceiveAuthenticationChallenge(session, challenge, &credential); + } else { + if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { + if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:challenge.protectionSpace.host]) { + credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; + if (credential) { + disposition = NSURLSessionAuthChallengeUseCredential; + } else { + disposition = NSURLSessionAuthChallengePerformDefaultHandling; + } + } else { + disposition = NSURLSessionAuthChallengeRejectProtectionSpace; + } + } else { + disposition = NSURLSessionAuthChallengePerformDefaultHandling; + } + } + + if (completionHandler) { + completionHandler(disposition, credential); + } +} + +#pragma mark - NSURLSessionTaskDelegate + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task +willPerformHTTPRedirection:(NSHTTPURLResponse *)response + newRequest:(NSURLRequest *)request + completionHandler:(void (^)(NSURLRequest *))completionHandler +{ + NSURLRequest *redirectRequest = request; + + if (self.taskWillPerformHTTPRedirection) { + redirectRequest = self.taskWillPerformHTTPRedirection(session, task, response, request); + } + + if (completionHandler) { + completionHandler(redirectRequest); + } +} + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task +didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge + completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler +{ + NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling; + __block NSURLCredential *credential = nil; + + if (self.taskDidReceiveAuthenticationChallenge) { + disposition = self.taskDidReceiveAuthenticationChallenge(session, task, challenge, &credential); + } else { + if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { + if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:challenge.protectionSpace.host]) { + disposition = NSURLSessionAuthChallengeUseCredential; + credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; + } else { + disposition = NSURLSessionAuthChallengeRejectProtectionSpace; + } + } else { + disposition = NSURLSessionAuthChallengePerformDefaultHandling; + } + } + + if (completionHandler) { + completionHandler(disposition, credential); + } +} + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task + needNewBodyStream:(void (^)(NSInputStream *bodyStream))completionHandler +{ + NSInputStream *inputStream = nil; + + if (self.taskNeedNewBodyStream) { + inputStream = self.taskNeedNewBodyStream(session, task); + } else if (task.originalRequest.HTTPBodyStream && [task.originalRequest.HTTPBodyStream conformsToProtocol:@protocol(NSCopying)]) { + inputStream = [task.originalRequest.HTTPBodyStream copy]; + } + + if (completionHandler) { + completionHandler(inputStream); + } +} + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task + didSendBodyData:(int64_t)bytesSent + totalBytesSent:(int64_t)totalBytesSent +totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend +{ + + int64_t totalUnitCount = totalBytesExpectedToSend; + if(totalUnitCount == NSURLSessionTransferSizeUnknown) { + NSString *contentLength = [task.originalRequest valueForHTTPHeaderField:@"Content-Length"]; + if(contentLength) { + totalUnitCount = (int64_t) [contentLength longLongValue]; + } + } + + if (self.taskDidSendBodyData) { + self.taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalUnitCount); + } +} + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task +didCompleteWithError:(NSError *)error +{ + AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task]; + + // delegate may be nil when completing a task in the background + if (delegate) { + [delegate URLSession:session task:task didCompleteWithError:error]; + + [self removeDelegateForTask:task]; + } + + if (self.taskDidComplete) { + self.taskDidComplete(session, task, error); + } +} + +#pragma mark - NSURLSessionDataDelegate + +- (void)URLSession:(NSURLSession *)session + dataTask:(NSURLSessionDataTask *)dataTask +didReceiveResponse:(NSURLResponse *)response + completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler +{ + NSURLSessionResponseDisposition disposition = NSURLSessionResponseAllow; + + if (self.dataTaskDidReceiveResponse) { + disposition = self.dataTaskDidReceiveResponse(session, dataTask, response); + } + + if (completionHandler) { + completionHandler(disposition); + } +} + +- (void)URLSession:(NSURLSession *)session + dataTask:(NSURLSessionDataTask *)dataTask +didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask +{ + AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:dataTask]; + if (delegate) { + [self removeDelegateForTask:dataTask]; + [self setDelegate:delegate forTask:downloadTask]; + } + + if (self.dataTaskDidBecomeDownloadTask) { + self.dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask); + } +} + +- (void)URLSession:(NSURLSession *)session + dataTask:(NSURLSessionDataTask *)dataTask + didReceiveData:(NSData *)data +{ + + AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:dataTask]; + [delegate URLSession:session dataTask:dataTask didReceiveData:data]; + + if (self.dataTaskDidReceiveData) { + self.dataTaskDidReceiveData(session, dataTask, data); + } +} + +- (void)URLSession:(NSURLSession *)session + dataTask:(NSURLSessionDataTask *)dataTask + willCacheResponse:(NSCachedURLResponse *)proposedResponse + completionHandler:(void (^)(NSCachedURLResponse *cachedResponse))completionHandler +{ + NSCachedURLResponse *cachedResponse = proposedResponse; + + if (self.dataTaskWillCacheResponse) { + cachedResponse = self.dataTaskWillCacheResponse(session, dataTask, proposedResponse); + } + + if (completionHandler) { + completionHandler(cachedResponse); + } +} + +- (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession *)session { + if (self.didFinishEventsForBackgroundURLSession) { + dispatch_async(dispatch_get_main_queue(), ^{ + self.didFinishEventsForBackgroundURLSession(session); + }); + } +} + +#pragma mark - NSURLSessionDownloadDelegate + +- (void)URLSession:(NSURLSession *)session + downloadTask:(NSURLSessionDownloadTask *)downloadTask +didFinishDownloadingToURL:(NSURL *)location +{ + AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:downloadTask]; + if (self.downloadTaskDidFinishDownloading) { + NSURL *fileURL = self.downloadTaskDidFinishDownloading(session, downloadTask, location); + if (fileURL) { + delegate.downloadFileURL = fileURL; + NSError *error = nil; + [[NSFileManager defaultManager] moveItemAtURL:location toURL:fileURL error:&error]; + if (error) { + [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:error.userInfo]; + } + + return; + } + } + + if (delegate) { + [delegate URLSession:session downloadTask:downloadTask didFinishDownloadingToURL:location]; + } +} + +- (void)URLSession:(NSURLSession *)session + downloadTask:(NSURLSessionDownloadTask *)downloadTask + didWriteData:(int64_t)bytesWritten + totalBytesWritten:(int64_t)totalBytesWritten +totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite +{ + if (self.downloadTaskDidWriteData) { + self.downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite); + } +} + +- (void)URLSession:(NSURLSession *)session + downloadTask:(NSURLSessionDownloadTask *)downloadTask + didResumeAtOffset:(int64_t)fileOffset +expectedTotalBytes:(int64_t)expectedTotalBytes +{ + if (self.downloadTaskDidResume) { + self.downloadTaskDidResume(session, downloadTask, fileOffset, expectedTotalBytes); + } +} + +#pragma mark - NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)initWithCoder:(NSCoder *)decoder { + NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"]; + + self = [self initWithSessionConfiguration:configuration]; + if (!self) { + return nil; + } + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [coder encodeObject:self.session.configuration forKey:@"sessionConfiguration"]; +} + +#pragma mark - NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[[self class] allocWithZone:zone] initWithSessionConfiguration:self.session.configuration]; +} + +@end diff --git a/Example/Pods/AFNetworking/LICENSE b/Example/Pods/AFNetworking/LICENSE new file mode 100644 index 0000000..91f125b --- /dev/null +++ b/Example/Pods/AFNetworking/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) + +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. diff --git a/Example/Pods/AFNetworking/README.md b/Example/Pods/AFNetworking/README.md new file mode 100644 index 0000000..f784681 --- /dev/null +++ b/Example/Pods/AFNetworking/README.md @@ -0,0 +1,320 @@ +

+ AFNetworking +

+ +[![Build Status](https://travis-ci.org/AFNetworking/AFNetworking.svg)](https://travis-ci.org/AFNetworking/AFNetworking) +[![codecov.io](https://codecov.io/github/AFNetworking/AFNetworking/coverage.svg?branch=master)](https://codecov.io/github/AFNetworking/AFNetworking?branch=master) +[![Cocoapods Compatible](https://img.shields.io/cocoapods/v/AFNetworking.svg)](https://img.shields.io/cocoapods/v/AFNetworking.svg) +[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![Platform](https://img.shields.io/cocoapods/p/AFNetworking.svg?style=flat)](http://cocoadocs.org/docsets/AFNetworking) +[![Twitter](https://img.shields.io/badge/twitter-@AFNetworking-blue.svg?style=flat)](http://twitter.com/AFNetworking) + +AFNetworking is a delightful networking library for iOS and Mac OS X. It's built on top of the [Foundation URL Loading System](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html), extending the powerful high-level networking abstractions built into Cocoa. It has a modular architecture with well-designed, feature-rich APIs that are a joy to use. + +Perhaps the most important feature of all, however, is the amazing community of developers who use and contribute to AFNetworking every day. AFNetworking powers some of the most popular and critically-acclaimed apps on the iPhone, iPad, and Mac. + +Choose AFNetworking for your next project, or migrate over your existing projects—you'll be happy you did! + +## How To Get Started + +- [Download AFNetworking](https://github.com/AFNetworking/AFNetworking/archive/master.zip) and try out the included Mac and iPhone example apps +- Read the ["Getting Started" guide](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking), [FAQ](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-FAQ), or [other articles on the Wiki](https://github.com/AFNetworking/AFNetworking/wiki) +- Check out the [documentation](http://cocoadocs.org/docsets/AFNetworking/) for a comprehensive look at all of the APIs available in AFNetworking +- Read the [AFNetworking 3.0 Migration Guide](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-3.0-Migration-Guide) for an overview of the architectural changes from 2.0. + +## Communication + +- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/afnetworking). (Tag 'afnetworking') +- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/afnetworking). +- If you **found a bug**, _and can provide steps to reliably reproduce it_, open an issue. +- If you **have a feature request**, open an issue. +- If you **want to contribute**, submit a pull request. + +## Installation +AFNetworking supports multiple methods for installing the library in a project. + +## Installation with CocoaPods + +[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects. See the ["Getting Started" guide for more information](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking). You can install it with the following command: + +```bash +$ gem install cocoapods +``` + +> CocoaPods 0.39.0+ is required to build AFNetworking 3.0.0+. + +#### Podfile + +To integrate AFNetworking into your Xcode project using CocoaPods, specify it in your `Podfile`: + +```ruby +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '8.0' + +pod 'AFNetworking', '~> 3.0' +``` + +Then, run the following command: + +```bash +$ pod install +``` + +### Installation with Carthage + +[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. + +You can install Carthage with [Homebrew](http://brew.sh/) using the following command: + +```bash +$ brew update +$ brew install carthage +``` + +To integrate AFNetworking into your Xcode project using Carthage, specify it in your `Cartfile`: + +```ogdl +github "AFNetworking/AFNetworking" ~> 3.0 +``` + +Run `carthage` to build the framework and drag the built `AFNetworking.framework` into your Xcode project. + +## Requirements + +| AFNetworking Version | Minimum iOS Target | Minimum OS X Target | Minimum watchOS Target | Minimum tvOS Target | Notes | +|:--------------------:|:---------------------------:|:----------------------------:|:----------------------------:|:----------------------------:|:-------------------------------------------------------------------------:| +| 3.x | iOS 7 | OS X 10.9 | watchOS 2.0 | tvOS 9.0 | Xcode 7+ is required. `NSURLConnectionOperation` support has been removed. | +| 2.6 -> 2.6.3 | iOS 7 | OS X 10.9 | watchOS 2.0 | n/a | Xcode 7+ is required. | +| 2.0 -> 2.5.4 | iOS 6 | OS X 10.8 | n/a | n/a | Xcode 5+ is required. `NSURLSession` subspec requires iOS 7 or OS X 10.9. | +| 1.x | iOS 5 | Mac OS X 10.7 | n/a | n/a | +| 0.10.x | iOS 4 | Mac OS X 10.6 | n/a | n/a | + +(OS X projects must support [64-bit with modern Cocoa runtime](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtVersionsPlatforms.html)). + +> Programming in Swift? Try [Alamofire](https://github.com/Alamofire/Alamofire) for a more conventional set of APIs. + +## Architecture + +### NSURLSession + +- `AFURLSessionManager` +- `AFHTTPSessionManager` + +### Serialization + +* `` + - `AFHTTPRequestSerializer` + - `AFJSONRequestSerializer` + - `AFPropertyListRequestSerializer` +* `` + - `AFHTTPResponseSerializer` + - `AFJSONResponseSerializer` + - `AFXMLParserResponseSerializer` + - `AFXMLDocumentResponseSerializer` _(Mac OS X)_ + - `AFPropertyListResponseSerializer` + - `AFImageResponseSerializer` + - `AFCompoundResponseSerializer` + +### Additional Functionality + +- `AFSecurityPolicy` +- `AFNetworkReachabilityManager` + +## Usage + +### AFURLSessionManager + +`AFURLSessionManager` creates and manages an `NSURLSession` object based on a specified `NSURLSessionConfiguration` object, which conforms to ``, ``, ``, and ``. + +#### Creating a Download Task + +```objective-c +NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; +AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; + +NSURL *URL = [NSURL URLWithString:@"http://example.com/download.zip"]; +NSURLRequest *request = [NSURLRequest requestWithURL:URL]; + +NSURLSessionDownloadTask *downloadTask = [manager downloadTaskWithRequest:request progress:nil destination:^NSURL *(NSURL *targetPath, NSURLResponse *response) { + NSURL *documentsDirectoryURL = [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]; + return [documentsDirectoryURL URLByAppendingPathComponent:[response suggestedFilename]]; +} completionHandler:^(NSURLResponse *response, NSURL *filePath, NSError *error) { + NSLog(@"File downloaded to: %@", filePath); +}]; +[downloadTask resume]; +``` + +#### Creating an Upload Task + +```objective-c +NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; +AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; + +NSURL *URL = [NSURL URLWithString:@"http://example.com/upload"]; +NSURLRequest *request = [NSURLRequest requestWithURL:URL]; + +NSURL *filePath = [NSURL fileURLWithPath:@"file://path/to/image.png"]; +NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithRequest:request fromFile:filePath progress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { + if (error) { + NSLog(@"Error: %@", error); + } else { + NSLog(@"Success: %@ %@", response, responseObject); + } +}]; +[uploadTask resume]; +``` + +#### Creating an Upload Task for a Multi-Part Request, with Progress + +```objective-c +NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:@"http://example.com/upload" parameters:nil constructingBodyWithBlock:^(id formData) { + [formData appendPartWithFileURL:[NSURL fileURLWithPath:@"file://path/to/image.jpg"] name:@"file" fileName:@"filename.jpg" mimeType:@"image/jpeg" error:nil]; + } error:nil]; + +AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]]; + +NSURLSessionUploadTask *uploadTask; +uploadTask = [manager + uploadTaskWithStreamedRequest:request + progress:^(NSProgress * _Nonnull uploadProgress) { + // This is not called back on the main queue. + // You are responsible for dispatching to the main queue for UI updates + dispatch_async(dispatch_get_main_queue(), ^{ + //Update the progress view + [progressView setProgress:uploadProgress.fractionCompleted]; + }); + } + completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { + if (error) { + NSLog(@"Error: %@", error); + } else { + NSLog(@"%@ %@", response, responseObject); + } + }]; + +[uploadTask resume]; +``` + +#### Creating a Data Task + +```objective-c +NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; +AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; + +NSURL *URL = [NSURL URLWithString:@"http://example.com/upload"]; +NSURLRequest *request = [NSURLRequest requestWithURL:URL]; + +NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { + if (error) { + NSLog(@"Error: %@", error); + } else { + NSLog(@"%@ %@", response, responseObject); + } +}]; +[dataTask resume]; +``` + +--- + +### Request Serialization + +Request serializers create requests from URL strings, encoding parameters as either a query string or HTTP body. + +```objective-c +NSString *URLString = @"http://example.com"; +NSDictionary *parameters = @{@"foo": @"bar", @"baz": @[@1, @2, @3]}; +``` + +#### Query String Parameter Encoding + +```objective-c +[[AFHTTPRequestSerializer serializer] requestWithMethod:@"GET" URLString:URLString parameters:parameters error:nil]; +``` + + GET http://example.com?foo=bar&baz[]=1&baz[]=2&baz[]=3 + +#### URL Form Parameter Encoding + +```objective-c +[[AFHTTPRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters]; +``` + + POST http://example.com/ + Content-Type: application/x-www-form-urlencoded + + foo=bar&baz[]=1&baz[]=2&baz[]=3 + +#### JSON Parameter Encoding + +```objective-c +[[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters]; +``` + + POST http://example.com/ + Content-Type: application/json + + {"foo": "bar", "baz": [1,2,3]} + +--- + +### Network Reachability Manager + +`AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces. + +* Do not use Reachability to determine if the original request should be sent. + * You should try to send it. +* You can use Reachability to determine when a request should be automatically retried. + * Although it may still fail, a Reachability notification that the connectivity is available is a good time to retry something. +* Network reachability is a useful tool for determining why a request might have failed. + * After a network request has failed, telling the user they're offline is better than giving them a more technical but accurate error, such as "request timed out." + +See also [WWDC 2012 session 706, "Networking Best Practices."](https://developer.apple.com/videos/play/wwdc2012-706/). + +#### Shared Network Reachability + +```objective-c +[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { + NSLog(@"Reachability: %@", AFStringFromNetworkReachabilityStatus(status)); +}]; + +[[AFNetworkReachabilityManager sharedManager] startMonitoring]; +``` + +--- + +### Security Policy + +`AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections. + +Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled. + +#### Allowing Invalid SSL Certificates + +```objective-c +AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; +manager.securityPolicy.allowInvalidCertificates = YES; // not recommended for production +``` + +--- + +## Unit Tests + +AFNetworking includes a suite of unit tests within the Tests subdirectory. These tests can be run simply be executed the test action on the platform framework you would like to test. + +## Credits + +AFNetworking is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). + +AFNetworking was originally created by [Scott Raymond](https://github.com/sco/) and [Mattt Thompson](https://github.com/mattt/) in the development of [Gowalla for iPhone](http://en.wikipedia.org/wiki/Gowalla). + +AFNetworking's logo was designed by [Alan Defibaugh](http://www.alandefibaugh.com/). + +And most of all, thanks to AFNetworking's [growing list of contributors](https://github.com/AFNetworking/AFNetworking/contributors). + +### Security Disclosure + +If you believe you have identified a security vulnerability with AFNetworking, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker. + +## License + +AFNetworking is released under the MIT license. See LICENSE for details. diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h b/Example/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h new file mode 100644 index 0000000..e89b951 --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h @@ -0,0 +1,149 @@ +// AFAutoPurgingImageCache.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import +#import + +#if TARGET_OS_IOS || TARGET_OS_TV +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + The `AFImageCache` protocol defines a set of APIs for adding, removing and fetching images from a cache synchronously. + */ +@protocol AFImageCache + +/** + Adds the image to the cache with the given identifier. + + @param image The image to cache. + @param identifier The unique identifier for the image in the cache. + */ +- (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier; + +/** + Removes the image from the cache matching the given identifier. + + @param identifier The unique identifier for the image in the cache. + + @return A BOOL indicating whether or not the image was removed from the cache. + */ +- (BOOL)removeImageWithIdentifier:(NSString *)identifier; + +/** + Removes all images from the cache. + + @return A BOOL indicating whether or not all images were removed from the cache. + */ +- (BOOL)removeAllImages; + +/** + Returns the image in the cache associated with the given identifier. + + @param identifier The unique identifier for the image in the cache. + + @return An image for the matching identifier, or nil. + */ +- (nullable UIImage *)imageWithIdentifier:(NSString *)identifier; +@end + + +/** + The `ImageRequestCache` protocol extends the `ImageCache` protocol by adding methods for adding, removing and fetching images from a cache given an `NSURLRequest` and additional identifier. + */ +@protocol AFImageRequestCache + +/** + Adds the image to the cache using an identifier created from the request and additional identifier. + + @param image The image to cache. + @param request The unique URL request identifing the image asset. + @param identifier The additional identifier to apply to the URL request to identify the image. + */ +- (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; + +/** + Removes the image from the cache using an identifier created from the request and additional identifier. + + @param request The unique URL request identifing the image asset. + @param identifier The additional identifier to apply to the URL request to identify the image. + + @return A BOOL indicating whether or not all images were removed from the cache. + */ +- (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; + +/** + Returns the image from the cache associated with an identifier created from the request and additional identifier. + + @param request The unique URL request identifing the image asset. + @param identifier The additional identifier to apply to the URL request to identify the image. + + @return An image for the matching request and identifier, or nil. + */ +- (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; + +@end + +/** + The `AutoPurgingImageCache` in an in-memory image cache used to store images up to a given memory capacity. When the memory capacity is reached, the image cache is sorted by last access date, then the oldest image is continuously purged until the preferred memory usage after purge is met. Each time an image is accessed through the cache, the internal access date of the image is updated. + */ +@interface AFAutoPurgingImageCache : NSObject + +/** + The total memory capacity of the cache in bytes. + */ +@property (nonatomic, assign) UInt64 memoryCapacity; + +/** + The preferred memory usage after purge in bytes. During a purge, images will be purged until the memory capacity drops below this limit. + */ +@property (nonatomic, assign) UInt64 preferredMemoryUsageAfterPurge; + +/** + The current total memory usage in bytes of all images stored within the cache. + */ +@property (nonatomic, assign, readonly) UInt64 memoryUsage; + +/** + Initialies the `AutoPurgingImageCache` instance with default values for memory capacity and preferred memory usage after purge limit. `memoryCapcity` defaults to `100 MB`. `preferredMemoryUsageAfterPurge` defaults to `60 MB`. + + @return The new `AutoPurgingImageCache` instance. + */ +- (instancetype)init; + +/** + Initialies the `AutoPurgingImageCache` instance with the given memory capacity and preferred memory usage + after purge limit. + + @param memoryCapacity The total memory capacity of the cache in bytes. + @param preferredMemoryUsageAfterPurge The preferred memory usage after purge in bytes. + + @return The new `AutoPurgingImageCache` instance. + */ +- (instancetype)initWithMemoryCapacity:(UInt64)memoryCapacity preferredMemoryCapacity:(UInt64)preferredMemoryCapacity; + +@end + +NS_ASSUME_NONNULL_END + +#endif + diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.m b/Example/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.m new file mode 100644 index 0000000..326fe4f --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.m @@ -0,0 +1,201 @@ +// AFAutoPurgingImageCache.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import "AFAutoPurgingImageCache.h" + +@interface AFCachedImage : NSObject + +@property (nonatomic, strong) UIImage *image; +@property (nonatomic, strong) NSString *identifier; +@property (nonatomic, assign) UInt64 totalBytes; +@property (nonatomic, strong) NSDate *lastAccessDate; +@property (nonatomic, assign) UInt64 currentMemoryUsage; + +@end + +@implementation AFCachedImage + +-(instancetype)initWithImage:(UIImage *)image identifier:(NSString *)identifier { + if (self = [self init]) { + self.image = image; + self.identifier = identifier; + + CGSize imageSize = CGSizeMake(image.size.width * image.scale, image.size.height * image.scale); + CGFloat bytesPerPixel = 4.0; + CGFloat bytesPerRow = imageSize.width * bytesPerPixel; + self.totalBytes = (UInt64)bytesPerPixel * (UInt64)bytesPerRow; + self.lastAccessDate = [NSDate date]; + } + return self; +} + +- (UIImage*)accessImage { + self.lastAccessDate = [NSDate date]; + return self.image; +} + +- (NSString *)description { + NSString *descriptionString = [NSString stringWithFormat:@"Idenfitier: %@ lastAccessDate: %@ ", self.identifier, self.lastAccessDate]; + return descriptionString; + +} + +@end + +@interface AFAutoPurgingImageCache () +@property (nonatomic, strong) NSMutableDictionary *cachedImages; +@property (nonatomic, assign) UInt64 currentMemoryUsage; +@property (nonatomic, strong) dispatch_queue_t synchronizationQueue; +@end + +@implementation AFAutoPurgingImageCache + +- (instancetype)init { + return [self initWithMemoryCapacity:100 * 1024 * 1024 preferredMemoryCapacity:60 * 1024 * 1024]; +} + +- (instancetype)initWithMemoryCapacity:(UInt64)memoryCapacity preferredMemoryCapacity:(UInt64)preferredMemoryCapacity { + if (self = [super init]) { + self.memoryCapacity = memoryCapacity; + self.preferredMemoryUsageAfterPurge = preferredMemoryCapacity; + self.cachedImages = [[NSMutableDictionary alloc] init]; + + NSString *queueName = [NSString stringWithFormat:@"com.alamofire.autopurgingimagecache-%@", [[NSUUID UUID] UUIDString]]; + self.synchronizationQueue = dispatch_queue_create([queueName cStringUsingEncoding:NSASCIIStringEncoding], DISPATCH_QUEUE_CONCURRENT); + + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(removeAllImages) + name:UIApplicationDidReceiveMemoryWarningNotification + object:nil]; + + } + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +- (UInt64)memoryUsage { + __block UInt64 result = 0; + dispatch_sync(self.synchronizationQueue, ^{ + result = self.currentMemoryUsage; + }); + return result; +} + +- (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier { + dispatch_barrier_async(self.synchronizationQueue, ^{ + AFCachedImage *cacheImage = [[AFCachedImage alloc] initWithImage:image identifier:identifier]; + + AFCachedImage *previousCachedImage = self.cachedImages[identifier]; + if (previousCachedImage != nil) { + self.currentMemoryUsage -= previousCachedImage.totalBytes; + } + + self.cachedImages[identifier] = cacheImage; + self.currentMemoryUsage += cacheImage.totalBytes; + }); + + dispatch_barrier_async(self.synchronizationQueue, ^{ + if (self.currentMemoryUsage > self.memoryCapacity) { + UInt64 bytesToPurge = self.currentMemoryUsage - self.preferredMemoryUsageAfterPurge; + NSMutableArray *sortedImages = [NSMutableArray arrayWithArray:self.cachedImages.allValues]; + NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"lastAccessDate" + ascending:YES]; + [sortedImages sortUsingDescriptors:@[sortDescriptor]]; + + UInt64 bytesPurged = 0; + + for (AFCachedImage *cachedImage in sortedImages) { + [self.cachedImages removeObjectForKey:cachedImage.identifier]; + bytesPurged += cachedImage.totalBytes; + if (bytesPurged >= bytesToPurge) { + break ; + } + } + self.currentMemoryUsage -= bytesPurged; + } + }); +} + +- (BOOL)removeImageWithIdentifier:(NSString *)identifier { + __block BOOL removed = NO; + dispatch_barrier_sync(self.synchronizationQueue, ^{ + AFCachedImage *cachedImage = self.cachedImages[identifier]; + if (cachedImage != nil) { + [self.cachedImages removeObjectForKey:identifier]; + self.currentMemoryUsage -= cachedImage.totalBytes; + removed = YES; + } + }); + return removed; +} + +- (BOOL)removeAllImages { + __block BOOL removed = NO; + dispatch_barrier_sync(self.synchronizationQueue, ^{ + if (self.cachedImages.count > 0) { + [self.cachedImages removeAllObjects]; + self.currentMemoryUsage = 0; + removed = YES; + } + }); + return removed; +} + +- (nullable UIImage *)imageWithIdentifier:(NSString *)identifier { + __block UIImage *image = nil; + dispatch_sync(self.synchronizationQueue, ^{ + AFCachedImage *cachedImage = self.cachedImages[identifier]; + image = [cachedImage accessImage]; + }); + return image; +} + +- (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier { + [self addImage:image withIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]]; +} + +- (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier { + return [self removeImageWithIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]]; +} + +- (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier { + return [self imageWithIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]]; +} + +- (NSString *)imageCacheKeyFromURLRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)additionalIdentifier { + NSString *key = request.URL.absoluteString; + if (additionalIdentifier != nil) { + key = [key stringByAppendingString:additionalIdentifier]; + } + return key; +} + +@end + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.h b/Example/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.h new file mode 100644 index 0000000..b35e185 --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.h @@ -0,0 +1,157 @@ +// AFImageDownloader.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import +#import "AFAutoPurgingImageCache.h" +#import "AFHTTPSessionManager.h" + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization) { + AFImageDownloadPrioritizationFIFO, + AFImageDownloadPrioritizationLIFO +}; + +/** + The `AFImageDownloadReceipt` is an object vended by the `AFImageDownloader` when starting a data task. It can be used to cancel active tasks running on the `AFImageDownloader` session. As a general rule, image data tasks should be cancelled using the `AFImageDownloadReceipt` instead of calling `cancel` directly on the `task` itself. The `AFImageDownloader` is optimized to handle duplicate task scenarios as well as pending versus active downloads. + */ +@interface AFImageDownloadReceipt : NSObject + +/** + The data task created by the `AFImageDownloader`. +*/ +@property (nonatomic, strong) NSURLSessionDataTask *task; + +/** + The unique identifier for the success and failure blocks when duplicate requests are made. + */ +@property (nonatomic, strong) NSUUID *receiptID; +@end + +/** The `AFImageDownloader` class is responsible for downloading images in parallel on a prioritized queue. Incoming downloads are added to the front or back of the queue depending on the download prioritization. Each downloaded image is cached in the underlying `NSURLCache` as well as the in-memory image cache. By default, any download request with a cached image equivalent in the image cache will automatically be served the cached image representation. + */ +@interface AFImageDownloader : NSObject + +/** + The image cache used to store all downloaded images in. `AFAutoPurgingImageCache` by default. + */ +@property (nonatomic, strong, nullable) id imageCache; + +/** + The `AFHTTPSessionManager` used to download images. By default, this is configured with an `AFImageResponseSerializer`, and a shared `NSURLCache` for all image downloads. + */ +@property (nonatomic, strong) AFHTTPSessionManager *sessionManager; + +/** + Defines the order prioritization of incoming download requests being inserted into the queue. `AFImageDownloadPrioritizationFIFO` by default. + */ +@property (nonatomic, assign) AFImageDownloadPrioritization downloadPrioritizaton; + +/** + The shared default instance of `AFImageDownloader` initialized with default values. + */ ++ (instancetype)defaultInstance; + +/** + Creates a default `NSURLCache` with common usage parameter values. + + @returns The default `NSURLCache` instance. + */ ++ (NSURLCache *)defaultURLCache; + +/** + Default initializer + + @return An instance of `AFImageDownloader` initialized with default values. + */ +- (instancetype)init; + +/** + Initializes the `AFImageDownloader` instance with the given session manager, download prioritization, maximum active download count and image cache. + + @param sessionManager The session manager to use to download images. + @param downloadPrioritization The download prioritization of the download queue. + @param maximumActiveDownloads The maximum number of active downloads allowed at any given time. Recommend `4`. + @param imageCache The image cache used to store all downloaded images in. + + @return The new `AFImageDownloader` instance. + */ +- (instancetype)initWithSessionManager:(AFHTTPSessionManager *)sessionManager + downloadPrioritization:(AFImageDownloadPrioritization)downloadPrioritization + maximumActiveDownloads:(NSInteger)maximumActiveDownloads + imageCache:(nullable id )imageCache; + +/** + Creates a data task using the `sessionManager` instance for the specified URL request. + + If the same data task is already in the queue or currently being downloaded, the success and failure blocks are + appended to the already existing task. Once the task completes, all success or failure blocks attached to the + task are executed in the order they were added. + + @param request The URL request. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + + @return The image download receipt for the data task if available. `nil` if the image is stored in the cache. + cache and the URL request cache policy allows the cache to be used. + */ +- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + +/** + Creates a data task using the `sessionManager` instance for the specified URL request. + + If the same data task is already in the queue or currently being downloaded, the success and failure blocks are + appended to the already existing task. Once the task completes, all success or failure blocks attached to the + task are executed in the order they were added. + + @param request The URL request. + @param request The identifier to use for the download receipt that will be created for this request. This must be a unique identifier that does not represent any other request. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + + @return The image download receipt for the data task if available. `nil` if the image is stored in the cache. + cache and the URL request cache policy allows the cache to be used. + */ +- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request + withReceiptID:(NSUUID *)receiptID + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + +/** + Cancels the data task in the receipt by removing the corresponding success and failure blocks and cancelling the data task if necessary. + + If the data task is pending in the queue, it will be cancelled if no other success and failure blocks are registered with the data task. If the data task is currently executing or is already completed, the success and failure blocks are removed and will not be called when the task finishes. + + @param imageDownloadReceipt The image download receipt to cancel. + */ +- (void)cancelTaskForImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt; + +@end + +#endif + +NS_ASSUME_NONNULL_END diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.m b/Example/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.m new file mode 100644 index 0000000..e87082a --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.m @@ -0,0 +1,369 @@ +// AFImageDownloader.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import "AFImageDownloader.h" +#import "AFHTTPSessionManager.h" + +@interface AFImageDownloaderResponseHandler : NSObject +@property (nonatomic, strong) NSUUID *uuid; +@property (nonatomic, copy) void (^successBlock)(NSURLRequest*, NSHTTPURLResponse*, UIImage*); +@property (nonatomic, copy) void (^failureBlock)(NSURLRequest*, NSHTTPURLResponse*, NSError*); +@end + +@implementation AFImageDownloaderResponseHandler + +- (instancetype)initWithUUID:(NSUUID *)uuid + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure { + if (self = [self init]) { + self.uuid = uuid; + self.successBlock = success; + self.failureBlock = failure; + } + return self; +} + +- (NSString *)description { + return [NSString stringWithFormat: @"UUID: %@", [self.uuid UUIDString]]; +} + +@end + +@interface AFImageDownloaderMergedTask : NSObject +@property (nonatomic, strong) NSString *identifier; +@property (nonatomic, strong) NSURLSessionDataTask *task; +@property (nonatomic, strong) NSMutableArray *responseHandlers; + +@end + +@implementation AFImageDownloaderMergedTask + +- (instancetype)initWithIdentifier:(NSString *)identifier task:(NSURLSessionDataTask *)task { + if (self = [self init]) { + self.identifier = identifier; + self.task = task; + self.responseHandlers = [[NSMutableArray alloc] init]; + } + return self; +} + +- (void)addResponseHandler:(AFImageDownloaderResponseHandler*)handler { + [self.responseHandlers addObject:handler]; +} + +- (void)removeResponseHandler:(AFImageDownloaderResponseHandler*)handler { + [self.responseHandlers removeObject:handler]; +} + +@end + +@implementation AFImageDownloadReceipt + +- (instancetype)initWithReceiptID:(NSUUID *)receiptID task:(NSURLSessionDataTask *)task { + if (self = [self init]) { + self.receiptID = receiptID; + self.task = task; + } + return self; +} + +@end + +@interface AFImageDownloader () + +@property (nonatomic, strong) dispatch_queue_t synchronizationQueue; +@property (nonatomic, strong) dispatch_queue_t responseQueue; + +@property (nonatomic, assign) NSInteger maximumActiveDownloads; +@property (nonatomic, assign) NSInteger activeRequestCount; + +@property (nonatomic, strong) NSMutableArray *queuedMergedTasks; +@property (nonatomic, strong) NSMutableDictionary *mergedTasks; + +@end + + +@implementation AFImageDownloader + ++ (NSURLCache *)defaultURLCache { + return [[NSURLCache alloc] initWithMemoryCapacity:20 * 1024 * 1024 + diskCapacity:150 * 1024 * 1024 + diskPath:@"com.alamofire.imagedownloader"]; +} + ++ (NSURLSessionConfiguration *)defaultURLSessionConfiguration { + NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; + + //TODO set the default HTTP headers + + configuration.HTTPShouldSetCookies = YES; + configuration.HTTPShouldUsePipelining = NO; + + configuration.requestCachePolicy = NSURLRequestUseProtocolCachePolicy; + configuration.allowsCellularAccess = YES; + configuration.timeoutIntervalForRequest = 60.0; + configuration.URLCache = [AFImageDownloader defaultURLCache]; + + return configuration; +} + +- (instancetype)init { + NSURLSessionConfiguration *defaultConfiguration = [self.class defaultURLSessionConfiguration]; + AFHTTPSessionManager *sessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:defaultConfiguration]; + sessionManager.responseSerializer = [AFImageResponseSerializer serializer]; + + return [self initWithSessionManager:sessionManager + downloadPrioritization:AFImageDownloadPrioritizationFIFO + maximumActiveDownloads:4 + imageCache:[[AFAutoPurgingImageCache alloc] init]]; +} + +- (instancetype)initWithSessionManager:(AFHTTPSessionManager *)sessionManager + downloadPrioritization:(AFImageDownloadPrioritization)downloadPrioritization + maximumActiveDownloads:(NSInteger)maximumActiveDownloads + imageCache:(id )imageCache { + if (self = [super init]) { + self.sessionManager = sessionManager; + + self.downloadPrioritizaton = downloadPrioritization; + self.maximumActiveDownloads = maximumActiveDownloads; + self.imageCache = imageCache; + + self.queuedMergedTasks = [[NSMutableArray alloc] init]; + self.mergedTasks = [[NSMutableDictionary alloc] init]; + self.activeRequestCount = 0; + + NSString *name = [NSString stringWithFormat:@"com.alamofire.imagedownloader.synchronizationqueue-%@", [[NSUUID UUID] UUIDString]]; + self.synchronizationQueue = dispatch_queue_create([name cStringUsingEncoding:NSASCIIStringEncoding], DISPATCH_QUEUE_SERIAL); + + name = [NSString stringWithFormat:@"com.alamofire.imagedownloader.responsequeue-%@", [[NSUUID UUID] UUIDString]]; + self.responseQueue = dispatch_queue_create([name cStringUsingEncoding:NSASCIIStringEncoding], DISPATCH_QUEUE_CONCURRENT); + } + + return self; +} + ++ (instancetype)defaultInstance { + static AFImageDownloader *sharedInstance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedInstance = [[self alloc] init]; + }); + return sharedInstance; +} + +- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request + success:(void (^)(NSURLRequest * _Nonnull, NSHTTPURLResponse * _Nullable, UIImage * _Nonnull))success + failure:(void (^)(NSURLRequest * _Nonnull, NSHTTPURLResponse * _Nullable, NSError * _Nonnull))failure { + return [self downloadImageForURLRequest:request withReceiptID:[NSUUID UUID] success:success failure:failure]; +} + +- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request + withReceiptID:(nonnull NSUUID *)receiptID + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure { + __block NSURLSessionDataTask *task = nil; + dispatch_sync(self.synchronizationQueue, ^{ + NSString *identifier = request.URL.absoluteString; + + // 1) Append the success and failure blocks to a pre-existing request if it already exists + AFImageDownloaderMergedTask *existingMergedTask = self.mergedTasks[identifier]; + if (existingMergedTask != nil) { + AFImageDownloaderResponseHandler *handler = [[AFImageDownloaderResponseHandler alloc] initWithUUID:receiptID success:success failure:failure]; + [existingMergedTask addResponseHandler:handler]; + task = existingMergedTask.task; + return; + } + + // 2) Attempt to load the image from the image cache if the cache policy allows it + switch (request.cachePolicy) { + case NSURLRequestUseProtocolCachePolicy: + case NSURLRequestReturnCacheDataElseLoad: + case NSURLRequestReturnCacheDataDontLoad: { + UIImage *cachedImage = [self.imageCache imageforRequest:request withAdditionalIdentifier:nil]; + if (cachedImage != nil) { + if (success) { + dispatch_async(dispatch_get_main_queue(), ^{ + success(request, nil, cachedImage); + }); + } + return; + } + break; + } + default: + break; + } + + // 3) Create the request and set up authentication, validation and response serialization + NSURLSessionDataTask *createdTask; + __weak __typeof__(self) weakSelf = self; + + createdTask = [self.sessionManager + dataTaskWithRequest:request + completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { + dispatch_async(self.responseQueue, ^{ + __strong __typeof__(weakSelf) strongSelf = weakSelf; + AFImageDownloaderMergedTask *mergedTask = [strongSelf safelyRemoveMergedTaskWithIdentifier:identifier]; + if (error) { + for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) { + if (handler.failureBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + handler.failureBlock(request, (NSHTTPURLResponse*)response, error); + }); + } + } + } else { + [strongSelf.imageCache addImage:responseObject forRequest:request withAdditionalIdentifier:nil]; + + for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) { + if (handler.successBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + handler.successBlock(request, (NSHTTPURLResponse*)response, responseObject); + }); + } + } + + } + [strongSelf safelyDecrementActiveTaskCount]; + [strongSelf safelyStartNextTaskIfNecessary]; + }); + }]; + + // 4) Store the response handler for use when the request completes + AFImageDownloaderResponseHandler *handler = [[AFImageDownloaderResponseHandler alloc] initWithUUID:receiptID + success:success + failure:failure]; + AFImageDownloaderMergedTask *mergedTask = [[AFImageDownloaderMergedTask alloc] + initWithIdentifier:identifier + task:createdTask]; + [mergedTask addResponseHandler:handler]; + self.mergedTasks[identifier] = mergedTask; + + // 5) Either start the request or enqueue it depending on the current active request count + if ([self isActiveRequestCountBelowMaximumLimit]) { + [self startMergedTask:mergedTask]; + } else { + [self enqueueMergedTask:mergedTask]; + } + + task = mergedTask.task; + }); + if (task) { + return [[AFImageDownloadReceipt alloc] initWithReceiptID:receiptID task:task]; + } else { + return nil; + } +} + +- (void)cancelTaskForImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt { + dispatch_sync(self.synchronizationQueue, ^{ + NSString *identifier = imageDownloadReceipt.task.originalRequest.URL.absoluteString; + AFImageDownloaderMergedTask *mergedTask = self.mergedTasks[identifier]; + NSUInteger index = [mergedTask.responseHandlers indexOfObjectPassingTest:^BOOL(AFImageDownloaderResponseHandler * _Nonnull handler, __unused NSUInteger idx, __unused BOOL * _Nonnull stop) { + return handler.uuid == imageDownloadReceipt.receiptID; + }]; + + if (index != NSNotFound) { + AFImageDownloaderResponseHandler *handler = mergedTask.responseHandlers[index]; + [mergedTask removeResponseHandler:handler]; + NSString *failureReason = [NSString stringWithFormat:@"ImageDownloader cancelled URL request: %@",imageDownloadReceipt.task.originalRequest.URL.absoluteString]; + NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey:failureReason}; + NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:userInfo]; + if (handler.failureBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + handler.failureBlock(imageDownloadReceipt.task.originalRequest, nil, error); + }); + } + } + + if (mergedTask.responseHandlers.count == 0 && mergedTask.task.state == NSURLSessionTaskStateSuspended) { + [mergedTask.task cancel]; + } + }); +} + +- (AFImageDownloaderMergedTask*)safelyRemoveMergedTaskWithIdentifier:(NSString *)identifier { + __block AFImageDownloaderMergedTask *mergedTask = nil; + dispatch_sync(self.synchronizationQueue, ^{ + mergedTask = self.mergedTasks[identifier]; + [self.mergedTasks removeObjectForKey:identifier]; + + }); + return mergedTask; +} + +- (void)safelyDecrementActiveTaskCount { + dispatch_sync(self.synchronizationQueue, ^{ + if (self.activeRequestCount > 0) { + self.activeRequestCount -= 1; + } + }); +} + +- (void)safelyStartNextTaskIfNecessary { + dispatch_sync(self.synchronizationQueue, ^{ + if ([self isActiveRequestCountBelowMaximumLimit]) { + while (self.queuedMergedTasks.count > 0) { + AFImageDownloaderMergedTask *mergedTask = [self dequeueMergedTask]; + if (mergedTask.task.state == NSURLSessionTaskStateSuspended) { + [self startMergedTask:mergedTask]; + break; + } + } + } + }); +} + +- (void)startMergedTask:(AFImageDownloaderMergedTask *)mergedTask { + [mergedTask.task resume]; + ++self.activeRequestCount; +} + +- (void)enqueueMergedTask:(AFImageDownloaderMergedTask *)mergedTask { + switch (self.downloadPrioritizaton) { + case AFImageDownloadPrioritizationFIFO: + [self.queuedMergedTasks addObject:mergedTask]; + break; + case AFImageDownloadPrioritizationLIFO: + [self.queuedMergedTasks insertObject:mergedTask atIndex:0]; + break; + } +} + +- (AFImageDownloaderMergedTask *)dequeueMergedTask { + AFImageDownloaderMergedTask *mergedTask = nil; + mergedTask = [self.queuedMergedTasks firstObject]; + [self.queuedMergedTasks removeObject:mergedTask]; + return mergedTask; +} + +- (BOOL)isActiveRequestCountBelowMaximumLimit { + return self.activeRequestCount < self.maximumActiveDownloads; +} + +@end + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h b/Example/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h new file mode 100644 index 0000000..a627a6d --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h @@ -0,0 +1,103 @@ +// AFNetworkActivityIndicatorManager.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#import + +#if TARGET_OS_IOS + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a session task has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero. + + You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code: + + [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; + + By setting `enabled` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself. + + See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information: + http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44 + */ +NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.") +@interface AFNetworkActivityIndicatorManager : NSObject + +/** + A Boolean value indicating whether the manager is enabled. + + If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO. + */ +@property (nonatomic, assign, getter = isEnabled) BOOL enabled; + +/** + A Boolean value indicating whether the network activity indicator manager is currently active. +*/ +@property (readonly, nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; + +/** + A time interval indicating the minimum duration of networking activity that should occur before the activity indicator is displayed. The default value 1 second. If the network activity indicator should be displayed immediately when network activity occurs, this value should be set to 0 seconds. + + Apple's HIG describes the following: + + > Display the network activity indicator to provide feedback when your app accesses the network for more than a couple of seconds. If the operation finishes sooner than that, you don’t have to show the network activity indicator, because the indicator is likely to disappear before users notice its presence. + + */ +@property (nonatomic, assign) NSTimeInterval activationDelay; + +/** + A time interval indicating the duration of time of no networking activity required before the activity indicator is disabled. This allows for continuous display of the network activity indicator across multiple requests. The default value is 0.17 seconds. + */ + +@property (nonatomic, assign) NSTimeInterval completionDelay; + +/** + Returns the shared network activity indicator manager object for the system. + + @return The systemwide network activity indicator manager. + */ ++ (instancetype)sharedManager; + +/** + Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator. + */ +- (void)incrementActivityCount; + +/** + Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator. + */ +- (void)decrementActivityCount; + +/** + Set the a custom method to be executed when the network activity indicator manager should be hidden/shown. By default, this is null, and the UIApplication Network Activity Indicator will be managed automatically. If this block is set, it is the responsiblity of the caller to manager the network activity indicator going forward. + + @param block A block to be executed when the network activity indicator status changes. + */ +- (void)setNetworkingActivityActionWithBlock:(nullable void (^)(BOOL networkActivityIndicatorVisible))block; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m b/Example/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m new file mode 100644 index 0000000..0615fa9 --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m @@ -0,0 +1,261 @@ +// AFNetworkActivityIndicatorManager.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "AFNetworkActivityIndicatorManager.h" + +#if TARGET_OS_IOS +#import "AFURLSessionManager.h" + +typedef NS_ENUM(NSInteger, AFNetworkActivityManagerState) { + AFNetworkActivityManagerStateNotActive, + AFNetworkActivityManagerStateDelayingStart, + AFNetworkActivityManagerStateActive, + AFNetworkActivityManagerStateDelayingEnd +}; + +static NSTimeInterval const kDefaultAFNetworkActivityManagerActivationDelay = 1.0; +static NSTimeInterval const kDefaultAFNetworkActivityManagerCompletionDelay = 0.17; + +static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notification) { + if ([[notification object] respondsToSelector:@selector(originalRequest)]) { + return [(NSURLSessionTask *)[notification object] originalRequest]; + } else { + return nil; + } +} + +typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisible); + +@interface AFNetworkActivityIndicatorManager () +@property (readwrite, nonatomic, assign) NSInteger activityCount; +@property (readwrite, nonatomic, strong) NSTimer *activationDelayTimer; +@property (readwrite, nonatomic, strong) NSTimer *completionDelayTimer; +@property (readonly, nonatomic, getter = isNetworkActivityOccurring) BOOL networkActivityOccurring; +@property (nonatomic, copy) AFNetworkActivityActionBlock networkActivityActionBlock; +@property (nonatomic, assign) AFNetworkActivityManagerState currentState; +@property (nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; + +- (void)updateCurrentStateForNetworkActivityChange; +@end + +@implementation AFNetworkActivityIndicatorManager + ++ (instancetype)sharedManager { + static AFNetworkActivityIndicatorManager *_sharedManager = nil; + static dispatch_once_t oncePredicate; + dispatch_once(&oncePredicate, ^{ + _sharedManager = [[self alloc] init]; + }); + + return _sharedManager; +} + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + self.currentState = AFNetworkActivityManagerStateNotActive; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingTaskDidResumeNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidSuspendNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidCompleteNotification object:nil]; + self.activationDelay = kDefaultAFNetworkActivityManagerActivationDelay; + self.completionDelay = kDefaultAFNetworkActivityManagerCompletionDelay; + + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + [_activationDelayTimer invalidate]; + [_completionDelayTimer invalidate]; +} + +- (void)setEnabled:(BOOL)enabled { + _enabled = enabled; + if (enabled == NO) { + [self setCurrentState:AFNetworkActivityManagerStateNotActive]; + } +} + +- (void)setNetworkingActivityActionWithBlock:(void (^)(BOOL networkActivityIndicatorVisible))block { + self.networkActivityActionBlock = block; +} + +- (BOOL)isNetworkActivityOccurring { + @synchronized(self) { + return self.activityCount > 0; + } +} + +- (void)setNetworkActivityIndicatorVisible:(BOOL)networkActivityIndicatorVisible { + if (_networkActivityIndicatorVisible != networkActivityIndicatorVisible) { + [self willChangeValueForKey:@"networkActivityIndicatorVisible"]; + @synchronized(self) { + _networkActivityIndicatorVisible = networkActivityIndicatorVisible; + } + [self didChangeValueForKey:@"networkActivityIndicatorVisible"]; + if (self.networkActivityActionBlock) { + self.networkActivityActionBlock(networkActivityIndicatorVisible); + } else { + [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:networkActivityIndicatorVisible]; + } + } +} + +- (void)setActivityCount:(NSInteger)activityCount { + @synchronized(self) { + _activityCount = activityCount; + } + + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateCurrentStateForNetworkActivityChange]; + }); +} + +- (void)incrementActivityCount { + [self willChangeValueForKey:@"activityCount"]; + @synchronized(self) { + _activityCount++; + } + [self didChangeValueForKey:@"activityCount"]; + + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateCurrentStateForNetworkActivityChange]; + }); +} + +- (void)decrementActivityCount { + [self willChangeValueForKey:@"activityCount"]; + @synchronized(self) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + _activityCount = MAX(_activityCount - 1, 0); +#pragma clang diagnostic pop + } + [self didChangeValueForKey:@"activityCount"]; + + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateCurrentStateForNetworkActivityChange]; + }); +} + +- (void)networkRequestDidStart:(NSNotification *)notification { + if ([AFNetworkRequestFromNotification(notification) URL]) { + [self incrementActivityCount]; + } +} + +- (void)networkRequestDidFinish:(NSNotification *)notification { + if ([AFNetworkRequestFromNotification(notification) URL]) { + [self decrementActivityCount]; + } +} + +#pragma mark - Internal State Management +- (void)setCurrentState:(AFNetworkActivityManagerState)currentState { + @synchronized(self) { + if (_currentState != currentState) { + [self willChangeValueForKey:@"currentState"]; + _currentState = currentState; + switch (currentState) { + case AFNetworkActivityManagerStateNotActive: + [self cancelActivationDelayTimer]; + [self cancelCompletionDelayTimer]; + [self setNetworkActivityIndicatorVisible:NO]; + break; + case AFNetworkActivityManagerStateDelayingStart: + [self startActivationDelayTimer]; + break; + case AFNetworkActivityManagerStateActive: + [self cancelCompletionDelayTimer]; + [self setNetworkActivityIndicatorVisible:YES]; + break; + case AFNetworkActivityManagerStateDelayingEnd: + [self startCompletionDelayTimer]; + break; + } + } + [self didChangeValueForKey:@"currentState"]; + } +} + +- (void)updateCurrentStateForNetworkActivityChange { + if (self.enabled) { + switch (self.currentState) { + case AFNetworkActivityManagerStateNotActive: + if (self.isNetworkActivityOccurring) { + [self setCurrentState:AFNetworkActivityManagerStateDelayingStart]; + } + break; + case AFNetworkActivityManagerStateDelayingStart: + //No op. Let the delay timer finish out. + break; + case AFNetworkActivityManagerStateActive: + if (!self.isNetworkActivityOccurring) { + [self setCurrentState:AFNetworkActivityManagerStateDelayingEnd]; + } + break; + case AFNetworkActivityManagerStateDelayingEnd: + if (self.isNetworkActivityOccurring) { + [self setCurrentState:AFNetworkActivityManagerStateActive]; + } + break; + } + } +} + +- (void)startActivationDelayTimer { + self.activationDelayTimer = [NSTimer + timerWithTimeInterval:self.activationDelay target:self selector:@selector(activationDelayTimerFired) userInfo:nil repeats:NO]; + [[NSRunLoop mainRunLoop] addTimer:self.activationDelayTimer forMode:NSRunLoopCommonModes]; +} + +- (void)activationDelayTimerFired { + if (self.networkActivityOccurring) { + [self setCurrentState:AFNetworkActivityManagerStateActive]; + } else { + [self setCurrentState:AFNetworkActivityManagerStateNotActive]; + } +} + +- (void)startCompletionDelayTimer { + [self.completionDelayTimer invalidate]; + self.completionDelayTimer = [NSTimer timerWithTimeInterval:self.completionDelay target:self selector:@selector(completionDelayTimerFired) userInfo:nil repeats:NO]; + [[NSRunLoop mainRunLoop] addTimer:self.completionDelayTimer forMode:NSRunLoopCommonModes]; +} + +- (void)completionDelayTimerFired { + [self setCurrentState:AFNetworkActivityManagerStateNotActive]; +} + +- (void)cancelActivationDelayTimer { + [self.activationDelayTimer invalidate]; +} + +- (void)cancelCompletionDelayTimer { + [self.completionDelayTimer invalidate]; +} + +@end + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h new file mode 100644 index 0000000..b6ef044 --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h @@ -0,0 +1,48 @@ +// UIActivityIndicatorView+AFNetworking.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +/** + This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a session task. + */ +@interface UIActivityIndicatorView (AFNetworking) + +///---------------------------------- +/// @name Animating for Session Tasks +///---------------------------------- + +/** + Binds the animating state to the state of the specified task. + + @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. + */ +- (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; + +@end + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m new file mode 100644 index 0000000..fcf1c0c --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m @@ -0,0 +1,124 @@ +// UIActivityIndicatorView+AFNetworking.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "UIActivityIndicatorView+AFNetworking.h" +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import "AFURLSessionManager.h" + +@interface AFActivityIndicatorViewNotificationObserver : NSObject +@property (readonly, nonatomic, weak) UIActivityIndicatorView *activityIndicatorView; +- (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView; + +- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task; + +@end + +@implementation UIActivityIndicatorView (AFNetworking) + +- (AFActivityIndicatorViewNotificationObserver *)af_notificationObserver { + AFActivityIndicatorViewNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); + if (notificationObserver == nil) { + notificationObserver = [[AFActivityIndicatorViewNotificationObserver alloc] initWithActivityIndicatorView:self]; + objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + return notificationObserver; +} + +- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { + [[self af_notificationObserver] setAnimatingWithStateOfTask:task]; +} + +@end + +@implementation AFActivityIndicatorViewNotificationObserver + +- (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView +{ + self = [super init]; + if (self) { + _activityIndicatorView = activityIndicatorView; + } + return self; +} + +- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + + [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; + + if (task) { + if (task.state != NSURLSessionTaskStateCompleted) { + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreceiver-is-weak" +#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" + if (task.state == NSURLSessionTaskStateRunning) { + [self.activityIndicatorView startAnimating]; + } else { + [self.activityIndicatorView stopAnimating]; + } +#pragma clang diagnostic pop + + [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingTaskDidResumeNotification object:task]; + [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidCompleteNotification object:task]; + [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidSuspendNotification object:task]; + } + } +} + +#pragma mark - + +- (void)af_startAnimating { + dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreceiver-is-weak" + [self.activityIndicatorView startAnimating]; +#pragma clang diagnostic pop + }); +} + +- (void)af_stopAnimating { + dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreceiver-is-weak" + [self.activityIndicatorView stopAnimating]; +#pragma clang diagnostic pop + }); +} + +#pragma mark - + +- (void)dealloc { + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + + [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; +} + +@end + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h new file mode 100644 index 0000000..98b911e --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h @@ -0,0 +1,175 @@ +// UIButton+AFNetworking.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class AFImageDownloader; + +/** + This category adds methods to the UIKit framework's `UIButton` class. The methods in this category provide support for loading remote images and background images asynchronously from a URL. + + @warning Compound values for control `state` (such as `UIControlStateHighlighted | UIControlStateDisabled`) are unsupported. + */ +@interface UIButton (AFNetworking) + +///------------------------------------ +/// @name Accessing the Image Downloader +///------------------------------------ + +/** + Set the shared image downloader used to download images. + + @param imageDownloader The shared image downloader used to download images. +*/ ++ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader; + +/** + The shared image downloader used to download images. + */ ++ (AFImageDownloader *)sharedImageDownloader; + +///-------------------- +/// @name Setting Image +///-------------------- + +/** + Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + @param state The control state. + @param url The URL used for the image request. + */ +- (void)setImageForState:(UIControlState)state + withURL:(NSURL *)url; + +/** + Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + @param state The control state. + @param url The URL used for the image request. + @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes. + */ +- (void)setImageForState:(UIControlState)state + withURL:(NSURL *)url + placeholderImage:(nullable UIImage *)placeholderImage; + +/** + Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setImage:forState:` is applied. + + @param state The control state. + @param urlRequest The URL request used for the image request. + @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + */ +- (void)setImageForState:(UIControlState)state + withURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(nullable UIImage *)placeholderImage + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + + +///------------------------------- +/// @name Setting Background Image +///------------------------------- + +/** + Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous background image request for the receiver will be cancelled. + + If the background image is cached locally, the background image is set immediately, otherwise the specified placeholder background image will be set immediately, and then the remote background image will be set once the request is finished. + + @param state The control state. + @param url The URL used for the background image request. + */ +- (void)setBackgroundImageForState:(UIControlState)state + withURL:(NSURL *)url; + +/** + Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + @param state The control state. + @param url The URL used for the background image request. + @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes. + */ +- (void)setBackgroundImageForState:(UIControlState)state + withURL:(NSURL *)url + placeholderImage:(nullable UIImage *)placeholderImage; + +/** + Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setBackgroundImage:forState:` is applied. + + @param state The control state. + @param urlRequest The URL request used for the image request. + @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + */ +- (void)setBackgroundImageForState:(UIControlState)state + withURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(nullable UIImage *)placeholderImage + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + + +///------------------------------ +/// @name Canceling Image Loading +///------------------------------ + +/** + Cancels any executing image task for the specified control state of the receiver, if one exists. + + @param state The control state. + */ +- (void)cancelImageDownloadTaskForState:(UIControlState)state; + +/** + Cancels any executing background image task for the specified control state of the receiver, if one exists. + + @param state The control state. + */ +- (void)cancelBackgroundImageDownloadTaskForState:(UIControlState)state; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m new file mode 100644 index 0000000..ceb6ebc --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m @@ -0,0 +1,305 @@ +// UIButton+AFNetworking.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "UIButton+AFNetworking.h" + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import "UIImageView+AFNetworking.h" +#import "AFImageDownloader.h" + +@interface UIButton (_AFNetworking) +@end + +@implementation UIButton (_AFNetworking) + +#pragma mark - + +static char AFImageDownloadReceiptNormal; +static char AFImageDownloadReceiptHighlighted; +static char AFImageDownloadReceiptSelected; +static char AFImageDownloadReceiptDisabled; + +static const char * af_imageDownloadReceiptKeyForState(UIControlState state) { + switch (state) { + case UIControlStateHighlighted: + return &AFImageDownloadReceiptHighlighted; + case UIControlStateSelected: + return &AFImageDownloadReceiptSelected; + case UIControlStateDisabled: + return &AFImageDownloadReceiptDisabled; + case UIControlStateNormal: + default: + return &AFImageDownloadReceiptNormal; + } +} + +- (AFImageDownloadReceipt *)af_imageDownloadReceiptForState:(UIControlState)state { + return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, af_imageDownloadReceiptKeyForState(state)); +} + +- (void)af_setImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt + forState:(UIControlState)state +{ + objc_setAssociatedObject(self, af_imageDownloadReceiptKeyForState(state), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +#pragma mark - + +static char AFBackgroundImageDownloadReceiptNormal; +static char AFBackgroundImageDownloadReceiptHighlighted; +static char AFBackgroundImageDownloadReceiptSelected; +static char AFBackgroundImageDownloadReceiptDisabled; + +static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState state) { + switch (state) { + case UIControlStateHighlighted: + return &AFBackgroundImageDownloadReceiptHighlighted; + case UIControlStateSelected: + return &AFBackgroundImageDownloadReceiptSelected; + case UIControlStateDisabled: + return &AFBackgroundImageDownloadReceiptDisabled; + case UIControlStateNormal: + default: + return &AFBackgroundImageDownloadReceiptNormal; + } +} + +- (AFImageDownloadReceipt *)af_backgroundImageDownloadReceiptForState:(UIControlState)state { + return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, af_backgroundImageDownloadReceiptKeyForState(state)); +} + +- (void)af_setBackgroundImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt + forState:(UIControlState)state +{ + objc_setAssociatedObject(self, af_backgroundImageDownloadReceiptKeyForState(state), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +@end + +#pragma mark - + +@implementation UIButton (AFNetworking) + ++ (AFImageDownloader *)sharedImageDownloader { + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance]; +#pragma clang diagnostic pop +} + ++ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader { + objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +#pragma mark - + +- (void)setImageForState:(UIControlState)state + withURL:(NSURL *)url +{ + [self setImageForState:state withURL:url placeholderImage:nil]; +} + +- (void)setImageForState:(UIControlState)state + withURL:(NSURL *)url + placeholderImage:(UIImage *)placeholderImage +{ + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; + [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; + + [self setImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; +} + +- (void)setImageForState:(UIControlState)state + withURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(nullable UIImage *)placeholderImage + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure +{ + if ([self isActiveTaskURLEqualToURLRequest:urlRequest forState:state]) { + return; + } + + [self cancelImageDownloadTaskForState:state]; + + AFImageDownloader *downloader = [[self class] sharedImageDownloader]; + id imageCache = downloader.imageCache; + + //Use the image from the image cache if it exists + UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; + if (cachedImage) { + if (success) { + success(urlRequest, nil, cachedImage); + } else { + [self setImage:cachedImage forState:state]; + } + [self af_setImageDownloadReceipt:nil forState:state]; + } else { + if (placeholderImage) { + [self setImage:placeholderImage forState:state]; + } + + __weak __typeof(self)weakSelf = self; + NSUUID *downloadID = [NSUUID UUID]; + AFImageDownloadReceipt *receipt; + receipt = [downloader + downloadImageForURLRequest:urlRequest + withReceiptID:downloadID + success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([[strongSelf af_imageDownloadReceiptForState:state].receiptID isEqual:downloadID]) { + if (success) { + success(request, response, responseObject); + } else if(responseObject) { + [strongSelf setImage:responseObject forState:state]; + } + [strongSelf af_setImageDownloadReceipt:nil forState:state]; + } + + } + failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([[strongSelf af_imageDownloadReceiptForState:state].receiptID isEqual:downloadID]) { + if (failure) { + failure(request, response, error); + } + [strongSelf af_setImageDownloadReceipt:nil forState:state]; + } + }]; + + [self af_setImageDownloadReceipt:receipt forState:state]; + } +} + +#pragma mark - + +- (void)setBackgroundImageForState:(UIControlState)state + withURL:(NSURL *)url +{ + [self setBackgroundImageForState:state withURL:url placeholderImage:nil]; +} + +- (void)setBackgroundImageForState:(UIControlState)state + withURL:(NSURL *)url + placeholderImage:(nullable UIImage *)placeholderImage +{ + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; + [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; + + [self setBackgroundImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; +} + +- (void)setBackgroundImageForState:(UIControlState)state + withURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(nullable UIImage *)placeholderImage + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure +{ + if ([self isActiveBackgroundTaskURLEqualToURLRequest:urlRequest forState:state]) { + return; + } + + [self cancelImageDownloadTaskForState:state]; + + AFImageDownloader *downloader = [[self class] sharedImageDownloader]; + id imageCache = downloader.imageCache; + + //Use the image from the image cache if it exists + UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; + if (cachedImage) { + if (success) { + success(urlRequest, nil, cachedImage); + } else { + [self setBackgroundImage:cachedImage forState:state]; + } + [self af_setBackgroundImageDownloadReceipt:nil forState:state]; + } else { + if (placeholderImage) { + [self setBackgroundImage:placeholderImage forState:state]; + } + + __weak __typeof(self)weakSelf = self; + NSUUID *downloadID = [NSUUID UUID]; + AFImageDownloadReceipt *receipt; + receipt = [downloader + downloadImageForURLRequest:urlRequest + withReceiptID:downloadID + success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([[strongSelf af_backgroundImageDownloadReceiptForState:state].receiptID isEqual:downloadID]) { + if (success) { + success(request, response, responseObject); + } else if(responseObject) { + [strongSelf setBackgroundImage:responseObject forState:state]; + } + [strongSelf af_setImageDownloadReceipt:nil forState:state]; + } + + } + failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([[strongSelf af_backgroundImageDownloadReceiptForState:state].receiptID isEqual:downloadID]) { + if (failure) { + failure(request, response, error); + } + [strongSelf af_setBackgroundImageDownloadReceipt:nil forState:state]; + } + }]; + + [self af_setBackgroundImageDownloadReceipt:receipt forState:state]; + } +} + +#pragma mark - + +- (void)cancelImageDownloadTaskForState:(UIControlState)state { + AFImageDownloadReceipt *receipt = [self af_imageDownloadReceiptForState:state]; + if (receipt != nil) { + [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:receipt]; + [self af_setImageDownloadReceipt:nil forState:state]; + } +} + +- (void)cancelBackgroundImageDownloadTaskForState:(UIControlState)state { + AFImageDownloadReceipt *receipt = [self af_backgroundImageDownloadReceiptForState:state]; + if (receipt != nil) { + [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:receipt]; + [self af_setBackgroundImageDownloadReceipt:nil forState:state]; + } +} + +- (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest forState:(UIControlState)state { + AFImageDownloadReceipt *receipt = [self af_imageDownloadReceiptForState:state]; + return [receipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; +} + +- (BOOL)isActiveBackgroundTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest forState:(UIControlState)state { + AFImageDownloadReceipt *receipt = [self af_backgroundImageDownloadReceiptForState:state]; + return [receipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; +} + + +@end + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h new file mode 100644 index 0000000..14744cd --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h @@ -0,0 +1,35 @@ +// +// UIImage+AFNetworking.h +// +// +// Created by Paulo Ferreira on 08/07/15. +// +// 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. + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +@interface UIImage (AFNetworking) + ++ (UIImage*) safeImageWithData:(NSData*)data; + +@end + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h new file mode 100644 index 0000000..ce9ae2e --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h @@ -0,0 +1,109 @@ +// UIImageView+AFNetworking.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class AFImageDownloader; + +/** + This category adds methods to the UIKit framework's `UIImageView` class. The methods in this category provide support for loading remote images asynchronously from a URL. + */ +@interface UIImageView (AFNetworking) + +///------------------------------------ +/// @name Accessing the Image Downloader +///------------------------------------ + +/** + Set the shared image downloader used to download images. + + @param imageDownloader The shared image downloader used to download images. + */ ++ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader; + +/** + The shared image downloader used to download images. + */ ++ (AFImageDownloader *)sharedImageDownloader; + +///-------------------- +/// @name Setting Image +///-------------------- + +/** + Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:` + + @param url The URL used for the image request. + */ +- (void)setImageWithURL:(NSURL *)url; + +/** + Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:` + + @param url The URL used for the image request. + @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes. + */ +- (void)setImageWithURL:(NSURL *)url + placeholderImage:(nullable UIImage *)placeholderImage; + +/** + Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is applied. + + @param urlRequest The URL request used for the image request. + @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + */ +- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(nullable UIImage *)placeholderImage + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + +/** + Cancels any executing image operation for the receiver, if one exists. + */ +- (void)cancelImageDownloadTask; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m new file mode 100644 index 0000000..a97d5cc --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m @@ -0,0 +1,161 @@ +// UIImageView+AFNetworking.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "UIImageView+AFNetworking.h" + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import "AFImageDownloader.h" + +@interface UIImageView (_AFNetworking) +@property (readwrite, nonatomic, strong, setter = af_setActiveImageDownloadReceipt:) AFImageDownloadReceipt *af_activeImageDownloadReceipt; +@end + +@implementation UIImageView (_AFNetworking) + +- (AFImageDownloadReceipt *)af_activeImageDownloadReceipt { + return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, @selector(af_activeImageDownloadReceipt)); +} + +- (void)af_setActiveImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt { + objc_setAssociatedObject(self, @selector(af_activeImageDownloadReceipt), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +@end + +#pragma mark - + +@implementation UIImageView (AFNetworking) + ++ (AFImageDownloader *)sharedImageDownloader { + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance]; +#pragma clang diagnostic pop +} + ++ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader { + objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +#pragma mark - + +- (void)setImageWithURL:(NSURL *)url { + [self setImageWithURL:url placeholderImage:nil]; +} + +- (void)setImageWithURL:(NSURL *)url + placeholderImage:(UIImage *)placeholderImage +{ + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; + [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; + + [self setImageWithURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; +} + +- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(UIImage *)placeholderImage + success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure +{ + + if ([urlRequest URL] == nil) { + [self cancelImageDownloadTask]; + self.image = placeholderImage; + return; + } + + if ([self isActiveTaskURLEqualToURLRequest:urlRequest]){ + return; + } + + [self cancelImageDownloadTask]; + + AFImageDownloader *downloader = [[self class] sharedImageDownloader]; + id imageCache = downloader.imageCache; + + //Use the image from the image cache if it exists + UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; + if (cachedImage) { + if (success) { + success(urlRequest, nil, cachedImage); + } else { + self.image = cachedImage; + } + [self clearActiveDownloadInformation]; + } else { + if (placeholderImage) { + self.image = placeholderImage; + } + + __weak __typeof(self)weakSelf = self; + NSUUID *downloadID = [NSUUID UUID]; + AFImageDownloadReceipt *receipt; + receipt = [downloader + downloadImageForURLRequest:urlRequest + withReceiptID:downloadID + success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) { + if (success) { + success(request, response, responseObject); + } else if(responseObject) { + strongSelf.image = responseObject; + } + [strongSelf clearActiveDownloadInformation]; + } + + } + failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) { + if (failure) { + failure(request, response, error); + } + [strongSelf clearActiveDownloadInformation]; + } + }]; + + self.af_activeImageDownloadReceipt = receipt; + } +} + +- (void)cancelImageDownloadTask { + if (self.af_activeImageDownloadReceipt != nil) { + [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:self.af_activeImageDownloadReceipt]; + [self clearActiveDownloadInformation]; + } +} + +- (void)clearActiveDownloadInformation { + self.af_activeImageDownloadReceipt = nil; +} + +- (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest { + return [self.af_activeImageDownloadReceipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; +} + +@end + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h new file mode 100644 index 0000000..b36ee0c --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h @@ -0,0 +1,42 @@ +// UIKit+AFNetworking.h +// +// Copyright (c) 2013 AFNetworking (http://afnetworking.com/) +// +// 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. + +#if TARGET_OS_IOS || TARGET_OS_TV +#import + +#ifndef _UIKIT_AFNETWORKING_ + #define _UIKIT_AFNETWORKING_ + +#if TARGET_OS_IOS + #import "AFAutoPurgingImageCache.h" + #import "AFImageDownloader.h" + #import "AFNetworkActivityIndicatorManager.h" + #import "UIRefreshControl+AFNetworking.h" + #import "UIWebView+AFNetworking.h" +#endif + + #import "UIActivityIndicatorView+AFNetworking.h" + #import "UIButton+AFNetworking.h" + #import "UIImageView+AFNetworking.h" + #import "UIProgressView+AFNetworking.h" +#endif /* _UIKIT_AFNETWORKING_ */ +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h new file mode 100644 index 0000000..a0c463b --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h @@ -0,0 +1,64 @@ +// UIProgressView+AFNetworking.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +NS_ASSUME_NONNULL_BEGIN + + +/** + This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task. + */ +@interface UIProgressView (AFNetworking) + +///------------------------------------ +/// @name Setting Session Task Progress +///------------------------------------ + +/** + Binds the progress to the upload progress of the specified session task. + + @param task The session task. + @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. + */ +- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task + animated:(BOOL)animated; + +/** + Binds the progress to the download progress of the specified session task. + + @param task The session task. + @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. + */ +- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task + animated:(BOOL)animated; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m new file mode 100644 index 0000000..6680bac --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m @@ -0,0 +1,118 @@ +// UIProgressView+AFNetworking.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "UIProgressView+AFNetworking.h" + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import "AFURLSessionManager.h" + +static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext; +static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext; + +#pragma mark - + +@implementation UIProgressView (AFNetworking) + +- (BOOL)af_uploadProgressAnimated { + return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_uploadProgressAnimated)) boolValue]; +} + +- (void)af_setUploadProgressAnimated:(BOOL)animated { + objc_setAssociatedObject(self, @selector(af_uploadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (BOOL)af_downloadProgressAnimated { + return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_downloadProgressAnimated)) boolValue]; +} + +- (void)af_setDownloadProgressAnimated:(BOOL)animated { + objc_setAssociatedObject(self, @selector(af_downloadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +#pragma mark - + +- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task + animated:(BOOL)animated +{ + [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; + [task addObserver:self forKeyPath:@"countOfBytesSent" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; + + [self af_setUploadProgressAnimated:animated]; +} + +- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task + animated:(BOOL)animated +{ + [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; + [task addObserver:self forKeyPath:@"countOfBytesReceived" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; + + [self af_setDownloadProgressAnimated:animated]; +} + +#pragma mark - NSKeyValueObserving + +- (void)observeValueForKeyPath:(NSString *)keyPath + ofObject:(id)object + change:(__unused NSDictionary *)change + context:(void *)context +{ + if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) { + if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) { + if ([object countOfBytesExpectedToSend] > 0) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self setProgress:[object countOfBytesSent] / ([object countOfBytesExpectedToSend] * 1.0f) animated:self.af_uploadProgressAnimated]; + }); + } + } + + if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) { + if ([object countOfBytesExpectedToReceive] > 0) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self setProgress:[object countOfBytesReceived] / ([object countOfBytesExpectedToReceive] * 1.0f) animated:self.af_downloadProgressAnimated]; + }); + } + } + + if ([keyPath isEqualToString:NSStringFromSelector(@selector(state))]) { + if ([(NSURLSessionTask *)object state] == NSURLSessionTaskStateCompleted) { + @try { + [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(state))]; + + if (context == AFTaskCountOfBytesSentContext) { + [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))]; + } + + if (context == AFTaskCountOfBytesReceivedContext) { + [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))]; + } + } + @catch (NSException * __unused exception) {} + } + } + } +} + +@end + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h new file mode 100644 index 0000000..f6930a9 --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h @@ -0,0 +1,53 @@ +// UIRefreshControl+AFNetworking.m +// +// Copyright (c) 2014 AFNetworking (http://afnetworking.com) +// +// 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. + +#import + +#import + +#if TARGET_OS_IOS + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a session task. + */ +@interface UIRefreshControl (AFNetworking) + +///----------------------------------- +/// @name Refreshing for Session Tasks +///----------------------------------- + +/** + Binds the refreshing state to the state of the specified task. + + @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. + */ +- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m new file mode 100644 index 0000000..ddc033b --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m @@ -0,0 +1,122 @@ +// UIRefreshControl+AFNetworking.m +// +// Copyright (c) 2014 AFNetworking (http://afnetworking.com) +// +// 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. + +#import "UIRefreshControl+AFNetworking.h" +#import + +#if TARGET_OS_IOS + +#import "AFURLSessionManager.h" + +@interface AFRefreshControlNotificationObserver : NSObject +@property (readonly, nonatomic, weak) UIRefreshControl *refreshControl; +- (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl; + +- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; + +@end + +@implementation UIRefreshControl (AFNetworking) + +- (AFRefreshControlNotificationObserver *)af_notificationObserver { + AFRefreshControlNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); + if (notificationObserver == nil) { + notificationObserver = [[AFRefreshControlNotificationObserver alloc] initWithActivityRefreshControl:self]; + objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + return notificationObserver; +} + +- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { + [[self af_notificationObserver] setRefreshingWithStateOfTask:task]; +} + +@end + +@implementation AFRefreshControlNotificationObserver + +- (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl +{ + self = [super init]; + if (self) { + _refreshControl = refreshControl; + } + return self; +} + +- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + + [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; + + if (task) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreceiver-is-weak" +#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" + if (task.state == NSURLSessionTaskStateRunning) { + [self.refreshControl beginRefreshing]; + + [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingTaskDidResumeNotification object:task]; + [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidCompleteNotification object:task]; + [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidSuspendNotification object:task]; + } else { + [self.refreshControl endRefreshing]; + } +#pragma clang diagnostic pop + } +} + +#pragma mark - + +- (void)af_beginRefreshing { + dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreceiver-is-weak" + [self.refreshControl beginRefreshing]; +#pragma clang diagnostic pop + }); +} + +- (void)af_endRefreshing { + dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreceiver-is-weak" + [self.refreshControl endRefreshing]; +#pragma clang diagnostic pop + }); +} + +#pragma mark - + +- (void)dealloc { + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + + [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; +} + +@end + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h new file mode 100644 index 0000000..777dce2 --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h @@ -0,0 +1,80 @@ +// UIWebView+AFNetworking.h +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import + +#import + +#if TARGET_OS_IOS + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class AFHTTPSessionManager; + +/** + This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling. + + @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly. + */ +@interface UIWebView (AFNetworking) + +/** + The session manager used to download all requests. + */ +@property (nonatomic, strong) AFHTTPSessionManager *sessionManager; + +/** + Asynchronously loads the specified request. + + @param request A URL request identifying the location of the content to load. This must not be `nil`. + @param progress A progress object monitoring the current download progress. + @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string. + @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. + */ +- (void)loadRequest:(NSURLRequest *)request + progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress + success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success + failure:(nullable void (^)(NSError *error))failure; + +/** + Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. + + @param request A URL request identifying the location of the content to load. This must not be `nil`. + @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. + @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. +@param progress A progress object monitoring the current download progress. + @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data. + @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. + */ +- (void)loadRequest:(NSURLRequest *)request + MIMEType:(nullable NSString *)MIMEType + textEncodingName:(nullable NSString *)textEncodingName + progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress + success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success + failure:(nullable void (^)(NSError *error))failure; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/Example/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m new file mode 100644 index 0000000..ac089da --- /dev/null +++ b/Example/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m @@ -0,0 +1,160 @@ +// UIWebView+AFNetworking.m +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) +// +// 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. + +#import "UIWebView+AFNetworking.h" + +#import + +#if TARGET_OS_IOS + +#import "AFHTTPSessionManager.h" +#import "AFURLResponseSerialization.h" +#import "AFURLRequestSerialization.h" + +@interface UIWebView (_AFNetworking) +@property (readwrite, nonatomic, strong, setter = af_setURLSessionTask:) NSURLSessionDataTask *af_URLSessionTask; +@end + +@implementation UIWebView (_AFNetworking) + +- (NSURLSessionDataTask *)af_URLSessionTask { + return (NSURLSessionDataTask *)objc_getAssociatedObject(self, @selector(af_URLSessionTask)); +} + +- (void)af_setURLSessionTask:(NSURLSessionDataTask *)af_URLSessionTask { + objc_setAssociatedObject(self, @selector(af_URLSessionTask), af_URLSessionTask, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +@end + +#pragma mark - + +@implementation UIWebView (AFNetworking) + +- (AFHTTPSessionManager *)sessionManager { + static AFHTTPSessionManager *_af_defaultHTTPSessionManager = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _af_defaultHTTPSessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]]; + _af_defaultHTTPSessionManager.requestSerializer = [AFHTTPRequestSerializer serializer]; + _af_defaultHTTPSessionManager.responseSerializer = [AFHTTPResponseSerializer serializer]; + }); + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + return objc_getAssociatedObject(self, @selector(sessionManager)) ?: _af_defaultHTTPSessionManager; +#pragma clang diagnostic pop +} + +- (void)setSessionManager:(AFHTTPSessionManager *)sessionManager { + objc_setAssociatedObject(self, @selector(sessionManager), sessionManager, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (AFHTTPResponseSerializer *)responseSerializer { + static AFHTTPResponseSerializer *_af_defaultResponseSerializer = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _af_defaultResponseSerializer = [AFHTTPResponseSerializer serializer]; + }); + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer; +#pragma clang diagnostic pop +} + +- (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer { + objc_setAssociatedObject(self, @selector(responseSerializer), responseSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +#pragma mark - + +- (void)loadRequest:(NSURLRequest *)request + progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress + success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success + failure:(void (^)(NSError *error))failure +{ + [self loadRequest:request MIMEType:nil textEncodingName:nil progress:progress success:^NSData *(NSHTTPURLResponse *response, NSData *data) { + NSStringEncoding stringEncoding = NSUTF8StringEncoding; + if (response.textEncodingName) { + CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName); + if (encoding != kCFStringEncodingInvalidId) { + stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding); + } + } + + NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding]; + if (success) { + string = success(response, string); + } + + return [string dataUsingEncoding:stringEncoding]; + } failure:failure]; +} + +- (void)loadRequest:(NSURLRequest *)request + MIMEType:(NSString *)MIMEType + textEncodingName:(NSString *)textEncodingName + progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress + success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success + failure:(void (^)(NSError *error))failure +{ + NSParameterAssert(request); + + if (self.af_URLSessionTask.state == NSURLSessionTaskStateRunning || self.af_URLSessionTask.state == NSURLSessionTaskStateSuspended) { + [self.af_URLSessionTask cancel]; + } + self.af_URLSessionTask = nil; + + __weak __typeof(self)weakSelf = self; + NSURLSessionDataTask *dataTask; + dataTask = [self.sessionManager + GET:request.URL.absoluteString + parameters:nil + progress:nil + success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) { + __strong __typeof(weakSelf) strongSelf = weakSelf; + if (success) { + success((NSHTTPURLResponse *)task.response, responseObject); + } + [strongSelf loadData:responseObject MIMEType:MIMEType textEncodingName:textEncodingName baseURL:[task.currentRequest URL]]; + + if ([strongSelf.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { + [strongSelf.delegate webViewDidFinishLoad:strongSelf]; + } + } + failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) { + if (failure) { + failure(error); + } + }]; + self.af_URLSessionTask = dataTask; + *progress = [self.sessionManager downloadProgressForTask:dataTask]; + [self.af_URLSessionTask resume]; + + if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { + [self.delegate webViewDidStartLoad:self]; + } +} + +@end + +#endif \ No newline at end of file diff --git a/Example/Pods/Expecta+Snapshots/EXPMatchers+FBSnapshotTest.h b/Example/Pods/Expecta+Snapshots/EXPMatchers+FBSnapshotTest.h new file mode 100644 index 0000000..547e1f6 --- /dev/null +++ b/Example/Pods/Expecta+Snapshots/EXPMatchers+FBSnapshotTest.h @@ -0,0 +1,22 @@ +// +// EXPMatchers+FBSnapshotTest.h +// Artsy +// +// Created by Daniel Doubrovkine on 1/14/14. +// Copyright (c) 2014 Artsy Inc. All rights reserved. +// + +#import +#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)); diff --git a/Example/Pods/Expecta+Snapshots/EXPMatchers+FBSnapshotTest.m b/Example/Pods/Expecta+Snapshots/EXPMatchers+FBSnapshotTest.m new file mode 100644 index 0000000..8ca877f --- /dev/null +++ b/Example/Pods/Expecta+Snapshots/EXPMatchers+FBSnapshotTest.m @@ -0,0 +1,319 @@ +// +// EXPMatchers+FBSnapshotTest.h +// Artsy +// +// Created by Daniel Doubrovkine on 1/14/14. +// Copyright (c) 2014 Artsy Inc. All rights reserved. +// + +#import "EXPMatchers+FBSnapshotTest.h" +#import +#import + +@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 + + + +// If you're bringing in Speca via CocoaPods +// use the test path to get the test's image file URL + +#if __has_include() +#import +#import +#import + +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; + + 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 *{ + 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 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 (!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 + +#else + +// If you don't have Speca stub the functions + +EXPMatcherImplementationBegin(haveValidSnapshot, (void)){ + + prerequisite(^BOOL{ + return NO; + }); + + failureMessageForTo(^NSString *{ + return @"you need Specta installed via CocoaPods to use haveValidSnapshot, use haveValidSnapshotNamed instead"; + }); + + failureMessageForNotTo(^NSString *{ + return @"you need Specta installed via CocoaPods to use haveValidSnapshot, use haveValidSnapshotNamed instead"; + }); +} +EXPMatcherImplementationEnd + + +EXPMatcherImplementationBegin(recordSnapshot, (void)) { + + prerequisite(^BOOL{ + return NO; + }); + + failureMessageForTo(^NSString *{ + return @"you need Specta installed via CocoaPods to use recordSnapshot, use recordSnapshotNamed instead"; + }); + + failureMessageForNotTo(^NSString *{ + return @"you need Specta installed via CocoaPods to use recordSnapshot, use recordSnapshotNamed instead"; + }); +} +EXPMatcherImplementationEnd + + +#endif + + + +EXPMatcherImplementationBegin(haveValidSnapshotNamed, (NSString *snapshot)){ + BOOL snapshotIsNil = (snapshot == nil); + __block NSError *error = nil; + + prerequisite(^BOOL{ + return !(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 *{ + 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 (!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 diff --git a/Example/Pods/Expecta+Snapshots/ExpectaObject+FBSnapshotTest.h b/Example/Pods/Expecta+Snapshots/ExpectaObject+FBSnapshotTest.h new file mode 100644 index 0000000..a3feec3 --- /dev/null +++ b/Example/Pods/Expecta+Snapshots/ExpectaObject+FBSnapshotTest.h @@ -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 + +@interface Expecta (FBSnapshotTest) + ++ (void)setUsesDrawViewHierarchyInRect:(BOOL)usesDrawViewHierarchyInRect; + ++ (BOOL)usesDrawViewHierarchyInRect; + +@end diff --git a/Example/Pods/Expecta+Snapshots/ExpectaObject+FBSnapshotTest.m b/Example/Pods/Expecta+Snapshots/ExpectaObject+FBSnapshotTest.m new file mode 100644 index 0000000..698447a --- /dev/null +++ b/Example/Pods/Expecta+Snapshots/ExpectaObject+FBSnapshotTest.m @@ -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 + +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 diff --git a/Example/Pods/Expecta+Snapshots/LICENSE.md b/Example/Pods/Expecta+Snapshots/LICENSE.md new file mode 100644 index 0000000..47c9a3d --- /dev/null +++ b/Example/Pods/Expecta+Snapshots/LICENSE.md @@ -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. diff --git a/Example/Pods/Expecta+Snapshots/README.md b/Example/Pods/Expecta+Snapshots/README.md new file mode 100644 index 0000000..07c5265 --- /dev/null +++ b/Example/Pods/Expecta+Snapshots/README.md @@ -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). + +[![Build Status](https://travis-ci.org/dblock/ios-snapshot-test-case-expecta.png)](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 +#include +#include +#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) diff --git a/Example/Pods/Expecta/Expecta/EXPBlockDefinedMatcher.h b/Example/Pods/Expecta/Expecta/EXPBlockDefinedMatcher.h new file mode 100644 index 0000000..58b1282 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/EXPBlockDefinedMatcher.h @@ -0,0 +1,25 @@ +// +// EXPRuntimeMatcher.h +// Expecta +// +// Created by Luke Redpath on 26/03/2012. +// Copyright (c) 2012 Peter Jihoon Kim. All rights reserved. +// + +#import +#import "EXPMatcher.h" +#import "EXPDefines.h" + +@interface EXPBlockDefinedMatcher : NSObject { + EXPBoolBlock prerequisiteBlock; + EXPBoolBlock matchBlock; + EXPStringBlock failureMessageForToBlock; + EXPStringBlock failureMessageForNotToBlock; +} + +@property(nonatomic, copy) EXPBoolBlock prerequisiteBlock; +@property(nonatomic, copy) EXPBoolBlock matchBlock; +@property(nonatomic, copy) EXPStringBlock failureMessageForToBlock; +@property(nonatomic, copy) EXPStringBlock failureMessageForNotToBlock; + +@end diff --git a/Example/Pods/Expecta/Expecta/EXPBlockDefinedMatcher.m b/Example/Pods/Expecta/Expecta/EXPBlockDefinedMatcher.m new file mode 100644 index 0000000..89bba37 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/EXPBlockDefinedMatcher.m @@ -0,0 +1,60 @@ +// +// EXPRuntimeMatcher.m +// Expecta +// +// Created by Luke Redpath on 26/03/2012. +// Copyright (c) 2012 Peter Jihoon Kim. All rights reserved. +// + +#import "EXPBlockDefinedMatcher.h" + +@implementation EXPBlockDefinedMatcher + +- (void)dealloc +{ + self.prerequisiteBlock = nil; + self.matchBlock = nil; + self.failureMessageForToBlock = nil; + self.failureMessageForNotToBlock = nil; + + [super dealloc]; +} + +@synthesize prerequisiteBlock; +@synthesize matchBlock; +@synthesize failureMessageForToBlock; +@synthesize failureMessageForNotToBlock; + +- (BOOL)meetsPrerequesiteFor:(id)actual +{ + if (self.prerequisiteBlock) { + return self.prerequisiteBlock(); + } + return YES; +} + +- (BOOL)matches:(id)actual +{ + if (self.matchBlock) { + return self.matchBlock(); + } + return YES; +} + +- (NSString *)failureMessageForTo:(id)actual +{ + if (self.failureMessageForToBlock) { + return self.failureMessageForToBlock(); + } + return nil; +} + +- (NSString *)failureMessageForNotTo:(id)actual +{ + if (self.failureMessageForNotToBlock) { + return self.failureMessageForNotToBlock(); + } + return nil; +} + +@end diff --git a/Example/Pods/Expecta/Expecta/EXPDefines.h b/Example/Pods/Expecta/Expecta/EXPDefines.h new file mode 100644 index 0000000..52af721 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/EXPDefines.h @@ -0,0 +1,17 @@ +// +// EXPDefines.h +// Expecta +// +// Created by Luke Redpath on 26/03/2012. +// Copyright (c) 2012 Peter Jihoon Kim. All rights reserved. +// + +#ifndef Expecta_EXPDefines_h +#define Expecta_EXPDefines_h + +typedef void (^EXPBasicBlock)(); +typedef id (^EXPIdBlock)(); +typedef BOOL (^EXPBoolBlock)(); +typedef NSString *(^EXPStringBlock)(); + +#endif diff --git a/Example/Pods/Expecta/Expecta/EXPDoubleTuple.h b/Example/Pods/Expecta/Expecta/EXPDoubleTuple.h new file mode 100644 index 0000000..4bd231c --- /dev/null +++ b/Example/Pods/Expecta/Expecta/EXPDoubleTuple.h @@ -0,0 +1,13 @@ +#import + +@interface EXPDoubleTuple : NSObject { + double *_values; + size_t _size; +} + +@property (nonatomic, assign) double *values; +@property (nonatomic, assign) size_t size; + +- (instancetype)initWithDoubleValues:(double *)values size:(size_t)size NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Example/Pods/Expecta/Expecta/EXPDoubleTuple.m b/Example/Pods/Expecta/Expecta/EXPDoubleTuple.m new file mode 100644 index 0000000..9ebef50 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/EXPDoubleTuple.m @@ -0,0 +1,45 @@ +#import "EXPDoubleTuple.h" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wobjc-designated-initializers" +@implementation EXPDoubleTuple +#pragma clang diagnostic pop + +@synthesize values = _values, size = _size; + +- (instancetype)initWithDoubleValues:(double *)values size:(size_t)size { + if ((self = [super init])) { + self.values = malloc(sizeof(double) * size); + memcpy(self.values, values, sizeof(double) * size); + self.size = size; + } + return self; +} + +- (void)dealloc { + free(self.values); + [super dealloc]; +} + +- (BOOL)isEqual:(id)object { + if (![object isKindOfClass:[EXPDoubleTuple class]]) return NO; + EXPDoubleTuple *other = (EXPDoubleTuple *)object; + if (self.size == other.size) { + for (int i = 0; i < self.size; ++i) { + if (self.values[i] != other.values[i]) return NO; + } + return YES; + } + return NO; +} + +- (NSString *)description { + if (self.size == 2) { + return [NSString stringWithFormat:@"Double tuple: {%f, %f}", self.values[0], self.values[1]]; + } else if (self.size == 4) { + return [NSString stringWithFormat:@"Double tuple: {%f, %f, %f, %f}", self.values[0], self.values[1], self.values[2], self.values[3]]; + } + return [NSString stringWithFormat:@"Double tuple of unexpected size %zd, sadly", self.size]; +} + +@end diff --git a/Example/Pods/Expecta/Expecta/EXPExpect.h b/Example/Pods/Expecta/Expecta/EXPExpect.h new file mode 100644 index 0000000..985c120 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/EXPExpect.h @@ -0,0 +1,45 @@ +#import +#import "EXPMatcher.h" +#import "EXPDefines.h" + +@interface EXPExpect : NSObject { + EXPIdBlock _actualBlock; + id _testCase; + int _lineNumber; + char *_fileName; + BOOL _negative; + BOOL _asynchronous; + NSTimeInterval _timeout; +} + +@property(nonatomic, copy) EXPIdBlock actualBlock; +@property(nonatomic, readonly) id actual; +@property(nonatomic, assign) id testCase; +@property(nonatomic) int lineNumber; +@property(nonatomic) const char *fileName; +@property(nonatomic) BOOL negative; +@property(nonatomic) BOOL asynchronous; +@property(nonatomic) NSTimeInterval timeout; + +@property(nonatomic, readonly) EXPExpect *to; +@property(nonatomic, readonly) EXPExpect *toNot; +@property(nonatomic, readonly) EXPExpect *notTo; +@property(nonatomic, readonly) EXPExpect *will; +@property(nonatomic, readonly) EXPExpect *willNot; +@property(nonatomic, readonly) EXPExpect *(^after)(NSTimeInterval timeInterval); + +- (instancetype)initWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName NS_DESIGNATED_INITIALIZER; ++ (EXPExpect *)expectWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName; + +- (void)applyMatcher:(id)matcher; +- (void)applyMatcher:(id)matcher to:(NSObject **)actual; + +@end + +@interface EXPDynamicPredicateMatcher : NSObject { + EXPExpect *_expectation; + SEL _selector; +} +- (instancetype)initWithExpectation:(EXPExpect *)expectation selector:(SEL)selector NS_DESIGNATED_INITIALIZER; +@property (nonatomic, readonly, copy) void (^dispatch)(void); +@end diff --git a/Example/Pods/Expecta/Expecta/EXPExpect.m b/Example/Pods/Expecta/Expecta/EXPExpect.m new file mode 100644 index 0000000..230e137 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/EXPExpect.m @@ -0,0 +1,221 @@ +#import "EXPExpect.h" +#import "NSObject+Expecta.h" +#import "Expecta.h" +#import "EXPUnsupportedObject.h" +#import "EXPMatcher.h" +#import "EXPBlockDefinedMatcher.h" +#import + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wobjc-designated-initializers" +@implementation EXPExpect +#pragma clang diagnostic pop + +@dynamic + actual, + to, + toNot, + notTo, + will, + willNot, + after; + +@synthesize + actualBlock=_actualBlock, + testCase=_testCase, + negative=_negative, + asynchronous=_asynchronous, + timeout=_timeout, + lineNumber=_lineNumber, + fileName=_fileName; + +- (instancetype)initWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName { + self = [super init]; + if(self) { + self.actualBlock = actualBlock; + self.testCase = testCase; + self.negative = NO; + self.asynchronous = NO; + self.timeout = [Expecta asynchronousTestTimeout]; + self.lineNumber = lineNumber; + self.fileName = fileName; + } + return self; +} + +- (void)dealloc +{ + [_actualBlock release]; + _actualBlock = nil; + [super dealloc]; +} + ++ (EXPExpect *)expectWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName { + return [[[EXPExpect alloc] initWithActualBlock:actualBlock testCase:(id)testCase lineNumber:lineNumber fileName:fileName] autorelease]; +} + +#pragma mark - + +- (EXPExpect *)to { + return self; +} + +- (EXPExpect *)toNot { + self.negative = !self.negative; + return self; +} + +- (EXPExpect *)notTo { + return [self toNot]; +} + +- (EXPExpect *)will { + self.asynchronous = YES; + return self; +} + +- (EXPExpect *)willNot { + return self.will.toNot; +} + +- (EXPExpect *(^)(NSTimeInterval))after +{ + EXPExpect * (^block)(NSTimeInterval) = [^EXPExpect *(NSTimeInterval timeout) { + self.asynchronous = YES; + self.timeout = timeout; + return self; + } copy]; + + return [block autorelease]; +} + +#pragma mark - + +- (id)actual { + if(self.actualBlock) { + return self.actualBlock(); + } + return nil; +} + +- (void)applyMatcher:(id)matcher +{ + id actual = [self actual]; + [self applyMatcher:matcher to:&actual]; +} + +- (void)applyMatcher:(id)matcher to:(NSObject **)actual { + if([*actual isKindOfClass:[EXPUnsupportedObject class]]) { + EXPFail(self.testCase, self.lineNumber, self.fileName, + [NSString stringWithFormat:@"expecting a %@ is not supported", ((EXPUnsupportedObject *)*actual).type]); + } else { + BOOL failed = NO; + if([matcher respondsToSelector:@selector(meetsPrerequesiteFor:)] && + ![matcher meetsPrerequesiteFor:*actual]) { + failed = YES; + } else { + BOOL matchResult = NO; + if(self.asynchronous) { + NSTimeInterval timeOut = self.timeout; + NSDate *expiryDate = [NSDate dateWithTimeIntervalSinceNow:timeOut]; + while(1) { + matchResult = [matcher matches:*actual]; + failed = self.negative ? matchResult : !matchResult; + if(!failed || ([(NSDate *)[NSDate date] compare:expiryDate] == NSOrderedDescending)) { + break; + } + [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.01]]; + OSMemoryBarrier(); + *actual = self.actual; + } + } else { + matchResult = [matcher matches:*actual]; + } + failed = self.negative ? matchResult : !matchResult; + } + if(failed) { + NSString *message = nil; + + if(self.negative) { + if ([matcher respondsToSelector:@selector(failureMessageForNotTo:)]) { + message = [matcher failureMessageForNotTo:*actual]; + } + } else { + if ([matcher respondsToSelector:@selector(failureMessageForTo:)]) { + message = [matcher failureMessageForTo:*actual]; + } + } + if (message == nil) { + message = @"Match Failed."; + } + + EXPFail(self.testCase, self.lineNumber, self.fileName, message); + } + } + self.negative = NO; +} + +#pragma mark - Dynamic predicate dispatch + +- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector +{ + if ([self.actual respondsToSelector:aSelector]) { + return [self.actual methodSignatureForSelector:aSelector]; + } + return [super methodSignatureForSelector:aSelector]; +} + +- (void)forwardInvocation:(NSInvocation *)anInvocation +{ + if ([self.actual respondsToSelector:anInvocation.selector]) { + EXPDynamicPredicateMatcher *matcher = [[EXPDynamicPredicateMatcher alloc] initWithExpectation:self selector:anInvocation.selector]; + [anInvocation setSelector:@selector(dispatch)]; + [anInvocation invokeWithTarget:matcher]; + [matcher release]; + } + else { + [super forwardInvocation:anInvocation]; + } +} + +@end + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wobjc-designated-initializers" +@implementation EXPDynamicPredicateMatcher +#pragma clang diagnostic pop + +- (instancetype)initWithExpectation:(EXPExpect *)expectation selector:(SEL)selector +{ + if ((self = [super init])) { + _expectation = expectation; + _selector = selector; + } + return self; +} + +- (BOOL)matches:(id)actual +{ + return (BOOL)[actual performSelector:_selector]; +} + +- (NSString *)failureMessageForTo:(id)actual +{ + return [NSString stringWithFormat:@"expected %@ to be true", NSStringFromSelector(_selector)]; +} + +- (NSString *)failureMessageForNotTo:(id)actual +{ + return [NSString stringWithFormat:@"expected %@ to be false", NSStringFromSelector(_selector)]; +} + +- (void (^)(void))dispatch +{ + __block id blockExpectation = _expectation; + + return [[^{ + [blockExpectation applyMatcher:self]; + } copy] autorelease]; +} + +@end diff --git a/Example/Pods/Expecta/Expecta/EXPFloatTuple.h b/Example/Pods/Expecta/Expecta/EXPFloatTuple.h new file mode 100644 index 0000000..ea8ee81 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/EXPFloatTuple.h @@ -0,0 +1,13 @@ +#import + +@interface EXPFloatTuple : NSObject { + float *_values; + size_t _size; +} + +@property (nonatomic, assign) float *values; +@property (nonatomic, assign) size_t size; + +- (instancetype)initWithFloatValues:(float *)values size:(size_t)size NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Example/Pods/Expecta/Expecta/EXPFloatTuple.m b/Example/Pods/Expecta/Expecta/EXPFloatTuple.m new file mode 100644 index 0000000..b7ccf08 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/EXPFloatTuple.m @@ -0,0 +1,55 @@ +#import "EXPFloatTuple.h" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wobjc-designated-initializers" +@implementation EXPFloatTuple +#pragma clang diagnostic pop + +@synthesize values = _values, size = _size; + +- (instancetype)initWithFloatValues:(float *)values size:(size_t)size { + if ((self = [super init])) { + self.values = malloc(sizeof(float) * size); + memcpy(self.values, values, sizeof(float) * size); + self.size = size; + } + return self; +} + +- (void)dealloc { + free(self.values); + [super dealloc]; +} + +- (BOOL)isEqual:(id)object { + if (![object isKindOfClass:[EXPFloatTuple class]]) return NO; + EXPFloatTuple *other = (EXPFloatTuple *)object; + if (self.size == other.size) { + for (int i = 0; i < self.size; ++i) { + if (self.values[i] != other.values[i]) return NO; + } + return YES; + } + return NO; +} + +- (NSUInteger)hash +{ + NSUInteger prime = 31; + NSUInteger hash = 0; + for (int i=0; i + +@protocol EXPMatcher + +- (BOOL)matches:(id)actual; + +@optional +- (BOOL)meetsPrerequesiteFor:(id)actual; +- (NSString *)failureMessageForTo:(id)actual; +- (NSString *)failureMessageForNotTo:(id)actual; + +@end diff --git a/Example/Pods/Expecta/Expecta/EXPUnsupportedObject.h b/Example/Pods/Expecta/Expecta/EXPUnsupportedObject.h new file mode 100644 index 0000000..3ad0561 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/EXPUnsupportedObject.h @@ -0,0 +1,11 @@ +#import + +@interface EXPUnsupportedObject : NSObject { + NSString *_type; +} + +@property (nonatomic, retain) NSString *type; + +- (instancetype)initWithType:(NSString *)type NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Example/Pods/Expecta/Expecta/EXPUnsupportedObject.m b/Example/Pods/Expecta/Expecta/EXPUnsupportedObject.m new file mode 100644 index 0000000..3d062e3 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/EXPUnsupportedObject.m @@ -0,0 +1,23 @@ +#import "EXPUnsupportedObject.h" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wobjc-designated-initializers" +@implementation EXPUnsupportedObject +#pragma clang diagnostic pop + +@synthesize type=_type; + +- (instancetype)initWithType:(NSString *)type { + self = [super init]; + if(self) { + self.type = type; + } + return self; +} + +- (void)dealloc { + self.type = nil; + [super dealloc]; +} + +@end diff --git a/Example/Pods/Expecta/Expecta/Expecta.h b/Example/Pods/Expecta/Expecta/Expecta.h new file mode 100644 index 0000000..066e988 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Expecta.h @@ -0,0 +1,15 @@ +#import + +//! Project version number for Expecta. +FOUNDATION_EXPORT double ExpectaVersionNumber; + +//! Project version string for Expecta. +FOUNDATION_EXPORT const unsigned char ExpectaVersionString[]; + +#import +#import +#import + +// Enable shorthand by default +#define expect(...) EXP_expect((__VA_ARGS__)) +#define failure(...) EXP_failure((__VA_ARGS__)) diff --git a/Example/Pods/Expecta/Expecta/ExpectaObject.h b/Example/Pods/Expecta/Expecta/ExpectaObject.h new file mode 100644 index 0000000..e4277a9 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/ExpectaObject.h @@ -0,0 +1,18 @@ +#import + +#define EXPObjectify(value) _EXPObjectify(@encode(__typeof__((value))), (value)) +#define EXP_expect(actual) _EXP_expect(self, __LINE__, __FILE__, ^id{ __typeof__((actual)) strongActual = (actual); return EXPObjectify(strongActual); }) +#define EXPMatcherInterface(matcherName, matcherArguments) _EXPMatcherInterface(matcherName, matcherArguments) +#define EXPMatcherImplementationBegin(matcherName, matcherArguments) _EXPMatcherImplementationBegin(matcherName, matcherArguments) +#define EXPMatcherImplementationEnd _EXPMatcherImplementationEnd +#define EXPMatcherAliasImplementation(newMatcherName, oldMatcherName, matcherArguments) _EXPMatcherAliasImplementation(newMatcherName, oldMatcherName, matcherArguments) + +#define EXP_failure(message) EXPFail(self, __LINE__, __FILE__, message) + + +@interface Expecta : NSObject + ++ (NSTimeInterval)asynchronousTestTimeout; ++ (void)setAsynchronousTestTimeout:(NSTimeInterval)timeout; + +@end diff --git a/Example/Pods/Expecta/Expecta/ExpectaObject.m b/Example/Pods/Expecta/Expecta/ExpectaObject.m new file mode 100644 index 0000000..b51e00a --- /dev/null +++ b/Example/Pods/Expecta/Expecta/ExpectaObject.m @@ -0,0 +1,15 @@ +#import "ExpectaObject.h" + +@implementation Expecta + +static NSTimeInterval _asynchronousTestTimeout = 1.0; + ++ (NSTimeInterval)asynchronousTestTimeout { + return _asynchronousTestTimeout; +} + ++ (void)setAsynchronousTestTimeout:(NSTimeInterval)timeout { + _asynchronousTestTimeout = timeout; +} + +@end \ No newline at end of file diff --git a/Example/Pods/Expecta/Expecta/ExpectaSupport.h b/Example/Pods/Expecta/Expecta/ExpectaSupport.h new file mode 100644 index 0000000..28fc5e0 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/ExpectaSupport.h @@ -0,0 +1,74 @@ +#import "EXPExpect.h" +#import "EXPBlockDefinedMatcher.h" + +#ifdef __cplusplus +extern "C" { +#endif + +id _EXPObjectify(const char *type, ...); +EXPExpect *_EXP_expect(id testCase, int lineNumber, const char *fileName, EXPIdBlock actualBlock); + +void EXPFail(id testCase, int lineNumber, const char *fileName, NSString *message); +NSString *EXPDescribeObject(id obj); + +void EXP_prerequisite(EXPBoolBlock block); +void EXP_match(EXPBoolBlock block); +void EXP_failureMessageForTo(EXPStringBlock block); +void EXP_failureMessageForNotTo(EXPStringBlock block); + +#if __has_feature(objc_arc) +#define _EXP_release(x) +#define _EXP_autorelease(x) (x) + +#else +#define _EXP_release(x) [x release] +#define _EXP_autorelease(x) [x autorelease] +#endif + +// workaround for the categories bug: http://developer.apple.com/library/mac/#qa/qa1490/_index.html +#define EXPFixCategoriesBug(name) \ +__attribute__((constructor)) static void EXPFixCategoriesBug##name() {} + +#define _EXPMatcherInterface(matcherName, matcherArguments) \ +@interface EXPExpect (matcherName##Matcher) \ +@property (nonatomic, readonly) void(^ matcherName) matcherArguments; \ +@end + +#define _EXPMatcherImplementationBegin(matcherName, matcherArguments) \ +EXPFixCategoriesBug(EXPMatcher##matcherName##Matcher); \ +@implementation EXPExpect (matcherName##Matcher) \ +@dynamic matcherName;\ +- (void(^) matcherArguments) matcherName { \ + EXPBlockDefinedMatcher *matcher = [[EXPBlockDefinedMatcher alloc] init]; \ + [[[NSThread currentThread] threadDictionary] setObject:matcher forKey:@"EXP_currentMatcher"]; \ + __block id actual = self.actual; \ + __block void (^prerequisite)(EXPBoolBlock block) = ^(EXPBoolBlock block) { EXP_prerequisite(block); }; \ + __block void (^match)(EXPBoolBlock block) = ^(EXPBoolBlock block) { EXP_match(block); }; \ + __block void (^failureMessageForTo)(EXPStringBlock block) = ^(EXPStringBlock block) { EXP_failureMessageForTo(block); }; \ + __block void (^failureMessageForNotTo)(EXPStringBlock block) = ^(EXPStringBlock block) { EXP_failureMessageForNotTo(block); }; \ + prerequisite(nil); match(nil); failureMessageForTo(nil); failureMessageForNotTo(nil); \ + void (^matcherBlock) matcherArguments = [^ matcherArguments { \ + { + +#define _EXPMatcherImplementationEnd \ + } \ + [self applyMatcher:matcher to:&actual]; \ + [[[NSThread currentThread] threadDictionary] removeObjectForKey:@"EXP_currentMatcher"]; \ + } copy]; \ + _EXP_release(matcher); \ + return _EXP_autorelease(matcherBlock); \ +} \ +@end + +#define _EXPMatcherAliasImplementation(newMatcherName, oldMatcherName, matcherArguments) \ +EXPFixCategoriesBug(EXPMatcher##newMatcherName##Matcher); \ +@implementation EXPExpect (newMatcherName##Matcher) \ +@dynamic newMatcherName;\ +- (void(^) matcherArguments) newMatcherName { \ + return [self oldMatcherName]; \ +}\ +@end + +#ifdef __cplusplus +} +#endif diff --git a/Example/Pods/Expecta/Expecta/ExpectaSupport.m b/Example/Pods/Expecta/Expecta/ExpectaSupport.m new file mode 100644 index 0000000..8abe415 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/ExpectaSupport.m @@ -0,0 +1,176 @@ +#import "ExpectaSupport.h" +#import "NSValue+Expecta.h" +#import "NSObject+Expecta.h" +#import "EXPUnsupportedObject.h" +#import "EXPFloatTuple.h" +#import "EXPDoubleTuple.h" +#import "EXPDefines.h" +#import + +@interface NSObject (ExpectaXCTestRecordFailure) + +// suppress warning +- (void)recordFailureWithDescription:(NSString *)description inFile:(NSString *)filename atLine:(NSUInteger)lineNumber expected:(BOOL)expected; + +@end + +id _EXPObjectify(const char *type, ...) { + va_list v; + va_start(v, type); + id obj = nil; + if(strcmp(type, @encode(char)) == 0) { + char actual = (char)va_arg(v, int); + obj = @(actual); + } else if(strcmp(type, @encode(_Bool)) == 0) { + _Static_assert(sizeof(_Bool) <= sizeof(int), "Expected _Bool to be subject to vararg type promotion"); + _Bool actual = (_Bool)va_arg(v, int); + obj = @(actual); + } else if(strcmp(type, @encode(double)) == 0) { + double actual = (double)va_arg(v, double); + obj = @(actual); + } else if(strcmp(type, @encode(float)) == 0) { + float actual = (float)va_arg(v, double); + obj = @(actual); + } else if(strcmp(type, @encode(int)) == 0) { + int actual = (int)va_arg(v, int); + obj = @(actual); + } else if(strcmp(type, @encode(long)) == 0) { + long actual = (long)va_arg(v, long); + obj = @(actual); + } else if(strcmp(type, @encode(long long)) == 0) { + long long actual = (long long)va_arg(v, long long); + obj = @(actual); + } else if(strcmp(type, @encode(short)) == 0) { + short actual = (short)va_arg(v, int); + obj = @(actual); + } else if(strcmp(type, @encode(unsigned char)) == 0) { + unsigned char actual = (unsigned char)va_arg(v, unsigned int); + obj = @(actual); + } else if(strcmp(type, @encode(unsigned int)) == 0) { + unsigned int actual = (int)va_arg(v, unsigned int); + obj = @(actual); + } else if(strcmp(type, @encode(unsigned long)) == 0) { + unsigned long actual = (unsigned long)va_arg(v, unsigned long); + obj = @(actual); + } else if(strcmp(type, @encode(unsigned long long)) == 0) { + unsigned long long actual = (unsigned long long)va_arg(v, unsigned long long); + obj = @(actual); + } else if(strcmp(type, @encode(unsigned short)) == 0) { + unsigned short actual = (unsigned short)va_arg(v, unsigned int); + obj = @(actual); + } else if(strstr(type, @encode(EXPBasicBlock)) != NULL) { + // @encode(EXPBasicBlock) returns @? as of clang 4.1. + // This condition must occur before the test for id/class type, + // otherwise blocks will be treated as vanilla objects. + id actual = va_arg(v, EXPBasicBlock); + obj = [[actual copy] autorelease]; + } else if((strstr(type, @encode(id)) != NULL) || (strstr(type, @encode(Class)) != 0)) { + id actual = va_arg(v, id); + obj = actual; + } else if(strcmp(type, @encode(__typeof__(nil))) == 0) { + obj = nil; + } else if(strstr(type, "ff}{") != NULL) { //TODO: of course this only works for a 2x2 e.g. CGRect + obj = [[[EXPFloatTuple alloc] initWithFloatValues:(float *)va_arg(v, float[4]) size:4] autorelease]; + } else if(strstr(type, "=ff}") != NULL) { + obj = [[[EXPFloatTuple alloc] initWithFloatValues:(float *)va_arg(v, float[2]) size:2] autorelease]; + } else if(strstr(type, "=ffff}") != NULL) { + obj = [[[EXPFloatTuple alloc] initWithFloatValues:(float *)va_arg(v, float[4]) size:4] autorelease]; + } else if(strstr(type, "dd}{") != NULL) { //TODO: same here + obj = [[[EXPDoubleTuple alloc] initWithDoubleValues:(double *)va_arg(v, double[4]) size:4] autorelease]; + } else if(strstr(type, "=dd}") != NULL) { + obj = [[[EXPDoubleTuple alloc] initWithDoubleValues:(double *)va_arg(v, double[2]) size:2] autorelease]; + } else if(strstr(type, "=dddd}") != NULL) { + obj = [[[EXPDoubleTuple alloc] initWithDoubleValues:(double *)va_arg(v, double[4]) size:4] autorelease]; + } else if(type[0] == '{') { + EXPUnsupportedObject *actual = [[[EXPUnsupportedObject alloc] initWithType:@"struct"] autorelease]; + obj = actual; + } else if(type[0] == '(') { + EXPUnsupportedObject *actual = [[[EXPUnsupportedObject alloc] initWithType:@"union"] autorelease]; + obj = actual; + } else { + void *actual = va_arg(v, void *); + obj = (actual == NULL ? nil :[NSValue valueWithPointer:actual]); + } + if([obj isKindOfClass:[NSValue class]] && ![obj isKindOfClass:[NSNumber class]]) { + [(NSValue *)obj set_EXP_objCType:type]; + } + va_end(v); + return obj; +} + +EXPExpect *_EXP_expect(id testCase, int lineNumber, const char *fileName, EXPIdBlock actualBlock) { + return [EXPExpect expectWithActualBlock:actualBlock testCase:testCase lineNumber:lineNumber fileName:fileName]; +} + +void EXPFail(id testCase, int lineNumber, const char *fileName, NSString *message) { + NSLog(@"%s:%d %@", fileName, lineNumber, message); + NSString *reason = [NSString stringWithFormat:@"%s:%d %@", fileName, lineNumber, message]; + NSException *exception = [NSException exceptionWithName:@"Expecta Error" reason:reason userInfo:nil]; + + if(testCase && [testCase respondsToSelector:@selector(recordFailureWithDescription:inFile:atLine:expected:)]){ + [testCase recordFailureWithDescription:message + inFile:@(fileName) + atLine:lineNumber + expected:NO]; + } else { + [exception raise]; + } +} + +NSString *EXPDescribeObject(id obj) { + if(obj == nil) { + return @"nil/null"; + } else if([obj isKindOfClass:[NSValue class]] && ![obj isKindOfClass:[NSNumber class]]) { + const char *type = [(NSValue *)obj _EXP_objCType]; + if(type) { + if(strcmp(type, @encode(SEL)) == 0) { + return [NSString stringWithFormat:@"@selector(%@)", NSStringFromSelector([obj pointerValue])]; + } else if(strcmp(type, @encode(Class)) == 0) { + return NSStringFromClass([obj pointerValue]); + } + } + } + NSString *description = [obj description]; + if([obj isKindOfClass:[NSArray class]]) { + NSMutableArray *arr = [NSMutableArray arrayWithCapacity:[obj count]]; + for(id o in obj) { + [arr addObject:EXPDescribeObject(o)]; + } + description = [NSString stringWithFormat:@"(%@)", [arr componentsJoinedByString:@", "]]; + } else if([obj isKindOfClass:[NSSet class]] || [obj isKindOfClass:[NSOrderedSet class]]) { + NSMutableArray *arr = [NSMutableArray arrayWithCapacity:[obj count]]; + for(id o in obj) { + [arr addObject:EXPDescribeObject(o)]; + } + description = [NSString stringWithFormat:@"{(%@)}", [arr componentsJoinedByString:@", "]]; + } else if([obj isKindOfClass:[NSDictionary class]]) { + NSMutableArray *arr = [NSMutableArray arrayWithCapacity:[obj count]]; + for(id k in obj) { + id v = obj[k]; + [arr addObject:[NSString stringWithFormat:@"%@ = %@;",EXPDescribeObject(k), EXPDescribeObject(v)]]; + } + description = [NSString stringWithFormat:@"{%@}", [arr componentsJoinedByString:@" "]]; + } else if([obj isKindOfClass:[NSAttributedString class]]) { + description = [obj string]; + } else { + description = [description stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"]; + } + return description; +} + +void EXP_prerequisite(EXPBoolBlock block) { + [[[NSThread currentThread] threadDictionary][@"EXP_currentMatcher"] setPrerequisiteBlock:block]; +} + +void EXP_match(EXPBoolBlock block) { + [[[NSThread currentThread] threadDictionary][@"EXP_currentMatcher"] setMatchBlock:block]; +} + +void EXP_failureMessageForTo(EXPStringBlock block) { + [[[NSThread currentThread] threadDictionary][@"EXP_currentMatcher"] setFailureMessageForToBlock:block]; +} + +void EXP_failureMessageForNotTo(EXPStringBlock block) { + [[[NSThread currentThread] threadDictionary][@"EXP_currentMatcher"] setFailureMessageForNotToBlock:block]; +} + diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatcherHelpers.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatcherHelpers.h new file mode 100644 index 0000000..5780ff6 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatcherHelpers.h @@ -0,0 +1,4 @@ +#import + +BOOL EXPIsValuePointer(NSValue *value); +BOOL EXPIsNumberFloat(NSNumber *number); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatcherHelpers.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatcherHelpers.m new file mode 100644 index 0000000..cec0343 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatcherHelpers.m @@ -0,0 +1,9 @@ +#import "EXPMatcherHelpers.h" + +BOOL EXPIsValuePointer(NSValue *value) { + return [value objCType][0] == @encode(void *)[0]; +} + +BOOL EXPIsNumberFloat(NSNumber *number) { + return strcmp([number objCType], @encode(float)) == 0; +} diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beCloseTo.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beCloseTo.h new file mode 100644 index 0000000..f683d6b --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beCloseTo.h @@ -0,0 +1,7 @@ +#import "Expecta.h" + +EXPMatcherInterface(_beCloseToWithin, (id expected, id within)); +EXPMatcherInterface(beCloseToWithin, (id expected, id within)); + +#define beCloseTo(expected) _beCloseToWithin(EXPObjectify((expected)), nil) +#define beCloseToWithin(expected, range) _beCloseToWithin(EXPObjectify((expected)), EXPObjectify((range))) diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beCloseTo.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beCloseTo.m new file mode 100644 index 0000000..c55431a --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beCloseTo.m @@ -0,0 +1,49 @@ +#import "EXPMatchers+beCloseTo.h" +#import "EXPMatcherHelpers.h" + +EXPMatcherImplementationBegin(_beCloseToWithin, (id expected, id within)) { + prerequisite(^BOOL{ + return [actual isKindOfClass:[NSNumber class]] && + [expected isKindOfClass:[NSNumber class]] && + ([within isKindOfClass:[NSNumber class]] || (within == nil)); + }); + + match(^BOOL{ + double actualValue = [actual doubleValue]; + double expectedValue = [expected doubleValue]; + + if (within != nil) { + double withinValue = [within doubleValue]; + double lowerBound = expectedValue - withinValue; + double upperBound = expectedValue + withinValue; + return (actualValue >= lowerBound) && (actualValue <= upperBound); + } else { + double diff = fabs(actualValue - expectedValue); + actualValue = fabs(actualValue); + expectedValue = fabs(expectedValue); + double largest = (expectedValue > actualValue) ? expectedValue : actualValue; + return (diff <= largest * FLT_EPSILON); + } + }); + + failureMessageForTo(^NSString *{ + if (within) { + return [NSString stringWithFormat:@"expected %@ to be close to %@ within %@", + EXPDescribeObject(actual), EXPDescribeObject(expected), EXPDescribeObject(within)]; + } else { + return [NSString stringWithFormat:@"expected %@ to be close to %@", + EXPDescribeObject(actual), EXPDescribeObject(expected)]; + } + }); + + failureMessageForNotTo(^NSString *{ + if (within) { + return [NSString stringWithFormat:@"expected %@ not to be close to %@ within %@", + EXPDescribeObject(actual), EXPDescribeObject(expected), EXPDescribeObject(within)]; + } else { + return [NSString stringWithFormat:@"expected %@ not to be close to %@", + EXPDescribeObject(actual), EXPDescribeObject(expected)]; + } + }); +} +EXPMatcherImplementationEnd \ No newline at end of file diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beFalsy.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beFalsy.h new file mode 100644 index 0000000..89c8e00 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beFalsy.h @@ -0,0 +1,3 @@ +#import "Expecta.h" + +EXPMatcherInterface(beFalsy, (void)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beFalsy.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beFalsy.m new file mode 100644 index 0000000..382cab8 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beFalsy.m @@ -0,0 +1,24 @@ +#import "EXPMatchers+beFalsy.h" +#import "EXPMatcherHelpers.h" + +EXPMatcherImplementationBegin(beFalsy, (void)) { + match(^BOOL{ + if([actual isKindOfClass:[NSNumber class]]) { + return ![(NSNumber *)actual boolValue]; + } else if([actual isKindOfClass:[NSValue class]]) { + if(EXPIsValuePointer((NSValue *)actual)) { + return ![(NSValue *)actual pointerValue]; + } + } + return !actual; + }); + + failureMessageForTo(^NSString *{ + return [NSString stringWithFormat:@"expected: a falsy value, got: %@, which is truthy", EXPDescribeObject(actual)]; + }); + + failureMessageForNotTo(^NSString *{ + return [NSString stringWithFormat:@"expected: a non-falsy value, got: %@, which is falsy", EXPDescribeObject(actual)]; + }); +} +EXPMatcherImplementationEnd diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThan.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThan.h new file mode 100644 index 0000000..a2f9fba --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThan.h @@ -0,0 +1,6 @@ +#import "Expecta.h" + +EXPMatcherInterface(_beGreaterThan, (id expected)); +EXPMatcherInterface(beGreaterThan, (id expected)); + +#define beGreaterThan(expected) _beGreaterThan(EXPObjectify((expected))) diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThan.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThan.m new file mode 100644 index 0000000..d725387 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThan.m @@ -0,0 +1,20 @@ +#import "EXPMatchers+beGreaterThan.h" +#import "EXPMatcherHelpers.h" + +EXPMatcherImplementationBegin(_beGreaterThan, (id expected)) { + match(^BOOL{ + if ([actual respondsToSelector:@selector(compare:)]) { + return [actual compare:expected] == NSOrderedDescending; + } + return NO; + }); + + failureMessageForTo(^NSString *{ + return [NSString stringWithFormat:@"expected: %@ to be greater than %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; + }); + + failureMessageForNotTo(^NSString *{ + return [NSString stringWithFormat:@"expected: %@ not to be greater than %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; + }); +} +EXPMatcherImplementationEnd \ No newline at end of file diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThanOrEqualTo.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThanOrEqualTo.h new file mode 100644 index 0000000..3e91c64 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThanOrEqualTo.h @@ -0,0 +1,6 @@ +#import "Expecta.h" + +EXPMatcherInterface(_beGreaterThanOrEqualTo, (id expected)); +EXPMatcherInterface(beGreaterThanOrEqualTo, (id expected)); + +#define beGreaterThanOrEqualTo(expected) _beGreaterThanOrEqualTo(EXPObjectify((expected))) diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThanOrEqualTo.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThanOrEqualTo.m new file mode 100644 index 0000000..3276344 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThanOrEqualTo.m @@ -0,0 +1,20 @@ +#import "EXPMatchers+beGreaterThanOrEqualTo.h" +#import "EXPMatcherHelpers.h" + +EXPMatcherImplementationBegin(_beGreaterThanOrEqualTo, (id expected)) { + match(^BOOL{ + if ([actual respondsToSelector:@selector(compare:)]) { + return [actual compare:expected] != NSOrderedAscending; + } + return NO; + }); + + failureMessageForTo(^NSString *{ + return [NSString stringWithFormat:@"expected: %@ to be greater than or equal to %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; + }); + + failureMessageForNotTo(^NSString *{ + return [NSString stringWithFormat:@"expected: %@ not to be greater than or equal to %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; + }); +} +EXPMatcherImplementationEnd \ No newline at end of file diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beIdenticalTo.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beIdenticalTo.h new file mode 100644 index 0000000..d13619f --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beIdenticalTo.h @@ -0,0 +1,10 @@ +#import "Expecta.h" + +EXPMatcherInterface(_beIdenticalTo, (void *expected)); +EXPMatcherInterface(beIdenticalTo, (void *expected)); // to aid code completion + +#if __has_feature(objc_arc) +#define beIdenticalTo(expected) _beIdenticalTo((__bridge void*)expected) +#else +#define beIdenticalTo(expected) _beIdenticalTo(expected) +#endif diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beIdenticalTo.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beIdenticalTo.m new file mode 100644 index 0000000..b62b0fe --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beIdenticalTo.m @@ -0,0 +1,24 @@ +#import "EXPMatchers+equal.h" +#import "EXPMatcherHelpers.h" + +EXPMatcherImplementationBegin(_beIdenticalTo, (void *expected)) { + match(^BOOL{ + if(actual == expected) { + return YES; + } else if([actual isKindOfClass:[NSValue class]] && EXPIsValuePointer((NSValue *)actual)) { + if([(NSValue *)actual pointerValue] == expected) { + return YES; + } + } + return NO; + }); + + failureMessageForTo(^NSString *{ + return [NSString stringWithFormat:@"expected: <%p>, got: <%p>", expected, actual]; + }); + + failureMessageForNotTo(^NSString *{ + return [NSString stringWithFormat:@"expected: not <%p>, got: <%p>", expected, actual]; + }); +} +EXPMatcherImplementationEnd diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beInTheRangeOf.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beInTheRangeOf.h new file mode 100644 index 0000000..8ea990e --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beInTheRangeOf.h @@ -0,0 +1,6 @@ +#import "Expecta.h" + +EXPMatcherInterface(_beInTheRangeOf, (id expectedLowerBound, id expectedUpperBound)); +EXPMatcherInterface(beInTheRangeOf, (id expectedLowerBound, id expectedUpperBound)); + +#define beInTheRangeOf(expectedLowerBound, expectedUpperBound) _beInTheRangeOf(EXPObjectify((expectedLowerBound)), EXPObjectify((expectedUpperBound))) diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beInTheRangeOf.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beInTheRangeOf.m new file mode 100644 index 0000000..1631f24 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beInTheRangeOf.m @@ -0,0 +1,30 @@ +#import "EXPMatchers+beInTheRangeOf.h" +#import "EXPMatcherHelpers.h" + +EXPMatcherImplementationBegin(_beInTheRangeOf, (id expectedLowerBound, id expectedUpperBound)) { + match(^BOOL{ + if ([actual respondsToSelector:@selector(compare:)]) { + NSComparisonResult compareLowerBound = [expectedLowerBound compare: actual]; + NSComparisonResult compareUpperBound = [expectedUpperBound compare: actual]; + if (compareLowerBound == NSOrderedSame) { + return YES; + } + if (compareUpperBound == NSOrderedSame) { + return YES; + } + if ((compareLowerBound == NSOrderedAscending) && (compareUpperBound == NSOrderedDescending)) { + return YES; + } + } + return NO; + }); + + failureMessageForTo(^NSString *{ + return [NSString stringWithFormat:@"expected: %@ to be in the range [%@, %@] (inclusive)", EXPDescribeObject(actual), EXPDescribeObject(expectedLowerBound), EXPDescribeObject(expectedUpperBound)]; + }); + + failureMessageForNotTo(^NSString *{ + return [NSString stringWithFormat:@"expected: %@ not to be in the range [%@, %@] (inclusive)", EXPDescribeObject(actual), EXPDescribeObject(expectedLowerBound), EXPDescribeObject(expectedUpperBound)]; + }); +} +EXPMatcherImplementationEnd \ No newline at end of file diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beInstanceOf.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beInstanceOf.h new file mode 100644 index 0000000..a8e8175 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beInstanceOf.h @@ -0,0 +1,6 @@ +#import "Expecta.h" + +EXPMatcherInterface(beInstanceOf, (Class expected)); +EXPMatcherInterface(beAnInstanceOf, (Class expected)); +EXPMatcherInterface(beMemberOf, (Class expected)); +EXPMatcherInterface(beAMemberOf, (Class expected)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beInstanceOf.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beInstanceOf.m new file mode 100644 index 0000000..9535e1e --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beInstanceOf.m @@ -0,0 +1,31 @@ +#import "EXPMatchers+beInstanceOf.h" + +EXPMatcherImplementationBegin(beInstanceOf, (Class expected)) { + BOOL actualIsNil = (actual == nil); + BOOL expectedIsNil = (expected == nil); + + prerequisite(^BOOL{ + return !(actualIsNil || expectedIsNil); + }); + + match(^BOOL{ + return [actual isMemberOfClass:expected]; + }); + + failureMessageForTo(^NSString *{ + if(actualIsNil) return @"the actual value is nil/null"; + if(expectedIsNil) return @"the expected value is nil/null"; + return [NSString stringWithFormat:@"expected: an instance of %@, got: an instance of %@", [expected class], [actual class]]; + }); + + failureMessageForNotTo(^NSString *{ + if(actualIsNil) return @"the actual value is nil/null"; + if(expectedIsNil) return @"the expected value is nil/null"; + return [NSString stringWithFormat:@"expected: not an instance of %@, got: an instance of %@", [expected class], [actual class]]; + }); +} +EXPMatcherImplementationEnd + +EXPMatcherAliasImplementation(beAnInstanceOf, beInstanceOf, (Class expected)); +EXPMatcherAliasImplementation(beMemberOf, beInstanceOf, (Class expected)); +EXPMatcherAliasImplementation(beAMemberOf, beInstanceOf, (Class expected)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beKindOf.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beKindOf.h new file mode 100644 index 0000000..b8623e0 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beKindOf.h @@ -0,0 +1,4 @@ +#import "Expecta.h" + +EXPMatcherInterface(beKindOf, (Class expected)); +EXPMatcherInterface(beAKindOf, (Class expected)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beKindOf.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beKindOf.m new file mode 100644 index 0000000..f13ffb5 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beKindOf.m @@ -0,0 +1,29 @@ +#import "EXPMatchers+beKindOf.h" + +EXPMatcherImplementationBegin(beKindOf, (Class expected)) { + BOOL actualIsNil = (actual == nil); + BOOL expectedIsNil = (expected == nil); + + prerequisite(^BOOL{ + return !(actualIsNil || expectedIsNil); + }); + + match(^BOOL{ + return [actual isKindOfClass:expected]; + }); + + failureMessageForTo(^NSString *{ + if(actualIsNil) return @"the actual value is nil/null"; + if(expectedIsNil) return @"the expected value is nil/null"; + return [NSString stringWithFormat:@"expected: a kind of %@, got: an instance of %@, which is not a kind of %@", [expected class], [actual class], [expected class]]; + }); + + failureMessageForNotTo(^NSString *{ + if(actualIsNil) return @"the actual value is nil/null"; + if(expectedIsNil) return @"the expected value is nil/null"; + return [NSString stringWithFormat:@"expected: not a kind of %@, got: an instance of %@, which is a kind of %@", [expected class], [actual class], [expected class]]; + }); +} +EXPMatcherImplementationEnd + +EXPMatcherAliasImplementation(beAKindOf, beKindOf, (Class expected)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThan.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThan.h new file mode 100644 index 0000000..5ed0a24 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThan.h @@ -0,0 +1,6 @@ +#import "Expecta.h" + +EXPMatcherInterface(_beLessThan, (id expected)); +EXPMatcherInterface(beLessThan, (id expected)); + +#define beLessThan(expected) _beLessThan(EXPObjectify((expected))) diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThan.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThan.m new file mode 100644 index 0000000..39b6883 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThan.m @@ -0,0 +1,20 @@ +#import "EXPMatchers+beLessThan.h" +#import "EXPMatcherHelpers.h" + +EXPMatcherImplementationBegin(_beLessThan, (id expected)) { + match(^BOOL{ + if ([actual respondsToSelector:@selector(compare:)]) { + return [actual compare:expected] == NSOrderedAscending; + } + return NO; + }); + + failureMessageForTo(^NSString *{ + return [NSString stringWithFormat:@"expected: %@ to be less than %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; + }); + + failureMessageForNotTo(^NSString *{ + return [NSString stringWithFormat:@"expected: %@ not to be less than %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; + }); +} +EXPMatcherImplementationEnd \ No newline at end of file diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThanOrEqualTo.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThanOrEqualTo.h new file mode 100644 index 0000000..2c31341 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThanOrEqualTo.h @@ -0,0 +1,6 @@ +#import "Expecta.h" + +EXPMatcherInterface(_beLessThanOrEqualTo, (id expected)); +EXPMatcherInterface(beLessThanOrEqualTo, (id expected)); + +#define beLessThanOrEqualTo(expected) _beLessThanOrEqualTo(EXPObjectify((expected))) diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThanOrEqualTo.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThanOrEqualTo.m new file mode 100644 index 0000000..401c194 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThanOrEqualTo.m @@ -0,0 +1,20 @@ +#import "EXPMatchers+beLessThanOrEqualTo.h" +#import "EXPMatcherHelpers.h" + +EXPMatcherImplementationBegin(_beLessThanOrEqualTo, (id expected)) { + match(^BOOL{ + if ([actual respondsToSelector:@selector(compare:)]) { + return [actual compare:expected] != NSOrderedDescending; + } + return NO; + }); + + failureMessageForTo(^NSString *{ + return [NSString stringWithFormat:@"expected: %@ to be less than or equal to %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; + }); + + failureMessageForNotTo(^NSString *{ + return [NSString stringWithFormat:@"expected: %@ not to be less than or equal to %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; + }); +} +EXPMatcherImplementationEnd \ No newline at end of file diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beNil.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beNil.h new file mode 100644 index 0000000..6d78162 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beNil.h @@ -0,0 +1,4 @@ +#import "Expecta.h" + +EXPMatcherInterface(beNil, (void)); +EXPMatcherInterface(beNull, (void)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beNil.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beNil.m new file mode 100644 index 0000000..161067f --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beNil.m @@ -0,0 +1,18 @@ +#import "EXPMatchers+beNil.h" + +EXPMatcherImplementationBegin(beNil, (void)) { + match(^BOOL{ + return actual == nil; + }); + + failureMessageForTo(^NSString *{ + return [NSString stringWithFormat:@"expected: nil/null, got: %@", EXPDescribeObject(actual)]; + }); + + failureMessageForNotTo(^NSString *{ + return [NSString stringWithFormat:@"expected: not nil/null, got: %@", EXPDescribeObject(actual)]; + }); +} +EXPMatcherImplementationEnd + +EXPMatcherAliasImplementation(beNull, beNil, (void)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beSubclassOf.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beSubclassOf.h new file mode 100644 index 0000000..65401c5 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beSubclassOf.h @@ -0,0 +1,4 @@ +#import "Expecta.h" + +EXPMatcherInterface(beSubclassOf, (Class expected)); +EXPMatcherInterface(beASubclassOf, (Class expected)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beSubclassOf.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beSubclassOf.m new file mode 100644 index 0000000..d4976d5 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beSubclassOf.m @@ -0,0 +1,29 @@ +#import "EXPMatchers+beSubclassOf.h" +#import "NSValue+Expecta.h" +#import + +EXPMatcherImplementationBegin(beSubclassOf, (Class expected)) { + __block BOOL actualIsClass = YES; + + prerequisite(^BOOL { + actualIsClass = class_isMetaClass(object_getClass(actual)); + return actualIsClass; + }); + + match(^BOOL{ + return [actual isSubclassOfClass:expected]; + }); + + failureMessageForTo(^NSString *{ + if(!actualIsClass) return @"the actual value is not a Class"; + return [NSString stringWithFormat:@"expected: a subclass of %@, got: a class %@, which is not a subclass of %@", [expected class], actual, [expected class]]; + }); + + failureMessageForNotTo(^NSString *{ + if(!actualIsClass) return @"the actual value is not a Class"; + return [NSString stringWithFormat:@"expected: not a subclass of %@, got: a class %@, which is a subclass of %@", [expected class], actual, [expected class]]; + }); +} +EXPMatcherImplementationEnd + +EXPMatcherAliasImplementation(beASubclassOf, beSubclassOf, (Class expected)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beSupersetOf.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beSupersetOf.h new file mode 100644 index 0000000..f9a47ba --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beSupersetOf.h @@ -0,0 +1,4 @@ +#import "Expecta.h" + +EXPMatcherInterface(beSupersetOf, (id subset)); + diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beSupersetOf.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beSupersetOf.m new file mode 100644 index 0000000..f4d05c0 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beSupersetOf.m @@ -0,0 +1,62 @@ +#import "EXPMatchers+contain.h" + +EXPMatcherImplementationBegin(beSupersetOf, (id subset)) { + BOOL actualIsCompatible = [actual isKindOfClass:[NSDictionary class]] || [actual respondsToSelector:@selector(containsObject:)]; + BOOL subsetIsNil = (subset == nil); + + // For some instances the isKindOfClass: method returns false, even though + // they are both actually dictionaries. e.g. Comparing a NSCFDictionary and a + // NSDictionary. + // Or in cases when you compare NSMutableArray (which implementation is __NSArrayM:NSMutableArray:NSArray) + // and NSArray (which implementation is __NSArrayI:NSArray) + BOOL bothAreIdenticalCollectionClasses = ([actual isKindOfClass:[NSDictionary class]] && [subset isKindOfClass:[NSDictionary class]]) || + ([actual isKindOfClass:[NSArray class]] && [subset isKindOfClass:[NSArray class]]) || + ([actual isKindOfClass:[NSSet class]] && [subset isKindOfClass:[NSSet class]]) || + ([actual isKindOfClass:[NSOrderedSet class]] && [subset isKindOfClass:[NSOrderedSet class]]); + + BOOL classMatches = bothAreIdenticalCollectionClasses || [subset isKindOfClass:[actual class]]; + + prerequisite(^BOOL{ + return actualIsCompatible && !subsetIsNil && classMatches; + }); + + match(^BOOL{ + if(!actualIsCompatible) return NO; + + if([actual isKindOfClass:[NSDictionary class]]) { + for (id key in subset) { + id actualValue = [actual valueForKey:key]; + id subsetValue = [subset valueForKey:key]; + + if (![subsetValue isEqual:actualValue]) return NO; + } + } else { + for (id object in subset) { + if (![actual containsObject:object]) return NO; + } + } + + return YES; + }); + + failureMessageForTo(^NSString *{ + if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSDictionary and does not implement -containsObject:", EXPDescribeObject(actual)]; + + if(subsetIsNil) return @"the expected value is nil/null"; + + if(!classMatches) return [NSString stringWithFormat:@"%@ does not match the class of %@", EXPDescribeObject(subset), EXPDescribeObject(actual)]; + + return [NSString stringWithFormat:@"expected %@ to be a superset of %@", EXPDescribeObject(actual), EXPDescribeObject(subset)]; + }); + + failureMessageForNotTo(^NSString *{ + if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSDictionary and does not implement -containsObject:", EXPDescribeObject(actual)]; + + if(subsetIsNil) return @"the expected value is nil/null"; + + if(!classMatches) return [NSString stringWithFormat:@"%@ does not match the class of %@", EXPDescribeObject(subset), EXPDescribeObject(actual)]; + + return [NSString stringWithFormat:@"expected %@ not to be a superset of %@", EXPDescribeObject(actual), EXPDescribeObject(subset)]; + }); +} +EXPMatcherImplementationEnd diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beTruthy.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beTruthy.h new file mode 100644 index 0000000..1e4e78f --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beTruthy.h @@ -0,0 +1,3 @@ +#import "Expecta.h" + +EXPMatcherInterface(beTruthy, (void)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beTruthy.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beTruthy.m new file mode 100644 index 0000000..02fa6e7 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beTruthy.m @@ -0,0 +1,24 @@ +#import "EXPMatchers+beTruthy.h" +#import "EXPMatcherHelpers.h" + +EXPMatcherImplementationBegin(beTruthy, (void)) { + match(^BOOL{ + if([actual isKindOfClass:[NSNumber class]]) { + return !![(NSNumber *)actual boolValue]; + } else if([actual isKindOfClass:[NSValue class]]) { + if(EXPIsValuePointer((NSValue *)actual)) { + return !![(NSValue *)actual pointerValue]; + } + } + return !!actual; + }); + + failureMessageForTo(^NSString *{ + return [NSString stringWithFormat:@"expected: a truthy value, got: %@, which is falsy", EXPDescribeObject(actual)]; + }); + + failureMessageForNotTo(^NSString *{ + return [NSString stringWithFormat:@"expected: a non-truthy value, got: %@, which is truthy", EXPDescribeObject(actual)]; + }); +} +EXPMatcherImplementationEnd diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beginWith.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beginWith.h new file mode 100644 index 0000000..07ddd6c --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beginWith.h @@ -0,0 +1,4 @@ +#import "Expecta.h" + +EXPMatcherInterface(beginWith, (id expected)); +EXPMatcherInterface(startWith, (id expected)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beginWith.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beginWith.m new file mode 100644 index 0000000..a7c9e59 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+beginWith.m @@ -0,0 +1,51 @@ +#import "EXPMatchers+beginWith.h" + +EXPMatcherImplementationBegin(beginWith, (id expected)) { + BOOL actualIsNil = (actual == nil); + BOOL expectedIsNil = (expected == nil); + //This condition allows the comparison of an immutable string or ordered collection to the mutable type of the same + BOOL actualAndExpectedAreCompatible = (([actual isKindOfClass:[NSString class]] && [expected isKindOfClass:[NSString class]]) + || ([actual isKindOfClass:[NSArray class]] && [expected isKindOfClass:[NSArray class]]) + || ([actual isKindOfClass:[NSOrderedSet class]] && [expected isKindOfClass:[NSOrderedSet class]])); + + prerequisite(^BOOL { + return actualAndExpectedAreCompatible; + }); + + match(^BOOL { + if ([actual isKindOfClass:[NSString class]]) { + return [actual hasPrefix:expected]; + } else if ([actual isKindOfClass:[NSArray class]]) { + if ([expected count] > [actual count] || [expected count] == 0) { + return NO; + } + NSArray *subArray = [actual subarrayWithRange:NSMakeRange(0, [expected count])]; + return [subArray isEqualToArray:expected]; + } else { + if ([expected count] > [actual count] || [expected count] == 0) { + return NO; + } + + NSOrderedSet *subset = [NSOrderedSet orderedSetWithOrderedSet:actual range:NSMakeRange(0, [expected count]) copyItems:NO]; + return [subset isEqualToOrderedSet:expected]; + } + }); + + failureMessageForTo(^NSString *{ + if (actualIsNil) return @"the object is nil/null"; + if (expectedIsNil) return @"the expected value is nil/null"; + if (!actualAndExpectedAreCompatible) return [NSString stringWithFormat:@"%@ and %@ are not instances of one of %@, %@, or %@", EXPDescribeObject(actual), EXPDescribeObject(expected), [NSString class], [NSArray class], [NSOrderedSet class]]; + return [NSString stringWithFormat:@"expected: %@ to begin with %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; + }); + + failureMessageForNotTo(^NSString *{ + if (actualIsNil) return @"the object is nil/null"; + if (expectedIsNil) return @"the expected value is nil/null"; + if (!actualAndExpectedAreCompatible) return [NSString stringWithFormat:@"%@ and %@ are not instances of one of %@, %@, or %@", EXPDescribeObject(actual), EXPDescribeObject(expected), [NSString class], [NSArray class], [NSOrderedSet class]]; + + return [NSString stringWithFormat:@"expected: %@ not to begin with %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; + }); +} +EXPMatcherImplementationEnd + +EXPMatcherAliasImplementation(startWith, beginWith, (id expected)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+conformTo.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+conformTo.h new file mode 100644 index 0000000..efc7b98 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+conformTo.h @@ -0,0 +1,3 @@ +#import "Expecta.h" + +EXPMatcherInterface(conformTo, (Protocol *expected)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+conformTo.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+conformTo.m new file mode 100644 index 0000000..b88014d --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+conformTo.m @@ -0,0 +1,33 @@ +#import "EXPMatchers+conformTo.h" +#import "NSValue+Expecta.h" +#import + +EXPMatcherImplementationBegin(conformTo, (Protocol *expected)) { + BOOL actualIsNil = (actual == nil); + BOOL expectedIsNil = (expected == nil); + + prerequisite(^BOOL{ + return !(actualIsNil || expectedIsNil); + }); + + match(^BOOL{ + return [actual conformsToProtocol:expected]; + }); + + failureMessageForTo(^NSString *{ + if(actualIsNil) return @"the object is nil/null"; + if(expectedIsNil) return @"the protocol is nil/null"; + + NSString *name = NSStringFromProtocol(expected); + return [NSString stringWithFormat:@"expected: %@ to conform to %@", actual, name]; + }); + + failureMessageForNotTo(^NSString *{ + if(actualIsNil) return @"the object is nil/null"; + if(expectedIsNil) return @"the protocol is nil/null"; + + NSString *name = NSStringFromProtocol(expected); + return [NSString stringWithFormat:@"expected: %@ not to conform to %@", actual, name]; + }); +} +EXPMatcherImplementationEnd diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+contain.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+contain.h new file mode 100644 index 0000000..5803146 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+contain.h @@ -0,0 +1,5 @@ +#import "Expecta.h" + +EXPMatcherInterface(_contain, (id expected)); +EXPMatcherInterface(contain, (id expected)); // to aid code completion +#define contain(expected) _contain(EXPObjectify((expected))) diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+contain.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+contain.m new file mode 100644 index 0000000..b8a6f86 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+contain.m @@ -0,0 +1,38 @@ +#import "EXPMatchers+contain.h" + +EXPMatcherImplementationBegin(_contain, (id expected)) { + BOOL actualIsCompatible = [actual isKindOfClass:[NSString class]] || [actual conformsToProtocol:@protocol(NSFastEnumeration)]; + BOOL expectedIsNil = (expected == nil); + + prerequisite(^BOOL{ + return actualIsCompatible && !expectedIsNil; + }); + + match(^BOOL{ + if(actualIsCompatible) { + if([actual isKindOfClass:[NSString class]]) { + return [(NSString *)actual rangeOfString:[expected description]].location != NSNotFound; + } else { + for (id object in actual) { + if ([object isEqual:expected]) { + return YES; + } + } + } + } + return NO; + }); + + failureMessageForTo(^NSString *{ + if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSString or NSFastEnumeration", EXPDescribeObject(actual)]; + if(expectedIsNil) return @"the expected value is nil/null"; + return [NSString stringWithFormat:@"expected %@ to contain %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; + }); + + failureMessageForNotTo(^NSString *{ + if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSString or NSFastEnumeration", EXPDescribeObject(actual)]; + if(expectedIsNil) return @"the expected value is nil/null"; + return [NSString stringWithFormat:@"expected %@ not to contain %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; + }); +} +EXPMatcherImplementationEnd diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+endWith.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+endWith.h new file mode 100644 index 0000000..228cea9 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+endWith.h @@ -0,0 +1,3 @@ +#import "Expecta.h" + +EXPMatcherInterface(endWith, (id expected)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+endWith.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+endWith.m new file mode 100644 index 0000000..f34bd90 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+endWith.m @@ -0,0 +1,49 @@ +#import "EXPMatchers+endWith.h" + +EXPMatcherImplementationBegin(endWith, (id expected)) { + BOOL actualIsNil = (actual == nil); + BOOL expectedIsNil = (expected == nil); + //This condition allows the comparison of an immutable string or ordered collection to the mutable type of the same + BOOL actualAndExpectedAreCompatible = (([actual isKindOfClass:[NSString class]] && [expected isKindOfClass:[NSString class]]) + || ([actual isKindOfClass:[NSArray class]] && [expected isKindOfClass:[NSArray class]]) + || ([actual isKindOfClass:[NSOrderedSet class]] && [expected isKindOfClass:[NSOrderedSet class]])); + + prerequisite(^BOOL { + return actualAndExpectedAreCompatible; + }); + + match(^BOOL { + if ([actual isKindOfClass:[NSString class]]) { + return [actual hasSuffix:expected]; + } else if ([actual isKindOfClass:[NSArray class]]) { + if ([expected count] > [actual count] || [expected count] == 0) { + return NO; + } + NSArray *subArray = [actual subarrayWithRange:NSMakeRange([actual count] - [expected count], [expected count])]; + return [subArray isEqualToArray:expected]; + } else { + if ([expected count] > [actual count] || [expected count] == 0) { + return NO; + } + + NSOrderedSet *subset = [NSOrderedSet orderedSetWithOrderedSet:actual range:NSMakeRange([actual count] - [expected count], [expected count]) copyItems:NO]; + return [subset isEqualToOrderedSet:expected]; + } + }); + + failureMessageForTo(^NSString *{ + if (actualIsNil) return @"the object is nil/null"; + if (expectedIsNil) return @"the expected value is nil/null"; + if (!actualAndExpectedAreCompatible) return [NSString stringWithFormat:@"%@ and %@ are not instances of one of %@, %@, or %@", EXPDescribeObject(actual), EXPDescribeObject(expected), [NSString class], [NSArray class], [NSOrderedSet class]]; + return [NSString stringWithFormat:@"expected: %@ to end with %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; + }); + + failureMessageForNotTo(^NSString *{ + if (actualIsNil) return @"the object is nil/null"; + if (expectedIsNil) return @"the expected value is nil/null"; + if (!actualAndExpectedAreCompatible) return [NSString stringWithFormat:@"%@ and %@ are not instances of one of %@, %@, or %@", EXPDescribeObject(actual), EXPDescribeObject(expected), [NSString class], [NSArray class], [NSOrderedSet class]]; + + return [NSString stringWithFormat:@"expected: %@ not to end with %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; + }); +} +EXPMatcherImplementationEnd diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+equal.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+equal.h new file mode 100644 index 0000000..b4047c0 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+equal.h @@ -0,0 +1,5 @@ +#import "Expecta.h" + +EXPMatcherInterface(_equal, (id expected)); +EXPMatcherInterface(equal, (id expected)); // to aid code completion +#define equal(...) _equal(EXPObjectify((__VA_ARGS__))) diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+equal.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+equal.m new file mode 100644 index 0000000..0dc4d33 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+equal.m @@ -0,0 +1,38 @@ +#import "EXPMatchers+equal.h" +#import "EXPMatcherHelpers.h" + +EXPMatcherImplementationBegin(_equal, (id expected)) { + match(^BOOL{ + if((actual == expected) || [actual isEqual:expected]) { + return YES; + } else if([actual isKindOfClass:[NSNumber class]] && [expected isKindOfClass:[NSNumber class]]) { + if([actual isKindOfClass:[NSDecimalNumber class]] || [expected isKindOfClass:[NSDecimalNumber class]]) { + NSDecimalNumber *actualDecimalNumber = [NSDecimalNumber decimalNumberWithDecimal:[(NSNumber *) actual decimalValue]]; + NSDecimalNumber *expectedDecimalNumber = [NSDecimalNumber decimalNumberWithDecimal:[(NSNumber *) expected decimalValue]]; + return [actualDecimalNumber isEqualToNumber:expectedDecimalNumber]; + } + else { + if(EXPIsNumberFloat((NSNumber *)actual) || EXPIsNumberFloat((NSNumber *)expected)) { + return [(NSNumber *)actual floatValue] == [(NSNumber *)expected floatValue]; + } + } + } + return NO; + }); + + failureMessageForTo(^NSString *{ + NSString *expectedDescription = EXPDescribeObject(expected); + NSString *actualDescription = EXPDescribeObject(actual); + + if (![expectedDescription isEqualToString:actualDescription]) { + return [NSString stringWithFormat:@"expected: %@, got: %@", EXPDescribeObject(expected), EXPDescribeObject(actual)]; + } else { + return [NSString stringWithFormat:@"expected (%@): %@, got (%@): %@", NSStringFromClass([expected class]), EXPDescribeObject(expected), NSStringFromClass([actual class]), EXPDescribeObject(actual)]; + } + }); + + failureMessageForNotTo(^NSString *{ + return [NSString stringWithFormat:@"expected: not %@, got: %@", EXPDescribeObject(expected), EXPDescribeObject(actual)]; + }); +} +EXPMatcherImplementationEnd diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+haveCountOf.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+haveCountOf.h new file mode 100644 index 0000000..2e9aef5 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+haveCountOf.h @@ -0,0 +1,10 @@ +#import "Expecta.h" + +EXPMatcherInterface(haveCountOf, (NSUInteger expected)); +EXPMatcherInterface(haveCount, (NSUInteger expected)); +EXPMatcherInterface(haveACountOf, (NSUInteger expected)); +EXPMatcherInterface(haveLength, (NSUInteger expected)); +EXPMatcherInterface(haveLengthOf, (NSUInteger expected)); +EXPMatcherInterface(haveALengthOf, (NSUInteger expected)); + +#define beEmpty() haveCountOf(0) diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+haveCountOf.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+haveCountOf.m new file mode 100644 index 0000000..ecc4831 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+haveCountOf.m @@ -0,0 +1,42 @@ +#import "EXPMatchers+haveCountOf.h" + +EXPMatcherImplementationBegin(haveCountOf, (NSUInteger expected)) { + BOOL actualIsStringy = [actual isKindOfClass:[NSString class]] || [actual isKindOfClass:[NSAttributedString class]]; + BOOL actualIsCompatible = actualIsStringy || [actual respondsToSelector:@selector(count)]; + + prerequisite(^BOOL{ + return actualIsCompatible; + }); + + NSUInteger (^count)(id) = ^(id actual) { + if(actualIsStringy) { + return [actual length]; + } else { + return [actual count]; + } + }; + + match(^BOOL{ + if(actualIsCompatible) { + return count(actual) == expected; + } + return NO; + }); + + failureMessageForTo(^NSString *{ + if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSString, NSAttributedString, NSArray, NSSet, NSOrderedSet, or NSDictionary", EXPDescribeObject(actual)]; + return [NSString stringWithFormat:@"expected %@ to have a count of %zi but got %zi", EXPDescribeObject(actual), expected, count(actual)]; + }); + + failureMessageForNotTo(^NSString *{ + if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSString, NSAttributedString, NSArray, NSSet, NSOrderedSet, or NSDictionary", EXPDescribeObject(actual)]; + return [NSString stringWithFormat:@"expected %@ not to have a count of %zi", EXPDescribeObject(actual), expected]; + }); +} +EXPMatcherImplementationEnd + +EXPMatcherAliasImplementation(haveCount, haveCountOf, (NSUInteger expected)); +EXPMatcherAliasImplementation(haveACountOf, haveCountOf, (NSUInteger expected)); +EXPMatcherAliasImplementation(haveLength, haveCountOf, (NSUInteger expected)); +EXPMatcherAliasImplementation(haveLengthOf, haveCountOf, (NSUInteger expected)); +EXPMatcherAliasImplementation(haveALengthOf, haveCountOf, (NSUInteger expected)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+match.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+match.h new file mode 100644 index 0000000..4f0e8e4 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+match.h @@ -0,0 +1,3 @@ +#import "Expecta.h" + +EXPMatcherInterface(match, (NSString *expected)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+match.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+match.m new file mode 100644 index 0000000..a217467 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+match.m @@ -0,0 +1,38 @@ +#import "EXPMatchers+match.h" +#import "EXPMatcherHelpers.h" + +EXPMatcherImplementationBegin(match, (NSString *expected)) { + BOOL actualIsNil = (actual == nil); + BOOL expectedIsNil = (expected == nil); + + __block NSRegularExpression *regex = nil; + __block NSError *regexError = nil; + + prerequisite (^BOOL { + BOOL nilInput = (actualIsNil || expectedIsNil); + if (!nilInput) { + regex = [NSRegularExpression regularExpressionWithPattern:expected options:0 error:®exError]; + } + return !nilInput && regex; + }); + + match(^BOOL { + NSRange range = [regex rangeOfFirstMatchInString:actual options:0 range:NSMakeRange(0, [actual length])]; + return !NSEqualRanges(range, NSMakeRange(NSNotFound, 0)); + }); + + failureMessageForTo(^NSString *{ + if (actualIsNil) return @"the object is nil/null"; + if (expectedIsNil) return @"the expression is nil/null"; + if (regexError) return [NSString stringWithFormat:@"unable to create regular expression from given parameter: %@", [regexError localizedDescription]]; + return [NSString stringWithFormat:@"expected: %@ to match to %@", EXPDescribeObject(actual), expected]; + }); + + failureMessageForNotTo(^NSString *{ + if (actualIsNil) return @"the object is nil/null"; + if (expectedIsNil) return @"the expression is nil/null"; + if (regexError) return [NSString stringWithFormat:@"unable to create regular expression from given parameter: %@", [regexError localizedDescription]]; + return [NSString stringWithFormat:@"expected: %@ not to match to %@", EXPDescribeObject(actual), expected]; + }); +} +EXPMatcherImplementationEnd diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+postNotification.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+postNotification.h new file mode 100644 index 0000000..cdba4a3 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+postNotification.h @@ -0,0 +1,4 @@ +#import "Expecta.h" + +EXPMatcherInterface(postNotification, (id expectedNotification)); +EXPMatcherInterface(notify, (id expectedNotification)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+postNotification.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+postNotification.m new file mode 100644 index 0000000..6e517c4 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+postNotification.m @@ -0,0 +1,88 @@ +#import "EXPMatchers+postNotification.h" + +@implementation NSNotification (EXPEquality) + +- (BOOL)exp_isFunctionallyEqualTo:(NSNotification *)otherNotification +{ + if (![otherNotification isKindOfClass:[NSNotification class]]) return NO; + + BOOL namesMatch = [otherNotification.name isEqualToString:self.name]; + + BOOL objectsMatch = YES; + if (otherNotification.object || self.object) { + objectsMatch = [otherNotification.object isEqual:self.object]; + } + + BOOL userInfoMatches = YES; + if (otherNotification.userInfo || self.userInfo) { + userInfoMatches = [otherNotification.userInfo isEqual:self.userInfo]; + } + + return (namesMatch && objectsMatch && userInfoMatches); +} + +@end + +EXPMatcherImplementationBegin(postNotification, (id expected)){ + BOOL actualIsNil = (actual == nil); + BOOL expectedIsNil = (expected == nil); + BOOL isNotification = [expected isKindOfClass:[NSNotification class]]; + BOOL isName = [expected isKindOfClass:[NSString class]]; + + __block NSString *expectedName; + __block BOOL expectedNotificationOccurred = NO; + __block id observer; + + prerequisite(^BOOL{ + expectedNotificationOccurred = NO; + if (actualIsNil || expectedIsNil) return NO; + if (isNotification) { + expectedName = [expected name]; + }else if(isName) { + expectedName = expected; + }else{ + return NO; + } + + observer = [[NSNotificationCenter defaultCenter] addObserverForName:expectedName object:nil queue:nil usingBlock:^(NSNotification *note){ + if (isNotification) { + expectedNotificationOccurred |= [expected exp_isFunctionallyEqualTo:note]; + }else{ + expectedNotificationOccurred = YES; + } + }]; + ((EXPBasicBlock)actual)(); + return YES; + }); + + match(^BOOL{ + if(expectedNotificationOccurred) { + [[NSNotificationCenter defaultCenter] removeObserver:observer]; + } + return expectedNotificationOccurred; + }); + + failureMessageForTo(^NSString *{ + if (observer) { + [[NSNotificationCenter defaultCenter] removeObserver:observer]; + } + if(actualIsNil) return @"the actual value is nil/null"; + if(expectedIsNil) return @"the expected value is nil/null"; + if(!(isNotification || isName)) return @"the actual value is not a notification or string"; + return [NSString stringWithFormat:@"expected: %@, got: none",expectedName]; + }); + + failureMessageForNotTo(^NSString *{ + if (observer) { + [[NSNotificationCenter defaultCenter] removeObserver:observer]; + } + if(actualIsNil) return @"the actual value is nil/null"; + if(expectedIsNil) return @"the expected value is nil/null"; + if(!(isNotification || isName)) return @"the actual value is not a notification or string"; + return [NSString stringWithFormat:@"expected: none, got: %@", expectedName]; + }); +} + +EXPMatcherImplementationEnd + +EXPMatcherAliasImplementation(notify, postNotification, (id expectedNotification)) diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+raise.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+raise.h new file mode 100644 index 0000000..1f7fae0 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+raise.h @@ -0,0 +1,4 @@ +#import "Expecta.h" + +EXPMatcherInterface(raise, (NSString *expectedExceptionName)); +#define raiseAny() raise(nil) diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+raise.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+raise.m new file mode 100644 index 0000000..26f3c55 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+raise.m @@ -0,0 +1,30 @@ +#import "EXPMatchers+raise.h" +#import "EXPDefines.h" + +EXPMatcherImplementationBegin(raise, (NSString *expectedExceptionName)) { + __block NSException *exceptionCaught = nil; + + match(^BOOL{ + BOOL expectedExceptionCaught = NO; + @try { + ((EXPBasicBlock)actual)(); + } @catch(NSException *e) { + exceptionCaught = e; + expectedExceptionCaught = (expectedExceptionName == nil) || [[exceptionCaught name] isEqualToString:expectedExceptionName]; + } + return expectedExceptionCaught; + }); + + failureMessageForTo(^NSString *{ + return [NSString stringWithFormat:@"expected: %@, got: %@", + expectedExceptionName ? expectedExceptionName : @"any exception", + exceptionCaught ? [exceptionCaught name] : @"no exception"]; + }); + + failureMessageForNotTo(^NSString *{ + return [NSString stringWithFormat:@"expected: %@, got: %@", + expectedExceptionName ? [NSString stringWithFormat:@"not %@", expectedExceptionName] : @"no exception", + exceptionCaught ? [exceptionCaught name] : @"no exception"]; + }); +} +EXPMatcherImplementationEnd diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+raiseWithReason.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+raiseWithReason.h new file mode 100644 index 0000000..2cf5a5d --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+raiseWithReason.h @@ -0,0 +1,3 @@ +#import "Expecta.h" + +EXPMatcherInterface(raiseWithReason, (NSString *expectedExceptionName, NSString *expectedReason)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+raiseWithReason.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+raiseWithReason.m new file mode 100644 index 0000000..3943d38 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+raiseWithReason.m @@ -0,0 +1,35 @@ +#import "EXPMatchers+raiseWithReason.h" +#import "EXPDefines.h" + +EXPMatcherImplementationBegin(raiseWithReason, (NSString *expectedExceptionName, NSString *expectedReason)) { + __block NSException *exceptionCaught = nil; + + match(^BOOL{ + BOOL expectedExceptionCaught = NO; + @try { + ((EXPBasicBlock)actual)(); + } @catch(NSException *e) { + exceptionCaught = e; + expectedExceptionCaught = (((expectedExceptionName == nil) || [[exceptionCaught name] isEqualToString:expectedExceptionName]) && + ((expectedReason == nil) || ([[exceptionCaught reason] isEqualToString:expectedReason]))); + } + return expectedExceptionCaught; + }); + + failureMessageForTo(^NSString *{ + return [NSString stringWithFormat:@"expected: %@ (%@), got: %@ (%@)", + expectedExceptionName ?: @"any exception", + expectedReason ?: @"any reason", + exceptionCaught ? [exceptionCaught name] : @"no exception", + exceptionCaught ? [exceptionCaught reason] : @""]; + }); + + failureMessageForNotTo(^NSString *{ + return [NSString stringWithFormat:@"expected: %@ (%@), got: %@ (%@)", + expectedExceptionName ? [NSString stringWithFormat:@"not %@", expectedExceptionName] : @"no exception", + expectedReason ? [NSString stringWithFormat:@"not '%@'", expectedReason] : @"no reason", + exceptionCaught ? [exceptionCaught name] : @"no exception", + exceptionCaught ? [exceptionCaught reason] : @"no reason"]; + }); +} +EXPMatcherImplementationEnd diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+respondTo.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+respondTo.h new file mode 100644 index 0000000..279131d --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+respondTo.h @@ -0,0 +1,3 @@ +#import "Expecta.h" + +EXPMatcherInterface(respondTo, (SEL expected)); diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+respondTo.m b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+respondTo.m new file mode 100644 index 0000000..d294113 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers+respondTo.m @@ -0,0 +1,28 @@ +#import "EXPMatchers+respondTo.h" +#import "EXPMatcherHelpers.h" + +EXPMatcherImplementationBegin(respondTo, (SEL expected)) { + BOOL actualIsNil = (actual == nil); + BOOL expectedIsNull = (expected == NULL); + + prerequisite (^BOOL { + return !(actualIsNil || expectedIsNull); + }); + + match(^BOOL { + return [actual respondsToSelector:expected]; + }); + + failureMessageForTo(^NSString *{ + if (actualIsNil) return @"the object is nil/null"; + if (expectedIsNull) return @"the selector is null"; + return [NSString stringWithFormat:@"expected: %@ to respond to %@", EXPDescribeObject(actual), NSStringFromSelector(expected)]; + }); + + failureMessageForNotTo(^NSString *{ + if (actualIsNil) return @"the object is nil/null"; + if (expectedIsNull) return @"the selector is null"; + return [NSString stringWithFormat:@"expected: %@ not to respond to %@", EXPDescribeObject(actual), NSStringFromSelector(expected)]; + }); +} +EXPMatcherImplementationEnd diff --git a/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers.h b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers.h new file mode 100644 index 0000000..ed6ef85 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/Matchers/EXPMatchers.h @@ -0,0 +1,25 @@ +#import "EXPMatchers+beNil.h" +#import "EXPMatchers+equal.h" +#import "EXPMatchers+beInstanceOf.h" +#import "EXPMatchers+beKindOf.h" +#import "EXPMatchers+beSubclassOf.h" +#import "EXPMatchers+conformTo.h" +#import "EXPMatchers+beTruthy.h" +#import "EXPMatchers+beFalsy.h" +#import "EXPMatchers+contain.h" +#import "EXPMatchers+beSupersetOf.h" +#import "EXPMatchers+haveCountOf.h" +#import "EXPMatchers+beIdenticalTo.h" +#import "EXPMatchers+beGreaterThan.h" +#import "EXPMatchers+beGreaterThanOrEqualTo.h" +#import "EXPMatchers+beLessThan.h" +#import "EXPMatchers+beLessThanOrEqualTo.h" +#import "EXPMatchers+beInTheRangeOf.h" +#import "EXPMatchers+beCloseTo.h" +#import "EXPMatchers+raise.h" +#import "EXPMatchers+raiseWithReason.h" +#import "EXPMatchers+respondTo.h" +#import "EXPMatchers+postNotification.h" +#import "EXPMatchers+beginWith.h" +#import "EXPMatchers+endWith.h" +#import "EXPMatchers+match.h" diff --git a/Example/Pods/Expecta/Expecta/NSObject+Expecta.h b/Example/Pods/Expecta/Expecta/NSObject+Expecta.h new file mode 100644 index 0000000..5920e31 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/NSObject+Expecta.h @@ -0,0 +1,10 @@ +#import + +@interface NSObject (Expecta) + +- (void)recordFailureWithDescription:(NSString *)description + inFile:(NSString *)filename + atLine:(NSUInteger)lineNumber + expected:(BOOL)expected; + +@end diff --git a/Example/Pods/Expecta/Expecta/NSValue+Expecta.h b/Example/Pods/Expecta/Expecta/NSValue+Expecta.h new file mode 100644 index 0000000..e8ff6a4 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/NSValue+Expecta.h @@ -0,0 +1,7 @@ +#import + +@interface NSValue (Expecta) + +@property (nonatomic) const char *_EXP_objCType; + +@end diff --git a/Example/Pods/Expecta/Expecta/NSValue+Expecta.m b/Example/Pods/Expecta/Expecta/NSValue+Expecta.m new file mode 100644 index 0000000..f660996 --- /dev/null +++ b/Example/Pods/Expecta/Expecta/NSValue+Expecta.m @@ -0,0 +1,21 @@ +#import "NSValue+Expecta.h" +#import +#import "Expecta.h" + +EXPFixCategoriesBug(NSValue_Expecta); + +@implementation NSValue (Expecta) + +static char _EXP_typeKey; + +- (const char *)_EXP_objCType { + return [(NSString *)objc_getAssociatedObject(self, &_EXP_typeKey) cStringUsingEncoding:NSASCIIStringEncoding]; +} + +- (void)set_EXP_objCType:(const char *)_EXP_objCType { + objc_setAssociatedObject(self, &_EXP_typeKey, + @(_EXP_objCType), + OBJC_ASSOCIATION_COPY_NONATOMIC); +} + +@end diff --git a/Example/Pods/Expecta/LICENSE b/Example/Pods/Expecta/LICENSE new file mode 100644 index 0000000..a036c85 --- /dev/null +++ b/Example/Pods/Expecta/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011-2015 Specta Team - https://github.com/specta + +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. diff --git a/Example/Pods/Expecta/README.md b/Example/Pods/Expecta/README.md new file mode 100644 index 0000000..1933707 --- /dev/null +++ b/Example/Pods/Expecta/README.md @@ -0,0 +1,293 @@ +#Expecta + +[![Build Status](http://img.shields.io/travis/specta/expecta/master.svg?style=flat)](https://travis-ci.org/specta/expecta) +[![Pod Version](http://img.shields.io/cocoapods/v/Expecta.svg?style=flat)](http://cocoadocs.org/docsets/Expecta/) +[![Pod Platform](http://img.shields.io/cocoapods/p/Expecta.svg?style=flat)](http://cocoadocs.org/docsets/Expecta/) +[![Pod License](http://img.shields.io/cocoapods/l/Expecta.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0.html) + +A matcher framework for Objective-C and Cocoa. + +## 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. + +```objective-c +expect(@"foo").to.equal(@"foo"); // `to` is a syntactic sugar and can be safely omitted. +expect(foo).notTo.equal(1); +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/). + + +## 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 // 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:). + +> `expect(x).to.beIdenticalTo(y);` compares objects x and y and passes if they are identical and have the same memory address. + +> `expect(x).to.beNil();` passes if x is nil. + +> `expect(x).to.beTruthy();` passes if x evaluates to true (non-zero). + +> `expect(x).to.beFalsy();` passes if x evaluates to false (zero). + +> `expect(x).to.contain(y);` passes if an instance of NSArray or NSString x contains y. + +> `expect(x).to.beSupersetOf(y);` passes if an instance of NSArray, NSSet, NSDictionary or NSOrderedSet x contains all elements of y. + +> `expect(x).to.haveCountOf(y);` passes if an instance of NSArray, NSSet, NSDictionary or NSString x has a count or length of y. + +> `expect(x).to.beEmpty();` passes if an instance of NSArray, NSSet, NSDictionary or NSString x has a count or length of . + +> `expect(x).to.beInstanceOf([Foo class]);` passes if x is an instance of a class Foo. + +> `expect(x).to.beKindOf([Foo class]);` passes if x is an instance of a class Foo or if x is an instance of any class that inherits from the class Foo. + +> `expect([Foo class]).to.beSubclassOf([Bar class]);` passes if the class Foo is a subclass of the class Bar or if it is identical to the class Bar. Use beKindOf() for class clusters. + +> `expect(x).to.beLessThan(y);` passes if `x` is less than `y`. + +> `expect(x).to.beLessThanOrEqualTo(y);` passes if `x` is less than or equal to `y`. + +> `expect(x).to.beGreaterThan(y);` passes if `x` is greater than `y`. + +> `expect(x).to.beGreaterThanOrEqualTo(y);` passes if `x` is greater than or equal to `y`. + +> `expect(x).to.beInTheRangeOf(y,z);` passes if `x` is in the range of `y` and `z`. + +> `expect(x).to.beCloseTo(y);` passes if `x` is close to `y`. + +> `expect(x).to.beCloseToWithin(y, z);` passes if `x` is close to `y` within `z`. + +> `expect(^{ /* code */ }).to.raise(@"ExceptionName");` passes if a given block of code raises an exception named `ExceptionName`. + +> `expect(^{ /* code */ }).to.raiseAny();` passes if a given block of code raises any exception. + +> `expect(x).to.conformTo(y);` passes if `x` conforms to the protocol `y`. + +> `expect(x).to.respondTo(y);` passes if `x` responds to the selector `y`. + +> `expect(^{ /* code */ }).to.notify(@"NotificationName");` passes if a given block of code generates an NSNotification amed `NotificationName`. + +> `expect(^{ /* code */ }).to.notify(notification);` passes if a given block of code generates an NSNotification equal to the passed `notification`. + +> `expect(x).to.beginWith(y);` passes if an instance of NSString, NSArray, or NSOrderedSet `x` begins with `y`. Also liased by `startWith` + +> `expect(x).to.endWith(y);` passes if an instance of NSString, NSArray, or NSOrderedSet `x` ends with `y`. + +> `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 + +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 + +Every matcher can be made to perform asynchronous testing by prepending `.will`, `.willNot` or `after(...)`: + +>`expect(x).will.beNil();` passes if x becomes nil before the default timeout. +> +>`expect(x).willNot.beNil();` passes if x becomes non-nil before the default timeout. +> +>`expect(x).after(3).to.beNil();` passes if x becoms nil after 3.0 seconds. +> +>`expect(x).after(2.5).notTo.equal(42);` passes if x doesn't equal 42 after 2.5 seconds. + +The default timeout is 1.0 second and is used for all matchers if not otherwise specified. This setting can be changed by calling `[Expecta setAsynchronousTestTimeout:x]`, where `x` is the desired timeout in seconds. + +```objective-c +describe(@"Foo", ^{ + beforeAll(^{ + // All asynchronous matching using `will` and `willNot` + // will have a timeout of 2.0 seconds + [Expecta setAsynchronousTestTimeout:2]; + }); + + it(@"will not be nil", ^{ + // Test case where default timeout is used + expect(foo).willNot.beNil(); + }); + + it(@"should equal 42 after 3 seconds", ^{ + // Signle case where timeout differs from the default + expect(foo).after(3).to.equal(42); + }); +}); +``` + +## 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 a new matcher is easy with special macros provided by Expecta. Take a look at how `.beKindOf()` matcher is defined: + +`EXPMatchers+beKindOf.h` + +```objective-c +#import "Expecta.h" + +EXPMatcherInterface(beKindOf, (Class expected)); +// 1st argument is the name of the matcher function +// 2nd argument is the list of arguments that may be passed in the function +// call. +// Multiple arguments are fine. (e.g. (int foo, float bar)) + +#define beAKindOf beKindOf +``` + +`EXPMatchers+beKindOf.m` + +```objective-c +#import "EXPMatchers+beKindOf.h" + +EXPMatcherImplementationBegin(beKindOf, (Class expected)) { + BOOL actualIsNil = (actual == nil); + BOOL expectedIsNil = (expected == nil); + + prerequisite(^BOOL { + return !(actualIsNil || expectedIsNil); + // Return `NO` if matcher should fail whether or not the result is inverted + // using `.Not`. + }); + + match(^BOOL { + return [actual isKindOfClass:expected]; + // Return `YES` if the matcher should pass, `NO` if it should not. + // The actual value/object is passed as `actual`. + // Please note that primitive values will be wrapped in NSNumber/NSValue. + }); + + failureMessageForTo(^NSString * { + if (actualIsNil) + return @"the actual value is nil/null"; + if (expectedIsNil) + return @"the expected value is nil/null"; + return [NSString + stringWithFormat:@"expected: a kind of %@, " + "got: an instance of %@, which is not a kind of %@", + [expected class], [actual class], [expected class]]; + // Return the message to be displayed when the match function returns `YES`. + }); + + failureMessageForNotTo(^NSString * { + if (actualIsNil) + return @"the actual value is nil/null"; + if (expectedIsNil) + return @"the expected value is nil/null"; + return [NSString + stringWithFormat:@"expected: not a kind of %@, " + "got: an instance of %@, which is a kind of %@", + [expected class], [actual class], [expected class]]; + // Return the message to be displayed when the match function returns `NO`. + }); +} +EXPMatcherImplementationEnd +``` + +## 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. + +For instance, if you have the following class: + +```objc +@interface LightSwitch : NSObject +@property (nonatomic, assign, getter=isTurnedOn) BOOL turnedOn; +@end + +@implementation LightSwitch +@synthesize turnedOn; +@end +``` + +The normal way to write an assertion that the switch is turned on would be: + +```objc +expect([lightSwitch isTurnedOn]).to.beTruthy(); +``` + +However, if we define a custom predicate matcher: + +```objc +EXPMatcherInterface(isTurnedOn, (void)); +``` + +(Note: we haven't defined the matcher implementation, just it's interface) + +You can now write your assertion as follows: + +```objc +expect(lightSwitch).isTurnedOn(); +``` + +## Contribution Guidelines + +* Please use only spaces and indent 2 spaces at a time. +* Please prefix instance variable names with a single underscore (`_`). +* Please prefix custom classes and functions defined in the global scope with `EXP`. + +## 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). diff --git a/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase.modulemap b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase.modulemap new file mode 100644 index 0000000..733e78b --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase.modulemap @@ -0,0 +1,15 @@ +framework module FBSnapshotTestCase { + umbrella header "FBSnapshotTestCase.h" + + export * + module * { export * } + + header "FBSnapshotTestCase.h" + header "FBSnapshotTestCasePlatform.h" + header "FBSnapshotTestController.h" + + private header "UIImage+Compare.h" + private header "UIImage+Diff.h" + private header "UIImage+Snapshot.h" +} + diff --git a/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Compare.h b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Compare.h new file mode 100644 index 0000000..9091d62 --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Compare.h @@ -0,0 +1,37 @@ +// +// Created by Gabriel Handford on 3/1/09. +// Copyright 2009-2013. All rights reserved. +// Created by John Boiles on 10/20/11. +// Copyright (c) 2011. All rights reserved +// Modified by Felix Schulze on 2/11/13. +// Copyright 2013. All rights reserved. +// +// 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. +// + +#import + +@interface UIImage (Compare) + +- (BOOL)fb_compareWithImage:(UIImage *)image tolerance:(CGFloat)tolerance; + +@end diff --git a/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Compare.m b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Compare.m new file mode 100644 index 0000000..c997f57 --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Compare.m @@ -0,0 +1,134 @@ +// +// Created by Gabriel Handford on 3/1/09. +// Copyright 2009-2013. All rights reserved. +// Created by John Boiles on 10/20/11. +// Copyright (c) 2011. All rights reserved +// Modified by Felix Schulze on 2/11/13. +// Copyright 2013. All rights reserved. +// +// 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. +// + +#import + +// This makes debugging much more fun +typedef union { + uint32_t raw; + unsigned char bytes[4]; + struct { + char red; + char green; + char blue; + char alpha; + } __attribute__ ((packed)) pixels; +} FBComparePixel; + +@implementation UIImage (Compare) + +- (BOOL)fb_compareWithImage:(UIImage *)image tolerance:(CGFloat)tolerance +{ + NSAssert(CGSizeEqualToSize(self.size, image.size), @"Images must be same size."); + + CGSize referenceImageSize = CGSizeMake(CGImageGetWidth(self.CGImage), CGImageGetHeight(self.CGImage)); + CGSize imageSize = CGSizeMake(CGImageGetWidth(image.CGImage), CGImageGetHeight(image.CGImage)); + + // The images have the equal size, so we could use the smallest amount of bytes because of byte padding + size_t minBytesPerRow = MIN(CGImageGetBytesPerRow(self.CGImage), CGImageGetBytesPerRow(image.CGImage)); + size_t referenceImageSizeBytes = referenceImageSize.height * minBytesPerRow; + void *referenceImagePixels = calloc(1, referenceImageSizeBytes); + void *imagePixels = calloc(1, referenceImageSizeBytes); + + if (!referenceImagePixels || !imagePixels) { + free(referenceImagePixels); + free(imagePixels); + return NO; + } + + CGContextRef referenceImageContext = CGBitmapContextCreate(referenceImagePixels, + referenceImageSize.width, + referenceImageSize.height, + CGImageGetBitsPerComponent(self.CGImage), + minBytesPerRow, + CGImageGetColorSpace(self.CGImage), + (CGBitmapInfo)kCGImageAlphaPremultipliedLast + ); + CGContextRef imageContext = CGBitmapContextCreate(imagePixels, + imageSize.width, + imageSize.height, + CGImageGetBitsPerComponent(image.CGImage), + minBytesPerRow, + CGImageGetColorSpace(image.CGImage), + (CGBitmapInfo)kCGImageAlphaPremultipliedLast + ); + + if (!referenceImageContext || !imageContext) { + CGContextRelease(referenceImageContext); + CGContextRelease(imageContext); + free(referenceImagePixels); + free(imagePixels); + return NO; + } + + CGContextDrawImage(referenceImageContext, CGRectMake(0, 0, referenceImageSize.width, referenceImageSize.height), self.CGImage); + CGContextDrawImage(imageContext, CGRectMake(0, 0, imageSize.width, imageSize.height), image.CGImage); + + CGContextRelease(referenceImageContext); + CGContextRelease(imageContext); + + BOOL imageEqual = YES; + + // Do a fast compare if we can + if (tolerance == 0) { + imageEqual = (memcmp(referenceImagePixels, imagePixels, referenceImageSizeBytes) == 0); + } else { + // Go through each pixel in turn and see if it is different + const NSInteger pixelCount = referenceImageSize.width * referenceImageSize.height; + + FBComparePixel *p1 = referenceImagePixels; + FBComparePixel *p2 = imagePixels; + + NSInteger numDiffPixels = 0; + for (int n = 0; n < pixelCount; ++n) { + // If this pixel is different, increment the pixel diff count and see + // if we have hit our limit. + if (p1->raw != p2->raw) { + numDiffPixels ++; + + CGFloat percent = (CGFloat)numDiffPixels / pixelCount; + if (percent > tolerance) { + imageEqual = NO; + break; + } + } + + p1++; + p2++; + } + } + + free(referenceImagePixels); + free(imagePixels); + + return imageEqual; +} + +@end diff --git a/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Diff.h b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Diff.h new file mode 100644 index 0000000..a0863f3 --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Diff.h @@ -0,0 +1,37 @@ +// +// Created by Gabriel Handford on 3/1/09. +// Copyright 2009-2013. All rights reserved. +// Created by John Boiles on 10/20/11. +// Copyright (c) 2011. All rights reserved +// Modified by Felix Schulze on 2/11/13. +// Copyright 2013. All rights reserved. +// +// 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. +// + +#import + +@interface UIImage (Diff) + +- (UIImage *)fb_diffWithImage:(UIImage *)image; + +@end diff --git a/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Diff.m b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Diff.m new file mode 100644 index 0000000..ebb72fe --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Diff.m @@ -0,0 +1,56 @@ +// +// Created by Gabriel Handford on 3/1/09. +// Copyright 2009-2013. All rights reserved. +// Created by John Boiles on 10/20/11. +// Copyright (c) 2011. All rights reserved +// Modified by Felix Schulze on 2/11/13. +// Copyright 2013. All rights reserved. +// +// 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. +// + +#import + +@implementation UIImage (Diff) + +- (UIImage *)fb_diffWithImage:(UIImage *)image +{ + if (!image) { + return nil; + } + CGSize imageSize = CGSizeMake(MAX(self.size.width, image.size.width), MAX(self.size.height, image.size.height)); + UIGraphicsBeginImageContextWithOptions(imageSize, YES, 0); + CGContextRef context = UIGraphicsGetCurrentContext(); + [self drawInRect:CGRectMake(0, 0, self.size.width, self.size.height)]; + CGContextSetAlpha(context, 0.5); + CGContextBeginTransparencyLayer(context, NULL); + [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)]; + CGContextSetBlendMode(context, kCGBlendModeDifference); + CGContextSetFillColorWithColor(context,[UIColor whiteColor].CGColor); + CGContextFillRect(context, CGRectMake(0, 0, self.size.width, self.size.height)); + CGContextEndTransparencyLayer(context); + UIImage *returnImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return returnImage; +} + +@end diff --git a/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Snapshot.h b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Snapshot.h new file mode 100644 index 0000000..b0d5b26 --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Snapshot.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2015, 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 + +@interface UIImage (Snapshot) + +/// Uses renderInContext: to get a snapshot of the layer. ++ (UIImage *)fb_imageForLayer:(CALayer *)layer; + +/// Uses renderInContext: to get a snapshot of the view layer. ++ (UIImage *)fb_imageForViewLayer:(UIView *)view; + +/// Uses drawViewHierarchyInRect: to get a snapshot of the view and adds the view into a window if needed. ++ (UIImage *)fb_imageForView:(UIView *)view; + +@end diff --git a/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Snapshot.m b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Snapshot.m new file mode 100644 index 0000000..c792077 --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Snapshot.m @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2015, 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 + +@implementation UIImage (Snapshot) + ++ (UIImage *)fb_imageForLayer:(CALayer *)layer +{ + CGRect bounds = layer.bounds; + NSAssert1(CGRectGetWidth(bounds), @"Zero width for layer %@", layer); + NSAssert1(CGRectGetHeight(bounds), @"Zero height for layer %@", layer); + + UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0); + CGContextRef context = UIGraphicsGetCurrentContext(); + NSAssert1(context, @"Could not generate context for layer %@", layer); + CGContextSaveGState(context); + [layer layoutIfNeeded]; + [layer renderInContext:context]; + CGContextRestoreGState(context); + + UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return snapshot; +} + ++ (UIImage *)fb_imageForViewLayer:(UIView *)view +{ + [view layoutIfNeeded]; + return [self fb_imageForLayer:view.layer]; +} + ++ (UIImage *)fb_imageForView:(UIView *)view +{ + CGRect bounds = view.bounds; + NSAssert1(CGRectGetWidth(bounds), @"Zero width for view %@", view); + NSAssert1(CGRectGetHeight(bounds), @"Zero height for view %@", view); + + UIWindow *window = view.window; + if (window == nil) { + window = [[UIWindow alloc] initWithFrame:bounds]; + [window addSubview:view]; + [window makeKeyAndVisible]; + } + + UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0); + [view layoutIfNeeded]; + [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES]; + + UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return snapshot; +} + +@end diff --git a/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.h b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.h new file mode 100644 index 0000000..54e301e --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.h @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2015, 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 + +#import + +#import + +#import + +/* + There are three ways of setting reference image directories. + + 1. Set the preprocessor macro FB_REFERENCE_IMAGE_DIR to a double quoted + c-string with the path. + 2. Set an environment variable named FB_REFERENCE_IMAGE_DIR with the path. This + takes precedence over the preprocessor macro to allow for run-time override. + 3. Keep everything unset, which will cause the reference images to be looked up + inside the bundle holding the current test, in the + Resources/ReferenceImages_* directories. + */ +#ifndef FB_REFERENCE_IMAGE_DIR +#define FB_REFERENCE_IMAGE_DIR "" +#endif + +/** + Similar to our much-loved XCTAssert() macros. Use this to perform your test. No need to write an explanation, though. + @param view The view to snapshot + @param identifier An optional identifier, used if there are multiple snapshot tests in a given -test method. + @param suffixes An NSOrderedSet of strings for the different suffixes + @param tolerance The percentage of pixels that can differ and still count as an 'identical' view + */ +#define FBSnapshotVerifyViewWithOptions(view__, identifier__, suffixes__, tolerance__) \ + FBSnapshotVerifyViewOrLayerWithOptions(View, view__, identifier__, suffixes__, tolerance__) + +#define FBSnapshotVerifyView(view__, identifier__) \ + FBSnapshotVerifyViewWithOptions(view__, identifier__, FBSnapshotTestCaseDefaultSuffixes(), 0) + + +/** + Similar to our much-loved XCTAssert() macros. Use this to perform your test. No need to write an explanation, though. + @param layer The layer to snapshot + @param identifier An optional identifier, used is there are multiple snapshot tests in a given -test method. + @param suffixes An NSOrderedSet of strings for the different suffixes + @param tolerance The percentage of pixels that can differ and still count as an 'identical' layer + */ +#define FBSnapshotVerifyLayerWithOptions(layer__, identifier__, suffixes__, tolerance__) \ + FBSnapshotVerifyViewOrLayerWithOptions(Layer, layer__, identifier__, suffixes__, tolerance__) + +#define FBSnapshotVerifyLayer(layer__, identifier__) \ + FBSnapshotVerifyLayerWithOptions(layer__, identifier__, FBSnapshotTestCaseDefaultSuffixes(), 0) + + +#define FBSnapshotVerifyViewOrLayerWithOptions(what__, viewOrLayer__, identifier__, suffixes__, tolerance__) \ +{ \ + NSString *referenceImageDirectory = [self getReferenceImageDirectoryWithDefault:(@ FB_REFERENCE_IMAGE_DIR)]; \ + XCTAssertNotNil(referenceImageDirectory, @"Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.");\ + XCTAssertTrue((suffixes__.count > 0), @"Suffixes set cannot be empty %@", suffixes__); \ + \ + BOOL testSuccess__ = NO; \ + NSError *error__ = nil; \ + NSMutableArray *errors__ = [NSMutableArray array]; \ + \ + if (self.recordMode) { \ + \ + NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@"%@%@", referenceImageDirectory, suffixes__.firstObject]; \ + BOOL referenceImageSaved__ = [self compareSnapshotOf ## what__ :(viewOrLayer__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) tolerance:(tolerance__) error:&error__]; \ + if (!referenceImageSaved__) { \ + [errors__ addObject:error__]; \ + } \ + } else { \ + \ + for (NSString *suffix__ in suffixes__) { \ + NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@"%@%@", referenceImageDirectory, suffix__]; \ + BOOL referenceImageAvailable = [self referenceImageRecordedInDirectory:referenceImagesDirectory__ identifier:(identifier__) error:&error__]; \ + \ + if (referenceImageAvailable) { \ + BOOL comparisonSuccess__ = [self compareSnapshotOf ## what__ :(viewOrLayer__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) tolerance:(tolerance__) error:&error__]; \ + [errors__ removeAllObjects]; \ + if (comparisonSuccess__) { \ + testSuccess__ = YES; \ + break; \ + } else { \ + [errors__ addObject:error__]; \ + } \ + } else { \ + [errors__ addObject:error__]; \ + } \ + } \ + } \ + XCTAssertTrue(testSuccess__, @"Snapshot comparison failed: %@", errors__.firstObject); \ + XCTAssertFalse(self.recordMode, @"Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!"); \ +} + + +/** + The base class of view snapshotting tests. If you have small UI component, it's often easier to configure it in a test + and compare an image of the view to a reference image that write lots of complex layout-code tests. + + In order to flip the tests in your subclass to record the reference images set @c recordMode to @c YES. + + @attention When recording, the reference image directory should be explicitly + set, otherwise the images may be written to somewhere inside the + simulator directory. + + For example: + @code + - (void)setUp + { + [super setUp]; + self.recordMode = YES; + } + @endcode + */ +@interface FBSnapshotTestCase : XCTestCase + +/** + When YES, the test macros will save reference images, rather than performing an actual test. + */ +@property (readwrite, nonatomic, assign) BOOL recordMode; + +/** + When @c YES appends the name of the device model and OS to the snapshot file name. + The default value is @c NO. + */ +@property (readwrite, nonatomic, assign, getter=isDeviceAgnostic) BOOL deviceAgnostic; + +/** + When YES, renders a snapshot of the complete view hierarchy as visible onscreen. + There are several things that do not work if renderInContext: is used. + - UIVisualEffect #70 + - UIAppearance #91 + - Size Classes #92 + + @attention If the view does't belong to a UIWindow, it will create one and add the view as a subview. + */ +@property (readwrite, nonatomic, assign) BOOL usesDrawViewHierarchyInRect; + +- (void)setUp NS_REQUIRES_SUPER; +- (void)tearDown NS_REQUIRES_SUPER; + +/** + Performs the comparison or records a snapshot of the layer if recordMode is YES. + @param layer The Layer to snapshot + @param referenceImagesDirectory The directory in which reference images are stored. + @param identifier An optional identifier, used if there are multiple snapshot tests in a given -test method. + @param tolerance The percentage difference to still count as identical - 0 mean pixel perfect, 1 means I don't care + @param errorPtr An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc). + @returns YES if the comparison (or saving of the reference image) succeeded. + */ +- (BOOL)compareSnapshotOfLayer:(CALayer *)layer + referenceImagesDirectory:(NSString *)referenceImagesDirectory + identifier:(NSString *)identifier + tolerance:(CGFloat)tolerance + error:(NSError **)errorPtr; + +/** + Performs the comparison or records a snapshot of the view if recordMode is YES. + @param view The view to snapshot + @param referenceImagesDirectory The directory in which reference images are stored. + @param identifier An optional identifier, used if there are multiple snapshot tests in a given -test method. + @param tolerance The percentage difference to still count as identical - 0 mean pixel perfect, 1 means I don't care + @param errorPtr An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc). + @returns YES if the comparison (or saving of the reference image) succeeded. + */ +- (BOOL)compareSnapshotOfView:(UIView *)view + referenceImagesDirectory:(NSString *)referenceImagesDirectory + identifier:(NSString *)identifier + tolerance:(CGFloat)tolerance + error:(NSError **)errorPtr; + +/** + Checks if reference image with identifier based name exists in the reference images directory. + @param referenceImagesDirectory The directory in which reference images are stored. + @param identifier An optional identifier, used if there are multiple snapshot tests in a given -test method. + @param errorPtr An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc). + @returns YES if reference image exists. + */ +- (BOOL)referenceImageRecordedInDirectory:(NSString *)referenceImagesDirectory + identifier:(NSString *)identifier + error:(NSError **)errorPtr; + +/** + Returns the reference image directory. + + Helper function used to implement the assert macros. + + @param dir directory to use if environment variable not specified. Ignored if null or empty. + */ +- (NSString *)getReferenceImageDirectoryWithDefault:(NSString *)dir; + +@end diff --git a/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.m b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.m new file mode 100644 index 0000000..3ee351f --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.m @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2015, 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 +#import + +@implementation FBSnapshotTestCase +{ + FBSnapshotTestController *_snapshotController; +} + +#pragma mark - Overrides + +- (void)setUp +{ + [super setUp]; + _snapshotController = [[FBSnapshotTestController alloc] initWithTestName:NSStringFromClass([self class])]; +} + +- (void)tearDown +{ + _snapshotController = nil; + [super tearDown]; +} + +- (BOOL)recordMode +{ + return _snapshotController.recordMode; +} + +- (void)setRecordMode:(BOOL)recordMode +{ + NSAssert1(_snapshotController, @"%s cannot be called before [super setUp]", __FUNCTION__); + _snapshotController.recordMode = recordMode; +} + +- (BOOL)isDeviceAgnostic +{ + return _snapshotController.deviceAgnostic; +} + +- (void)setDeviceAgnostic:(BOOL)deviceAgnostic +{ + NSAssert1(_snapshotController, @"%s cannot be called before [super setUp]", __FUNCTION__); + _snapshotController.deviceAgnostic = deviceAgnostic; +} + +- (BOOL)usesDrawViewHierarchyInRect +{ + return _snapshotController.usesDrawViewHierarchyInRect; +} + +- (void)setUsesDrawViewHierarchyInRect:(BOOL)usesDrawViewHierarchyInRect +{ + NSAssert1(_snapshotController, @"%s cannot be called before [super setUp]", __FUNCTION__); + _snapshotController.usesDrawViewHierarchyInRect = usesDrawViewHierarchyInRect; +} + +#pragma mark - Public API + +- (BOOL)compareSnapshotOfLayer:(CALayer *)layer + referenceImagesDirectory:(NSString *)referenceImagesDirectory + identifier:(NSString *)identifier + tolerance:(CGFloat)tolerance + error:(NSError **)errorPtr +{ + return [self _compareSnapshotOfViewOrLayer:layer + referenceImagesDirectory:referenceImagesDirectory + identifier:identifier + tolerance:tolerance + error:errorPtr]; +} + +- (BOOL)compareSnapshotOfView:(UIView *)view + referenceImagesDirectory:(NSString *)referenceImagesDirectory + identifier:(NSString *)identifier + tolerance:(CGFloat)tolerance + error:(NSError **)errorPtr +{ + return [self _compareSnapshotOfViewOrLayer:view + referenceImagesDirectory:referenceImagesDirectory + identifier:identifier + tolerance:tolerance + error:errorPtr]; +} + +- (BOOL)referenceImageRecordedInDirectory:(NSString *)referenceImagesDirectory + identifier:(NSString *)identifier + error:(NSError **)errorPtr +{ + NSAssert1(_snapshotController, @"%s cannot be called before [super setUp]", __FUNCTION__); + _snapshotController.referenceImagesDirectory = referenceImagesDirectory; + UIImage *referenceImage = [_snapshotController referenceImageForSelector:self.invocation.selector + identifier:identifier + error:errorPtr]; + + return (referenceImage != nil); +} + +- (NSString *)getReferenceImageDirectoryWithDefault:(NSString *)dir +{ + NSString *envReferenceImageDirectory = [NSProcessInfo processInfo].environment[@"FB_REFERENCE_IMAGE_DIR"]; + if (envReferenceImageDirectory) { + return envReferenceImageDirectory; + } + if (dir && dir.length > 0) { + return dir; + } + return [[NSBundle bundleForClass:self.class].resourcePath stringByAppendingPathComponent:@"ReferenceImages"]; +} + + +#pragma mark - Private API + +- (BOOL)_compareSnapshotOfViewOrLayer:(id)viewOrLayer + referenceImagesDirectory:(NSString *)referenceImagesDirectory + identifier:(NSString *)identifier + tolerance:(CGFloat)tolerance + error:(NSError **)errorPtr +{ + _snapshotController.referenceImagesDirectory = referenceImagesDirectory; + return [_snapshotController compareSnapshotOfViewOrLayer:viewOrLayer + selector:self.invocation.selector + identifier:identifier + tolerance:tolerance + error:errorPtr]; +} + +@end diff --git a/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCasePlatform.h b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCasePlatform.h new file mode 100644 index 0000000..e04acf2 --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCasePlatform.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015, 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 + +#ifdef __cplusplus +extern "C" { +#endif + +/** + Returns a Boolean value that indicates whether the snapshot test is running in 64Bit. + This method is a convenience for creating the suffixes set based on the architecture + that the test is running. + + @returns @c YES if the test is running in 64bit, otherwise @c NO. + */ +BOOL FBSnapshotTestCaseIs64Bit(void); + +/** + Returns a default set of strings that is used to append a suffix based on the architectures. + @warning Do not modify this function, you can create your own and use it with @c FBSnapshotVerifyViewWithOptions() + + @returns An @c NSOrderedSet object containing strings that are appended to the reference images directory. + */ +NSOrderedSet *FBSnapshotTestCaseDefaultSuffixes(void); + +/** + Returns a fully «normalized» file name. + Strips punctuation and spaces and replaces them with @c _. Also appends the device model, running OS and screen size to the file name. + + @returns An @c NSString object containing the passed @c fileName with the device model, OS and screen size appended at the end. + */ +NSString *FBDeviceAgnosticNormalizedFileName(NSString *fileName); + +#ifdef __cplusplus +} +#endif diff --git a/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m new file mode 100644 index 0000000..4f6fb01 --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2015, 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 +#import + +BOOL FBSnapshotTestCaseIs64Bit(void) +{ +#if __LP64__ + return YES; +#else + return NO; +#endif +} + +NSOrderedSet *FBSnapshotTestCaseDefaultSuffixes(void) +{ + NSMutableOrderedSet *suffixesSet = [[NSMutableOrderedSet alloc] init]; + [suffixesSet addObject:@"_32"]; + [suffixesSet addObject:@"_64"]; + if (FBSnapshotTestCaseIs64Bit()) { + return [suffixesSet reversedOrderedSet]; + } + return [suffixesSet copy]; +} + +NSString *FBDeviceAgnosticNormalizedFileName(NSString *fileName) +{ + UIDevice *device = [UIDevice currentDevice]; + CGSize screenSize = [[UIApplication sharedApplication] keyWindow].bounds.size; + NSString *os = device.systemVersion; + + fileName = [NSString stringWithFormat:@"%@_%@%@_%.0fx%.0f", fileName, device.model, os, screenSize.width, screenSize.height]; + + NSMutableCharacterSet *invalidCharacters = [NSMutableCharacterSet new]; + [invalidCharacters formUnionWithCharacterSet:[NSCharacterSet whitespaceCharacterSet]]; + [invalidCharacters formUnionWithCharacterSet:[NSCharacterSet punctuationCharacterSet]]; + NSArray *validComponents = [fileName componentsSeparatedByCharactersInSet:invalidCharacters]; + fileName = [validComponents componentsJoinedByString:@"_"]; + + return fileName; +} \ No newline at end of file diff --git a/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestController.h b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestController.h new file mode 100644 index 0000000..5719aba --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestController.h @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2015, 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 +#import + +typedef NS_ENUM(NSInteger, FBSnapshotTestControllerErrorCode) { + FBSnapshotTestControllerErrorCodeUnknown, + FBSnapshotTestControllerErrorCodeNeedsRecord, + FBSnapshotTestControllerErrorCodePNGCreationFailed, + FBSnapshotTestControllerErrorCodeImagesDifferentSizes, + FBSnapshotTestControllerErrorCodeImagesDifferent, +}; +/** + Errors returned by the methods of FBSnapshotTestController use this domain. + */ +extern NSString *const FBSnapshotTestControllerErrorDomain; + +/** + Errors returned by the methods of FBSnapshotTestController sometimes contain this key in the `userInfo` dictionary. + */ +extern NSString *const FBReferenceImageFilePathKey; + +/** + Provides the heavy-lifting for FBSnapshotTestCase. It loads and saves images, along with performing the actual pixel- + by-pixel comparison of images. + Instances are initialized with the test class, and directories to read and write to. + */ +@interface FBSnapshotTestController : NSObject + +/** + Record snapshots. + */ +@property (readwrite, nonatomic, assign) BOOL recordMode; + +/** + When @c YES appends the name of the device model and OS to the snapshot file name. + The default value is @c NO. + */ +@property (readwrite, nonatomic, assign, getter=isDeviceAgnostic) BOOL deviceAgnostic; + +/** + Uses drawViewHierarchyInRect:afterScreenUpdates: to draw the image instead of renderInContext: + */ +@property (readwrite, nonatomic, assign) BOOL usesDrawViewHierarchyInRect; + +/** + The directory in which referfence images are stored. + */ +@property (readwrite, nonatomic, copy) NSString *referenceImagesDirectory; + +/** + @param testClass The subclass of FBSnapshotTestCase that is using this controller. + @returns An instance of FBSnapshotTestController. + */ +- (instancetype)initWithTestClass:(Class)testClass; + +/** + Designated initializer. + @param testName The name of the tests. + @returns An instance of FBSnapshotTestController. + */ +- (instancetype)initWithTestName:(NSString *)testName; + +/** + Performs the comparison of the layer. + @param layer The Layer to snapshot. + @param selector The test method being run. + @param identifier An optional identifier, used is there are muliptle snapshot tests in a given -test method. + @param error An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc). + @returns YES if the comparison (or saving of the reference image) succeeded. + */ +- (BOOL)compareSnapshotOfLayer:(CALayer *)layer + selector:(SEL)selector + identifier:(NSString *)identifier + error:(NSError **)errorPtr; + +/** + Performs the comparison of the view. + @param view The view to snapshot. + @param selector The test method being run. + @param identifier An optional identifier, used is there are muliptle snapshot tests in a given -test method. + @param error An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc). + @returns YES if the comparison (or saving of the reference image) succeeded. + */ +- (BOOL)compareSnapshotOfView:(UIView *)view + selector:(SEL)selector + identifier:(NSString *)identifier + error:(NSError **)errorPtr; + +/** + Performs the comparison of a view or layer. + @param view The view or layer to snapshot. + @param selector The test method being run. + @param identifier An optional identifier, used is there are muliptle snapshot tests in a given -test method. + @param tolerance The percentage of pixels that can differ and still be considered 'identical' + @param error An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc). + @returns YES if the comparison (or saving of the reference image) succeeded. + */ +- (BOOL)compareSnapshotOfViewOrLayer:(id)viewOrLayer + selector:(SEL)selector + identifier:(NSString *)identifier + tolerance:(CGFloat)tolerance + error:(NSError **)errorPtr; + +/** + Loads a reference image. + @param selector The test method being run. + @param identifier The optional identifier, used when multiple images are tested in a single -test method. + @param errorPtr An error, if this methods returns nil, the error will be something useful. + @returns An image. + */ +- (UIImage *)referenceImageForSelector:(SEL)selector + identifier:(NSString *)identifier + error:(NSError **)errorPtr; + +/** + Performs a pixel-by-pixel comparison of the two images with an allowable margin of error. + @param referenceImage The reference (correct) image. + @param image The image to test against the reference. + @param tolerance The percentage of pixels that can differ and still be considered 'identical' + @param errorPtr An error that indicates why the comparison failed if it does. + @returns YES if the comparison succeeded and the images are the same(ish). + */ +- (BOOL)compareReferenceImage:(UIImage *)referenceImage + toImage:(UIImage *)image + tolerance:(CGFloat)tolerance + error:(NSError **)errorPtr; + +/** + Saves the reference image and the test image to `failedOutputDirectory`. + @param referenceImage The reference (correct) image. + @param testImage The image to test against the reference. + @param selector The test method being run. + @param identifier The optional identifier, used when multiple images are tested in a single -test method. + @param errorPtr An error that indicates why the comparison failed if it does. + @returns YES if the save succeeded. + */ +- (BOOL)saveFailedReferenceImage:(UIImage *)referenceImage + testImage:(UIImage *)testImage + selector:(SEL)selector + identifier:(NSString *)identifier + error:(NSError **)errorPtr; +@end diff --git a/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestController.m b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestController.m new file mode 100644 index 0000000..4cebe10 --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestController.m @@ -0,0 +1,356 @@ +/* + * Copyright (c) 2015, 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 +#import +#import +#import +#import + +#import + +NSString *const FBSnapshotTestControllerErrorDomain = @"FBSnapshotTestControllerErrorDomain"; +NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey"; + +typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) { + FBTestSnapshotFileNameTypeReference, + FBTestSnapshotFileNameTypeFailedReference, + FBTestSnapshotFileNameTypeFailedTest, + FBTestSnapshotFileNameTypeFailedTestDiff, +}; + +@implementation FBSnapshotTestController +{ + NSString *_testName; + NSFileManager *_fileManager; +} + +#pragma mark - Initializers + +- (instancetype)initWithTestClass:(Class)testClass; +{ + return [self initWithTestName:NSStringFromClass(testClass)]; +} + +- (instancetype)initWithTestName:(NSString *)testName +{ + if (self = [super init]) { + _testName = [testName copy]; + _deviceAgnostic = NO; + + _fileManager = [[NSFileManager alloc] init]; + } + return self; +} + +#pragma mark - Overrides + +- (NSString *)description +{ + return [NSString stringWithFormat:@"%@ %@", [super description], _referenceImagesDirectory]; +} + +#pragma mark - Public API + +- (BOOL)compareSnapshotOfLayer:(CALayer *)layer + selector:(SEL)selector + identifier:(NSString *)identifier + error:(NSError **)errorPtr +{ + return [self compareSnapshotOfViewOrLayer:layer + selector:selector + identifier:identifier + tolerance:0 + error:errorPtr]; +} + +- (BOOL)compareSnapshotOfView:(UIView *)view + selector:(SEL)selector + identifier:(NSString *)identifier + error:(NSError **)errorPtr +{ + return [self compareSnapshotOfViewOrLayer:view + selector:selector + identifier:identifier + tolerance:0 + error:errorPtr]; +} + +- (BOOL)compareSnapshotOfViewOrLayer:(id)viewOrLayer + selector:(SEL)selector + identifier:(NSString *)identifier + tolerance:(CGFloat)tolerance + error:(NSError **)errorPtr +{ + if (self.recordMode) { + return [self _recordSnapshotOfViewOrLayer:viewOrLayer selector:selector identifier:identifier error:errorPtr]; + } else { + return [self _performPixelComparisonWithViewOrLayer:viewOrLayer selector:selector identifier:identifier tolerance:tolerance error:errorPtr]; + } +} + +- (UIImage *)referenceImageForSelector:(SEL)selector + identifier:(NSString *)identifier + error:(NSError **)errorPtr +{ + NSString *filePath = [self _referenceFilePathForSelector:selector identifier:identifier]; + UIImage *image = [UIImage imageWithContentsOfFile:filePath]; + if (nil == image && NULL != errorPtr) { + BOOL exists = [_fileManager fileExistsAtPath:filePath]; + if (!exists) { + *errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain + code:FBSnapshotTestControllerErrorCodeNeedsRecord + userInfo:@{ + FBReferenceImageFilePathKey: filePath, + NSLocalizedDescriptionKey: @"Unable to load reference image.", + NSLocalizedFailureReasonErrorKey: @"Reference image not found. You need to run the test in record mode", + }]; + } else { + *errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain + code:FBSnapshotTestControllerErrorCodeUnknown + userInfo:nil]; + } + } + return image; +} + +- (BOOL)compareReferenceImage:(UIImage *)referenceImage + toImage:(UIImage *)image + tolerance:(CGFloat)tolerance + error:(NSError **)errorPtr +{ + if (CGSizeEqualToSize(referenceImage.size, image.size)) { + BOOL imagesEqual = [referenceImage fb_compareWithImage:image tolerance:tolerance]; + if (NULL != errorPtr) { + *errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain + code:FBSnapshotTestControllerErrorCodeImagesDifferent + userInfo:@{ + NSLocalizedDescriptionKey: @"Images different", + }]; + } + return imagesEqual; + } + if (NULL != errorPtr) { + *errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain + code:FBSnapshotTestControllerErrorCodeImagesDifferentSizes + userInfo:@{ + NSLocalizedDescriptionKey: @"Images different sizes", + NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"referenceImage:%@, image:%@", + NSStringFromCGSize(referenceImage.size), + NSStringFromCGSize(image.size)], + }]; + } + return NO; +} + +- (BOOL)saveFailedReferenceImage:(UIImage *)referenceImage + testImage:(UIImage *)testImage + selector:(SEL)selector + identifier:(NSString *)identifier + error:(NSError **)errorPtr +{ + NSData *referencePNGData = UIImagePNGRepresentation(referenceImage); + NSData *testPNGData = UIImagePNGRepresentation(testImage); + + NSString *referencePath = [self _failedFilePathForSelector:selector + identifier:identifier + fileNameType:FBTestSnapshotFileNameTypeFailedReference]; + + NSError *creationError = nil; + BOOL didCreateDir = [_fileManager createDirectoryAtPath:[referencePath stringByDeletingLastPathComponent] + withIntermediateDirectories:YES + attributes:nil + error:&creationError]; + if (!didCreateDir) { + if (NULL != errorPtr) { + *errorPtr = creationError; + } + return NO; + } + + if (![referencePNGData writeToFile:referencePath options:NSDataWritingAtomic error:errorPtr]) { + return NO; + } + + NSString *testPath = [self _failedFilePathForSelector:selector + identifier:identifier + fileNameType:FBTestSnapshotFileNameTypeFailedTest]; + + if (![testPNGData writeToFile:testPath options:NSDataWritingAtomic error:errorPtr]) { + return NO; + } + + NSString *diffPath = [self _failedFilePathForSelector:selector + identifier:identifier + fileNameType:FBTestSnapshotFileNameTypeFailedTestDiff]; + + UIImage *diffImage = [referenceImage fb_diffWithImage:testImage]; + NSData *diffImageData = UIImagePNGRepresentation(diffImage); + + if (![diffImageData writeToFile:diffPath options:NSDataWritingAtomic error:errorPtr]) { + return NO; + } + + NSLog(@"If you have Kaleidoscope installed you can run this command to see an image diff:\n" + @"ksdiff \"%@\" \"%@\"", referencePath, testPath); + + return YES; +} + +#pragma mark - Private API + +- (NSString *)_fileNameForSelector:(SEL)selector + identifier:(NSString *)identifier + fileNameType:(FBTestSnapshotFileNameType)fileNameType +{ + NSString *fileName = nil; + switch (fileNameType) { + case FBTestSnapshotFileNameTypeFailedReference: + fileName = @"reference_"; + break; + case FBTestSnapshotFileNameTypeFailedTest: + fileName = @"failed_"; + break; + case FBTestSnapshotFileNameTypeFailedTestDiff: + fileName = @"diff_"; + break; + default: + fileName = @""; + break; + } + fileName = [fileName stringByAppendingString:NSStringFromSelector(selector)]; + if (0 < identifier.length) { + fileName = [fileName stringByAppendingFormat:@"_%@", identifier]; + } + + if (self.isDeviceAgnostic) { + fileName = FBDeviceAgnosticNormalizedFileName(fileName); + } + + if ([[UIScreen mainScreen] scale] > 1) { + fileName = [fileName stringByAppendingFormat:@"@%.fx", [[UIScreen mainScreen] scale]]; + } + fileName = [fileName stringByAppendingPathExtension:@"png"]; + return fileName; +} + +- (NSString *)_referenceFilePathForSelector:(SEL)selector + identifier:(NSString *)identifier +{ + NSString *fileName = [self _fileNameForSelector:selector + identifier:identifier + fileNameType:FBTestSnapshotFileNameTypeReference]; + NSString *filePath = [_referenceImagesDirectory stringByAppendingPathComponent:_testName]; + filePath = [filePath stringByAppendingPathComponent:fileName]; + return filePath; +} + +- (NSString *)_failedFilePathForSelector:(SEL)selector + identifier:(NSString *)identifier + fileNameType:(FBTestSnapshotFileNameType)fileNameType +{ + NSString *fileName = [self _fileNameForSelector:selector + identifier:identifier + fileNameType:fileNameType]; + NSString *folderPath = NSTemporaryDirectory(); + if (getenv("IMAGE_DIFF_DIR")) { + folderPath = @(getenv("IMAGE_DIFF_DIR")); + } + NSString *filePath = [folderPath stringByAppendingPathComponent:_testName]; + filePath = [filePath stringByAppendingPathComponent:fileName]; + return filePath; +} + +- (BOOL)_performPixelComparisonWithViewOrLayer:(id)viewOrLayer + selector:(SEL)selector + identifier:(NSString *)identifier + tolerance:(CGFloat)tolerance + error:(NSError **)errorPtr +{ + UIImage *referenceImage = [self referenceImageForSelector:selector identifier:identifier error:errorPtr]; + if (nil != referenceImage) { + UIImage *snapshot = [self _imageForViewOrLayer:viewOrLayer]; + BOOL imagesSame = [self compareReferenceImage:referenceImage toImage:snapshot tolerance:tolerance error:errorPtr]; + if (!imagesSame) { + [self saveFailedReferenceImage:referenceImage + testImage:snapshot + selector:selector + identifier:identifier + error:errorPtr]; + } + return imagesSame; + } + return NO; +} + +- (BOOL)_recordSnapshotOfViewOrLayer:(id)viewOrLayer + selector:(SEL)selector + identifier:(NSString *)identifier + error:(NSError **)errorPtr +{ + UIImage *snapshot = [self _imageForViewOrLayer:viewOrLayer]; + return [self _saveReferenceImage:snapshot selector:selector identifier:identifier error:errorPtr]; +} + +- (BOOL)_saveReferenceImage:(UIImage *)image + selector:(SEL)selector + identifier:(NSString *)identifier + error:(NSError **)errorPtr +{ + BOOL didWrite = NO; + if (nil != image) { + NSString *filePath = [self _referenceFilePathForSelector:selector identifier:identifier]; + NSData *pngData = UIImagePNGRepresentation(image); + if (nil != pngData) { + NSError *creationError = nil; + BOOL didCreateDir = [_fileManager createDirectoryAtPath:[filePath stringByDeletingLastPathComponent] + withIntermediateDirectories:YES + attributes:nil + error:&creationError]; + if (!didCreateDir) { + if (NULL != errorPtr) { + *errorPtr = creationError; + } + return NO; + } + didWrite = [pngData writeToFile:filePath options:NSDataWritingAtomic error:errorPtr]; + if (didWrite) { + NSLog(@"Reference image save at: %@", filePath); + } + } else { + if (nil != errorPtr) { + *errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain + code:FBSnapshotTestControllerErrorCodePNGCreationFailed + userInfo:@{ + FBReferenceImageFilePathKey: filePath, + }]; + } + } + } + return didWrite; +} + +- (UIImage *)_imageForViewOrLayer:(id)viewOrLayer +{ + if ([viewOrLayer isKindOfClass:[UIView class]]) { + if (_usesDrawViewHierarchyInRect) { + return [UIImage fb_imageForView:viewOrLayer]; + } else { + return [UIImage fb_imageForViewLayer:viewOrLayer]; + } + } else if ([viewOrLayer isKindOfClass:[CALayer class]]) { + return [UIImage fb_imageForLayer:viewOrLayer]; + } else { + [NSException raise:@"Only UIView and CALayer classes can be snapshotted" format:@"%@", viewOrLayer]; + } + return nil; +} + +@end diff --git a/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/SwiftSupport.swift b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/SwiftSupport.swift new file mode 100644 index 0000000..d3058fb --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/SwiftSupport.swift @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2015, 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. +* +*/ + +public extension FBSnapshotTestCase { + public func FBSnapshotVerifyView(view: UIView, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) { + FBSnapshotVerifyViewOrLayer(view, identifier: identifier, suffixes: suffixes) + } + + public func FBSnapshotVerifyLayer(layer: CALayer, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) { + FBSnapshotVerifyViewOrLayer(layer, identifier: identifier, suffixes: suffixes) + } + + private func FBSnapshotVerifyViewOrLayer(viewOrLayer: AnyObject, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) { + let envReferenceImageDirectory = self.getReferenceImageDirectoryWithDefault(FB_REFERENCE_IMAGE_DIR) + var error: NSError? + var comparisonSuccess = false + + if let envReferenceImageDirectory = envReferenceImageDirectory { + for suffix in suffixes { + let referenceImagesDirectory = "\(envReferenceImageDirectory)\(suffix)" + if viewOrLayer.isKindOfClass(UIView) { + do { + try compareSnapshotOfView(viewOrLayer as! UIView, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: 0) + comparisonSuccess = true + } catch let error1 as NSError { + error = error1 + comparisonSuccess = false + } + } else if viewOrLayer.isKindOfClass(CALayer) { + do { + try compareSnapshotOfLayer(viewOrLayer as! CALayer, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: 0) + comparisonSuccess = true + } catch let error1 as NSError { + error = error1 + comparisonSuccess = false + } + } else { + assertionFailure("Only UIView and CALayer classes can be snapshotted") + } + + assert(recordMode == false, message: "Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!", file: file, line: line) + + if comparisonSuccess || recordMode { + break + } + + assert(comparisonSuccess, message: "Snapshot comparison failed: \(error)", file: file, line: line) + } + } else { + XCTFail("Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.") + } + } + + func assert(assertion: Bool, message: String, file: String, line: UInt) { + if !assertion { + XCTFail(message, file: file, line: line) + } + } +} diff --git a/Example/Pods/FBSnapshotTestCase/LICENSE b/Example/Pods/FBSnapshotTestCase/LICENSE new file mode 100644 index 0000000..2dd780c --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/LICENSE @@ -0,0 +1,29 @@ +BSD License + +For the FBSnapshotTestCase software + +Copyright (c) 2013, Facebook, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name Facebook nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Example/Pods/FBSnapshotTestCase/README.md b/Example/Pods/FBSnapshotTestCase/README.md new file mode 100644 index 0000000..bc23b83 --- /dev/null +++ b/Example/Pods/FBSnapshotTestCase/README.md @@ -0,0 +1,97 @@ +FBSnapshotTestCase +====================== + +[![Build Status](https://travis-ci.org/facebook/ios-snapshot-test-case.svg)](https://travis-ci.org/facebook/ios-snapshot-test-case) [![Cocoa Pod Version](https://cocoapod-badges.herokuapp.com/v/FBSnapshotTestCase/badge.svg)](http://cocoadocs.org/docsets/FBSnapshotTestCase/) + +What it does +------------ + +A "snapshot test case" takes a configured `UIView` or `CALayer` and uses the +`renderInContext:` method to get an image snapshot of its contents. It +compares this snapshot to a "reference image" stored in your source code +repository and fails the test if the two images don't match. + +Why? +---- + +At Facebook we write a lot of UI code. As you might imagine, each type of +feed story is rendered using a subclass of `UIView`. There are a lot of edge +cases that we want to handle correctly: + +- What if there is more text than can fit in the space available? +- What if an image doesn't match the size of an image view? +- What should the highlighted state look like? + +It's straightforward to test logic code, but less obvious how you should test +views. You can do a lot of rectangle asserts, but these are hard to understand +or visualize. Looking at an image diff shows you exactly what changed and how +it will look to users. + +We developed `FBSnapshotTestCase` to make snapshot tests easy. + +Installation with CocoaPods +--------------------------- + +1. Add the following lines to your Podfile: + + ``` + target "Tests" do + pod 'FBSnapshotTestCase' + end + ``` + + If you support iOS 7 use `FBSnapshotTestCase/Core` instead, which doesn't contain Swift support. + + Replace "Tests" with the name of your test project. + +2. There are [three ways](https://github.com/facebook/ios-snapshot-test-case/blob/master/FBSnapshotTestCase/FBSnapshotTestCase.h#L19-L29) of setting reference image directories, the recommended one is to define `FB_REFERENCE_IMAGE_DIR` in your scheme. This should point to the directory where you want reference images to be stored. At Facebook, we normally use this: + +|Name|Value| +|:---|:----| +|`FB_REFERENCE_IMAGE_DIR`|`$(SOURCE_ROOT)/$(PROJECT_NAME)Tests/ReferenceImages`| + + +![](FBSnapshotTestCaseDemo/Scheme_FB_REFERENCE_IMAGE_DIR.png) + +Creating a snapshot test +------------------------ + +1. Subclass `FBSnapshotTestCase` instead of `XCTestCase`. +2. From within your test, use `FBSnapshotVerifyView`. +3. Run the test once with `self.recordMode = YES;` in the test's `-setUp` + method. (This creates the reference images on disk.) +4. Remove the line enabling record mode and run the test. + +Features +-------- + +- Automatically names reference images on disk according to test class and + selector. +- Prints a descriptive error message to the console on failure. (Bonus: + failure message includes a one-line command to see an image diff if + you have [Kaleidoscope](http://www.kaleidoscopeapp.com) installed.) +- Supply an optional "identifier" if you want to perform multiple snapshots + in a single test method. +- Support for `CALayer` via `FBSnapshotVerifyLayer`. +- `usesDrawViewHierarchyInRect` to handle cases like `UIVisualEffect`, `UIAppearance` and Size Classes. +- `isDeviceAgnostic` to allow appending the device model (`iPhone`, `iPad`, `iPod Touch`, etc), OS version and screen size to the images (allowing to have multiple tests for the same «snapshot» for different `OS`s and devices). + +Notes +----- + +Your unit test must be an "application test", not a "logic test." (That is, it +must be run within the Simulator so that it has access to UIKit.) In Xcode 5 +and later new projects only offer application tests, but older projects will +have separate targets for the two types. + +Authors +------- + +`FBSnapshotTestCase` was written at Facebook by +[Jonathan Dann](https://facebook.com/j.p.dann) with significant contributions by +[Todd Krabach](https://facebook.com/toddkrabach). + +License +------- + +`FBSnapshotTestCase` is BSD-licensed. See `LICENSE`. diff --git a/Example/Pods/Local Podspecs/PNObject.podspec.json b/Example/Pods/Local Podspecs/PNObject.podspec.json new file mode 100644 index 0000000..2671077 --- /dev/null +++ b/Example/Pods/Local Podspecs/PNObject.podspec.json @@ -0,0 +1,24 @@ +{ + "name": "PNObject", + "version": "0.1.0", + "summary": "A short description of PNObject.", + "homepage": "https://github.com//PNObject", + "license": "MIT", + "authors": { + "Giuseppe Nucifora": "me@giuseppenucifora.com" + }, + "source": { + "git": "https://github.com//PNObject.git", + "tag": "0.1.0" + }, + "platforms": { + "ios": "7.0" + }, + "requires_arc": true, + "source_files": "Pod/Classes/**/*", + "resource_bundles": { + "PNObject": [ + "Pod/Assets/*.png" + ] + } +} diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock new file mode 100644 index 0000000..095972a --- /dev/null +++ b/Example/Pods/Manifest.lock @@ -0,0 +1,60 @@ +PODS: + - AFNetworking (3.0.4): + - AFNetworking/NSURLSession (= 3.0.4) + - AFNetworking/Reachability (= 3.0.4) + - AFNetworking/Security (= 3.0.4) + - AFNetworking/Serialization (= 3.0.4) + - AFNetworking/UIKit (= 3.0.4) + - AFNetworking/NSURLSession (3.0.4): + - AFNetworking/Reachability + - AFNetworking/Security + - AFNetworking/Serialization + - AFNetworking/Reachability (3.0.4) + - AFNetworking/Security (3.0.4) + - AFNetworking/Serialization (3.0.4) + - AFNetworking/UIKit (3.0.4): + - AFNetworking/NSURLSession + - Expecta (1.0.5) + - Expecta+Snapshots (2.0.0): + - Expecta (~> 1.0) + - FBSnapshotTestCase/Core (~> 2.0.3) + - FBSnapshotTestCase (2.0.7): + - FBSnapshotTestCase/SwiftSupport (= 2.0.7) + - FBSnapshotTestCase/Core (2.0.7) + - FBSnapshotTestCase/SwiftSupport (2.0.7): + - FBSnapshotTestCase/Core + - NSDate_Utils (0.1.0) + - PEAR-FileManager-iOS (1.3.1) + - PNObject (0.1.0) + - Specta (1.0.5) + - UIDevice-Utils (0.1.2) + +DEPENDENCIES: + - AFNetworking + - Expecta + - Expecta+Snapshots + - FBSnapshotTestCase + - NSDate_Utils + - PEAR-FileManager-iOS + - PNObject (from `../`) + - Specta + - UIDevice-Utils + +EXTERNAL SOURCES: + PNObject: + :path: "../" + +SPEC CHECKSUMS: + AFNetworking: a0075feb321559dc78d9d85b55d11caa19eabb93 + Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe + Expecta+Snapshots: 29b38dd695bc72a0ed2bea833937d78df41943ba + FBSnapshotTestCase: 7e85180d0d141a0cf472352edda7e80d7eaeb547 + NSDate_Utils: 4a57f91094123d5b7600c7de8c9ad9e1d43306a3 + PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3 + PNObject: c76ad7edcc1e09717e48eb9554f6d6eb422ea70e + Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2 + UIDevice-Utils: 14362004e88f8cc05d8ec68369724a5972faadec + +PODFILE CHECKSUM: 6a156edc70605054ee3ec9b0a6d6af416e100bf0 + +COCOAPODS: 1.0.0.beta.1 diff --git a/Example/Pods/NSDate_Utils/LICENSE b/Example/Pods/NSDate_Utils/LICENSE new file mode 100644 index 0000000..5f646ce --- /dev/null +++ b/Example/Pods/NSDate_Utils/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015 Giuseppe Nucifora + +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. diff --git a/Example/Pods/NSDate_Utils/Pod/Classes/NSDate+NSDate_Util.h b/Example/Pods/NSDate_Utils/Pod/Classes/NSDate+NSDate_Util.h new file mode 100755 index 0000000..fe7662d --- /dev/null +++ b/Example/Pods/NSDate_Utils/Pod/Classes/NSDate+NSDate_Util.h @@ -0,0 +1,114 @@ +// +// NSDate+NSDate_Util.h +// +// Created by Giuseppe Nucifora on 11/02/14. +// Copyright (c) 2014 Giuseppe Nucifora. All rights reserved. +// + +#import + +#define kSunRiseMinutes 5*60 +#define kSunSetMinutes 19*60 + +#define kMoonRiseMinutes 17*60 +#define kMoonSetMinutes 7*60 + +static NSString *kNSDateHelperFormatFullDateWithTime = @"MMM d, yyyy h:mm a"; +static NSString *kNSDateHelperFormatFullDate = @"MMM d, yyyy"; +static NSString *kNSDateHelperFormatShortDateWithTime = @"MMM d h:mm a"; +static NSString *kNSDateHelperFormatShortDate = @"MMM d"; +static NSString *kNSDateHelperFormatWeekday = @"EEEE"; +static NSString *kNSDateHelperFormatWeekdayWithTime = @"EEEE h:mm a"; +static NSString *kNSDateHelperFormatTime = @"h:mm a"; +static NSString *kNSDateHelperFormatTimeWithPrefix = @"'at' h:mm a"; +static NSString *kNSDateHelperFormatSQLDate = @"yyyy-MM-dd"; +static NSString *kNSDateHelperFormatSQLTime = @"HH:mm:ss"; +static NSString *kNSDateHelperFormatSQLDateWithTime = @"yyyy-MM-dd HH:mm:ss"; +static NSString *kNSDateHelperFormatSQLDate_shashSeparated = @"yyyy/MM/dd"; +static NSString *kNSDateHelperFormatSQLDate_notSlashSeparated = @"yyyy-MM-dd"; +static NSString *kNSDateHelperFormatSQLDateWithTime_shashSeparated = @"yyyy/MM/dd HH:mm:ss"; +static NSString *kNSDateHelperFormatSQLDateIT = @"dd-MM-yyyy"; +static NSString *kNSDateHelperFormatSQLDateEN = @"MM-dd-yyyy"; +static NSString *kNSDateHelperFormatSQLDateIT_shashSeparated = @"dd/MM/yyyy"; +static NSString *kNSDateHelperFormatSQLDateEN_shashSeparated = @"MM/dd/yyyy"; + +@interface NSDate (NSDate_Util) + ++ (void)initializeStatics; + ++ (NSCalendar *) sharedCalendar; ++ (NSDateFormatter *) sharedDateFormatter; + +- (NSDate *) dateToNearestMinutes:(NSInteger)minutes; + +- (NSDate *) dateByAddingMinutes:(NSInteger) dMinutes; +- (NSDate *) dateByAddingHours:(NSInteger) hours; +- (NSDate*) dateByAddingDays:(NSInteger) days; +- (NSDate*) dateByAddingYears:(NSInteger) years; + +- (NSDate *) dateBySubtractingMinutes:(NSInteger) dMinutes; +- (NSDate *) dateBySubtractingHours:(NSInteger) hours; +- (NSDate *) dateBySubtractingDays:(NSInteger) days; +- (NSDate *) dateBySubtractingYears:(NSInteger) years; + +- (NSDate *) dateAtStartOfDay; + +- (NSInteger) minutesAfterDate:(NSDate *) aDate; +- (CGFloat) distanceInWeeksToDate:(NSDate *) anotherDate; +- (CGFloat) distanceInDaysToDate:(NSDate *) anotherDate; +- (CGFloat) distanceInHoursToDate:(NSDate *) anotherDate; +- (CGFloat) distanceInMinutesToDate:(NSDate *) anotherDate; +- (CGFloat) distanceInSeconsToDate:(NSDate *) anotherDate; + +- (NSDate *) toLocalTime; +- (NSDate *) toGlobalTime; + +- (BOOL) isSameYearAsDate:(NSDate *) aDate; +- (BOOL) isEarlierThanDate:(NSDate *) aDate; +- (BOOL) isLaterThanDate:(NSDate *) aDate; + +- (NSUInteger) daysAgo; +- (NSUInteger) daysAgoAgainstMidnight; +- (NSString *) stringDaysAgo; +- (NSString *) stringDaysAgoAgainstMidnight:(BOOL)flag; +- (NSUInteger) monthDay; +- (NSUInteger) weekday; +- (NSUInteger) month; +- (NSUInteger) weekNumber; +- (NSUInteger) hour; +- (NSUInteger) minute; +- (NSUInteger) year; +- (long int) utcTimeStamp; //full seconds since ++ (NSDate *) dateFromString:(NSString *) string; ++ (NSDate *) dateFromString:(NSString *) string withFormat:(NSString *) format; ++ (NSDate *) dateFromString:(NSString *) string withFormat:(NSString *) format withTimeZone:(NSTimeZone*) timeZone; ++ (NSString *) stringFromDate:(NSDate *) date withFormat:(NSString *) string; ++ (NSString *) stringFromDate:(NSDate *) date; ++ (NSString *) stringForDisplayFromDate:(NSDate *) date; ++ (NSString *) stringForDisplayFromDate:(NSDate *) date prefixed:(BOOL) prefixed; ++ (NSString *) stringForDisplayFromDate:(NSDate *) date prefixed:(BOOL) prefixed alwaysDisplayTime:(BOOL)displayTime; +- (NSString *) string; +- (NSString *) stringWithFormat:(NSString *) format; +- (NSString *) stringWithFormat:(NSString *) format timeZone:(NSTimeZone*) timezone; +- (NSString *) stringWithDateStyle:(NSDateFormatterStyle) dateStyle timeStyle:(NSDateFormatterStyle) timeStyle; +- (NSDate *) beginningOfWeek; +- (NSDate *) beginningOfDay; +- (NSDate *) endOfWeek; ++ (NSString *) dateFormatString; ++ (NSString *) timeFormatString; ++ (NSString *) timestampFormatString; ++ (NSString *) dbFormatString; + ++ (NSString *) parseDateFormatFromString:(NSString *) dateString; + ++ (NSString *) WCFStringFromDate:(NSDate*) date; + ++ (NSArray*) getSlotTimesFromDate:(NSDate*) date distanceMinutes:(NSInteger) minutes; + +- (BOOL)isSameDayAsDate:(NSDate*)otherDate; + ++ (NSString *) getUniversalHourFromDateString:(NSString *) string formatterString:(NSString*) formatterString andUppercaseString:(BOOL) uppercaseString; +- (NSString *) getUniversalHourUppercaseString:(BOOL) uppercaseString; +- (NSString *) getNotificationUniversalHourUppercaseString:(BOOL) uppercaseString; + +@end diff --git a/Example/Pods/NSDate_Utils/Pod/Classes/NSDate+NSDate_Util.m b/Example/Pods/NSDate_Utils/Pod/Classes/NSDate+NSDate_Util.m new file mode 100755 index 0000000..331e5c8 --- /dev/null +++ b/Example/Pods/NSDate_Utils/Pod/Classes/NSDate+NSDate_Util.m @@ -0,0 +1,1183 @@ +// +// NSDate+NSDate_Util.m +// +// Created by Giuseppe Nucifora on 11/02/14. +// Copyright (c) 2014 Giuseppe Nucifora. All rights reserved. +// + +#import "NSDate+NSDate_Util.h" + +#define DATE_COMPONENTS (NSCalendarUnitEra | NSCalendarUnitYear| NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitWeekOfMonth | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond | NSCalendarUnitWeekday | NSCalendarUnitWeekdayOrdinal) +#define CURRENT_CALENDAR [NSCalendar currentCalendar] +#define D_MINUTE 60 + + + + + +@implementation NSDate (NSDate_Util) + +static NSCalendar *_calendar = nil; +static NSDateFormatter *_displayFormatter = nil; + ++ (void)initializeStatics { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + @autoreleasepool { + if (_calendar == nil) { +#if __has_feature(objc_arc) + _calendar = [NSCalendar currentCalendar]; +#else + _calendar = [[NSCalendar currentCalendar] retain]; +#endif + } + if (_displayFormatter == nil) { + _displayFormatter = [[NSDateFormatter alloc] init]; + } + } + }); +} + +- (NSDate *) dateAtStartOfDay +{ + NSDateComponents *components = [CURRENT_CALENDAR components:DATE_COMPONENTS fromDate:self]; + components.hour = 0; + components.minute = 0; + components.second = 0; + return [CURRENT_CALENDAR dateFromComponents:components]; +} +- (NSInteger) minutesAfterDate: (NSDate *) aDate +{ + NSTimeInterval ti = [self timeIntervalSinceDate:aDate]; + return (NSInteger) (ti / D_MINUTE); +} + + +- (NSDate *) dateBySubtractingMinutes: (NSInteger) dMinutes +{ + return [self dateByAddingMinutes: (dMinutes * -1)]; +} + +- (NSDate *) dateBySubtractingHours: (NSInteger) hours { + + return [self dateByAddingHours: (hours * -1)]; +} + +- (NSDate *) dateBySubtractingDays: (NSInteger) days +{ + return [self dateByAddingDays: (days * -1)]; +} + +- (NSDate *) dateBySubtractingYears: (NSInteger) years { + + + return [self dateByAddingYears: (years * -1)]; +} + +- (NSDate *)dateToNearestMinutes:(NSInteger)minutes { + unsigned unitFlags = NSCalendarUnitYear| NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitWeekOfMonth | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond | NSCalendarUnitWeekday | NSCalendarUnitWeekdayOrdinal; + // Extract components. + NSDateComponents *time = [[NSCalendar currentCalendar] components:unitFlags fromDate:self]; + NSInteger thisMin = [time minute]; + NSDate *newDate; + long remain = thisMin % minutes; + // if less then 3 then round down + NSInteger dividor = ceil(minutes/2); + if (remain= thisYear) { + if (displayTime) { + [formatter setDateFormat:kNSDateHelperFormatShortDateWithTime]; + } + else { + [formatter setDateFormat:kNSDateHelperFormatShortDate]; + } + } else { + if (displayTime) { + [formatter setDateFormat:kNSDateHelperFormatFullDateWithTime]; + } + else { + [formatter setDateFormat:kNSDateHelperFormatFullDate]; + } + } + } + if (prefixed) { + NSString *dateFormat = [formatter dateFormat]; + NSString *prefix = @"'on' "; + [formatter setDateFormat:[prefix stringByAppendingString:dateFormat]]; + } + } + // use display formatter to return formatted date string + displayString = [formatter stringFromDate:date]; + return displayString; +} + ++ (NSString *)stringForDisplayFromDate:(NSDate *)date prefixed:(BOOL)prefixed { + return [[self class] stringForDisplayFromDate:date prefixed:prefixed alwaysDisplayTime:NO]; +} + ++ (NSString *)stringForDisplayFromDate:(NSDate *)date { + return [self stringForDisplayFromDate:date prefixed:NO]; +} + +- (NSString *)stringWithFormat:(NSString *)format { + + NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init]; + [outputFormatter setDateFormat:format]; + NSString *timestamp_str = [outputFormatter stringFromDate:self]; + + return timestamp_str; +} + +- (NSString *)stringWithFormat:(NSString *)format timeZone:(NSTimeZone*) timezone { + + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + [formatter setDateFormat:format]; + [formatter setTimeZone:timezone]; + + NSString *timestamp_str = [formatter stringFromDate:self]; + return timestamp_str; +} + +- (NSString *)string { + return [self stringWithFormat:[NSDate dbFormatString]]; +} + +- (NSString *)stringWithDateStyle:(NSDateFormatterStyle)dateStyle timeStyle:(NSDateFormatterStyle)timeStyle { + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + + [formatter setDateStyle:dateStyle]; + [formatter setTimeStyle:timeStyle]; + NSString *outputString = [formatter stringFromDate:self]; + return outputString; +} + +- (NSDate *)beginningOfWeek { + // largely borrowed from "Date and Time Programming Guide for Cocoa" + // we'll use the default calendar and hope for the best + NSCalendar *calendar = [[self class] sharedCalendar]; + NSDate *beginningOfWeek = nil; + BOOL ok = [calendar rangeOfUnit:NSCalendarUnitWeekOfMonth startDate:&beginningOfWeek + interval:NULL forDate:self]; + if (ok) { + return beginningOfWeek; + } + // couldn't calc via range, so try to grab Sunday, assuming gregorian style + // Get the weekday component of the current date + NSDateComponents *weekdayComponents = [calendar components:NSCalendarUnitWeekday fromDate:self]; + /* + Create a date components to represent the number of days to subtract from the current date. + The weekday value for Sunday in the Gregorian calendar is 1, so subtract 1 from the number of days to subtract from the date in question. (If today's Sunday, subtract 0 days.) + */ + NSDateComponents *componentsToSubtract = [[NSDateComponents alloc] init]; + [componentsToSubtract setDay: 0 - ([weekdayComponents weekday] - 1)]; + beginningOfWeek = nil; + beginningOfWeek = [calendar dateByAddingComponents:componentsToSubtract toDate:self options:0]; +#if !__has_feature(objc_arc) + [componentsToSubtract release]; +#endif + //normalize to midnight, extract the year, month, and day components and create a new date from those components. + NSDateComponents *components = [calendar components:(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay) + fromDate:beginningOfWeek]; + return [calendar dateFromComponents:components]; +} + +- (NSDate *)beginningOfDay { + NSCalendar *calendar = [[self class] sharedCalendar]; + // Get the weekday component of the current date + NSDateComponents *components = [calendar components:(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay) + fromDate:self]; + return [calendar dateFromComponents:components]; +} + +- (NSDate *)endOfWeek { + NSCalendar *calendar = [[self class] sharedCalendar]; + // Get the weekday component of the current date + NSDateComponents *weekdayComponents = [calendar components:NSCalendarUnitWeekday fromDate:self]; + NSDateComponents *componentsToAdd = [[NSDateComponents alloc] init]; + // to get the end of week for a particular date, add (7 - weekday) days + [componentsToAdd setDay:(7 - [weekdayComponents weekday])]; + NSDate *endOfWeek = [calendar dateByAddingComponents:componentsToAdd toDate:self options:0]; +#if !__has_feature(objc_arc) + [componentsToAdd release]; +#endif + return endOfWeek; +} + ++ (NSString *)dateFormatString { + return kNSDateHelperFormatSQLDate; +} + ++ (NSString *)timeFormatString { + return kNSDateHelperFormatSQLTime; +} + ++ (NSString *)timestampFormatString { + return kNSDateHelperFormatSQLDateWithTime; +} + +// preserving for compatibility ++ (NSString *)dbFormatString { + return [NSDate timestampFormatString]; +} + ++ (NSString *)parseDateFormatFromString:(NSString *)dateString { + + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + + NSArray *dateFormatsArray = [[NSArray alloc] initWithObjects:kNSDateHelperFormatSQLDate,kNSDateHelperFormatSQLDateIT,kNSDateHelperFormatSQLDate_notSlashSeparated,kNSDateHelperFormatSQLDateEN,kNSDateHelperFormatSQLDateIT_shashSeparated,kNSDateHelperFormatSQLDateEN_shashSeparated,kNSDateHelperFormatSQLTime,kNSDateHelperFormatSQLDateWithTime,kNSDateHelperFormatSQLDate_shashSeparated,kNSDateHelperFormatSQLDateWithTime_shashSeparated,kNSDateHelperFormatFullDateWithTime,kNSDateHelperFormatFullDate,kNSDateHelperFormatShortDateWithTime,kNSDateHelperFormatShortDate,kNSDateHelperFormatWeekday,kNSDateHelperFormatWeekdayWithTime,kNSDateHelperFormatTime,kNSDateHelperFormatTimeWithPrefix, nil]; + + + for (NSString *dateFormat in dateFormatsArray) { + + [dateFormatter setDateFormat:dateFormat]; + + NSDate *theDate = nil; + NSError *error = nil; + if (![dateFormatter getObjectValue:&theDate forString:dateString range:nil error:&error]) { + NSLog(@"Date '%@' could not be parsed: %@", dateString, error); + } + else { + return dateFormat; + } + } + return nil; +} + ++ (NSArray*) getSlotTimesFromDate:(NSDate*) date distanceMinutes:(NSInteger) minutes { + + if (!date) { + date = [NSDate date]; + } + + if (minutes == 0) { + minutes = 10; + } + + NSMutableArray *slotTimes = [[NSMutableArray alloc] init]; + + BOOL step = TRUE; + while (step){ + + [slotTimes addObject:date]; + + if([date minute] == 30 && [date hour] == 23) { + step = FALSE; + } + + date = [date dateByAddingMinutes:minutes]; + } + + + return slotTimes; +} + +- (BOOL)isSameDayAsDate:(NSDate*)otherDate { + + // From progrmr's answer... + NSCalendar* calendar = [NSCalendar currentCalendar]; + + unsigned unitFlags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay; + NSDateComponents* comp1 = [calendar components:unitFlags fromDate:self]; + NSDateComponents* comp2 = [calendar components:unitFlags fromDate:otherDate]; + + return [comp1 day] == [comp2 day] && + [comp1 month] == [comp2 month] && + [comp1 year] == [comp2 year]; +} + ++ (NSString *)getUniversalHourFromDateString:(NSString *)string formatterString:(NSString*) formatterString andUppercaseString:(BOOL)uppercaseString { + + NSString * dateString = [NSString stringWithString:string]; + + NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; + if (formatterString) { + [dateFormatter setDateFormat:formatterString]; + } + else { + [dateFormatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"]; + } + NSDate* myDate = [dateFormatter dateFromString:dateString]; + + NSDate *now = [NSDate date]; + NSTimeInterval time = [myDate timeIntervalSinceDate:now]; + + if (time < 0) { + time *=-1; + + if (time < 60) { + if (uppercaseString) { + return [NSLocalizedString(@"Poco fa", nil) uppercaseString]; + } + return NSLocalizedString(@"Poco fa", nil); + } else if (time < 3600) { + int diff = round(time / 60); + + if (diff == 1) { + if (uppercaseString) { + return [NSLocalizedString(@"1 Minuto fa", nil) uppercaseString]; + } + return NSLocalizedString(@"1 Minuto fa", nil); + } + + if (uppercaseString) { + return [[NSString stringWithFormat:@"%d %@", diff, NSLocalizedString(@"Minuti fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%d %@", diff, NSLocalizedString(@"Minuti fa", nil)]; + + } else if (time < 86400) { + int diff = round(time / 60 / 60); + if (diff == 1) { + if (uppercaseString) { + return [NSLocalizedString(@"1 Ora fa", nil) uppercaseString]; + } + return NSLocalizedString(@"1 Ora fa", nil); + } + if (uppercaseString) { + return [[NSString stringWithFormat:@"%d %@", diff, NSLocalizedString(@"Ore fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%d %@", diff, NSLocalizedString(@"Ore fa", nil)]; + } else { + NSInteger diff = round(time / 60 / 60 / 24); + switch (diff) { + case 1:{ + if (uppercaseString) { + + return [[NSString stringWithFormat:@"%@",NSLocalizedString(@"Ieri", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%@",NSLocalizedString(@"Ieri", nil)]; + } + break; + case 2: + case 3: + case 4: + case 5: + case 6: { + + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@", (long)diff, NSLocalizedString(@"Giorni fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@", (long)diff, NSLocalizedString(@"Giorni fa", nil)]; + } + break; + default:{ + NSInteger diffWeeks = round(time / 60 / 60 / 24 / 7); + switch (diffWeeks) { + case 1:{ + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@",(long)diffWeeks,NSLocalizedString(@"Settimana fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@",(long)diffWeeks,NSLocalizedString(@"Settimana fa", nil)]; + } + break; + case 2: + case 3: + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@",(long)diffWeeks,NSLocalizedString(@"Settimane fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@",(long)diffWeeks,NSLocalizedString(@"Settimane fa", nil)]; + break; + default:{ + NSInteger diffMounth = round(time / 60 /60 / 24 / 30); + switch (diffMounth) { + case 1: { + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@",(long)diffMounth,NSLocalizedString(@"Mese fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@",(long)diffMounth,NSLocalizedString(@"Mese fa", nil)]; + } + break; + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11:{ + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@",(long)diffMounth,NSLocalizedString(@"Mesi fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@",(long)diffMounth,NSLocalizedString(@"Mesi fa", nil)]; + } + break; + + default:{ + NSInteger diffYears = round(time / 60 /60 / 24 / 365); + switch (diffYears) { + case 1: + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@",(long)diffYears,NSLocalizedString(@"Anno fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@",(long)diffYears,NSLocalizedString(@"Anno fa", nil)]; + break; + default:{ + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@",(long)diffYears,NSLocalizedString(@"Anni fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@",(long)diffYears,NSLocalizedString(@"Anni fa", nil)]; + } + break; + } + } + break; + } + } + break; + } + } + break; + } + } + } + else { + if (time < 60) { + if (uppercaseString) { + return [NSLocalizedString(@"Tra poco", nil) uppercaseString]; + } + return NSLocalizedString(@"Tra poco", nil); + } else if (time < 3600) { + int diff = round(time / 60); + + if (diff == 1) { + if (uppercaseString) { + return [NSLocalizedString(@"Tra 1 minuto", nil) uppercaseString]; + } + return NSLocalizedString(@"Tra 1 minuto", nil); + } + + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d minuti", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d minuti", nil), diff]; + + } else if (time < 86400) { + int diff = round(time / 60 / 60); + if (diff == 1) { + if (uppercaseString) { + return [NSLocalizedString(@"Tra 1 ora", nil) uppercaseString]; + } + return NSLocalizedString(@"Tra 1 ora", nil); + } + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d ore", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d ore", nil), diff]; + } else { + NSInteger diff = round(time / 60 / 60 / 24); + switch (diff) { + case 1:{ + if (uppercaseString) { + + return [[NSString stringWithFormat:@"%@",NSLocalizedString(@"Domani", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%@",NSLocalizedString(@"Domani", nil)]; + } + break; + case 2: + case 3: + case 4: + case 5: + case 6: { + + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d giorni", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d giorni", nil), diff]; + } + break; + default:{ + NSInteger diffWeeks = round(time / 60 / 60 / 24 / 7); + switch (diffWeeks) { + case 1:{ + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@",(long)diffWeeks,NSLocalizedString(@"Tra 1 Settimana", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@",(long)diffWeeks,NSLocalizedString(@"Tra 1 Settimana", nil)]; + } + break; + case 2: + case 3: + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d settimane", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d settimane", nil), diff]; + break; + default:{ + NSInteger diffMounth = round(time / 60 /60 / 24 / 30); + switch (diffMounth) { + case 1: { + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d mese", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d mese", nil), diff]; + } + break; + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11:{ + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d mesi", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d mesi", nil), diff]; + } + break; + + default:{ + NSInteger diffYears = round(time / 60 /60 / 24 / 365); + switch (diffYears) { + case 1: + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d anno", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d anno", nil), diff]; + break; + default:{ + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d anni", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d anni", nil), diff]; + } + break; + } + } + break; + } + } + break; + } + } + break; + } + } + } +} + +- (NSString *)getUniversalHourUppercaseString:(BOOL)uppercaseString { + + NSDate *now = [NSDate date]; + NSTimeInterval time = [self timeIntervalSinceDate:now]; + + if (time < 0) { + time *=-1; + + if (time < 60) { + if (uppercaseString) { + return [NSLocalizedString(@"Poco fa", nil) uppercaseString]; + } + return NSLocalizedString(@"Poco fa", nil); + } else if (time < 3600) { + int diff = round(time / 60); + + if (diff == 1) { + if (uppercaseString) { + return [NSLocalizedString(@"1 Minuto fa", nil) uppercaseString]; + } + return NSLocalizedString(@"1 Minuto fa", nil); + } + + if (uppercaseString) { + return [[NSString stringWithFormat:@"%d %@", diff, NSLocalizedString(@"Minuti fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%d %@", diff, NSLocalizedString(@"Minuti fa", nil)]; + + } else if (time < 86400) { + int diff = round(time / 60 / 60); + if (diff == 1) { + if (uppercaseString) { + return [NSLocalizedString(@"1 Ora fa", nil) uppercaseString]; + } + return NSLocalizedString(@"1 Ora fa", nil); + } + if (uppercaseString) { + return [[NSString stringWithFormat:@"%d %@", diff, NSLocalizedString(@"Ore fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%d %@", diff, NSLocalizedString(@"Ore fa", nil)]; + } else { + NSInteger diff = round(time / 60 / 60 / 24); + switch (diff) { + case 1:{ + if (uppercaseString) { + + return [[NSString stringWithFormat:@"%@",NSLocalizedString(@"Ieri", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%@",NSLocalizedString(@"Ieri", nil)]; + } + break; + case 2: + case 3: + case 4: + case 5: + case 6: { + + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@", (long)diff, NSLocalizedString(@"Giorni fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@", (long)diff, NSLocalizedString(@"Giorni fa", nil)]; + } + break; + default:{ + NSInteger diffWeeks = round(time / 60 / 60 / 24 / 7); + switch (diffWeeks) { + case 1:{ + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@",(long)diffWeeks,NSLocalizedString(@"Settimana fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@",(long)diffWeeks,NSLocalizedString(@"Settimana fa", nil)]; + } + break; + case 2: + case 3: + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@",(long)diffWeeks,NSLocalizedString(@"Settimane fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@",(long)diffWeeks,NSLocalizedString(@"Settimane fa", nil)]; + break; + default:{ + NSInteger diffMounth = round(time / 60 /60 / 24 / 30); + switch (diffMounth) { + case 1: { + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@",(long)diffMounth,NSLocalizedString(@"Mese fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@",(long)diffMounth,NSLocalizedString(@"Mese fa", nil)]; + } + break; + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11:{ + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@",(long)diffMounth,NSLocalizedString(@"Mesi fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@",(long)diffMounth,NSLocalizedString(@"Mesi fa", nil)]; + } + break; + + default:{ + NSInteger diffYears = round(time / 60 /60 / 24 / 365); + switch (diffYears) { + case 1: + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@",(long)diffYears,NSLocalizedString(@"Anno fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@",(long)diffYears,NSLocalizedString(@"Anno fa", nil)]; + break; + default:{ + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@",(long)diffYears,NSLocalizedString(@"Anni fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@",(long)diffYears,NSLocalizedString(@"Anni fa", nil)]; + } + break; + } + } + break; + } + } + break; + } + } + break; + } + } + } + else { + if (time < 60) { + if (uppercaseString) { + return [NSLocalizedString(@"Tra poco", nil) uppercaseString]; + } + return NSLocalizedString(@"Tra poco", nil); + } else if (time < 3600) { + int diff = round(time / 60); + + if (diff == 1) { + if (uppercaseString) { + return [NSLocalizedString(@"Tra 1 minuto", nil) uppercaseString]; + } + return NSLocalizedString(@"Tra 1 minuto", nil); + } + + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d minuti", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d minuti", nil), diff]; + + } else if (time < 86400) { + int diff = round(time / 60 / 60); + if (diff == 1) { + if (uppercaseString) { + return [NSLocalizedString(@"Tra 1 ora", nil) uppercaseString]; + } + return NSLocalizedString(@"Tra 1 ora", nil); + } + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d ore", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d ore", nil), diff]; + } else { + NSInteger diff = round(time / 60 / 60 / 24); + switch (diff) { + case 1:{ + if (uppercaseString) { + + return [[NSString stringWithFormat:@"%@",NSLocalizedString(@"Domani", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%@",NSLocalizedString(@"Domani", nil)]; + } + break; + case 2: + case 3: + case 4: + case 5: + case 6: { + + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d giorni", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d giorni", nil), diff]; + } + break; + default:{ + NSInteger diffWeeks = round(time / 60 / 60 / 24 / 7); + switch (diffWeeks) { + case 1:{ + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@",(long)diffWeeks,NSLocalizedString(@"Tra 1 Settimana", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@",(long)diffWeeks,NSLocalizedString(@"Tra 1 Settimana", nil)]; + } + break; + case 2: + case 3: + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d settimane", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d settimane", nil), diff]; + break; + default:{ + NSInteger diffMounth = round(time / 60 /60 / 24 / 30); + switch (diffMounth) { + case 1: { + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d mese", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d mese", nil), diff]; + } + break; + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11:{ + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d mesi", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d mesi", nil), diff]; + } + break; + + default:{ + NSInteger diffYears = round(time / 60 /60 / 24 / 365); + switch (diffYears) { + case 1: + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d anno", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d anno", nil), diff]; + break; + default:{ + if (uppercaseString) { + return [[NSString stringWithFormat:NSLocalizedString(@"Tra %d anni", nil), diff] uppercaseString]; + } + return [NSString stringWithFormat:NSLocalizedString(@"Tra %d anni", nil), diff]; + } + break; + } + } + break; + } + } + break; + } + } + break; + } + } + } +} + +- (NSString *)getNotificationUniversalHourUppercaseString:(BOOL)uppercaseString { + + NSDate *now = [NSDate date]; + NSTimeInterval time = [self timeIntervalSinceDate:now]; + + if (time < 0) { + time *=-1; + + if (time < 60) { + if (uppercaseString) { + return [NSLocalizedString(@"Poco fa", nil) uppercaseString]; + } + return NSLocalizedString(@"Poco fa", nil); + } else if (time < 3600) { + int diff = round(time / 60); + + if (diff == 1) { + if (uppercaseString) { + return [NSLocalizedString(@"1 Minuto fa", nil) uppercaseString]; + } + return NSLocalizedString(@"1 Minuto fa", nil); + } + + if (uppercaseString) { + return [[NSString stringWithFormat:@"%d %@", diff, NSLocalizedString(@"Minuti fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%d %@", diff, NSLocalizedString(@"Minuti fa", nil)]; + + } else if (time < 86400) { + int diff = round(time / 60 / 60); + if (diff == 1) { + if (uppercaseString) { + return [NSLocalizedString(@"1 Ora fa", nil) uppercaseString]; + } + return NSLocalizedString(@"1 Ora fa", nil); + } + if (uppercaseString) { + return [[NSString stringWithFormat:@"%d %@", diff, NSLocalizedString(@"Ore fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%d %@", diff, NSLocalizedString(@"Ore fa", nil)]; + } else { + NSInteger diff = round(time / 60 / 60 / 24); + switch (diff) { + case 1:{ + if (uppercaseString) { + + return [[NSString stringWithFormat:@"%@",NSLocalizedString(@"Ieri", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%@",NSLocalizedString(@"Ieri", nil)]; + } + break; + case 2: + case 3: + case 4: + case 5: + case 6: { + + if (uppercaseString) { + return [[NSString stringWithFormat:@"%ld %@", (long)diff, NSLocalizedString(@"Giorni fa", nil)] uppercaseString]; + } + return [NSString stringWithFormat:@"%ld %@", (long)diff, NSLocalizedString(@"Giorni fa", nil)]; + } + break; + default:{ + + if (uppercaseString) { + return [[self stringWithFormat:@"d MMM"] uppercaseString]; + } + return [self stringWithFormat:@"d MMM"]; + + } + break; + } + } + } + return @""; +} + @end \ No newline at end of file diff --git a/Example/Pods/NSDate_Utils/README.md b/Example/Pods/NSDate_Utils/README.md new file mode 100644 index 0000000..0cd9087 --- /dev/null +++ b/Example/Pods/NSDate_Utils/README.md @@ -0,0 +1,112 @@ +# NSDate_Utils + +[![CI Status](http://img.shields.io/travis/Giuseppe Nucifora/NSDate_Utils.svg?style=flat)](https://travis-ci.org/Giuseppe Nucifora/NSDate_Utils) +[![Version](https://img.shields.io/cocoapods/v/NSDate_Utils.svg?style=flat)](http://cocoapods.org/pods/NSDate_Utils) +[![License](https://img.shields.io/cocoapods/l/NSDate_Utils.svg?style=flat)](http://cocoapods.org/pods/NSDate_Utils) +[![Platform](https://img.shields.io/cocoapods/p/NSDate_Utils.svg?style=flat)](http://cocoapods.org/pods/NSDate_Utils) + +## Usage + +To run the example project, clone the repo, and run `pod install` from the Example directory first. + +## Requirements + +## Installation + +NSDate_Utils is available through [CocoaPods](http://cocoapods.org). To install +it, simply add the following line to your Podfile: + +```ruby +pod "NSDate_Utils" +``` + +```ruby ++ (NSCalendar *) sharedCalendar; ++ (NSDateFormatter *) sharedDateFormatter; + + ++ (NSString *) dateFormatString; ++ (NSString *) timeFormatString; ++ (NSString *) timestampFormatString; ++ (NSString *) dbFormatString; + ++ (NSString *) parseDateFormatFromString:(NSString *) dateString; + ++ (NSString *) WCFStringFromDate:(NSDate*) date; + ++ (NSArray*) getSlotTimesFromDate:(NSDate*) date distanceMinutes:(NSInteger) minutes; + ++ (NSDate *) dateFromString:(NSString *) string; ++ (NSDate *) dateFromString:(NSString *) string withFormat:(NSString *) format; ++ (NSDate *) dateFromString:(NSString *) string withFormat:(NSString *) format withTimeZone:(NSTimeZone*) timeZone; ++ (NSString *) stringFromDate:(NSDate *) date withFormat:(NSString *) string; ++ (NSString *) stringFromDate:(NSDate *) date; ++ (NSString *) stringForDisplayFromDate:(NSDate *) date; ++ (NSString *) stringForDisplayFromDate:(NSDate *) date prefixed:(BOOL) prefixed; ++ (NSString *) stringForDisplayFromDate:(NSDate *) date prefixed:(BOOL) prefixed alwaysDisplayTime:(BOOL)displayTime; + ++ (NSString *) getUniversalHourFromDateString:(NSString *) string formatterString:(NSString*) formatterString andUppercaseString:(BOOL) uppercaseString; + +- (NSDate *) dateToNearestMinutes:(NSInteger)minutes; + +- (NSDate *) dateByAddingMinutes:(NSInteger) dMinutes; +- (NSDate *) dateByAddingHours:(NSInteger) hours; +- (NSDate*) dateByAddingDays:(NSInteger) days; +- (NSDate*) dateByAddingYears:(NSInteger) years; + +- (NSDate *) dateBySubtractingMinutes:(NSInteger) dMinutes; +- (NSDate *) dateBySubtractingHours:(NSInteger) hours; +- (NSDate *) dateBySubtractingDays:(NSInteger) days; +- (NSDate *) dateBySubtractingYears:(NSInteger) years; + +- (NSDate *) dateAtStartOfDay; + +- (NSInteger) minutesAfterDate:(NSDate *) aDate; +- (CGFloat) distanceInWeeksToDate:(NSDate *) anotherDate; +- (CGFloat) distanceInDaysToDate:(NSDate *) anotherDate; +- (CGFloat) distanceInHoursToDate:(NSDate *) anotherDate; +- (CGFloat) distanceInMinutesToDate:(NSDate *) anotherDate; +- (CGFloat) distanceInSeconsToDate:(NSDate *) anotherDate; + +- (NSDate *) toLocalTime; +- (NSDate *) toGlobalTime; + +- (BOOL) isSameYearAsDate:(NSDate *) aDate; +- (BOOL) isEarlierThanDate:(NSDate *) aDate; +- (BOOL) isLaterThanDate:(NSDate *) aDate; + +- (NSUInteger) daysAgo; +- (NSUInteger) daysAgoAgainstMidnight; +- (NSString *) stringDaysAgo; +- (NSString *) stringDaysAgoAgainstMidnight:(BOOL)flag; +- (NSUInteger) monthDay; +- (NSUInteger) weekday; +- (NSUInteger) month; +- (NSUInteger) weekNumber; +- (NSUInteger) hour; +- (NSUInteger) minute; +- (NSUInteger) year; +- (long int) utcTimeStamp; //full seconds since + +- (NSString *) string; +- (NSString *) stringWithFormat:(NSString *) format; +- (NSString *) stringWithFormat:(NSString *) format timeZone:(NSTimeZone*) timezone; +- (NSString *) stringWithDateStyle:(NSDateFormatterStyle) dateStyle timeStyle:(NSDateFormatterStyle) timeStyle; +- (NSDate *) beginningOfWeek; +- (NSDate *) beginningOfDay; +- (NSDate *) endOfWeek; + + +- (BOOL)isSameDayAsDate:(NSDate*)otherDate; + +- (NSString *) getUniversalHourUppercaseString:(BOOL) uppercaseString; +- (NSString *) getNotificationUniversalHourUppercaseString:(BOOL) uppercaseString; +``` + +## Author + +Giuseppe Nucifora, me@giuseppenucifora.com + +## License + +NSDate_Utils is available under the MIT license. See the LICENSE file for more info. diff --git a/Example/Pods/PEAR-FileManager-iOS/LICENSE b/Example/Pods/PEAR-FileManager-iOS/LICENSE new file mode 100644 index 0000000..2779f38 --- /dev/null +++ b/Example/Pods/PEAR-FileManager-iOS/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) <2015> Hiroki Umatani PEAR + + +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. diff --git a/Example/Pods/PEAR-FileManager-iOS/PEAR-FileManager-iOS/PEARFileManager.h b/Example/Pods/PEAR-FileManager-iOS/PEAR-FileManager-iOS/PEARFileManager.h new file mode 100644 index 0000000..9cce7f0 --- /dev/null +++ b/Example/Pods/PEAR-FileManager-iOS/PEAR-FileManager-iOS/PEARFileManager.h @@ -0,0 +1,104 @@ +// +// PEARFileManager.h +// FileManager +// +// Created by hirokiumatani on 2015/10/31. +// Copyright (c) 2015年 hirokiumatani. All rights reserved. +// + +#import + +@interface PEARFileManager : NSObject + +typedef NS_ENUM(NSInteger,ROOT_DIR_TYPE) +{ + k_ROOT_DIR_DOCUMENTS, + k_ROOT_DIR_LIBRARY, + k_ROOT_DIR_TMP, +}; + + +@property (nonatomic,assign)ROOT_DIR_TYPE rootDir; +/** + initial with root directory + */ +- (id)initWithRootPath:(ROOT_DIR_TYPE)rootType; + +/** + singletone instance + */ ++ (PEARFileManager *)sharedInstatnce; + +/** + set root directory + */ +- (void)setRootDirectory:(ROOT_DIR_TYPE)rootType; + +/** + get root directory path + */ +- (NSString *)getRootDirectoryPath; + +/** + join file name in dir path + */ +- (NSString *)joinFileName:(NSString *)fileName + inDirPath:(NSString *)dirPath; + +/** + create directory + */ +- (BOOL)createDirectory:(NSString *)dirPath + permisson:(NSNumber *)permission; + +/** + create file + */ +- (BOOL)createFileWithData:(NSData *)fileData + filePath:(NSString *)filePath + permisson:(NSNumber *)permission; + +/** + fetch data + */ +- (NSData *)fetchFileDataWithPath:(NSString *)path; + +/** + fetch file Names + */ +- (NSArray *)fetchFileNameListsWithDirPath:(NSString *)dirPath; + +/** + check file or directory + */ +- (BOOL)checkPath:(NSString *)path; + +/** + delete file or directory + */ +- (BOOL)deletePath:(NSString *)Path; + +/** + update directory + */ +- (BOOL)updateDirectory:(NSString *)dirPath + permisson:(NSNumber *)permission; + +/** + update file + */ +- (BOOL)updateFileWithData:(NSData *)fileData + filePath:(NSString *)filePath + permisson:(NSNumber *)permission; + +/** + move file or directory + */ +- (BOOL)moveFromPath:(NSString *)fromPath toPath:(NSString *)toPath; + +/** + copy file or directory + */ +- (BOOL)copyFrompath:(NSString *)fromPath toPath:(NSString *)toPath; + +@end diff --git a/Example/Pods/PEAR-FileManager-iOS/PEAR-FileManager-iOS/PEARFileManager.m b/Example/Pods/PEAR-FileManager-iOS/PEAR-FileManager-iOS/PEARFileManager.m new file mode 100644 index 0000000..26d7240 --- /dev/null +++ b/Example/Pods/PEAR-FileManager-iOS/PEAR-FileManager-iOS/PEARFileManager.m @@ -0,0 +1,219 @@ +// +// PEARFileManager.m +// FileManager +// +// Created by hirokiumatani on 2015/10/31. +// Copyright (c) 2015年 hirokiumatani. All rights reserved. +// + +#import "PEARFileManager.h" + +@interface PEARFileManager () + +@property (nonatomic,strong) NSString *rootPath; + +@end + +@implementation PEARFileManager + +static PEARFileManager *_sharedInstatnce = nil; + +#pragma mark - initial ++ (PEARFileManager*)sharedInstatnce +{ + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^ + { + _sharedInstatnce = [[PEARFileManager alloc] init]; + [_sharedInstatnce setRootDirectory:k_ROOT_DIR_LIBRARY]; + }); + return _sharedInstatnce; +} + +- (id)init +{ + if (self == [super init]) + { + [self setRootDir:k_ROOT_DIR_LIBRARY]; + } + return self; +} + +- (id)initWithRootPath:(ROOT_DIR_TYPE)rootType +{ + if (self == [super init]) + { + [self setRootDir:rootType]; + } + return self; +} + +#pragma mark - root directory +- (void)setRootDirectory:(ROOT_DIR_TYPE)rootType +{ + switch (rootType) + { + case k_ROOT_DIR_DOCUMENTS: + { + _rootPath = [NSString stringWithFormat:@"%@/Documents",NSHomeDirectory()]; + break; + } + case k_ROOT_DIR_LIBRARY: + { + _rootPath = [NSString stringWithFormat:@"%@/Library",NSHomeDirectory()]; + break; + } + case k_ROOT_DIR_TMP: + { + _rootPath = [NSString stringWithFormat:@"%@/tmp",NSHomeDirectory()]; + break; + } + } +} + +- (NSString *)getRootDirectoryPath +{ + return _rootPath; +} + +#pragma mark - create +- (BOOL)createDirectory:(NSString *)dirPath + permisson:(NSNumber *)permission +{ + if ([self checkPath:dirPath]) + { + NSLog(@"The path already exists"); + return NO; + } + + return [[NSFileManager new] createDirectoryAtPath:[self joinFileName:dirPath inDirPath:_rootPath] + withIntermediateDirectories:YES + attributes:@{NSFilePosixPermissions: permission} + error:nil]; +} + +- (BOOL)createFileWithData:(NSData *)fileData + filePath:(NSString *)filePath + permisson:(NSNumber *)permission +{ + if ([self checkPath:filePath]) + { + NSLog(@"The path already exists"); + return NO; + } + + NSString *filesPath = [self joinFileName:filePath inDirPath:_rootPath]; + + return [[NSFileManager new] createFileAtPath:filesPath + contents:fileData + attributes:@{NSFilePosixPermissions:permission}]; +} + +#pragma mark - update +- (BOOL)updateDirectory:(NSString *)dirPath + permisson:(NSNumber *)permission +{ + if (![self checkPath:dirPath]) + { + NSLog(@"The path dose not exists"); + return NO; + } + + return [[NSFileManager new] createDirectoryAtPath:[self joinFileName:dirPath inDirPath:_rootPath] + withIntermediateDirectories:YES + attributes:@{NSFilePosixPermissions: permission} + error:nil]; +} + +- (BOOL)updateFileWithData:(NSData *)fileData + filePath:(NSString *)filePath + permisson:(NSNumber *)permission +{ + if (![self checkPath:filePath]) + { + NSLog(@"The path dose not exists"); + return NO; + } + + return [[NSFileManager new] createFileAtPath:[self joinFileName:filePath inDirPath:_rootPath] + contents:fileData + attributes:@{NSFilePosixPermissions:permission}]; + +} + +#pragma mark - fetch +- (NSData *)fetchFileDataWithPath:(NSString *)path +{ + if (![self checkPath:path]) + { + NSLog(@"The path dose not exists"); + return nil; + } + return [[NSFileManager new] contentsAtPath:[self joinFileName:path inDirPath:_rootPath]]; +} + +- (NSArray *)fetchFileNameListsWithDirPath:(NSString *)dirPath +{ + return [[NSFileManager defaultManager] contentsOfDirectoryAtPath:dirPath error:nil]; +} + +#pragma mark - check +- (BOOL)checkPath:(NSString *)path +{ + return [[NSFileManager new] fileExistsAtPath:[self joinFileName:path inDirPath:_rootPath]]; +} + +#pragma mark - delete +- (BOOL)deletePath:(NSString *)path +{ + if (![self checkPath:path]) + { + NSLog(@"The path dose not exists"); + return NO; + } + return [[NSFileManager new] removeItemAtPath:[self joinFileName:path inDirPath:_rootPath] error:nil]; +} + +#pragma mark - move +- (BOOL)moveFromPath:(NSString *)fromPath toPath:(NSString *)toPath +{ + if (![self checkPath:fromPath]) + { + NSLog(@"The path dose not exists"); + return NO; + } + if ([self checkPath:toPath]) + { + NSLog(@"The path already exists"); + return NO; + } + + return [[NSFileManager new] moveItemAtPath:[self joinFileName:fromPath inDirPath:_rootPath] + toPath:[self joinFileName:toPath inDirPath:_rootPath] error:nil]; +} + +#pragma mark - copy +- (BOOL)copyFrompath:(NSString *)fromPath toPath:(NSString *)toPath +{ + if (![self checkPath:fromPath]) + { + NSLog(@"The path dose not exists"); + return NO; + } + if ([self checkPath:toPath]) + { + NSLog(@"The path already exists"); + return NO; + } + + return [[NSFileManager new] copyItemAtPath:[self joinFileName:fromPath inDirPath:_rootPath] + toPath:[self joinFileName:toPath inDirPath:_rootPath] error:nil]; +} + +#pragma mark - join +- (NSString *)joinFileName:(NSString *)fileName + inDirPath:(NSString *)dirPath +{ + return [NSString stringWithFormat:@"%@/%@",dirPath,fileName]; +} +@end diff --git a/Example/Pods/PEAR-FileManager-iOS/README.md b/Example/Pods/PEAR-FileManager-iOS/README.md new file mode 100644 index 0000000..4d0284e --- /dev/null +++ b/Example/Pods/PEAR-FileManager-iOS/README.md @@ -0,0 +1,57 @@ +### PEAR-FileManager-iOS [![GitHub license](https://img.shields.io/badge/LICENSE-MIT%20LICENSE-blue.svg)](https://github.com/HirokiUmatani/PEAR-FileManager-iOS/LICENSE) [![CocoaPods](https://img.shields.io/badge/platform-ios-lightgrey.svg)](https://cocoapods.org/pods/PEAR-FileManager-iOS) [![CocoaPods](https://img.shields.io/cocoapods/v/PEAR-FileManager-iOS.svg)](https://cocoapods.org/pods/PEAR-FileManager-iOS) + +==== +### Overview +This is the ios library to manipulate directories and files in application. + +### Installation + +pod 'PEAR-FileManager-iOS' + + +### Usage + +##### initial +``` +PEARFileManager *fileManager = [PEARFileManager sharedInstatnce]; +fileManager.rootDir = k_ROOT_DIR_LIBRARY; + +``` +##### Create +``` +[fileManager createDirectory:DIR_PATH permisson:PERMISSION]; + +``` +``` +[fileManager createFileWithData:pearImageData + filePath:[fileManager joinFileName:FILE_NAME inDirPath:DIR_PATH] + permisson:PERMISSION]; + + +``` +##### Copy +``` +[fileManager copyFrompath:[fileManager joinFileName:FILE_NAME inDirPath:DIR_PATH] + toPath:[fileManager joinFileName:COPY_FILE_NAME inDirPath:DIR_PATH]]; + +``` +##### Move +``` +[fileManager moveFromPath:DIR_PATH + toPath:MOVE_DIR_PATH]; + +``` +##### Delete +``` +[fileManager deletePath:[fileManager joinFileName:FILE_NAME inDirPath:DIR_PATH]]; + +``` + +### Documents +[library document](http://cocoadocs.org/docsets/PEAR-FileManager-iOS) + +### Licence +[MIT](https://github.com/HirokiUmatani/PEAR-FileManager-iOS/blob/master/LICENSE) + +### Author +[Hiroki Umatani](https://github.com/HirokiUmatani) diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 0000000..9484c3f --- /dev/null +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,3034 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 003FC52F29E9B9B55FFC8C2C1E57D6BE /* PNObject-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D21BA597DC54DA5B79874658C865E54 /* PNObject-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0602A61C6A56334AD7D7AF0EC23E8B19 /* SPTCompiledExample.h in Headers */ = {isa = PBXBuildFile; fileRef = 852ED4B265FE033613AC722C1062C301 /* SPTCompiledExample.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 064A5A36853F3744DAE30AB83B951829 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C011832F271A444CE38AB546BF893CB7 /* Foundation.framework */; }; + 07CAFACAFAC87ABBF28D453E70832464 /* UIImage+Compare.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F9CBFB97FAE3AC05A28EE45CDA2734 /* UIImage+Compare.m */; }; + 07FB694DFFD00BFB7890D2E727F7D81F /* Pods-PNObject_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 60B530196848B62AA6D54AEEB46A06D8 /* Pods-PNObject_Example-dummy.m */; }; + 0A5DFD94EE83E385C1C7D24986E04592 /* SwiftSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70B374F2107437CA956DF24E5E19499A /* SwiftSupport.swift */; }; + 0C6FF91EB1F0391ED75DC72D31D159EF /* EXPMatchers+beTruthy.m in Sources */ = {isa = PBXBuildFile; fileRef = 399B462AA47CD6AB8297E3B09AEB18F0 /* EXPMatchers+beTruthy.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 0D16B556212D317A0D4FEB71E102E207 /* EXPMatchers+beLessThan.h in Headers */ = {isa = PBXBuildFile; fileRef = 92C726C29A6539951DB12B041D1792AE /* EXPMatchers+beLessThan.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0EBFA5FBE4953A83B677CE2A75746761 /* EXPMatchers+beLessThan.m in Sources */ = {isa = PBXBuildFile; fileRef = 91B991DE57581DC2C3B4E6025B38E2B2 /* EXPMatchers+beLessThan.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 0F94F5B0ABB3252B9275B7C129EC7A26 /* EXPMatchers+equal.h in Headers */ = {isa = PBXBuildFile; fileRef = 039DE5E921EE2C83F0DB098D9C48758F /* EXPMatchers+equal.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 11C1AEB289C1EB80089349B71F09D04B /* EXPMatchers+raiseWithReason.h in Headers */ = {isa = PBXBuildFile; fileRef = B4D46FA1D8C11A61B0779DCEEE44A0C0 /* EXPMatchers+raiseWithReason.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1312A7D381C51428CF481E33E3D37901 /* EXPMatchers+beGreaterThan.m in Sources */ = {isa = PBXBuildFile; fileRef = A632AA14A79DFF2E79B4285BA9976153 /* EXPMatchers+beGreaterThan.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 131532787AD40BE1F35DF288D2E6FFD7 /* EXPMatchers+beInTheRangeOf.h in Headers */ = {isa = PBXBuildFile; fileRef = A07F7B6A7A5C085B18CFA541503FD407 /* EXPMatchers+beInTheRangeOf.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1338EA7034EEBE3E938F563AAD1A1908 /* XCTest+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3815F645AAADCAF88CC9740D8FED47C6 /* XCTest+Private.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1480F4923DBBF217F60572EEECB4027C /* AFNetworkActivityIndicatorManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 797359E997295E3851B8A92E12EC7DAE /* AFNetworkActivityIndicatorManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 154FE40BF807A22A341770459ED0BCA9 /* NSDate+NSDate_Util.m in Sources */ = {isa = PBXBuildFile; fileRef = AA18FB23EB66AB9CB3EB7D7D83B4F4BC /* NSDate+NSDate_Util.m */; }; + 174202BD6AE0E4A41F5CE66E975EAE52 /* UIRefreshControl+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = CB3F28C9BC17E4A2F27DCCE9693F61A2 /* UIRefreshControl+AFNetworking.m */; }; + 17572374B2AE183C6347C41E8DF8E579 /* EXPMatchers+beFalsy.m in Sources */ = {isa = PBXBuildFile; fileRef = 27E5C65560784FEE47CF5B6B7C469CCD /* EXPMatchers+beFalsy.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 17AC9529FFE28D4FA7DCF4B60F398B7E /* SPTTestSuite.h in Headers */ = {isa = PBXBuildFile; fileRef = A0B2B2D2C961344B4CF652B166E525DB /* SPTTestSuite.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 197B5FE62F55AA8BEE877817E83AF810 /* SPTSharedExampleGroups.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B07E3A6961EE0F0821BEDD4EFDBC3E6 /* SPTSharedExampleGroups.m */; }; + 1A1AB2EC52323C5EA28DAA99F1E1A90D /* EXPMatchers+endWith.h in Headers */ = {isa = PBXBuildFile; fileRef = 60972F56E13BC9E547CFBF5F290DD89E /* EXPMatchers+endWith.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1AB3304B6884F626BC54150AC7565E18 /* EXPMatchers+equal.m in Sources */ = {isa = PBXBuildFile; fileRef = 620776E83BE8FBF047E6CB8725265419 /* EXPMatchers+equal.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 1B0389CD88AA949B34DC7269030FEC6F /* EXPMatchers+beGreaterThanOrEqualTo.m in Sources */ = {isa = PBXBuildFile; fileRef = C75BE203FE62CDE9CBC30A1812780F6E /* EXPMatchers+beGreaterThanOrEqualTo.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 1D80CC0197DAA1C570189DCE17DA1AD2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C011832F271A444CE38AB546BF893CB7 /* Foundation.framework */; }; + 1E48073A34450AE92B16209CDF55C1A1 /* SPTCompiledExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F8244AC7C380BAC0FF7995A0DD0985C /* SPTCompiledExample.m */; }; + 1E5B8F12ED7CC40ECDB9B1F755F387E5 /* UIActivityIndicatorView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 2480119A8B86BA567BE7777F466E6E27 /* UIActivityIndicatorView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1EB1017329A4B7619553CBD5FF5D0DAA /* NSDate_Utils.bundle in Resources */ = {isa = PBXBuildFile; fileRef = F6475D2AE952D65158911AE59D9D7787 /* NSDate_Utils.bundle */; }; + 201BF9C605852822CA5A65ADE282A310 /* EXPMatcherHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AEF7A08332A013E569FC109270AB45 /* EXPMatcherHelpers.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 204D694B03BFF3B244A6AB73FACFFC43 /* Expecta-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 231DEFBB5E4E226771797D517A35EE2B /* Expecta-dummy.m */; }; + 20607BE2B1E5F31765026E5AC64DB27D /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EE729CB108F93E49233153B2022FF79 /* AFSecurityPolicy.m */; }; + 207B0778FA44B677AA237F5D96C23E28 /* PEARFileManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 92D7C780DF210F826062C7DA4241628F /* PEARFileManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 20C0CFB6F8C29123D1667E2676D8B2F5 /* FBSnapshotTestCase.h in Headers */ = {isa = PBXBuildFile; fileRef = 08D27CF8BF643F6B5B13F8232258D5B8 /* FBSnapshotTestCase.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 20EE8030FCF2402DAC7F1C9B9DDAEF79 /* AFURLRequestSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A9C98362B8CD1F0E2749529D53DEE66 /* AFURLRequestSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2549CD1370AF63009DEC76693F5E9BD1 /* FBSnapshotTestCase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CDFD3EE185C96AC4743FBBA951370259 /* FBSnapshotTestCase.framework */; }; + 254A0FE70B70FE015FBD7539ACAE1C2A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C75D598FF13B60EB2CD549CB4F31CC05 /* CoreGraphics.framework */; }; + 260BC7EED9289AF321A6F791964CE472 /* EXPMatchers+respondTo.h in Headers */ = {isa = PBXBuildFile; fileRef = 972238611238826A2E259BFD28D740D9 /* EXPMatchers+respondTo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 274D9545D0357B667BCAA82B3FB38ECD /* UIImage+Diff.h in Headers */ = {isa = PBXBuildFile; fileRef = A829ACCB34F1EA88C97102126F1E0496 /* UIImage+Diff.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 276A698B4EB38111291EAB8218845DE0 /* SPTExampleGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = AD1FD21D8F457F0E27CFCFB595FCC669 /* SPTExampleGroup.m */; }; + 2916A0606136A9DC67F2463AB230868B /* EXPMatchers+match.h in Headers */ = {isa = PBXBuildFile; fileRef = E166162701E3405E15FECEF6994FEF52 /* EXPMatchers+match.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 299E9DD0F4332D9DB6311B6E60C5832C /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 74C92BBA05370961FE712919F3B45BC1 /* SystemConfiguration.framework */; }; + 29F2AEAF2B01E3739BF745ADE8E9D0A4 /* Expecta+Snapshots-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = CC81989EC2F7F38C770FB47B29B1E665 /* Expecta+Snapshots-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2BE05F43DACF9A685B82C7DB94C5FA51 /* SPTSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 64F490A38FEF85969F7D32CF7DAD9297 /* SPTSpec.m */; }; + 2C0A8737FDB9B9C6A6BDF437FD11334C /* EXPMatchers+beNil.m in Sources */ = {isa = PBXBuildFile; fileRef = E6275022455B7BEF01F79BED352B30CE /* EXPMatchers+beNil.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 2CFE2898496C1C7096DB8DA43AF19103 /* EXPMatchers+raise.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D4263FB8214129B7A47ABE38111805A /* EXPMatchers+raise.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 2E14619153A453BB8DF389FB6EA147BE /* ExpectaObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 00CE164DFFFD1548EEA5BC737EFB2E4F /* ExpectaObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2E8A32ED46194EDBE22146271F6D26DE /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = B084A0DAE06CE16B13B08D6D5A550E84 /* UIImageView+AFNetworking.m */; }; + 2F427490ACABC4408D57CC0592276678 /* EXPDoubleTuple.h in Headers */ = {isa = PBXBuildFile; fileRef = A0F8321743E27E471F349C43FFFA019C /* EXPDoubleTuple.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2FC59A81B07D43DCB4CAE4962F4A6018 /* PNObject-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = ED867712668303BA41A70CB5E1969AC2 /* PNObject-dummy.m */; }; + 31B6079AAD3DA41DCEBEAAF6FD7A787C /* Specta-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C332041D67D213B77C9019B97A07B72 /* Specta-dummy.m */; }; + 34B6E9A30603BEBBD87BA535B7D384CA /* EXPMatchers+beInstanceOf.h in Headers */ = {isa = PBXBuildFile; fileRef = 077055C691E79C85089B2CBB50EFF72D /* EXPMatchers+beInstanceOf.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3637BC64699FECD40DB791C67CD45394 /* PEARFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B463FAC7628AB20088321502DCE1BF4 /* PEARFileManager.m */; }; + 372F7A9CCE59CE86316CF436F832A3FC /* EXPMatchers+beGreaterThanOrEqualTo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D8BBFAC4FCF0406684B4912DEFF0BA5 /* EXPMatchers+beGreaterThanOrEqualTo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 37A2D0F8493469EF2495FC689440F079 /* EXPMatchers+beLessThanOrEqualTo.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CEF6C8224D8B72BE896822887E9FEC7 /* EXPMatchers+beLessThanOrEqualTo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3800CFF3A1FE79B3A3B3151EB1EB3E8D /* SPTTestSuite.m in Sources */ = {isa = PBXBuildFile; fileRef = DE7319124E858F652E78EEE78BFCD99A /* SPTTestSuite.m */; }; + 38CB41EA09748ABA8AA494C7963C3A80 /* SPTCallSite.m in Sources */ = {isa = PBXBuildFile; fileRef = C9DC12BFABE07666DD4F120195F6CBA9 /* SPTCallSite.m */; }; + 397B320B7C59C168CC5B62E18ED8DEA0 /* EXPMatchers+beSubclassOf.h in Headers */ = {isa = PBXBuildFile; fileRef = 11B8D7A38CA91B88D21DC30CF361022E /* EXPMatchers+beSubclassOf.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 39A998387A26E4C74355B2D4DB470BE3 /* UIDevice-Hardware.h in Headers */ = {isa = PBXBuildFile; fileRef = 11F40498197518D0054C94BB580B6354 /* UIDevice-Hardware.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 39F3AFD4DADD9BF4AEDFAF1FEA82B2F2 /* ExpectaObject+FBSnapshotTest.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE3DA9BC9D60F271CF023406E323EDE /* ExpectaObject+FBSnapshotTest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3B5B7495707BF7133B9FB3F834045611 /* EXPBlockDefinedMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D901B838EEC5C1F057C3B0E9D2EAF1E /* EXPBlockDefinedMatcher.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3C2700C7DAA15C6AF84A595865C42F4D /* EXPMatchers+contain.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E6E877D18DB0AC4191855EC8CB90CBC /* EXPMatchers+contain.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3D2789FC760A97301909F0B1201626CD /* AFNetworking-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EFB4F4A6EBF9B58B69E3E3F5FFAF41D /* AFNetworking-dummy.m */; }; + 3D48EE131B6577ED73A5CC481A6FE40C /* Expecta.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 58AD3556F41D0C4F8075D98B78B2821C /* Expecta.framework */; }; + 3F1BC9BAFFEEABB1ABC7614DF0FC97D5 /* AFAutoPurgingImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = B491529366D57763C1863C7BFAEAD597 /* AFAutoPurgingImageCache.m */; }; + 403292D82DA62291204BF59524BC4EDB /* EXPMatchers+haveCountOf.m in Sources */ = {isa = PBXBuildFile; fileRef = 731E63E14623364DFA2CE5F112B445FB /* EXPMatchers+haveCountOf.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 4052EB66107F09D6F856EAA1F4FC0846 /* UIImage+Snapshot.m in Sources */ = {isa = PBXBuildFile; fileRef = CE87B9C36054834C443E9E1F536F71CA /* UIImage+Snapshot.m */; }; + 410F22568A4D148214B412697A2322E6 /* PNObjectProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = D0251859D2194B8DD130203343433439 /* PNObjectProperty.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 46137F5CC368BF38BAF0D0AF81DD8FFE /* EXPMatchers+raise.h in Headers */ = {isa = PBXBuildFile; fileRef = 729C007887FD208D20BA5C7463209CB1 /* EXPMatchers+raise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 471FD4F68E27AB26FA2AEBB8B245CEE4 /* NSValue+Expecta.h in Headers */ = {isa = PBXBuildFile; fileRef = 0667FC521633B245D5797472CBAE44A6 /* NSValue+Expecta.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 47BE16803392A5BB68905A2F6AE2638B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C011832F271A444CE38AB546BF893CB7 /* Foundation.framework */; }; + 47D16DB1D23CFE027F5BE7F7E391AB4C /* EXPMatchers+FBSnapshotTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E81F08D50F678A8D5B0F18FDD8D26E61 /* EXPMatchers+FBSnapshotTest.m */; }; + 4B5542E72A64100965FFFA704684CED4 /* ExpectaObject+FBSnapshotTest.m in Sources */ = {isa = PBXBuildFile; fileRef = C4FCEB148D2A9DE0A797FBE6968CAE28 /* ExpectaObject+FBSnapshotTest.m */; }; + 4BBCBB9D8EF0B241A4A4FE4982985481 /* ExpectaSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = BFA6C1A3B741D0831BA11C4A61B1671A /* ExpectaSupport.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 4E9495420371C304945421EA68F69B22 /* PNObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 941FEF92BBC85C24850889688C55A31A /* PNObject.m */; }; + 4EB3EF278446BB04246DCA3A510C4D1C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C011832F271A444CE38AB546BF893CB7 /* Foundation.framework */; }; + 4F535B1FDEAB87D360A100F7055A806E /* PEAR-FileManager-iOS-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 116C444E4E0B2289993841A669D8F371 /* PEAR-FileManager-iOS-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5056E0520959CBC31CCB037B59BFC847 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CBF5555FF85E73125C0AEE4ABCE95F5 /* UIKit.framework */; }; + 5062716982D7B13BBDA758E244EDDC86 /* NSDate_Utils-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 2692A0A67F111639E3EAA40D5DE1889F /* NSDate_Utils-dummy.m */; }; + 519F89F4A38E9DBE767A99200B52DFBC /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83308845452F95A0C8ED000AA75BBF1D /* XCTest.framework */; }; + 51DDDB0FB4899757CF6A826B531B940D /* EXPUnsupportedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 680CFD1FCDFA6B058464345597F0BBF0 /* EXPUnsupportedObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 54AF62ACF67074BA98574325C3093D1F /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D743AB04E3D7B81D9141A4B8B5EC6A04 /* Security.framework */; }; + 560698A4D707DCBCC1C8F98BC9B89B23 /* AFURLSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 7264E73C67D22139208F59592E9961DD /* AFURLSessionManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5808B477EFF509D810B5CDCFDC944F80 /* AFImageDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 57AC1497F372BCC2F1675EFD329028EE /* AFImageDownloader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 595C956284B1A67B369F027FC7DAEE2C /* Pods-PNObject_Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = A838922082CBB903238CF0302A9F06FC /* Pods-PNObject_Tests-dummy.m */; }; + 5B2D4A621D3DA971A474776AF36BB073 /* EXPBlockDefinedMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 93027BCB2CB00856CF97BEA85FBE0BCC /* EXPBlockDefinedMatcher.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 5CF7526D330A734F7ABCDCFF3D1A9B35 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C011832F271A444CE38AB546BF893CB7 /* Foundation.framework */; }; + 5EA7043FE10E75D02F3C3052AF8B8318 /* EXPDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB065F9E7871AB78576CEC23B72D0AD /* EXPDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5FF6453E55785669885F626B853FD2AA /* UIProgressView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = E75DAAFC920067DD87C26508EF097BE4 /* UIProgressView+AFNetworking.m */; }; + 60E3009342BEE96D32C546BE2DB60052 /* UIImageView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 5115E74D3D1BEE398F4A023E24121BD9 /* UIImageView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6184ABDA3CAD8105CBAF2199B838191F /* UIDevice-Utils-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 0119C90B122B618D30B242F76C7D3A79 /* UIDevice-Utils-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 659960F7E28E993E08CCC1E8A383E710 /* UIKit+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = DE532B43526854304B2FF59160AD3587 /* UIKit+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 65BC31095CCDFC80CBF6BBA843751F23 /* EXPMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = A7396073D01D42C1A4A64BB83CE09172 /* EXPMatcher.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 66A27898E989A3FA5C15AA671C4536F0 /* EXPMatchers+beIdenticalTo.m in Sources */ = {isa = PBXBuildFile; fileRef = ABC2BD19C88FB68928A4ACDD68A9A724 /* EXPMatchers+beIdenticalTo.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 67459AD239EF669A365519E06B45DCFE /* EXPExpect.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C30C86ADD90253F9625EE97E677992 /* EXPExpect.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 68152D921ABF6A423C192C04FDF94F0F /* AFNetworkReachabilityManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D147D9B92257C3B94B576C35DC424BF /* AFNetworkReachabilityManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 68A38977EBAE334DC3C22386D00D2622 /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 01C0656AD6CD15FA1E1CD0B12E72DBAC /* AFNetworkReachabilityManager.m */; }; + 6B8F67BF9EF9C0D399893E9C92482D49 /* SpectaUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E49D273A400D01F7C968DEDB310739A /* SpectaUtility.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6E1D978790705E137FDE439AA68DD3AA /* EXPFloatTuple.h in Headers */ = {isa = PBXBuildFile; fileRef = 61F3C1DB6F4E00473063EACFC5515CC3 /* EXPFloatTuple.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6ED4ABEE8A5F51F5ECB59FA1781D29C6 /* UIActivityIndicatorView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 00CF9AD323F4143FCE6694EBA30BEB6D /* UIActivityIndicatorView+AFNetworking.m */; }; + 6EFC63A5CED45BB39FC79D87F2C47D6B /* EXPMatchers+beGreaterThan.h in Headers */ = {isa = PBXBuildFile; fileRef = 792CFC9325C0ACB6EB08A01A6BD38F48 /* EXPMatchers+beGreaterThan.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6F278423C8AE1DA47F35E374BB5B91EC /* EXPMatchers+beSupersetOf.m in Sources */ = {isa = PBXBuildFile; fileRef = 53079E33AC4EFBBE446B58B5C9AD7B3A /* EXPMatchers+beSupersetOf.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 707B1A7541C8DBDDE8C27896A61370BE /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 472BFFF9F27894940F02DF7071AB20E6 /* AFURLSessionManager.m */; }; + 70E4BCC789D8C8F1033F23E0752502A7 /* FBSnapshotTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A32AF4D883390B0F2AF7CB064D6E567 /* FBSnapshotTestCase.m */; }; + 715A1122272BB3A29A10AAE4C8C03913 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C011832F271A444CE38AB546BF893CB7 /* Foundation.framework */; }; + 7332F15718920917F544F35CE2C038AA /* AFURLResponseSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 1713E8DF36EE24BDD474593A71C61871 /* AFURLResponseSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 76CCABE79C04444450153424D7CE1DC1 /* EXPMatchers+beSupersetOf.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C07FC3585B90CDC7B4253F3CDD27B9F /* EXPMatchers+beSupersetOf.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 76D337327C10A7555447B69AA1562647 /* EXPMatchers+beInstanceOf.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BD3279B3B9EBDFF6097082F89B34E7F /* EXPMatchers+beInstanceOf.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 772BFB9529121111C517FBA06EA26237 /* Expecta+Snapshots-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 96598024D930A60C681375C1DF09DE6C /* Expecta+Snapshots-dummy.m */; }; + 7861523B9D5DFCF0F4A56E4DE3296AA2 /* FBSnapshotTestController.m in Sources */ = {isa = PBXBuildFile; fileRef = 723A847962247DDB3BC419C8B19D36C9 /* FBSnapshotTestController.m */; }; + 79558B1F97ABE4AB8942DC18BEBD4B82 /* EXPMatchers+beKindOf.h in Headers */ = {isa = PBXBuildFile; fileRef = 6188FAB496F61A82CC5B25315035E54D /* EXPMatchers+beKindOf.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7B223B4E6EF14BA12DA113F7EE10B96C /* NSObject+Expecta.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F5B8ECC50DE0A0648459CB8E03120C0 /* NSObject+Expecta.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7CE07ED7493F98167CDC4F577191B826 /* SPTSharedExampleGroups.h in Headers */ = {isa = PBXBuildFile; fileRef = 4EB3A39CD648527BE16B141FD58D5A58 /* SPTSharedExampleGroups.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 805E425BBEF7A6133E32E1D30A073010 /* EXPExpect.m in Sources */ = {isa = PBXBuildFile; fileRef = BB946E78D3AB1817B7BE4FFFAF51BB20 /* EXPExpect.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 81004C67390828241A58A4A2BAC25FA3 /* SpectaDSL.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D1A759D33F173D10E0B7015AE80CF23 /* SpectaDSL.m */; }; + 81B617F8D26BB10C5726D75E85D21EB7 /* UIButton+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C8EC4D7223E809A20EF5E01C4B7BF9 /* UIButton+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8247F34C45EDD7B97CBC3488E090D15D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C011832F271A444CE38AB546BF893CB7 /* Foundation.framework */; }; + 837B593D7C1D01B4EA400247309D6AB0 /* Expecta-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 70AF5C61DBBAA303456ABD23D9DEF8D2 /* Expecta-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 85E31076D5530AEEB45ACF16B2B8A983 /* EXPMatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = F462F789E7FB9E0958BDB03D88F0FBE3 /* EXPMatchers.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 85EB2F216487CB2E8F3FCCFBC4D69912 /* EXPMatchers+beTruthy.h in Headers */ = {isa = PBXBuildFile; fileRef = 33C3E715C562A5C56F2E392BE1ED75A5 /* EXPMatchers+beTruthy.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 87FD5F0F682CDEB6A348CA448889E3EA /* EXPMatchers+beKindOf.m in Sources */ = {isa = PBXBuildFile; fileRef = 64ABF623C50C215070FC44795D797682 /* EXPMatchers+beKindOf.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 889307E521A732E7CFC5FD480350CA0E /* SPTSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 16381C8F5ADB6A8C9F60144F32E457D0 /* SPTSpec.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 89A46B63E469F17791D14FC64466794A /* UIImage+Diff.m in Sources */ = {isa = PBXBuildFile; fileRef = 95EABF09D36FAE5816ACC4FFDD253A49 /* UIImage+Diff.m */; }; + 8AEED396EA1BF8EA92F1771BA96E61A4 /* UIDevice-Utils.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 5B5C169A7A6F9F35D18EB5691C3CAD4C /* UIDevice-Utils.bundle */; }; + 8C8C1B0D83FE6A4352F15154DB16372C /* EXPMatcherHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AAA9A2FF692B4E11F127ABBA5AA8270 /* EXPMatcherHelpers.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8DB501F22B9C2B05A98240F3300D5CBD /* SPTExampleGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D5200015B01A00B8EE614CEC1A72DBA /* SPTExampleGroup.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 918E06480F28F27361B19D19432F8538 /* EXPMatchers+endWith.m in Sources */ = {isa = PBXBuildFile; fileRef = 5FCE0EEEA51957BFB0C9A1B31785C6DA /* EXPMatchers+endWith.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 931D410B9F8ACB935883DF8C59F9C93E /* EXPMatchers+postNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = E25DD7021E70A195FA82B61C00864AB9 /* EXPMatchers+postNotification.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 93D8E1506F234C3D9559F807A554ECDE /* PNObject.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 50F53D1643B9ED1F04EAF728153AEDAA /* PNObject.bundle */; }; + 94C47C87E397972CE98F75929F3B706C /* ExpectaObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 00B0B399D3C61A4F51723CDBFFD2DB8A /* ExpectaObject.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 98A194768324928F76BF544EEE5EDBE5 /* PNObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E0780BB830EFAC797B401B279BC515 /* PNObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 993893E5C3C3D99357DBE588CC659880 /* Pods-PNObject_Tests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = E46B7AFFF2CB3F42C731CF9CFA5DFC85 /* Pods-PNObject_Tests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9B2E761A064459F77EA9870BEF03ACC3 /* EXPMatchers+postNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = B6B08F884D9E5AAEC4C91E0CEE9E06C5 /* EXPMatchers+postNotification.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9B44D7028D962637E9AFEADFCA36A335 /* SPTCallSite.h in Headers */ = {isa = PBXBuildFile; fileRef = 29DF17D4BD0DFBF04363B12DF5D708DE /* SPTCallSite.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9BB9159FBA757600D3D4C0FF645F3911 /* EXPMatchers+beInTheRangeOf.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5DB4BC4F106F89C9CD4C9D535CB97C /* EXPMatchers+beInTheRangeOf.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 9C4A76E7CF86418FB84B6C340C7E1FA0 /* SpectaTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 69C520A4C76B14DB186E153AEE415291 /* SpectaTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9E1723E2FE89DC9BD907271B23B585F2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C011832F271A444CE38AB546BF893CB7 /* Foundation.framework */; }; + 9E1E90DED74B73ECE53C9AD76DE53E2D /* UIImage+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 7968D24D26E093F665513DEBD3A5E14E /* UIImage+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A00EC4B7A1B96BA93FD5F8C6D58E2CF7 /* NSDate_Utils-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5332092A275215EA81B7A180089C08 /* NSDate_Utils-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A1B57D94E314EBB5B14A52B19D093DF4 /* SPTExcludeGlobalBeforeAfterEach.h in Headers */ = {isa = PBXBuildFile; fileRef = C7D89C09473939D9000E883749E7A017 /* SPTExcludeGlobalBeforeAfterEach.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A32D0D2C7494F484262AB7665FD5C8B6 /* SpectaUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 4518F84A8AE33249879AD096501ACF2C /* SpectaUtility.m */; }; + A462945883F7729B185B64B679A6BFBE /* UIWebView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 312B6D8F8E4F8197145BC05D4EFF798D /* UIWebView+AFNetworking.m */; }; + A4E805FD5751CA4114B8F78B2E1DE506 /* SPTExample.h in Headers */ = {isa = PBXBuildFile; fileRef = 95D4B9664052A1C4C44C63454B6C1EED /* SPTExample.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A6C6019D45BE62C61210A9CC619368EF /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 98C6631C8A5AB6830B4C85C4E316A6FD /* AFNetworkActivityIndicatorManager.m */; }; + AAB359E74D72E65F659D324BB3BF53DD /* Specta-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 7FE77851AA58DDB7CD067DDA327931D1 /* Specta-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AB39AC9746E7575D7449700475E41B0B /* AFHTTPSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CADBBB423380FDCA673761B70A0FAFD /* AFHTTPSessionManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AB889BC8C7B93051E0C88B77E41444D3 /* PEAR-FileManager-iOS-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 31A98D7DB13DDB1AF3280F169F14BC6C /* PEAR-FileManager-iOS-dummy.m */; }; + AD6588767DB99EE8F22AFD7BA4687E62 /* XCTestCase+Specta.h in Headers */ = {isa = PBXBuildFile; fileRef = 02C1CCA906DB8F2DEDF2F199F2262598 /* XCTestCase+Specta.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AE2A07407FB50BA249984DC0620E84C0 /* UIWebView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F58AD51CDC214F86073965CEF4DB89C /* UIWebView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AE9692FDC1174DFB1E0F8920C27EEEDC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C011832F271A444CE38AB546BF893CB7 /* Foundation.framework */; }; + AF03C11A1FAC8132AD3749D8F541701A /* UIButton+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = C9A6D00AE10BF3C39CCB9F5BB8DD39AF /* UIButton+AFNetworking.m */; }; + AF1F46668D4591602887998C6E9C10AD /* EXPMatchers+beCloseTo.h in Headers */ = {isa = PBXBuildFile; fileRef = FB40504B37813B22D5041650F8E335AA /* EXPMatchers+beCloseTo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AFFC8900E52BBEC72059334132F3A8F3 /* ExpectaSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 58A2BEF45B88FB715BB96E49CBCF87AF /* ExpectaSupport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B5852322ADE88AAD56EE042B80BA81E4 /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 53812272391D9612B78D0372F2DFA9B4 /* AFURLResponseSerialization.m */; }; + B8001DED7F2BCC10485DD736B2D7B2CA /* SPTGlobalBeforeAfterEach.h in Headers */ = {isa = PBXBuildFile; fileRef = B18531DAB0C92B47BC6B34F097747A28 /* SPTGlobalBeforeAfterEach.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B84431CF8C64F363A334AA7089F6C134 /* NSValue+Expecta.m in Sources */ = {isa = PBXBuildFile; fileRef = A98C4E446CB7E44B70B68A03B294D040 /* NSValue+Expecta.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + BA12B131F10BCE3BE6E9A02FC908FE9D /* EXPMatchers+beCloseTo.m in Sources */ = {isa = PBXBuildFile; fileRef = 72EB7E5F5CDA29AB6F0E4BC25DE5F867 /* EXPMatchers+beCloseTo.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + BC55C8365AEFF8217F6A567607754854 /* EXPDoubleTuple.m in Sources */ = {isa = PBXBuildFile; fileRef = D787AD02E49323EDF499CEA4B18362E2 /* EXPDoubleTuple.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + BEFFE9FFE52E9A0833A7D2D8FB67EB4D /* EXPMatchers+beSubclassOf.m in Sources */ = {isa = PBXBuildFile; fileRef = F7FE7E898C64DAE5E020AE493772158A /* EXPMatchers+beSubclassOf.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + C2DD28375E1F0B1D0D1D2E4E607C499F /* AFSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CCB15DE181920D49ED519522A12BC5B /* AFSecurityPolicy.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C6354FEC7728A4C86DAD8092509BA7D4 /* UIRefreshControl+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 92B62A9467BD08CEDCCC1BF8AB515D45 /* UIRefreshControl+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C6E9B0A908F410317F2DBBECA0944AAB /* FBSnapshotTestCase-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 185504E9BC20A737B0F6C725AFC1921A /* FBSnapshotTestCase-dummy.m */; }; + CAC483EF637FB4A2C2E2FC75BA631B87 /* AFAutoPurgingImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 03AEAD3C2B6F38C1A68385FBEC16507E /* AFAutoPurgingImageCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CE3F4ECBB0BC095577D66AE50C8E604C /* EXPFloatTuple.m in Sources */ = {isa = PBXBuildFile; fileRef = B30B8D4EC5724E9404D704E681CF9BE1 /* EXPFloatTuple.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + CE91E0B7C2BF362403CB3A75E69AA061 /* UIImage+Snapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = 54293BEDFCD9CE82F2C279AD4B41D67A /* UIImage+Snapshot.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CFA8D6B529A0EBFF0316F2629AB2556E /* AFImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 369EF4C1F5BDF496FA846C56A6E4870A /* AFImageDownloader.m */; }; + D000E3F9104E3B518D5296061F07BAC6 /* NSDate+NSDate_Util.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1C2A65F78882A083F81AE54885379E /* NSDate+NSDate_Util.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D181FA8D3863D4294F5CD912DBEDA7C2 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83308845452F95A0C8ED000AA75BBF1D /* XCTest.framework */; }; + D1D3674271C4183F0C9E138EF724DEB7 /* UIDevice-Utils-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B22ACC9B3ADC87EE7F92E8760D777A4 /* UIDevice-Utils-dummy.m */; }; + D1E9E55D21C92E33ACE7E911BCB96269 /* FBSnapshotTestCasePlatform.h in Headers */ = {isa = PBXBuildFile; fileRef = 6456DEF4D3F54D788069D69C45928CBC /* FBSnapshotTestCasePlatform.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D83677C54D2226C67886A525B0B46FBE /* EXPMatchers+beLessThanOrEqualTo.m in Sources */ = {isa = PBXBuildFile; fileRef = 1904F5E4534B5BBEC9867AFBB51ED621 /* EXPMatchers+beLessThanOrEqualTo.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + D954A37F9C0000D4D973F95402B5BE35 /* Specta.h in Headers */ = {isa = PBXBuildFile; fileRef = A4183324B6BABCEE7610BB0F038B1F59 /* Specta.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D9F4E833E37B611B432F6B5D7072DDA2 /* UIProgressView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CB1274205C7A040F2B11C88E1B54172 /* UIProgressView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DB30F82FB1BE083D9471B965FB500CA2 /* EXPMatchers+conformTo.m in Sources */ = {isa = PBXBuildFile; fileRef = B8D1FA8C4EE246A36E4E4831C67680F8 /* EXPMatchers+conformTo.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + DE7E50D08184052574DD94F7D20067BF /* UIDevice-Hardware.m in Sources */ = {isa = PBXBuildFile; fileRef = DB25C8D56F3BC7AF00EC94819841709D /* UIDevice-Hardware.m */; }; + DFFA215EEAA8DDBD540076927535275C /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 0086B599B6C85DF27B4ED96EEBA0F597 /* AFURLRequestSerialization.m */; }; + E0A077DFB064B79685B810CCEFB2F1EF /* EXPMatchers+respondTo.m in Sources */ = {isa = PBXBuildFile; fileRef = FFA9C82F3CA4A7726C38765EA662E470 /* EXPMatchers+respondTo.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + E0AAF49134A0505DF00E20E7B62087E1 /* EXPMatchers+beIdenticalTo.h in Headers */ = {isa = PBXBuildFile; fileRef = 83EF389320BC8B3BF6D71B078974AC6E /* EXPMatchers+beIdenticalTo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E0D4045AC4C1B41917FCA23A042D18B2 /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F4D1EA21341FF1B04C50B1C5453758C /* AFHTTPSessionManager.m */; }; + E10811B5E4578C31FB675361C99EDED6 /* UIImage+Compare.h in Headers */ = {isa = PBXBuildFile; fileRef = D382546D2C84FB1FD054DF511E64DDF0 /* UIImage+Compare.h */; settings = {ATTRIBUTES = (Private, ); }; }; + E1D01718CD5CFB570AE7B1D46BCE1436 /* PNObjectProperty.m in Sources */ = {isa = PBXBuildFile; fileRef = 570E079E6A901F2AD57E8F3241BCE8C3 /* PNObjectProperty.m */; }; + E1EC4532663CA75DE5BD00CB0A56814D /* Expecta.h in Headers */ = {isa = PBXBuildFile; fileRef = F9664ECC37853F2F4C53EA28E02A4B11 /* Expecta.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E3C61206BEDBA3EBAA0A69B51DE0F3AA /* FBSnapshotTestCasePlatform.m in Sources */ = {isa = PBXBuildFile; fileRef = AB96365A5153FA50BDB938207154513D /* FBSnapshotTestCasePlatform.m */; }; + E4EC16570D46F25B3BD2830D65C06AE5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C011832F271A444CE38AB546BF893CB7 /* Foundation.framework */; }; + E735386085CE344F6A01178CF4763852 /* EXPMatchers+beNil.h in Headers */ = {isa = PBXBuildFile; fileRef = 991F3CF7356D606F1EB7B29CD98506D8 /* EXPMatchers+beNil.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E7988678C81F7CCB95D239375FC6986D /* AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 82AB26C80BBEABC97E60E162BDB7B620 /* AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EA840679AC9463E0E3D371FCC3466B0A /* EXPMatchers+FBSnapshotTest.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E6A13BA89A028B6BDBF2E7C01FC96FD /* EXPMatchers+FBSnapshotTest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EC3414CDAA9691CCA70739A44A1E7A9D /* Pods-PNObject_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = AA1CE72928E46C7F70D4BBE1CD90756D /* Pods-PNObject_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EC67CB7330FCA32710213A5EA3DD983F /* SPTExample.m in Sources */ = {isa = PBXBuildFile; fileRef = EB692859FF4E52214F253B1CDC8E86C8 /* SPTExample.m */; }; + EC7CADE416A78A1CD6936018A6695126 /* AFNetworking-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 20B68B3A3F5D9BB99DDD14EC6B840405 /* AFNetworking-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EF6497EE123F6BC0C1B09717437C5908 /* EXPUnsupportedObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F1BB2ADA82E22F3F0913AC850D335C0 /* EXPUnsupportedObject.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + EFA65E728C5137E08D45ABD91C37AA27 /* SpectaDSL.h in Headers */ = {isa = PBXBuildFile; fileRef = 35585DFFA728C4C5A14AA183EC036013 /* SpectaDSL.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F0DDF02A078B917997FF025BB33BB842 /* EXPMatchers+conformTo.h in Headers */ = {isa = PBXBuildFile; fileRef = AA8B73F95EA806BA1F359F5D99822CBF /* EXPMatchers+conformTo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F12D57414A73406831CC032A7170DBFF /* EXPMatchers+beginWith.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C0D6CF0102398AA5794D260E6CA94B0 /* EXPMatchers+beginWith.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + F1867C99D4A92FC191093E4901E463B5 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83308845452F95A0C8ED000AA75BBF1D /* XCTest.framework */; }; + F2BF22CC173E7B04AB4E726675A14A62 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C011832F271A444CE38AB546BF893CB7 /* Foundation.framework */; }; + F41209A94070904A00BDF24ACB6336B6 /* EXPMatchers+beFalsy.h in Headers */ = {isa = PBXBuildFile; fileRef = A57B5C631B9EB4F5FE82A815FD1205E3 /* EXPMatchers+beFalsy.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F58F9BC7759BB8A5007B8821A275AEDD /* FBSnapshotTestController.h in Headers */ = {isa = PBXBuildFile; fileRef = 009062739020CCD0E6297F2C8D4CFB93 /* FBSnapshotTestController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F65411E9EF00A9BB39D6BD1521A4F3FD /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C6602571BB0B2EB97F81DF77649A2D79 /* MobileCoreServices.framework */; }; + F75CB2A727F678C9A848A3A11EA7979B /* EXPMatchers+haveCountOf.h in Headers */ = {isa = PBXBuildFile; fileRef = ADB01FE4B3DF3EA50915878776A88684 /* EXPMatchers+haveCountOf.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FA839F20BC13A260E089D374CAAB584E /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83308845452F95A0C8ED000AA75BBF1D /* XCTest.framework */; }; + FC20596ABFE14A61F171A29FD03275E7 /* EXPMatchers+contain.m in Sources */ = {isa = PBXBuildFile; fileRef = AE3FC0336DCF98CD24220FB3C4AF534C /* EXPMatchers+contain.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + FC45858927D3B6A0F922C4B697B04A38 /* EXPMatchers+match.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DDC1EDF29C314462DBE55FFD34C51EF /* EXPMatchers+match.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + FCDC9C0B871F82CB1AEE73303F9A2927 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 737516B7AC7E0AE5ADC04B99A65FAB2B /* QuartzCore.framework */; }; + FD2D4497BC41412128C2D87C1BDE7398 /* EXPMatchers+beginWith.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D750B75B3C40BCBE799D93256132FF6 /* EXPMatchers+beginWith.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FDACA7B483937A645DBDE9E25DEBA758 /* XCTestCase+Specta.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D235B3CA6493F5DFD4DF8399F3F6E52 /* XCTestCase+Specta.m */; }; + FE8E34356D24F6759A8B010ED2F5707B /* EXPMatchers+raiseWithReason.m in Sources */ = {isa = PBXBuildFile; fileRef = 264F3B713EF22CA791B9485BEFA42727 /* EXPMatchers+raiseWithReason.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 0CD167825DC3C6EBCB6F12FF7295B619 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3241BF41D67FE3979A15BEAA18A92CA3; + remoteInfo = "NSDate_Utils-NSDate_Utils"; + }; + 4B0DAF64EA0AC85B798C1549D1A53B2C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = BF088AF63E437970817C1E809577C700; + remoteInfo = "PEAR-FileManager-iOS"; + }; + 4B732239BE294A58DC6272F6728ED39E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1C3436CEA5C3D39764C5F54374794ECB; + remoteInfo = AFNetworking; + }; + 4DBD8C9175CF420255ACC02D04C83503 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = FEFA0EA1EEA4C33F0DE10FCEDDA0F0A2; + remoteInfo = Specta; + }; + 68E178B9E911168080B99FBC53CEA776 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5FC3550CE584133F3A6D63CD1997A942; + remoteInfo = "UIDevice-Utils"; + }; + 6D753E6161742F970C234BAAE7F6406C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 20B8A8681820FA8513BD7E48A85DC18D; + remoteInfo = NSDate_Utils; + }; + 82200C210A231BA5B34F0CB3A8F037F3 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = D07447EE3CEBB0BCB8D61DFCB8EA915F; + remoteInfo = FBSnapshotTestCase; + }; + 8ED7A6856CF11CC77820D019BFD88B37 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 619F0D28240534293108906FED04836F; + remoteInfo = "Expecta+Snapshots"; + }; + 933AD56993BFD86E122885B5E3201263 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 14C0C6F18E6665CC5462A4754C119096; + remoteInfo = PNObject; + }; + A24CCDAB9D3B52B9B9BA3FB118E7272F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 14C0C6F18E6665CC5462A4754C119096; + remoteInfo = PNObject; + }; + BE37CAAFB350F19DE50212EBAE338997 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = F4EDFD36E823E9C8FC07F587475D3097; + remoteInfo = "PNObject-PNObject"; + }; + CCF83280732A67033B72EE54815FFD3F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 0D888F29E05E498D0CD91A51D28599A5; + remoteInfo = Expecta; + }; + DB8B9514246D0DB2C2107F5951E3CEA0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 0D888F29E05E498D0CD91A51D28599A5; + remoteInfo = Expecta; + }; + F88968C905905F79592DE479282C3689 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 0AC755D7223E1DCE35AE9FCCC88542DE; + remoteInfo = "UIDevice-Utils-UIDevice-Utils"; + }; + F9BBA6CBCE0B1A136EAFACE5185B512D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = D07447EE3CEBB0BCB8D61DFCB8EA915F; + remoteInfo = FBSnapshotTestCase; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 0086B599B6C85DF27B4ED96EEBA0F597 /* AFURLRequestSerialization.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLRequestSerialization.m; path = AFNetworking/AFURLRequestSerialization.m; sourceTree = ""; }; + 009062739020CCD0E6297F2C8D4CFB93 /* FBSnapshotTestController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FBSnapshotTestController.h; path = FBSnapshotTestCase/FBSnapshotTestController.h; sourceTree = ""; }; + 00B0B399D3C61A4F51723CDBFFD2DB8A /* ExpectaObject.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ExpectaObject.m; path = Expecta/ExpectaObject.m; sourceTree = ""; }; + 00CE164DFFFD1548EEA5BC737EFB2E4F /* ExpectaObject.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ExpectaObject.h; path = Expecta/ExpectaObject.h; sourceTree = ""; }; + 00CF9AD323F4143FCE6694EBA30BEB6D /* UIActivityIndicatorView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIActivityIndicatorView+AFNetworking.m"; path = "UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m"; sourceTree = ""; }; + 0119C90B122B618D30B242F76C7D3A79 /* UIDevice-Utils-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UIDevice-Utils-umbrella.h"; sourceTree = ""; }; + 01C0656AD6CD15FA1E1CD0B12E72DBAC /* AFNetworkReachabilityManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFNetworkReachabilityManager.m; path = AFNetworking/AFNetworkReachabilityManager.m; sourceTree = ""; }; + 02C1CCA906DB8F2DEDF2F199F2262598 /* XCTestCase+Specta.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "XCTestCase+Specta.h"; path = "Specta/Specta/XCTestCase+Specta.h"; sourceTree = ""; }; + 039DE5E921EE2C83F0DB098D9C48758F /* EXPMatchers+equal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+equal.h"; path = "Expecta/Matchers/EXPMatchers+equal.h"; sourceTree = ""; }; + 03AEAD3C2B6F38C1A68385FBEC16507E /* AFAutoPurgingImageCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFAutoPurgingImageCache.h; path = "UIKit+AFNetworking/AFAutoPurgingImageCache.h"; sourceTree = ""; }; + 0667FC521633B245D5797472CBAE44A6 /* NSValue+Expecta.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSValue+Expecta.h"; path = "Expecta/NSValue+Expecta.h"; sourceTree = ""; }; + 077055C691E79C85089B2CBB50EFF72D /* EXPMatchers+beInstanceOf.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beInstanceOf.h"; path = "Expecta/Matchers/EXPMatchers+beInstanceOf.h"; sourceTree = ""; }; + 08D27CF8BF643F6B5B13F8232258D5B8 /* FBSnapshotTestCase.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FBSnapshotTestCase.h; path = FBSnapshotTestCase/FBSnapshotTestCase.h; sourceTree = ""; }; + 0A32AF4D883390B0F2AF7CB064D6E567 /* FBSnapshotTestCase.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FBSnapshotTestCase.m; path = FBSnapshotTestCase/FBSnapshotTestCase.m; sourceTree = ""; }; + 0B22ACC9B3ADC87EE7F92E8760D777A4 /* UIDevice-Utils-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UIDevice-Utils-dummy.m"; sourceTree = ""; }; + 0BD3279B3B9EBDFF6097082F89B34E7F /* EXPMatchers+beInstanceOf.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beInstanceOf.m"; path = "Expecta/Matchers/EXPMatchers+beInstanceOf.m"; sourceTree = ""; }; + 0CADBBB423380FDCA673761B70A0FAFD /* AFHTTPSessionManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFHTTPSessionManager.h; path = AFNetworking/AFHTTPSessionManager.h; sourceTree = ""; }; + 0E49D273A400D01F7C968DEDB310739A /* SpectaUtility.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SpectaUtility.h; path = Specta/Specta/SpectaUtility.h; sourceTree = ""; }; + 116C444E4E0B2289993841A669D8F371 /* PEAR-FileManager-iOS-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PEAR-FileManager-iOS-umbrella.h"; sourceTree = ""; }; + 11B8D7A38CA91B88D21DC30CF361022E /* EXPMatchers+beSubclassOf.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beSubclassOf.h"; path = "Expecta/Matchers/EXPMatchers+beSubclassOf.h"; sourceTree = ""; }; + 11F40498197518D0054C94BB580B6354 /* UIDevice-Hardware.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIDevice-Hardware.h"; path = "Pod/Classes/UIDevice-Hardware.h"; sourceTree = ""; }; + 16381C8F5ADB6A8C9F60144F32E457D0 /* SPTSpec.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SPTSpec.h; path = Specta/Specta/SPTSpec.h; sourceTree = ""; }; + 1713E8DF36EE24BDD474593A71C61871 /* AFURLResponseSerialization.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLResponseSerialization.h; path = AFNetworking/AFURLResponseSerialization.h; sourceTree = ""; }; + 185504E9BC20A737B0F6C725AFC1921A /* FBSnapshotTestCase-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FBSnapshotTestCase-dummy.m"; sourceTree = ""; }; + 1904F5E4534B5BBEC9867AFBB51ED621 /* EXPMatchers+beLessThanOrEqualTo.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beLessThanOrEqualTo.m"; path = "Expecta/Matchers/EXPMatchers+beLessThanOrEqualTo.m"; sourceTree = ""; }; + 1C07FC3585B90CDC7B4253F3CDD27B9F /* EXPMatchers+beSupersetOf.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beSupersetOf.h"; path = "Expecta/Matchers/EXPMatchers+beSupersetOf.h"; sourceTree = ""; }; + 1CEF6C8224D8B72BE896822887E9FEC7 /* EXPMatchers+beLessThanOrEqualTo.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beLessThanOrEqualTo.h"; path = "Expecta/Matchers/EXPMatchers+beLessThanOrEqualTo.h"; sourceTree = ""; }; + 1E9631FC8095895820932DC31657A035 /* Pods_PNObject_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PNObject_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 1F1BB2ADA82E22F3F0913AC850D335C0 /* EXPUnsupportedObject.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = EXPUnsupportedObject.m; path = Expecta/EXPUnsupportedObject.m; sourceTree = ""; }; + 20B68B3A3F5D9BB99DDD14EC6B840405 /* AFNetworking-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AFNetworking-umbrella.h"; sourceTree = ""; }; + 218AF1ECF876B28B484AD438E085D491 /* PNObject.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PNObject.xcconfig; sourceTree = ""; }; + 228EBF0A7945E0E7F50209AAF9F47A2B /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 231DEFBB5E4E226771797D517A35EE2B /* Expecta-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Expecta-dummy.m"; sourceTree = ""; }; + 2480119A8B86BA567BE7777F466E6E27 /* UIActivityIndicatorView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIActivityIndicatorView+AFNetworking.h"; path = "UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h"; sourceTree = ""; }; + 264F3B713EF22CA791B9485BEFA42727 /* EXPMatchers+raiseWithReason.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+raiseWithReason.m"; path = "Expecta/Matchers/EXPMatchers+raiseWithReason.m"; sourceTree = ""; }; + 2692A0A67F111639E3EAA40D5DE1889F /* NSDate_Utils-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "NSDate_Utils-dummy.m"; sourceTree = ""; }; + 26DB3DA19A34FAC2082C658C5199DEC8 /* PEAR-FileManager-iOS-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PEAR-FileManager-iOS-prefix.pch"; sourceTree = ""; }; + 2701DCB1C4CA2591F34532CBFE0BC596 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 27053B717A2E6C890A9A5567BE892759 /* PEAR_FileManager_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PEAR_FileManager_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 27E5C65560784FEE47CF5B6B7C469CCD /* EXPMatchers+beFalsy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beFalsy.m"; path = "Expecta/Matchers/EXPMatchers+beFalsy.m"; sourceTree = ""; }; + 29DF17D4BD0DFBF04363B12DF5D708DE /* SPTCallSite.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SPTCallSite.h; path = Specta/Specta/SPTCallSite.h; sourceTree = ""; }; + 2AAA9A2FF692B4E11F127ABBA5AA8270 /* EXPMatcherHelpers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = EXPMatcherHelpers.h; path = Expecta/Matchers/EXPMatcherHelpers.h; sourceTree = ""; }; + 2CEB36A633CECB76D6838E2E9C892579 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 2EE729CB108F93E49233153B2022FF79 /* AFSecurityPolicy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFSecurityPolicy.m; path = AFNetworking/AFSecurityPolicy.m; sourceTree = ""; }; + 312B6D8F8E4F8197145BC05D4EFF798D /* UIWebView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIWebView+AFNetworking.m"; path = "UIKit+AFNetworking/UIWebView+AFNetworking.m"; sourceTree = ""; }; + 31A98D7DB13DDB1AF3280F169F14BC6C /* PEAR-FileManager-iOS-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PEAR-FileManager-iOS-dummy.m"; sourceTree = ""; }; + 31EC73DD2649E7FFDFFC27FD45896BD4 /* FBSnapshotTestCase.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FBSnapshotTestCase.xcconfig; sourceTree = ""; }; + 33C3E715C562A5C56F2E392BE1ED75A5 /* EXPMatchers+beTruthy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beTruthy.h"; path = "Expecta/Matchers/EXPMatchers+beTruthy.h"; sourceTree = ""; }; + 35585DFFA728C4C5A14AA183EC036013 /* SpectaDSL.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SpectaDSL.h; path = Specta/Specta/SpectaDSL.h; sourceTree = ""; }; + 369EF4C1F5BDF496FA846C56A6E4870A /* AFImageDownloader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFImageDownloader.m; path = "UIKit+AFNetworking/AFImageDownloader.m"; sourceTree = ""; }; + 3815F645AAADCAF88CC9740D8FED47C6 /* XCTest+Private.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "XCTest+Private.h"; path = "Specta/Specta/XCTest+Private.h"; sourceTree = ""; }; + 389952D5D54C67E70501B09516F08587 /* Pods-PNObject_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-PNObject_Tests.modulemap"; sourceTree = ""; }; + 399B462AA47CD6AB8297E3B09AEB18F0 /* EXPMatchers+beTruthy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beTruthy.m"; path = "Expecta/Matchers/EXPMatchers+beTruthy.m"; sourceTree = ""; }; + 3C332041D67D213B77C9019B97A07B72 /* Specta-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Specta-dummy.m"; sourceTree = ""; }; + 4518F84A8AE33249879AD096501ACF2C /* SpectaUtility.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SpectaUtility.m; path = Specta/Specta/SpectaUtility.m; sourceTree = ""; }; + 4549BF253506807AEDF1B6ADDC55B169 /* ResourceBundle-NSDate_Utils-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "ResourceBundle-NSDate_Utils-Info.plist"; sourceTree = ""; }; + 472BFFF9F27894940F02DF7071AB20E6 /* AFURLSessionManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLSessionManager.m; path = AFNetworking/AFURLSessionManager.m; sourceTree = ""; }; + 499413218E4F25EEFA02E1896294EED3 /* PEAR-FileManager-iOS.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "PEAR-FileManager-iOS.modulemap"; sourceTree = ""; }; + 49C7A7BE9DAD1731154BC8C233529B63 /* Expecta+Snapshots-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Expecta+Snapshots-prefix.pch"; sourceTree = ""; }; + 4B07E3A6961EE0F0821BEDD4EFDBC3E6 /* SPTSharedExampleGroups.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SPTSharedExampleGroups.m; path = Specta/Specta/SPTSharedExampleGroups.m; sourceTree = ""; }; + 4CA3F01C6FCD8C40E554418F47CB254D /* UIDevice-Utils.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "UIDevice-Utils.xcconfig"; sourceTree = ""; }; + 4D21BA597DC54DA5B79874658C865E54 /* PNObject-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PNObject-umbrella.h"; sourceTree = ""; }; + 4D901B838EEC5C1F057C3B0E9D2EAF1E /* EXPBlockDefinedMatcher.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = EXPBlockDefinedMatcher.h; path = Expecta/EXPBlockDefinedMatcher.h; sourceTree = ""; }; + 4DDC1EDF29C314462DBE55FFD34C51EF /* EXPMatchers+match.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+match.m"; path = "Expecta/Matchers/EXPMatchers+match.m"; sourceTree = ""; }; + 4EB3A39CD648527BE16B141FD58D5A58 /* SPTSharedExampleGroups.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SPTSharedExampleGroups.h; path = Specta/Specta/SPTSharedExampleGroups.h; sourceTree = ""; }; + 4F4D1EA21341FF1B04C50B1C5453758C /* AFHTTPSessionManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFHTTPSessionManager.m; path = AFNetworking/AFHTTPSessionManager.m; sourceTree = ""; }; + 5041E2A91C7A8740358698C67EC25A89 /* Pods-PNObject_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-PNObject_Example-acknowledgements.plist"; sourceTree = ""; }; + 50F53D1643B9ED1F04EAF728153AEDAA /* PNObject.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PNObject.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; + 5115E74D3D1BEE398F4A023E24121BD9 /* UIImageView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+AFNetworking.h"; path = "UIKit+AFNetworking/UIImageView+AFNetworking.h"; sourceTree = ""; }; + 53079E33AC4EFBBE446B58B5C9AD7B3A /* EXPMatchers+beSupersetOf.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beSupersetOf.m"; path = "Expecta/Matchers/EXPMatchers+beSupersetOf.m"; sourceTree = ""; }; + 534BF2171D335392C5C6F17F1B4BF69D /* Specta.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Specta.modulemap; sourceTree = ""; }; + 53812272391D9612B78D0372F2DFA9B4 /* AFURLResponseSerialization.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLResponseSerialization.m; path = AFNetworking/AFURLResponseSerialization.m; sourceTree = ""; }; + 54293BEDFCD9CE82F2C279AD4B41D67A /* UIImage+Snapshot.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+Snapshot.h"; path = "FBSnapshotTestCase/Categories/UIImage+Snapshot.h"; sourceTree = ""; }; + 56CC371A2A26C2206AD6BD10FF6DA775 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 570E079E6A901F2AD57E8F3241BCE8C3 /* PNObjectProperty.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = PNObjectProperty.m; sourceTree = ""; }; + 573BE10C3E06A0BD955F3C0EB3745CEB /* AFNetworking.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = AFNetworking.modulemap; sourceTree = ""; }; + 57AC1497F372BCC2F1675EFD329028EE /* AFImageDownloader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFImageDownloader.h; path = "UIKit+AFNetworking/AFImageDownloader.h"; sourceTree = ""; }; + 58A2BEF45B88FB715BB96E49CBCF87AF /* ExpectaSupport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ExpectaSupport.h; path = Expecta/ExpectaSupport.h; sourceTree = ""; }; + 58AD3556F41D0C4F8075D98B78B2821C /* Expecta.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Expecta.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 5AC70376CF4B8810FD6F1D7416760F34 /* Expecta+Snapshots.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Expecta+Snapshots.modulemap"; sourceTree = ""; }; + 5B5C169A7A6F9F35D18EB5691C3CAD4C /* UIDevice-Utils.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UIDevice-Utils.bundle"; sourceTree = BUILT_PRODUCTS_DIR; }; + 5CB1274205C7A040F2B11C88E1B54172 /* UIProgressView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIProgressView+AFNetworking.h"; path = "UIKit+AFNetworking/UIProgressView+AFNetworking.h"; sourceTree = ""; }; + 5CCB15DE181920D49ED519522A12BC5B /* AFSecurityPolicy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFSecurityPolicy.h; path = AFNetworking/AFSecurityPolicy.h; sourceTree = ""; }; + 5D5200015B01A00B8EE614CEC1A72DBA /* SPTExampleGroup.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SPTExampleGroup.h; path = Specta/Specta/SPTExampleGroup.h; sourceTree = ""; }; + 5EFB4F4A6EBF9B58B69E3E3F5FFAF41D /* AFNetworking-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "AFNetworking-dummy.m"; sourceTree = ""; }; + 5F58AD51CDC214F86073965CEF4DB89C /* UIWebView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIWebView+AFNetworking.h"; path = "UIKit+AFNetworking/UIWebView+AFNetworking.h"; sourceTree = ""; }; + 5F5B8ECC50DE0A0648459CB8E03120C0 /* NSObject+Expecta.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSObject+Expecta.h"; path = "Expecta/NSObject+Expecta.h"; sourceTree = ""; }; + 5F8244AC7C380BAC0FF7995A0DD0985C /* SPTCompiledExample.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SPTCompiledExample.m; path = Specta/Specta/SPTCompiledExample.m; sourceTree = ""; }; + 5FCE0EEEA51957BFB0C9A1B31785C6DA /* EXPMatchers+endWith.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+endWith.m"; path = "Expecta/Matchers/EXPMatchers+endWith.m"; sourceTree = ""; }; + 60972F56E13BC9E547CFBF5F290DD89E /* EXPMatchers+endWith.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+endWith.h"; path = "Expecta/Matchers/EXPMatchers+endWith.h"; sourceTree = ""; }; + 60B530196848B62AA6D54AEEB46A06D8 /* Pods-PNObject_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-PNObject_Example-dummy.m"; sourceTree = ""; }; + 6188FAB496F61A82CC5B25315035E54D /* EXPMatchers+beKindOf.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beKindOf.h"; path = "Expecta/Matchers/EXPMatchers+beKindOf.h"; sourceTree = ""; }; + 61BDFBB0CBB83F681A933201CF0FE1C7 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 61F3C1DB6F4E00473063EACFC5515CC3 /* EXPFloatTuple.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = EXPFloatTuple.h; path = Expecta/EXPFloatTuple.h; sourceTree = ""; }; + 620776E83BE8FBF047E6CB8725265419 /* EXPMatchers+equal.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+equal.m"; path = "Expecta/Matchers/EXPMatchers+equal.m"; sourceTree = ""; }; + 6387377EE062A0FDF751AA136AC2D137 /* Expecta_Snapshots.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Expecta_Snapshots.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6456DEF4D3F54D788069D69C45928CBC /* FBSnapshotTestCasePlatform.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FBSnapshotTestCasePlatform.h; path = FBSnapshotTestCase/FBSnapshotTestCasePlatform.h; sourceTree = ""; }; + 64ABF623C50C215070FC44795D797682 /* EXPMatchers+beKindOf.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beKindOf.m"; path = "Expecta/Matchers/EXPMatchers+beKindOf.m"; sourceTree = ""; }; + 64F490A38FEF85969F7D32CF7DAD9297 /* SPTSpec.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SPTSpec.m; path = Specta/Specta/SPTSpec.m; sourceTree = ""; }; + 680CFD1FCDFA6B058464345597F0BBF0 /* EXPUnsupportedObject.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = EXPUnsupportedObject.h; path = Expecta/EXPUnsupportedObject.h; sourceTree = ""; }; + 684260D2513FE8AD036B49C00B805318 /* Expecta.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Expecta.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 69C520A4C76B14DB186E153AEE415291 /* SpectaTypes.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SpectaTypes.h; path = Specta/Specta/SpectaTypes.h; sourceTree = ""; }; + 6A9C98362B8CD1F0E2749529D53DEE66 /* AFURLRequestSerialization.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLRequestSerialization.h; path = AFNetworking/AFURLRequestSerialization.h; sourceTree = ""; }; + 6BCF0B57CC5FE7DB7261CE7C60EAE6C1 /* NSDate_Utils.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NSDate_Utils.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D147D9B92257C3B94B576C35DC424BF /* AFNetworkReachabilityManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworkReachabilityManager.h; path = AFNetworking/AFNetworkReachabilityManager.h; sourceTree = ""; }; + 6D1A759D33F173D10E0B7015AE80CF23 /* SpectaDSL.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SpectaDSL.m; path = Specta/Specta/SpectaDSL.m; sourceTree = ""; }; + 6D4263FB8214129B7A47ABE38111805A /* EXPMatchers+raise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+raise.m"; path = "Expecta/Matchers/EXPMatchers+raise.m"; sourceTree = ""; }; + 6D8BBFAC4FCF0406684B4912DEFF0BA5 /* EXPMatchers+beGreaterThanOrEqualTo.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beGreaterThanOrEqualTo.h"; path = "Expecta/Matchers/EXPMatchers+beGreaterThanOrEqualTo.h"; sourceTree = ""; }; + 6E6E877D18DB0AC4191855EC8CB90CBC /* EXPMatchers+contain.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+contain.h"; path = "Expecta/Matchers/EXPMatchers+contain.h"; sourceTree = ""; }; + 6E8CE9158C2B090D4648C7F04DA1889C /* Specta-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Specta-prefix.pch"; sourceTree = ""; }; + 700C6F8D29A77D7A3DBBB33423557925 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 70AF5C61DBBAA303456ABD23D9DEF8D2 /* Expecta-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Expecta-umbrella.h"; sourceTree = ""; }; + 70B374F2107437CA956DF24E5E19499A /* SwiftSupport.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SwiftSupport.swift; path = FBSnapshotTestCase/SwiftSupport.swift; sourceTree = ""; }; + 71227C8B97BF0A085C371A91B264B57F /* NSDate_Utils.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = NSDate_Utils.modulemap; sourceTree = ""; }; + 723A847962247DDB3BC419C8B19D36C9 /* FBSnapshotTestController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FBSnapshotTestController.m; path = FBSnapshotTestCase/FBSnapshotTestController.m; sourceTree = ""; }; + 7264E73C67D22139208F59592E9961DD /* AFURLSessionManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLSessionManager.h; path = AFNetworking/AFURLSessionManager.h; sourceTree = ""; }; + 729C007887FD208D20BA5C7463209CB1 /* EXPMatchers+raise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+raise.h"; path = "Expecta/Matchers/EXPMatchers+raise.h"; sourceTree = ""; }; + 72EB7E5F5CDA29AB6F0E4BC25DE5F867 /* EXPMatchers+beCloseTo.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beCloseTo.m"; path = "Expecta/Matchers/EXPMatchers+beCloseTo.m"; sourceTree = ""; }; + 731E63E14623364DFA2CE5F112B445FB /* EXPMatchers+haveCountOf.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+haveCountOf.m"; path = "Expecta/Matchers/EXPMatchers+haveCountOf.m"; sourceTree = ""; }; + 737516B7AC7E0AE5ADC04B99A65FAB2B /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + 748E0B295CE6475615F29850C6CD4B0A /* Pods-PNObject_Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-PNObject_Tests-acknowledgements.plist"; sourceTree = ""; }; + 74C92BBA05370961FE712919F3B45BC1 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; + 767D0A7A31EF6EBC0781569FEC410B20 /* UIDevice-Utils.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "UIDevice-Utils.modulemap"; sourceTree = ""; }; + 792CFC9325C0ACB6EB08A01A6BD38F48 /* EXPMatchers+beGreaterThan.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beGreaterThan.h"; path = "Expecta/Matchers/EXPMatchers+beGreaterThan.h"; sourceTree = ""; }; + 7968D24D26E093F665513DEBD3A5E14E /* UIImage+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+AFNetworking.h"; path = "UIKit+AFNetworking/UIImage+AFNetworking.h"; sourceTree = ""; }; + 797359E997295E3851B8A92E12EC7DAE /* AFNetworkActivityIndicatorManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworkActivityIndicatorManager.h; path = "UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h"; sourceTree = ""; }; + 7A09A844498D0BE9ECEF19919560448F /* ResourceBundle-PNObject-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "ResourceBundle-PNObject-Info.plist"; sourceTree = ""; }; + 7D235B3CA6493F5DFD4DF8399F3F6E52 /* XCTestCase+Specta.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "XCTestCase+Specta.m"; path = "Specta/Specta/XCTestCase+Specta.m"; sourceTree = ""; }; + 7D750B75B3C40BCBE799D93256132FF6 /* EXPMatchers+beginWith.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beginWith.h"; path = "Expecta/Matchers/EXPMatchers+beginWith.h"; sourceTree = ""; }; + 7FE77851AA58DDB7CD067DDA327931D1 /* Specta-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Specta-umbrella.h"; sourceTree = ""; }; + 806E3AAC0A4A15EF79D3BCD7811DB696 /* FBSnapshotTestCase.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FBSnapshotTestCase.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 821A5C557963A679894335F2C12F9FC9 /* Pods-PNObject_Tests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-PNObject_Tests-resources.sh"; sourceTree = ""; }; + 824C131E1882E849655990203D7BA94B /* Pods_PNObject_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PNObject_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 82AB26C80BBEABC97E60E162BDB7B620 /* AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworking.h; path = AFNetworking/AFNetworking.h; sourceTree = ""; }; + 83308845452F95A0C8ED000AA75BBF1D /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/System/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 836B3E38F7F7AF752C3A2569E3B463FC /* PNObject-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PNObject-prefix.pch"; sourceTree = ""; }; + 83EF389320BC8B3BF6D71B078974AC6E /* EXPMatchers+beIdenticalTo.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beIdenticalTo.h"; path = "Expecta/Matchers/EXPMatchers+beIdenticalTo.h"; sourceTree = ""; }; + 845300C5E6C0EB3B1FFE992EE5D4D5B8 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 85236F2A052FC848EBF82D0FB0B950A4 /* ResourceBundle-UIDevice-Utils-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "ResourceBundle-UIDevice-Utils-Info.plist"; sourceTree = ""; }; + 852ED4B265FE033613AC722C1062C301 /* SPTCompiledExample.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SPTCompiledExample.h; path = Specta/Specta/SPTCompiledExample.h; sourceTree = ""; }; + 8A0F89C4069234AA0DE6F90476FE7FC6 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8AB065F9E7871AB78576CEC23B72D0AD /* EXPDefines.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = EXPDefines.h; path = Expecta/EXPDefines.h; sourceTree = ""; }; + 8B463FAC7628AB20088321502DCE1BF4 /* PEARFileManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = PEARFileManager.m; path = "PEAR-FileManager-iOS/PEARFileManager.m"; sourceTree = ""; }; + 8C0D6CF0102398AA5794D260E6CA94B0 /* EXPMatchers+beginWith.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beginWith.m"; path = "Expecta/Matchers/EXPMatchers+beginWith.m"; sourceTree = ""; }; + 8CBF5555FF85E73125C0AEE4ABCE95F5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + 8E6A13BA89A028B6BDBF2E7C01FC96FD /* EXPMatchers+FBSnapshotTest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "EXPMatchers+FBSnapshotTest.h"; sourceTree = ""; }; + 8F1203F6CA5CD18E2ACF4E60085EBCC8 /* FBSnapshotTestCase.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = FBSnapshotTestCase.modulemap; sourceTree = ""; }; + 8F63209A7B3EE3ED016CF8977F775084 /* Specta.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Specta.xcconfig; sourceTree = ""; }; + 90090F537C1E3D5A10D48C164A6F8570 /* AFNetworking.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AFNetworking.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 904082EBDFF32BCD467F6A45BF9EBB63 /* Expecta+Snapshots.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Expecta+Snapshots.xcconfig"; sourceTree = ""; }; + 90604A87BB7538C11C8A79A3023FC482 /* Pods-PNObject_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-PNObject_Example-acknowledgements.markdown"; sourceTree = ""; }; + 91B991DE57581DC2C3B4E6025B38E2B2 /* EXPMatchers+beLessThan.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beLessThan.m"; path = "Expecta/Matchers/EXPMatchers+beLessThan.m"; sourceTree = ""; }; + 92B62A9467BD08CEDCCC1BF8AB515D45 /* UIRefreshControl+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIRefreshControl+AFNetworking.h"; path = "UIKit+AFNetworking/UIRefreshControl+AFNetworking.h"; sourceTree = ""; }; + 92C726C29A6539951DB12B041D1792AE /* EXPMatchers+beLessThan.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beLessThan.h"; path = "Expecta/Matchers/EXPMatchers+beLessThan.h"; sourceTree = ""; }; + 92D7C780DF210F826062C7DA4241628F /* PEARFileManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PEARFileManager.h; path = "PEAR-FileManager-iOS/PEARFileManager.h"; sourceTree = ""; }; + 93027BCB2CB00856CF97BEA85FBE0BCC /* EXPBlockDefinedMatcher.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = EXPBlockDefinedMatcher.m; path = Expecta/EXPBlockDefinedMatcher.m; sourceTree = ""; }; + 93AEF7A08332A013E569FC109270AB45 /* EXPMatcherHelpers.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = EXPMatcherHelpers.m; path = Expecta/Matchers/EXPMatcherHelpers.m; sourceTree = ""; }; + 941FEF92BBC85C24850889688C55A31A /* PNObject.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = PNObject.m; sourceTree = ""; }; + 9563F7F11E1375F4565A5DA733FCE9DA /* AFNetworking.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = AFNetworking.xcconfig; sourceTree = ""; }; + 95D4B9664052A1C4C44C63454B6C1EED /* SPTExample.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SPTExample.h; path = Specta/Specta/SPTExample.h; sourceTree = ""; }; + 95EABF09D36FAE5816ACC4FFDD253A49 /* UIImage+Diff.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+Diff.m"; path = "FBSnapshotTestCase/Categories/UIImage+Diff.m"; sourceTree = ""; }; + 96598024D930A60C681375C1DF09DE6C /* Expecta+Snapshots-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Expecta+Snapshots-dummy.m"; sourceTree = ""; }; + 96F15D3DFF0D00CD1F008FC669E41C86 /* Specta.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Specta.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 972238611238826A2E259BFD28D740D9 /* EXPMatchers+respondTo.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+respondTo.h"; path = "Expecta/Matchers/EXPMatchers+respondTo.h"; sourceTree = ""; }; + 98C6631C8A5AB6830B4C85C4E316A6FD /* AFNetworkActivityIndicatorManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFNetworkActivityIndicatorManager.m; path = "UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m"; sourceTree = ""; }; + 991F3CF7356D606F1EB7B29CD98506D8 /* EXPMatchers+beNil.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beNil.h"; path = "Expecta/Matchers/EXPMatchers+beNil.h"; sourceTree = ""; }; + A067EAE216F588D68000AF117F032E2A /* NSDate_Utils-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NSDate_Utils-prefix.pch"; sourceTree = ""; }; + A07F7B6A7A5C085B18CFA541503FD407 /* EXPMatchers+beInTheRangeOf.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beInTheRangeOf.h"; path = "Expecta/Matchers/EXPMatchers+beInTheRangeOf.h"; sourceTree = ""; }; + A0B2B2D2C961344B4CF652B166E525DB /* SPTTestSuite.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SPTTestSuite.h; path = Specta/Specta/SPTTestSuite.h; sourceTree = ""; }; + A0F8321743E27E471F349C43FFFA019C /* EXPDoubleTuple.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = EXPDoubleTuple.h; path = Expecta/EXPDoubleTuple.h; sourceTree = ""; }; + A4183324B6BABCEE7610BB0F038B1F59 /* Specta.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Specta.h; path = Specta/Specta/Specta.h; sourceTree = ""; }; + A57B5C631B9EB4F5FE82A815FD1205E3 /* EXPMatchers+beFalsy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beFalsy.h"; path = "Expecta/Matchers/EXPMatchers+beFalsy.h"; sourceTree = ""; }; + A632AA14A79DFF2E79B4285BA9976153 /* EXPMatchers+beGreaterThan.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beGreaterThan.m"; path = "Expecta/Matchers/EXPMatchers+beGreaterThan.m"; sourceTree = ""; }; + A7396073D01D42C1A4A64BB83CE09172 /* EXPMatcher.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = EXPMatcher.h; path = Expecta/EXPMatcher.h; sourceTree = ""; }; + A829ACCB34F1EA88C97102126F1E0496 /* UIImage+Diff.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+Diff.h"; path = "FBSnapshotTestCase/Categories/UIImage+Diff.h"; sourceTree = ""; }; + A838922082CBB903238CF0302A9F06FC /* Pods-PNObject_Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-PNObject_Tests-dummy.m"; sourceTree = ""; }; + A98C4E446CB7E44B70B68A03B294D040 /* NSValue+Expecta.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSValue+Expecta.m"; path = "Expecta/NSValue+Expecta.m"; sourceTree = ""; }; + A9C30C86ADD90253F9625EE97E677992 /* EXPExpect.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = EXPExpect.h; path = Expecta/EXPExpect.h; sourceTree = ""; }; + AA18FB23EB66AB9CB3EB7D7D83B4F4BC /* NSDate+NSDate_Util.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSDate+NSDate_Util.m"; path = "Pod/Classes/NSDate+NSDate_Util.m"; sourceTree = ""; }; + AA1CE72928E46C7F70D4BBE1CD90756D /* Pods-PNObject_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-PNObject_Example-umbrella.h"; sourceTree = ""; }; + AA8B73F95EA806BA1F359F5D99822CBF /* EXPMatchers+conformTo.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+conformTo.h"; path = "Expecta/Matchers/EXPMatchers+conformTo.h"; sourceTree = ""; }; + AB96365A5153FA50BDB938207154513D /* FBSnapshotTestCasePlatform.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FBSnapshotTestCasePlatform.m; path = FBSnapshotTestCase/FBSnapshotTestCasePlatform.m; sourceTree = ""; }; + ABC2BD19C88FB68928A4ACDD68A9A724 /* EXPMatchers+beIdenticalTo.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beIdenticalTo.m"; path = "Expecta/Matchers/EXPMatchers+beIdenticalTo.m"; sourceTree = ""; }; + AC21CDE2049E2BAD2A2390F2EC6056A1 /* Pods-PNObject_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-PNObject_Example.modulemap"; sourceTree = ""; }; + AD1FD21D8F457F0E27CFCFB595FCC669 /* SPTExampleGroup.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SPTExampleGroup.m; path = Specta/Specta/SPTExampleGroup.m; sourceTree = ""; }; + ADB01FE4B3DF3EA50915878776A88684 /* EXPMatchers+haveCountOf.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+haveCountOf.h"; path = "Expecta/Matchers/EXPMatchers+haveCountOf.h"; sourceTree = ""; }; + AE3FC0336DCF98CD24220FB3C4AF534C /* EXPMatchers+contain.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+contain.m"; path = "Expecta/Matchers/EXPMatchers+contain.m"; sourceTree = ""; }; + B084A0DAE06CE16B13B08D6D5A550E84 /* UIImageView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+AFNetworking.m"; path = "UIKit+AFNetworking/UIImageView+AFNetworking.m"; sourceTree = ""; }; + B18531DAB0C92B47BC6B34F097747A28 /* SPTGlobalBeforeAfterEach.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SPTGlobalBeforeAfterEach.h; path = Specta/Specta/SPTGlobalBeforeAfterEach.h; sourceTree = ""; }; + B30B8D4EC5724E9404D704E681CF9BE1 /* EXPFloatTuple.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = EXPFloatTuple.m; path = Expecta/EXPFloatTuple.m; sourceTree = ""; }; + B491529366D57763C1863C7BFAEAD597 /* AFAutoPurgingImageCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFAutoPurgingImageCache.m; path = "UIKit+AFNetworking/AFAutoPurgingImageCache.m"; sourceTree = ""; }; + B4D46FA1D8C11A61B0779DCEEE44A0C0 /* EXPMatchers+raiseWithReason.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+raiseWithReason.h"; path = "Expecta/Matchers/EXPMatchers+raiseWithReason.h"; sourceTree = ""; }; + B6B08F884D9E5AAEC4C91E0CEE9E06C5 /* EXPMatchers+postNotification.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+postNotification.h"; path = "Expecta/Matchers/EXPMatchers+postNotification.h"; sourceTree = ""; }; + B8D1FA8C4EE246A36E4E4831C67680F8 /* EXPMatchers+conformTo.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+conformTo.m"; path = "Expecta/Matchers/EXPMatchers+conformTo.m"; sourceTree = ""; }; + B8F890AACB551F53A3EF64D661F0A11D /* Pods-PNObject_Tests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-PNObject_Tests-frameworks.sh"; sourceTree = ""; }; + B9519193AF170D5AF1C9DB2ED31EA12D /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B9693DE8FEDDDE35C28DA30BBE9C5322 /* Expecta-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Expecta-prefix.pch"; sourceTree = ""; }; + BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + BAC103126493FCA9DC307BF91F51572A /* PEAR-FileManager-iOS.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "PEAR-FileManager-iOS.xcconfig"; sourceTree = ""; }; + BB946E78D3AB1817B7BE4FFFAF51BB20 /* EXPExpect.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = EXPExpect.m; path = Expecta/EXPExpect.m; sourceTree = ""; }; + BC1C2A65F78882A083F81AE54885379E /* NSDate+NSDate_Util.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSDate+NSDate_Util.h"; path = "Pod/Classes/NSDate+NSDate_Util.h"; sourceTree = ""; }; + BC5332092A275215EA81B7A180089C08 /* NSDate_Utils-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NSDate_Utils-umbrella.h"; sourceTree = ""; }; + BFA6C1A3B741D0831BA11C4A61B1671A /* ExpectaSupport.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ExpectaSupport.m; path = Expecta/ExpectaSupport.m; sourceTree = ""; }; + C011832F271A444CE38AB546BF893CB7 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + C092C2EA6068564AD00DF872B5C9B5BF /* FBSnapshotTestCase-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FBSnapshotTestCase-prefix.pch"; sourceTree = ""; }; + C2D2620C4D8B7C07CB68366A7BEA9EBA /* Expecta.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Expecta.xcconfig; sourceTree = ""; }; + C4FCEB148D2A9DE0A797FBE6968CAE28 /* ExpectaObject+FBSnapshotTest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "ExpectaObject+FBSnapshotTest.m"; sourceTree = ""; }; + C6602571BB0B2EB97F81DF77649A2D79 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/System/Library/Frameworks/MobileCoreServices.framework; sourceTree = DEVELOPER_DIR; }; + C75BE203FE62CDE9CBC30A1812780F6E /* EXPMatchers+beGreaterThanOrEqualTo.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beGreaterThanOrEqualTo.m"; path = "Expecta/Matchers/EXPMatchers+beGreaterThanOrEqualTo.m"; sourceTree = ""; }; + C75D598FF13B60EB2CD549CB4F31CC05 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; }; + C7D89C09473939D9000E883749E7A017 /* SPTExcludeGlobalBeforeAfterEach.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SPTExcludeGlobalBeforeAfterEach.h; path = Specta/Specta/SPTExcludeGlobalBeforeAfterEach.h; sourceTree = ""; }; + C9A6D00AE10BF3C39CCB9F5BB8DD39AF /* UIButton+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIButton+AFNetworking.m"; path = "UIKit+AFNetworking/UIButton+AFNetworking.m"; sourceTree = ""; }; + C9C90AD238A313B46BF94AE78706DCB4 /* NSDate_Utils.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = NSDate_Utils.xcconfig; sourceTree = ""; }; + C9DC12BFABE07666DD4F120195F6CBA9 /* SPTCallSite.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SPTCallSite.m; path = Specta/Specta/SPTCallSite.m; sourceTree = ""; }; + CB327A2C4264D8D750739600AF58AB3C /* UIDevice_Utils.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = UIDevice_Utils.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + CB3F28C9BC17E4A2F27DCCE9693F61A2 /* UIRefreshControl+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIRefreshControl+AFNetworking.m"; path = "UIKit+AFNetworking/UIRefreshControl+AFNetworking.m"; sourceTree = ""; }; + CC81989EC2F7F38C770FB47B29B1E665 /* Expecta+Snapshots-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Expecta+Snapshots-umbrella.h"; sourceTree = ""; }; + CDE3DA9BC9D60F271CF023406E323EDE /* ExpectaObject+FBSnapshotTest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ExpectaObject+FBSnapshotTest.h"; sourceTree = ""; }; + CDFD3EE185C96AC4743FBBA951370259 /* FBSnapshotTestCase.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FBSnapshotTestCase.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + CE5DB4BC4F106F89C9CD4C9D535CB97C /* EXPMatchers+beInTheRangeOf.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beInTheRangeOf.m"; path = "Expecta/Matchers/EXPMatchers+beInTheRangeOf.m"; sourceTree = ""; }; + CE87B9C36054834C443E9E1F536F71CA /* UIImage+Snapshot.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+Snapshot.m"; path = "FBSnapshotTestCase/Categories/UIImage+Snapshot.m"; sourceTree = ""; }; + D0251859D2194B8DD130203343433439 /* PNObjectProperty.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = PNObjectProperty.h; sourceTree = ""; }; + D0C8EC4D7223E809A20EF5E01C4B7BF9 /* UIButton+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIButton+AFNetworking.h"; path = "UIKit+AFNetworking/UIButton+AFNetworking.h"; sourceTree = ""; }; + D11A9BD0CFE1E520AE71DC4403614790 /* Pods-PNObject_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-PNObject_Example.debug.xcconfig"; sourceTree = ""; }; + D382546D2C84FB1FD054DF511E64DDF0 /* UIImage+Compare.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+Compare.h"; path = "FBSnapshotTestCase/Categories/UIImage+Compare.h"; sourceTree = ""; }; + D6D401801EE142013F616C33730E6C68 /* AFNetworking-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AFNetworking-prefix.pch"; sourceTree = ""; }; + D743AB04E3D7B81D9141A4B8B5EC6A04 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; + D761BAE2437C826AB810C023C228E54E /* PNObject.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = PNObject.modulemap; sourceTree = ""; }; + D787AD02E49323EDF499CEA4B18362E2 /* EXPDoubleTuple.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = EXPDoubleTuple.m; path = Expecta/EXPDoubleTuple.m; sourceTree = ""; }; + DB25C8D56F3BC7AF00EC94819841709D /* UIDevice-Hardware.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIDevice-Hardware.m"; path = "Pod/Classes/UIDevice-Hardware.m"; sourceTree = ""; }; + DC358092608E035811817A25786F40A6 /* Pods-PNObject_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-PNObject_Example.release.xcconfig"; sourceTree = ""; }; + DE532B43526854304B2FF59160AD3587 /* UIKit+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIKit+AFNetworking.h"; path = "UIKit+AFNetworking/UIKit+AFNetworking.h"; sourceTree = ""; }; + DE7319124E858F652E78EEE78BFCD99A /* SPTTestSuite.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SPTTestSuite.m; path = Specta/Specta/SPTTestSuite.m; sourceTree = ""; }; + DFC441DEC0296333CDB9D7926575F8DF /* UIDevice-Utils-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UIDevice-Utils-prefix.pch"; sourceTree = ""; }; + E166162701E3405E15FECEF6994FEF52 /* EXPMatchers+match.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+match.h"; path = "Expecta/Matchers/EXPMatchers+match.h"; sourceTree = ""; }; + E16AE17E2B35A7123F90844256259B9D /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + E1E0780BB830EFAC797B401B279BC515 /* PNObject.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = PNObject.h; sourceTree = ""; }; + E25DD7021E70A195FA82B61C00864AB9 /* EXPMatchers+postNotification.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+postNotification.m"; path = "Expecta/Matchers/EXPMatchers+postNotification.m"; sourceTree = ""; }; + E46B7AFFF2CB3F42C731CF9CFA5DFC85 /* Pods-PNObject_Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-PNObject_Tests-umbrella.h"; sourceTree = ""; }; + E47CDA8C196A62B78FACDBFE34E3F5AD /* Pods-PNObject_Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-PNObject_Example-resources.sh"; sourceTree = ""; }; + E6275022455B7BEF01F79BED352B30CE /* EXPMatchers+beNil.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beNil.m"; path = "Expecta/Matchers/EXPMatchers+beNil.m"; sourceTree = ""; }; + E6F03F79EEA27C574F6ADCB71E692FA5 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + E75DAAFC920067DD87C26508EF097BE4 /* UIProgressView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIProgressView+AFNetworking.m"; path = "UIKit+AFNetworking/UIProgressView+AFNetworking.m"; sourceTree = ""; }; + E81F08D50F678A8D5B0F18FDD8D26E61 /* EXPMatchers+FBSnapshotTest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "EXPMatchers+FBSnapshotTest.m"; sourceTree = ""; }; + EB692859FF4E52214F253B1CDC8E86C8 /* SPTExample.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SPTExample.m; path = Specta/Specta/SPTExample.m; sourceTree = ""; }; + EB8B84E4432E9D6D4914A7EB79C467FA /* Pods-PNObject_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-PNObject_Tests.debug.xcconfig"; sourceTree = ""; }; + ED867712668303BA41A70CB5E1969AC2 /* PNObject-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PNObject-dummy.m"; sourceTree = ""; }; + F18435C7355DA51EDB57E2BC9552B2FC /* Pods-PNObject_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-PNObject_Tests-acknowledgements.markdown"; sourceTree = ""; }; + F462F789E7FB9E0958BDB03D88F0FBE3 /* EXPMatchers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = EXPMatchers.h; path = Expecta/Matchers/EXPMatchers.h; sourceTree = ""; }; + F6475D2AE952D65158911AE59D9D7787 /* NSDate_Utils.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NSDate_Utils.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; + F793F931AACF1EE2763F3169C9C69946 /* PNObject.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PNObject.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F7F9CBFB97FAE3AC05A28EE45CDA2734 /* UIImage+Compare.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+Compare.m"; path = "FBSnapshotTestCase/Categories/UIImage+Compare.m"; sourceTree = ""; }; + F7FE7E898C64DAE5E020AE493772158A /* EXPMatchers+beSubclassOf.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+beSubclassOf.m"; path = "Expecta/Matchers/EXPMatchers+beSubclassOf.m"; sourceTree = ""; }; + F872FBD57D98CFC3DE47AD9A270264B9 /* Pods-PNObject_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-PNObject_Tests.release.xcconfig"; sourceTree = ""; }; + F924BAFD8984753A0E19859F0D994689 /* Pods-PNObject_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-PNObject_Example-frameworks.sh"; sourceTree = ""; }; + F9664ECC37853F2F4C53EA28E02A4B11 /* Expecta.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Expecta.h; path = Expecta/Expecta.h; sourceTree = ""; }; + FA9B970B7B7887AA9701B950AB3E9ED6 /* Expecta.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Expecta.modulemap; sourceTree = ""; }; + FB40504B37813B22D5041650F8E335AA /* EXPMatchers+beCloseTo.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beCloseTo.h"; path = "Expecta/Matchers/EXPMatchers+beCloseTo.h"; sourceTree = ""; }; + FFA9C82F3CA4A7726C38765EA662E470 /* EXPMatchers+respondTo.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+respondTo.m"; path = "Expecta/Matchers/EXPMatchers+respondTo.m"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 076EFF1C26317DB401B532BF933C74DA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0AE200B93FBC97786AE0B7F8B47D9303 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D80CC0197DAA1C570189DCE17DA1AD2 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2FBBC195EC5AF2E370AF885FCB76B312 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 47BE16803392A5BB68905A2F6AE2638B /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D6CB09F12A9C7654A9780AC037A1D63 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8247F34C45EDD7B97CBC3488E090D15D /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 914A3FA7C160948DE0A308FB745E7380 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 5CF7526D330A734F7ABCDCFF3D1A9B35 /* Foundation.framework in Frameworks */, + FCDC9C0B871F82CB1AEE73303F9A2927 /* QuartzCore.framework in Frameworks */, + 5056E0520959CBC31CCB037B59BFC847 /* UIKit.framework in Frameworks */, + FA839F20BC13A260E089D374CAAB584E /* XCTest.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A56E13DAA3C6DDE77A388FB0AD375540 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4EB3EF278446BB04246DCA3A510C4D1C /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C151364F15F39F7CC60CBF9A3AB49B44 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 254A0FE70B70FE015FBD7539ACAE1C2A /* CoreGraphics.framework in Frameworks */, + 9E1723E2FE89DC9BD907271B23B585F2 /* Foundation.framework in Frameworks */, + F65411E9EF00A9BB39D6BD1521A4F3FD /* MobileCoreServices.framework in Frameworks */, + 54AF62ACF67074BA98574325C3093D1F /* Security.framework in Frameworks */, + 299E9DD0F4332D9DB6311B6E60C5832C /* SystemConfiguration.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9D84858B33FBC15355A749B4C1EA875 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AE9692FDC1174DFB1E0F8920C27EEEDC /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CFF5B7915B7C4A2828E27F2C89B1769C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3D48EE131B6577ED73A5CC481A6FE40C /* Expecta.framework in Frameworks */, + 2549CD1370AF63009DEC76693F5E9BD1 /* FBSnapshotTestCase.framework in Frameworks */, + 715A1122272BB3A29A10AAE4C8C03913 /* Foundation.framework in Frameworks */, + D181FA8D3863D4294F5CD912DBEDA7C2 /* XCTest.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DA96E0E0E5819F73D7723C62EBB3C3EB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DF37C2BB2DC1ACB7EFB121F1B9CC97D4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F2BF22CC173E7B04AB4E726675A14A62 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E6B836B352B13C63D3C0FA0E500C98A4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E4EC16570D46F25B3BD2830D65C06AE5 /* Foundation.framework in Frameworks */, + F1867C99D4A92FC191093E4901E463B5 /* XCTest.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E83D493CE1B2D93EDA7574BB1E5DEB29 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FE96ED7903B6CE86B6B21F9F8C12B9D0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 064A5A36853F3744DAE30AB83B951829 /* Foundation.framework in Frameworks */, + 519F89F4A38E9DBE767A99200B52DFBC /* XCTest.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 079E0D3EB3F01EAD3A28EA78B19BE0DF /* Serialization */ = { + isa = PBXGroup; + children = ( + 6A9C98362B8CD1F0E2749529D53DEE66 /* AFURLRequestSerialization.h */, + 0086B599B6C85DF27B4ED96EEBA0F597 /* AFURLRequestSerialization.m */, + 1713E8DF36EE24BDD474593A71C61871 /* AFURLResponseSerialization.h */, + 53812272391D9612B78D0372F2DFA9B4 /* AFURLResponseSerialization.m */, + ); + name = Serialization; + sourceTree = ""; + }; + 168A3B8397ECA5C7750BACB8764D0C36 /* Pods-PNObject_Tests */ = { + isa = PBXGroup; + children = ( + E16AE17E2B35A7123F90844256259B9D /* Info.plist */, + 389952D5D54C67E70501B09516F08587 /* Pods-PNObject_Tests.modulemap */, + F18435C7355DA51EDB57E2BC9552B2FC /* Pods-PNObject_Tests-acknowledgements.markdown */, + 748E0B295CE6475615F29850C6CD4B0A /* Pods-PNObject_Tests-acknowledgements.plist */, + A838922082CBB903238CF0302A9F06FC /* Pods-PNObject_Tests-dummy.m */, + B8F890AACB551F53A3EF64D661F0A11D /* Pods-PNObject_Tests-frameworks.sh */, + 821A5C557963A679894335F2C12F9FC9 /* Pods-PNObject_Tests-resources.sh */, + E46B7AFFF2CB3F42C731CF9CFA5DFC85 /* Pods-PNObject_Tests-umbrella.h */, + EB8B84E4432E9D6D4914A7EB79C467FA /* Pods-PNObject_Tests.debug.xcconfig */, + F872FBD57D98CFC3DE47AD9A270264B9 /* Pods-PNObject_Tests.release.xcconfig */, + ); + name = "Pods-PNObject_Tests"; + path = "Target Support Files/Pods-PNObject_Tests"; + sourceTree = ""; + }; + 18719642523332F7AE8C29EFA0E829A3 /* Support Files */ = { + isa = PBXGroup; + children = ( + 8F1203F6CA5CD18E2ACF4E60085EBCC8 /* FBSnapshotTestCase.modulemap */, + 31EC73DD2649E7FFDFFC27FD45896BD4 /* FBSnapshotTestCase.xcconfig */, + 185504E9BC20A737B0F6C725AFC1921A /* FBSnapshotTestCase-dummy.m */, + C092C2EA6068564AD00DF872B5C9B5BF /* FBSnapshotTestCase-prefix.pch */, + 56CC371A2A26C2206AD6BD10FF6DA775 /* Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/FBSnapshotTestCase"; + sourceTree = ""; + }; + 20554A5E017CC4548F5C314DF4CCEF1F /* Pods */ = { + isa = PBXGroup; + children = ( + 66D1F6496CB25138DFD570FEF41CB944 /* AFNetworking */, + 94F21B8E923A4D731307FC589A974EDB /* Expecta */, + 5AB664DFCDF393C315BFBC182B823DBA /* Expecta+Snapshots */, + 4EAB1AF20D00E0A031370E554A440808 /* FBSnapshotTestCase */, + 456F01B42C18C5D969B3B54E4669F7A6 /* NSDate_Utils */, + 7123EAAA0E58DA2900B3B7FF89E5EB94 /* PEAR-FileManager-iOS */, + 21194C0CED8534A3A47EEC7BC6A6D8D4 /* Specta */, + 6963333AA224B56F4EA948D1389FFA46 /* UIDevice-Utils */, + ); + name = Pods; + sourceTree = ""; + }; + 21194C0CED8534A3A47EEC7BC6A6D8D4 /* Specta */ = { + isa = PBXGroup; + children = ( + A4183324B6BABCEE7610BB0F038B1F59 /* Specta.h */, + 35585DFFA728C4C5A14AA183EC036013 /* SpectaDSL.h */, + 6D1A759D33F173D10E0B7015AE80CF23 /* SpectaDSL.m */, + 69C520A4C76B14DB186E153AEE415291 /* SpectaTypes.h */, + 0E49D273A400D01F7C968DEDB310739A /* SpectaUtility.h */, + 4518F84A8AE33249879AD096501ACF2C /* SpectaUtility.m */, + 29DF17D4BD0DFBF04363B12DF5D708DE /* SPTCallSite.h */, + C9DC12BFABE07666DD4F120195F6CBA9 /* SPTCallSite.m */, + 852ED4B265FE033613AC722C1062C301 /* SPTCompiledExample.h */, + 5F8244AC7C380BAC0FF7995A0DD0985C /* SPTCompiledExample.m */, + 95D4B9664052A1C4C44C63454B6C1EED /* SPTExample.h */, + EB692859FF4E52214F253B1CDC8E86C8 /* SPTExample.m */, + 5D5200015B01A00B8EE614CEC1A72DBA /* SPTExampleGroup.h */, + AD1FD21D8F457F0E27CFCFB595FCC669 /* SPTExampleGroup.m */, + C7D89C09473939D9000E883749E7A017 /* SPTExcludeGlobalBeforeAfterEach.h */, + B18531DAB0C92B47BC6B34F097747A28 /* SPTGlobalBeforeAfterEach.h */, + 4EB3A39CD648527BE16B141FD58D5A58 /* SPTSharedExampleGroups.h */, + 4B07E3A6961EE0F0821BEDD4EFDBC3E6 /* SPTSharedExampleGroups.m */, + 16381C8F5ADB6A8C9F60144F32E457D0 /* SPTSpec.h */, + 64F490A38FEF85969F7D32CF7DAD9297 /* SPTSpec.m */, + A0B2B2D2C961344B4CF652B166E525DB /* SPTTestSuite.h */, + DE7319124E858F652E78EEE78BFCD99A /* SPTTestSuite.m */, + 3815F645AAADCAF88CC9740D8FED47C6 /* XCTest+Private.h */, + 02C1CCA906DB8F2DEDF2F199F2262598 /* XCTestCase+Specta.h */, + 7D235B3CA6493F5DFD4DF8399F3F6E52 /* XCTestCase+Specta.m */, + B990EED8DB09C8013B67BA54CF0A5A1B /* Support Files */, + ); + path = Specta; + sourceTree = ""; + }; + 3042BB3E5ED447873FD23E281C87EA86 /* Support Files */ = { + isa = PBXGroup; + children = ( + 228EBF0A7945E0E7F50209AAF9F47A2B /* Info.plist */, + 71227C8B97BF0A085C371A91B264B57F /* NSDate_Utils.modulemap */, + C9C90AD238A313B46BF94AE78706DCB4 /* NSDate_Utils.xcconfig */, + 2692A0A67F111639E3EAA40D5DE1889F /* NSDate_Utils-dummy.m */, + A067EAE216F588D68000AF117F032E2A /* NSDate_Utils-prefix.pch */, + BC5332092A275215EA81B7A180089C08 /* NSDate_Utils-umbrella.h */, + 4549BF253506807AEDF1B6ADDC55B169 /* ResourceBundle-NSDate_Utils-Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/NSDate_Utils"; + sourceTree = ""; + }; + 30888CCAE6C09BBE3DB2932177E9D896 /* PNObject */ = { + isa = PBXGroup; + children = ( + B0D5DD18FBE5B96807E4D87978121CFB /* Pod */, + 425607755C726CECF42269E67F188E46 /* Support Files */, + ); + name = PNObject; + path = ../..; + sourceTree = ""; + }; + 3652C2E38DF53C768F329F262835036F /* Core */ = { + isa = PBXGroup; + children = ( + 08D27CF8BF643F6B5B13F8232258D5B8 /* FBSnapshotTestCase.h */, + 0A32AF4D883390B0F2AF7CB064D6E567 /* FBSnapshotTestCase.m */, + 6456DEF4D3F54D788069D69C45928CBC /* FBSnapshotTestCasePlatform.h */, + AB96365A5153FA50BDB938207154513D /* FBSnapshotTestCasePlatform.m */, + 009062739020CCD0E6297F2C8D4CFB93 /* FBSnapshotTestController.h */, + 723A847962247DDB3BC419C8B19D36C9 /* FBSnapshotTestController.m */, + D382546D2C84FB1FD054DF511E64DDF0 /* UIImage+Compare.h */, + F7F9CBFB97FAE3AC05A28EE45CDA2734 /* UIImage+Compare.m */, + A829ACCB34F1EA88C97102126F1E0496 /* UIImage+Diff.h */, + 95EABF09D36FAE5816ACC4FFDD253A49 /* UIImage+Diff.m */, + 54293BEDFCD9CE82F2C279AD4B41D67A /* UIImage+Snapshot.h */, + CE87B9C36054834C443E9E1F536F71CA /* UIImage+Snapshot.m */, + ); + name = Core; + sourceTree = ""; + }; + 375DF2F955219DBF90E2B08794AFC957 /* Reachability */ = { + isa = PBXGroup; + children = ( + 6D147D9B92257C3B94B576C35DC424BF /* AFNetworkReachabilityManager.h */, + 01C0656AD6CD15FA1E1CD0B12E72DBAC /* AFNetworkReachabilityManager.m */, + ); + name = Reachability; + sourceTree = ""; + }; + 425607755C726CECF42269E67F188E46 /* Support Files */ = { + isa = PBXGroup; + children = ( + 2CEB36A633CECB76D6838E2E9C892579 /* Info.plist */, + D761BAE2437C826AB810C023C228E54E /* PNObject.modulemap */, + 218AF1ECF876B28B484AD438E085D491 /* PNObject.xcconfig */, + ED867712668303BA41A70CB5E1969AC2 /* PNObject-dummy.m */, + 836B3E38F7F7AF752C3A2569E3B463FC /* PNObject-prefix.pch */, + 4D21BA597DC54DA5B79874658C865E54 /* PNObject-umbrella.h */, + 7A09A844498D0BE9ECEF19919560448F /* ResourceBundle-PNObject-Info.plist */, + ); + name = "Support Files"; + path = "Example/Pods/Target Support Files/PNObject"; + sourceTree = ""; + }; + 456F01B42C18C5D969B3B54E4669F7A6 /* NSDate_Utils */ = { + isa = PBXGroup; + children = ( + BC1C2A65F78882A083F81AE54885379E /* NSDate+NSDate_Util.h */, + AA18FB23EB66AB9CB3EB7D7D83B4F4BC /* NSDate+NSDate_Util.m */, + 3042BB3E5ED447873FD23E281C87EA86 /* Support Files */, + ); + path = NSDate_Utils; + sourceTree = ""; + }; + 4B0255A501671A8FA9CBC245A676888B /* Support Files */ = { + isa = PBXGroup; + children = ( + FA9B970B7B7887AA9701B950AB3E9ED6 /* Expecta.modulemap */, + C2D2620C4D8B7C07CB68366A7BEA9EBA /* Expecta.xcconfig */, + 231DEFBB5E4E226771797D517A35EE2B /* Expecta-dummy.m */, + B9693DE8FEDDDE35C28DA30BBE9C5322 /* Expecta-prefix.pch */, + 70AF5C61DBBAA303456ABD23D9DEF8D2 /* Expecta-umbrella.h */, + 61BDFBB0CBB83F681A933201CF0FE1C7 /* Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/Expecta"; + sourceTree = ""; + }; + 4EAB1AF20D00E0A031370E554A440808 /* FBSnapshotTestCase */ = { + isa = PBXGroup; + children = ( + 3652C2E38DF53C768F329F262835036F /* Core */, + 18719642523332F7AE8C29EFA0E829A3 /* Support Files */, + AF83980345FD63E8B499A0B295578A85 /* SwiftSupport */, + ); + path = FBSnapshotTestCase; + sourceTree = ""; + }; + 4FAD321FAD29AE38A48D07DE7B69B09F /* Frameworks */ = { + isa = PBXGroup; + children = ( + 58AD3556F41D0C4F8075D98B78B2821C /* Expecta.framework */, + CDFD3EE185C96AC4743FBBA951370259 /* FBSnapshotTestCase.framework */, + 7956A67129470E5A5E2BB83D1CBCE7AC /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + 56BD78A69573139280921FE89BE0B864 /* Products */ = { + isa = PBXGroup; + children = ( + 90090F537C1E3D5A10D48C164A6F8570 /* AFNetworking.framework */, + 684260D2513FE8AD036B49C00B805318 /* Expecta.framework */, + 6387377EE062A0FDF751AA136AC2D137 /* Expecta_Snapshots.framework */, + 806E3AAC0A4A15EF79D3BCD7811DB696 /* FBSnapshotTestCase.framework */, + F6475D2AE952D65158911AE59D9D7787 /* NSDate_Utils.bundle */, + 6BCF0B57CC5FE7DB7261CE7C60EAE6C1 /* NSDate_Utils.framework */, + 27053B717A2E6C890A9A5567BE892759 /* PEAR_FileManager_iOS.framework */, + 50F53D1643B9ED1F04EAF728153AEDAA /* PNObject.bundle */, + F793F931AACF1EE2763F3169C9C69946 /* PNObject.framework */, + 1E9631FC8095895820932DC31657A035 /* Pods_PNObject_Example.framework */, + 824C131E1882E849655990203D7BA94B /* Pods_PNObject_Tests.framework */, + 96F15D3DFF0D00CD1F008FC669E41C86 /* Specta.framework */, + 5B5C169A7A6F9F35D18EB5691C3CAD4C /* UIDevice-Utils.bundle */, + CB327A2C4264D8D750739600AF58AB3C /* UIDevice_Utils.framework */, + ); + name = Products; + sourceTree = ""; + }; + 5AB664DFCDF393C315BFBC182B823DBA /* Expecta+Snapshots */ = { + isa = PBXGroup; + children = ( + CDE3DA9BC9D60F271CF023406E323EDE /* ExpectaObject+FBSnapshotTest.h */, + C4FCEB148D2A9DE0A797FBE6968CAE28 /* ExpectaObject+FBSnapshotTest.m */, + 8E6A13BA89A028B6BDBF2E7C01FC96FD /* EXPMatchers+FBSnapshotTest.h */, + E81F08D50F678A8D5B0F18FDD8D26E61 /* EXPMatchers+FBSnapshotTest.m */, + F215FF93B2088443B513F00088D26859 /* Support Files */, + ); + path = "Expecta+Snapshots"; + sourceTree = ""; + }; + 66D1F6496CB25138DFD570FEF41CB944 /* AFNetworking */ = { + isa = PBXGroup; + children = ( + 82AB26C80BBEABC97E60E162BDB7B620 /* AFNetworking.h */, + D4758ED040973938B15F4AD2DB314779 /* NSURLSession */, + 375DF2F955219DBF90E2B08794AFC957 /* Reachability */, + D3183DF76048A03CABE45DC1E97AECE1 /* Security */, + 079E0D3EB3F01EAD3A28EA78B19BE0DF /* Serialization */, + 8CCD3CC274053F06E1347EDDCB5CCA09 /* Support Files */, + F78734C81AF2417E6112BEDA5F4F4622 /* UIKit */, + ); + path = AFNetworking; + sourceTree = ""; + }; + 6963333AA224B56F4EA948D1389FFA46 /* UIDevice-Utils */ = { + isa = PBXGroup; + children = ( + 11F40498197518D0054C94BB580B6354 /* UIDevice-Hardware.h */, + DB25C8D56F3BC7AF00EC94819841709D /* UIDevice-Hardware.m */, + F3054C0E2858E52A9DEFD1D6008A3BEE /* Support Files */, + ); + path = "UIDevice-Utils"; + sourceTree = ""; + }; + 7123EAAA0E58DA2900B3B7FF89E5EB94 /* PEAR-FileManager-iOS */ = { + isa = PBXGroup; + children = ( + 92D7C780DF210F826062C7DA4241628F /* PEARFileManager.h */, + 8B463FAC7628AB20088321502DCE1BF4 /* PEARFileManager.m */, + DC2443EBF960D2AAA7976234A42E651F /* Support Files */, + ); + path = "PEAR-FileManager-iOS"; + sourceTree = ""; + }; + 7956A67129470E5A5E2BB83D1CBCE7AC /* iOS */ = { + isa = PBXGroup; + children = ( + C75D598FF13B60EB2CD549CB4F31CC05 /* CoreGraphics.framework */, + C011832F271A444CE38AB546BF893CB7 /* Foundation.framework */, + C6602571BB0B2EB97F81DF77649A2D79 /* MobileCoreServices.framework */, + 737516B7AC7E0AE5ADC04B99A65FAB2B /* QuartzCore.framework */, + D743AB04E3D7B81D9141A4B8B5EC6A04 /* Security.framework */, + 74C92BBA05370961FE712919F3B45BC1 /* SystemConfiguration.framework */, + 8CBF5555FF85E73125C0AEE4ABCE95F5 /* UIKit.framework */, + 83308845452F95A0C8ED000AA75BBF1D /* XCTest.framework */, + ); + name = iOS; + sourceTree = ""; + }; + 7B2C40B467EE55C5CB63A978531E7289 /* Pods-PNObject_Example */ = { + isa = PBXGroup; + children = ( + 2701DCB1C4CA2591F34532CBFE0BC596 /* Info.plist */, + AC21CDE2049E2BAD2A2390F2EC6056A1 /* Pods-PNObject_Example.modulemap */, + 90604A87BB7538C11C8A79A3023FC482 /* Pods-PNObject_Example-acknowledgements.markdown */, + 5041E2A91C7A8740358698C67EC25A89 /* Pods-PNObject_Example-acknowledgements.plist */, + 60B530196848B62AA6D54AEEB46A06D8 /* Pods-PNObject_Example-dummy.m */, + F924BAFD8984753A0E19859F0D994689 /* Pods-PNObject_Example-frameworks.sh */, + E47CDA8C196A62B78FACDBFE34E3F5AD /* Pods-PNObject_Example-resources.sh */, + AA1CE72928E46C7F70D4BBE1CD90756D /* Pods-PNObject_Example-umbrella.h */, + D11A9BD0CFE1E520AE71DC4403614790 /* Pods-PNObject_Example.debug.xcconfig */, + DC358092608E035811817A25786F40A6 /* Pods-PNObject_Example.release.xcconfig */, + ); + name = "Pods-PNObject_Example"; + path = "Target Support Files/Pods-PNObject_Example"; + sourceTree = ""; + }; + 7DB346D0F39D3F0E887471402A8071AB = { + isa = PBXGroup; + children = ( + BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */, + E99CD5B3CF7131277C4CBA3A1162D56A /* Development Pods */, + 4FAD321FAD29AE38A48D07DE7B69B09F /* Frameworks */, + 20554A5E017CC4548F5C314DF4CCEF1F /* Pods */, + 56BD78A69573139280921FE89BE0B864 /* Products */, + CA2A6C0A1068E1DAEA2579E47E971F66 /* Targets Support Files */, + ); + sourceTree = ""; + }; + 8CCD3CC274053F06E1347EDDCB5CCA09 /* Support Files */ = { + isa = PBXGroup; + children = ( + 573BE10C3E06A0BD955F3C0EB3745CEB /* AFNetworking.modulemap */, + 9563F7F11E1375F4565A5DA733FCE9DA /* AFNetworking.xcconfig */, + 5EFB4F4A6EBF9B58B69E3E3F5FFAF41D /* AFNetworking-dummy.m */, + D6D401801EE142013F616C33730E6C68 /* AFNetworking-prefix.pch */, + 20B68B3A3F5D9BB99DDD14EC6B840405 /* AFNetworking-umbrella.h */, + 8A0F89C4069234AA0DE6F90476FE7FC6 /* Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/AFNetworking"; + sourceTree = ""; + }; + 94F21B8E923A4D731307FC589A974EDB /* Expecta */ = { + isa = PBXGroup; + children = ( + 4D901B838EEC5C1F057C3B0E9D2EAF1E /* EXPBlockDefinedMatcher.h */, + 93027BCB2CB00856CF97BEA85FBE0BCC /* EXPBlockDefinedMatcher.m */, + 8AB065F9E7871AB78576CEC23B72D0AD /* EXPDefines.h */, + A0F8321743E27E471F349C43FFFA019C /* EXPDoubleTuple.h */, + D787AD02E49323EDF499CEA4B18362E2 /* EXPDoubleTuple.m */, + F9664ECC37853F2F4C53EA28E02A4B11 /* Expecta.h */, + 00CE164DFFFD1548EEA5BC737EFB2E4F /* ExpectaObject.h */, + 00B0B399D3C61A4F51723CDBFFD2DB8A /* ExpectaObject.m */, + 58A2BEF45B88FB715BB96E49CBCF87AF /* ExpectaSupport.h */, + BFA6C1A3B741D0831BA11C4A61B1671A /* ExpectaSupport.m */, + A9C30C86ADD90253F9625EE97E677992 /* EXPExpect.h */, + BB946E78D3AB1817B7BE4FFFAF51BB20 /* EXPExpect.m */, + 61F3C1DB6F4E00473063EACFC5515CC3 /* EXPFloatTuple.h */, + B30B8D4EC5724E9404D704E681CF9BE1 /* EXPFloatTuple.m */, + A7396073D01D42C1A4A64BB83CE09172 /* EXPMatcher.h */, + 2AAA9A2FF692B4E11F127ABBA5AA8270 /* EXPMatcherHelpers.h */, + 93AEF7A08332A013E569FC109270AB45 /* EXPMatcherHelpers.m */, + F462F789E7FB9E0958BDB03D88F0FBE3 /* EXPMatchers.h */, + FB40504B37813B22D5041650F8E335AA /* EXPMatchers+beCloseTo.h */, + 72EB7E5F5CDA29AB6F0E4BC25DE5F867 /* EXPMatchers+beCloseTo.m */, + A57B5C631B9EB4F5FE82A815FD1205E3 /* EXPMatchers+beFalsy.h */, + 27E5C65560784FEE47CF5B6B7C469CCD /* EXPMatchers+beFalsy.m */, + 7D750B75B3C40BCBE799D93256132FF6 /* EXPMatchers+beginWith.h */, + 8C0D6CF0102398AA5794D260E6CA94B0 /* EXPMatchers+beginWith.m */, + 792CFC9325C0ACB6EB08A01A6BD38F48 /* EXPMatchers+beGreaterThan.h */, + A632AA14A79DFF2E79B4285BA9976153 /* EXPMatchers+beGreaterThan.m */, + 6D8BBFAC4FCF0406684B4912DEFF0BA5 /* EXPMatchers+beGreaterThanOrEqualTo.h */, + C75BE203FE62CDE9CBC30A1812780F6E /* EXPMatchers+beGreaterThanOrEqualTo.m */, + 83EF389320BC8B3BF6D71B078974AC6E /* EXPMatchers+beIdenticalTo.h */, + ABC2BD19C88FB68928A4ACDD68A9A724 /* EXPMatchers+beIdenticalTo.m */, + 077055C691E79C85089B2CBB50EFF72D /* EXPMatchers+beInstanceOf.h */, + 0BD3279B3B9EBDFF6097082F89B34E7F /* EXPMatchers+beInstanceOf.m */, + A07F7B6A7A5C085B18CFA541503FD407 /* EXPMatchers+beInTheRangeOf.h */, + CE5DB4BC4F106F89C9CD4C9D535CB97C /* EXPMatchers+beInTheRangeOf.m */, + 6188FAB496F61A82CC5B25315035E54D /* EXPMatchers+beKindOf.h */, + 64ABF623C50C215070FC44795D797682 /* EXPMatchers+beKindOf.m */, + 92C726C29A6539951DB12B041D1792AE /* EXPMatchers+beLessThan.h */, + 91B991DE57581DC2C3B4E6025B38E2B2 /* EXPMatchers+beLessThan.m */, + 1CEF6C8224D8B72BE896822887E9FEC7 /* EXPMatchers+beLessThanOrEqualTo.h */, + 1904F5E4534B5BBEC9867AFBB51ED621 /* EXPMatchers+beLessThanOrEqualTo.m */, + 991F3CF7356D606F1EB7B29CD98506D8 /* EXPMatchers+beNil.h */, + E6275022455B7BEF01F79BED352B30CE /* EXPMatchers+beNil.m */, + 11B8D7A38CA91B88D21DC30CF361022E /* EXPMatchers+beSubclassOf.h */, + F7FE7E898C64DAE5E020AE493772158A /* EXPMatchers+beSubclassOf.m */, + 1C07FC3585B90CDC7B4253F3CDD27B9F /* EXPMatchers+beSupersetOf.h */, + 53079E33AC4EFBBE446B58B5C9AD7B3A /* EXPMatchers+beSupersetOf.m */, + 33C3E715C562A5C56F2E392BE1ED75A5 /* EXPMatchers+beTruthy.h */, + 399B462AA47CD6AB8297E3B09AEB18F0 /* EXPMatchers+beTruthy.m */, + AA8B73F95EA806BA1F359F5D99822CBF /* EXPMatchers+conformTo.h */, + B8D1FA8C4EE246A36E4E4831C67680F8 /* EXPMatchers+conformTo.m */, + 6E6E877D18DB0AC4191855EC8CB90CBC /* EXPMatchers+contain.h */, + AE3FC0336DCF98CD24220FB3C4AF534C /* EXPMatchers+contain.m */, + 60972F56E13BC9E547CFBF5F290DD89E /* EXPMatchers+endWith.h */, + 5FCE0EEEA51957BFB0C9A1B31785C6DA /* EXPMatchers+endWith.m */, + 039DE5E921EE2C83F0DB098D9C48758F /* EXPMatchers+equal.h */, + 620776E83BE8FBF047E6CB8725265419 /* EXPMatchers+equal.m */, + ADB01FE4B3DF3EA50915878776A88684 /* EXPMatchers+haveCountOf.h */, + 731E63E14623364DFA2CE5F112B445FB /* EXPMatchers+haveCountOf.m */, + E166162701E3405E15FECEF6994FEF52 /* EXPMatchers+match.h */, + 4DDC1EDF29C314462DBE55FFD34C51EF /* EXPMatchers+match.m */, + B6B08F884D9E5AAEC4C91E0CEE9E06C5 /* EXPMatchers+postNotification.h */, + E25DD7021E70A195FA82B61C00864AB9 /* EXPMatchers+postNotification.m */, + 729C007887FD208D20BA5C7463209CB1 /* EXPMatchers+raise.h */, + 6D4263FB8214129B7A47ABE38111805A /* EXPMatchers+raise.m */, + B4D46FA1D8C11A61B0779DCEEE44A0C0 /* EXPMatchers+raiseWithReason.h */, + 264F3B713EF22CA791B9485BEFA42727 /* EXPMatchers+raiseWithReason.m */, + 972238611238826A2E259BFD28D740D9 /* EXPMatchers+respondTo.h */, + FFA9C82F3CA4A7726C38765EA662E470 /* EXPMatchers+respondTo.m */, + 680CFD1FCDFA6B058464345597F0BBF0 /* EXPUnsupportedObject.h */, + 1F1BB2ADA82E22F3F0913AC850D335C0 /* EXPUnsupportedObject.m */, + 5F5B8ECC50DE0A0648459CB8E03120C0 /* NSObject+Expecta.h */, + 0667FC521633B245D5797472CBAE44A6 /* NSValue+Expecta.h */, + A98C4E446CB7E44B70B68A03B294D040 /* NSValue+Expecta.m */, + 4B0255A501671A8FA9CBC245A676888B /* Support Files */, + ); + path = Expecta; + sourceTree = ""; + }; + AE64835AD928C05A0E07671000DB2081 /* Classes */ = { + isa = PBXGroup; + children = ( + E1E0780BB830EFAC797B401B279BC515 /* PNObject.h */, + 941FEF92BBC85C24850889688C55A31A /* PNObject.m */, + D0251859D2194B8DD130203343433439 /* PNObjectProperty.h */, + 570E079E6A901F2AD57E8F3241BCE8C3 /* PNObjectProperty.m */, + ); + path = Classes; + sourceTree = ""; + }; + AF83980345FD63E8B499A0B295578A85 /* SwiftSupport */ = { + isa = PBXGroup; + children = ( + 70B374F2107437CA956DF24E5E19499A /* SwiftSupport.swift */, + ); + name = SwiftSupport; + sourceTree = ""; + }; + B0D5DD18FBE5B96807E4D87978121CFB /* Pod */ = { + isa = PBXGroup; + children = ( + AE64835AD928C05A0E07671000DB2081 /* Classes */, + ); + path = Pod; + sourceTree = ""; + }; + B990EED8DB09C8013B67BA54CF0A5A1B /* Support Files */ = { + isa = PBXGroup; + children = ( + B9519193AF170D5AF1C9DB2ED31EA12D /* Info.plist */, + 534BF2171D335392C5C6F17F1B4BF69D /* Specta.modulemap */, + 8F63209A7B3EE3ED016CF8977F775084 /* Specta.xcconfig */, + 3C332041D67D213B77C9019B97A07B72 /* Specta-dummy.m */, + 6E8CE9158C2B090D4648C7F04DA1889C /* Specta-prefix.pch */, + 7FE77851AA58DDB7CD067DDA327931D1 /* Specta-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/Specta"; + sourceTree = ""; + }; + CA2A6C0A1068E1DAEA2579E47E971F66 /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + 7B2C40B467EE55C5CB63A978531E7289 /* Pods-PNObject_Example */, + 168A3B8397ECA5C7750BACB8764D0C36 /* Pods-PNObject_Tests */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + D3183DF76048A03CABE45DC1E97AECE1 /* Security */ = { + isa = PBXGroup; + children = ( + 5CCB15DE181920D49ED519522A12BC5B /* AFSecurityPolicy.h */, + 2EE729CB108F93E49233153B2022FF79 /* AFSecurityPolicy.m */, + ); + name = Security; + sourceTree = ""; + }; + D4758ED040973938B15F4AD2DB314779 /* NSURLSession */ = { + isa = PBXGroup; + children = ( + 0CADBBB423380FDCA673761B70A0FAFD /* AFHTTPSessionManager.h */, + 4F4D1EA21341FF1B04C50B1C5453758C /* AFHTTPSessionManager.m */, + 7264E73C67D22139208F59592E9961DD /* AFURLSessionManager.h */, + 472BFFF9F27894940F02DF7071AB20E6 /* AFURLSessionManager.m */, + ); + name = NSURLSession; + sourceTree = ""; + }; + DC2443EBF960D2AAA7976234A42E651F /* Support Files */ = { + isa = PBXGroup; + children = ( + E6F03F79EEA27C574F6ADCB71E692FA5 /* Info.plist */, + 499413218E4F25EEFA02E1896294EED3 /* PEAR-FileManager-iOS.modulemap */, + BAC103126493FCA9DC307BF91F51572A /* PEAR-FileManager-iOS.xcconfig */, + 31A98D7DB13DDB1AF3280F169F14BC6C /* PEAR-FileManager-iOS-dummy.m */, + 26DB3DA19A34FAC2082C658C5199DEC8 /* PEAR-FileManager-iOS-prefix.pch */, + 116C444E4E0B2289993841A669D8F371 /* PEAR-FileManager-iOS-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/PEAR-FileManager-iOS"; + sourceTree = ""; + }; + E99CD5B3CF7131277C4CBA3A1162D56A /* Development Pods */ = { + isa = PBXGroup; + children = ( + 30888CCAE6C09BBE3DB2932177E9D896 /* PNObject */, + ); + name = "Development Pods"; + sourceTree = ""; + }; + F215FF93B2088443B513F00088D26859 /* Support Files */ = { + isa = PBXGroup; + children = ( + 5AC70376CF4B8810FD6F1D7416760F34 /* Expecta+Snapshots.modulemap */, + 904082EBDFF32BCD467F6A45BF9EBB63 /* Expecta+Snapshots.xcconfig */, + 96598024D930A60C681375C1DF09DE6C /* Expecta+Snapshots-dummy.m */, + 49C7A7BE9DAD1731154BC8C233529B63 /* Expecta+Snapshots-prefix.pch */, + CC81989EC2F7F38C770FB47B29B1E665 /* Expecta+Snapshots-umbrella.h */, + 700C6F8D29A77D7A3DBBB33423557925 /* Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/Expecta+Snapshots"; + sourceTree = ""; + }; + F3054C0E2858E52A9DEFD1D6008A3BEE /* Support Files */ = { + isa = PBXGroup; + children = ( + 845300C5E6C0EB3B1FFE992EE5D4D5B8 /* Info.plist */, + 85236F2A052FC848EBF82D0FB0B950A4 /* ResourceBundle-UIDevice-Utils-Info.plist */, + 767D0A7A31EF6EBC0781569FEC410B20 /* UIDevice-Utils.modulemap */, + 4CA3F01C6FCD8C40E554418F47CB254D /* UIDevice-Utils.xcconfig */, + 0B22ACC9B3ADC87EE7F92E8760D777A4 /* UIDevice-Utils-dummy.m */, + DFC441DEC0296333CDB9D7926575F8DF /* UIDevice-Utils-prefix.pch */, + 0119C90B122B618D30B242F76C7D3A79 /* UIDevice-Utils-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/UIDevice-Utils"; + sourceTree = ""; + }; + F78734C81AF2417E6112BEDA5F4F4622 /* UIKit */ = { + isa = PBXGroup; + children = ( + 03AEAD3C2B6F38C1A68385FBEC16507E /* AFAutoPurgingImageCache.h */, + B491529366D57763C1863C7BFAEAD597 /* AFAutoPurgingImageCache.m */, + 57AC1497F372BCC2F1675EFD329028EE /* AFImageDownloader.h */, + 369EF4C1F5BDF496FA846C56A6E4870A /* AFImageDownloader.m */, + 797359E997295E3851B8A92E12EC7DAE /* AFNetworkActivityIndicatorManager.h */, + 98C6631C8A5AB6830B4C85C4E316A6FD /* AFNetworkActivityIndicatorManager.m */, + 2480119A8B86BA567BE7777F466E6E27 /* UIActivityIndicatorView+AFNetworking.h */, + 00CF9AD323F4143FCE6694EBA30BEB6D /* UIActivityIndicatorView+AFNetworking.m */, + D0C8EC4D7223E809A20EF5E01C4B7BF9 /* UIButton+AFNetworking.h */, + C9A6D00AE10BF3C39CCB9F5BB8DD39AF /* UIButton+AFNetworking.m */, + 7968D24D26E093F665513DEBD3A5E14E /* UIImage+AFNetworking.h */, + 5115E74D3D1BEE398F4A023E24121BD9 /* UIImageView+AFNetworking.h */, + B084A0DAE06CE16B13B08D6D5A550E84 /* UIImageView+AFNetworking.m */, + DE532B43526854304B2FF59160AD3587 /* UIKit+AFNetworking.h */, + 5CB1274205C7A040F2B11C88E1B54172 /* UIProgressView+AFNetworking.h */, + E75DAAFC920067DD87C26508EF097BE4 /* UIProgressView+AFNetworking.m */, + 92B62A9467BD08CEDCCC1BF8AB515D45 /* UIRefreshControl+AFNetworking.h */, + CB3F28C9BC17E4A2F27DCCE9693F61A2 /* UIRefreshControl+AFNetworking.m */, + 5F58AD51CDC214F86073965CEF4DB89C /* UIWebView+AFNetworking.h */, + 312B6D8F8E4F8197145BC05D4EFF798D /* UIWebView+AFNetworking.m */, + ); + name = UIKit; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 0C7D6B9DBA9F53F30F4F525BE25A1789 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 39A998387A26E4C74355B2D4DB470BE3 /* UIDevice-Hardware.h in Headers */, + 6184ABDA3CAD8105CBAF2199B838191F /* UIDevice-Utils-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 192E87C792D1EA23277FF97C60726FC5 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + AAB359E74D72E65F659D324BB3BF53DD /* Specta-umbrella.h in Headers */, + D954A37F9C0000D4D973F95402B5BE35 /* Specta.h in Headers */, + EFA65E728C5137E08D45ABD91C37AA27 /* SpectaDSL.h in Headers */, + 9C4A76E7CF86418FB84B6C340C7E1FA0 /* SpectaTypes.h in Headers */, + 6B8F67BF9EF9C0D399893E9C92482D49 /* SpectaUtility.h in Headers */, + 9B44D7028D962637E9AFEADFCA36A335 /* SPTCallSite.h in Headers */, + 0602A61C6A56334AD7D7AF0EC23E8B19 /* SPTCompiledExample.h in Headers */, + A4E805FD5751CA4114B8F78B2E1DE506 /* SPTExample.h in Headers */, + 8DB501F22B9C2B05A98240F3300D5CBD /* SPTExampleGroup.h in Headers */, + A1B57D94E314EBB5B14A52B19D093DF4 /* SPTExcludeGlobalBeforeAfterEach.h in Headers */, + B8001DED7F2BCC10485DD736B2D7B2CA /* SPTGlobalBeforeAfterEach.h in Headers */, + 7CE07ED7493F98167CDC4F577191B826 /* SPTSharedExampleGroups.h in Headers */, + 889307E521A732E7CFC5FD480350CA0E /* SPTSpec.h in Headers */, + 17AC9529FFE28D4FA7DCF4B60F398B7E /* SPTTestSuite.h in Headers */, + 1338EA7034EEBE3E938F563AAD1A1908 /* XCTest+Private.h in Headers */, + AD6588767DB99EE8F22AFD7BA4687E62 /* XCTestCase+Specta.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2CCD3AC15356E236F04A34F8C92A312C /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + EC3414CDAA9691CCA70739A44A1E7A9D /* Pods-PNObject_Example-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 48923ED0E34E254D77BA5695C091C159 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + D000E3F9104E3B518D5296061F07BAC6 /* NSDate+NSDate_Util.h in Headers */, + A00EC4B7A1B96BA93FD5F8C6D58E2CF7 /* NSDate_Utils-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7C6A0D99A9CC32A19A92A62F8A941139 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + CAC483EF637FB4A2C2E2FC75BA631B87 /* AFAutoPurgingImageCache.h in Headers */, + AB39AC9746E7575D7449700475E41B0B /* AFHTTPSessionManager.h in Headers */, + 5808B477EFF509D810B5CDCFDC944F80 /* AFImageDownloader.h in Headers */, + 1480F4923DBBF217F60572EEECB4027C /* AFNetworkActivityIndicatorManager.h in Headers */, + EC7CADE416A78A1CD6936018A6695126 /* AFNetworking-umbrella.h in Headers */, + E7988678C81F7CCB95D239375FC6986D /* AFNetworking.h in Headers */, + 68152D921ABF6A423C192C04FDF94F0F /* AFNetworkReachabilityManager.h in Headers */, + C2DD28375E1F0B1D0D1D2E4E607C499F /* AFSecurityPolicy.h in Headers */, + 20EE8030FCF2402DAC7F1C9B9DDAEF79 /* AFURLRequestSerialization.h in Headers */, + 7332F15718920917F544F35CE2C038AA /* AFURLResponseSerialization.h in Headers */, + 560698A4D707DCBCC1C8F98BC9B89B23 /* AFURLSessionManager.h in Headers */, + 1E5B8F12ED7CC40ECDB9B1F755F387E5 /* UIActivityIndicatorView+AFNetworking.h in Headers */, + 81B617F8D26BB10C5726D75E85D21EB7 /* UIButton+AFNetworking.h in Headers */, + 9E1E90DED74B73ECE53C9AD76DE53E2D /* UIImage+AFNetworking.h in Headers */, + 60E3009342BEE96D32C546BE2DB60052 /* UIImageView+AFNetworking.h in Headers */, + 659960F7E28E993E08CCC1E8A383E710 /* UIKit+AFNetworking.h in Headers */, + D9F4E833E37B611B432F6B5D7072DDA2 /* UIProgressView+AFNetworking.h in Headers */, + C6354FEC7728A4C86DAD8092509BA7D4 /* UIRefreshControl+AFNetworking.h in Headers */, + AE2A07407FB50BA249984DC0620E84C0 /* UIWebView+AFNetworking.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8C5203B8750A6E260AA0643BE409CDAA /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 993893E5C3C3D99357DBE588CC659880 /* Pods-PNObject_Tests-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 966427BD32145AD621F074D1691342B8 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 3B5B7495707BF7133B9FB3F834045611 /* EXPBlockDefinedMatcher.h in Headers */, + 5EA7043FE10E75D02F3C3052AF8B8318 /* EXPDefines.h in Headers */, + 2F427490ACABC4408D57CC0592276678 /* EXPDoubleTuple.h in Headers */, + 837B593D7C1D01B4EA400247309D6AB0 /* Expecta-umbrella.h in Headers */, + E1EC4532663CA75DE5BD00CB0A56814D /* Expecta.h in Headers */, + 2E14619153A453BB8DF389FB6EA147BE /* ExpectaObject.h in Headers */, + AFFC8900E52BBEC72059334132F3A8F3 /* ExpectaSupport.h in Headers */, + 67459AD239EF669A365519E06B45DCFE /* EXPExpect.h in Headers */, + 6E1D978790705E137FDE439AA68DD3AA /* EXPFloatTuple.h in Headers */, + 65BC31095CCDFC80CBF6BBA843751F23 /* EXPMatcher.h in Headers */, + 8C8C1B0D83FE6A4352F15154DB16372C /* EXPMatcherHelpers.h in Headers */, + AF1F46668D4591602887998C6E9C10AD /* EXPMatchers+beCloseTo.h in Headers */, + F41209A94070904A00BDF24ACB6336B6 /* EXPMatchers+beFalsy.h in Headers */, + FD2D4497BC41412128C2D87C1BDE7398 /* EXPMatchers+beginWith.h in Headers */, + 6EFC63A5CED45BB39FC79D87F2C47D6B /* EXPMatchers+beGreaterThan.h in Headers */, + 372F7A9CCE59CE86316CF436F832A3FC /* EXPMatchers+beGreaterThanOrEqualTo.h in Headers */, + E0AAF49134A0505DF00E20E7B62087E1 /* EXPMatchers+beIdenticalTo.h in Headers */, + 34B6E9A30603BEBBD87BA535B7D384CA /* EXPMatchers+beInstanceOf.h in Headers */, + 131532787AD40BE1F35DF288D2E6FFD7 /* EXPMatchers+beInTheRangeOf.h in Headers */, + 79558B1F97ABE4AB8942DC18BEBD4B82 /* EXPMatchers+beKindOf.h in Headers */, + 0D16B556212D317A0D4FEB71E102E207 /* EXPMatchers+beLessThan.h in Headers */, + 37A2D0F8493469EF2495FC689440F079 /* EXPMatchers+beLessThanOrEqualTo.h in Headers */, + E735386085CE344F6A01178CF4763852 /* EXPMatchers+beNil.h in Headers */, + 397B320B7C59C168CC5B62E18ED8DEA0 /* EXPMatchers+beSubclassOf.h in Headers */, + 76CCABE79C04444450153424D7CE1DC1 /* EXPMatchers+beSupersetOf.h in Headers */, + 85EB2F216487CB2E8F3FCCFBC4D69912 /* EXPMatchers+beTruthy.h in Headers */, + F0DDF02A078B917997FF025BB33BB842 /* EXPMatchers+conformTo.h in Headers */, + 3C2700C7DAA15C6AF84A595865C42F4D /* EXPMatchers+contain.h in Headers */, + 1A1AB2EC52323C5EA28DAA99F1E1A90D /* EXPMatchers+endWith.h in Headers */, + 0F94F5B0ABB3252B9275B7C129EC7A26 /* EXPMatchers+equal.h in Headers */, + F75CB2A727F678C9A848A3A11EA7979B /* EXPMatchers+haveCountOf.h in Headers */, + 2916A0606136A9DC67F2463AB230868B /* EXPMatchers+match.h in Headers */, + 9B2E761A064459F77EA9870BEF03ACC3 /* EXPMatchers+postNotification.h in Headers */, + 46137F5CC368BF38BAF0D0AF81DD8FFE /* EXPMatchers+raise.h in Headers */, + 11C1AEB289C1EB80089349B71F09D04B /* EXPMatchers+raiseWithReason.h in Headers */, + 260BC7EED9289AF321A6F791964CE472 /* EXPMatchers+respondTo.h in Headers */, + 85E31076D5530AEEB45ACF16B2B8A983 /* EXPMatchers.h in Headers */, + 51DDDB0FB4899757CF6A826B531B940D /* EXPUnsupportedObject.h in Headers */, + 7B223B4E6EF14BA12DA113F7EE10B96C /* NSObject+Expecta.h in Headers */, + 471FD4F68E27AB26FA2AEBB8B245CEE4 /* NSValue+Expecta.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B579CB9E08B95B7902D35622143D00AA /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 003FC52F29E9B9B55FFC8C2C1E57D6BE /* PNObject-umbrella.h in Headers */, + 98A194768324928F76BF544EEE5EDBE5 /* PNObject.h in Headers */, + 410F22568A4D148214B412697A2322E6 /* PNObjectProperty.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BA0FDF67467F294ACFEF3C734E0A426A /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 29F2AEAF2B01E3739BF745ADE8E9D0A4 /* Expecta+Snapshots-umbrella.h in Headers */, + 39F3AFD4DADD9BF4AEDFAF1FEA82B2F2 /* ExpectaObject+FBSnapshotTest.h in Headers */, + EA840679AC9463E0E3D371FCC3466B0A /* EXPMatchers+FBSnapshotTest.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DF8D3B8C69B09612DFF4ABBD19102AD2 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 4F535B1FDEAB87D360A100F7055A806E /* PEAR-FileManager-iOS-umbrella.h in Headers */, + 207B0778FA44B677AA237F5D96C23E28 /* PEARFileManager.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F4CD5DD853B84CC2D8644CF4FED35F1E /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 20C0CFB6F8C29123D1667E2676D8B2F5 /* FBSnapshotTestCase.h in Headers */, + D1E9E55D21C92E33ACE7E911BCB96269 /* FBSnapshotTestCasePlatform.h in Headers */, + F58F9BC7759BB8A5007B8821A275AEDD /* FBSnapshotTestController.h in Headers */, + E10811B5E4578C31FB675361C99EDED6 /* UIImage+Compare.h in Headers */, + 274D9545D0357B667BCAA82B3FB38ECD /* UIImage+Diff.h in Headers */, + CE91E0B7C2BF362403CB3A75E69AA061 /* UIImage+Snapshot.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 0AC755D7223E1DCE35AE9FCCC88542DE /* UIDevice-Utils-UIDevice-Utils */ = { + isa = PBXNativeTarget; + buildConfigurationList = 42A0294C794D4EE020CA257E3A01B114 /* Build configuration list for PBXNativeTarget "UIDevice-Utils-UIDevice-Utils" */; + buildPhases = ( + 843CD8E277073D9AED703095BCBC79A9 /* Sources */, + DA96E0E0E5819F73D7723C62EBB3C3EB /* Frameworks */, + 52182C0F4E0101A4AB69F2A8AF198581 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "UIDevice-Utils-UIDevice-Utils"; + productName = "UIDevice-Utils-UIDevice-Utils"; + productReference = 5B5C169A7A6F9F35D18EB5691C3CAD4C /* UIDevice-Utils.bundle */; + productType = "com.apple.product-type.bundle"; + }; + 0D888F29E05E498D0CD91A51D28599A5 /* Expecta */ = { + isa = PBXNativeTarget; + buildConfigurationList = DC61702A42844E4ED762A73E8893436B /* Build configuration list for PBXNativeTarget "Expecta" */; + buildPhases = ( + B239BD93C67DE976C7F3A1AD982A0A58 /* Sources */, + E6B836B352B13C63D3C0FA0E500C98A4 /* Frameworks */, + 966427BD32145AD621F074D1691342B8 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Expecta; + productName = Expecta; + productReference = 684260D2513FE8AD036B49C00B805318 /* Expecta.framework */; + productType = "com.apple.product-type.framework"; + }; + 14C0C6F18E6665CC5462A4754C119096 /* PNObject */ = { + isa = PBXNativeTarget; + buildConfigurationList = ECBCCBF3DEC3A8EB22536CD202D1A7CE /* Build configuration list for PBXNativeTarget "PNObject" */; + buildPhases = ( + 14C6DD5F3F8D3CD8656F8DAB6699BE2A /* Sources */, + DF37C2BB2DC1ACB7EFB121F1B9CC97D4 /* Frameworks */, + 61ADC96C800CB97146CC9B52B2C27D92 /* Resources */, + B579CB9E08B95B7902D35622143D00AA /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + A79A6A136E7856F4D07BF63A04C744BF /* PBXTargetDependency */, + ); + name = PNObject; + productName = PNObject; + productReference = F793F931AACF1EE2763F3169C9C69946 /* PNObject.framework */; + productType = "com.apple.product-type.framework"; + }; + 1C3436CEA5C3D39764C5F54374794ECB /* AFNetworking */ = { + isa = PBXNativeTarget; + buildConfigurationList = 57800A0D1724774333EF09E83030AA81 /* Build configuration list for PBXNativeTarget "AFNetworking" */; + buildPhases = ( + 1F17F426378DF5EC8DFB10304B8C4BA4 /* Sources */, + C151364F15F39F7CC60CBF9A3AB49B44 /* Frameworks */, + 7C6A0D99A9CC32A19A92A62F8A941139 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AFNetworking; + productName = AFNetworking; + productReference = 90090F537C1E3D5A10D48C164A6F8570 /* AFNetworking.framework */; + productType = "com.apple.product-type.framework"; + }; + 20B8A8681820FA8513BD7E48A85DC18D /* NSDate_Utils */ = { + isa = PBXNativeTarget; + buildConfigurationList = 79BD86EAF35000F652F4BBD8B3117E03 /* Build configuration list for PBXNativeTarget "NSDate_Utils" */; + buildPhases = ( + 59ED484589F5B1C9798100CF3687BA41 /* Sources */, + 0AE200B93FBC97786AE0B7F8B47D9303 /* Frameworks */, + 24051A43C464FA4753841B4A25AAD831 /* Resources */, + 48923ED0E34E254D77BA5695C091C159 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + EF83D136E3B525B6151A75CBAEFE4ADD /* PBXTargetDependency */, + ); + name = NSDate_Utils; + productName = NSDate_Utils; + productReference = 6BCF0B57CC5FE7DB7261CE7C60EAE6C1 /* NSDate_Utils.framework */; + productType = "com.apple.product-type.framework"; + }; + 3241BF41D67FE3979A15BEAA18A92CA3 /* NSDate_Utils-NSDate_Utils */ = { + isa = PBXNativeTarget; + buildConfigurationList = AAB6419C2AFF3412132A85C871687E0B /* Build configuration list for PBXNativeTarget "NSDate_Utils-NSDate_Utils" */; + buildPhases = ( + EFCDB2F10A0D0ECD2C48D53B2E003FEC /* Sources */, + E83D493CE1B2D93EDA7574BB1E5DEB29 /* Frameworks */, + 5493837171A1BFE5D0807A41315674C6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "NSDate_Utils-NSDate_Utils"; + productName = "NSDate_Utils-NSDate_Utils"; + productReference = F6475D2AE952D65158911AE59D9D7787 /* NSDate_Utils.bundle */; + productType = "com.apple.product-type.bundle"; + }; + 3FC66D7226BA3A5FBE528DBFDABC3B14 /* Pods-PNObject_Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4E0C6A15611EBBBE323682471AF5E49E /* Build configuration list for PBXNativeTarget "Pods-PNObject_Tests" */; + buildPhases = ( + 152D796921343454EE26D6AE2BEA89AE /* Sources */, + C9D84858B33FBC15355A749B4C1EA875 /* Frameworks */, + 8C5203B8750A6E260AA0643BE409CDAA /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 43FAC99B3C6E8E43090727DD0DD31436 /* PBXTargetDependency */, + 49487DFD795051E3221AD5CF7B0A56E8 /* PBXTargetDependency */, + A035600EE984F2B16527954600032B82 /* PBXTargetDependency */, + AF40FC576E027F8EA348D35D9C96C757 /* PBXTargetDependency */, + D98449D6D97200A339E1A6D293706E17 /* PBXTargetDependency */, + ); + name = "Pods-PNObject_Tests"; + productName = "Pods-PNObject_Tests"; + productReference = 824C131E1882E849655990203D7BA94B /* Pods_PNObject_Tests.framework */; + productType = "com.apple.product-type.framework"; + }; + 5FC3550CE584133F3A6D63CD1997A942 /* UIDevice-Utils */ = { + isa = PBXNativeTarget; + buildConfigurationList = A72D32D24FDEC5ABE522D499900CD632 /* Build configuration list for PBXNativeTarget "UIDevice-Utils" */; + buildPhases = ( + 957FC7A06FF010185965C558F6AFAB00 /* Sources */, + A56E13DAA3C6DDE77A388FB0AD375540 /* Frameworks */, + 2F01F09216CF74DAB06A552261BD5356 /* Resources */, + 0C7D6B9DBA9F53F30F4F525BE25A1789 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 175B2B1B2540FA77ADA77ED5AF4BA337 /* PBXTargetDependency */, + ); + name = "UIDevice-Utils"; + productName = "UIDevice-Utils"; + productReference = CB327A2C4264D8D750739600AF58AB3C /* UIDevice_Utils.framework */; + productType = "com.apple.product-type.framework"; + }; + 619F0D28240534293108906FED04836F /* Expecta+Snapshots */ = { + isa = PBXNativeTarget; + buildConfigurationList = D5B74CC207A82790DE2A82F49EDF170A /* Build configuration list for PBXNativeTarget "Expecta+Snapshots" */; + buildPhases = ( + 796C061AD650C052C9339513DE83940A /* Sources */, + CFF5B7915B7C4A2828E27F2C89B1769C /* Frameworks */, + BA0FDF67467F294ACFEF3C734E0A426A /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 4ACA793EC27274D41A670C74CD739365 /* PBXTargetDependency */, + CFC3C60C0541C54818441E331A7E8753 /* PBXTargetDependency */, + ); + name = "Expecta+Snapshots"; + productName = "Expecta+Snapshots"; + productReference = 6387377EE062A0FDF751AA136AC2D137 /* Expecta_Snapshots.framework */; + productType = "com.apple.product-type.framework"; + }; + BF088AF63E437970817C1E809577C700 /* PEAR-FileManager-iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 87A85A81F57840394EEB3599AFEC5125 /* Build configuration list for PBXNativeTarget "PEAR-FileManager-iOS" */; + buildPhases = ( + 958D491DA8D20A98E036C0C4545C7D75 /* Sources */, + 6D6CB09F12A9C7654A9780AC037A1D63 /* Frameworks */, + DF8D3B8C69B09612DFF4ABBD19102AD2 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "PEAR-FileManager-iOS"; + productName = "PEAR-FileManager-iOS"; + productReference = 27053B717A2E6C890A9A5567BE892759 /* PEAR_FileManager_iOS.framework */; + productType = "com.apple.product-type.framework"; + }; + CD1AB2B568D950154C8989EF79AD82AC /* Pods-PNObject_Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = C162623A8C03367E01ED7B8E8ACC5D78 /* Build configuration list for PBXNativeTarget "Pods-PNObject_Example" */; + buildPhases = ( + 670062506FE05E496EF63E1614C85581 /* Sources */, + 2FBBC195EC5AF2E370AF885FCB76B312 /* Frameworks */, + 2CCD3AC15356E236F04A34F8C92A312C /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 4350AD66D151EBAB414F1F7E40B38979 /* PBXTargetDependency */, + 93B269AF7AB7D4AAAD0E0CF611E40C71 /* PBXTargetDependency */, + 6059D20F8BABBCC1C713F5FA48F9E352 /* PBXTargetDependency */, + DB0EE9D1A9B7B596CD6A20A464DB0EC5 /* PBXTargetDependency */, + 10794661E5C7A493B6CF158E1C1AC084 /* PBXTargetDependency */, + ); + name = "Pods-PNObject_Example"; + productName = "Pods-PNObject_Example"; + productReference = 1E9631FC8095895820932DC31657A035 /* Pods_PNObject_Example.framework */; + productType = "com.apple.product-type.framework"; + }; + D07447EE3CEBB0BCB8D61DFCB8EA915F /* FBSnapshotTestCase */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7C7B4BE8DC7E24A96243E4D67565D719 /* Build configuration list for PBXNativeTarget "FBSnapshotTestCase" */; + buildPhases = ( + 050B9690E875D70369E073EC11B52256 /* Sources */, + 914A3FA7C160948DE0A308FB745E7380 /* Frameworks */, + F4CD5DD853B84CC2D8644CF4FED35F1E /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FBSnapshotTestCase; + productName = FBSnapshotTestCase; + productReference = 806E3AAC0A4A15EF79D3BCD7811DB696 /* FBSnapshotTestCase.framework */; + productType = "com.apple.product-type.framework"; + }; + F4EDFD36E823E9C8FC07F587475D3097 /* PNObject-PNObject */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7CB35F1AF1D2238A2F08DE111DBC8954 /* Build configuration list for PBXNativeTarget "PNObject-PNObject" */; + buildPhases = ( + 6D790362F683950CDB17977212E96689 /* Sources */, + 076EFF1C26317DB401B532BF933C74DA /* Frameworks */, + E342AA2CC9941811D37126BF2DFAB14A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "PNObject-PNObject"; + productName = "PNObject-PNObject"; + productReference = 50F53D1643B9ED1F04EAF728153AEDAA /* PNObject.bundle */; + productType = "com.apple.product-type.bundle"; + }; + FEFA0EA1EEA4C33F0DE10FCEDDA0F0A2 /* Specta */ = { + isa = PBXNativeTarget; + buildConfigurationList = CA50AC503D3571B657584ED19F4D04EE /* Build configuration list for PBXNativeTarget "Specta" */; + buildPhases = ( + 147F11451D91D1068AAA5E962D8A2B17 /* Sources */, + FE96ED7903B6CE86B6B21F9F8C12B9D0 /* Frameworks */, + 192E87C792D1EA23277FF97C60726FC5 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Specta; + productName = Specta; + productReference = 96F15D3DFF0D00CD1F008FC669E41C86 /* Specta.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0700; + }; + buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7DB346D0F39D3F0E887471402A8071AB; + productRefGroup = 56BD78A69573139280921FE89BE0B864 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1C3436CEA5C3D39764C5F54374794ECB /* AFNetworking */, + 0D888F29E05E498D0CD91A51D28599A5 /* Expecta */, + 619F0D28240534293108906FED04836F /* Expecta+Snapshots */, + D07447EE3CEBB0BCB8D61DFCB8EA915F /* FBSnapshotTestCase */, + 20B8A8681820FA8513BD7E48A85DC18D /* NSDate_Utils */, + 3241BF41D67FE3979A15BEAA18A92CA3 /* NSDate_Utils-NSDate_Utils */, + BF088AF63E437970817C1E809577C700 /* PEAR-FileManager-iOS */, + 14C0C6F18E6665CC5462A4754C119096 /* PNObject */, + F4EDFD36E823E9C8FC07F587475D3097 /* PNObject-PNObject */, + CD1AB2B568D950154C8989EF79AD82AC /* Pods-PNObject_Example */, + 3FC66D7226BA3A5FBE528DBFDABC3B14 /* Pods-PNObject_Tests */, + FEFA0EA1EEA4C33F0DE10FCEDDA0F0A2 /* Specta */, + 5FC3550CE584133F3A6D63CD1997A942 /* UIDevice-Utils */, + 0AC755D7223E1DCE35AE9FCCC88542DE /* UIDevice-Utils-UIDevice-Utils */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 24051A43C464FA4753841B4A25AAD831 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1EB1017329A4B7619553CBD5FF5D0DAA /* NSDate_Utils.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2F01F09216CF74DAB06A552261BD5356 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8AEED396EA1BF8EA92F1771BA96E61A4 /* UIDevice-Utils.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52182C0F4E0101A4AB69F2A8AF198581 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5493837171A1BFE5D0807A41315674C6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 61ADC96C800CB97146CC9B52B2C27D92 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 93D8E1506F234C3D9559F807A554ECDE /* PNObject.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E342AA2CC9941811D37126BF2DFAB14A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 050B9690E875D70369E073EC11B52256 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C6E9B0A908F410317F2DBBECA0944AAB /* FBSnapshotTestCase-dummy.m in Sources */, + 70E4BCC789D8C8F1033F23E0752502A7 /* FBSnapshotTestCase.m in Sources */, + E3C61206BEDBA3EBAA0A69B51DE0F3AA /* FBSnapshotTestCasePlatform.m in Sources */, + 7861523B9D5DFCF0F4A56E4DE3296AA2 /* FBSnapshotTestController.m in Sources */, + 0A5DFD94EE83E385C1C7D24986E04592 /* SwiftSupport.swift in Sources */, + 07CAFACAFAC87ABBF28D453E70832464 /* UIImage+Compare.m in Sources */, + 89A46B63E469F17791D14FC64466794A /* UIImage+Diff.m in Sources */, + 4052EB66107F09D6F856EAA1F4FC0846 /* UIImage+Snapshot.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 147F11451D91D1068AAA5E962D8A2B17 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 31B6079AAD3DA41DCEBEAAF6FD7A787C /* Specta-dummy.m in Sources */, + 81004C67390828241A58A4A2BAC25FA3 /* SpectaDSL.m in Sources */, + A32D0D2C7494F484262AB7665FD5C8B6 /* SpectaUtility.m in Sources */, + 38CB41EA09748ABA8AA494C7963C3A80 /* SPTCallSite.m in Sources */, + 1E48073A34450AE92B16209CDF55C1A1 /* SPTCompiledExample.m in Sources */, + EC67CB7330FCA32710213A5EA3DD983F /* SPTExample.m in Sources */, + 276A698B4EB38111291EAB8218845DE0 /* SPTExampleGroup.m in Sources */, + 197B5FE62F55AA8BEE877817E83AF810 /* SPTSharedExampleGroups.m in Sources */, + 2BE05F43DACF9A685B82C7DB94C5FA51 /* SPTSpec.m in Sources */, + 3800CFF3A1FE79B3A3B3151EB1EB3E8D /* SPTTestSuite.m in Sources */, + FDACA7B483937A645DBDE9E25DEBA758 /* XCTestCase+Specta.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 14C6DD5F3F8D3CD8656F8DAB6699BE2A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2FC59A81B07D43DCB4CAE4962F4A6018 /* PNObject-dummy.m in Sources */, + 4E9495420371C304945421EA68F69B22 /* PNObject.m in Sources */, + E1D01718CD5CFB570AE7B1D46BCE1436 /* PNObjectProperty.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 152D796921343454EE26D6AE2BEA89AE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 595C956284B1A67B369F027FC7DAEE2C /* Pods-PNObject_Tests-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1F17F426378DF5EC8DFB10304B8C4BA4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F1BC9BAFFEEABB1ABC7614DF0FC97D5 /* AFAutoPurgingImageCache.m in Sources */, + E0D4045AC4C1B41917FCA23A042D18B2 /* AFHTTPSessionManager.m in Sources */, + CFA8D6B529A0EBFF0316F2629AB2556E /* AFImageDownloader.m in Sources */, + A6C6019D45BE62C61210A9CC619368EF /* AFNetworkActivityIndicatorManager.m in Sources */, + 3D2789FC760A97301909F0B1201626CD /* AFNetworking-dummy.m in Sources */, + 68A38977EBAE334DC3C22386D00D2622 /* AFNetworkReachabilityManager.m in Sources */, + 20607BE2B1E5F31765026E5AC64DB27D /* AFSecurityPolicy.m in Sources */, + DFFA215EEAA8DDBD540076927535275C /* AFURLRequestSerialization.m in Sources */, + B5852322ADE88AAD56EE042B80BA81E4 /* AFURLResponseSerialization.m in Sources */, + 707B1A7541C8DBDDE8C27896A61370BE /* AFURLSessionManager.m in Sources */, + 6ED4ABEE8A5F51F5ECB59FA1781D29C6 /* UIActivityIndicatorView+AFNetworking.m in Sources */, + AF03C11A1FAC8132AD3749D8F541701A /* UIButton+AFNetworking.m in Sources */, + 2E8A32ED46194EDBE22146271F6D26DE /* UIImageView+AFNetworking.m in Sources */, + 5FF6453E55785669885F626B853FD2AA /* UIProgressView+AFNetworking.m in Sources */, + 174202BD6AE0E4A41F5CE66E975EAE52 /* UIRefreshControl+AFNetworking.m in Sources */, + A462945883F7729B185B64B679A6BFBE /* UIWebView+AFNetworking.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 59ED484589F5B1C9798100CF3687BA41 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 154FE40BF807A22A341770459ED0BCA9 /* NSDate+NSDate_Util.m in Sources */, + 5062716982D7B13BBDA758E244EDDC86 /* NSDate_Utils-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 670062506FE05E496EF63E1614C85581 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 07FB694DFFD00BFB7890D2E727F7D81F /* Pods-PNObject_Example-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D790362F683950CDB17977212E96689 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 796C061AD650C052C9339513DE83940A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 772BFB9529121111C517FBA06EA26237 /* Expecta+Snapshots-dummy.m in Sources */, + 4B5542E72A64100965FFFA704684CED4 /* ExpectaObject+FBSnapshotTest.m in Sources */, + 47D16DB1D23CFE027F5BE7F7E391AB4C /* EXPMatchers+FBSnapshotTest.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 843CD8E277073D9AED703095BCBC79A9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 957FC7A06FF010185965C558F6AFAB00 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DE7E50D08184052574DD94F7D20067BF /* UIDevice-Hardware.m in Sources */, + D1D3674271C4183F0C9E138EF724DEB7 /* UIDevice-Utils-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 958D491DA8D20A98E036C0C4545C7D75 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AB889BC8C7B93051E0C88B77E41444D3 /* PEAR-FileManager-iOS-dummy.m in Sources */, + 3637BC64699FECD40DB791C67CD45394 /* PEARFileManager.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B239BD93C67DE976C7F3A1AD982A0A58 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5B2D4A621D3DA971A474776AF36BB073 /* EXPBlockDefinedMatcher.m in Sources */, + BC55C8365AEFF8217F6A567607754854 /* EXPDoubleTuple.m in Sources */, + 204D694B03BFF3B244A6AB73FACFFC43 /* Expecta-dummy.m in Sources */, + 94C47C87E397972CE98F75929F3B706C /* ExpectaObject.m in Sources */, + 4BBCBB9D8EF0B241A4A4FE4982985481 /* ExpectaSupport.m in Sources */, + 805E425BBEF7A6133E32E1D30A073010 /* EXPExpect.m in Sources */, + CE3F4ECBB0BC095577D66AE50C8E604C /* EXPFloatTuple.m in Sources */, + 201BF9C605852822CA5A65ADE282A310 /* EXPMatcherHelpers.m in Sources */, + BA12B131F10BCE3BE6E9A02FC908FE9D /* EXPMatchers+beCloseTo.m in Sources */, + 17572374B2AE183C6347C41E8DF8E579 /* EXPMatchers+beFalsy.m in Sources */, + F12D57414A73406831CC032A7170DBFF /* EXPMatchers+beginWith.m in Sources */, + 1312A7D381C51428CF481E33E3D37901 /* EXPMatchers+beGreaterThan.m in Sources */, + 1B0389CD88AA949B34DC7269030FEC6F /* EXPMatchers+beGreaterThanOrEqualTo.m in Sources */, + 66A27898E989A3FA5C15AA671C4536F0 /* EXPMatchers+beIdenticalTo.m in Sources */, + 76D337327C10A7555447B69AA1562647 /* EXPMatchers+beInstanceOf.m in Sources */, + 9BB9159FBA757600D3D4C0FF645F3911 /* EXPMatchers+beInTheRangeOf.m in Sources */, + 87FD5F0F682CDEB6A348CA448889E3EA /* EXPMatchers+beKindOf.m in Sources */, + 0EBFA5FBE4953A83B677CE2A75746761 /* EXPMatchers+beLessThan.m in Sources */, + D83677C54D2226C67886A525B0B46FBE /* EXPMatchers+beLessThanOrEqualTo.m in Sources */, + 2C0A8737FDB9B9C6A6BDF437FD11334C /* EXPMatchers+beNil.m in Sources */, + BEFFE9FFE52E9A0833A7D2D8FB67EB4D /* EXPMatchers+beSubclassOf.m in Sources */, + 6F278423C8AE1DA47F35E374BB5B91EC /* EXPMatchers+beSupersetOf.m in Sources */, + 0C6FF91EB1F0391ED75DC72D31D159EF /* EXPMatchers+beTruthy.m in Sources */, + DB30F82FB1BE083D9471B965FB500CA2 /* EXPMatchers+conformTo.m in Sources */, + FC20596ABFE14A61F171A29FD03275E7 /* EXPMatchers+contain.m in Sources */, + 918E06480F28F27361B19D19432F8538 /* EXPMatchers+endWith.m in Sources */, + 1AB3304B6884F626BC54150AC7565E18 /* EXPMatchers+equal.m in Sources */, + 403292D82DA62291204BF59524BC4EDB /* EXPMatchers+haveCountOf.m in Sources */, + FC45858927D3B6A0F922C4B697B04A38 /* EXPMatchers+match.m in Sources */, + 931D410B9F8ACB935883DF8C59F9C93E /* EXPMatchers+postNotification.m in Sources */, + 2CFE2898496C1C7096DB8DA43AF19103 /* EXPMatchers+raise.m in Sources */, + FE8E34356D24F6759A8B010ED2F5707B /* EXPMatchers+raiseWithReason.m in Sources */, + E0A077DFB064B79685B810CCEFB2F1EF /* EXPMatchers+respondTo.m in Sources */, + EF6497EE123F6BC0C1B09717437C5908 /* EXPUnsupportedObject.m in Sources */, + B84431CF8C64F363A334AA7089F6C134 /* NSValue+Expecta.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EFCDB2F10A0D0ECD2C48D53B2E003FEC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 10794661E5C7A493B6CF158E1C1AC084 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "UIDevice-Utils"; + target = 5FC3550CE584133F3A6D63CD1997A942 /* UIDevice-Utils */; + targetProxy = 68E178B9E911168080B99FBC53CEA776 /* PBXContainerItemProxy */; + }; + 175B2B1B2540FA77ADA77ED5AF4BA337 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "UIDevice-Utils-UIDevice-Utils"; + target = 0AC755D7223E1DCE35AE9FCCC88542DE /* UIDevice-Utils-UIDevice-Utils */; + targetProxy = F88968C905905F79592DE479282C3689 /* PBXContainerItemProxy */; + }; + 4350AD66D151EBAB414F1F7E40B38979 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = AFNetworking; + target = 1C3436CEA5C3D39764C5F54374794ECB /* AFNetworking */; + targetProxy = 4B732239BE294A58DC6272F6728ED39E /* PBXContainerItemProxy */; + }; + 43FAC99B3C6E8E43090727DD0DD31436 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Expecta; + target = 0D888F29E05E498D0CD91A51D28599A5 /* Expecta */; + targetProxy = DB8B9514246D0DB2C2107F5951E3CEA0 /* PBXContainerItemProxy */; + }; + 49487DFD795051E3221AD5CF7B0A56E8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "Expecta+Snapshots"; + target = 619F0D28240534293108906FED04836F /* Expecta+Snapshots */; + targetProxy = 8ED7A6856CF11CC77820D019BFD88B37 /* PBXContainerItemProxy */; + }; + 4ACA793EC27274D41A670C74CD739365 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Expecta; + target = 0D888F29E05E498D0CD91A51D28599A5 /* Expecta */; + targetProxy = CCF83280732A67033B72EE54815FFD3F /* PBXContainerItemProxy */; + }; + 6059D20F8BABBCC1C713F5FA48F9E352 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "PEAR-FileManager-iOS"; + target = BF088AF63E437970817C1E809577C700 /* PEAR-FileManager-iOS */; + targetProxy = 4B0DAF64EA0AC85B798C1549D1A53B2C /* PBXContainerItemProxy */; + }; + 93B269AF7AB7D4AAAD0E0CF611E40C71 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = NSDate_Utils; + target = 20B8A8681820FA8513BD7E48A85DC18D /* NSDate_Utils */; + targetProxy = 6D753E6161742F970C234BAAE7F6406C /* PBXContainerItemProxy */; + }; + A035600EE984F2B16527954600032B82 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = FBSnapshotTestCase; + target = D07447EE3CEBB0BCB8D61DFCB8EA915F /* FBSnapshotTestCase */; + targetProxy = 82200C210A231BA5B34F0CB3A8F037F3 /* PBXContainerItemProxy */; + }; + A79A6A136E7856F4D07BF63A04C744BF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "PNObject-PNObject"; + target = F4EDFD36E823E9C8FC07F587475D3097 /* PNObject-PNObject */; + targetProxy = BE37CAAFB350F19DE50212EBAE338997 /* PBXContainerItemProxy */; + }; + AF40FC576E027F8EA348D35D9C96C757 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = PNObject; + target = 14C0C6F18E6665CC5462A4754C119096 /* PNObject */; + targetProxy = A24CCDAB9D3B52B9B9BA3FB118E7272F /* PBXContainerItemProxy */; + }; + CFC3C60C0541C54818441E331A7E8753 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = FBSnapshotTestCase; + target = D07447EE3CEBB0BCB8D61DFCB8EA915F /* FBSnapshotTestCase */; + targetProxy = F9BBA6CBCE0B1A136EAFACE5185B512D /* PBXContainerItemProxy */; + }; + D98449D6D97200A339E1A6D293706E17 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Specta; + target = FEFA0EA1EEA4C33F0DE10FCEDDA0F0A2 /* Specta */; + targetProxy = 4DBD8C9175CF420255ACC02D04C83503 /* PBXContainerItemProxy */; + }; + DB0EE9D1A9B7B596CD6A20A464DB0EC5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = PNObject; + target = 14C0C6F18E6665CC5462A4754C119096 /* PNObject */; + targetProxy = 933AD56993BFD86E122885B5E3201263 /* PBXContainerItemProxy */; + }; + EF83D136E3B525B6151A75CBAEFE4ADD /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "NSDate_Utils-NSDate_Utils"; + target = 3241BF41D67FE3979A15BEAA18A92CA3 /* NSDate_Utils-NSDate_Utils */; + targetProxy = 0CD167825DC3C6EBCB6F12FF7295B619 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 096210B7B84F8CA4FEF263DD6CC82AEA /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9C90AD238A313B46BF94AE78706DCB4 /* NSDate_Utils.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/NSDate_Utils/NSDate_Utils-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/NSDate_Utils/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/NSDate_Utils/NSDate_Utils.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = NSDate_Utils; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 120360176337DDCFA254D151FC926CE4 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 218AF1ECF876B28B484AD438E085D491 /* PNObject.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/PNObject/ResourceBundle-PNObject-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + PRODUCT_NAME = PNObject; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = bundle; + }; + name = Release; + }; + 12AE6F83274C7A824845A8BF52BA16DF /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 31EC73DD2649E7FFDFFC27FD45896BD4 /* FBSnapshotTestCase.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/FBSnapshotTestCase/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = FBSnapshotTestCase; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 18F3430617D125CAAC70F31B1D84A461 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BAC103126493FCA9DC307BF91F51572A /* PEAR-FileManager-iOS.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PEAR-FileManager-iOS/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = PEAR_FileManager_iOS; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 1BD8423F9E51E0E25A5BC39E697CBF01 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 31EC73DD2649E7FFDFFC27FD45896BD4 /* FBSnapshotTestCase.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/FBSnapshotTestCase/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = FBSnapshotTestCase; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 2952B3C6909CF79419E899529474B8A5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9563F7F11E1375F4565A5DA733FCE9DA /* AFNetworking.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/AFNetworking/AFNetworking-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/AFNetworking/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/AFNetworking/AFNetworking.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = AFNetworking; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 2C442C92732ADBDBFA54CF4EA7B71CDF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 2F914909F85A5B7FA381E7629A0FFB17 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 904082EBDFF32BCD467F6A45BF9EBB63 /* Expecta+Snapshots.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/Expecta+Snapshots/Expecta+Snapshots-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Expecta+Snapshots/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Expecta+Snapshots/Expecta+Snapshots.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = Expecta_Snapshots; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 373349C30AA02CB77851CFF553DFAE5C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 904082EBDFF32BCD467F6A45BF9EBB63 /* Expecta+Snapshots.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/Expecta+Snapshots/Expecta+Snapshots-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Expecta+Snapshots/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Expecta+Snapshots/Expecta+Snapshots.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = Expecta_Snapshots; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 3A0D16B40A19E2EEC5827E1CCA22A644 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 218AF1ECF876B28B484AD438E085D491 /* PNObject.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/PNObject/PNObject-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PNObject/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PNObject/PNObject.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = PNObject; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 3BCDFD10D3EF18D2B41E2AF437E614E0 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EB8B84E4432E9D6D4914A7EB79C467FA /* Pods-PNObject_Tests.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-PNObject_Tests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_PNObject_Tests; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 61A178E7BF297D56213BB4BF218463C9 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9C90AD238A313B46BF94AE78706DCB4 /* NSDate_Utils.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/NSDate_Utils/ResourceBundle-NSDate_Utils-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + PRODUCT_NAME = NSDate_Utils; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = bundle; + }; + name = Release; + }; + 66EC22D928FCAD74D89944A8BA144C15 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D11A9BD0CFE1E520AE71DC4403614790 /* Pods-PNObject_Example.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-PNObject_Example/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_PNObject_Example; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 6D9FA84BB6387F9913EEED4D0C2A7310 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BAC103126493FCA9DC307BF91F51572A /* PEAR-FileManager-iOS.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PEAR-FileManager-iOS/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = PEAR_FileManager_iOS; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 72E10C157721DA4F8079DD1560E64572 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4CA3F01C6FCD8C40E554418F47CB254D /* UIDevice-Utils.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/UIDevice-Utils/ResourceBundle-UIDevice-Utils-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + PRODUCT_NAME = "UIDevice-Utils"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = bundle; + }; + name = Release; + }; + 7DF7688F79A559C9598216F5D75FD022 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4CA3F01C6FCD8C40E554418F47CB254D /* UIDevice-Utils.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/UIDevice-Utils/UIDevice-Utils-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/UIDevice-Utils/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/UIDevice-Utils/UIDevice-Utils.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = UIDevice_Utils; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 861C297869508F2D8745D5F255B96464 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 218AF1ECF876B28B484AD438E085D491 /* PNObject.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/PNObject/ResourceBundle-PNObject-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + PRODUCT_NAME = PNObject; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = bundle; + }; + name = Debug; + }; + 86B3AF85DF2958967D7E96849C2BE84C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C2D2620C4D8B7C07CB68366A7BEA9EBA /* Expecta.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/Expecta/Expecta-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Expecta/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Expecta/Expecta.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = Expecta; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 86B9B849D7550BCF8E5C892F6C1DA3A3 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4CA3F01C6FCD8C40E554418F47CB254D /* UIDevice-Utils.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/UIDevice-Utils/UIDevice-Utils-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/UIDevice-Utils/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/UIDevice-Utils/UIDevice-Utils.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = UIDevice_Utils; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 8F3DB35429BAAFA186FAC9DDA4A4AFE1 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8F63209A7B3EE3ED016CF8977F775084 /* Specta.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/Specta/Specta-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Specta/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Specta/Specta.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = Specta; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 9C751625A21A57BE8E3F4FCE8630D2EA /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8F63209A7B3EE3ED016CF8977F775084 /* Specta.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/Specta/Specta-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Specta/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Specta/Specta.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = Specta; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 9FDB32B574D35930239AED9E717B488B /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = DC358092608E035811817A25786F40A6 /* Pods-PNObject_Example.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-PNObject_Example/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_PNObject_Example; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + A995C0FF0D9A9E9226F1AF23ED8B68AF /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9C90AD238A313B46BF94AE78706DCB4 /* NSDate_Utils.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/NSDate_Utils/NSDate_Utils-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/NSDate_Utils/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/NSDate_Utils/NSDate_Utils.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = NSDate_Utils; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + AC044B65E2FB02CB420DF9AE625B92F2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9563F7F11E1375F4565A5DA733FCE9DA /* AFNetworking.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/AFNetworking/AFNetworking-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/AFNetworking/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/AFNetworking/AFNetworking.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = AFNetworking; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + C7953110A6CE153C5E106CB8CF3D552C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C9C90AD238A313B46BF94AE78706DCB4 /* NSDate_Utils.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/NSDate_Utils/ResourceBundle-NSDate_Utils-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + PRODUCT_NAME = NSDate_Utils; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = bundle; + }; + name = Debug; + }; + D59F51BB5D11440BACEADB935063934E /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F872FBD57D98CFC3DE47AD9A270264B9 /* Pods-PNObject_Tests.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-PNObject_Tests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_PNObject_Tests; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + DB44C5CA5E7AC762546FE4E73ED003F3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; + ONLY_ACTIVE_ARCH = YES; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + DD7D5F1D54D7015F36635951E0F5E50F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4CA3F01C6FCD8C40E554418F47CB254D /* UIDevice-Utils.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/UIDevice-Utils/ResourceBundle-UIDevice-Utils-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + PRODUCT_NAME = "UIDevice-Utils"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = bundle; + }; + name = Debug; + }; + EB9C5963E2A033B24EAF62B38ABC3BBB /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 218AF1ECF876B28B484AD438E085D491 /* PNObject.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/PNObject/PNObject-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PNObject/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PNObject/PNObject.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = PNObject; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + F24F328AA1CFC9A061F629C917D03F44 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C2D2620C4D8B7C07CB68366A7BEA9EBA /* Expecta.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/Expecta/Expecta-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Expecta/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Expecta/Expecta.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = Expecta; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DB44C5CA5E7AC762546FE4E73ED003F3 /* Debug */, + 2C442C92732ADBDBFA54CF4EA7B71CDF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 42A0294C794D4EE020CA257E3A01B114 /* Build configuration list for PBXNativeTarget "UIDevice-Utils-UIDevice-Utils" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DD7D5F1D54D7015F36635951E0F5E50F /* Debug */, + 72E10C157721DA4F8079DD1560E64572 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4E0C6A15611EBBBE323682471AF5E49E /* Build configuration list for PBXNativeTarget "Pods-PNObject_Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3BCDFD10D3EF18D2B41E2AF437E614E0 /* Debug */, + D59F51BB5D11440BACEADB935063934E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 57800A0D1724774333EF09E83030AA81 /* Build configuration list for PBXNativeTarget "AFNetworking" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AC044B65E2FB02CB420DF9AE625B92F2 /* Debug */, + 2952B3C6909CF79419E899529474B8A5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 79BD86EAF35000F652F4BBD8B3117E03 /* Build configuration list for PBXNativeTarget "NSDate_Utils" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 096210B7B84F8CA4FEF263DD6CC82AEA /* Debug */, + A995C0FF0D9A9E9226F1AF23ED8B68AF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7C7B4BE8DC7E24A96243E4D67565D719 /* Build configuration list for PBXNativeTarget "FBSnapshotTestCase" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1BD8423F9E51E0E25A5BC39E697CBF01 /* Debug */, + 12AE6F83274C7A824845A8BF52BA16DF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7CB35F1AF1D2238A2F08DE111DBC8954 /* Build configuration list for PBXNativeTarget "PNObject-PNObject" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 861C297869508F2D8745D5F255B96464 /* Debug */, + 120360176337DDCFA254D151FC926CE4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 87A85A81F57840394EEB3599AFEC5125 /* Build configuration list for PBXNativeTarget "PEAR-FileManager-iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 18F3430617D125CAAC70F31B1D84A461 /* Debug */, + 6D9FA84BB6387F9913EEED4D0C2A7310 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A72D32D24FDEC5ABE522D499900CD632 /* Build configuration list for PBXNativeTarget "UIDevice-Utils" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 86B9B849D7550BCF8E5C892F6C1DA3A3 /* Debug */, + 7DF7688F79A559C9598216F5D75FD022 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + AAB6419C2AFF3412132A85C871687E0B /* Build configuration list for PBXNativeTarget "NSDate_Utils-NSDate_Utils" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C7953110A6CE153C5E106CB8CF3D552C /* Debug */, + 61A178E7BF297D56213BB4BF218463C9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C162623A8C03367E01ED7B8E8ACC5D78 /* Build configuration list for PBXNativeTarget "Pods-PNObject_Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 66EC22D928FCAD74D89944A8BA144C15 /* Debug */, + 9FDB32B574D35930239AED9E717B488B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CA50AC503D3571B657584ED19F4D04EE /* Build configuration list for PBXNativeTarget "Specta" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8F3DB35429BAAFA186FAC9DDA4A4AFE1 /* Debug */, + 9C751625A21A57BE8E3F4FCE8630D2EA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D5B74CC207A82790DE2A82F49EDF170A /* Build configuration list for PBXNativeTarget "Expecta+Snapshots" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 373349C30AA02CB77851CFF553DFAE5C /* Debug */, + 2F914909F85A5B7FA381E7629A0FFB17 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + DC61702A42844E4ED762A73E8893436B /* Build configuration list for PBXNativeTarget "Expecta" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 86B3AF85DF2958967D7E96849C2BE84C /* Debug */, + F24F328AA1CFC9A061F629C917D03F44 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + ECBCCBF3DEC3A8EB22536CD202D1A7CE /* Build configuration list for PBXNativeTarget "PNObject" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3A0D16B40A19E2EEC5827E1CCA22A644 /* Debug */, + EB9C5963E2A033B24EAF62B38ABC3BBB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; +} diff --git a/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/PNObject.xcscheme b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/PNObject.xcscheme new file mode 100644 index 0000000..bd0dca9 --- /dev/null +++ b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/PNObject.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Pods/Specta/LICENSE b/Example/Pods/Specta/LICENSE new file mode 100644 index 0000000..ca257c0 --- /dev/null +++ b/Example/Pods/Specta/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2012-2014 Specta Team. + +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. + diff --git a/Example/Pods/Specta/README.md b/Example/Pods/Specta/README.md new file mode 100644 index 0000000..431b121 --- /dev/null +++ b/Example/Pods/Specta/README.md @@ -0,0 +1,176 @@ +# Specta + +A light-weight TDD / BDD framework for Objective-C. + +### Status +[![Build Status](https://travis-ci.org/specta/specta.png)](https://travis-ci.org/specta/specta) +[![Coverage Status](https://coveralls.io/repos/specta/specta/badge.svg)](https://coveralls.io/r/specta/specta) + +## FEATURES + +* An Objective-C RSpec-like BDD DSL +* Quick and easy set up +* Built on top of XCTest +* Excellent Xcode integration + +## SCREENSHOT + +![Specta Screenshot](https://raw.githubusercontent.com/specta/specta/master/misc/specta_screenshot.jpg) + +## SETUP + +Use [CocoaPods](http://github.com/CocoaPods/CocoaPods), [Carthage](https://github.com/carthage/carthage) or [Set up manually](#setting-up-manually) + +### CocoaPods + +1. Add Specta to your project's `Podfile`: + + ```ruby + target :MyApp do + # your app dependencies + end + + target :MyAppTests do + pod 'Specta', '~> 1.0' + # pod 'Expecta', '~> 1.0' # expecta matchers + # pod 'OCMock', '~> 2.2' # OCMock + # pod 'OCHamcrest', '~> 3.0' # hamcrest matchers + # pod 'OCMockito', '~> 1.0' # OCMock + # pod 'LRMocky', '~> 0.9' # LRMocky + end + ``` + +2. Run `pod update` or `pod install` in your project directory. + +### Carthage + +1. Add Specta to your project's `Cartfile.private` + + ``` + github "specta/specta" ~> 1.0 + ``` + +2. Run `carthage update` in your project directory +3. Drag the appropriate `Specta.framework` for your platform (located in Carthage/Build/) into your application’s Xcode project, and add it to your test target(s). +4. If you are building for iOS, a new `Run Script Phase` must be added to copy the framework. The instructions can be found on [Carthage's getting started instructions](https://github.com/carthage/carthage#getting-started) + +### SETTING UP MANUALLY + +1. Clone from Github. +2. Run `rake` in project root to build. +3. Add a "Cocoa/Cocoa Touch Unit Testing Bundle" target if you don't already have one. +4. Copy and add all header files in `Products` folder to the Test target in your Xcode project. +5. For **OS X projects**, copy and add `Specta.framework` in `Products/osx` folder to the test target in your Xcode project. + For **iOS projects**, copy and add `Specta.framework` in `Products/ios` folder to the test target in your Xcode project. + You can alternatively use `libSpecta.a`, if you prefer to add it as a static library for your project. (iOS 7 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. If you encounter linking issues with `_llvm_*` symbols, ensure your target's "Generate Test Coverage Files" and "Instrument Program Flow" build settings are set to `Yes`. + +## EXAMPLE + +```objective-c +#import // #import "Specta.h" if you're using libSpecta.a + +SharedExamplesBegin(MySharedExamples) +// Global shared examples are shared across all spec files. + +sharedExamplesFor(@"foo", ^(NSDictionary *data) { + __block id bar = nil; + beforeEach(^{ + bar = data[@"bar"]; + }); + it(@"should not be nil", ^{ + XCTAssertNotNil(bar); + }); +}); + +SharedExamplesEnd + +SpecBegin(Thing) + +describe(@"Thing", ^{ + sharedExamplesFor(@"another shared behavior", ^(NSDictionary *data) { + // Locally defined shared examples can override global shared examples within its scope. + }); + + beforeAll(^{ + // This is run once and only once before all of the examples + // in this group and before any beforeEach blocks. + }); + + beforeEach(^{ + // This is run before each example. + }); + + it(@"should do stuff", ^{ + // This is an example block. Place your assertions here. + }); + + it(@"should do some stuff asynchronously", ^{ + waitUntil(^(DoneCallback done) { + // Async example blocks need to invoke done() callback. + done(); + }); + }); + + itShouldBehaveLike(@"a shared behavior", @{@"key" : @"obj"}); + + itShouldBehaveLike(@"another shared behavior", ^{ + // Use a block that returns a dictionary if you need the context to be evaluated lazily, + // e.g. to use an object prepared in a beforeEach block. + return @{@"key" : @"obj"}; + }); + + describe(@"Nested examples", ^{ + it(@"should do even more stuff", ^{ + // ... + }); + }); + + pending(@"pending example"); + + pending(@"another pending example", ^{ + // ... + }); + + afterEach(^{ + // This is run after each example. + }); + + afterAll(^{ + // This is run once and only once after all of the examples + // in this group and after any afterEach blocks. + }); +}); + +SpecEnd +``` + +* `beforeEach` and `afterEach` are also aliased as `before` and `after` respectively. +* `describe` is also aliased as `context`. +* `it` is also aliased as `example` and `specify`. +* `itShouldBehaveLike` is also aliased as `itBehavesLike`. +* Use `pending` or prepend `x` to `describe`, `context`, `example`, `it`, and `specify` to mark examples or groups as pending. +* Use `^(DoneCallback done)` as shown in the example above to make examples wait for completion. `done()` callback needs to be invoked to let Specta know that your test is complete. The default timeout is 10.0 seconds but this can be changed by calling the function `setAsyncSpecTimeout(NSTimeInterval timeout)`. +* `(before|after)(Each/All)` also accept `^(DoneCallback done)`s. +* Do `#define SPT_CEDAR_SYNTAX` before importing Specta if you prefer to write `SPEC_BEGIN` and `SPEC_END` instead of `SpecBegin` and `SpecEnd`. +* Prepend `f` to your `describe`, `context`, `example`, `it`, and `specify` to set focus on examples or groups. When specs are focused, all unfocused specs are skipped. +* To use original XCTest reporter, set an environment variable named `SPECTA_REPORTER_CLASS` to `SPTXCTestReporter` in your test scheme. +* Set an environment variable `SPECTA_NO_SHUFFLE` with value `1` to disable test shuffling. +* Set an environment variable `SPECTA_SEED` to specify the random seed for test shuffling. + +Standard XCTest matchers such as `XCTAssertEqualObjects` and `XCTAssertNil` work, but you probably want to add a nicer matcher framework - [Expecta](http://github.com/specta/expecta/) to your setup. Or if you really prefer, [OCHamcrest](https://github.com/jonreid/OCHamcrest) works fine too. Also, add a mocking framework: [OCMock](http://ocmock.org/). + +## RUNNING TESTS IN COMMAND LINE + +* Run `rake test` in the cloned folder. + +## CONTRIBUTION GUIDELINES + +* Please use only spaces and indent 2 spaces at a time. +* Please prefix instance variable names with a single underscore (`_`). +* Please prefix custom classes and functions defined in the global scope with `SPT`. + +## 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). diff --git a/Example/Pods/Specta/Specta/Specta/SPTCallSite.h b/Example/Pods/Specta/Specta/Specta/SPTCallSite.h new file mode 100644 index 0000000..adcd3b0 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTCallSite.h @@ -0,0 +1,12 @@ +#import + +@interface SPTCallSite : NSObject + +@property (nonatomic, copy, readonly) NSString *file; +@property (nonatomic, readonly) NSUInteger line; + ++ (instancetype)callSiteWithFile:(NSString *)file line:(NSUInteger)line; + +- (instancetype)initWithFile:(NSString *)file line:(NSUInteger)line; + +@end diff --git a/Example/Pods/Specta/Specta/Specta/SPTCallSite.m b/Example/Pods/Specta/Specta/Specta/SPTCallSite.m new file mode 100644 index 0000000..585cecd --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTCallSite.m @@ -0,0 +1,18 @@ +#import "SPTCallSite.h" + +@implementation SPTCallSite + ++ (instancetype)callSiteWithFile:(NSString *)file line:(NSUInteger)line { + return [[self alloc] initWithFile:file line:line]; +} + +- (instancetype)initWithFile:(NSString *)file line:(NSUInteger)line { + self = [super init]; + if (self) { + _file = file; + _line = line; + } + return self; +} + +@end diff --git a/Example/Pods/Specta/Specta/Specta/SPTCompiledExample.h b/Example/Pods/Specta/Specta/Specta/SPTCompiledExample.h new file mode 100644 index 0000000..adb3aaa --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTCompiledExample.h @@ -0,0 +1,17 @@ +#import +#import "SpectaTypes.h" + +@interface SPTCompiledExample : NSObject + +@property (nonatomic, copy) NSString *name; +@property (nonatomic, copy) NSString *testCaseName; +@property (nonatomic, copy) SPTSpecBlock block; + +@property (nonatomic) BOOL pending; +@property (nonatomic, getter=isFocused) BOOL focused; + +@property (nonatomic) SEL testMethodSelector; + +- (id)initWithName:(NSString *)name testCaseName:(NSString *)testCaseName block:(SPTSpecBlock)block pending:(BOOL)pending focused:(BOOL)focused; + +@end diff --git a/Example/Pods/Specta/Specta/Specta/SPTCompiledExample.m b/Example/Pods/Specta/Specta/Specta/SPTCompiledExample.m new file mode 100644 index 0000000..e762165 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTCompiledExample.m @@ -0,0 +1,17 @@ +#import "SPTCompiledExample.h" + +@implementation SPTCompiledExample + +- (id)initWithName:(NSString *)name testCaseName:(NSString *)testCaseName block:(SPTSpecBlock)block pending:(BOOL)pending focused:(BOOL)focused { + self = [super init]; + if (self) { + self.name = name; + self.testCaseName = testCaseName; + self.block = block; + self.pending = pending; + self.focused = focused; + } + return self; +} + +@end diff --git a/Example/Pods/Specta/Specta/Specta/SPTExample.h b/Example/Pods/Specta/Specta/Specta/SPTExample.h new file mode 100644 index 0000000..849aacb --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTExample.h @@ -0,0 +1,17 @@ +#import +#import "SpectaTypes.h" + +@class SPTCallSite; + +@interface SPTExample : NSObject + +@property (nonatomic, copy) NSString *name; +@property (nonatomic, retain) SPTCallSite *callSite; +@property (nonatomic, copy) SPTVoidBlock block; + +@property (nonatomic) BOOL pending; +@property (nonatomic, getter=isFocused) BOOL focused; + +- (id)initWithName:(NSString *)name callSite:(SPTCallSite *)callSite focused:(BOOL)focused block:(SPTVoidBlock)block; + +@end diff --git a/Example/Pods/Specta/Specta/Specta/SPTExample.m b/Example/Pods/Specta/Specta/Specta/SPTExample.m new file mode 100644 index 0000000..e5905a9 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTExample.m @@ -0,0 +1,17 @@ +#import "SPTExample.h" + +@implementation SPTExample + +- (id)initWithName:(NSString *)name callSite:(SPTCallSite *)callSite focused:(BOOL)focused block:(SPTVoidBlock)block { + self = [super init]; + if (self) { + self.name = name; + self.callSite = callSite; + self.block = block; + self.focused = focused; + self.pending = block == nil; + } + return self; +} + +@end diff --git a/Example/Pods/Specta/Specta/Specta/SPTExampleGroup.h b/Example/Pods/Specta/Specta/Specta/SPTExampleGroup.h new file mode 100644 index 0000000..dce3db6 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTExampleGroup.h @@ -0,0 +1,36 @@ +#import +#import +#import "SpectaTypes.h" + +@class SPTExample; +@class SPTCallSite; + +@interface SPTExampleGroup : NSObject + +@property (nonatomic, copy) NSString *name; +@property (nonatomic, weak) SPTExampleGroup *root; +@property (nonatomic, weak) SPTExampleGroup *parent; +@property (nonatomic, strong) NSMutableArray *children; +@property (nonatomic, strong) NSMutableArray *beforeAllArray; +@property (nonatomic, strong) NSMutableArray *afterAllArray; +@property (nonatomic, strong) NSMutableArray *beforeEachArray; +@property (nonatomic, strong) NSMutableArray *afterEachArray; +@property (nonatomic, strong) NSMutableDictionary *sharedExamples; +@property (nonatomic) unsigned int exampleCount; +@property (nonatomic) unsigned int ranExampleCount; +@property (nonatomic) unsigned int pendingExampleCount; +@property (nonatomic, getter=isFocused) BOOL focused; + +- (id)initWithName:(NSString *)name parent:(SPTExampleGroup *)parent root:(SPTExampleGroup *)root; + +- (SPTExampleGroup *)addExampleGroupWithName:(NSString *)name focused:(BOOL)focused; +- (SPTExample *)addExampleWithName:(NSString *)name callSite:(SPTCallSite *)callSite focused:(BOOL)focused block:(SPTVoidBlock)block; + +- (void)addBeforeAllBlock:(SPTVoidBlock)block; +- (void)addAfterAllBlock:(SPTVoidBlock)block; +- (void)addBeforeEachBlock:(SPTVoidBlock)block; +- (void)addAfterEachBlock:(SPTVoidBlock)block; + +- (NSArray *)compileExamplesWithStack:(NSArray *)stack; + +@end diff --git a/Example/Pods/Specta/Specta/Specta/SPTExampleGroup.m b/Example/Pods/Specta/Specta/Specta/SPTExampleGroup.m new file mode 100644 index 0000000..cf51800 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTExampleGroup.m @@ -0,0 +1,335 @@ +#import "SPTExampleGroup.h" +#import "SPTExample.h" +#import "SPTCompiledExample.h" +#import "SPTSpec.h" +#import "SpectaUtility.h" +#import "XCTest+Private.h" +#import "SPTGlobalBeforeAfterEach.h" +#import +#import + +static NSArray *ClassesWithClassMethod(SEL classMethodSelector) { + NSMutableArray *classesWithClassMethod = [[NSMutableArray alloc] init]; + + int numberOfClasses = objc_getClassList(NULL, 0); + if (numberOfClasses > 0) { + Class *classes = (Class *)malloc(sizeof(Class) *numberOfClasses); + numberOfClasses = objc_getClassList(classes, numberOfClasses); + + for(int classIndex = 0; classIndex < numberOfClasses; classIndex++) { + Class aClass = classes[classIndex]; + + if (class_conformsToProtocol(aClass, @protocol(SPTGlobalBeforeAfterEach))) { + Method globalMethod = class_getClassMethod(aClass, classMethodSelector); + if (globalMethod) { + [classesWithClassMethod addObject:aClass]; + } + } + } + + free(classes); + } + + return classesWithClassMethod; +} + +static void runExampleBlock(void (^block)(), NSString *name) { + if (!SPTIsBlock(block)) { + return; + } + + ((SPTVoidBlock)block)(); +} + +typedef NS_ENUM(NSInteger, SPTExampleGroupOrder) { + SPTExampleGroupOrderOutermostFirst = 1, + SPTExampleGroupOrderInnermostFirst +}; + +@interface SPTExampleGroup () + +- (void)incrementExampleCount; +- (void)incrementPendingExampleCount; +- (void)resetRanExampleCountIfNeeded; +- (void)incrementRanExampleCount; +- (void)runBeforeHooks:(NSString *)compiledName; +- (void)runBeforeAllHooks:(NSString *)compiledName; +- (void)runBeforeEachHooks:(NSString *)compiledName; +- (void)runAfterHooks:(NSString *)compiledName; +- (void)runAfterEachHooks:(NSString *)compiledName; +- (void)runAfterAllHooks:(NSString *)compiledName; + +@end + +@implementation SPTExampleGroup + +- (id)init { + self = [super init]; + if (self) { + self.name = nil; + self.root = nil; + self.parent = nil; + self.children = [NSMutableArray array]; + self.beforeAllArray = [NSMutableArray array]; + self.afterAllArray = [NSMutableArray array]; + self.beforeEachArray = [NSMutableArray array]; + self.afterEachArray = [NSMutableArray array]; + self.sharedExamples = [NSMutableDictionary dictionary]; + self.exampleCount = 0; + self.pendingExampleCount = 0; + self.ranExampleCount = 0; + } + return self; +} + +- (id)initWithName:(NSString *)name parent:(SPTExampleGroup *)parent root:(SPTExampleGroup *)root { + self = [self init]; + if (self) { + self.name = name; + self.parent = parent; + self.root = root; + } + return self; +} + +- (SPTExampleGroup *)addExampleGroupWithName:(NSString *)name focused:(BOOL)focused { + SPTExampleGroup *group = [[SPTExampleGroup alloc] initWithName:name parent:self root:self.root]; + group.focused = focused; + [self.children addObject:group]; + return group; +} + +- (SPTExample *)addExampleWithName:(NSString *)name callSite:(SPTCallSite *)callSite focused:(BOOL)focused block:(SPTVoidBlock)block { + SPTExample *example; + @synchronized(self) { + example = [[SPTExample alloc] initWithName:name callSite:callSite focused:focused block:block]; + [self.children addObject:example]; + + [self incrementExampleCount]; + if (example.pending) { + [self incrementPendingExampleCount]; + } + } + return example; +} + +- (void)incrementExampleCount { + SPTExampleGroup *group = self; + while (group != nil) { + group.exampleCount ++; + group = group.parent; + } +} + +- (void)incrementPendingExampleCount { + SPTExampleGroup *group = self; + while (group != nil) { + group.pendingExampleCount ++; + group = group.parent; + } +} + +- (void)resetRanExampleCountIfNeeded { + SPTExampleGroup *group = self; + while (group != nil) { + if (group.ranExampleCount >= group.exampleCount) { + group.ranExampleCount = 0; + } + group = group.parent; + } +} + +- (void)incrementRanExampleCount { + SPTExampleGroup *group = self; + while (group != nil) { + group.ranExampleCount ++; + group = group.parent; + } +} + +- (void)addBeforeAllBlock:(SPTVoidBlock)block { + if (!block) return; + [self.beforeAllArray addObject:[block copy]]; +} + +- (void)addAfterAllBlock:(SPTVoidBlock)block { + if (!block) return; + [self.afterAllArray addObject:[block copy]]; +} + +- (void)addBeforeEachBlock:(SPTVoidBlock)block { + if (!block) return; + [self.beforeEachArray addObject:[block copy]]; +} + +- (void)addAfterEachBlock:(SPTVoidBlock)block { + if (!block) return; + [self.afterEachArray addObject:[block copy]]; +} + +- (void)runGlobalBeforeEachHooks:(NSString *)compiledName { + static NSArray *globalBeforeEachClasses; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + globalBeforeEachClasses = ClassesWithClassMethod(@selector(beforeEach)); + }); + + for (Class class in globalBeforeEachClasses) { + [class beforeEach]; + } +} + +- (void)runGlobalAfterEachHooks:(NSString *)compiledName { + static NSArray *globalAfterEachClasses; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + globalAfterEachClasses = ClassesWithClassMethod(@selector(afterEach)); + }); + + for (Class class in globalAfterEachClasses) { + [class afterEach]; + } +} + +// Builds an array of example groups that enclose the current group. +// When in innermost-first order, the most deeply nested example groups, +// beginning with self, are placed at the beginning of the array. +// When in outermost-first order, the opposite is true, and the last +// group in the array (self) is the most deeply nested. +- (NSArray *)exampleGroupStackInOrder:(SPTExampleGroupOrder)order { + NSMutableArray *groups = [NSMutableArray array]; + SPTExampleGroup *group = self; + while (group != nil) { + switch (order) { + case SPTExampleGroupOrderOutermostFirst: + [groups insertObject:group atIndex:0]; + break; + case SPTExampleGroupOrderInnermostFirst: + [groups addObject:group]; + break; + } + group = group.parent; + } + + return [groups copy]; +} + +- (void)runBeforeHooks:(NSString *)compiledName { + [self runBeforeAllHooks:compiledName]; + [self runBeforeEachHooks:compiledName]; +} + +- (void)runBeforeAllHooks:(NSString *)compiledName { + for(SPTExampleGroup *group in [self exampleGroupStackInOrder:SPTExampleGroupOrderOutermostFirst]) { + if (group.ranExampleCount == 0) { + for (id beforeAllBlock in group.beforeAllArray) { + runExampleBlock(beforeAllBlock, [NSString stringWithFormat:@"%@ - before all block", compiledName]); + } + } + } +} + +- (void)runBeforeEachHooks:(NSString *)compiledName { + [self runGlobalBeforeEachHooks:compiledName]; + for (SPTExampleGroup *group in [self exampleGroupStackInOrder:SPTExampleGroupOrderOutermostFirst]) { + for (id beforeEachBlock in group.beforeEachArray) { + runExampleBlock(beforeEachBlock, [NSString stringWithFormat:@"%@ - before each block", compiledName]); + } + } +} + +- (void)runAfterHooks:(NSString *)compiledName { + [self runAfterEachHooks:compiledName]; + [self runAfterAllHooks:compiledName]; +} + +- (void)runAfterEachHooks:(NSString *)compiledName { + for (SPTExampleGroup *group in [self exampleGroupStackInOrder:SPTExampleGroupOrderInnermostFirst]) { + for (id afterEachBlock in group.afterEachArray) { + runExampleBlock(afterEachBlock, [NSString stringWithFormat:@"%@ - after each block", compiledName]); + } + } + [self runGlobalAfterEachHooks:compiledName]; +} + +- (void)runAfterAllHooks:(NSString *)compiledName { + for (SPTExampleGroup *group in [self exampleGroupStackInOrder:SPTExampleGroupOrderInnermostFirst]) { + if (group.ranExampleCount == group.exampleCount) { + for (id afterAllBlock in group.afterAllArray) { + runExampleBlock(afterAllBlock, [NSString stringWithFormat:@"%@ - after all block", compiledName]); + } + } + } +} + +- (BOOL)isFocusedOrHasFocusedAncestor { + SPTExampleGroup *ancestor = self; + while (ancestor != nil) { + if (ancestor.focused) { + return YES; + } else { + ancestor = ancestor.parent; + } + } + + return NO; +} + +- (NSArray *)compileExamplesWithStack:(NSArray *)stack { + BOOL groupIsFocusedOrHasFocusedAncestor = [self isFocusedOrHasFocusedAncestor]; + + NSArray *compiled = @[]; + + for(id child in self.children) { + if ([child isKindOfClass:[SPTExampleGroup class]]) { + SPTExampleGroup *group = child; + NSArray *newStack = [stack arrayByAddingObject:group]; + compiled = [compiled arrayByAddingObjectsFromArray:[group compileExamplesWithStack:newStack]]; + + } else if ([child isKindOfClass:[SPTExample class]]) { + SPTExample *example = child; + NSArray *newStack = [stack arrayByAddingObject:example]; + + NSString *compiledName = [spt_map(newStack, ^id(id obj, NSUInteger idx) { + return [obj name]; + }) componentsJoinedByString:@" "]; + + NSString *testCaseName = [spt_map(newStack, ^id(id obj, NSUInteger idx) { + return spt_underscorize([obj name]); + }) componentsJoinedByString:@"__"]; + + // If example is pending, run only before- and after-all hooks. + // Otherwise, run the example and all before and after hooks. + SPTSpecBlock compiledBlock = example.pending ? ^(SPTSpec *spec){ + @synchronized(self.root) { + [self resetRanExampleCountIfNeeded]; + [self runBeforeAllHooks:compiledName]; + [self incrementRanExampleCount]; + [self runAfterAllHooks:compiledName]; + } + } : ^(SPTSpec *spec) { + @synchronized(self.root) { + [self resetRanExampleCountIfNeeded]; + [self runBeforeHooks:compiledName]; + } + @try { + runExampleBlock(example.block, compiledName); + } + @catch(NSException *e) { + [spec spt_handleException:e]; + } + @finally { + @synchronized(self.root) { + [self incrementRanExampleCount]; + [self runAfterHooks:compiledName]; + } + } + }; + SPTCompiledExample *compiledExample = [[SPTCompiledExample alloc] initWithName:compiledName testCaseName:testCaseName block:compiledBlock pending:example.pending focused:(groupIsFocusedOrHasFocusedAncestor || example.focused)]; + compiled = [compiled arrayByAddingObject:compiledExample]; + } + } + return compiled; +} + +@end diff --git a/Example/Pods/Specta/Specta/Specta/SPTExcludeGlobalBeforeAfterEach.h b/Example/Pods/Specta/Specta/Specta/SPTExcludeGlobalBeforeAfterEach.h new file mode 100644 index 0000000..9581f0b --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTExcludeGlobalBeforeAfterEach.h @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2015 Specta Team. All rights reserved. + */ +#import + +// This protocol was used for blacklisting classes for global beforeEach and afterEach blocks. +// Now, instead, classes are whitelisted by implementing the SPTGlobalBeforeAfterEach protocol. +__deprecated_msg("Please whitelist classes instead with the SPTGlobalBeforeAfterEach protocol") +@protocol SPTExcludeGlobalBeforeAfterEach +@end diff --git a/Example/Pods/Specta/Specta/Specta/SPTGlobalBeforeAfterEach.h b/Example/Pods/Specta/Specta/Specta/SPTGlobalBeforeAfterEach.h new file mode 100644 index 0000000..490359d --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTGlobalBeforeAfterEach.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2015 Specta Team. All rights reserved. + */ +#import + +// This protocol is used for whitelisting classes for global beforeEach and afterEach blocks. +// If you want a class to participate in those just add this protocol to a category and it will be +// included. +@protocol SPTGlobalBeforeAfterEach + +@optional ++ (void)beforeEach; ++ (void)afterEach; + +@end diff --git a/Example/Pods/Specta/Specta/Specta/SPTSharedExampleGroups.h b/Example/Pods/Specta/Specta/Specta/SPTSharedExampleGroups.h new file mode 100644 index 0000000..090acba --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTSharedExampleGroups.h @@ -0,0 +1,17 @@ +#import +#import +#import + +@class _XCTestCaseImplementation; + +@class SPTExampleGroup; + +@interface SPTSharedExampleGroups : XCTestCase + ++ (void)addSharedExampleGroupWithName:(NSString *)name block:(SPTDictionaryBlock)block exampleGroup:(SPTExampleGroup *)exampleGroup; ++ (SPTDictionaryBlock)sharedExampleGroupWithName:(NSString *)name exampleGroup:(SPTExampleGroup *)exampleGroup; + +- (void)sharedExampleGroups; + +@end + diff --git a/Example/Pods/Specta/Specta/Specta/SPTSharedExampleGroups.m b/Example/Pods/Specta/Specta/Specta/SPTSharedExampleGroups.m new file mode 100644 index 0000000..35b405c --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTSharedExampleGroups.m @@ -0,0 +1,74 @@ +#import "SPTSharedExampleGroups.h" +#import "SPTExampleGroup.h" +#import "SPTSpec.h" +#import "SpectaUtility.h" +#import + +NSMutableDictionary *globalSharedExampleGroups = nil; +BOOL initialized = NO; + +@implementation SPTSharedExampleGroups + ++ (void)initialize { + Class SPTSharedExampleGroupsClass = [SPTSharedExampleGroups class]; + if ([self class] == SPTSharedExampleGroupsClass) { + if (!initialized) { + initialized = YES; + globalSharedExampleGroups = [[NSMutableDictionary alloc] init]; + + Class *classes = NULL; + int numClasses = objc_getClassList(NULL, 0); + + if (numClasses > 0) { + classes = (Class *)malloc(sizeof(Class) * numClasses); + numClasses = objc_getClassList(classes, numClasses); + + Class klass, superClass; + for(uint i = 0; i < numClasses; i++) { + klass = classes[i]; + superClass = class_getSuperclass(klass); + if (superClass == SPTSharedExampleGroupsClass) { + [[[klass alloc] init] sharedExampleGroups]; + } + } + + free(classes); + } + } + } +} + ++ (void)addSharedExampleGroupWithName:(NSString *)name block:(SPTDictionaryBlock)block exampleGroup:(SPTExampleGroup *)exampleGroup { + (exampleGroup == nil ? globalSharedExampleGroups : exampleGroup.sharedExamples)[name] = [block copy]; +} + ++ (SPTDictionaryBlock)sharedExampleGroupWithName:(NSString *)name exampleGroup:(SPTExampleGroup *)exampleGroup { + SPTDictionaryBlock sharedExampleGroup = nil; + while (exampleGroup != nil) { + if ((sharedExampleGroup = exampleGroup.sharedExamples[name])) { + return sharedExampleGroup; + } + exampleGroup = exampleGroup.parent; + } + return globalSharedExampleGroups[name]; +} + +- (void)sharedExampleGroups {} + +- (void)spt_handleException:(NSException *)exception { + [SPTCurrentSpec spt_handleException:exception]; +} + +- (void)recordFailureWithDescription:(NSString *)description inFile:(NSString *)filename atLine:(NSUInteger)lineNumber expected:(BOOL)expected { + [SPTCurrentSpec recordFailureWithDescription:description inFile:filename atLine:lineNumber expected:expected]; +} + +- (void)_recordUnexpectedFailureWithDescription:(NSString *)description exception:(NSException *)exception { + [SPTCurrentSpec _recordUnexpectedFailureWithDescription:description exception:exception]; +} + +- (_XCTestCaseImplementation *)internalImplementation { + return [SPTCurrentSpec internalImplementation]; +} + +@end diff --git a/Example/Pods/Specta/Specta/Specta/SPTSpec.h b/Example/Pods/Specta/Specta/Specta/SPTSpec.h new file mode 100644 index 0000000..ada4ea2 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTSpec.h @@ -0,0 +1,28 @@ +#import +#import + +@class + SPTTestSuite +, SPTCompiledExample +; + +@interface SPTSpec : XCTestCase + +@property (strong) XCTestCaseRun *spt_run; +@property (nonatomic) BOOL spt_pending; +@property (nonatomic) BOOL spt_skipped; + ++ (BOOL)spt_isDisabled; ++ (void)spt_setDisabled:(BOOL)disabled; ++ (BOOL)spt_focusedExamplesExist; ++ (SEL)spt_convertToTestMethod:(SPTCompiledExample *)example; ++ (SPTTestSuite *)spt_testSuite; ++ (void)spt_setCurrentTestSuite; ++ (void)spt_unsetCurrentTestSuite; ++ (void)spt_setCurrentTestSuiteFileName:(NSString *)fileName lineNumber:(NSUInteger)lineNumber; + +- (void)spec; +- (BOOL)spt_shouldRunExample:(SPTCompiledExample *)example; +- (void)spt_runExample:(SPTCompiledExample *)example; + +@end diff --git a/Example/Pods/Specta/Specta/Specta/SPTSpec.m b/Example/Pods/Specta/Specta/Specta/SPTSpec.m new file mode 100644 index 0000000..35ad313 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTSpec.m @@ -0,0 +1,210 @@ +#import "SPTSpec.h" +#import "SPTTestSuite.h" +#import "SPTCompiledExample.h" +#import "SPTSharedExampleGroups.h" +#import "SpectaUtility.h" +#import +#import "XCTest+Private.h" + +@implementation SPTSpec + ++ (void)initialize { + [SPTSharedExampleGroups initialize]; + SPTTestSuite *testSuite = [[SPTTestSuite alloc] init]; + SPTSpec *spec = [[[self class] alloc] init]; + NSString *specName = NSStringFromClass([self class]); + objc_setAssociatedObject(self, "spt_testSuite", testSuite, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + [self spt_setCurrentTestSuite]; + @try { + [spec spec]; + } + @catch (NSException *exception) { + fprintf(stderr, "%s: An exception has occured outside of tests, aborting.\n\n%s (%s) \n", [specName UTF8String], [[exception name] UTF8String], [[exception reason] UTF8String]); + if ([exception respondsToSelector:@selector(callStackSymbols)]) { + NSArray *callStackSymbols = [exception callStackSymbols]; + if (callStackSymbols) { + NSString *callStack = [NSString stringWithFormat:@"\n Call Stack:\n %@\n", [callStackSymbols componentsJoinedByString:@"\n "]]; + fprintf(stderr, "%s", [callStack UTF8String]); + } + } + exit(1); + } + @finally { + [self spt_unsetCurrentTestSuite]; + } + [testSuite compile]; + [[self class] testInvocations]; + [super initialize]; +} + ++ (SPTTestSuite *)spt_testSuite { + return objc_getAssociatedObject(self, "spt_testSuite"); +} + ++ (BOOL)spt_isDisabled { + return [self spt_testSuite].disabled; +} + ++ (void)spt_setDisabled:(BOOL)disabled { + [self spt_testSuite].disabled = disabled; +} + ++ (NSArray *)spt_allSpecClasses { + static NSArray *allSpecClasses = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + + NSMutableArray *specClasses = [[NSMutableArray alloc] init]; + + int numberOfClasses = objc_getClassList(NULL, 0); + if (numberOfClasses > 0) { + Class *classes = (Class *)malloc(sizeof(Class) * numberOfClasses); + numberOfClasses = objc_getClassList(classes, numberOfClasses); + + for (int classIndex = 0; classIndex < numberOfClasses; classIndex++) { + Class aClass = classes[classIndex]; + if (spt_isSpecClass(aClass)) { + [specClasses addObject:aClass]; + } + } + + free(classes); + } + + allSpecClasses = [specClasses copy]; + }); + + return allSpecClasses; +} + ++ (BOOL)spt_focusedExamplesExist { + for (Class specClass in [self spt_allSpecClasses]) { + SPTTestSuite *testSuite = [specClass spt_testSuite]; + if (testSuite.disabled == NO && [testSuite hasFocusedExamples]) { + return YES; + } + } + + return NO; +} + ++ (SEL)spt_convertToTestMethod:(SPTCompiledExample *)example { + @synchronized(example) { + if (!example.testMethodSelector) { + IMP imp = imp_implementationWithBlock(^(SPTSpec *self) { + [self spt_runExample:example]; + }); + + SEL sel; + unsigned int i = 0; + + do { + i++; + if (i == 1) { + sel = NSSelectorFromString([NSString stringWithFormat:@"test_%@", example.testCaseName]); + } else { + sel = NSSelectorFromString([NSString stringWithFormat:@"test_%@_%u", example.testCaseName, i]); + } + } while([self instancesRespondToSelector:sel]); + + class_addMethod(self, sel, imp, "@@:"); + example.testMethodSelector = sel; + } + } + + return example.testMethodSelector; +} + ++ (void)spt_setCurrentTestSuite { + SPTTestSuite *testSuite = [self spt_testSuite]; + [[NSThread currentThread] threadDictionary][spt_kCurrentTestSuiteKey] = testSuite; +} + ++ (void)spt_unsetCurrentTestSuite { + [[[NSThread currentThread] threadDictionary] removeObjectForKey:spt_kCurrentTestSuiteKey]; +} + ++ (void)spt_setCurrentTestSuiteFileName:(NSString *)fileName lineNumber:(NSUInteger)lineNumber { + SPTTestSuite *testSuite = [self spt_testSuite]; + testSuite.fileName = fileName; + testSuite.lineNumber = lineNumber; +} + +- (void)spec {} + +- (BOOL)spt_shouldRunExample:(SPTCompiledExample *)example { + return [[self class] spt_isDisabled] == NO && + (example.focused || [[self class] spt_focusedExamplesExist] == NO); +} + +- (void)spt_runExample:(SPTCompiledExample *)example { + [[NSThread currentThread] threadDictionary][spt_kCurrentSpecKey] = self; + + if ([self spt_shouldRunExample:example]) { + self.spt_pending = example.pending; + example.block(self); + } else if (!example.pending) { + self.spt_skipped = YES; + } + + [[[NSThread currentThread] threadDictionary] removeObjectForKey:spt_kCurrentSpecKey]; +} + +#pragma mark - XCTestCase overrides + ++ (NSArray *)testInvocations { + NSArray *compiledExamples = [self spt_testSuite].compiledExamples; + [NSMutableArray arrayWithCapacity:[compiledExamples count]]; + + NSMutableSet *addedSelectors = [NSMutableSet setWithCapacity:[compiledExamples count]]; + NSMutableArray *selectors = [NSMutableArray arrayWithCapacity:[compiledExamples count]]; + + // dynamically generate test methods with compiled examples + for (SPTCompiledExample *example in compiledExamples) { + SEL sel = [self spt_convertToTestMethod:example]; + NSString *selName = NSStringFromSelector(sel); + [selectors addObject: selName]; + [addedSelectors addObject: selName]; + } + + // look for any other test methods that may be present in class. + unsigned int n; + Method *imethods = class_copyMethodList(self, &n); + + for (NSUInteger i = 0; i < n; i++) { + struct objc_method_description *desc = method_getDescription(imethods[i]); + + char *types = desc->types; + SEL sel = desc->name; + NSString *selName = NSStringFromSelector(sel); + + if (strcmp(types, "@@:") == 0 && [selName hasPrefix:@"test"] && ![addedSelectors containsObject:selName]) { + [selectors addObject:NSStringFromSelector(sel)]; + } + } + + free(imethods); + + // create invocations from test method selectors + NSMutableArray *invocations = [NSMutableArray arrayWithCapacity:[selectors count]]; + for (NSString *selName in selectors) { + SEL sel = NSSelectorFromString(selName); + NSInvocation *inv = [NSInvocation invocationWithMethodSignature:[self instanceMethodSignatureForSelector:sel]]; + [inv setSelector:sel]; + [invocations addObject:inv]; + } + + return spt_shuffle(invocations); +} + +- (void)recordFailureWithDescription:(NSString *)description inFile:(NSString *)filename atLine:(NSUInteger)lineNumber expected:(BOOL)expected { + SPTSpec *currentSpec = SPTCurrentSpec; + [currentSpec.spt_run recordFailureWithDescription:description inFile:filename atLine:lineNumber expected:expected]; +} + +- (void)performTest:(XCTestRun *)run { + self.spt_run = (XCTestCaseRun *)run; + [super performTest:run]; +} + +@end diff --git a/Example/Pods/Specta/Specta/Specta/SPTTestSuite.h b/Example/Pods/Specta/Specta/Specta/SPTTestSuite.h new file mode 100644 index 0000000..9bd9016 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTTestSuite.h @@ -0,0 +1,21 @@ +#import + +@class + SPTExample +, SPTExampleGroup +; + +@interface SPTTestSuite : NSObject + +@property (nonatomic, strong) SPTExampleGroup *rootGroup; +@property (nonatomic, strong) NSMutableArray *groupStack; +@property (nonatomic, strong) NSArray *compiledExamples; +@property (nonatomic, copy) NSString *fileName; +@property (nonatomic) NSUInteger lineNumber; +@property (nonatomic, getter = isDisabled) BOOL disabled; +@property (nonatomic) BOOL hasFocusedExamples; + +- (SPTExampleGroup *)currentGroup; +- (void)compile; + +@end diff --git a/Example/Pods/Specta/Specta/Specta/SPTTestSuite.m b/Example/Pods/Specta/Specta/Specta/SPTTestSuite.m new file mode 100644 index 0000000..7053edd --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SPTTestSuite.m @@ -0,0 +1,31 @@ +#import "SPTTestSuite.h" +#import "SPTExampleGroup.h" +#import "SPTCompiledExample.h" + +@implementation SPTTestSuite + +- (id)init { + self = [super init]; + if (self) { + self.rootGroup = [[SPTExampleGroup alloc] init]; + self.rootGroup.root = self.rootGroup; + self.groupStack = [NSMutableArray arrayWithObject:self.rootGroup]; + } + return self; +} + +- (SPTExampleGroup *)currentGroup { + return [self.groupStack lastObject]; +} + +- (void)compile { + self.compiledExamples = [self.rootGroup compileExamplesWithStack:@[]]; + for (SPTCompiledExample *example in self.compiledExamples) { + if (example.focused) { + self.hasFocusedExamples = YES; + break; + } + } +} + +@end diff --git a/Example/Pods/Specta/Specta/Specta/Specta.h b/Example/Pods/Specta/Specta/Specta/Specta.h new file mode 100644 index 0000000..dda17f9 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/Specta.h @@ -0,0 +1,14 @@ +#import +#import + +//! Project version number for Specta. +FOUNDATION_EXPORT double SpectaVersionNumber; + +//! Project version string for Specta. +FOUNDATION_EXPORT const unsigned char SpectaVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import +#import +#import diff --git a/Example/Pods/Specta/Specta/Specta/SpectaDSL.h b/Example/Pods/Specta/Specta/Specta/SpectaDSL.h new file mode 100644 index 0000000..284d4f5 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SpectaDSL.h @@ -0,0 +1,90 @@ +#import + +#define SpecBegin(name) _SPTSpecBegin(name, __FILE__, __LINE__) +#define SpecEnd _SPTSpecEnd + +#define SharedExamplesBegin(name) _SPTSharedExampleGroupsBegin(name) +#define SharedExamplesEnd _SPTSharedExampleGroupsEnd +#define SharedExampleGroupsBegin(name) _SPTSharedExampleGroupsBegin(name) +#define SharedExampleGroupsEnd _SPTSharedExampleGroupsEnd + +typedef void (^DoneCallback)(void); + +OBJC_EXTERN void describe(NSString *name, void (^block)()); +OBJC_EXTERN void fdescribe(NSString *name, void (^block)()); + +OBJC_EXTERN void context(NSString *name, void (^block)()); +OBJC_EXTERN void fcontext(NSString *name, void (^block)()); + +OBJC_EXTERN void it(NSString *name, void (^block)()); +OBJC_EXTERN void fit(NSString *name, void (^block)()); + +OBJC_EXTERN void example(NSString *name, void (^block)()); +OBJC_EXTERN void fexample(NSString *name, void (^block)()); + +OBJC_EXTERN void specify(NSString *name, void (^block)()); +OBJC_EXTERN void fspecify(NSString *name, void (^block)()); + +#define pending(...) spt_pending_(__VA_ARGS__, nil) +#define xdescribe(...) spt_pending_(__VA_ARGS__, nil) +#define xcontext(...) spt_pending_(__VA_ARGS__, nil) +#define xexample(...) spt_pending_(__VA_ARGS__, nil) +#define xit(...) spt_pending_(__VA_ARGS__, nil) +#define xspecify(...) spt_pending_(__VA_ARGS__, nil) + +OBJC_EXTERN void beforeAll(void (^block)()); +OBJC_EXTERN void afterAll(void (^block)()); + +OBJC_EXTERN void beforeEach(void (^block)()); +OBJC_EXTERN void afterEach(void (^block)()); + +OBJC_EXTERN void before(void (^block)()); +OBJC_EXTERN void after(void (^block)()); + +OBJC_EXTERN void sharedExamplesFor(NSString *name, void (^block)(NSDictionary *data)); +OBJC_EXTERN void sharedExamples(NSString *name, void (^block)(NSDictionary *data)); + +#define itShouldBehaveLike(...) spt_itShouldBehaveLike_(@(__FILE__), __LINE__, __VA_ARGS__) +#define itBehavesLike(...) spt_itShouldBehaveLike_(@(__FILE__), __LINE__, __VA_ARGS__) + +OBJC_EXTERN void waitUntil(void (^block)(DoneCallback done)); +/** + * Runs the @c block and waits until the @c done block is called or the + * @c timeout has passed. + * + * @param timeout timeout for this @c block only; does not affect the global + * timeout, as @c setAsyncSpecTimeout() does. + * @param ^block runs test code + */ +OBJC_EXTERN void waitUntilTimeout(NSTimeInterval timeout, void (^block)(DoneCallback done)); + +OBJC_EXTERN void setAsyncSpecTimeout(NSTimeInterval timeout); + +// ---------------------------------------------------------------------------- + +#define _SPTSpecBegin(name, file, line) \ +@interface name##Spec : SPTSpec \ +@end \ +@implementation name##Spec \ +- (void)spec { \ + [[self class] spt_setCurrentTestSuiteFileName:(@(file)) lineNumber:(line)]; + +#define _SPTSpecEnd \ +} \ +@end + +#define _SPTSharedExampleGroupsBegin(name) \ +@interface name##SharedExampleGroups : SPTSharedExampleGroups \ +@end \ +@implementation name##SharedExampleGroups \ +- (void)sharedExampleGroups { + +#define _SPTSharedExampleGroupsEnd \ +} \ +@end + +OBJC_EXTERN void spt_it_(NSString *name, NSString *fileName, NSUInteger lineNumber, void (^block)()); +OBJC_EXTERN void spt_fit_(NSString *name, NSString *fileName, NSUInteger lineNumber, void (^block)()); +OBJC_EXTERN void spt_pending_(NSString *name, ...); +OBJC_EXTERN void spt_itShouldBehaveLike_(NSString *fileName, NSUInteger lineNumber, NSString *name, id dictionaryOrBlock); +OBJC_EXTERN void spt_itShouldBehaveLike_block(NSString *fileName, NSUInteger lineNumber, NSString *name, NSDictionary *(^block)()); diff --git a/Example/Pods/Specta/Specta/Specta/SpectaDSL.m b/Example/Pods/Specta/Specta/Specta/SpectaDSL.m new file mode 100644 index 0000000..10edcd5 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SpectaDSL.m @@ -0,0 +1,189 @@ +#import "SpectaDSL.h" +#import "SpectaTypes.h" +#import "SpectaUtility.h" +#import "SPTTestSuite.h" +#import "SPTExampleGroup.h" +#import "SPTSharedExampleGroups.h" +#import "SPTSpec.h" +#import "SPTCallSite.h" +#import + +static NSTimeInterval asyncSpecTimeout = 10.0; + +static void spt_defineItBlock(NSString *name, NSString *fileName, NSUInteger lineNumber, BOOL focused, void (^block)()) { + SPTReturnUnlessBlockOrNil(block); + SPTCallSite *site = nil; + if (lineNumber && fileName) { + site = [SPTCallSite callSiteWithFile:fileName line:lineNumber]; + } + [SPTCurrentGroup addExampleWithName:name callSite:site focused:focused block:block]; +} + +static void spt_defineDescribeBlock(NSString *name, BOOL focused, void (^block)()) { + if (block) { + [SPTGroupStack addObject:[SPTCurrentGroup addExampleGroupWithName:name focused:focused]]; + block(); + [SPTGroupStack removeLastObject]; + } else { + spt_defineItBlock(name, nil, 0, focused, nil); + } +} + +void spt_it_(NSString *name, NSString *fileName, NSUInteger lineNumber, void (^block)()) { + spt_defineItBlock(name, fileName, lineNumber, NO, block); +} + +void spt_fit_(NSString *name, NSString *fileName, NSUInteger lineNumber, void (^block)()) { + spt_defineItBlock(name, fileName, lineNumber, YES, block); +} + +void spt_pending_(NSString *name, ...) { + spt_defineItBlock(name, nil, 0, NO, nil); +} + +void spt_itShouldBehaveLike_(NSString *fileName, NSUInteger lineNumber, NSString *name, id dictionaryOrBlock) { + SPTDictionaryBlock block = [SPTSharedExampleGroups sharedExampleGroupWithName:name exampleGroup:SPTCurrentGroup]; + if (block) { + if (SPTIsBlock(dictionaryOrBlock)) { + id (^dataBlock)(void) = [dictionaryOrBlock copy]; + + describe(name, ^{ + __block NSMutableDictionary *dataDict = [[NSMutableDictionary alloc] init]; + + beforeEach(^{ + NSDictionary *blockData = dataBlock(); + [dataDict removeAllObjects]; + [dataDict addEntriesFromDictionary:blockData]; + }); + + block(dataDict); + + afterAll(^{ + dataDict = nil; + }); + }); + } else { + NSDictionary *data = dictionaryOrBlock; + + describe(name, ^{ + block(data); + }); + } + } else { + SPTSpec *currentSpec = SPTCurrentSpec; + if (currentSpec) { + [currentSpec recordFailureWithDescription:@"itShouldBehaveLike should not be invoked inside an example block!" inFile:fileName atLine:lineNumber expected:NO]; + } else { + it(name, ^{ + [SPTCurrentSpec recordFailureWithDescription:[NSString stringWithFormat:@"Shared example group \"%@\" does not exist.", name] inFile:fileName atLine:lineNumber expected:NO]; + }); + } + } +} + +void spt_itShouldBehaveLike_block(NSString *fileName, NSUInteger lineNumber, NSString *name, NSDictionary *(^block)()) { + spt_itShouldBehaveLike_(fileName, lineNumber, name, (id)block); +} + +void describe(NSString *name, void (^block)()) { + spt_defineDescribeBlock(name, NO, block); +} + +void fdescribe(NSString *name, void (^block)()) { + spt_defineDescribeBlock(name, YES, block); +} + +void context(NSString *name, void (^block)()) { + describe(name, block); +} + +void fcontext(NSString *name, void (^block)()) { + fdescribe(name, block); +} + +void it(NSString *name, void (^block)()) { + spt_defineItBlock(name, nil, 0, NO, block); +} + +void fit(NSString *name, void (^block)()) { + spt_defineItBlock(name, nil, 0, YES, block); +} + +void example(NSString *name, void (^block)()) { + it(name, block); +} + +void fexample(NSString *name, void (^block)()) { + fit(name, block); +} + +void specify(NSString *name, void (^block)()) { + it(name, block); +} + +void fspecify(NSString *name, void (^block)()) { + fit(name, block); +} + +void beforeAll(void (^block)()) { + SPTReturnUnlessBlockOrNil(block); + [SPTCurrentGroup addBeforeAllBlock:block]; +} + +void afterAll(void (^block)()) { + SPTReturnUnlessBlockOrNil(block); + [SPTCurrentGroup addAfterAllBlock:block]; +} + +void beforeEach(void (^block)()) { + SPTReturnUnlessBlockOrNil(block); + [SPTCurrentGroup addBeforeEachBlock:block]; +} + +void afterEach(void (^block)()) { + SPTReturnUnlessBlockOrNil(block); + [SPTCurrentGroup addAfterEachBlock:block]; +} + +void before(void (^block)()) { + beforeEach(block); +} + +void after(void (^block)()) { + afterEach(block); +} + +void sharedExamplesFor(NSString *name, void (^block)(NSDictionary *data)) { + [SPTSharedExampleGroups addSharedExampleGroupWithName:name block:block exampleGroup:SPTCurrentGroup]; +} + +void sharedExamples(NSString *name, void (^block)(NSDictionary *data)) { + sharedExamplesFor(name, block); +} + +void waitUntil(void (^block)(DoneCallback done)) { + waitUntilTimeout(asyncSpecTimeout, block); +} + +void waitUntilTimeout(NSTimeInterval timeout, void (^block)(DoneCallback done)) { + __block uint32_t complete = 0; + dispatch_async(dispatch_get_main_queue(), ^{ + block(^{ + OSAtomicOr32Barrier(1, &complete); + }); + }); + NSDate *timeoutDate = [NSDate dateWithTimeIntervalSinceNow:timeout]; + while (!complete && [timeoutDate timeIntervalSinceNow] > 0) { + [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.01]]; + } + if (!complete) { + NSString *message = [NSString stringWithFormat:@"failed to invoke done() callback before timeout (%f seconds)", timeout]; + SPTSpec *currentSpec = SPTCurrentSpec; + SPTTestSuite *testSuite = [[currentSpec class] spt_testSuite]; + [currentSpec recordFailureWithDescription:message inFile:testSuite.fileName atLine:testSuite.lineNumber expected:YES]; + } +} + +void setAsyncSpecTimeout(NSTimeInterval timeout) { + asyncSpecTimeout = timeout; +} diff --git a/Example/Pods/Specta/Specta/Specta/SpectaTypes.h b/Example/Pods/Specta/Specta/Specta/SpectaTypes.h new file mode 100644 index 0000000..f1f0ae3 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SpectaTypes.h @@ -0,0 +1,5 @@ +@class SPTSpec; + +typedef void (^SPTVoidBlock)(); +typedef void (^SPTSpecBlock)(SPTSpec *spec); +typedef void (^SPTDictionaryBlock)(NSDictionary *dictionary); diff --git a/Example/Pods/Specta/Specta/Specta/SpectaUtility.h b/Example/Pods/Specta/Specta/Specta/SpectaUtility.h new file mode 100644 index 0000000..a3a8f07 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SpectaUtility.h @@ -0,0 +1,18 @@ +#import + +extern NSString * const spt_kCurrentTestSuiteKey; +extern NSString * const spt_kCurrentSpecKey; + +#define SPTCurrentTestSuite [[NSThread mainThread] threadDictionary][spt_kCurrentTestSuiteKey] +#define SPTCurrentSpec [[NSThread mainThread] threadDictionary][spt_kCurrentSpecKey] +#define SPTCurrentGroup [SPTCurrentTestSuite currentGroup] +#define SPTGroupStack [SPTCurrentTestSuite groupStack] + +#define SPTReturnUnlessBlockOrNil(block) if ((block) && !SPTIsBlock((block))) return; +#define SPTIsBlock(obj) [(obj) isKindOfClass:NSClassFromString(@"NSBlock")] + +BOOL spt_isSpecClass(Class aClass); +NSString *spt_underscorize(NSString *string); +NSArray *spt_map(NSArray *array, id (^block)(id obj, NSUInteger idx)); +NSArray *spt_shuffle(NSArray *array); +unsigned int spt_seed(); diff --git a/Example/Pods/Specta/Specta/Specta/SpectaUtility.m b/Example/Pods/Specta/Specta/Specta/SpectaUtility.m new file mode 100644 index 0000000..9b2ee80 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/SpectaUtility.m @@ -0,0 +1,79 @@ +#import "SpectaUtility.h" +#import "SPTSpec.h" +#import + +NSString * const spt_kCurrentTestSuiteKey = @"SPTCurrentTestSuite"; +NSString * const spt_kCurrentSpecKey = @"SPTCurrentSpec"; + +static unsigned int seed = 0; + +BOOL spt_isSpecClass(Class aClass) { + Class superclass = class_getSuperclass(aClass); + while (superclass != Nil) { + if (superclass == [SPTSpec class]) { + return YES; + } else { + superclass = class_getSuperclass(superclass); + } + } + return NO; +} + +NSString *spt_underscorize(NSString *string) { + static NSMutableCharacterSet *invalidCharSet; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + invalidCharSet = [[NSMutableCharacterSet alloc] init]; + [invalidCharSet formUnionWithCharacterSet:[NSCharacterSet controlCharacterSet]]; + [invalidCharSet formUnionWithCharacterSet:[NSCharacterSet illegalCharacterSet]]; + [invalidCharSet formUnionWithCharacterSet:[NSCharacterSet newlineCharacterSet]]; + [invalidCharSet formUnionWithCharacterSet:[NSCharacterSet nonBaseCharacterSet]]; + [invalidCharSet formUnionWithCharacterSet:[NSCharacterSet punctuationCharacterSet]]; + [invalidCharSet formUnionWithCharacterSet:[NSCharacterSet symbolCharacterSet]]; + }); + NSString *stripped = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + stripped = [[stripped componentsSeparatedByCharactersInSet:invalidCharSet] componentsJoinedByString:@""]; + + NSArray *components = [stripped componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + stripped = [[components objectsAtIndexes:[components indexesOfObjectsPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) { + return ![obj isEqualToString:@""]; + }]] componentsJoinedByString:@"_"]; + return stripped; +} + +NSArray *spt_map(NSArray *array, id (^block)(id obj, NSUInteger idx)) { + NSMutableArray *mapped = [NSMutableArray arrayWithCapacity:[array count]]; + [array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + [mapped addObject:block(obj, idx)]; + }]; + return mapped; +} + +NSArray *spt_shuffle(NSArray *array) { + if (![[[[NSProcessInfo processInfo] environment] objectForKey:@"SPECTA_SHUFFLE"] isEqualToString:@"1"]) { + return array; + } + spt_seed(); + NSMutableArray *shuffled = [array mutableCopy]; + NSUInteger count = [shuffled count]; + for (NSUInteger i = 0; i < count; i++) { + NSUInteger r = random() % count; + [shuffled exchangeObjectAtIndex:i withObjectAtIndex:r]; + } + return shuffled; +} + +unsigned int spt_seed() { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + NSString *envSeed = [[[NSProcessInfo processInfo] environment] objectForKey:@"SPECTA_SEED"]; + if (envSeed) { + sscanf([envSeed UTF8String], "%u", &seed); + } else { + seed = arc4random(); + } + srandom(seed); + printf("Test Seed: %u\n", seed); + }); + return seed; +} diff --git a/Example/Pods/Specta/Specta/Specta/XCTest+Private.h b/Example/Pods/Specta/Specta/Specta/XCTest+Private.h new file mode 100644 index 0000000..c88fcc9 --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/XCTest+Private.h @@ -0,0 +1,41 @@ +#import + +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90000 || __MAC_OS_X_VERSION_MAX_ALLOWED >= 101100 + +@interface XCTestObservationCenter (SPTTestSuspention) + +- (void)_suspendObservationForBlock:(void (^)(void))block; + +@end + +#else + +@interface XCTestObservationCenter : NSObject + ++ (id)sharedObservationCenter; +- (void)_suspendObservationForBlock:(void (^)(void))block; + +@end + +@protocol XCTestObservation +@end + + +#endif + +@interface _XCTestDriverTestObserver : NSObject + +- (void)stopObserving; +- (void)startObserving; + +@end + +@interface _XCTestCaseImplementation : NSObject +@end + +@interface XCTestCase () + +- (_XCTestCaseImplementation *)internalImplementation; +- (void)_recordUnexpectedFailureWithDescription:(NSString *)description exception:(NSException *)exception; + +@end diff --git a/Example/Pods/Specta/Specta/Specta/XCTestCase+Specta.h b/Example/Pods/Specta/Specta/Specta/XCTestCase+Specta.h new file mode 100644 index 0000000..9ca8f8a --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/XCTestCase+Specta.h @@ -0,0 +1,7 @@ +#import + +@interface XCTestCase (Specta) + +- (void)spt_handleException:(NSException *)exception; + +@end diff --git a/Example/Pods/Specta/Specta/Specta/XCTestCase+Specta.m b/Example/Pods/Specta/Specta/Specta/XCTestCase+Specta.m new file mode 100644 index 0000000..4c503ee --- /dev/null +++ b/Example/Pods/Specta/Specta/Specta/XCTestCase+Specta.m @@ -0,0 +1,65 @@ +#import +#import "XCTestCase+Specta.h" +#import "SPTSpec.h" +#import "SPTExample.h" +#import "SPTSharedExampleGroups.h" +#import "SpectaUtility.h" +#import "XCTest+Private.h" + +@interface XCTestCase (xct_allSubclasses) + +- (NSArray *)allSubclasses; +- (void)_dequeueFailures; + +@end + +@implementation XCTestCase (Specta) + ++ (void)load { + Method allSubclasses = class_getClassMethod(self, @selector(allSubclasses)); + Method allSubclasses_swizzle = class_getClassMethod(self , @selector(spt_allSubclasses_swizzle)); + method_exchangeImplementations(allSubclasses, allSubclasses_swizzle); + + Method dequeueFailures = class_getInstanceMethod(self, @selector(_dequeueFailures)); + Method dequeueFailures_swizzle = class_getInstanceMethod(self, @selector(spt_dequeueFailures)); + method_exchangeImplementations(dequeueFailures, dequeueFailures_swizzle); +} + ++ (NSArray *)spt_allSubclasses_swizzle { + NSArray *subclasses = [self spt_allSubclasses_swizzle]; // call original + NSMutableArray *filtered = [NSMutableArray arrayWithCapacity:[subclasses count]]; + // exclude SPTSpec base class and all subclasses of SPTSharedExampleGroups + for (id subclass in subclasses) { + if (subclass != [SPTSpec class] && ![subclass isKindOfClass:[SPTSharedExampleGroups class]]) { + [filtered addObject:subclass]; + } + } + return spt_shuffle(filtered); +} + +- (void)spt_dequeueFailures { + void(^dequeueFailures)() = ^() { + [self spt_dequeueFailures]; + }; + + if ([NSThread isMainThread]) { + dequeueFailures(); + } else { + dispatch_sync(dispatch_get_main_queue(), dequeueFailures); + } +} + +- (void)spt_handleException:(NSException *)exception { + NSString *description = [exception reason]; + if ([exception userInfo]) { + id line = [exception userInfo][@"line"]; + id file = [exception userInfo][@"file"]; + if ([line isKindOfClass:[NSNumber class]] && [file isKindOfClass:[NSString class]]) { + [self recordFailureWithDescription:description inFile:file atLine:[line unsignedIntegerValue] expected:YES]; + return; + } + } + [self _recordUnexpectedFailureWithDescription:description exception:exception]; +} + +@end diff --git a/Example/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m b/Example/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m new file mode 100644 index 0000000..6a29cf8 --- /dev/null +++ b/Example/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_AFNetworking : NSObject +@end +@implementation PodsDummy_AFNetworking +@end diff --git a/Example/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch b/Example/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch new file mode 100644 index 0000000..b52cf0d --- /dev/null +++ b/Example/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch @@ -0,0 +1,15 @@ +#ifdef __OBJC__ +#import +#endif + +#ifndef TARGET_OS_IOS + #define TARGET_OS_IOS TARGET_OS_IPHONE +#endif + +#ifndef TARGET_OS_WATCH + #define TARGET_OS_WATCH 0 +#endif + +#ifndef TARGET_OS_TV + #define TARGET_OS_TV 0 +#endif diff --git a/Example/Pods/Target Support Files/AFNetworking/AFNetworking-umbrella.h b/Example/Pods/Target Support Files/AFNetworking/AFNetworking-umbrella.h new file mode 100644 index 0000000..a0f6f34 --- /dev/null +++ b/Example/Pods/Target Support Files/AFNetworking/AFNetworking-umbrella.h @@ -0,0 +1,24 @@ +#import + +#import "AFNetworking.h" +#import "AFHTTPSessionManager.h" +#import "AFURLSessionManager.h" +#import "AFNetworkReachabilityManager.h" +#import "AFSecurityPolicy.h" +#import "AFURLRequestSerialization.h" +#import "AFURLResponseSerialization.h" +#import "AFAutoPurgingImageCache.h" +#import "AFImageDownloader.h" +#import "AFNetworkActivityIndicatorManager.h" +#import "UIActivityIndicatorView+AFNetworking.h" +#import "UIButton+AFNetworking.h" +#import "UIImage+AFNetworking.h" +#import "UIImageView+AFNetworking.h" +#import "UIKit+AFNetworking.h" +#import "UIProgressView+AFNetworking.h" +#import "UIRefreshControl+AFNetworking.h" +#import "UIWebView+AFNetworking.h" + +FOUNDATION_EXPORT double AFNetworkingVersionNumber; +FOUNDATION_EXPORT const unsigned char AFNetworkingVersionString[]; + diff --git a/Example/Pods/Target Support Files/AFNetworking/AFNetworking.modulemap b/Example/Pods/Target Support Files/AFNetworking/AFNetworking.modulemap new file mode 100644 index 0000000..5892cd3 --- /dev/null +++ b/Example/Pods/Target Support Files/AFNetworking/AFNetworking.modulemap @@ -0,0 +1,6 @@ +framework module AFNetworking { + umbrella header "AFNetworking-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig b/Example/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig new file mode 100644 index 0000000..66a01fd --- /dev/null +++ b/Example/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig @@ -0,0 +1,6 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" +PODS_ROOT = ${SRCROOT} +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Example/Pods/Target Support Files/AFNetworking/Info.plist b/Example/Pods/Target Support Files/AFNetworking/Info.plist new file mode 100644 index 0000000..799692d --- /dev/null +++ b/Example/Pods/Target Support Files/AFNetworking/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 3.0.4 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots-dummy.m b/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots-dummy.m new file mode 100644 index 0000000..a28cba4 --- /dev/null +++ b/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Expecta_Snapshots : NSObject +@end +@implementation PodsDummy_Expecta_Snapshots +@end diff --git a/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots-prefix.pch b/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots-umbrella.h b/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots-umbrella.h new file mode 100644 index 0000000..f065e56 --- /dev/null +++ b/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots-umbrella.h @@ -0,0 +1,8 @@ +#import + +#import "ExpectaObject+FBSnapshotTest.h" +#import "EXPMatchers+FBSnapshotTest.h" + +FOUNDATION_EXPORT double Expecta_SnapshotsVersionNumber; +FOUNDATION_EXPORT const unsigned char Expecta_SnapshotsVersionString[]; + diff --git a/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots.modulemap b/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots.modulemap new file mode 100644 index 0000000..15f364a --- /dev/null +++ b/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots.modulemap @@ -0,0 +1,6 @@ +framework module Expecta_Snapshots { + umbrella header "Expecta+Snapshots-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots.xcconfig b/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots.xcconfig new file mode 100644 index 0000000..86db3e6 --- /dev/null +++ b/Example/Pods/Target Support Files/Expecta+Snapshots/Expecta+Snapshots.xcconfig @@ -0,0 +1,7 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "Foundation" -framework "XCTest" +PODS_ROOT = ${SRCROOT} +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Example/Pods/Target Support Files/Expecta+Snapshots/Info.plist b/Example/Pods/Target Support Files/Expecta+Snapshots/Info.plist new file mode 100644 index 0000000..0a12077 --- /dev/null +++ b/Example/Pods/Target Support Files/Expecta+Snapshots/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 2.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Expecta/Expecta-dummy.m b/Example/Pods/Target Support Files/Expecta/Expecta-dummy.m new file mode 100644 index 0000000..c4c252a --- /dev/null +++ b/Example/Pods/Target Support Files/Expecta/Expecta-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Expecta : NSObject +@end +@implementation PodsDummy_Expecta +@end diff --git a/Example/Pods/Target Support Files/Expecta/Expecta-prefix.pch b/Example/Pods/Target Support Files/Expecta/Expecta-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/Example/Pods/Target Support Files/Expecta/Expecta-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/Example/Pods/Target Support Files/Expecta/Expecta-umbrella.h b/Example/Pods/Target Support Files/Expecta/Expecta-umbrella.h new file mode 100644 index 0000000..79e1308 --- /dev/null +++ b/Example/Pods/Target Support Files/Expecta/Expecta-umbrella.h @@ -0,0 +1,45 @@ +#import + +#import "EXPBlockDefinedMatcher.h" +#import "EXPDefines.h" +#import "EXPDoubleTuple.h" +#import "Expecta.h" +#import "ExpectaObject.h" +#import "ExpectaSupport.h" +#import "EXPExpect.h" +#import "EXPFloatTuple.h" +#import "EXPMatcher.h" +#import "EXPUnsupportedObject.h" +#import "EXPMatcherHelpers.h" +#import "EXPMatchers+beCloseTo.h" +#import "EXPMatchers+beFalsy.h" +#import "EXPMatchers+beginWith.h" +#import "EXPMatchers+beGreaterThan.h" +#import "EXPMatchers+beGreaterThanOrEqualTo.h" +#import "EXPMatchers+beIdenticalTo.h" +#import "EXPMatchers+beInstanceOf.h" +#import "EXPMatchers+beInTheRangeOf.h" +#import "EXPMatchers+beKindOf.h" +#import "EXPMatchers+beLessThan.h" +#import "EXPMatchers+beLessThanOrEqualTo.h" +#import "EXPMatchers+beNil.h" +#import "EXPMatchers+beSubclassOf.h" +#import "EXPMatchers+beSupersetOf.h" +#import "EXPMatchers+beTruthy.h" +#import "EXPMatchers+conformTo.h" +#import "EXPMatchers+contain.h" +#import "EXPMatchers+endWith.h" +#import "EXPMatchers+equal.h" +#import "EXPMatchers+haveCountOf.h" +#import "EXPMatchers+match.h" +#import "EXPMatchers+postNotification.h" +#import "EXPMatchers+raise.h" +#import "EXPMatchers+raiseWithReason.h" +#import "EXPMatchers+respondTo.h" +#import "EXPMatchers.h" +#import "NSObject+Expecta.h" +#import "NSValue+Expecta.h" + +FOUNDATION_EXPORT double ExpectaVersionNumber; +FOUNDATION_EXPORT const unsigned char ExpectaVersionString[]; + diff --git a/Example/Pods/Target Support Files/Expecta/Expecta.modulemap b/Example/Pods/Target Support Files/Expecta/Expecta.modulemap new file mode 100644 index 0000000..e06f902 --- /dev/null +++ b/Example/Pods/Target Support Files/Expecta/Expecta.modulemap @@ -0,0 +1,6 @@ +framework module Expecta { + umbrella header "Expecta-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/Expecta/Expecta.xcconfig b/Example/Pods/Target Support Files/Expecta/Expecta.xcconfig new file mode 100644 index 0000000..bd75300 --- /dev/null +++ b/Example/Pods/Target Support Files/Expecta/Expecta.xcconfig @@ -0,0 +1,8 @@ +ENABLE_BITCODE = NO +FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "Foundation" -framework "XCTest" +PODS_ROOT = ${SRCROOT} +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Example/Pods/Target Support Files/Expecta/Info.plist b/Example/Pods/Target Support Files/Expecta/Info.plist new file mode 100644 index 0000000..a5730fa --- /dev/null +++ b/Example/Pods/Target Support Files/Expecta/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.5 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-dummy.m b/Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-dummy.m new file mode 100644 index 0000000..fb0c8fe --- /dev/null +++ b/Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_FBSnapshotTestCase : NSObject +@end +@implementation PodsDummy_FBSnapshotTestCase +@end diff --git a/Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-prefix.pch b/Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase.modulemap b/Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase.modulemap new file mode 100644 index 0000000..733e78b --- /dev/null +++ b/Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase.modulemap @@ -0,0 +1,15 @@ +framework module FBSnapshotTestCase { + umbrella header "FBSnapshotTestCase.h" + + export * + module * { export * } + + header "FBSnapshotTestCase.h" + header "FBSnapshotTestCasePlatform.h" + header "FBSnapshotTestController.h" + + private header "UIImage+Compare.h" + private header "UIImage+Diff.h" + private header "UIImage+Snapshot.h" +} + diff --git a/Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase.xcconfig b/Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase.xcconfig new file mode 100644 index 0000000..08f0943 --- /dev/null +++ b/Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase.xcconfig @@ -0,0 +1,9 @@ +ENABLE_BITCODE = NO +FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "Foundation" -framework "QuartzCore" -framework "UIKit" -framework "XCTest" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_ROOT = ${SRCROOT} +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Example/Pods/Target Support Files/FBSnapshotTestCase/Info.plist b/Example/Pods/Target Support Files/FBSnapshotTestCase/Info.plist new file mode 100644 index 0000000..4fcad82 --- /dev/null +++ b/Example/Pods/Target Support Files/FBSnapshotTestCase/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 2.0.7 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/NSDate_Utils/Info.plist b/Example/Pods/Target Support Files/NSDate_Utils/Info.plist new file mode 100644 index 0000000..161a9d3 --- /dev/null +++ b/Example/Pods/Target Support Files/NSDate_Utils/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.1.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils-dummy.m b/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils-dummy.m new file mode 100644 index 0000000..289c4c1 --- /dev/null +++ b/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_NSDate_Utils : NSObject +@end +@implementation PodsDummy_NSDate_Utils +@end diff --git a/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils-prefix.pch b/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils-umbrella.h b/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils-umbrella.h new file mode 100644 index 0000000..f6a8ab0 --- /dev/null +++ b/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils-umbrella.h @@ -0,0 +1,7 @@ +#import + +#import "NSDate+NSDate_Util.h" + +FOUNDATION_EXPORT double NSDate_UtilsVersionNumber; +FOUNDATION_EXPORT const unsigned char NSDate_UtilsVersionString[]; + diff --git a/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils.modulemap b/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils.modulemap new file mode 100644 index 0000000..c00b863 --- /dev/null +++ b/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils.modulemap @@ -0,0 +1,6 @@ +framework module NSDate_Utils { + umbrella header "NSDate_Utils-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils.xcconfig b/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils.xcconfig new file mode 100644 index 0000000..5b4e8a0 --- /dev/null +++ b/Example/Pods/Target Support Files/NSDate_Utils/NSDate_Utils.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +PODS_ROOT = ${SRCROOT} +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Example/Pods/Target Support Files/NSDate_Utils/ResourceBundle-NSDate_Utils-Info.plist b/Example/Pods/Target Support Files/NSDate_Utils/ResourceBundle-NSDate_Utils-Info.plist new file mode 100644 index 0000000..161a9d3 --- /dev/null +++ b/Example/Pods/Target Support Files/NSDate_Utils/ResourceBundle-NSDate_Utils-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.1.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/PEAR-FileManager-iOS/Info.plist b/Example/Pods/Target Support Files/PEAR-FileManager-iOS/Info.plist new file mode 100644 index 0000000..10f280e --- /dev/null +++ b/Example/Pods/Target Support Files/PEAR-FileManager-iOS/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.3.1 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS-dummy.m b/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS-dummy.m new file mode 100644 index 0000000..c94220d --- /dev/null +++ b/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_PEAR_FileManager_iOS : NSObject +@end +@implementation PodsDummy_PEAR_FileManager_iOS +@end diff --git a/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS-prefix.pch b/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS-umbrella.h b/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS-umbrella.h new file mode 100644 index 0000000..266ea91 --- /dev/null +++ b/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS-umbrella.h @@ -0,0 +1,7 @@ +#import + +#import "PEARFileManager.h" + +FOUNDATION_EXPORT double PEAR_FileManager_iOSVersionNumber; +FOUNDATION_EXPORT const unsigned char PEAR_FileManager_iOSVersionString[]; + diff --git a/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS.modulemap b/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS.modulemap new file mode 100644 index 0000000..b4e40f9 --- /dev/null +++ b/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS.modulemap @@ -0,0 +1,6 @@ +framework module PEAR_FileManager_iOS { + umbrella header "PEAR-FileManager-iOS-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS.xcconfig b/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS.xcconfig new file mode 100644 index 0000000..5b4e8a0 --- /dev/null +++ b/Example/Pods/Target Support Files/PEAR-FileManager-iOS/PEAR-FileManager-iOS.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +PODS_ROOT = ${SRCROOT} +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Example/Pods/Target Support Files/PNObject/Info.plist b/Example/Pods/Target Support Files/PNObject/Info.plist new file mode 100644 index 0000000..161a9d3 --- /dev/null +++ b/Example/Pods/Target Support Files/PNObject/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.1.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/PNObject/PNObject-dummy.m b/Example/Pods/Target Support Files/PNObject/PNObject-dummy.m new file mode 100644 index 0000000..62c7439 --- /dev/null +++ b/Example/Pods/Target Support Files/PNObject/PNObject-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_PNObject : NSObject +@end +@implementation PodsDummy_PNObject +@end diff --git a/Example/Pods/Target Support Files/PNObject/PNObject-prefix.pch b/Example/Pods/Target Support Files/PNObject/PNObject-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/Example/Pods/Target Support Files/PNObject/PNObject-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/Example/Pods/Target Support Files/PNObject/PNObject-umbrella.h b/Example/Pods/Target Support Files/PNObject/PNObject-umbrella.h new file mode 100644 index 0000000..10a920a --- /dev/null +++ b/Example/Pods/Target Support Files/PNObject/PNObject-umbrella.h @@ -0,0 +1,8 @@ +#import + +#import "PNObject.h" +#import "PNObjectProperty.h" + +FOUNDATION_EXPORT double PNObjectVersionNumber; +FOUNDATION_EXPORT const unsigned char PNObjectVersionString[]; + diff --git a/Example/Pods/Target Support Files/PNObject/PNObject.modulemap b/Example/Pods/Target Support Files/PNObject/PNObject.modulemap new file mode 100644 index 0000000..5b9e67c --- /dev/null +++ b/Example/Pods/Target Support Files/PNObject/PNObject.modulemap @@ -0,0 +1,6 @@ +framework module PNObject { + umbrella header "PNObject-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/PNObject/PNObject.xcconfig b/Example/Pods/Target Support Files/PNObject/PNObject.xcconfig new file mode 100644 index 0000000..5b4e8a0 --- /dev/null +++ b/Example/Pods/Target Support Files/PNObject/PNObject.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +PODS_ROOT = ${SRCROOT} +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Example/Pods/Target Support Files/PNObject/ResourceBundle-PNObject-Info.plist b/Example/Pods/Target Support Files/PNObject/ResourceBundle-PNObject-Info.plist new file mode 100644 index 0000000..161a9d3 --- /dev/null +++ b/Example/Pods/Target Support Files/PNObject/ResourceBundle-PNObject-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.1.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Example/Info.plist b/Example/Pods/Target Support Files/Pods-PNObject_Example/Info.plist new file mode 100644 index 0000000..2243fe6 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Example/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-acknowledgements.markdown b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-acknowledgements.markdown new file mode 100644 index 0000000..c11433a --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-acknowledgements.markdown @@ -0,0 +1,119 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## AFNetworking + +Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) + +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. + + +## NSDate_Utils + +Copyright (c) 2015 Giuseppe Nucifora + +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. + + +## PEAR-FileManager-iOS + +Copyright (c) <2015> Hiroki Umatani PEAR + + +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. + + +## PNObject + +Copyright (c) 2015 Giuseppe Nucifora + +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. + + +## UIDevice-Utils + +Copyright (c) 2015 Giuseppe Nucifora + +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. + +Generated by CocoaPods - https://cocoapods.org diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-acknowledgements.plist b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-acknowledgements.plist new file mode 100644 index 0000000..736a3c5 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-acknowledgements.plist @@ -0,0 +1,165 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) + +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. + + Title + AFNetworking + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2015 Giuseppe Nucifora <me@giuseppenucifora.com> + +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. + + Title + NSDate_Utils + Type + PSGroupSpecifier + + + FooterText + Copyright (c) <2015> Hiroki Umatani PEAR + + +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. + + Title + PEAR-FileManager-iOS + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2015 Giuseppe Nucifora <me@giuseppenucifora.com> + +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. + + Title + PNObject + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2015 Giuseppe Nucifora <me@giuseppenucifora.com> + +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. + + Title + UIDevice-Utils + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-dummy.m b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-dummy.m new file mode 100644 index 0000000..3a90d0a --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_PNObject_Example : NSObject +@end +@implementation PodsDummy_Pods_PNObject_Example +@end diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-frameworks.sh b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-frameworks.sh new file mode 100755 index 0000000..1bd1885 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-frameworks.sh @@ -0,0 +1,99 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # use filter instead of exclude so missing patterns dont' throw errors + echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" + /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "Pods-PNObject_Example/AFNetworking.framework" + install_framework "Pods-PNObject_Example/NSDate_Utils.framework" + install_framework "Pods-PNObject_Example/PEAR_FileManager_iOS.framework" + install_framework "Pods-PNObject_Example/PNObject.framework" + install_framework "Pods-PNObject_Example/UIDevice_Utils.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "Pods-PNObject_Example/AFNetworking.framework" + install_framework "Pods-PNObject_Example/NSDate_Utils.framework" + install_framework "Pods-PNObject_Example/PEAR_FileManager_iOS.framework" + install_framework "Pods-PNObject_Example/PNObject.framework" + install_framework "Pods-PNObject_Example/UIDevice_Utils.framework" +fi diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-resources.sh b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-resources.sh new file mode 100755 index 0000000..fa69136 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-resources.sh @@ -0,0 +1,102 @@ +#!/bin/sh +set -e + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +realpath() { + DIRECTORY="$(cd "${1%/*}" && pwd)" + FILENAME="${1##*/}" + echo "$DIRECTORY/$FILENAME" +} + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" + ;; + *.framework) + echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync -av $RESOURCE_PATH ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + rsync -av "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + xcrun momc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + xcrun momc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + xcrun mapc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; + esac + + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "`realpath $PODS_ROOT`*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-umbrella.h b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-umbrella.h new file mode 100644 index 0000000..c9156db --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example-umbrella.h @@ -0,0 +1,6 @@ +#import + + +FOUNDATION_EXPORT double Pods_PNObject_ExampleVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_PNObject_ExampleVersionString[]; + diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.debug.xcconfig b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.debug.xcconfig new file mode 100644 index 0000000..ae8c014 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.debug.xcconfig @@ -0,0 +1,6 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSDate_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PEAR_FileManager_iOS.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PNObject.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/UIDevice_Utils.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "NSDate_Utils" -framework "PEAR_FileManager_iOS" -framework "PNObject" -framework "UIDevice_Utils" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-PNObject_Example +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.modulemap b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.modulemap new file mode 100644 index 0000000..2f58fbe --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.modulemap @@ -0,0 +1,6 @@ +framework module Pods_PNObject_Example { + umbrella header "Pods-PNObject_Example-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.release.xcconfig b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.release.xcconfig new file mode 100644 index 0000000..ae8c014 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.release.xcconfig @@ -0,0 +1,6 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSDate_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PEAR_FileManager_iOS.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PNObject.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/UIDevice_Utils.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "NSDate_Utils" -framework "PEAR_FileManager_iOS" -framework "PNObject" -framework "UIDevice_Utils" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-PNObject_Example +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Tests/Info.plist b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Info.plist new file mode 100644 index 0000000..2243fe6 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-acknowledgements.markdown b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-acknowledgements.markdown new file mode 100644 index 0000000..2101866 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-acknowledgements.markdown @@ -0,0 +1,132 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## PNObject + +Copyright (c) 2015 Giuseppe Nucifora + +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. + + +## Expecta + +Copyright (c) 2011-2015 Specta Team - https://github.com/specta + +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. + + +## Expecta+Snapshots + +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. + + +## FBSnapshotTestCase + +BSD License + +For the FBSnapshotTestCase software + +Copyright (c) 2013, Facebook, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name Facebook nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +## Specta + +Copyright (c) 2012-2014 Specta Team. + +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. + + +Generated by CocoaPods - https://cocoapods.org diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-acknowledgements.plist b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-acknowledgements.plist new file mode 100644 index 0000000..400228c --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-acknowledgements.plist @@ -0,0 +1,178 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2015 Giuseppe Nucifora <me@giuseppenucifora.com> + +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. + + Title + PNObject + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2011-2015 Specta Team - https://github.com/specta + +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. + + Title + Expecta + Type + PSGroupSpecifier + + + FooterText + 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. + + Title + Expecta+Snapshots + Type + PSGroupSpecifier + + + FooterText + BSD License + +For the FBSnapshotTestCase software + +Copyright (c) 2013, Facebook, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name Facebook nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Title + FBSnapshotTestCase + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2012-2014 Specta Team. + +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. + + + Title + Specta + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-dummy.m b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-dummy.m new file mode 100644 index 0000000..66e91f7 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_PNObject_Tests : NSObject +@end +@implementation PodsDummy_Pods_PNObject_Tests +@end diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-frameworks.sh b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-frameworks.sh new file mode 100755 index 0000000..2ff822c --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-frameworks.sh @@ -0,0 +1,99 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # use filter instead of exclude so missing patterns dont' throw errors + echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" + /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "Pods-PNObject_Tests/PNObject.framework" + install_framework "Pods-PNObject_Tests/Expecta.framework" + install_framework "Pods-PNObject_Tests/Expecta_Snapshots.framework" + install_framework "Pods-PNObject_Tests/FBSnapshotTestCase.framework" + install_framework "Pods-PNObject_Tests/Specta.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "Pods-PNObject_Tests/PNObject.framework" + install_framework "Pods-PNObject_Tests/Expecta.framework" + install_framework "Pods-PNObject_Tests/Expecta_Snapshots.framework" + install_framework "Pods-PNObject_Tests/FBSnapshotTestCase.framework" + install_framework "Pods-PNObject_Tests/Specta.framework" +fi diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-resources.sh b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-resources.sh new file mode 100755 index 0000000..fa69136 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-resources.sh @@ -0,0 +1,102 @@ +#!/bin/sh +set -e + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +realpath() { + DIRECTORY="$(cd "${1%/*}" && pwd)" + FILENAME="${1##*/}" + echo "$DIRECTORY/$FILENAME" +} + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" + ;; + *.framework) + echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync -av $RESOURCE_PATH ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + rsync -av "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + xcrun momc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + xcrun momc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + xcrun mapc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; + esac + + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "`realpath $PODS_ROOT`*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-umbrella.h b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-umbrella.h new file mode 100644 index 0000000..f7f0848 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests-umbrella.h @@ -0,0 +1,6 @@ +#import + + +FOUNDATION_EXPORT double Pods_PNObject_TestsVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_PNObject_TestsVersionString[]; + diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.debug.xcconfig b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.debug.xcconfig new file mode 100644 index 0000000..8dbf89c --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.debug.xcconfig @@ -0,0 +1,8 @@ +EMBEDDED_CONTENT_CONTAINS_SWIFT = YES +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Expecta.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Expecta_Snapshots.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PNObject.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Specta.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "Expecta" -framework "Expecta_Snapshots" -framework "FBSnapshotTestCase" -framework "PNObject" -framework "Specta" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-PNObject_Tests +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.modulemap b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.modulemap new file mode 100644 index 0000000..0665a94 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.modulemap @@ -0,0 +1,6 @@ +framework module Pods_PNObject_Tests { + umbrella header "Pods-PNObject_Tests-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.release.xcconfig b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.release.xcconfig new file mode 100644 index 0000000..8dbf89c --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-PNObject_Tests/Pods-PNObject_Tests.release.xcconfig @@ -0,0 +1,8 @@ +EMBEDDED_CONTENT_CONTAINS_SWIFT = YES +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Expecta.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Expecta_Snapshots.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PNObject.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Specta.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "Expecta" -framework "Expecta_Snapshots" -framework "FBSnapshotTestCase" -framework "PNObject" -framework "Specta" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-PNObject_Tests +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/Specta/Info.plist b/Example/Pods/Target Support Files/Specta/Info.plist new file mode 100644 index 0000000..a5730fa --- /dev/null +++ b/Example/Pods/Target Support Files/Specta/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.5 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Specta/Specta-dummy.m b/Example/Pods/Target Support Files/Specta/Specta-dummy.m new file mode 100644 index 0000000..fdae423 --- /dev/null +++ b/Example/Pods/Target Support Files/Specta/Specta-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Specta : NSObject +@end +@implementation PodsDummy_Specta +@end diff --git a/Example/Pods/Target Support Files/Specta/Specta-prefix.pch b/Example/Pods/Target Support Files/Specta/Specta-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/Example/Pods/Target Support Files/Specta/Specta-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/Example/Pods/Target Support Files/Specta/Specta-umbrella.h b/Example/Pods/Target Support Files/Specta/Specta-umbrella.h new file mode 100644 index 0000000..c6cc903 --- /dev/null +++ b/Example/Pods/Target Support Files/Specta/Specta-umbrella.h @@ -0,0 +1,21 @@ +#import + +#import "Specta.h" +#import "SpectaDSL.h" +#import "SpectaTypes.h" +#import "SpectaUtility.h" +#import "SPTCallSite.h" +#import "SPTCompiledExample.h" +#import "SPTExample.h" +#import "SPTExampleGroup.h" +#import "SPTExcludeGlobalBeforeAfterEach.h" +#import "SPTGlobalBeforeAfterEach.h" +#import "SPTSharedExampleGroups.h" +#import "SPTSpec.h" +#import "SPTTestSuite.h" +#import "XCTest+Private.h" +#import "XCTestCase+Specta.h" + +FOUNDATION_EXPORT double SpectaVersionNumber; +FOUNDATION_EXPORT const unsigned char SpectaVersionString[]; + diff --git a/Example/Pods/Target Support Files/Specta/Specta.modulemap b/Example/Pods/Target Support Files/Specta/Specta.modulemap new file mode 100644 index 0000000..c1629fb --- /dev/null +++ b/Example/Pods/Target Support Files/Specta/Specta.modulemap @@ -0,0 +1,6 @@ +framework module Specta { + umbrella header "Specta-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/Specta/Specta.xcconfig b/Example/Pods/Target Support Files/Specta/Specta.xcconfig new file mode 100644 index 0000000..bd75300 --- /dev/null +++ b/Example/Pods/Target Support Files/Specta/Specta.xcconfig @@ -0,0 +1,8 @@ +ENABLE_BITCODE = NO +FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "Foundation" -framework "XCTest" +PODS_ROOT = ${SRCROOT} +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Example/Pods/Target Support Files/UIDevice-Utils/Info.plist b/Example/Pods/Target Support Files/UIDevice-Utils/Info.plist new file mode 100644 index 0000000..7c241fa --- /dev/null +++ b/Example/Pods/Target Support Files/UIDevice-Utils/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.1.2 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/UIDevice-Utils/ResourceBundle-UIDevice-Utils-Info.plist b/Example/Pods/Target Support Files/UIDevice-Utils/ResourceBundle-UIDevice-Utils-Info.plist new file mode 100644 index 0000000..7c241fa --- /dev/null +++ b/Example/Pods/Target Support Files/UIDevice-Utils/ResourceBundle-UIDevice-Utils-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.1.2 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils-dummy.m b/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils-dummy.m new file mode 100644 index 0000000..7c0cb8a --- /dev/null +++ b/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_UIDevice_Utils : NSObject +@end +@implementation PodsDummy_UIDevice_Utils +@end diff --git a/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils-prefix.pch b/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils-umbrella.h b/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils-umbrella.h new file mode 100644 index 0000000..1153cf3 --- /dev/null +++ b/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils-umbrella.h @@ -0,0 +1,7 @@ +#import + +#import "UIDevice-Hardware.h" + +FOUNDATION_EXPORT double UIDevice_UtilsVersionNumber; +FOUNDATION_EXPORT const unsigned char UIDevice_UtilsVersionString[]; + diff --git a/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils.modulemap b/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils.modulemap new file mode 100644 index 0000000..9834ada --- /dev/null +++ b/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils.modulemap @@ -0,0 +1,6 @@ +framework module UIDevice_Utils { + umbrella header "UIDevice-Utils-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils.xcconfig b/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils.xcconfig new file mode 100644 index 0000000..5b4e8a0 --- /dev/null +++ b/Example/Pods/Target Support Files/UIDevice-Utils/UIDevice-Utils.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +PODS_ROOT = ${SRCROOT} +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Example/Pods/UIDevice-Utils/LICENSE b/Example/Pods/UIDevice-Utils/LICENSE new file mode 100644 index 0000000..5f646ce --- /dev/null +++ b/Example/Pods/UIDevice-Utils/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015 Giuseppe Nucifora + +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. diff --git a/Example/Pods/UIDevice-Utils/Pod/Classes/UIDevice-Hardware.h b/Example/Pods/UIDevice-Utils/Pod/Classes/UIDevice-Hardware.h new file mode 100755 index 0000000..763199c --- /dev/null +++ b/Example/Pods/UIDevice-Utils/Pod/Classes/UIDevice-Hardware.h @@ -0,0 +1,112 @@ +/* + Erica Sadun, http://ericasadun.com + iPhone Developer's Cookbook, 6.x Edition + BSD License, Use at your own risk + + Modified by Eric Horacek for Monospace Ltd. on 2/4/13 + */ + +#import + +#define IS_IPAD (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad) +#define DEVICE_IOS_VERSION [[UIDevice currentDevice].systemVersion floatValue] + +#define DEVICE_HAS_RETINA_DISPLAY (fabs([UIScreen mainScreen].scale - 2.0) <= fabs([UIScreen mainScreen].scale - 2.0)*DBL_EPSILON) +#define IS_IOS7_OR_LATER (((double)(DEVICE_IOS_VERSION)-7.0) > -((double)(DEVICE_IOS_VERSION)-7.0)*DBL_EPSILON) +#define NSStringAdd568hIfIphone4inch(str) [NSString stringWithFormat:[UIDevice currentDevice].isIphoneWith4inchDisplay ? @"%@-568h" : @"%@", str] + +#define IS_IPHONE_5 [[UIScreen mainScreen] applicationFrame].size.height == 568 + +typedef NS_ENUM(NSUInteger, UIDeviceFamily) { + UIDeviceFamilyiPhone, + UIDeviceFamilyiPod, + UIDeviceFamilyiPad, + UIDeviceFamilyAppleTV, + UIDeviceFamilyUnknown, +}; + +typedef NS_ENUM(NSUInteger, UIDeviceGenerationModel) { + UIDeviceGenerationModeliPhone3G, + UIDeviceGenerationModeliPhone3GS, + UIDeviceGenerationModeliPhone4, + UIDeviceGenerationModeliPhone4S, + UIDeviceGenerationModeliPhone5, + UIDeviceGenerationModeliPhone5C, + UIDeviceGenerationModeliPhone5S, + UIDeviceGenerationModeliPhone6, + UIDeviceGenerationModeliPhone6Plus, + UIDeviceGenerationModeliPhone6S, + UIDeviceGenerationModeliPhone6SPlus, + UIDeviceGenerationModeliPhoneSimulator, + UIDeviceGenerationModeliPad1, + UIDeviceGenerationModeliPad2, + UIDeviceGenerationModeliPad3, + UIDeviceGenerationModeliPad4, + UIDeviceGenerationModeliPadAir, + UIDeviceGenerationModeliPadAir2, + UIDeviceGenerationModeliPadMini1, + UIDeviceGenerationModeliPadMini2, + UIDeviceGenerationModeliPadMini3, + UIDeviceGenerationModeliPadMini4, + UIDeviceGenerationModeliPadPro, + UIDeviceGenerationModeliPadSimulator, + UIDeviceGenerationModeliPod1, + UIDeviceGenerationModeliPod2, + UIDeviceGenerationModeliPod3, + UIDeviceGenerationModeliPod4, + UIDeviceGenerationModeliPod5, + UIDeviceGenerationModeliPod6, + UIDeviceGenerationModelAppleTV1, + UIDeviceGenerationModelAppleTV2, + UIDeviceGenerationModelAppleTV3, + UIDeviceGenerationModelAppleTV3_v2, + UIDeviceGenerationModelAppleTV4, + UIDeviceGenerationModelUnknown +}; + + +typedef NS_ENUM(NSUInteger, UIDeviceModelInches) { + UIDeviceModelInches35, + UIDeviceModelInches4, + UIDeviceModelInches47, + UIDeviceModelInches55, + UIDeviceModelInches79, + UIDeviceModelInches97, + UIDeviceModelInches129, + UIDeviceModelInchesUnKnown +}; + + +@interface UIDevice (Hardware) + +/** + Returns a machine-readable model name in the format of "iPhone4,1" + */ +- (NSString *)modelIdentifier; + +/** + Returns a human-readable model name in the format of "iPhone 4S". Fallback of the the `modelIdentifier` value. + */ +- (NSString *)modelName; + +/** + Returns the device generation model as a `UIDeviceGenerationModel` + */ +- (UIDeviceGenerationModel) deviceGenerationModel; + +/** + Returns the device generation model as a NSString `iPhone4` + */ +- (NSString*) deviceGenerationModelString; + +/** + Returns the device family as a `UIDeviceFamily` + */ +- (UIDeviceFamily)deviceFamily; + +/** + Returns the device Inches + */ +- (UIDeviceModelInches) deviceInches; + +@end diff --git a/Example/Pods/UIDevice-Utils/Pod/Classes/UIDevice-Hardware.m b/Example/Pods/UIDevice-Utils/Pod/Classes/UIDevice-Hardware.m new file mode 100755 index 0000000..d473f02 --- /dev/null +++ b/Example/Pods/UIDevice-Utils/Pod/Classes/UIDevice-Hardware.m @@ -0,0 +1,345 @@ +/* + Erica Sadun, http://ericasadun.com + iPhone Developer's Cookbook, 6.x Edition + BSD License, Use at your own risk + + Modified by Eric Horacek for Monospace Ltd. on 2/4/13 + */ + +#include +#import "UIDevice-Hardware.h" + +@interface UIDevice (Hardward) + +- (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier; + +@end + +@implementation UIDevice (Hardware) + +- (NSString *)getSysInfoByName:(char *)typeSpecifier +{ + size_t size; + sysctlbyname(typeSpecifier, NULL, &size, NULL, 0); + + char *answer = malloc(size); + sysctlbyname(typeSpecifier, answer, &size, NULL, 0); + + NSString *results = [NSString stringWithCString:answer encoding: NSUTF8StringEncoding]; + + free(answer); + return results; +} + +- (NSString *)modelIdentifier +{ + return [self getSysInfoByName:"hw.machine"]; +} + +- (NSString *)modelName +{ + return [self modelNameForModelIdentifier:[self modelIdentifier]]; +} + +- (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier +{ + // iPhone http://theiphonewiki.com/wiki/IPhone + + if ([modelIdentifier isEqualToString:@"iPhone1,1"]) return @"iPhone 1G"; + if ([modelIdentifier isEqualToString:@"iPhone1,2"]) return @"iPhone 3G"; + if ([modelIdentifier isEqualToString:@"iPhone2,1"]) return @"iPhone 3GS"; + if ([modelIdentifier isEqualToString:@"iPhone3,1"]) return @"iPhone 4 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPhone3,2"]) return @"iPhone 4 (GSM Rev A)"; + if ([modelIdentifier isEqualToString:@"iPhone3,3"]) return @"iPhone 4 (CDMA)"; + if ([modelIdentifier isEqualToString:@"iPhone4,1"]) return @"iPhone 4S"; + if ([modelIdentifier isEqualToString:@"iPhone5,1"]) return @"iPhone 5 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPhone5,2"]) return @"iPhone 5 (Global)"; + if ([modelIdentifier isEqualToString:@"iPhone5,3"]) return @"iPhone 5c (GSM)"; + if ([modelIdentifier isEqualToString:@"iPhone5,4"]) return @"iPhone 5c (Global)"; + if ([modelIdentifier isEqualToString:@"iPhone6,1"]) return @"iPhone 5s (GSM)"; + if ([modelIdentifier isEqualToString:@"iPhone6,2"]) return @"iPhone 5s (Global)"; + if ([modelIdentifier isEqualToString:@"iPhone7,1"]) return @"iPhone 6 Plus"; + if ([modelIdentifier isEqualToString:@"iPhone7,2"]) return @"iPhone 6"; + if ([modelIdentifier isEqualToString:@"iPhone8,1"]) return @"iPhone 6s"; + if ([modelIdentifier isEqualToString:@"iPhone8,2"]) return @"iPhone 6s Plus"; + + // iPad http://theiphonewiki.com/wiki/IPad + + if ([modelIdentifier isEqualToString:@"iPad1,1"]) return @"iPad 1G"; + if ([modelIdentifier isEqualToString:@"iPad2,1"]) return @"iPad 2 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad2,2"]) return @"iPad 2 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPad2,3"]) return @"iPad 2 (CDMA)"; + if ([modelIdentifier isEqualToString:@"iPad2,4"]) return @"iPad 2 (Rev A)"; + if ([modelIdentifier isEqualToString:@"iPad3,1"]) return @"iPad 3 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad3,2"]) return @"iPad 3 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPad3,3"]) return @"iPad 3 (Global)"; + if ([modelIdentifier isEqualToString:@"iPad3,4"]) return @"iPad 4 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad3,5"]) return @"iPad 4 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPad3,6"]) return @"iPad 4 (Global)"; + + if ([modelIdentifier isEqualToString:@"iPad4,1"]) return @"iPad Air (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad4,2"]) return @"iPad Air (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad5,3"]) return @"iPad Air 2 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad5,4"]) return @"iPad Air 2 (Cellular)"; + + // iPad Mini http://theiphonewiki.com/wiki/IPad_mini + + if ([modelIdentifier isEqualToString:@"iPad2,5"]) return @"iPad mini 1G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad2,6"]) return @"iPad mini 1G (GSM)"; + if ([modelIdentifier isEqualToString:@"iPad2,7"]) return @"iPad mini 1G (Global)"; + if ([modelIdentifier isEqualToString:@"iPad4,4"]) return @"iPad mini 2G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad4,5"]) return @"iPad mini 2G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad4,6"]) return @"iPad mini 2G (Cellular)"; // TD-LTE model see https://support.apple.com/en-us/HT201471#iPad-mini2 + if ([modelIdentifier isEqualToString:@"iPad4,7"]) return @"iPad mini 3G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad4,8"]) return @"iPad mini 3G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad4,9"]) return @"iPad mini 3G (Cellular)"; + + // iPod http://theiphonewiki.com/wiki/IPod + + if ([modelIdentifier isEqualToString:@"iPod1,1"]) return @"iPod touch 1G"; + if ([modelIdentifier isEqualToString:@"iPod2,1"]) return @"iPod touch 2G"; + if ([modelIdentifier isEqualToString:@"iPod3,1"]) return @"iPod touch 3G"; + if ([modelIdentifier isEqualToString:@"iPod4,1"]) return @"iPod touch 4G"; + if ([modelIdentifier isEqualToString:@"iPod5,1"]) return @"iPod touch 5G"; + if ([modelIdentifier isEqualToString:@"iPod7,1"]) return @"iPod touch 6G"; // as 6,1 was never released 7,1 is actually 6th generation + + // Apple TV https://www.theiphonewiki.com/wiki/Apple_TV + + if ([modelIdentifier isEqualToString:@"AppleTV1,1"]) return @"Apple TV 1G"; + if ([modelIdentifier isEqualToString:@"AppleTV2,1"]) return @"Apple TV 2G"; + if ([modelIdentifier isEqualToString:@"AppleTV3,1"]) return @"Apple TV 3G"; + if ([modelIdentifier isEqualToString:@"AppleTV3,2"]) return @"Apple TV 3G"; // small, incremental update over 3,1 + if ([modelIdentifier isEqualToString:@"AppleTV5,3"]) return @"Apple TV 4G"; + + // Simulator + if ([modelIdentifier hasSuffix:@"86"] || [modelIdentifier isEqual:@"x86_64"]) + { + BOOL smallerScreen = ([[UIScreen mainScreen] bounds].size.width < 768.0); + return (smallerScreen ? @"iPhone Simulator" : @"iPad Simulator"); + } + + return modelIdentifier; +} + +- (UIDeviceFamily) deviceFamily +{ + NSString *modelIdentifier = [self modelNameForModelIdentifier:[self modelIdentifier]]; + if ([modelIdentifier hasPrefix:@"iPhone"]) return UIDeviceFamilyiPhone; + if ([modelIdentifier hasPrefix:@"iPod"]) return UIDeviceFamilyiPod; + if ([modelIdentifier hasPrefix:@"iPad"]) return UIDeviceFamilyiPad; + if ([modelIdentifier hasPrefix:@"AppleTV"]) return UIDeviceFamilyAppleTV; + return UIDeviceFamilyUnknown; +} + +- (UIDeviceGenerationModel) deviceGenerationModel +{ + NSString *modelIdentifier = [self modelIdentifier]; + + if ([modelIdentifier isEqualToString:@"iPhone1,1"]) return UIDeviceGenerationModeliPhone3G; + if ([modelIdentifier isEqualToString:@"iPhone1,2"]) return UIDeviceGenerationModeliPhone3G; + if ([modelIdentifier isEqualToString:@"iPhone2,1"]) return UIDeviceGenerationModeliPhone3GS; + if ([modelIdentifier isEqualToString:@"iPhone3,1"]) return UIDeviceGenerationModeliPhone4; + if ([modelIdentifier isEqualToString:@"iPhone3,2"]) return UIDeviceGenerationModeliPhone4; + if ([modelIdentifier isEqualToString:@"iPhone3,3"]) return UIDeviceGenerationModeliPhone4; + if ([modelIdentifier isEqualToString:@"iPhone4,1"]) return UIDeviceGenerationModeliPhone4S; + if ([modelIdentifier isEqualToString:@"iPhone5,1"]) return UIDeviceGenerationModeliPhone5; + if ([modelIdentifier isEqualToString:@"iPhone5,2"]) return UIDeviceGenerationModeliPhone5; + if ([modelIdentifier isEqualToString:@"iPhone5,3"]) return UIDeviceGenerationModeliPhone5C; + if ([modelIdentifier isEqualToString:@"iPhone5,4"]) return UIDeviceGenerationModeliPhone5C; + if ([modelIdentifier isEqualToString:@"iPhone6,1"]) return UIDeviceGenerationModeliPhone5S; + if ([modelIdentifier isEqualToString:@"iPhone6,2"]) return UIDeviceGenerationModeliPhone5S; + if ([modelIdentifier isEqualToString:@"iPhone7,1"]) return UIDeviceGenerationModeliPhone6Plus; + if ([modelIdentifier isEqualToString:@"iPhone7,2"]) return UIDeviceGenerationModeliPhone6; + if ([modelIdentifier isEqualToString:@"iPhone8,1"]) return UIDeviceGenerationModeliPhone6S; + if ([modelIdentifier isEqualToString:@"iPhone8,2"]) return UIDeviceGenerationModeliPhone6SPlus; + + // iPad http://theiphonewiki.com/wiki/IPad + + if ([modelIdentifier isEqualToString:@"iPad1,1"]) return UIDeviceGenerationModeliPad1; + if ([modelIdentifier isEqualToString:@"iPad2,1"]) return UIDeviceGenerationModeliPad2; + if ([modelIdentifier isEqualToString:@"iPad2,2"]) return UIDeviceGenerationModeliPad2; + if ([modelIdentifier isEqualToString:@"iPad2,3"]) return UIDeviceGenerationModeliPad2; + if ([modelIdentifier isEqualToString:@"iPad2,4"]) return UIDeviceGenerationModeliPad2; + if ([modelIdentifier isEqualToString:@"iPad3,1"]) return UIDeviceGenerationModeliPad3; + if ([modelIdentifier isEqualToString:@"iPad3,2"]) return UIDeviceGenerationModeliPad3; + if ([modelIdentifier isEqualToString:@"iPad3,3"]) return UIDeviceGenerationModeliPad3; + if ([modelIdentifier isEqualToString:@"iPad3,4"]) return UIDeviceGenerationModeliPad4; + if ([modelIdentifier isEqualToString:@"iPad3,5"]) return UIDeviceGenerationModeliPad4; + if ([modelIdentifier isEqualToString:@"iPad3,6"]) return UIDeviceGenerationModeliPad4; + + if ([modelIdentifier isEqualToString:@"iPad4,1"]) return UIDeviceGenerationModeliPadAir; + if ([modelIdentifier isEqualToString:@"iPad4,2"]) return UIDeviceGenerationModeliPadAir; + if ([modelIdentifier isEqualToString:@"iPad5,3"]) return UIDeviceGenerationModeliPadAir2; + if ([modelIdentifier isEqualToString:@"iPad5,4"]) return UIDeviceGenerationModeliPadAir2; + + // iPad Mini http://theiphonewiki.com/wiki/IPad_mini + + if ([modelIdentifier isEqualToString:@"iPad2,5"]) return UIDeviceGenerationModeliPadMini1; + if ([modelIdentifier isEqualToString:@"iPad2,6"]) return UIDeviceGenerationModeliPadMini1; + if ([modelIdentifier isEqualToString:@"iPad2,7"]) return UIDeviceGenerationModeliPadMini1; + if ([modelIdentifier isEqualToString:@"iPad4,4"]) return UIDeviceGenerationModeliPadMini2; + if ([modelIdentifier isEqualToString:@"iPad4,5"]) return UIDeviceGenerationModeliPadMini2; + if ([modelIdentifier isEqualToString:@"iPad4,6"]) return UIDeviceGenerationModeliPadMini2; // TD-LTE model see https://support.apple.com/en-us/HT201471#iPad-mini2 + if ([modelIdentifier isEqualToString:@"iPad4,7"]) return UIDeviceGenerationModeliPadMini3; + if ([modelIdentifier isEqualToString:@"iPad4,8"]) return UIDeviceGenerationModeliPadMini3; + if ([modelIdentifier isEqualToString:@"iPad4,9"]) return UIDeviceGenerationModeliPadMini3; + + // iPod http://theiphonewiki.com/wiki/IPod + + if ([modelIdentifier isEqualToString:@"iPod1,1"]) return UIDeviceGenerationModeliPod1; + if ([modelIdentifier isEqualToString:@"iPod2,1"]) return UIDeviceGenerationModeliPod2; + if ([modelIdentifier isEqualToString:@"iPod3,1"]) return UIDeviceGenerationModeliPod3; + if ([modelIdentifier isEqualToString:@"iPod4,1"]) return UIDeviceGenerationModeliPod4; + if ([modelIdentifier isEqualToString:@"iPod5,1"]) return UIDeviceGenerationModeliPod5; + if ([modelIdentifier isEqualToString:@"iPod7,1"]) return UIDeviceGenerationModeliPod6; // as 6,1 was never released 7,1 is actually 6th generation + + // Apple TV https://www.theiphonewiki.com/wiki/Apple_TV + + if ([modelIdentifier isEqualToString:@"AppleTV1,1"]) return UIDeviceGenerationModelAppleTV1; + if ([modelIdentifier isEqualToString:@"AppleTV2,1"]) return UIDeviceGenerationModelAppleTV2; + if ([modelIdentifier isEqualToString:@"AppleTV3,1"]) return UIDeviceGenerationModelAppleTV3; + if ([modelIdentifier isEqualToString:@"AppleTV3,2"]) return UIDeviceGenerationModelAppleTV3_v2; // small, incremental update over 3,1 + if ([modelIdentifier isEqualToString:@"AppleTV5,3"]) return UIDeviceGenerationModelAppleTV4; + + if ([modelIdentifier hasSuffix:@"86"] || [modelIdentifier isEqual:@"x86_64"]) + { + BOOL smallerScreen = ([[UIScreen mainScreen] bounds].size.width < 768.0); + return (smallerScreen ? UIDeviceGenerationModeliPhoneSimulator : UIDeviceGenerationModeliPadSimulator); + } + return UIDeviceGenerationModelUnknown; +} + +- (NSString*) deviceGenerationModelString +{ + NSString *modelIdentifier = [self modelIdentifier]; + + if ([modelIdentifier isEqualToString:@"iPhone1,1"]) return @"iPhone 1G"; + if ([modelIdentifier isEqualToString:@"iPhone1,2"]) return @"iPhone 3G"; + if ([modelIdentifier isEqualToString:@"iPhone2,1"]) return @"iPhone 3GS"; + if ([modelIdentifier isEqualToString:@"iPhone3,1"]) return @"iPhone 4 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPhone3,2"]) return @"iPhone 4 (GSM Rev A)"; + if ([modelIdentifier isEqualToString:@"iPhone3,3"]) return @"iPhone 4 (CDMA)"; + if ([modelIdentifier isEqualToString:@"iPhone4,1"]) return @"iPhone 4S"; + if ([modelIdentifier isEqualToString:@"iPhone5,1"]) return @"iPhone 5 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPhone5,2"]) return @"iPhone 5 (Global)"; + if ([modelIdentifier isEqualToString:@"iPhone5,3"]) return @"iPhone 5c (GSM)"; + if ([modelIdentifier isEqualToString:@"iPhone5,4"]) return @"iPhone 5c (Global)"; + if ([modelIdentifier isEqualToString:@"iPhone6,1"]) return @"iPhone 5s (GSM)"; + if ([modelIdentifier isEqualToString:@"iPhone6,2"]) return @"iPhone 5s (Global)"; + if ([modelIdentifier isEqualToString:@"iPhone7,1"]) return @"iPhone 6 Plus"; + if ([modelIdentifier isEqualToString:@"iPhone7,2"]) return @"iPhone 6"; + if ([modelIdentifier isEqualToString:@"iPhone8,1"]) return @"iPhone 6s"; + if ([modelIdentifier isEqualToString:@"iPhone8,2"]) return @"iPhone 6s Plus"; + + // iPad http://theiphonewiki.com/wiki/IPad + + if ([modelIdentifier isEqualToString:@"iPad1,1"]) return @"iPad 1G"; + if ([modelIdentifier isEqualToString:@"iPad2,1"]) return @"iPad 2 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad2,2"]) return @"iPad 2 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPad2,3"]) return @"iPad 2 (CDMA)"; + if ([modelIdentifier isEqualToString:@"iPad2,4"]) return @"iPad 2 (Rev A)"; + if ([modelIdentifier isEqualToString:@"iPad3,1"]) return @"iPad 3 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad3,2"]) return @"iPad 3 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPad3,3"]) return @"iPad 3 (Global)"; + if ([modelIdentifier isEqualToString:@"iPad3,4"]) return @"iPad 4 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad3,5"]) return @"iPad 4 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPad3,6"]) return @"iPad 4 (Global)"; + + if ([modelIdentifier isEqualToString:@"iPad4,1"]) return @"iPad Air (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad4,2"]) return @"iPad Air (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad5,3"]) return @"iPad Air 2 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad5,4"]) return @"iPad Air 2 (Cellular)"; + + // iPad Mini http://theiphonewiki.com/wiki/IPad_mini + + if ([modelIdentifier isEqualToString:@"iPad2,5"]) return @"iPad mini 1G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad2,6"]) return @"iPad mini 1G (GSM)"; + if ([modelIdentifier isEqualToString:@"iPad2,7"]) return @"iPad mini 1G (Global)"; + if ([modelIdentifier isEqualToString:@"iPad4,4"]) return @"iPad mini 2G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad4,5"]) return @"iPad mini 2G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad4,6"]) return @"iPad mini 2G (Cellular)"; // TD-LTE model see https://support.apple.com/en-us/HT201471#iPad-mini2 + if ([modelIdentifier isEqualToString:@"iPad4,7"]) return @"iPad mini 3G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad4,8"]) return @"iPad mini 3G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad4,9"]) return @"iPad mini 3G (Cellular)"; + + // iPod http://theiphonewiki.com/wiki/IPod + + if ([modelIdentifier isEqualToString:@"iPod1,1"]) return @"iPod touch 1G"; + if ([modelIdentifier isEqualToString:@"iPod2,1"]) return @"iPod touch 2G"; + if ([modelIdentifier isEqualToString:@"iPod3,1"]) return @"iPod touch 3G"; + if ([modelIdentifier isEqualToString:@"iPod4,1"]) return @"iPod touch 4G"; + if ([modelIdentifier isEqualToString:@"iPod5,1"]) return @"iPod touch 5G"; + if ([modelIdentifier isEqualToString:@"iPod7,1"]) return @"iPod touch 6G"; // as 6,1 was never released 7,1 is actually 6th generation + + // Apple TV https://www.theiphonewiki.com/wiki/Apple_TV + + if ([modelIdentifier isEqualToString:@"AppleTV1,1"]) return @"Apple TV 1G"; + if ([modelIdentifier isEqualToString:@"AppleTV2,1"]) return @"Apple TV 2G"; + if ([modelIdentifier isEqualToString:@"AppleTV3,1"]) return @"Apple TV 3G"; + if ([modelIdentifier isEqualToString:@"AppleTV3,2"]) return @"Apple TV 3G"; // small, incremental update over 3,1 + if ([modelIdentifier isEqualToString:@"AppleTV5,3"]) return @"Apple TV 4G"; // as 4,1 was never released, 5,1 is actually 4th generation + + // Simulator + if ([modelIdentifier hasSuffix:@"86"] || [modelIdentifier isEqual:@"x86_64"]) + { + BOOL smallerScreen = ([[UIScreen mainScreen] bounds].size.width < 768.0); + return (smallerScreen ? @"iPhone Simulator" : @"iPad Simulator"); + } + + return modelIdentifier; +} + +- (UIDeviceModelInches) deviceInches { + switch ([self deviceGenerationModel]) { + case UIDeviceGenerationModeliPhone3G: + case UIDeviceGenerationModeliPhone3GS: + case UIDeviceGenerationModeliPhone4: + case UIDeviceGenerationModeliPhone4S:{ + return UIDeviceModelInches35; + } + break; + case UIDeviceGenerationModeliPhone5: + case UIDeviceGenerationModeliPhone5C: + case UIDeviceGenerationModeliPhone5S:{ + return UIDeviceModelInches4; + } + break; + case UIDeviceGenerationModeliPhone6: + case UIDeviceGenerationModeliPhone6S:{ + return UIDeviceModelInches47; + } + break; + case UIDeviceGenerationModeliPhone6Plus: + case UIDeviceGenerationModeliPhone6SPlus:{ + return UIDeviceModelInches55; + } + break; + case UIDeviceGenerationModeliPad1: + case UIDeviceGenerationModeliPad2: + case UIDeviceGenerationModeliPad3: + case UIDeviceGenerationModeliPad4: + case UIDeviceGenerationModeliPadAir: + case UIDeviceGenerationModeliPadAir2:{ + + return UIDeviceModelInches97; + } + break; + case UIDeviceGenerationModeliPadMini1: + case UIDeviceGenerationModeliPadMini2: + case UIDeviceGenerationModeliPadMini3: + case UIDeviceGenerationModeliPadMini4: + { + return UIDeviceModelInches79; + } + break; + case UIDeviceGenerationModeliPadPro:{ + return UIDeviceModelInches129; + } + default: + break; + } + return UIDeviceModelInchesUnKnown; +} + + +@end diff --git a/Example/Pods/UIDevice-Utils/README.md b/Example/Pods/UIDevice-Utils/README.md new file mode 100644 index 0000000..71a2fd2 --- /dev/null +++ b/Example/Pods/UIDevice-Utils/README.md @@ -0,0 +1,33 @@ +# UIDevice-Utils + +[![CI Status](http://img.shields.io/travis/Giuseppe Nucifora/UIDevice-Utils.svg?style=flat)](https://travis-ci.org/Giuseppe Nucifora/UIDevice-Utils) +[![Version](https://img.shields.io/cocoapods/v/UIDevice-Utils.svg?style=flat)](http://cocoapods.org/pods/UIDevice-Utils) +[![License](https://img.shields.io/cocoapods/l/UIDevice-Utils.svg?style=flat)](http://cocoapods.org/pods/UIDevice-Utils) +[![Platform](https://img.shields.io/cocoapods/p/UIDevice-Utils.svg?style=flat)](http://cocoapods.org/pods/UIDevice-Utils) + +## Usage + +To run the example project, clone the repo, and run `pod install` from the Example directory first. + +## Requirements + +## Installation + +UIDevice-Utils is available through [CocoaPods](http://cocoapods.org). To install +it, simply add the following line to your Podfile: + +```ruby +pod "UIDevice-Utils" , :git => 'https://github.com/giuseppenucifora/UIDevice-Utils.git' + +or + +pod "UIDevice-Utils" +``` + +## Author + +Giuseppe Nucifora, me@giuseppenucifora.com + +## License + +UIDevice-Utils is available under the MIT license. See the LICENSE file for more info. diff --git a/PNObject.podspec b/PNObject.podspec index 977f7d8..023d1b3 100644 --- a/PNObject.podspec +++ b/PNObject.podspec @@ -16,8 +16,7 @@ Pod::Spec.new do |s| # * Try to keep it short, snappy and to the point. # * Write the description between the DESC delimiters below. # * Finally, don't worry about the indent, CocoaPods strips it! - s.description = <<-DESC - DESC +# s.description = <<-DESC DESC s.homepage = "https://github.com//PNObject" # s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2" diff --git a/Pod/Classes/PNObject.h b/Pod/Classes/PNObject.h new file mode 100644 index 0000000..2fd3d22 --- /dev/null +++ b/Pod/Classes/PNObject.h @@ -0,0 +1,20 @@ +// +// PNObject.h +// Pods +// +// Created by Giuseppe Nucifora on 28/12/15. +// +// + +#import + +@interface PNObject : NSObject + +@property (nonatomic, strong) NSString *objID; +@property (nonatomic, strong) NSDate *createdDate; +@property (nonatomic, strong) NSDictionary *objectMapping; + +- (instancetype) initWithJSON:(NSDictionary*) JSON; + + +@end diff --git a/Pod/Classes/PNObject.m b/Pod/Classes/PNObject.m new file mode 100644 index 0000000..f35f479 --- /dev/null +++ b/Pod/Classes/PNObject.m @@ -0,0 +1,334 @@ +// +// PNObject.m +// Pods +// +// Created by Giuseppe Nucifora on 28/12/15. +// +// + +#import "PNObject.h" +#import +#import + +@interface PNObject() + +@property (nonatomic, strong) NSDictionary *JSON; + +@property (nonatomic, strong) NSString *endPoint; + +@end + +@implementation PNObject + +- (instancetype) init { + self = [super init]; + + if (self) { + NSAssert(_objectMapping, @"You must create objectMapping"); + + } + return self; +} + +- (instancetype) initWithJSON:(NSDictionary*) JSON { + self = [self init]; + if (self) { + _JSON = [[NSDictionary alloc] initWithDictionary:JSON]; + + [self populateObjectFromJSON:JSON]; + } + return self; +} + +- (BOOL)isStringNull:(NSString *)str +{ + if(nil == str || NSNull.null == (id)str) + return YES; + else + return NO; +} + +- (BOOL)isObjNull:(id)obj +{ + if(nil == obj || NSNull.null == obj) + return YES; + else + return NO; +} + +- (NSDictionary *)reverseMapping +{ + NSMutableDictionary *JSON = [NSMutableDictionary dictionary]; + + NSString *mappedJSONKey; + NSString *mappedJSONType; + + NSDictionary *properties = [PNObjectProperty propertiesForClass:self.class]; + + for (NSString* propertyName in _objectMapping) { + id mappingValue = [_objectMapping objectForKey:propertyName]; + + if([mappingValue isKindOfClass:NSDictionary.class]) { + mappedJSONKey = [mappingValue valueForKey:@"key"]; + mappedJSONType = [mappingValue valueForKey:@"type"]; + } else { + mappedJSONKey = mappingValue; + } + + NSString *propertyType = [properties valueForKey:propertyName]; + + id value = [self valueForKey:propertyName]; + + // NSDate + if([propertyType isEqualToString:@"NSDate"]) { + + value = [NSDate stringFromDate:value]; + } + // NSURL + else if([propertyType isEqualToString:@"NSURL"]) { + NSURL *url = value; + value = [url absoluteString]; + } + // NSArray, NSMutableArray + else if([propertyType isEqualToString:@"NSArray"] || + [propertyType isEqualToString:@"NSMutableArray"]) { + + NSMutableArray *arr = [NSMutableArray array]; + for(id LLObject in value) { + SEL selector = NSSelectorFromString(@"reverseMapping"); + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature: + [[PNObject class] instanceMethodSignatureForSelector:selector]]; + [invocation setSelector:selector]; + [invocation setTarget:LLObject]; + [invocation invoke]; + NSDictionary *returnValue; + [invocation getReturnValue:&returnValue]; + + [arr addObject:returnValue]; + } + + value = arr; + + } + // Other LLModel or an unidentified value + else { + BOOL isPNObjectSubclass = [NSClassFromString(propertyType) isSubclassOfClass:[PNObject class]]; + if(isPNObjectSubclass) { + SEL selector = NSSelectorFromString(@"reverseMapping"); + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature: + [[PNObject class] instanceMethodSignatureForSelector:selector]]; + [invocation setSelector:selector]; + [invocation setTarget:value]; + [invocation invoke]; + NSDictionary *returnValue; + [invocation getReturnValue:&returnValue]; + + value = returnValue; + + } + else { + // do nothing + } + } + + + [JSON setValue:value forKey:propertyName]; + } + + _JSON = JSON; + + return _JSON; +} + +- (void)populateObjectFromJSON:(id)JSON +{ + + NSDictionary *properties = [PNObjectProperty propertiesForClass:self.class]; + + for(NSString *propertyName in properties) { + + if([propertyName isEqualToString:@"mappingError"]) + continue; + + NSString *mappedJSONKey; + NSString *mappedJSONType; + + NSString *propertyType = [properties valueForKey:propertyName]; + + id mappingValue = [_objectMapping valueForKey:propertyName]; + + if([mappingValue isKindOfClass:NSDictionary.class]) { + mappedJSONKey = [mappingValue valueForKey:@"key"]; + mappedJSONType = [mappingValue valueForKey:@"type"]; + } else { + mappedJSONKey = mappingValue; + } + + // Check if there is mapping for the property + if([self isStringNull:mappedJSONKey]) { + // No mapping so just continue + continue; + } + + + // Get JSON value for the mapped key + id value = [JSON valueForKeyPath:mappedJSONKey]; + if([self isObjNull:value]) { + continue; + } + + //NSLog(@"Looking for : %@ -- %@ -- %@", propertyType, mappedJSONKey, value); + + + ((void (^)())@{ + @"c" : ^{ + char val = [value charValue]; + [self setValue:@(val) forKey:propertyName]; + }, + @"d" : ^{ + double val = [value doubleValue]; + [self setValue:@(val) forKey:propertyName]; + }, + @"f" : ^{ + float val = [value floatValue]; + [self setValue:@(val) forKey:propertyName]; + }, + @"i" : ^{ + int val = [value intValue]; + [self setValue:@(val) forKey:propertyName]; + }, + @"l" : ^{ + long val = [value longValue]; + [self setValue:@(val) forKey:propertyName]; + }, + @"s" : ^{ + short val = [value shortValue]; + [self setValue:@(val) forKey:propertyName]; + }, + @"NSString" : ^{ + NSString *val = [NSString stringWithFormat:@"%@", value]; + [self setValue:val forKey:propertyName]; + }, + @"NSNumber" : ^{ + NSInteger val = [value integerValue]; + [self setValue:@(val) forKey:propertyName]; + }, + @"NSDate" : ^{ + NSString *str = [NSString stringWithFormat:@"%@", value]; + NSDate *val = [NSDate dateFromString:str]; + [self setValue:val forKey:propertyName]; + }, + @"NSArray" : ^{ + NSMutableArray *arr = [NSMutableArray array]; + for(id JSONObject in value) { + PNObject *val = [[NSClassFromString(mappedJSONType) alloc] initWithJSON:JSONObject]; + [arr addObject:val]; + } + + [self setValue:arr forKey:propertyName]; + }, + @"NSMutableArray" : ^{ + NSMutableArray *arr = [NSMutableArray array]; + for(id JSONObject in value) { + PNObject *val = [[NSClassFromString(mappedJSONType) alloc] initWithJSON:JSONObject]; + [arr addObject:val]; + } + + [self setValue:arr forKey:propertyName]; + } + }[propertyType] ?: ^{ + BOOL isPNObjectSubclass = [NSClassFromString(propertyType) isSubclassOfClass:[PNObject class]]; + if(isPNObjectSubclass) { + PNObject *val = [[NSClassFromString(propertyType) alloc] initWithJSON:value]; + [self setValue:val forKey:propertyName]; + } + else { + NSString *errorStr = [NSString stringWithFormat:@"Property '%@' could not be assigned any value.", propertyName]; + NSLog(@"%@",errorStr); + } + })(); + /*// char + if([propertyType isEqualToString:@"c"]) { + char val = [value charValue]; + [self setValue:@(val) forKey:propertyName]; + } + // double + else if([propertyType isEqualToString:@"d"]) { + double val = [value doubleValue]; + [self setValue:@(val) forKey:propertyName]; + } + // float + else if([propertyType isEqualToString:@"f"]) { + float val = [value floatValue]; + [self setValue:@(val) forKey:propertyName]; + } + // integer + else if([propertyType isEqualToString:@"i"]) { + int val = [value intValue]; + [self setValue:@(val) forKey:propertyName]; + } + // long + else if([propertyType isEqualToString:@"l"]) { + long val = [value longValue]; + [self setValue:@(val) forKey:propertyName]; + } + // short + else if([propertyType isEqualToString:@"s"]) { + short val = [value shortValue]; + [self setValue:@(val) forKey:propertyName]; + } + // NSString + else if([propertyType isEqualToString:@"NSString"]) { + NSString *val = [NSString stringWithFormat:@"%@", value]; + [self setValue:val forKey:propertyName]; + } + // NSNumber + else if([propertyType isEqualToString:@"NSNumber"]) { + NSInteger val = [value integerValue]; + [self setValue:@(val) forKey:propertyName]; + } + // NSDate + else if([propertyType isEqualToString:@"NSDate"]) { + + + NSString *str = [NSString stringWithFormat:@"%@", value]; + NSDate *val = [NSDate dateFromString:str]; + [self setValue:val forKey:propertyName]; + } + // NSURL + else if([propertyType isEqualToString:@"NSURL"]) { + NSString *str = [NSString stringWithFormat:@"%@", value]; + NSURL *val = [NSURL URLWithString:str]; + [self setValue:val forKey:propertyName]; + } + // NSArray, NSMutableArray + else if([propertyType isEqualToString:@"NSArray"] || + [propertyType isEqualToString:@"NSMutableArray"]) { + + NSMutableArray *arr = [NSMutableArray array]; + for(id JSONObject in value) { + PNObject *val = [[NSClassFromString(mappedJSONType) alloc] initWithJSON:JSONObject]; + [arr addObject:val]; + } + + [self setValue:arr forKey:propertyName]; + + } + // Other LLModel or an unidentified value + else { + BOOL isPNObjectSubclass = [NSClassFromString(propertyType) isSubclassOfClass:[PNObject class]]; + if(isPNObjectSubclass) { + PNObject *val = [[NSClassFromString(propertyType) alloc] initWithJSON:value]; + [self setValue:val forKey:propertyName]; + } + else { + NSString *errorStr = [NSString stringWithFormat:@"Property '%@' could not be assigned any value.", propertyName]; + NSLog(@"%@",errorStr); + } + }*/ + + } + +} + +@end diff --git a/Pod/Classes/PNObjectProperty.h b/Pod/Classes/PNObjectProperty.h new file mode 100755 index 0000000..1a56136 --- /dev/null +++ b/Pod/Classes/PNObjectProperty.h @@ -0,0 +1,15 @@ +// +// PNObjectProperty.h +// Pods +// +// Created by Giuseppe Nucifora on 28/12/15. +// +// + +#import + +@interface PNObjectProperty : NSObject + ++ (NSDictionary *)propertiesForClass:(Class)PNObjClass; + +@end diff --git a/Pod/Classes/PNObjectProperty.m b/Pod/Classes/PNObjectProperty.m new file mode 100755 index 0000000..d7bb3b9 --- /dev/null +++ b/Pod/Classes/PNObjectProperty.m @@ -0,0 +1,77 @@ +// +// PNObjectProperty.m +// Pods +// +// Created by Giuseppe Nucifora on 28/12/15. +// +// + +#import "PNObjectProperty.h" +#import "objc/runtime.h" + +@implementation PNObjectProperty + +static BOOL property_getTypeString( objc_property_t property, char *buffer ) +{ + const char * attrs = property_getAttributes( property ); + if ( attrs == NULL ) + return NO; + + const char * e = strchr( attrs, ',' ); + if ( e == NULL ) + return NO; + + int len = (int)(e - attrs); + memcpy( buffer, attrs, len ); + buffer[len] = '\0'; + + return YES; +} + + + ++ (NSDictionary *)propertiesForClass:(Class)PNObjClass +{ + if (PNObjClass == NULL) { + return nil; + } + + NSMutableDictionary *results = [NSMutableDictionary dictionary]; + + unsigned int outCount, i; + objc_property_t *properties = class_copyPropertyList(PNObjClass, &outCount); + for (i = 0; i < outCount; i++) { + objc_property_t property = properties[i]; + const char *propName = property_getName(property); + if(propName) { + //const char *propType = getPropertyType(property); + char propType[256]; + if (!property_getTypeString(property, propType)) { + continue; + } + NSString *propertyName = [NSString stringWithUTF8String:propName]; + NSString *propertyType = [NSString stringWithUTF8String:propType]; + + NSRange range = [propertyType rangeOfString:@"T@\""]; + NSRange range2 = [propertyType rangeOfString:@"T"]; + if (range.location != NSNotFound) { + NSRange subStrRange = NSMakeRange(range.length, propertyType.length - (range.length + 1)); + propertyType = [propertyType substringWithRange:subStrRange]; + } + else if (range2.location != NSNotFound) { + NSRange subStrRange = NSMakeRange(range2.length, propertyType.length - (range2.length)); + propertyType = [propertyType substringWithRange:subStrRange]; + } + + //NSLog(@"Prop type & name: %@ -- %@", propertyType, propertyName); + + [results setObject:propertyType forKey:propertyName]; + } + } + free(properties); + + // returning a copy here to make sure the dictionary is immutable + return [NSDictionary dictionaryWithDictionary:results]; +} + +@end diff --git a/Pod/Classes/ReplaceMe.m b/Pod/Classes/ReplaceMe.m deleted file mode 100644 index e69de29..0000000