diff --git a/README.md b/README.md index d8e5bb4..b8a0b81 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,10 @@ * [AFNetworking example](/AFNetworkingExample) (Пример использования AFNetworking. Рекомендацию по использованию.) * [SDWebImage example](/SDWebImageExample) (Пример использования SDWebImage) * [RestKit example](/RestKitExample) (Пример использования RestKit) +* [UIVisualEffectView example](/dayPhoto) (Пример использования UIVisualEffectView) +* [Multitasking example](/dayPhoto) (Пример использования Multitasking) +* [Custom View Controller presentation transitions example](/dayPhoto) (Пример создания кастомной анимации перехода между View Controller) +* [Custom UICollectionView Layout example](/dayPhoto) (Пример создания кастомного UICollectionView Layout) #Cocoa diff --git a/dayPhoto/.travis.yml b/dayPhoto/.travis.yml new file mode 100755 index 0000000..75372db --- /dev/null +++ b/dayPhoto/.travis.yml @@ -0,0 +1,30 @@ +language: objective-c + +xcode_workspace: DayPhoto.xcworkspace +xcode_scheme: Staging + +before_install: + - export LANG=en_US.UTF-8 + - sudo gem install cocoapods --no-document + +install: + - pod install + +script: + - ./DayPhoto/Scripts/build.sh + - ./DayPhoto/Scripts/test.sh + +branches: + only: + - master + +notifications: + hipchat: + rooms: + - $API_TOKEN@ios-base + email: + recipients: + # - one@example.com + # - other@example.com + on_success: change # [always|never|change] # default: change + on_failure: change # [always|never|change] # default: always diff --git a/dayPhoto/DayPhoto.xcodeproj/project.pbxproj b/dayPhoto/DayPhoto.xcodeproj/project.pbxproj new file mode 100755 index 0000000..3a6283a --- /dev/null +++ b/dayPhoto/DayPhoto.xcodeproj/project.pbxproj @@ -0,0 +1,1463 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 172C0CF41C11F5B3008BFFFC /* Photos.plist in Resources */ = {isa = PBXBuildFile; fileRef = 172C0CF21C11F5B3008BFFFC /* Photos.plist */; }; + 172C0CF51C11F5B3008BFFFC /* Photos.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 172C0CF31C11F5B3008BFFFC /* Photos.xcassets */; }; + 172C0CF71C11F65C008BFFFC /* UIImage+Decompression.swift in Sources */ = {isa = PBXBuildFile; fileRef = 172C0CF61C11F65C008BFFFC /* UIImage+Decompression.swift */; }; + 1731E6BC1C10555D00316418 /* AnnotatedPhotoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1731E6BB1C10555D00316418 /* AnnotatedPhotoCell.swift */; }; + 1731E6BE1C10558500316418 /* RoundedCornersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1731E6BD1C10558500316418 /* RoundedCornersView.swift */; }; + 1731E6C11C10574900316418 /* DayPhotoLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1731E6C01C10574900316418 /* DayPhotoLayout.swift */; }; + 179838261C47C61400DCF455 /* FlipPresentAnimationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 179838251C47C61400DCF455 /* FlipPresentAnimationController.swift */; }; + 179838281C47C69B00DCF455 /* FlipDismissAnimationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 179838271C47C69B00DCF455 /* FlipDismissAnimationController.swift */; }; + 1798382A1C47C86B00DCF455 /* PhotoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 179838291C47C86B00DCF455 /* PhotoViewController.swift */; }; + 1798382C1C47CC5F00DCF455 /* SwipeInteractionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1798382B1C47CC5F00DCF455 /* SwipeInteractionController.swift */; }; + 17C004851C11A45A000ED0F9 /* Photo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17C004841C11A45A000ED0F9 /* Photo.swift */; }; + 17C004871C11A68D000ED0F9 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17C004861C11A68D000ED0F9 /* SDWebImage.framework */; }; + 17D418211C22CD3200FF5F9A /* FBSDKCoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17D4181E1C22CD3200FF5F9A /* FBSDKCoreKit.framework */; }; + 17D418221C22CD3200FF5F9A /* FBSDKLoginKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17D4181F1C22CD3200FF5F9A /* FBSDKLoginKit.framework */; }; + 17D418231C22CD3200FF5F9A /* FBSDKShareKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17D418201C22CD3200FF5F9A /* FBSDKShareKit.framework */; }; + 17D418251C22CE3C00FF5F9A /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17D418241C22CE3B00FF5F9A /* LoginViewController.swift */; }; + 17D4182B1C22E67100FF5F9A /* Fabric.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17D418271C22E67100FF5F9A /* Fabric.framework */; }; + 17D4182C1C22E67100FF5F9A /* TwitterKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17D418281C22E67100FF5F9A /* TwitterKit.framework */; }; + 17D4182D1C22E67100FF5F9A /* TwitterKitResources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 17D418291C22E67100FF5F9A /* TwitterKitResources.bundle */; }; + 17D4182E1C22E67100FF5F9A /* TwitterCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17D4182A1C22E67100FF5F9A /* TwitterCore.framework */; }; + 2124DFA01A8DF48000422313 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2124DF9F1A8DF48000422313 /* ViewController.swift */; }; + 212D018E1BB1986B00B34340 /* Swift_BaseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212D018D1BB1986B00B34340 /* Swift_BaseTests.swift */; }; + 213B89BF19F01A1E005D3749 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 213B89BE19F01A1E005D3749 /* CoreGraphics.framework */; }; + 214F4FF21BFDC2CF0084BE32 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 214F4FF11BFDC2CF0084BE32 /* Extensions.swift */; }; + 214F4FF41BFDC2D90084BE32 /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 214F4FF31BFDC2D90084BE32 /* Helpers.swift */; }; + 214F4FF61BFDC35C0084BE32 /* Protocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 214F4FF51BFDC35C0084BE32 /* Protocols.swift */; }; + 214F4FF81BFDCC680084BE32 /* APIManagerError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 214F4FF71BFDCC680084BE32 /* APIManagerError.swift */; }; + 2158286D1A91E2F200833BE6 /* mogend.sh in Resources */ = {isa = PBXBuildFile; fileRef = 2158286B1A91E2F200833BE6 /* mogend.sh */; }; + 2158286F1A91E56600833BE6 /* APIManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2158286E1A91E56600833BE6 /* APIManager.swift */; }; + 218C64C01BA07DDE00EEEDF1 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 218C64BD1BA07DDE00EEEDF1 /* Localizable.strings */; }; + 21DB301519DD2289003A418D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21DB301419DD2289003A418D /* AppDelegate.swift */; }; + 21DB301F19DD2289003A418D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 21DB301E19DD2289003A418D /* Images.xcassets */; }; + 21DB304919DD2D6D003A418D /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21DB304819DD2D6D003A418D /* Constants.swift */; }; + 21E157E21BB3EDF40041FCE4 /* FSTestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E157E11BB3EDF40041FCE4 /* FSTestHelpers.swift */; }; + A05B7FEDBE32B3F483B33908 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1218E154FF6E17259B67BF8D /* Pods.framework */; }; + E7566D9F1A1F85CB00DE3010 /* Main_Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E7566DA11A1F85CB00DE3010 /* Main_Storyboard.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXBuildRule section */ + 21DB304A19DD32B1003A418D /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.proxy.script; + fileType = wrapper.xcdatamodeld; + isEditable = 1; + outputFiles = ( + "$(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).mom", + ); + script = "echo \"Running mogend (Data model version files)\"\n\"${PROJECT_DIR}/DayPhoto/Scripts/mogend.sh\""; + }; + 21DB304B19DD32D9003A418D /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.proxy.script; + fileType = wrapper.xcdatamodel; + isEditable = 1; + outputFiles = ( + "$(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).momd", + ); + script = "echo \"Running mogend (Data model files)\"\n\"${PROJECT_DIR}/DayPhoto/Scripts/mogend.sh"; + }; +/* End PBXBuildRule section */ + +/* Begin PBXContainerItemProxy section */ + 212D01901BB1986B00B34340 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 21DB300719DD2289003A418D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 21DB300E19DD2289003A418D; + remoteInfo = DayPhoto; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 0B854B6014D9DDA9A596C69D /* Pods-DayPhotoTests.debug staging.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DayPhotoTests.debug staging.xcconfig"; path = "Pods/Target Support Files/Pods-DayPhotoTests/Pods-DayPhotoTests.debug staging.xcconfig"; sourceTree = ""; }; + 1218E154FF6E17259B67BF8D /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 172C0CF21C11F5B3008BFFFC /* Photos.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Photos.plist; sourceTree = ""; }; + 172C0CF31C11F5B3008BFFFC /* Photos.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Photos.xcassets; sourceTree = ""; }; + 172C0CF61C11F65C008BFFFC /* UIImage+Decompression.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+Decompression.swift"; sourceTree = ""; }; + 1731E6BB1C10555D00316418 /* AnnotatedPhotoCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnnotatedPhotoCell.swift; sourceTree = ""; }; + 1731E6BD1C10558500316418 /* RoundedCornersView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RoundedCornersView.swift; sourceTree = ""; }; + 1731E6C01C10574900316418 /* DayPhotoLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DayPhotoLayout.swift; sourceTree = ""; }; + 179838251C47C61400DCF455 /* FlipPresentAnimationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FlipPresentAnimationController.swift; sourceTree = ""; }; + 179838271C47C69B00DCF455 /* FlipDismissAnimationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FlipDismissAnimationController.swift; sourceTree = ""; }; + 179838291C47C86B00DCF455 /* PhotoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoViewController.swift; sourceTree = ""; }; + 1798382B1C47CC5F00DCF455 /* SwipeInteractionController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwipeInteractionController.swift; sourceTree = ""; }; + 17C004841C11A45A000ED0F9 /* Photo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Photo.swift; sourceTree = ""; }; + 17C004861C11A68D000ED0F9 /* SDWebImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDWebImage.framework; path = "Pods/build/Debug Staging-iphoneos/SDWebImage.framework"; sourceTree = ""; }; + 17D4181E1C22CD3200FF5F9A /* FBSDKCoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = FBSDKCoreKit.framework; sourceTree = ""; }; + 17D4181F1C22CD3200FF5F9A /* FBSDKLoginKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = FBSDKLoginKit.framework; sourceTree = ""; }; + 17D418201C22CD3200FF5F9A /* FBSDKShareKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = FBSDKShareKit.framework; sourceTree = ""; }; + 17D418241C22CE3B00FF5F9A /* LoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; + 17D418271C22E67100FF5F9A /* Fabric.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Fabric.framework; sourceTree = ""; }; + 17D418281C22E67100FF5F9A /* TwitterKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = TwitterKit.framework; sourceTree = ""; }; + 17D418291C22E67100FF5F9A /* TwitterKitResources.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = TwitterKitResources.bundle; path = TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle; sourceTree = ""; }; + 17D4182A1C22E67100FF5F9A /* TwitterCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = TwitterCore.framework; sourceTree = ""; }; + 194478471AAF90AF00A34744 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; + 19D856C11AB5ED2E0014C459 /* build.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; name = build.sh; path = Scripts/build.sh; sourceTree = ""; }; + 19D856C51AB5ED2E0014C459 /* test.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; name = test.sh; path = Scripts/test.sh; sourceTree = ""; }; + 19D856C71AB5EDDF0014C459 /* .travis.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .travis.yml; sourceTree = SOURCE_ROOT; }; + 2124DF9F1A8DF48000422313 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 212D018B1BB1986B00B34340 /* DayPhoto.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DayPhoto.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 212D018D1BB1986B00B34340 /* Swift_BaseTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Swift_BaseTests.swift; sourceTree = ""; }; + 212D018F1BB1986B00B34340 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 213B89BE19F01A1E005D3749 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 213B89C019F01A40005D3749 /* SpriteKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SpriteKit.framework; path = System/Library/Frameworks/SpriteKit.framework; sourceTree = SDKROOT; }; + 214F4FF11BFDC2CF0084BE32 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; + 214F4FF31BFDC2D90084BE32 /* Helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Helpers.swift; sourceTree = ""; }; + 214F4FF51BFDC35C0084BE32 /* Protocols.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Protocols.swift; sourceTree = ""; }; + 214F4FF71BFDCC680084BE32 /* APIManagerError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = APIManagerError.swift; sourceTree = ""; }; + 21513BBD19EBCBFA00EE6273 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; + 2158286B1A91E2F200833BE6 /* mogend.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = mogend.sh; path = Scripts/mogend.sh; sourceTree = ""; }; + 2158286E1A91E56600833BE6 /* APIManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = APIManager.swift; sourceTree = ""; }; + 218C64BB1BA07D3800EEEDF1 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Main_Storyboard.strings; sourceTree = ""; }; + 218C64C21BA07E1F00EEEDF1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; + 218C64C31BA07E4300EEEDF1 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; + 21C9F2DF19E833300084D18D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + 21DB300F19DD2289003A418D /* DayPhoto.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DayPhoto.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 21DB301319DD2289003A418D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 21DB301419DD2289003A418D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 21DB301E19DD2289003A418D /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 21DB303819DD2341003A418D /* BridgeHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BridgeHeader.h; sourceTree = ""; }; + 21DB304819DD2D6D003A418D /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; + 21E157E11BB3EDF40041FCE4 /* FSTestHelpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FSTestHelpers.swift; path = DayPhotoTests/FSTestHelpers.swift; sourceTree = ""; }; + 2900C0DB0F579B565AD4F9A8 /* Pods-DayPhotoTests.release staging.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DayPhotoTests.release staging.xcconfig"; path = "Pods/Target Support Files/Pods-DayPhotoTests/Pods-DayPhotoTests.release staging.xcconfig"; sourceTree = ""; }; + 51E82C8EB8DB50ECF52AE69A /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; + 7570731C5C4A951A2A3B3A1E /* libPods-DayPhotoTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-DayPhotoTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 965DB253E03512431530CABA /* Pods-DayPhotoTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DayPhotoTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-DayPhotoTests/Pods-DayPhotoTests.debug.xcconfig"; sourceTree = ""; }; + 9B62AFD8847834B4FE5064BD /* Pods-DayPhotoTests.appstore.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DayPhotoTests.appstore.xcconfig"; path = "Pods/Target Support Files/Pods-DayPhotoTests/Pods-DayPhotoTests.appstore.xcconfig"; sourceTree = ""; }; + A9F31A1C12206DF94283F801 /* Pods-DayPhotoTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DayPhotoTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-DayPhotoTests/Pods-DayPhotoTests.release.xcconfig"; sourceTree = ""; }; + AB848BC11E409F9A85D785F1 /* Pods.debug staging.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods.debug staging.xcconfig"; path = "Pods/Target Support Files/Pods/Pods.debug staging.xcconfig"; sourceTree = ""; }; + CD792995EA1B8C035C9A51B2 /* Pods.release staging.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods.release staging.xcconfig"; path = "Pods/Target Support Files/Pods/Pods.release staging.xcconfig"; sourceTree = ""; }; + E7566DA01A1F85CB00DE3010 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_Storyboard.storyboard; sourceTree = ""; }; + FF3C7DA238EA7C51D060C78B /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 212D01881BB1986B00B34340 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 21DB300C19DD2289003A418D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 17D4182B1C22E67100FF5F9A /* Fabric.framework in Frameworks */, + 17D418211C22CD3200FF5F9A /* FBSDKCoreKit.framework in Frameworks */, + 17C004871C11A68D000ED0F9 /* SDWebImage.framework in Frameworks */, + 17D4182C1C22E67100FF5F9A /* TwitterKit.framework in Frameworks */, + 17D4182E1C22E67100FF5F9A /* TwitterCore.framework in Frameworks */, + 17D418221C22CD3200FF5F9A /* FBSDKLoginKit.framework in Frameworks */, + 17D418231C22CD3200FF5F9A /* FBSDKShareKit.framework in Frameworks */, + 213B89BF19F01A1E005D3749 /* CoreGraphics.framework in Frameworks */, + A05B7FEDBE32B3F483B33908 /* Pods.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 172C0CF11C11F5A1008BFFFC /* Assets */ = { + isa = PBXGroup; + children = ( + 172C0CF21C11F5B3008BFFFC /* Photos.plist */, + 172C0CF31C11F5B3008BFFFC /* Photos.xcassets */, + ); + name = Assets; + sourceTree = ""; + }; + 1731E6BF1C10572D00316418 /* Layouts */ = { + isa = PBXGroup; + children = ( + 1731E6C01C10574900316418 /* DayPhotoLayout.swift */, + ); + name = Layouts; + sourceTree = ""; + }; + 196D6E161BAB0736000B7997 /* Helpers */ = { + isa = PBXGroup; + children = ( + 172C0CF61C11F65C008BFFFC /* UIImage+Decompression.swift */, + 214F4FF31BFDC2D90084BE32 /* Helpers.swift */, + 214F4FF11BFDC2CF0084BE32 /* Extensions.swift */, + 214F4FF51BFDC35C0084BE32 /* Protocols.swift */, + 179838251C47C61400DCF455 /* FlipPresentAnimationController.swift */, + 179838271C47C69B00DCF455 /* FlipDismissAnimationController.swift */, + 1798382B1C47CC5F00DCF455 /* SwipeInteractionController.swift */, + ); + name = Helpers; + sourceTree = ""; + }; + 19D856BF1AB5ECF50014C459 /* Travis CI */ = { + isa = PBXGroup; + children = ( + 19D856C71AB5EDDF0014C459 /* .travis.yml */, + 19D856C11AB5ED2E0014C459 /* build.sh */, + 19D856C51AB5ED2E0014C459 /* test.sh */, + ); + name = "Travis CI"; + sourceTree = ""; + }; + 212D01801BB1977100B34340 /* Tests */ = { + isa = PBXGroup; + children = ( + 21E157E11BB3EDF40041FCE4 /* FSTestHelpers.swift */, + 212D018C1BB1986B00B34340 /* UnitTests */, + ); + name = Tests; + sourceTree = ""; + }; + 212D018C1BB1986B00B34340 /* UnitTests */ = { + isa = PBXGroup; + children = ( + 212D018D1BB1986B00B34340 /* Swift_BaseTests.swift */, + 212D018F1BB1986B00B34340 /* Info.plist */, + ); + name = UnitTests; + path = DayPhotoTests; + sourceTree = ""; + }; + 215828691A91E2E000833BE6 /* Scripts */ = { + isa = PBXGroup; + children = ( + 19D856BF1AB5ECF50014C459 /* Travis CI */, + 2158286B1A91E2F200833BE6 /* mogend.sh */, + ); + name = Scripts; + sourceTree = ""; + }; + 218C64B41BA078BA00EEEDF1 /* CoreData */ = { + isa = PBXGroup; + children = ( + 17C004841C11A45A000ED0F9 /* Photo.swift */, + 218C64B51BA078BA00EEEDF1 /* Private */, + ); + path = CoreData; + sourceTree = ""; + }; + 218C64B51BA078BA00EEEDF1 /* Private */ = { + isa = PBXGroup; + children = ( + ); + path = Private; + sourceTree = ""; + }; + 218C64BC1BA07DDE00EEEDF1 /* Localization */ = { + isa = PBXGroup; + children = ( + 218C64BD1BA07DDE00EEEDF1 /* Localizable.strings */, + ); + path = Localization; + sourceTree = ""; + }; + 21DB300619DD2289003A418D = { + isa = PBXGroup; + children = ( + 21DB301119DD2289003A418D /* DayPhoto */, + 212D01801BB1977100B34340 /* Tests */, + 21DB301019DD2289003A418D /* Products */, + D9F12AAF93832B17BB391A0E /* Pods */, + 5C5B41AD2B6E0DFDD4D53E6B /* Frameworks */, + ); + sourceTree = ""; + }; + 21DB301019DD2289003A418D /* Products */ = { + isa = PBXGroup; + children = ( + 21DB300F19DD2289003A418D /* DayPhoto.app */, + 212D018B1BB1986B00B34340 /* DayPhoto.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 21DB301119DD2289003A418D /* DayPhoto */ = { + isa = PBXGroup; + children = ( + 172C0CF11C11F5A1008BFFFC /* Assets */, + 21DB304819DD2D6D003A418D /* Constants.swift */, + 21DB301419DD2289003A418D /* AppDelegate.swift */, + E7566DA11A1F85CB00DE3010 /* Main_Storyboard.storyboard */, + 21DB301E19DD2289003A418D /* Images.xcassets */, + 196D6E161BAB0736000B7997 /* Helpers */, + E731DC7A1A1CF1B700E12CBA /* Models */, + 1731E6BF1C10572D00316418 /* Layouts */, + E731DC711A1CB30C00E12CBA /* Views */, + E736C5A41A252B1500B8986E /* Controllers */, + 21DB301219DD2289003A418D /* Supporting Files */, + ); + path = DayPhoto; + sourceTree = ""; + }; + 21DB301219DD2289003A418D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 218C64BC1BA07DDE00EEEDF1 /* Localization */, + 21DB301319DD2289003A418D /* Info.plist */, + 21DB303819DD2341003A418D /* BridgeHeader.h */, + 215828691A91E2E000833BE6 /* Scripts */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 5C5B41AD2B6E0DFDD4D53E6B /* Frameworks */ = { + isa = PBXGroup; + children = ( + 17D418271C22E67100FF5F9A /* Fabric.framework */, + 17D418281C22E67100FF5F9A /* TwitterKit.framework */, + 17D418291C22E67100FF5F9A /* TwitterKitResources.bundle */, + 17D4182A1C22E67100FF5F9A /* TwitterCore.framework */, + 17D4181E1C22CD3200FF5F9A /* FBSDKCoreKit.framework */, + 17D4181F1C22CD3200FF5F9A /* FBSDKLoginKit.framework */, + 17D418201C22CD3200FF5F9A /* FBSDKShareKit.framework */, + 17C004861C11A68D000ED0F9 /* SDWebImage.framework */, + 194478471AAF90AF00A34744 /* SenTestingKit.framework */, + 213B89C019F01A40005D3749 /* SpriteKit.framework */, + 213B89BE19F01A1E005D3749 /* CoreGraphics.framework */, + 21513BBD19EBCBFA00EE6273 /* MediaPlayer.framework */, + 21C9F2DF19E833300084D18D /* AVFoundation.framework */, + 7570731C5C4A951A2A3B3A1E /* libPods-DayPhotoTests.a */, + 1218E154FF6E17259B67BF8D /* Pods.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + D9F12AAF93832B17BB391A0E /* Pods */ = { + isa = PBXGroup; + children = ( + FF3C7DA238EA7C51D060C78B /* Pods.debug.xcconfig */, + AB848BC11E409F9A85D785F1 /* Pods.debug staging.xcconfig */, + 51E82C8EB8DB50ECF52AE69A /* Pods.release.xcconfig */, + CD792995EA1B8C035C9A51B2 /* Pods.release staging.xcconfig */, + 965DB253E03512431530CABA /* Pods-DayPhotoTests.debug.xcconfig */, + 0B854B6014D9DDA9A596C69D /* Pods-DayPhotoTests.debug staging.xcconfig */, + A9F31A1C12206DF94283F801 /* Pods-DayPhotoTests.release.xcconfig */, + 9B62AFD8847834B4FE5064BD /* Pods-DayPhotoTests.appstore.xcconfig */, + 2900C0DB0F579B565AD4F9A8 /* Pods-DayPhotoTests.release staging.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + E731DC711A1CB30C00E12CBA /* Views */ = { + isa = PBXGroup; + children = ( + 1731E6BB1C10555D00316418 /* AnnotatedPhotoCell.swift */, + 1731E6BD1C10558500316418 /* RoundedCornersView.swift */, + ); + name = Views; + sourceTree = ""; + }; + E731DC7A1A1CF1B700E12CBA /* Models */ = { + isa = PBXGroup; + children = ( + E736C5E11A25CF8200B8986E /* API */, + 218C64B41BA078BA00EEEDF1 /* CoreData */, + ); + name = Models; + sourceTree = ""; + }; + E736C5A41A252B1500B8986E /* Controllers */ = { + isa = PBXGroup; + children = ( + 2124DF9F1A8DF48000422313 /* ViewController.swift */, + 17D418241C22CE3B00FF5F9A /* LoginViewController.swift */, + 179838291C47C86B00DCF455 /* PhotoViewController.swift */, + ); + name = Controllers; + sourceTree = ""; + }; + E736C5E11A25CF8200B8986E /* API */ = { + isa = PBXGroup; + children = ( + 2158286E1A91E56600833BE6 /* APIManager.swift */, + 214F4FF71BFDCC680084BE32 /* APIManagerError.swift */, + ); + name = API; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 212D018A1BB1986B00B34340 /* DayPhotoTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 212D01921BB1986B00B34340 /* Build configuration list for PBXNativeTarget "DayPhotoTests" */; + buildPhases = ( + 212D01871BB1986B00B34340 /* Sources */, + 212D01881BB1986B00B34340 /* Frameworks */, + 212D01891BB1986B00B34340 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 212D01911BB1986B00B34340 /* PBXTargetDependency */, + ); + name = DayPhotoTests; + productName = DayPhotoTests; + productReference = 212D018B1BB1986B00B34340 /* DayPhoto.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 21DB300E19DD2289003A418D /* DayPhoto */ = { + isa = PBXNativeTarget; + buildConfigurationList = 21DB303119DD2289003A418D /* Build configuration list for PBXNativeTarget "DayPhoto" */; + buildPhases = ( + F968CFE5EFDC266BFE5EBE7A /* Check Pods Manifest.lock */, + 21DB300B19DD2289003A418D /* Sources */, + 21DB300C19DD2289003A418D /* Frameworks */, + 21DB300D19DD2289003A418D /* Resources */, + 094CC2F0EF766D3A54F5369D /* Copy Pods Resources */, + 654836B709D288B4C74C22AA /* Embed Pods Frameworks */, + 17D418261C22E65400FF5F9A /* ShellScript */, + ); + buildRules = ( + 21DB304B19DD32D9003A418D /* PBXBuildRule */, + 21DB304A19DD32B1003A418D /* PBXBuildRule */, + ); + dependencies = ( + ); + name = DayPhoto; + productName = DayPhoto; + productReference = 21DB300F19DD2289003A418D /* DayPhoto.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 21DB300719DD2289003A418D /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftMigration = 0700; + LastSwiftUpdateCheck = 0700; + LastTestingUpgradeCheck = 0700; + LastUpgradeCheck = 0700; + ORGANIZATIONNAME = Flatstack; + TargetAttributes = { + 212D018A1BB1986B00B34340 = { + CreatedOnToolsVersion = 7.0; + TestTargetID = 21DB300E19DD2289003A418D; + }; + 21DB300E19DD2289003A418D = { + CreatedOnToolsVersion = 6.0.1; + DevelopmentTeam = UTXK29TA3W; + }; + }; + }; + buildConfigurationList = 21DB300A19DD2289003A418D /* Build configuration list for PBXProject "DayPhoto" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + Base, + ru, + en, + ); + mainGroup = 21DB300619DD2289003A418D; + productRefGroup = 21DB301019DD2289003A418D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 21DB300E19DD2289003A418D /* DayPhoto */, + 212D018A1BB1986B00B34340 /* DayPhotoTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 212D01891BB1986B00B34340 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 21DB300D19DD2289003A418D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E7566D9F1A1F85CB00DE3010 /* Main_Storyboard.storyboard in Resources */, + 17D4182D1C22E67100FF5F9A /* TwitterKitResources.bundle in Resources */, + 218C64C01BA07DDE00EEEDF1 /* Localizable.strings in Resources */, + 172C0CF51C11F5B3008BFFFC /* Photos.xcassets in Resources */, + 2158286D1A91E2F200833BE6 /* mogend.sh in Resources */, + 21DB301F19DD2289003A418D /* Images.xcassets in Resources */, + 172C0CF41C11F5B3008BFFFC /* Photos.plist in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 094CC2F0EF766D3A54F5369D /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 17D418261C22E65400FF5F9A /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "./Fabric.framework/run d451c14f681344df4d1323db079534a46fdbe02d da46c7fdc8d1f14710aa0cc346015267d6d2b7df053e9a2e6681cfd5ed9d9b00"; + }; + 654836B709D288B4C74C22AA /* 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/Pods-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + F968CFE5EFDC266BFE5EBE7A /* 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; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 212D01871BB1986B00B34340 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 212D018E1BB1986B00B34340 /* Swift_BaseTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 21DB300B19DD2289003A418D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 214F4FF81BFDCC680084BE32 /* APIManagerError.swift in Sources */, + 1731E6BC1C10555D00316418 /* AnnotatedPhotoCell.swift in Sources */, + 21E157E21BB3EDF40041FCE4 /* FSTestHelpers.swift in Sources */, + 17D418251C22CE3C00FF5F9A /* LoginViewController.swift in Sources */, + 2124DFA01A8DF48000422313 /* ViewController.swift in Sources */, + 1798382A1C47C86B00DCF455 /* PhotoViewController.swift in Sources */, + 1798382C1C47CC5F00DCF455 /* SwipeInteractionController.swift in Sources */, + 214F4FF61BFDC35C0084BE32 /* Protocols.swift in Sources */, + 214F4FF41BFDC2D90084BE32 /* Helpers.swift in Sources */, + 21DB301519DD2289003A418D /* AppDelegate.swift in Sources */, + 17C004851C11A45A000ED0F9 /* Photo.swift in Sources */, + 1731E6C11C10574900316418 /* DayPhotoLayout.swift in Sources */, + 2158286F1A91E56600833BE6 /* APIManager.swift in Sources */, + 21DB304919DD2D6D003A418D /* Constants.swift in Sources */, + 214F4FF21BFDC2CF0084BE32 /* Extensions.swift in Sources */, + 179838281C47C69B00DCF455 /* FlipDismissAnimationController.swift in Sources */, + 1731E6BE1C10558500316418 /* RoundedCornersView.swift in Sources */, + 172C0CF71C11F65C008BFFFC /* UIImage+Decompression.swift in Sources */, + 179838261C47C61400DCF455 /* FlipPresentAnimationController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 212D01911BB1986B00B34340 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 21DB300E19DD2289003A418D /* DayPhoto */; + targetProxy = 212D01901BB1986B00B34340 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 218C64BD1BA07DDE00EEEDF1 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + 218C64C21BA07E1F00EEEDF1 /* Base */, + 218C64C31BA07E4300EEEDF1 /* ru */, + ); + name = Localizable.strings; + sourceTree = ""; + }; + E7566DA11A1F85CB00DE3010 /* Main_Storyboard.storyboard */ = { + isa = PBXVariantGroup; + children = ( + E7566DA01A1F85CB00DE3010 /* Base */, + 218C64BB1BA07D3800EEEDF1 /* ru */, + ); + name = Main_Storyboard.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 212D01811BB1978500B34340 /* Test */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 51E82C8EB8DB50ECF52AE69A /* Pods.release.xcconfig */; + 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_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_SWIFT_FLAGS = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Test; + }; + 212D01821BB1978500B34340 /* Test */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 51E82C8EB8DB50ECF52AE69A /* Pods.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + BUNDLE_DISPLAY_NAME = DayPhoto; + BUNDLE_ID = com.flatstack.DayPhoto; + CODE_SIGN_IDENTITY = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(PROJECT_DIR)/Pods/build/Debug", + "Staging-iphoneos", + ); + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + INFOPLIST_FILE = DayPhoto/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-framework", + "\"QuartzCore\"", + ); + OTHER_SWIFT_FLAGS = "$(inherited) -DTEST"; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhoto; + PRODUCT_NAME = DayPhoto; + PROVISIONING_PROFILE = ""; + SWIFT_INSTALL_OBJC_HEADER = YES; + SWIFT_OBJC_BRIDGING_HEADER = DayPhoto/BridgeHeader.h; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + URL_HOST = "https://apple.com"; + }; + name = Test; + }; + 212D01831BB1978B00B34340 /* Test Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CD792995EA1B8C035C9A51B2 /* Pods.release staging.xcconfig */; + 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_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_SWIFT_FLAGS = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = "Test Staging"; + }; + 212D01841BB1978B00B34340 /* Test Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CD792995EA1B8C035C9A51B2 /* Pods.release staging.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-Staging"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + BUNDLE_DISPLAY_NAME = "DayPhoto Staging"; + BUNDLE_ID = com.flatstack.DayPhoto.staging; + CODE_SIGN_IDENTITY = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(PROJECT_DIR)/Pods/build/Debug", + "Staging-iphoneos", + ); + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + INFOPLIST_FILE = DayPhoto/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-framework", + "\"QuartzCore\"", + ); + OTHER_SWIFT_FLAGS = "$(inherited) -DTEST"; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhoto; + PRODUCT_NAME = DayPhoto; + PROVISIONING_PROFILE = ""; + SWIFT_INSTALL_OBJC_HEADER = YES; + SWIFT_OBJC_BRIDGING_HEADER = DayPhoto/BridgeHeader.h; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + URL_HOST = "https://apple.com"; + }; + name = "Test Staging"; + }; + 212D01851BB1981C00B34340 /* AppStore Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FF3C7DA238EA7C51D060C78B /* Pods.debug.xcconfig */; + 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_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_SWIFT_FLAGS = ""; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = "AppStore Debug"; + }; + 212D01861BB1981C00B34340 /* AppStore Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FF3C7DA238EA7C51D060C78B /* Pods.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + BUNDLE_DISPLAY_NAME = DayPhoto; + BUNDLE_ID = com.flatstack.DayPhoto; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(PLATFORM_DIR)/Developer/Library/Frameworks", + "$(PROJECT_DIR)/Pods/build/Debug", + "Staging-iphoneos", + ); + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + INFOPLIST_FILE = DayPhoto/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-framework", + "\"QuartzCore\"", + ); + OTHER_SWIFT_FLAGS = "$(inherited) -DDEBUG"; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhoto; + PRODUCT_NAME = DayPhoto; + PROVISIONING_PROFILE = ""; + SWIFT_INSTALL_OBJC_HEADER = YES; + SWIFT_OBJC_BRIDGING_HEADER = DayPhoto/BridgeHeader.h; + TARGETED_DEVICE_FAMILY = "1,2"; + URL_HOST = "https://apple.com"; + }; + name = "AppStore Debug"; + }; + 212D01931BB1986B00B34340 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FF3C7DA238EA7C51D060C78B /* Pods.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = DayPhotoTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhotoTests; + PRODUCT_NAME = DayPhoto; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DayPhoto.app/DayPhoto"; + }; + name = Debug; + }; + 212D01941BB1986B00B34340 /* AppStore Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FF3C7DA238EA7C51D060C78B /* Pods.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = DayPhotoTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhotoTests; + PRODUCT_NAME = DayPhoto; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DayPhoto.app/DayPhoto"; + }; + name = "AppStore Debug"; + }; + 212D01951BB1986B00B34340 /* Debug Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = AB848BC11E409F9A85D785F1 /* Pods.debug staging.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = DayPhotoTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhotoTests; + PRODUCT_NAME = DayPhoto; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DayPhoto.app/DayPhoto"; + }; + name = "Debug Staging"; + }; + 212D01961BB1986B00B34340 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 51E82C8EB8DB50ECF52AE69A /* Pods.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = DayPhotoTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhotoTests; + PRODUCT_NAME = DayPhoto; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DayPhoto.app/DayPhoto"; + }; + name = Release; + }; + 212D01971BB1986B00B34340 /* Test */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 51E82C8EB8DB50ECF52AE69A /* Pods.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + INFOPLIST_FILE = DayPhotoTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhotoTests; + PRODUCT_NAME = DayPhoto; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DayPhoto.app/DayPhoto"; + }; + name = Test; + }; + 212D01981BB1986B00B34340 /* AppStore */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 51E82C8EB8DB50ECF52AE69A /* Pods.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = DayPhotoTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhotoTests; + PRODUCT_NAME = DayPhoto; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DayPhoto.app/DayPhoto"; + }; + name = AppStore; + }; + 212D01991BB1986B00B34340 /* Release Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CD792995EA1B8C035C9A51B2 /* Pods.release staging.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = DayPhotoTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhotoTests; + PRODUCT_NAME = DayPhoto; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DayPhoto.app/DayPhoto"; + }; + name = "Release Staging"; + }; + 212D019A1BB1986B00B34340 /* Test Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CD792995EA1B8C035C9A51B2 /* Pods.release staging.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + INFOPLIST_FILE = DayPhotoTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhotoTests; + PRODUCT_NAME = DayPhoto; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DayPhoto.app/DayPhoto"; + }; + name = "Test Staging"; + }; + 21DB302F19DD2289003A418D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FF3C7DA238EA7C51D060C78B /* Pods.debug.xcconfig */; + 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_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_SWIFT_FLAGS = ""; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 21DB303019DD2289003A418D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 51E82C8EB8DB50ECF52AE69A /* Pods.release.xcconfig */; + 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_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_SWIFT_FLAGS = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 21DB303219DD2289003A418D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FF3C7DA238EA7C51D060C78B /* Pods.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + BUNDLE_DISPLAY_NAME = DayPhoto; + BUNDLE_ID = com.flatstack.DayPhoto; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(PLATFORM_DIR)/Developer/Library/Frameworks", + "$(PROJECT_DIR)/Pods/build/Debug", + "Staging-iphoneos", + ); + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + INFOPLIST_FILE = DayPhoto/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-framework", + "\"QuartzCore\"", + ); + OTHER_SWIFT_FLAGS = "$(inherited) -DDEBUG"; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhoto; + PRODUCT_NAME = DayPhoto; + PROVISIONING_PROFILE = ""; + SWIFT_INSTALL_OBJC_HEADER = YES; + SWIFT_OBJC_BRIDGING_HEADER = DayPhoto/BridgeHeader.h; + TARGETED_DEVICE_FAMILY = "1,2"; + URL_HOST = "https://apple.com"; + }; + name = Debug; + }; + 21DB303319DD2289003A418D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 51E82C8EB8DB50ECF52AE69A /* Pods.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + BUNDLE_DISPLAY_NAME = DayPhoto; + BUNDLE_ID = com.flatstack.DayPhoto; + CODE_SIGN_IDENTITY = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(PROJECT_DIR)/Pods/build/Debug", + "Staging-iphoneos", + ); + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + INFOPLIST_FILE = DayPhoto/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-framework", + "\"QuartzCore\"", + ); + OTHER_SWIFT_FLAGS = "$(inherited)"; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhoto; + PRODUCT_NAME = DayPhoto; + PROVISIONING_PROFILE = ""; + SWIFT_INSTALL_OBJC_HEADER = YES; + SWIFT_OBJC_BRIDGING_HEADER = DayPhoto/BridgeHeader.h; + TARGETED_DEVICE_FAMILY = "1,2"; + URL_HOST = "https://apple.com"; + }; + name = Release; + }; + 21DB304C19DD3B30003A418D /* Debug Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = AB848BC11E409F9A85D785F1 /* Pods.debug staging.xcconfig */; + 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_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_SWIFT_FLAGS = ""; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = "Debug Staging"; + }; + 21DB304D19DD3B30003A418D /* Debug Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = AB848BC11E409F9A85D785F1 /* Pods.debug staging.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-Staging"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + BUNDLE_DISPLAY_NAME = "DayPhoto Staging"; + BUNDLE_ID = com.flatstack.DayPhoto.staging; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(PLATFORM_DIR)/Developer/Library/Frameworks", + "$(PROJECT_DIR)/Pods/build/Debug", + "Staging-iphoneos", + ); + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + INFOPLIST_FILE = DayPhoto/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-framework", + "\"QuartzCore\"", + ); + OTHER_SWIFT_FLAGS = "$(inherited) -DDEBUG"; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhoto; + PRODUCT_NAME = DayPhoto; + PROVISIONING_PROFILE = ""; + SWIFT_INSTALL_OBJC_HEADER = YES; + SWIFT_OBJC_BRIDGING_HEADER = DayPhoto/BridgeHeader.h; + TARGETED_DEVICE_FAMILY = "1,2"; + URL_HOST = "https://apple.com"; + }; + name = "Debug Staging"; + }; + 21DB304F19DD3B48003A418D /* Release Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CD792995EA1B8C035C9A51B2 /* Pods.release staging.xcconfig */; + 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_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_SWIFT_FLAGS = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = "Release Staging"; + }; + 21DB305019DD3B48003A418D /* Release Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CD792995EA1B8C035C9A51B2 /* Pods.release staging.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-Staging"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + BUNDLE_DISPLAY_NAME = "DayPhoto Staging"; + BUNDLE_ID = com.flatstack.DayPhoto.staging; + CODE_SIGN_IDENTITY = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(PROJECT_DIR)/Pods/build/Debug", + "Staging-iphoneos", + ); + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + INFOPLIST_FILE = DayPhoto/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-framework", + "\"QuartzCore\"", + ); + OTHER_SWIFT_FLAGS = "$(inherited)"; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhoto; + PRODUCT_NAME = DayPhoto; + PROVISIONING_PROFILE = ""; + SWIFT_INSTALL_OBJC_HEADER = YES; + SWIFT_OBJC_BRIDGING_HEADER = DayPhoto/BridgeHeader.h; + TARGETED_DEVICE_FAMILY = "1,2"; + URL_HOST = "https://apple.com"; + }; + name = "Release Staging"; + }; + E736C5DE1A25320400B8986E /* AppStore */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 51E82C8EB8DB50ECF52AE69A /* Pods.release.xcconfig */; + 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_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_SWIFT_FLAGS = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = AppStore; + }; + E736C5DF1A25320400B8986E /* AppStore */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 51E82C8EB8DB50ECF52AE69A /* Pods.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + BUNDLE_DISPLAY_NAME = DayPhoto; + BUNDLE_ID = com.flatstack.DayPhoto; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(PROJECT_DIR)/Pods/build/Debug", + "Staging-iphoneos", + ); + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + INFOPLIST_FILE = DayPhoto/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-framework", + "\"QuartzCore\"", + ); + OTHER_SWIFT_FLAGS = "$(inherited)"; + PRODUCT_BUNDLE_IDENTIFIER = com.flatstack.DayPhoto; + PRODUCT_NAME = DayPhoto; + PROVISIONING_PROFILE = ""; + SWIFT_INSTALL_OBJC_HEADER = YES; + SWIFT_OBJC_BRIDGING_HEADER = DayPhoto/BridgeHeader.h; + TARGETED_DEVICE_FAMILY = "1,2"; + URL_HOST = "https://apple.com"; + }; + name = AppStore; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 212D01921BB1986B00B34340 /* Build configuration list for PBXNativeTarget "DayPhotoTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 212D01931BB1986B00B34340 /* Debug */, + 212D01941BB1986B00B34340 /* AppStore Debug */, + 212D01951BB1986B00B34340 /* Debug Staging */, + 212D01961BB1986B00B34340 /* Release */, + 212D01971BB1986B00B34340 /* Test */, + 212D01981BB1986B00B34340 /* AppStore */, + 212D01991BB1986B00B34340 /* Release Staging */, + 212D019A1BB1986B00B34340 /* Test Staging */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 21DB300A19DD2289003A418D /* Build configuration list for PBXProject "DayPhoto" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 21DB302F19DD2289003A418D /* Debug */, + 212D01851BB1981C00B34340 /* AppStore Debug */, + 21DB304C19DD3B30003A418D /* Debug Staging */, + 21DB303019DD2289003A418D /* Release */, + 212D01811BB1978500B34340 /* Test */, + E736C5DE1A25320400B8986E /* AppStore */, + 21DB304F19DD3B48003A418D /* Release Staging */, + 212D01831BB1978B00B34340 /* Test Staging */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 21DB303119DD2289003A418D /* Build configuration list for PBXNativeTarget "DayPhoto" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 21DB303219DD2289003A418D /* Debug */, + 212D01861BB1981C00B34340 /* AppStore Debug */, + 21DB304D19DD3B30003A418D /* Debug Staging */, + 21DB303319DD2289003A418D /* Release */, + 212D01821BB1978500B34340 /* Test */, + E736C5DF1A25320400B8986E /* AppStore */, + 21DB305019DD3B48003A418D /* Release Staging */, + 212D01841BB1978B00B34340 /* Test Staging */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 21DB300719DD2289003A418D /* Project object */; +} diff --git a/dayPhoto/DayPhoto.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/dayPhoto/DayPhoto.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100755 index 0000000..94fbbb5 --- /dev/null +++ b/dayPhoto/DayPhoto.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/dayPhoto/DayPhoto.xcodeproj/xcshareddata/xcschemes/AppStore.xcscheme b/dayPhoto/DayPhoto.xcodeproj/xcshareddata/xcschemes/AppStore.xcscheme new file mode 100755 index 0000000..580e910 --- /dev/null +++ b/dayPhoto/DayPhoto.xcodeproj/xcshareddata/xcschemes/AppStore.xcscheme @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dayPhoto/DayPhoto.xcodeproj/xcshareddata/xcschemes/Production.xcscheme b/dayPhoto/DayPhoto.xcodeproj/xcshareddata/xcschemes/Production.xcscheme new file mode 100755 index 0000000..2dde817 --- /dev/null +++ b/dayPhoto/DayPhoto.xcodeproj/xcshareddata/xcschemes/Production.xcscheme @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dayPhoto/DayPhoto.xcodeproj/xcshareddata/xcschemes/Staging.xcscheme b/dayPhoto/DayPhoto.xcodeproj/xcshareddata/xcschemes/Staging.xcscheme new file mode 100755 index 0000000..4a2058e --- /dev/null +++ b/dayPhoto/DayPhoto.xcodeproj/xcshareddata/xcschemes/Staging.xcscheme @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dayPhoto/DayPhoto.xcworkspace/contents.xcworkspacedata b/dayPhoto/DayPhoto.xcworkspace/contents.xcworkspacedata new file mode 100755 index 0000000..bd28772 --- /dev/null +++ b/dayPhoto/DayPhoto.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/dayPhoto/DayPhoto/APIManager.swift b/dayPhoto/DayPhoto/APIManager.swift new file mode 100755 index 0000000..9a9b3ee --- /dev/null +++ b/dayPhoto/DayPhoto/APIManager.swift @@ -0,0 +1,119 @@ +// +// APIManager.swift +// DayPhoto +// +// Created by Kruperfone on 16.02.15. +// Copyright (c) 2015 Flatstack. All rights reserved. +// + +import Foundation + +class APIManager: NSObject { + + class var sharedInstance: APIManager { + struct Static { + static var instance: APIManager? + static var token: dispatch_once_t = 0 + } + + dispatch_once(&Static.token) { + Static.instance = APIManager() + } + + return Static.instance! + } + + class var hostURL: NSURL { + + let URL_HOST = NSBundle.mainBundle().infoDictionary!["URL_HOST"] as! String + return NSURL(string: URL_HOST)! + } + + class var currentAPIVersion: UInt { + return 1 + } + + class var baseURL: NSURL { + + let version = "v\(self.currentAPIVersion)" + let hostURLString = "\(APIManager.hostURL.absoluteString)/\(version)" + + return NSURL(string: hostURLString)! + } + + private lazy var manager:AFHTTPRequestOperationManager = { + + let manager = AFHTTPRequestOperationManager(baseURL: APIManager.baseURL) + + manager.requestSerializer = AFJSONRequestSerializer(writingOptions: NSJSONWritingOptions.PrettyPrinted) + manager.responseSerializer = AFJSONResponseSerializer(readingOptions: NSJSONReadingOptions.AllowFragments) + + manager.responseSerializer.acceptableContentTypes = NSSet(objects: "text/plain", "text/html", "application/json") as Set + + #if DEBUG + manager.securityPolicy.allowInvalidCertificates = true + #endif + + return manager + }() +} + +//MARK: - Basic methods +extension APIManager { + + func failureErrorRecognizer (operation: AFHTTPRequestOperation?, error: NSError) -> NSError { + + guard let lOperation = operation else { + return APIManagerError.connectionMissing.generateError() + } + + guard !lOperation.cancelled else { + return APIManagerError.cancelled.generateError() + } + + return error + } + + //MARK: - Basic Methods + func GET (endpoint:String, + params:Dictionary?, + success:((operation: AFHTTPRequestOperation, responseObject: AnyObject?) -> Void)?, + failure:((operation: AFHTTPRequestOperation?, error: NSError) -> Void)?) -> AFHTTPRequestOperation? { + + let operation = manager.GET(endpoint, parameters: params, success: { (operation:AFHTTPRequestOperation!, responseObject:AnyObject!) -> Void in + + success?(operation: operation, responseObject: responseObject) + + }) { (operation: AFHTTPRequestOperation?, error: NSError) -> Void in + + var resultError = self.failureErrorRecognizer(operation, error: error) + + defer { + failure?(operation: operation, error: resultError) + } + } + + return operation + } + + func POST (endpoint:String, + params:Dictionary?, + success:((operation: AFHTTPRequestOperation, responseObject: AnyObject?) -> Void)?, + failure:((operation: AFHTTPRequestOperation?, error: NSError) -> Void)?) -> AFHTTPRequestOperation? { + + let operation = manager.POST(endpoint, parameters: params, success: { (operation:AFHTTPRequestOperation!, responseObject:AnyObject!) -> Void in + + success?(operation: operation, responseObject: responseObject) + + }) { (operation: AFHTTPRequestOperation?, error: NSError) -> Void in + + var resultError = self.failureErrorRecognizer(operation, error: error) + + defer { + failure?(operation: operation, error: resultError) + } + } + + return operation + } +} diff --git a/dayPhoto/DayPhoto/APIManagerError.swift b/dayPhoto/DayPhoto/APIManagerError.swift new file mode 100755 index 0000000..411bcc2 --- /dev/null +++ b/dayPhoto/DayPhoto/APIManagerError.swift @@ -0,0 +1,75 @@ +// +// APIManagerError.swift +// DayPhoto +// +// Created by Kruperfone on 19.11.15. +// Copyright © 2015 Flatstack. All rights reserved. +// + +import Foundation + +enum APIManagerError: Int { + + case cancelled = 0 + case connectionMissing + case notImplemented + case deviceTokenIsMissing + + //---------------// + static let domain: String = "com.apimanager" + + init? (error: NSError) { + guard error.domain == APIManagerError.domain else {return nil} + guard let code = APIManagerError(rawValue: error.code) else {return nil} + self = code + } + + var localizedDescription: String { + + switch self { + case cancelled: + return "\(self.rawValue): Request was cancelled" + + case connectionMissing: + return "\(self.rawValue): Connection is missing" + + case notImplemented: + return "\(self.rawValue): This feature is not implemented yet" + + default: + return "\(self.rawValue): Something went wrong. Please try again later" + } + } + + var failureReason: String { + switch self { + + case cancelled: + return "Operation was cancelled" + + case connectionMissing: + return "Connection is missing" + + case notImplemented: + return "The feature is not implemented" + + case deviceTokenIsMissing: + return "Device token is missing" + + } + } + + func generateError (userInfo: [NSObject : AnyObject]? = nil) -> NSError { + + var info: [NSObject : AnyObject] = [:] + if let lUserInfo = userInfo { + info += lUserInfo + } + + info.updateValue(self.localizedDescription, forKey: NSLocalizedDescriptionKey) + info.updateValue(self.failureReason, forKey: NSLocalizedFailureReasonErrorKey) + + let error = NSError(domain: APIManagerError.domain, code: self.rawValue, userInfo: info) + return error + } +} diff --git a/dayPhoto/DayPhoto/AnnotatedPhotoCell.swift b/dayPhoto/DayPhoto/AnnotatedPhotoCell.swift new file mode 100644 index 0000000..7e47b4d --- /dev/null +++ b/dayPhoto/DayPhoto/AnnotatedPhotoCell.swift @@ -0,0 +1,36 @@ +// +// AnnotatedPhotoCell.swift +// DayPhoto +// +// Created by Nikita Asabin on 3.12.15. +// Copyright (c) 2015 Flatstack. All rights reserved. +// + +import UIKit +import SDWebImage + +class AnnotatedPhotoCell: UICollectionViewCell { + + @IBOutlet private weak var imageView: UIImageView! + @IBOutlet private weak var imageViewHeightLayoutConstraint: NSLayoutConstraint! + @IBOutlet private weak var captionLabel: UILabel! + @IBOutlet private weak var commentLabel: UILabel! + + var photo: Photo? { + didSet { + if let photo = photo { + imageView.image = photo.image + captionLabel.text = photo.caption + commentLabel.text = photo.comment + } + } + } + + + override func applyLayoutAttributes(layoutAttributes: UICollectionViewLayoutAttributes) { + super.applyLayoutAttributes(layoutAttributes) + if let attributes = layoutAttributes as? DayPhotoLayoutAttributes { + imageViewHeightLayoutConstraint.constant = attributes.photoHeight + } + } +} diff --git a/dayPhoto/DayPhoto/AppDelegate.swift b/dayPhoto/DayPhoto/AppDelegate.swift new file mode 100755 index 0000000..fea8d43 --- /dev/null +++ b/dayPhoto/DayPhoto/AppDelegate.swift @@ -0,0 +1,136 @@ +// +// AppDelegate.swift +// DayPhoto +// +// Created by Kruperfone on 02.10.14. +// Copyright (c) 2014 Flatstack. All rights reserved. +// + +import UIKit +import CoreData +import SDWebImage +import MagicalRecord +import FBSDKCoreKit +import Fabric +import TwitterKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool + { + #if TEST + switch TestingMode() { + case .Unit: + print("Unit Tests") + self.window?.rootViewController = UIViewController() + return true + + case .UI: + print("UI Tests") + } + #endif + + FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions) + Fabric.with([Twitter.self]) + + //setting AFNetwork + /* + AFNetworkReachabilityManager.sharedManager().startMonitoring() + AFNetworkActivityIndicatorManager.sharedManager().enabled = true + */ + + //setting SDWebImage + + + let imageCache:SDImageCache = SDImageCache.sharedImageCache() + imageCache.maxCacheSize = 1024*1024*100 // 100mb on disk + imageCache.maxMemoryCost = 1024*1024*10 // 10mb in memory + + let imageDownloader:SDWebImageDownloader = SDWebImageDownloader.sharedDownloader() + imageDownloader.downloadTimeout = 60.0 + + MagicalRecord.setupCoreDataStackWithStoreNamed("DayPhoto") + //setting Crashlytics + /* + if DEBUG == 1 + { + println("Crashlytics is disabled in DEBUG") + } + else + { + Crashlytics.startWithAPIKey(kAPIKeyCrashlitycs) + } + */ + + return true + } + + func applicationWillResignActive(application: UIApplication) + { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(application: UIApplication) + { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(application: UIApplication) + { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(application: UIApplication) + { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(application: UIApplication) + { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + // Saves changes in the application's managed object context before the application terminates. + } + + func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool { + FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication:sourceApplication, annotation: annotation) + VKSdk.processOpenURL(url, fromApplication: sourceApplication) + return true + } + + func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool { + VKSdk.processOpenURL(url, fromApplication: options.fs_objectForKey(UIApplicationOpenURLOptionsSourceApplicationKey, orDefault: "") as! String) + return true + } + //MARK: - Remote Notifications + + func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) { + + let tokenChars = UnsafePointer(deviceToken.bytes) + var tokenString = "" + + for var i = 0; i < deviceToken.length; i++ { + let formatString = "%02.2hhx" + tokenString += String(format: formatString, arguments: [tokenChars[i]]) + } + + NSUserDefaults.standardUserDefaults().setObject(deviceToken, forKey: SBKeyUserDefaultsDeviceTokenData) + NSUserDefaults.standardUserDefaults().setObject(tokenString, forKey: SBKeyUserDefaultsDeviceTokenString) + NSUserDefaults.standardUserDefaults().synchronize() + } + + func requestForRemoteNotifications () { + if #available(iOS 8.0, *) { + UIApplication.sharedApplication().registerUserNotificationSettings(UIUserNotificationSettings(forTypes: [UIUserNotificationType.Alert, UIUserNotificationType.Sound, UIUserNotificationType.Badge], categories: nil)) + UIApplication.sharedApplication().registerForRemoteNotifications() + } else { + UIApplication.sharedApplication().registerForRemoteNotificationTypes([UIRemoteNotificationType.Alert, UIRemoteNotificationType.Sound, UIRemoteNotificationType.Badge]) + } + } +} + + diff --git a/dayPhoto/DayPhoto/Base.lproj/Main_Storyboard.storyboard b/dayPhoto/DayPhoto/Base.lproj/Main_Storyboard.storyboard new file mode 100755 index 0000000..caee7cd --- /dev/null +++ b/dayPhoto/DayPhoto/Base.lproj/Main_Storyboard.storyboard @@ -0,0 +1,582 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dayPhoto/DayPhoto/BridgeHeader.h b/dayPhoto/DayPhoto/BridgeHeader.h new file mode 100755 index 0000000..8b27503 --- /dev/null +++ b/dayPhoto/DayPhoto/BridgeHeader.h @@ -0,0 +1,17 @@ +// +// BridgeHeader.h +// DayPhoto +// +// Created by Kruperfone on 02.10.14. +// Copyright (c) 2014 Flatstack. All rights reserved. +// + +@import FSHelpers_Swift; + +@import AFNetworking; + +#import +#import +#import + +@import VK_ios_sdk; \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Constants.swift b/dayPhoto/DayPhoto/Constants.swift new file mode 100755 index 0000000..2035a14 --- /dev/null +++ b/dayPhoto/DayPhoto/Constants.swift @@ -0,0 +1,64 @@ +// +// Constants.swift +// DayPhoto +// +// Created by Kruperfone on 02.10.14. +// Copyright (c) 2014 Flatstack. All rights reserved. +// + +import UIKit + +/*----------API keys---------*/ +//For API Keys use prefix ABKeyAPI where AB is capital letters of your project name +//For example: 'SBKeyAPIMock' for DayPhoto + +/*--------------User Defaults keys-------------*/ +let SBKeyUserDefaultsDeviceTokenData = "kUserDefaultsDeviceTokenData" +let SBKeyUserDefaultsDeviceTokenString = "kUserDefaultsDeviceTokenString" + +/*----------Notifications---------*/ +//For Notifications use prefix ABNotif where AB is capital letters of your project name +//For example: 'SBNotifMock' for DayPhoto + +/*--------------Fonts-------------*/ + +//Example of custom font family name +enum AppFont: Int { + case Regular = 0 + case Bold + case Italic + + static var allValues: [AppFont] { + var fonts: [AppFont] = [] + var i = 0 + while let font = AppFont(rawValue: i) { + fonts.append(font) + i++ + } + return fonts + } + + static let familyName = "FontFamilyName" + var familyName: String {return AppFont.familyName} + + var description : String { + switch self { + case .Regular: return "FontFamilyName-Regular"; + case .Bold: return "FontFamilyName-Bold"; + case .Italic: return "FontFamilyName-Italic"; + } + } + + func font (size:CGFloat) -> UIFont? { + switch self { + case .Regular: return UIFont(name: self.description, size: size) + case .Bold: return UIFont(name: self.description, size: size) + case .Italic: return UIFont(name: self.description, size: size) + } + } +} + +/*----------Colors----------*/ + +//Example of custom color schemes in application +let AppColor = UIColor.clearColor() diff --git a/dayPhoto/DayPhoto/CoreData/DayPhoto.xcdatamodeld/.xccurrentversion b/dayPhoto/DayPhoto/CoreData/DayPhoto.xcdatamodeld/.xccurrentversion new file mode 100755 index 0000000..0c67376 --- /dev/null +++ b/dayPhoto/DayPhoto/CoreData/DayPhoto.xcdatamodeld/.xccurrentversion @@ -0,0 +1,5 @@ + + + + + diff --git a/dayPhoto/DayPhoto/CoreData/DayPhoto.xcdatamodeld/DayPhoto.xcdatamodel/contents b/dayPhoto/DayPhoto/CoreData/DayPhoto.xcdatamodeld/DayPhoto.xcdatamodel/contents new file mode 100644 index 0000000..f0a431b --- /dev/null +++ b/dayPhoto/DayPhoto/CoreData/DayPhoto.xcdatamodeld/DayPhoto.xcdatamodel/contents @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/dayPhoto/DayPhoto/CoreData/Photo.swift b/dayPhoto/DayPhoto/CoreData/Photo.swift new file mode 100644 index 0000000..7d82542 --- /dev/null +++ b/dayPhoto/DayPhoto/CoreData/Photo.swift @@ -0,0 +1,42 @@ + +import UIKit + +class Photo { + + class func allPhotos() -> [Photo] { + var photos = [Photo]() + if let URL = NSBundle.mainBundle().URLForResource("Photos", withExtension: "plist") { + if let photosFromPlist = NSArray(contentsOfURL: URL) { + for dictionary in photosFromPlist { + let photo = Photo(dictionary: dictionary as! NSDictionary) + photos.append(photo) + } + } + } + return photos + } + + var caption: String + var comment: String + var image: UIImage + + init(caption: String, comment: String, image: UIImage) { + self.caption = caption + self.comment = comment + self.image = image + } + + convenience init(dictionary: NSDictionary) { + let caption = dictionary["Caption"] as? String + let comment = dictionary["Comment"] as? String + let photo = dictionary["Photo"] as? String + let image = UIImage(named: photo!)?.decompressedImage + self.init(caption: caption!, comment: comment!, image: image!) + } + + func heightForComment(font: UIFont, width: CGFloat) -> CGFloat { + let rect = NSString(string: comment).boundingRectWithSize(CGSize(width: width, height: CGFloat(MAXFLOAT)), options: .UsesLineFragmentOrigin, attributes: [NSFontAttributeName: font], context: nil) + return ceil(rect.height) + } + +} diff --git a/dayPhoto/DayPhoto/DayPhotoLayout.swift b/dayPhoto/DayPhoto/DayPhotoLayout.swift new file mode 100644 index 0000000..98dffcb --- /dev/null +++ b/dayPhoto/DayPhoto/DayPhotoLayout.swift @@ -0,0 +1,123 @@ +// +// DayPhotoLayout.swift +// DayPhoto +// +// Created by Nikita Asabin on 3.12.15. +// Copyright (c) 2015 Flatstack. All rights reserved. +// + +import UIKit +protocol DayPhotoLayoutDelegate { + // 1. Method to ask the delegate for the height of the image + func collectionView(collectionView:UICollectionView, heightForPhotoAtIndexPath indexPath:NSIndexPath , withWidth:CGFloat) -> CGFloat + // 2. Method to ask the delegate for the height of the annotation text + func collectionView(collectionView: UICollectionView, heightForAnnotationAtIndexPath indexPath: NSIndexPath, withWidth width: CGFloat) -> CGFloat + +} + +class DayPhotoLayoutAttributes:UICollectionViewLayoutAttributes { + + // 1. Custom attribute + var photoHeight: CGFloat = 0.0 + + // 2. Override copyWithZone to conform to NSCopying protocol + override func copyWithZone(zone: NSZone) -> AnyObject { + let copy = super.copyWithZone(zone) as! DayPhotoLayoutAttributes + copy.photoHeight = photoHeight + return copy + } + + // 3. Override isEqual + override func isEqual(object: AnyObject?) -> Bool { + if let attributtes = object as? DayPhotoLayoutAttributes { + if( attributtes.photoHeight == photoHeight ) { + return super.isEqual(object) + } + } + return false + } +} + + +class DayPhotoLayout: UICollectionViewLayout { + //1. DayPhoto Layout Delegate + var delegate:DayPhotoLayoutDelegate! + + //2. Configurable properties + var numberOfColumns = 2 + var cellPadding: CGFloat = 6.0 + + //3. Array to keep a cache of attributes. + private var cache = [DayPhotoLayoutAttributes]() + + //4. Content height and size + private var contentHeight:CGFloat = 0.0 + private var contentWidth: CGFloat { + let insets = collectionView!.contentInset + return CGRectGetWidth(collectionView!.bounds) - (insets.left + insets.right) + } + + override class func layoutAttributesClass() -> AnyClass { + return DayPhotoLayoutAttributes.self + } + + override func prepareLayout() { + // 1. Only calculate once + if cache.isEmpty { + + // 2. Pre-Calculates the X Offset for every column and adds an array to increment the currently max Y Offset for each column + let columnWidth = contentWidth / CGFloat(numberOfColumns) + var xOffset = [CGFloat]() + for column in 0 ..< numberOfColumns { + xOffset.append(CGFloat(column) * columnWidth ) + } + var column = 0 + var yOffset = [CGFloat](count: numberOfColumns, repeatedValue: 0) + + // 3. Iterates through the list of items in the first section + for item in 0 ..< collectionView!.numberOfItemsInSection(0) { + + let indexPath = NSIndexPath(forItem: item, inSection: 0) + + // 4. Asks the delegate for the height of the picture and the annotation and calculates the cell frame. + let width = columnWidth - cellPadding*2 + let photoHeight = delegate.collectionView(collectionView!, heightForPhotoAtIndexPath: indexPath , withWidth:width) + let annotationHeight = delegate.collectionView(collectionView!, heightForAnnotationAtIndexPath: indexPath, withWidth: width) + let height = cellPadding + photoHeight + annotationHeight + cellPadding + let frame = CGRect(x: xOffset[column], y: yOffset[column], width: columnWidth, height: height) + let insetFrame = CGRectInset(frame, cellPadding, cellPadding) + + // 5. Creates an UICollectionViewLayoutItem with the frame and add it to the cache + let attributes = DayPhotoLayoutAttributes(forCellWithIndexPath: indexPath) + attributes.photoHeight = photoHeight + attributes.frame = insetFrame + cache.append(attributes) + + // 6. Updates the collection view content height + contentHeight = max(contentHeight, CGRectGetMaxY(frame)) + yOffset[column] = yOffset[column] + height + + column = column >= (numberOfColumns - 1) ? 0 : ++column + } + } + } + + override func collectionViewContentSize() -> CGSize { + return CGSize(width: contentWidth, height: contentHeight) + } + + override func layoutAttributesForElementsInRect(rect: CGRect) -> [UICollectionViewLayoutAttributes]? { + + var layoutAttributes = [UICollectionViewLayoutAttributes]() + + // Loop through the cache and look for items in the rect + for attributes in cache { + if CGRectIntersectsRect(attributes.frame, rect ) { + layoutAttributes.append(attributes) + } + } + return layoutAttributes + } +} + + diff --git a/dayPhoto/DayPhoto/Extensions.swift b/dayPhoto/DayPhoto/Extensions.swift new file mode 100755 index 0000000..3618be0 --- /dev/null +++ b/dayPhoto/DayPhoto/Extensions.swift @@ -0,0 +1,9 @@ +// +// Extensions.swift +// DayPhoto +// +// Created by Kruperfone on 19.11.15. +// Copyright © 2015 Flatstack. All rights reserved. +// + +import Foundation diff --git a/dayPhoto/DayPhoto/FlipDismissAnimationController.swift b/dayPhoto/DayPhoto/FlipDismissAnimationController.swift new file mode 100644 index 0000000..a762fcd --- /dev/null +++ b/dayPhoto/DayPhoto/FlipDismissAnimationController.swift @@ -0,0 +1,67 @@ +// +// FlipDismissAnimationController.swift +// DayPhoto +// +// Created by Nikita Asabin on 14.01.16. +// Copyright © 2016 Flatstack. All rights reserved. +// + +import UIKit + +class FlipDismissAnimationController: NSObject, UIViewControllerAnimatedTransitioning { + var destinationFrame = CGRectZero + + func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval { + return 0.6 + } + + func animateTransition(transitionContext: UIViewControllerContextTransitioning) { + + guard let fromVC = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey), + let containerView = transitionContext.containerView(), + let toVC = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey) else { + return + } + + let finalFrame = destinationFrame + + let snapshot = fromVC.view.snapshotViewAfterScreenUpdates(false) + + snapshot.layer.cornerRadius = 25 + snapshot.layer.masksToBounds = true + + containerView.addSubview(toVC.view) + containerView.addSubview(snapshot) + fromVC.view.hidden = true + + AnimationHelper.perspectiveTransformForContainerView(containerView) + + toVC.view.layer.transform = AnimationHelper.yRotation(-M_PI_2) + + let duration = transitionDuration(transitionContext) + + UIView.animateKeyframesWithDuration( + duration, + delay: 0, + options: .CalculationModeCubic, + animations: { + + UIView.addKeyframeWithRelativeStartTime(0.0, relativeDuration: 1/3, animations: { + snapshot.frame = finalFrame + }) + + UIView.addKeyframeWithRelativeStartTime(1/3, relativeDuration: 1/3, animations: { + snapshot.layer.transform = AnimationHelper.yRotation(M_PI_2) + }) + + UIView.addKeyframeWithRelativeStartTime(2/3, relativeDuration: 1/3, animations: { + toVC.view.layer.transform = AnimationHelper.yRotation(0.0) + }) + }, + completion: { _ in + fromVC.view.hidden = false + snapshot.removeFromSuperview() + transitionContext.completeTransition(!transitionContext.transitionWasCancelled()) + }) + } +} diff --git a/dayPhoto/DayPhoto/FlipPresentAnimationController.swift b/dayPhoto/DayPhoto/FlipPresentAnimationController.swift new file mode 100644 index 0000000..b10c33b --- /dev/null +++ b/dayPhoto/DayPhoto/FlipPresentAnimationController.swift @@ -0,0 +1,71 @@ +// +// FlipPresentAnimationController.swift +// DayPhoto +// +// Created by Nikita Asabin on 14.01.16. +// Copyright © 2016 Flatstack. All rights reserved. +// + +import UIKit + +class FlipPresentAnimationController: NSObject, UIViewControllerAnimatedTransitioning { + + var originFrame = CGRectZero + + func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval { + return 0.6 + } + + func animateTransition(transitionContext: UIViewControllerContextTransitioning) { + + guard let fromVC = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey), + let containerView = transitionContext.containerView(), + let toVC = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey) else { + return + } + + let initialFrame = originFrame + let finalFrame = transitionContext.finalFrameForViewController(toVC) + + let snapshot = toVC.view.snapshotViewAfterScreenUpdates(true) + + snapshot.frame = initialFrame + snapshot.layer.cornerRadius = 25 + snapshot.layer.masksToBounds = true + + containerView.addSubview(toVC.view) + containerView.addSubview(snapshot) + toVC.view.hidden = true + + AnimationHelper.perspectiveTransformForContainerView(containerView) + + snapshot.layer.transform = AnimationHelper.yRotation(M_PI_2) + + let duration = transitionDuration(transitionContext) + + UIView.animateKeyframesWithDuration( + duration, + delay: 0, + options: .CalculationModeCubic, + animations: { + + UIView.addKeyframeWithRelativeStartTime(0.0, relativeDuration: 1/3, animations: { + fromVC.view.layer.transform = AnimationHelper.yRotation(-M_PI_2) + }) + + UIView.addKeyframeWithRelativeStartTime(1/3, relativeDuration: 1/3, animations: { + snapshot.layer.transform = AnimationHelper.yRotation(0.0) + }) + + UIView.addKeyframeWithRelativeStartTime(2/3, relativeDuration: 1/3, animations: { + snapshot.frame = finalFrame + }) + }, + completion: { _ in + toVC.view.hidden = false + snapshot.removeFromSuperview() + transitionContext.completeTransition(!transitionContext.transitionWasCancelled()) + }) + } + +} diff --git a/dayPhoto/DayPhoto/GVAligmentCollectionViewFlowLayout.h b/dayPhoto/DayPhoto/GVAligmentCollectionViewFlowLayout.h new file mode 100755 index 0000000..aed6b67 --- /dev/null +++ b/dayPhoto/DayPhoto/GVAligmentCollectionViewFlowLayout.h @@ -0,0 +1,30 @@ +// +// GVAligmentCollectionViewFlowLayout.h +// Swift-Base +// +// Created by Vladimir Goncharov on 05.12.14. +// Copyright (c) 2014 Flatstack. All rights reserved. +// + +#import + +typedef NS_ENUM(NSUInteger, GVAligmentCollectionViewFlowLayoutAligmentVertical) +{ + GVAligmentCollectionViewFlowLayoutAligmentVerticalTop, + GVAligmentCollectionViewFlowLayoutAligmentVerticalCenter, + GVAligmentCollectionViewFlowLayoutAligmentVerticalBottom +}; + +typedef NS_ENUM(NSUInteger, GVAligmentCollectionViewFlowLayoutAligmentHorizontal) +{ + GVAligmentCollectionViewFlowLayoutAligmentHorizontalLeft, + GVAligmentCollectionViewFlowLayoutAligmentHorizontalCenter, + GVAligmentCollectionViewFlowLayoutAligmentHorizontalRight +}; + +@interface GVAligmentCollectionViewFlowLayout : UICollectionViewFlowLayout + +@property (nonatomic, assign) GVAligmentCollectionViewFlowLayoutAligmentVertical verticalAligment; +@property (nonatomic, assign) GVAligmentCollectionViewFlowLayoutAligmentHorizontal horizontalAligment; + +@end diff --git a/dayPhoto/DayPhoto/GVAligmentCollectionViewFlowLayout.m b/dayPhoto/DayPhoto/GVAligmentCollectionViewFlowLayout.m new file mode 100755 index 0000000..034f9b3 --- /dev/null +++ b/dayPhoto/DayPhoto/GVAligmentCollectionViewFlowLayout.m @@ -0,0 +1,53 @@ +// +// GVAligmentCollectionViewFlowLayout.m +// Swift-Base +// +// Created by Vladimir Goncharov on 05.12.14. +// Copyright (c) 2014 Flatstack. All rights reserved. +// + +#import "GVAligmentCollectionViewFlowLayout.h" + +@implementation GVAligmentCollectionViewFlowLayout + +- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect{ + NSArray* attributesToReturn = [super layoutAttributesForElementsInRect:rect]; + for (UICollectionViewLayoutAttributes* attributes in attributesToReturn) { + if (nil == attributes.representedElementKind) { + NSIndexPath* indexPath = attributes.indexPath; + attributes.frame = [self layoutAttributesForItemAtIndexPath:indexPath].frame; + } + } + return attributesToReturn; +} + +- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath { + UICollectionViewLayoutAttributes *currentItemAttributes = [super layoutAttributesForItemAtIndexPath:indexPath]; + +// switch (self.horizontalAligment) +// { +// case GVAligmentCollectionViewFlowLayoutAligmentHorizontalLeft: +// { +// return +// }; break; +// +// case GVAligmentCollectionViewFlowLayoutAligmentHorizontalCenter: +// { +// +// }; break; +// +// case GVAligmentCollectionViewFlowLayoutAligmentHorizontalRight: +// { +// +// }; break; +// +// default: +// break; +// } + currentItemAttributes.frame = CGRectOffset(currentItemAttributes.frame, 0, 0.5 * CGRectGetHeight(currentItemAttributes.frame)); + + return currentItemAttributes; +} + + +@end diff --git a/dayPhoto/DayPhoto/Helpers.swift b/dayPhoto/DayPhoto/Helpers.swift new file mode 100755 index 0000000..16e6faf --- /dev/null +++ b/dayPhoto/DayPhoto/Helpers.swift @@ -0,0 +1,21 @@ +// +// Helpers.swift +// DayPhoto +// +// Created by Kruperfone on 19.11.15. +// Copyright © 2015 Flatstack. All rights reserved. +// + +import Foundation + +struct AnimationHelper { + static func yRotation(angle: Double) -> CATransform3D { + return CATransform3DMakeRotation(CGFloat(angle), 0.0, 1.0, 0.0) + } + + static func perspectiveTransformForContainerView(containerView: UIView) { + var transform = CATransform3DIdentity + transform.m34 = -0.002 + containerView.layer.sublayerTransform = transform + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Contents.json b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Contents.json new file mode 100755 index 0000000..3a12f3f --- /dev/null +++ b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Contents.json @@ -0,0 +1,80 @@ +{ + "images" : [ + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-Small@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-Small@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-40@2x-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-60@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-Small.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-Small@2x-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-40.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-76@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-40.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-40.png new file mode 100755 index 0000000..201c803 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-40.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-40@2x-1.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-40@2x-1.png new file mode 100755 index 0000000..7baef82 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-40@2x-1.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-40@2x.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-40@2x.png new file mode 100755 index 0000000..7baef82 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-40@2x.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-40@3x.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-40@3x.png new file mode 100755 index 0000000..57e8bf5 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-40@3x.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-60@2x.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-60@2x.png new file mode 100755 index 0000000..57e8bf5 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-60@2x.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-60@3x.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-60@3x.png new file mode 100755 index 0000000..d5d185d Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-60@3x.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-76.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-76.png new file mode 100755 index 0000000..2d69daa Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-76.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-76@2x.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-76@2x.png new file mode 100755 index 0000000..9c6bb41 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-76@2x.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-Small.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-Small.png new file mode 100755 index 0000000..1ace2ac Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-Small.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-Small@2x-1.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-Small@2x-1.png new file mode 100755 index 0000000..f203122 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-Small@2x-1.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-Small@2x.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-Small@2x.png new file mode 100755 index 0000000..f203122 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-Small@2x.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-Small@3x.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-Small@3x.png new file mode 100755 index 0000000..d25d8ab Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon-Staging.appiconset/Icon-Small@3x.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Contents.json b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..f9a130d --- /dev/null +++ b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,80 @@ +{ + "images" : [ + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-Small@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-Small@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-60@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-Small-1.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-Small@2x-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-40.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-40@2x-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-76@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-40.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-40.png new file mode 100755 index 0000000..fc9c08e Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-40.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-40@2x-1.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-40@2x-1.png new file mode 100755 index 0000000..cb65218 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-40@2x-1.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png new file mode 100755 index 0000000..cb65218 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png new file mode 100755 index 0000000..6d6fd71 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png new file mode 100755 index 0000000..6d6fd71 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png new file mode 100755 index 0000000..bb4e123 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-76.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-76.png new file mode 100755 index 0000000..1693d7e Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-76.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png new file mode 100755 index 0000000..de93d9c Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-Small-1.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-Small-1.png new file mode 100755 index 0000000..a395fb0 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-Small-1.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png new file mode 100755 index 0000000..675e5c2 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png new file mode 100755 index 0000000..675e5c2 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png new file mode 100755 index 0000000..722b0e3 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/Contents.json b/dayPhoto/DayPhoto/Images.xcassets/Contents.json new file mode 100755 index 0000000..da4a164 --- /dev/null +++ b/dayPhoto/DayPhoto/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/1228625-2560x1600.png b/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/1228625-2560x1600.png new file mode 100755 index 0000000..434d494 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/1228625-2560x1600.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/128625-2560x1600-4.png b/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/128625-2560x1600-4.png new file mode 100755 index 0000000..d78dc53 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/128625-2560x1600-4.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/128625-2560x1600-5.png b/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/128625-2560x1600-5.png new file mode 100755 index 0000000..e334f15 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/128625-2560x1600-5.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/128625-2560x1600.png b/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/128625-2560x1600.png new file mode 100755 index 0000000..8f1213f Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/128625-2560x1600.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/Contents.json b/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100755 index 0000000..40cc61f --- /dev/null +++ b/dayPhoto/DayPhoto/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,43 @@ +{ + "images" : [ + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "736h", + "filename" : "128625-2560x1600.png", + "minimum-system-version" : "8.0", + "orientation" : "portrait", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "667h", + "filename" : "1228625-2560x1600.png", + "minimum-system-version" : "8.0", + "orientation" : "portrait", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "filename" : "128625-2560x1600-4.png", + "scale" : "2x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "retina4", + "filename" : "128625-2560x1600-5.png", + "minimum-system-version" : "7.0", + "orientation" : "portrait", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Images.xcassets/test.imageset/Artboard 1-1.png b/dayPhoto/DayPhoto/Images.xcassets/test.imageset/Artboard 1-1.png new file mode 100755 index 0000000..0bb3463 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/test.imageset/Artboard 1-1.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/test.imageset/Artboard 1-2.png b/dayPhoto/DayPhoto/Images.xcassets/test.imageset/Artboard 1-2.png new file mode 100755 index 0000000..0bb3463 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/test.imageset/Artboard 1-2.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/test.imageset/Artboard 1.png b/dayPhoto/DayPhoto/Images.xcassets/test.imageset/Artboard 1.png new file mode 100755 index 0000000..0bb3463 Binary files /dev/null and b/dayPhoto/DayPhoto/Images.xcassets/test.imageset/Artboard 1.png differ diff --git a/dayPhoto/DayPhoto/Images.xcassets/test.imageset/Contents.json b/dayPhoto/DayPhoto/Images.xcassets/test.imageset/Contents.json new file mode 100755 index 0000000..47fee9e --- /dev/null +++ b/dayPhoto/DayPhoto/Images.xcassets/test.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Artboard 1-1.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "Artboard 1.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Artboard 1-2.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Info.plist b/dayPhoto/DayPhoto/Info.plist new file mode 100755 index 0000000..0f16929 --- /dev/null +++ b/dayPhoto/DayPhoto/Info.plist @@ -0,0 +1,144 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${BUNDLE_DISPLAY_NAME} + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleURLTypes + + + CFBundleURLSchemes + + fb1678213849130486 + + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + vk5191828 + + + + CFBundleVersion + 1 + Fabric + + APIKey + d451c14f681344df4d1323db079534a46fdbe02d + Kits + + + KitInfo + + consumerKey + ticevCAkpR1RQT8TvjOmfy0Al + consumerSecret + CaZZqdTQgSJx8hobOYgF63s8MpjSRsklhNMfOsz7Q7ZJXnJK7l + + KitName + Twitter + + + + FacebookAppID + 1678213849130486 + FacebookDisplayName + pdpDecember + LSApplicationQueriesSchemes + + fbapi + fb-messenger-api + fbauth2 + fbshareextension + vk + vk-share + vkauthorize + + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSExceptionDomains + + akamaihd.net + + NSIncludesSubdomains + + NSThirdPartyExceptionRequiresForwardSecrecy + + + facebook.com + + NSIncludesSubdomains + + NSThirdPartyExceptionRequiresForwardSecrecy + + + fbcdn.net + + NSIncludesSubdomains + + NSThirdPartyExceptionRequiresForwardSecrecy + + + vk.com + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionRequiresForwardSecrecy + + NSIncludesSubdomains + + + + + UILaunchStoryboardName + Main_Storyboard + UIMainStoryboardFile + Main_Storyboard + UIMainStoryboardFile~ipad + Main_Storyboard + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarStyle + UIStatusBarStyleLightContent + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationPortraitUpsideDown + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + URL_HOST + ${URL_HOST} + + diff --git a/dayPhoto/DayPhoto/Localization/Base.lproj/Localizable.strings b/dayPhoto/DayPhoto/Localization/Base.lproj/Localizable.strings new file mode 100755 index 0000000..6cbb103 --- /dev/null +++ b/dayPhoto/DayPhoto/Localization/Base.lproj/Localizable.strings @@ -0,0 +1,18 @@ +/* Localized versions of Info.plist keys */ + +/*------------Common-----------*/ +"ERROR" = "Error"; +"NO" = "No"; +"YES" = "Yes"; +"OK" = "Ok"; + +"ORDER" = "Order"; + +/*-------------API-----------*/ +"API_VERSION_DEPRECATED" = "The current API version deprecated"; +"OPERATION_WAS_CANCELLED" = "Operation was cancelled"; +"NOT_FOUND" = "Not found"; +"UNKNOW_ERROR" = "Unknow error"; + +//"" = ""; +// /*-------------CATEGORY-----------*/ diff --git a/dayPhoto/DayPhoto/Localization/ru.lproj/Localizable.strings b/dayPhoto/DayPhoto/Localization/ru.lproj/Localizable.strings new file mode 100755 index 0000000..1c25617 --- /dev/null +++ b/dayPhoto/DayPhoto/Localization/ru.lproj/Localizable.strings @@ -0,0 +1,18 @@ +/* Localized versions of Info.plist keys */ + +/*------------Common-----------*/ +"ERROR" = "Ошибка"; +"NO" = "Нет"; +"YES" = "Да"; +"OK" = "Ок"; + +"ORDER" = "Заказ"; + +/*-------------API-----------*/ +"API_VERSION_DEPRECATED" = "Текущая версия API устарела"; +"OPERATION_WAS_CANCELLED" = "Операция была отменена"; +"NOT_FOUND" = "Не найдено"; +"UNKNOW_ERROR" = "Неизвестная ошибка"; + +//"" = ""; +// /*-------------CATEGORY-----------*/ diff --git a/dayPhoto/DayPhoto/LoginViewController.swift b/dayPhoto/DayPhoto/LoginViewController.swift new file mode 100644 index 0000000..ae4534f --- /dev/null +++ b/dayPhoto/DayPhoto/LoginViewController.swift @@ -0,0 +1,95 @@ +// +// LoginViewController.swift +// DayPhoto +// +// Created by Nikita Asabin on 17.12.15. +// Copyright © 2015 Flatstack. All rights reserved. +// + +import UIKit +import TwitterKit + +class LoginViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + let vkSdk = VKSdk.initializeWithAppId("5191828") + vkSdk.registerDelegate(self) + vkSdk.uiDelegate = self + + let blurEffect = UIBlurEffect(style: .Light) + let blurView = UIVisualEffectView(effect: blurEffect) + blurView.frame = self.view.bounds + self.view.insertSubview(blurView, atIndex: 0) + self.createLoginButtons() + // Do any additional setup after loading the view. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + func createLoginButtons() { + let fbLoginButton = FBSDKLoginButton.init() + fbLoginButton.center = CGPoint.init(x: 120, y: 50) + self.view.addSubview(fbLoginButton) + + let twitterLogInButton = TWTRLogInButton { (session, error) in + if let unwrappedSession = session { + let alert = UIAlertController(title: "Logged In", + message: "User \(unwrappedSession.userName) has logged in", + preferredStyle: UIAlertControllerStyle.Alert + ) + alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil)) + self.presentViewController(alert, animated: true, completion: nil) + } else { + NSLog("Login error: %@", error!.localizedDescription); + } + } + + // TODO: Change where the log in button is positioned in your view + twitterLogInButton.center = CGPointMake(120, 100) + self.view.addSubview(twitterLogInButton) + + let vkLoginButton = UIButton.init(frame: CGRectMake(60, 130, 120, 30)) + vkLoginButton.addTarget(self, action: "loginToVK", forControlEvents: UIControlEvents.TouchUpInside) + vkLoginButton.backgroundColor = UIColor.blueColor() + vkLoginButton.setTitle("Login to VK", forState: UIControlState.Normal) + vkLoginButton.layer.cornerRadius = 10 + vkLoginButton.clipsToBounds = true + self.view.addSubview(vkLoginButton) + } + + func loginToVK() { + VKSdk.authorize(["photo"]) + } + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} + +extension LoginViewController: VKSdkDelegate, VKSdkUIDelegate { + func vkSdkAccessAuthorizationFinishedWithResult(result: VKAuthorizationResult!) { + + } + + func vkSdkUserAuthorizationFailed() { + + } + + func vkSdkShouldPresentViewController(controller: UIViewController!) { + self.showDetailViewController(controller, sender: self) + } + func vkSdkNeedCaptchaEnter(captchaError: VKError!) { + + } + +} diff --git a/dayPhoto/DayPhoto/PhotoViewController.swift b/dayPhoto/DayPhoto/PhotoViewController.swift new file mode 100644 index 0000000..3c4f68c --- /dev/null +++ b/dayPhoto/DayPhoto/PhotoViewController.swift @@ -0,0 +1,48 @@ +// +// PhotoViewController.swift +// DayPhoto +// +// Created by Nikita Asabin on 14.01.16. +// Copyright © 2016 Flatstack. All rights reserved. +// + +import UIKit + +class PhotoViewController: UIViewController { + + @IBOutlet weak var fullImageView: UIImageView! + @IBOutlet weak var captionLabel: UILabel! + @IBOutlet weak var commentLabel: UILabel! + + var photo: Photo? + + override func viewDidLoad() { + super.viewDidLoad() + if let lphoto = photo { + self.fullImageView.image = lphoto.image + self.captionLabel.text = lphoto.caption + self.commentLabel.text = lphoto.comment + } + // Do any additional setup after loading the view. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + @IBAction func closePhoto(sender: AnyObject) { + self.dismissViewControllerAnimated(true, completion: nil) + } + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/dayPhoto/DayPhoto/Photos.plist b/dayPhoto/DayPhoto/Photos.plist new file mode 100644 index 0000000..cc6e968 --- /dev/null +++ b/dayPhoto/DayPhoto/Photos.plist @@ -0,0 +1,110 @@ + + + + + + Caption + VCON? + Comment + Is Ray hinting that perhaps it's Vicki's turn next year? + Photo + 01 + + + Caption + Little and Large + Comment + Brian and Matt meet for the very first time. + Photo + 02 + + + Caption + Shiny Happy People + Comment + There are so many happy people at RWDevCon - it's amazing. + Photo + 03 + + + Caption + Need More Lanyards + Comment + The moment it all became very real. The conference really was happening! + Photo + 04 + + + Caption + Thank You Sponsors + Comment + Without you we wouldn't have been able to put on this amazing conference. + Photo + 05 + + + Caption + TUTORIAL TEAM ASSEMBLE! + Comment + The Avengers certainly have nothing on this lot! + Photo + 06 + + + Caption + But, But, Delegates + Comment + "Matthijs, stop going on about architecture, we're trying to eat!" + Photo + 07 + + + Caption + Lunch + Comment + Mic and Greg grab a quick bite to eat between WatchKit sessions. + Photo + 08 + + + Caption + One More Thing... + Comment + The attendees eaglery awaiting the final big announcement. + Photo + 09 + + + Caption + Milan Beckoning Marin + Comment + Check out Marin's new catalogue pose! + Photo + 10 + + + Caption + Shiver Me Timbers! + Comment + Meet Christine, the world's least terrifying pirate. + Photo + 11 + + + Caption + We're Jammin' + Comment + An impromptu ukulele jamming session in the bar with Tim and Tammy. + Photo + 12 + + + Caption + Busted! + Comment + That's right Saul, we caught you napping. + Photo + 13 + + + diff --git a/dayPhoto/DayPhoto/Photos.xcassets/01.imageset/01.jpg b/dayPhoto/DayPhoto/Photos.xcassets/01.imageset/01.jpg new file mode 100644 index 0000000..73edd25 Binary files /dev/null and b/dayPhoto/DayPhoto/Photos.xcassets/01.imageset/01.jpg differ diff --git a/dayPhoto/DayPhoto/Photos.xcassets/01.imageset/Contents.json b/dayPhoto/DayPhoto/Photos.xcassets/01.imageset/Contents.json new file mode 100644 index 0000000..7b80e4c --- /dev/null +++ b/dayPhoto/DayPhoto/Photos.xcassets/01.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "01.jpg" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Photos.xcassets/02.imageset/02.jpg b/dayPhoto/DayPhoto/Photos.xcassets/02.imageset/02.jpg new file mode 100644 index 0000000..2ae149b Binary files /dev/null and b/dayPhoto/DayPhoto/Photos.xcassets/02.imageset/02.jpg differ diff --git a/dayPhoto/DayPhoto/Photos.xcassets/02.imageset/Contents.json b/dayPhoto/DayPhoto/Photos.xcassets/02.imageset/Contents.json new file mode 100644 index 0000000..5b11d9a --- /dev/null +++ b/dayPhoto/DayPhoto/Photos.xcassets/02.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "02.jpg" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Photos.xcassets/03.imageset/03.jpg b/dayPhoto/DayPhoto/Photos.xcassets/03.imageset/03.jpg new file mode 100644 index 0000000..c74a631 Binary files /dev/null and b/dayPhoto/DayPhoto/Photos.xcassets/03.imageset/03.jpg differ diff --git a/dayPhoto/DayPhoto/Photos.xcassets/03.imageset/Contents.json b/dayPhoto/DayPhoto/Photos.xcassets/03.imageset/Contents.json new file mode 100644 index 0000000..fd4364a --- /dev/null +++ b/dayPhoto/DayPhoto/Photos.xcassets/03.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "03.jpg" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Photos.xcassets/04.imageset/04.jpg b/dayPhoto/DayPhoto/Photos.xcassets/04.imageset/04.jpg new file mode 100644 index 0000000..ba6ef95 Binary files /dev/null and b/dayPhoto/DayPhoto/Photos.xcassets/04.imageset/04.jpg differ diff --git a/dayPhoto/DayPhoto/Photos.xcassets/04.imageset/Contents.json b/dayPhoto/DayPhoto/Photos.xcassets/04.imageset/Contents.json new file mode 100644 index 0000000..79da20b --- /dev/null +++ b/dayPhoto/DayPhoto/Photos.xcassets/04.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "04.jpg" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Photos.xcassets/05.imageset/05.jpg b/dayPhoto/DayPhoto/Photos.xcassets/05.imageset/05.jpg new file mode 100644 index 0000000..dd14bde Binary files /dev/null and b/dayPhoto/DayPhoto/Photos.xcassets/05.imageset/05.jpg differ diff --git a/dayPhoto/DayPhoto/Photos.xcassets/05.imageset/Contents.json b/dayPhoto/DayPhoto/Photos.xcassets/05.imageset/Contents.json new file mode 100644 index 0000000..b890ef9 --- /dev/null +++ b/dayPhoto/DayPhoto/Photos.xcassets/05.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "05.jpg" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Photos.xcassets/06.imageset/06.jpg b/dayPhoto/DayPhoto/Photos.xcassets/06.imageset/06.jpg new file mode 100644 index 0000000..57afd4d Binary files /dev/null and b/dayPhoto/DayPhoto/Photos.xcassets/06.imageset/06.jpg differ diff --git a/dayPhoto/DayPhoto/Photos.xcassets/06.imageset/Contents.json b/dayPhoto/DayPhoto/Photos.xcassets/06.imageset/Contents.json new file mode 100644 index 0000000..6342e13 --- /dev/null +++ b/dayPhoto/DayPhoto/Photos.xcassets/06.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "06.jpg" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Photos.xcassets/07.imageset/07.jpg b/dayPhoto/DayPhoto/Photos.xcassets/07.imageset/07.jpg new file mode 100644 index 0000000..a6c9415 Binary files /dev/null and b/dayPhoto/DayPhoto/Photos.xcassets/07.imageset/07.jpg differ diff --git a/dayPhoto/DayPhoto/Photos.xcassets/07.imageset/Contents.json b/dayPhoto/DayPhoto/Photos.xcassets/07.imageset/Contents.json new file mode 100644 index 0000000..8be0f38 --- /dev/null +++ b/dayPhoto/DayPhoto/Photos.xcassets/07.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "07.jpg" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Photos.xcassets/08.imageset/08.jpg b/dayPhoto/DayPhoto/Photos.xcassets/08.imageset/08.jpg new file mode 100644 index 0000000..656ce07 Binary files /dev/null and b/dayPhoto/DayPhoto/Photos.xcassets/08.imageset/08.jpg differ diff --git a/dayPhoto/DayPhoto/Photos.xcassets/08.imageset/Contents.json b/dayPhoto/DayPhoto/Photos.xcassets/08.imageset/Contents.json new file mode 100644 index 0000000..f69821c --- /dev/null +++ b/dayPhoto/DayPhoto/Photos.xcassets/08.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "08.jpg" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Photos.xcassets/09.imageset/10.jpg b/dayPhoto/DayPhoto/Photos.xcassets/09.imageset/10.jpg new file mode 100644 index 0000000..00e7607 Binary files /dev/null and b/dayPhoto/DayPhoto/Photos.xcassets/09.imageset/10.jpg differ diff --git a/dayPhoto/DayPhoto/Photos.xcassets/09.imageset/Contents.json b/dayPhoto/DayPhoto/Photos.xcassets/09.imageset/Contents.json new file mode 100644 index 0000000..826fd0e --- /dev/null +++ b/dayPhoto/DayPhoto/Photos.xcassets/09.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "10.jpg" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Photos.xcassets/10.imageset/09.jpg b/dayPhoto/DayPhoto/Photos.xcassets/10.imageset/09.jpg new file mode 100644 index 0000000..f843311 Binary files /dev/null and b/dayPhoto/DayPhoto/Photos.xcassets/10.imageset/09.jpg differ diff --git a/dayPhoto/DayPhoto/Photos.xcassets/10.imageset/Contents.json b/dayPhoto/DayPhoto/Photos.xcassets/10.imageset/Contents.json new file mode 100644 index 0000000..433f901 --- /dev/null +++ b/dayPhoto/DayPhoto/Photos.xcassets/10.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "09.jpg" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Photos.xcassets/11.imageset/11.jpg b/dayPhoto/DayPhoto/Photos.xcassets/11.imageset/11.jpg new file mode 100644 index 0000000..ccb45e2 Binary files /dev/null and b/dayPhoto/DayPhoto/Photos.xcassets/11.imageset/11.jpg differ diff --git a/dayPhoto/DayPhoto/Photos.xcassets/11.imageset/Contents.json b/dayPhoto/DayPhoto/Photos.xcassets/11.imageset/Contents.json new file mode 100644 index 0000000..8cb94f9 --- /dev/null +++ b/dayPhoto/DayPhoto/Photos.xcassets/11.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "11.jpg" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Photos.xcassets/12.imageset/12.jpg b/dayPhoto/DayPhoto/Photos.xcassets/12.imageset/12.jpg new file mode 100644 index 0000000..ff0d4c2 Binary files /dev/null and b/dayPhoto/DayPhoto/Photos.xcassets/12.imageset/12.jpg differ diff --git a/dayPhoto/DayPhoto/Photos.xcassets/12.imageset/Contents.json b/dayPhoto/DayPhoto/Photos.xcassets/12.imageset/Contents.json new file mode 100644 index 0000000..56ee0c0 --- /dev/null +++ b/dayPhoto/DayPhoto/Photos.xcassets/12.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "12.jpg" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Photos.xcassets/13.imageset/Busted.jpg b/dayPhoto/DayPhoto/Photos.xcassets/13.imageset/Busted.jpg new file mode 100644 index 0000000..cc15769 Binary files /dev/null and b/dayPhoto/DayPhoto/Photos.xcassets/13.imageset/Busted.jpg differ diff --git a/dayPhoto/DayPhoto/Photos.xcassets/13.imageset/Contents.json b/dayPhoto/DayPhoto/Photos.xcassets/13.imageset/Contents.json new file mode 100644 index 0000000..6af0d74 --- /dev/null +++ b/dayPhoto/DayPhoto/Photos.xcassets/13.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "Busted.jpg" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Protocols.swift b/dayPhoto/DayPhoto/Protocols.swift new file mode 100755 index 0000000..2680cdd --- /dev/null +++ b/dayPhoto/DayPhoto/Protocols.swift @@ -0,0 +1,25 @@ +// +// Protocols.swift +// DayPhoto +// +// Created by Kruperfone on 19.11.15. +// Copyright © 2015 Flatstack. All rights reserved. +// + +import Foundation + +func + (inout left: Dictionary, right: Dictionary) -> Dictionary { + var map = Dictionary() + for (k, v) in left { + map.updateValue(v, forKey: k) + } + for (k, v) in right { + map.updateValue(v, forKey: k) + } + return map +} + +func += (inout left: Dictionary, right: Dictionary) { + let map = left + right + left = map +} diff --git a/dayPhoto/DayPhoto/RoundedCornersView.swift b/dayPhoto/DayPhoto/RoundedCornersView.swift new file mode 100644 index 0000000..0ea0e0d --- /dev/null +++ b/dayPhoto/DayPhoto/RoundedCornersView.swift @@ -0,0 +1,21 @@ +// +// RoundedCornersView.swift +// DayPhoto +// +// Created by Nikita Asabin on 3.12.15. +// Copyright (c) 2015 Flatstack. All rights reserved. +// + +import UIKit + +@IBDesignable +class RoundedCornersView: UIView { + + @IBInspectable var cornerRadius: CGFloat = 0 { + didSet { + layer.cornerRadius = cornerRadius + layer.masksToBounds = cornerRadius > 0 + } + } + +} diff --git a/dayPhoto/DayPhoto/Scripts/build.sh b/dayPhoto/DayPhoto/Scripts/build.sh new file mode 100755 index 0000000..2dc8e4d --- /dev/null +++ b/dayPhoto/DayPhoto/Scripts/build.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xcodebuild -workspace DayPhoto.xcworkspace -scheme Production -sdk iphoneos -configuration Release OBJROOT=$PWD/build SYMROOT=$PWD/build ONLY_ACTIVE_ARCH=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty -c && exit ${PIPESTATUS[0]} diff --git a/dayPhoto/DayPhoto/Scripts/mogend.sh b/dayPhoto/DayPhoto/Scripts/mogend.sh new file mode 100755 index 0000000..6bf0906 --- /dev/null +++ b/dayPhoto/DayPhoto/Scripts/mogend.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# mogend.sh +# +# Created by Jean-Denis Muys on 24/02/11. +# Modified by Ryan Rounkles on 15/5/11 to use correct model version and to account for spaces in file paths +# Modified by Vyacheslav Artemev on 7/12/11 to use separate folders for machine and human +# Modyfied by Danis Ziganshin on 14.02.14 for ARC compability + +# Check paths for generated files first! It can be different for every project +# If something wrong with paths on your machine - use absolute path for mogenerator script +# for enabling this script you should go to "Project target" -> "Build Rules" -> "Editor" -> "Add build Rule" -> select "Data model version files using Script" -> Process = "Data model version files" -> add custom script + #echo "Running mogend" + #"${SRCROOT}/ios-base/Scripts/mogend.sh" +# Set Output files = $(DERIVED_FILE_DIR)/${INPUT_FILE_BASE}.momd + +mogenerator --swift --model "${INPUT_FILE_PATH}/" --machine-dir "${PROJECT_DIR}/DayPhoto/CoreData/Private/" --human-dir "${PROJECT_DIR}/DayPhoto/CoreData/" --template-var arc=true + +${DEVELOPER_BIN_DIR}/momc -XD_MOMC_TARGET_VERSION=10.7 "${INPUT_FILE_PATH}" "${TARGET_BUILD_DIR}/${EXECUTABLE_FOLDER_PATH}/${INPUT_FILE_BASE}.momd" + +echo "Mogend.sh is done" \ No newline at end of file diff --git a/dayPhoto/DayPhoto/Scripts/test.sh b/dayPhoto/DayPhoto/Scripts/test.sh new file mode 100755 index 0000000..eaf4504 --- /dev/null +++ b/dayPhoto/DayPhoto/Scripts/test.sh @@ -0,0 +1,14 @@ +#!/bin/sh +xcodebuild -workspace DayPhoto.xcworkspace -scheme Staging -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.1' test | xcpretty -c -t && exit ${PIPESTATUS[0]} + +#Available destinations for the "Staging" scheme: +#{ platform:iOS Simulator, id:9D4669A0-72AF-41A9-AB8A-14914D7A502F, OS:8.2, name:iPad 2 } +#{ platform:iOS Simulator, id:D1F3629A-4698-4DF4-813B-16E944D958C6, OS:8.2, name:iPad Air } +#{ platform:iOS Simulator, id:F16D6604-4C3C-46CF-B268-904093D42D28, OS:8.2, name:iPad Retina } +#{ platform:iOS Simulator, id:83BEC35E-D369-4CF5-BDB8-DB76DC1F1F1A, OS:8.2, name:iPhone 4s } +#{ platform:iOS Simulator, id:45F13142-6870-4DF5-AA02-DC5AB4549EDD, OS:8.2, name:iPhone 5 } +#{ platform:iOS Simulator, id:3A52861B-7E7A-43E8-9026-DFF899543071, OS:8.2, name:iPhone 5s } +#{ platform:iOS Simulator, id:2A8A340C-42BF-4045-B008-3868F8E082BA, OS:8.2, name:iPhone 6 Plus } +#{ platform:iOS Simulator, id:F651D749-67FD-4093-A9AE-C386E3858632, OS:8.2, name:iPhone 6 } +#{ platform:iOS Simulator, id:DB1FB84A-7F74-4042-B0E3-01B05B730FE7, OS:8.2, name:Resizable iPad } +#{ platform:iOS Simulator, id:90301A80-5A1B-4C4F-9433-D31A113FE314, OS:8.2, name:Resizable iPhone } diff --git a/dayPhoto/DayPhoto/SwipeInteractionController.swift b/dayPhoto/DayPhoto/SwipeInteractionController.swift new file mode 100644 index 0000000..e71c355 --- /dev/null +++ b/dayPhoto/DayPhoto/SwipeInteractionController.swift @@ -0,0 +1,63 @@ +// +// SwipeInteractionController.swift +// DayPhoto +// +// Created by Nikita Asabin on 14.01.16. +// Copyright © 2016 Flatstack. All rights reserved. +// + +import UIKit + +class SwipeInteractionController: UIPercentDrivenInteractiveTransition { + + var interactionInProgress = false + + private var shouldCompleteTransition = false + private weak var viewController: UIViewController! + + func wireToViewController(viewController: UIViewController!) { + self.viewController = viewController + prepareGestureRecognizerInView(viewController.view) + } + + private func prepareGestureRecognizerInView(view: UIView) { + let gesture = UIScreenEdgePanGestureRecognizer(target: self, action: "handleGesture:") + gesture.edges = UIRectEdge.Left + view.addGestureRecognizer(gesture) + } + + func handleGesture(gestureRecognizer: UIScreenEdgePanGestureRecognizer) { + + let translation = gestureRecognizer.translationInView(gestureRecognizer.view!.superview!) + var progress = (translation.x / 200) + progress = CGFloat(fminf(fmaxf(Float(progress), 0.0), 1.0)) + + switch gestureRecognizer.state { + + case .Began: + interactionInProgress = true + viewController.dismissViewControllerAnimated(true, completion: nil) + + case .Changed: + shouldCompleteTransition = progress > 0.5 + updateInteractiveTransition(progress) + + case .Cancelled: + interactionInProgress = false + cancelInteractiveTransition() + + case .Ended: + interactionInProgress = false + + if !shouldCompleteTransition { + cancelInteractiveTransition() + } else { + finishInteractiveTransition() + } + + default: + print("Unsupported") + } + } +} + diff --git a/dayPhoto/DayPhoto/UIImage+Decompression.swift b/dayPhoto/DayPhoto/UIImage+Decompression.swift new file mode 100644 index 0000000..754e3a7 --- /dev/null +++ b/dayPhoto/DayPhoto/UIImage+Decompression.swift @@ -0,0 +1,21 @@ +// +// UIImage+Decompression.swift +// RWDevCon +// +// Created by Mic Pringle on 09/03/2015. +// Copyright (c) 2015 Ray Wenderlich. All rights reserved. +// + +import UIKit + +extension UIImage { + + var decompressedImage: UIImage { + UIGraphicsBeginImageContextWithOptions(size, true, 0) + drawAtPoint(CGPointZero) + let decompressedImage = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + return decompressedImage + } + +} diff --git a/dayPhoto/DayPhoto/ViewController.swift b/dayPhoto/DayPhoto/ViewController.swift new file mode 100755 index 0000000..acf1773 --- /dev/null +++ b/dayPhoto/DayPhoto/ViewController.swift @@ -0,0 +1,163 @@ +// +// ViewController.swift +// DayPhoto +// +// Created by Kruperfone on 13.02.15. +// Copyright (c) 2015 Flatstack. All rights reserved. +// + +import UIKit +import MagicalRecord +import AVFoundation + +class ViewController: UIViewController { + + private let flipPresentAnimationController = FlipPresentAnimationController() + private let flipDismissAnimationController = FlipDismissAnimationController() + private let swipeInteractionController = SwipeInteractionController() + + @IBOutlet weak var label: UILabel! + @IBOutlet weak var collectionView: UICollectionView! + @IBOutlet weak var fullImageView: UIImageView! + @IBOutlet weak var blurButton: UIButton! + @IBOutlet weak var loginViewContainer: UIView! + + var photoSource = Photo.allPhotos() + var collectionViewWidth = CGFloat(0); + var isBlured = false + var fromFrame: CGRect? + override func viewDidLoad() { + super.viewDidLoad() + if let patternImage = UIImage(named: "Pattern") { + view.backgroundColor = UIColor(patternImage: patternImage) + } + if let layout = self.collectionView?.collectionViewLayout as? DayPhotoLayout { + layout.delegate = self + } + self.collectionView!.contentInset = UIEdgeInsets(top: 23, left: 5, bottom: 10, right: 5) + self.collectionViewWidth = self.collectionView.frame.width + self.blurButton.layer.cornerRadius = 70 + self.blurButton.clipsToBounds = true + self.setBlurForBlurButton() + self.loginViewContainer.layer.cornerRadius = 10 + self.loginViewContainer.clipsToBounds = true + + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + } + + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + if self.collectionView.frame.width != self.collectionViewWidth { + let layout = DayPhotoLayout() + layout.delegate = self + self.collectionView.collectionViewLayout.invalidateLayout() + self.collectionView.reloadData() + self.collectionView.setCollectionViewLayout(layout, animated: false) + self.collectionViewWidth = self.collectionView.frame.width + } + + } + + func setBlurForBlurButton() { + let blurEffect = UIBlurEffect(style: .Light) + let blurView = UIVisualEffectView(effect: blurEffect) + + let vibrancy = UIVibrancyEffect(forBlurEffect:blurEffect) + let vibrancyView = UIVisualEffectView(effect: vibrancy) + blurView.frame = CGRectMake(0, 0, 140, 140) + blurView.userInteractionEnabled = false + vibrancyView.frame = CGRectMake(0, 0, 140, 140) + vibrancyView.userInteractionEnabled = false + self.blurButton.insertSubview(blurView, atIndex: 0) + self.blurButton.insertSubview(vibrancyView, atIndex: 0) + } + + @IBAction func blurImage(sender: AnyObject) { + if self.isBlured == false { + let blurEffect = UIBlurEffect(style: .Light) + let blurView = UIVisualEffectView(effect: blurEffect) + blurView.frame = self.fullImageView.frame + self.view.insertSubview(blurView, aboveSubview: self.fullImageView) + self.isBlured = true + } else { + for view in self.view.subviews { + if view.isKindOfClass(UIVisualEffectView) { + view.removeFromSuperview() + } + } + self.isBlured = false + } + } + @IBAction func showHideLoginView(sender: AnyObject) { + self.loginViewContainer.hidden = !self.loginViewContainer.hidden + } + +} + +extension ViewController: UICollectionViewDataSource, UICollectionViewDelegate { + func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { + let cell = collectionView.dequeueReusableCellWithReuseIdentifier("AnnotatedPhotoCell", forIndexPath: indexPath) as! AnnotatedPhotoCell + cell.photo = photoSource[indexPath.item] + return cell + } + + func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return photoSource.count + } + + func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { + if FSIsIPad() == true { + self.fullImageView.image = photoSource[indexPath.row].image + } else { + let vc = self.storyboard?.instantiateViewControllerWithIdentifier("PhotoView") as! PhotoViewController + vc.photo = photoSource[indexPath.row] + vc.transitioningDelegate = self + let cell = collectionView.cellForItemAtIndexPath(indexPath) + self.fromFrame = cell?.frame + swipeInteractionController.wireToViewController(vc) + self.showViewController(vc, sender: self) + } + } + +} + +extension ViewController : DayPhotoLayoutDelegate { + + func collectionView(collectionView:UICollectionView, heightForPhotoAtIndexPath indexPath:NSIndexPath , withWidth width:CGFloat) -> CGFloat { + let photo = photoSource[indexPath.item] + let boundingRect = CGRect(x: 0, y: 0, width: width, height: CGFloat(MAXFLOAT)) + let rect = AVMakeRectWithAspectRatioInsideRect(photo.image.size , boundingRect) + return rect.size.height + } + + func collectionView(collectionView: UICollectionView, heightForAnnotationAtIndexPath indexPath: NSIndexPath, withWidth width: CGFloat) -> CGFloat { + let annotationPadding = CGFloat(4) + let annotationHeaderHeight = CGFloat(17) + + let photo = photoSource[indexPath.item] + let font = UIFont(name: "AvenirNext-Regular", size: 10)! + let commentHeight = photo.heightForComment(font, width: width) + let height = annotationPadding + annotationHeaderHeight + commentHeight + annotationPadding + return height + } +} + +extension ViewController: UIViewControllerTransitioningDelegate { + + func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? { + flipPresentAnimationController.originFrame = self.fromFrame! + return flipPresentAnimationController + } + + func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { + flipDismissAnimationController.destinationFrame = self.view.frame + return flipDismissAnimationController + } + func interactionControllerForDismissal(animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { + return swipeInteractionController.interactionInProgress ? swipeInteractionController : nil + } + +} \ No newline at end of file diff --git a/dayPhoto/DayPhoto/ru.lproj/Main_Storyboard.strings b/dayPhoto/DayPhoto/ru.lproj/Main_Storyboard.strings new file mode 100755 index 0000000..d2b4d22 --- /dev/null +++ b/dayPhoto/DayPhoto/ru.lproj/Main_Storyboard.strings @@ -0,0 +1,12 @@ +/*Use this to generate new strings files - + ibtool Base.lproj/Main.storyboard --generate-strings-file ~/Desktop/str.strings + */ + +/* Class = "UIButton"; normalTitle = "Tap to show alert"; ObjectID = "Eky-89-Wjw"; */ +"Eky-89-Wjw.normalTitle" = "Tap to show alert"; + +/* Class = "UILabel"; accessibilityLabel = "Hello World!"; ObjectID = "LaI-Mr-U2B"; */ +"LaI-Mr-U2B.accessibilityLabel" = "Hello World!"; + +/* Class = "UILabel"; text = "Hello World!"; ObjectID = "LaI-Mr-U2B"; */ +"LaI-Mr-U2B.text" = "Hello World!"; diff --git a/dayPhoto/DayPhotoTests/DayPhotoTests.swift b/dayPhoto/DayPhotoTests/DayPhotoTests.swift new file mode 100755 index 0000000..2c3f378 --- /dev/null +++ b/dayPhoto/DayPhotoTests/DayPhotoTests.swift @@ -0,0 +1,35 @@ +// +// Swift_BaseTests.swift +// DayPhotoTests +// +// Created by Kruperfone on 22.09.15. +// Copyright © 2015 Flatstack. All rights reserved. +// + +import XCTest + +class Swift_BaseTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measureBlock { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/dayPhoto/DayPhotoTests/FSTestHelpers.swift b/dayPhoto/DayPhotoTests/FSTestHelpers.swift new file mode 100755 index 0000000..7441a23 --- /dev/null +++ b/dayPhoto/DayPhotoTests/FSTestHelpers.swift @@ -0,0 +1,42 @@ +// +// FSTestHelpers.swift +// Adme +// +// Created by Kruperfone on 21.09.15. +// Copyright © 2015 Flatstack. All rights reserved. +// + +import Foundation + +enum TestingMode: String { + case Unit = "Unit" + case UI = "UI" + + init () { + let environments = NSProcessInfo.processInfo().environment + guard let modeString = environments["Testing"] else { + fatalError("Testing mode not defined") + } + + switch modeString { + case TestingMode.Unit.rawValue: + self = .Unit + + case TestingMode.UI.rawValue: + self = .UI + + default: + fatalError("Testing mode is wrong") + } + } +} + +func HasLaunchArgument (argument: String) -> Bool { + let arguments = NSProcessInfo.processInfo().arguments + return arguments.contains(argument) +} + +func GetEnvironment (key: String) -> String? { + let environments = NSProcessInfo.processInfo().environment + return environments[key] +} diff --git a/dayPhoto/DayPhotoTests/Info.plist b/dayPhoto/DayPhotoTests/Info.plist new file mode 100755 index 0000000..ba72822 --- /dev/null +++ b/dayPhoto/DayPhotoTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/dayPhoto/FBSDKCoreKit.framework/FBSDKCoreKit b/dayPhoto/FBSDKCoreKit.framework/FBSDKCoreKit new file mode 100644 index 0000000..03b5cc5 Binary files /dev/null and b/dayPhoto/FBSDKCoreKit.framework/FBSDKCoreKit differ diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKAccessToken.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKAccessToken.h new file mode 100644 index 0000000..4ed0656 --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKAccessToken.h @@ -0,0 +1,166 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 +#import + +/*! + @abstract Notification indicating that the `currentAccessToken` has changed. + @discussion the userInfo dictionary of the notification will contain keys + `FBSDKAccessTokenChangeOldKey` and + `FBSDKAccessTokenChangeNewKey`. + */ +FBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeNotification; + +/*! + @abstract A key in the notification's userInfo that will be set + if and only if the user ID changed between the old and new tokens. + @discussion Token refreshes can occur automatically with the SDK + which do not change the user. If you're only interested in user + changes (such as logging out), you should check for the existence + of this key. The value is a NSNumber with a boolValue. + + On a fresh start of the app where the SDK reads in the cached value + of an access token, this key will also exist since the access token + is moving from a null state (no user) to a non-null state (user). + */ +FBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeUserID; + +/* + @abstract key in notification's userInfo object for getting the old token. + @discussion If there was no old token, the key will not be present. + */ +FBSDK_EXTERN NSString *const FBSDKAccessTokenChangeOldKey; + +/* + @abstract key in notification's userInfo object for getting the new token. + @discussion If there is no new token, the key will not be present. + */ +FBSDK_EXTERN NSString *const FBSDKAccessTokenChangeNewKey; + + +/*! + @class FBSDKAccessToken + @abstract Represents an immutable access token for using Facebook services. + */ +@interface FBSDKAccessToken : NSObject + +/*! + @abstract Returns the app ID. + */ +@property (readonly, copy, nonatomic) NSString *appID; + +/*! + @abstract Returns the known declined permissions. + */ +@property (readonly, copy, nonatomic) NSSet *declinedPermissions; + +/*! + @abstract Returns the expiration date. + */ +@property (readonly, copy, nonatomic) NSDate *expirationDate; + +/*! + @abstract Returns the known granted permissions. + */ +@property (readonly, copy, nonatomic) NSSet *permissions; + +/*! + @abstract Returns the date the token was last refreshed. +*/ +@property (readonly, copy, nonatomic) NSDate *refreshDate; + +/*! + @abstract Returns the opaque token string. + */ +@property (readonly, copy, nonatomic) NSString *tokenString; + +/*! + @abstract Returns the user ID. + */ +@property (readonly, copy, nonatomic) NSString *userID; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +/*! + @abstract Initializes a new instance. + @param tokenString the opaque token string. + @param permissions the granted permissions. Note this is converted to NSSet and is only + an NSArray for the convenience of literal syntax. + @param declinedPermissions the declined permissions. Note this is converted to NSSet and is only + an NSArray for the convenience of literal syntax. + @param appID the app ID. + @param userID the user ID. + @param expirationDate the optional expiration date (defaults to distantFuture). + @param refreshDate the optional date the token was last refreshed (defaults to today). + @discussion This initializer should only be used for advanced apps that + manage tokens explicitly. Typical login flows only need to use `FBSDKLoginManager` + along with `+currentAccessToken`. + */ +- (instancetype)initWithTokenString:(NSString *)tokenString + permissions:(NSArray *)permissions + declinedPermissions:(NSArray *)declinedPermissions + appID:(NSString *)appID + userID:(NSString *)userID + expirationDate:(NSDate *)expirationDate + refreshDate:(NSDate *)refreshDate +NS_DESIGNATED_INITIALIZER; + +/*! + @abstract Convenience getter to determine if a permission has been granted + @param permission The permission to check. + */ +- (BOOL)hasGranted:(NSString *)permission; + +/*! + @abstract Compares the receiver to another FBSDKAccessToken + @param token The other token + @return YES if the receiver's values are equal to the other token's values; otherwise NO + */ +- (BOOL)isEqualToAccessToken:(FBSDKAccessToken *)token; + +/*! + @abstract Returns the "global" access token that represents the currently logged in user. + @discussion The `currentAccessToken` is a convenient representation of the token of the + current user and is used by other SDK components (like `FBSDKLoginManager`). + */ ++ (FBSDKAccessToken *)currentAccessToken; + +/*! + @abstract Sets the "global" access token that represents the currently logged in user. + @param token The access token to set. + @discussion This will broadcast a notification and save the token to the app keychain. + */ ++ (void)setCurrentAccessToken:(FBSDKAccessToken *)token; + +/*! + @abstract Refresh the current access token's permission state and extend the token's expiration date, + if possible. + @param completionHandler an optional callback handler that can surface any errors related to permission refreshing. + @discussion On a successful refresh, the currentAccessToken will be updated so you typically only need to + observe the `FBSDKAccessTokenDidChangeNotification` notification. + + If a token is already expired, it cannot be refreshed. + */ ++ (void)refreshCurrentAccessToken:(FBSDKGraphRequestHandler)completionHandler; + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKAppEvents.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKAppEvents.h new file mode 100644 index 0000000..375d413 --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKAppEvents.h @@ -0,0 +1,462 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 "FBSDKMacros.h" + +@class FBSDKAccessToken; +@class FBSDKGraphRequest; + +/*! @abstract NSNotificationCenter name indicating a result of a failed log flush attempt. The posted object will be an NSError instance. */ +FBSDK_EXTERN NSString *const FBSDKAppEventsLoggingResultNotification; + +/*! @abstract optional plist key ("FacebookLoggingOverrideAppID") for setting `loggingOverrideAppID` */ +FBSDK_EXTERN NSString *const FBSDKAppEventsOverrideAppIDBundleKey; + +/*! + + @typedef NS_ENUM (NSUInteger, FBSDKAppEventsFlushBehavior) + + @abstract Specifies when `FBSDKAppEvents` sends log events to the server. + + */ +typedef NS_ENUM(NSUInteger, FBSDKAppEventsFlushBehavior) +{ + + /*! Flush automatically: periodically (once a minute or every 100 logged events) and always at app reactivation. */ + FBSDKAppEventsFlushBehaviorAuto = 0, + + /*! Only flush when the `flush` method is called. When an app is moved to background/terminated, the + events are persisted and re-established at activation, but they will only be written with an + explicit call to `flush`. */ + FBSDKAppEventsFlushBehaviorExplicitOnly, + +}; + +/*! + @methodgroup Predefined event names for logging events common to many apps. Logging occurs through the `logEvent` family of methods on `FBSDKAppEvents`. + Common event parameters are provided in the `FBSDKAppEventsParameterNames*` constants. + */ + +/*! Log this event when the user has achieved a level in the app. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameAchievedLevel; + +/*! Log this event when the user has entered their payment info. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameAddedPaymentInfo; + +/*! Log this event when the user has added an item to their cart. The valueToSum passed to logEvent should be the item's price. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameAddedToCart; + +/*! Log this event when the user has added an item to their wishlist. The valueToSum passed to logEvent should be the item's price. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameAddedToWishlist; + +/*! Log this event when a user has completed registration with the app. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameCompletedRegistration; + +/*! Log this event when the user has completed a tutorial in the app. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameCompletedTutorial; + +/*! Log this event when the user has entered the checkout process. The valueToSum passed to logEvent should be the total price in the cart. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameInitiatedCheckout; + +/*! Log this event when the user has rated an item in the app. The valueToSum passed to logEvent should be the numeric rating. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameRated; + +/*! Log this event when a user has performed a search within the app. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameSearched; + +/*! Log this event when the user has spent app credits. The valueToSum passed to logEvent should be the number of credits spent. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameSpentCredits; + +/*! Log this event when the user has unlocked an achievement in the app. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameUnlockedAchievement; + +/*! Log this event when a user has viewed a form of content in the app. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameViewedContent; + +/*! + @methodgroup Predefined event name parameters for common additional information to accompany events logged through the `logEvent` family + of methods on `FBSDKAppEvents`. Common event names are provided in the `FBAppEventName*` constants. + */ + +/*! Parameter key used to specify an ID for the specific piece of content being logged about. Could be an EAN, article identifier, etc., depending on the nature of the app. */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameContentID; + +/*! Parameter key used to specify a generic content type/family for the logged event, e.g. "music", "photo", "video". Options to use will vary based upon what the app is all about. */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameContentType; + +/*! Parameter key used to specify currency used with logged event. E.g. "USD", "EUR", "GBP". See ISO-4217 for specific values. One reference for these is . */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameCurrency; + +/*! Parameter key used to specify a description appropriate to the event being logged. E.g., the name of the achievement unlocked in the `FBAppEventNameAchievementUnlocked` event. */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameDescription; + +/*! Parameter key used to specify the level achieved in a `FBAppEventNameAchieved` event. */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameLevel; + +/*! Parameter key used to specify the maximum rating available for the `FBAppEventNameRate` event. E.g., "5" or "10". */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameMaxRatingValue; + +/*! Parameter key used to specify how many items are being processed for an `FBAppEventNameInitiatedCheckout` or `FBAppEventNamePurchased` event. */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameNumItems; + +/*! Parameter key used to specify whether payment info is available for the `FBAppEventNameInitiatedCheckout` event. `FBSDKAppEventParameterValueYes` and `FBSDKAppEventParameterValueNo` are good canonical values to use for this parameter. */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNamePaymentInfoAvailable; + +/*! Parameter key used to specify method user has used to register for the app, e.g., "Facebook", "email", "Twitter", etc */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameRegistrationMethod; + +/*! Parameter key used to specify the string provided by the user for a search operation. */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameSearchString; + +/*! Parameter key used to specify whether the activity being logged about was successful or not. `FBSDKAppEventParameterValueYes` and `FBSDKAppEventParameterValueNo` are good canonical values to use for this parameter. */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameSuccess; + +/* + @methodgroup Predefined values to assign to event parameters that accompany events logged through the `logEvent` family + of methods on `FBSDKAppEvents`. Common event parameters are provided in the `FBSDKAppEventParameterName*` constants. + */ + +/*! Yes-valued parameter value to be used with parameter keys that need a Yes/No value */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueYes; + +/*! No-valued parameter value to be used with parameter keys that need a Yes/No value */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueNo; + + +/*! + + @class FBSDKAppEvents + + @abstract + Client-side event logging for specialized application analytics available through Facebook App Insights + and for use with Facebook Ads conversion tracking and optimization. + + @discussion + The `FBSDKAppEvents` static class has a few related roles: + + + Logging predefined and application-defined events to Facebook App Insights with a + numeric value to sum across a large number of events, and an optional set of key/value + parameters that define "segments" for this event (e.g., 'purchaserStatus' : 'frequent', or + 'gamerLevel' : 'intermediate') + + + Logging events to later be used for ads optimization around lifetime value. + + + Methods that control the way in which events are flushed out to the Facebook servers. + + Here are some important characteristics of the logging mechanism provided by `FBSDKAppEvents`: + + + Events are not sent immediately when logged. They're cached and flushed out to the Facebook servers + in a number of situations: + - when an event count threshold is passed (currently 100 logged events). + - when a time threshold is passed (currently 15 seconds). + - when an app has gone to background and is then brought back to the foreground. + + + Events will be accumulated when the app is in a disconnected state, and sent when the connection is + restored and one of the above 'flush' conditions are met. + + + The `FBSDKAppEvents` class is thread-safe in that events may be logged from any of the app's threads. + + + The developer can set the `flushBehavior` on `FBSDKAppEvents` to force the flushing of events to only + occur on an explicit call to the `flush` method. + + + The developer can turn on console debug output for event logging and flushing to the server by using + the `FBSDKLoggingBehaviorAppEvents` value in `[FBSettings setLoggingBehavior:]`. + + Some things to note when logging events: + + + There is a limit on the number of unique event names an app can use, on the order of 1000. + + There is a limit to the number of unique parameter names in the provided parameters that can + be used per event, on the order of 25. This is not just for an individual call, but for all + invocations for that eventName. + + Event names and parameter names (the keys in the NSDictionary) must be between 2 and 40 characters, and + must consist of alphanumeric characters, _, -, or spaces. + + The length of each parameter value can be no more than on the order of 100 characters. + + */ +@interface FBSDKAppEvents : NSObject + +/* + * Basic event logging + */ + +/*! + + @abstract + Log an event with just an eventName. + + @param eventName The name of the event to record. Limitations on number of events and name length + are given in the `FBSDKAppEvents` documentation. + + */ ++ (void)logEvent:(NSString *)eventName; + +/*! + + @abstract + Log an event with an eventName and a numeric value to be aggregated with other events of this name. + + @param eventName The name of the event to record. Limitations on number of events and name length + are given in the `FBSDKAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(double)valueToSum; + + +/*! + + @abstract + Log an event with an eventName and a set of key/value pairs in the parameters dictionary. + Parameter limitations are described above. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBSDKAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names + are provided in `FBSDKAppEventParameterName*` constants. + */ ++ (void)logEvent:(NSString *)eventName + parameters:(NSDictionary *)parameters; + +/*! + + @abstract + Log an event with an eventName, a numeric value to be aggregated with other events of this name, + and a set of key/value pairs in the parameters dictionary. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBSDKAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names + are provided in `FBSDKAppEventParameterName*` constants. + + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(double)valueToSum + parameters:(NSDictionary *)parameters; + + +/*! + + @abstract + Log an event with an eventName, a numeric value to be aggregated with other events of this name, + and a set of key/value pairs in the parameters dictionary. Providing session lets the developer + target a particular . If nil is provided, then `[FBSession activeSession]` will be used. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBSDKAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. Note that this is an NSNumber, and a value of `nil` denotes + that this event doesn't have a value associated with it for summation. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names + are provided in `FBSDKAppEventParameterName*` constants. + + @param accessToken The optional access token to log the event as. + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(NSNumber *)valueToSum + parameters:(NSDictionary *)parameters + accessToken:(FBSDKAccessToken *)accessToken; + +/* + * Purchase logging + */ + +/*! + + @abstract + Log a purchase of the specified amount, in the specified currency. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency. This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @discussion This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set + to `FBSDKAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency; + +/*! + + @abstract + Log a purchase of the specified amount, in the specified currency, also providing a set of + additional characteristics describing the purchase. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names + are provided in `FBSDKAppEventParameterName*` constants. + + @discussion This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set + to `FBSDKAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency + parameters:(NSDictionary *)parameters; + +/*! + + @abstract + Log a purchase of the specified amount, in the specified currency, also providing a set of + additional characteristics describing the purchase, as well as an to log to. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBSDKAppEvents` documentation. Commonly used parameter names + are provided in `FBSDKAppEventParameterName*` constants. + + @param accessToken The optional access token to log the event as. + + @discussion This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set + to `FBSDKAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency + parameters:(NSDictionary *)parameters + accessToken:(FBSDKAccessToken *)accessToken; + +/*! + + @abstract + Notifies the events system that the app has launched and, when appropriate, logs an "activated app" event. Should typically be placed in the + app delegates' `applicationDidBecomeActive:` method. + + This method also takes care of logging the event indicating the first time this app has been launched, which, among other things, is used to + track user acquisition and app install ads conversions. + + @discussion + `activateApp` will not log an event on every app launch, since launches happen every time the app is backgrounded and then foregrounded. + "activated app" events will be logged when the app has not been active for more than 60 seconds. This method also causes a "deactivated app" + event to be logged when sessions are "completed", and these events are logged with the session length, with an indication of how much + time has elapsed between sessions, and with the number of background/foreground interruptions that session had. This data + is all visible in your app's App Events Insights. + */ ++ (void)activateApp; + +/* + * Control over event batching/flushing + */ + +/*! + + @abstract + Get the current event flushing behavior specifying when events are sent back to Facebook servers. + */ ++ (FBSDKAppEventsFlushBehavior)flushBehavior; + +/*! + + @abstract + Set the current event flushing behavior specifying when events are sent back to Facebook servers. + + @param flushBehavior The desired `FBSDKAppEventsFlushBehavior` to be used. + */ ++ (void)setFlushBehavior:(FBSDKAppEventsFlushBehavior)flushBehavior; + +/*! + @abstract + Set the 'override' App ID for App Event logging. + + @discussion + In some cases, apps want to use one Facebook App ID for login and social presence and another + for App Event logging. (An example is if multiple apps from the same company share an app ID for login, but + want distinct logging.) By default, this value is `nil`, and defers to the `FBSDKAppEventsOverrideAppIDBundleKey` + plist value. If that's not set, it defaults to `[FBSDKSettings appID]`. + + This should be set before any other calls are made to `FBSDKAppEvents`. Thus, you should set it in your application + delegate's `application:didFinishLaunchingWithOptions:` delegate. + + @param appID The Facebook App ID to be used for App Event logging. + */ ++ (void)setLoggingOverrideAppID:(NSString *)appID; + +/*! + @abstract + Get the 'override' App ID for App Event logging. + + @see setLoggingOverrideAppID: + + */ ++ (NSString *)loggingOverrideAppID; + + +/*! + @abstract + Explicitly kick off flushing of events to Facebook. This is an asynchronous method, but it does initiate an immediate + kick off. Server failures will be reported through the NotificationCenter with notification ID `FBSDKAppEventsLoggingResultNotification`. + */ ++ (void)flush; + +/*! + @abstract + Creates a request representing the Graph API call to retrieve a Custom Audience "third party ID" for the app's Facebook user. + Callers will send this ID back to their own servers, collect up a set to create a Facebook Custom Audience with, + and then use the resultant Custom Audience to target ads. + + @param accessToken The access token to use to establish the user's identity for users logged into Facebook through this app. + If `nil`, then the `[FBSDKAccessToken currentAccessToken]` is used. + + @discussion + The JSON in the request's response will include an "custom_audience_third_party_id" key/value pair, with the value being the ID retrieved. + This ID is an encrypted encoding of the Facebook user's ID and the invoking Facebook app ID. + Multiple calls with the same user will return different IDs, thus these IDs cannot be used to correlate behavior + across devices or applications, and are only meaningful when sent back to Facebook for creating Custom Audiences. + + The ID retrieved represents the Facebook user identified in the following way: if the specified access token is valid, + the ID will represent the user associated with that token; otherwise the ID will represent the user logged into the + native Facebook app on the device. If there is no native Facebook app, no one is logged into it, or the user has opted out + at the iOS level from ad tracking, then a `nil` ID will be returned. + + This method returns `nil` if either the user has opted-out (via iOS) from Ad Tracking, the app itself has limited event usage + via the `[FBSDKSettings limitEventAndDataUsage]` flag, or a specific Facebook user cannot be identified. + */ ++ (FBSDKGraphRequest *)requestForCustomAudienceThirdPartyIDWithAccessToken:(FBSDKAccessToken *)accessToken; +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKAppLinkResolver.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKAppLinkResolver.h new file mode 100644 index 0000000..8e65e5b --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKAppLinkResolver.h @@ -0,0 +1,82 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +@class BFTask; + +// Check if Bolts.framework is available for import +#if __has_include() +// Import it if it's available +# import +#else +// Otherwise - redeclare BFAppLinkResolving protocol to resolve the problem of missing symbols +// Please note: Bolts.framework is still required for AppLink resolving to work, +// but this allows FBSDKCoreKit to weakly link Bolts.framework as well as this enables clang modulemaps to work. + +/*! + Implement this protocol to provide an alternate strategy for resolving + App Links that may include pre-fetching, caching, or querying for App Link + data from an index provided by a service provider. + */ +@protocol BFAppLinkResolving + +/*! + Asynchronously resolves App Link data for a given URL. + + @param url The URL to resolve into an App Link. + @returns A BFTask that will return a BFAppLink for the given URL. + */ +- (BFTask *)appLinkFromURLInBackground:(NSURL *)url; + +@end + +#endif + +/*! + @class FBSDKAppLinkResolver + + @abstract + Provides an implementation of the BFAppLinkResolving protocol that uses the Facebook App Link + Index API to resolve App Links given a URL. It also provides an additional helper method that can resolve + multiple App Links in a single call. + + @discussion + Usage of this type requires a client token. See `[FBSDKSettings setClientToken:]` and linking + Bolts.framework + */ +@interface FBSDKAppLinkResolver : NSObject + +/*! + @abstract Asynchronously resolves App Link data for multiple URLs. + + @param urls An array of NSURLs to resolve into App Links. + @returns A BFTask that will return dictionary mapping input NSURLs to their + corresponding BFAppLink. + + @discussion + You should set the client token before making this call. See `[FBSDKSettings setClientToken:]` + */ +- (BFTask *)appLinksFromURLsInBackground:(NSArray *)urls; + +/*! + @abstract Allocates and initializes a new instance of FBSDKAppLinkResolver. + */ ++ (instancetype)resolver; + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKAppLinkUtility.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKAppLinkUtility.h new file mode 100644 index 0000000..216b71d --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKAppLinkUtility.h @@ -0,0 +1,55 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract Describes the callback for fetchDeferredAppLink. + @param url the url representing the deferred App Link + @param error the error during the request, if any + + @discussion The url may also have a fb_click_time_utc query parameter that + represents when the click occurred that caused the deferred App Link to be created. + */ +typedef void (^FBSDKDeferredAppLinkHandler)(NSURL *url, NSError *error); + +/*! + @abstract Class containing App Links related utility methods. + */ +@interface FBSDKAppLinkUtility : NSObject + +/*! + @abstract + Call this method from the main thread to fetch deferred applink data if you use Mobile App + Engagement Ads (https://developers.facebook.com/docs/ads-for-apps/mobile-app-ads-engagement). + This may require a network round trip. If successful, the handler is invoked with the link + data (this will only return a valid URL once, and future calls will result in a nil URL + value in the callback). + + @param handler the handler to be invoked if there is deferred App Link data + + @discussion The handler may contain an NSError instance to capture any errors. In the + common case where there simply was no app link data, the NSError instance will be nil. + + This method should only be called from a location that occurs after any launching URL has + been processed (e.g., you should call this method from your application delegate's + applicationDidBecomeActive:). + */ ++ (void)fetchDeferredAppLink:(FBSDKDeferredAppLinkHandler)handler; + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKApplicationDelegate.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKApplicationDelegate.h new file mode 100644 index 0000000..857acd0 --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKApplicationDelegate.h @@ -0,0 +1,74 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @class FBSDKApplicationDelegate + + @abstract + The FBSDKApplicationDelegate is designed to post process the results from Facebook Login + or Facebook Dialogs (or any action that requires switching over to the native Facebook + app or Safari). + + @discussion + The methods in this class are designed to mirror those in UIApplicationDelegate, and you + should call them in the respective methods in your AppDelegate implementation. + */ +@interface FBSDKApplicationDelegate : NSObject + +/*! + @abstract Gets the singleton instance. + */ ++ (instancetype)sharedInstance; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or Safari as part of SSO authorization flow or Facebook dialogs. + + @param application The application as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param annotation The annotation as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ +- (BOOL)application:(UIApplication *)application + openURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + annotation:(id)annotation; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:didFinishLaunchingWithOptions:] method + of the AppDelegate for your app. It should be invoked for the proper use of the Facebook SDK. + + @param application The application as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. + + @param launchOptions The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKButton.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKButton.h new file mode 100644 index 0000000..8132998 --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKButton.h @@ -0,0 +1,26 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract A base class for common SDK buttons. + */ +@interface FBSDKButton : UIButton + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKConstants.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKConstants.h new file mode 100644 index 0000000..5f53161 --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKConstants.h @@ -0,0 +1,210 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract The error domain for all errors from FBSDKCoreKit. + @discussion Error codes from the SDK in the range 0-99 are reserved for this domain. + */ +FBSDK_EXTERN NSString *const FBSDKErrorDomain; + +/*! + @typedef NS_ENUM(NSInteger, FBSDKErrorCode) + @abstract Error codes for FBSDKErrorDomain. + */ +typedef NS_ENUM(NSInteger, FBSDKErrorCode) +{ + /*! + @abstract Reserved. + */ + FBSDKReservedErrorCode = 0, + + /*! + @abstract The error code for errors from invalid encryption on incoming encryption URLs. + */ + FBSDKEncryptionErrorCode, + + /*! + @abstract The error code for errors from invalid arguments to SDK methods. + */ + FBSDKInvalidArgumentErrorCode, + + /*! + @abstract The error code for unknown errors. + */ + FBSDKUnknownErrorCode, + + /*! + @abstract A request failed due to a network error. Use NSUnderlyingErrorKey to retrieve + the error object from the NSURLConnection for more information. + */ + FBSDKNetworkErrorCode, + + /*! + @abstract The error code for errors encounted during an App Events flush. + */ + FBSDKAppEventsFlushErrorCode, + + /*! + @abstract An endpoint that returns a binary response was used with FBSDKGraphRequestConnection. + @discussion Endpoints that return image/jpg, etc. should be accessed using NSURLRequest + */ + FBSDKGraphRequestNonTextMimeTypeReturnedErrorCode, + + /*! + @abstract The operation failed because the server returned an unexpected response. + @discussion You can get this error if you are not using the most recent SDK, or you are accessing a version of the + Graph API incompatible with the current SDK. + */ + FBSDKGraphRequestProtocolMismatchErrorCode, + + /*! + @abstract The Graph API returned an error. + @discussion See below for useful userInfo keys (beginning with FBSDKGraphRequestError*) + */ + FBSDKGraphRequestGraphAPIErrorCode, + + /*! + @abstract The specified dialog configuration is not available. + @discussion This error may signify that the configuration for the dialogs has not yet been downloaded from the server + or that the dialog is unavailable. Subsequent attempts to use the dialog may succeed as the configuration is loaded. + */ + FBSDKDialogUnavailableErrorCode, + + /*! + @abstract Indicates an operation failed because a required access token was not found. + */ + FBSDKAccessTokenRequiredErrorCode, + + /*! + @abstract Indicates an app switch (typically for a dialog) failed because the destination app is out of date. + */ + FBSDKAppVersionUnsupportedErrorCode, + + /*! + @abstract Indicates an app switch to the browser (typically for a dialog) failed. + */ + FBSDKBrowswerUnavailableErrorCode, +}; + +/*! + @typedef NS_ENUM(NSUInteger, FBSDKGraphRequestErrorCategory) + @abstract Describes the category of Facebook error. See `FBSDKGraphRequestErrorCategoryKey`. + */ +typedef NS_ENUM(NSUInteger, FBSDKGraphRequestErrorCategory) +{ + /*! The default error category that is not known to be recoverable. Check `FBSDKLocalizedErrorDescriptionKey` for a user facing message. */ + FBSDKGraphRequestErrorCategoryOther = 0, + /*! Indicates the error is temporary (such as server throttling). While a recoveryAttempter will be provided with the error instance, the attempt is guaranteed to succeed so you can simply retry the operation if you do not want to present an alert. */ + FBSDKGraphRequestErrorCategoryTransient = 1, + /*! Indicates the error can be recovered (such as requiring a login). A recoveryAttempter will be provided with the error instance that can take UI action. */ + FBSDKGraphRequestErrorCategoryRecoverable = 2 +}; + +/* + @methodgroup error userInfo keys + */ + +/*! + @abstract The userInfo key for the invalid collection for errors with FBSDKInvalidArgumentErrorCode. + @discussion If the invalid argument is a collection, the collection can be found with this key and the individual + invalid item can be found with FBSDKErrorArgumentValueKey. + */ +FBSDK_EXTERN NSString *const FBSDKErrorArgumentCollectionKey; + +/*! + @abstract The userInfo key for the invalid argument name for errors with FBSDKInvalidArgumentErrorCode. + */ +FBSDK_EXTERN NSString *const FBSDKErrorArgumentNameKey; + +/*! + @abstract The userInfo key for the invalid argument value for errors with FBSDKInvalidArgumentErrorCode. + */ +FBSDK_EXTERN NSString *const FBSDKErrorArgumentValueKey; + +/*! + @abstract The userInfo key for the message for developers in NSErrors that originate from the SDK. + @discussion The developer message will not be localized and is not intended to be presented within the app. + */ +FBSDK_EXTERN NSString *const FBSDKErrorDeveloperMessageKey; + +/*! + @abstract The userInfo key describing a localized description that can be presented to the user. + */ +FBSDK_EXTERN NSString *const FBSDKErrorLocalizedDescriptionKey; + +/*! + @abstract The userInfo key describing a localized title that can be presented to the user, used with `FBSDKLocalizedErrorDescriptionKey`. + */ +FBSDK_EXTERN NSString *const FBSDKErrorLocalizedTitleKey; + +/* + @methodgroup FBSDKGraphRequest error userInfo keys + */ + +/*! + @abstract The userInfo key describing the error category, for error recovery purposes. + @discussion See `FBSDKGraphErrorRecoveryProcessor` and `[FBSDKGraphRequest disableErrorRecovery]`. + */ +FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorCategoryKey; + +/* + @abstract The userInfo key for the Graph API error code. + */ +FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorGraphErrorCode; + +/* + @abstract The userInfo key for the Graph API error subcode. + */ +FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorGraphErrorSubcode; + +/* + @abstract The userInfo key for the HTTP status code. + */ +FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorHTTPStatusCodeKey; + +/* + @abstract The userInfo key for the raw JSON response. + */ +FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorParsedJSONResponseKey; + +/*! + @abstract a formal protocol very similar to the informal protocol NSErrorRecoveryAttempting + */ +@protocol FBSDKErrorRecoveryAttempting + +/*! + @abstract attempt the recovery + @param error the error + @param recoveryOptionIndex the selected option index + @param delegate the delegate + @param didRecoverSelector the callback selector, see discussion. + @param contextInfo context info to pass back to callback selector, see discussion. + @discussion + Given that an error alert has been presented document-modally to the user, and the user has chosen one of the error's recovery options, attempt recovery from the error, and send the selected message to the specified delegate. The option index is an index into the error's array of localized recovery options. The method selected by didRecoverSelector must have the same signature as: + + - (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void *)contextInfo; + + The value passed for didRecover must be YES if error recovery was completely successful, NO otherwise. + */ +- (void)attemptRecoveryFromError:(NSError *)error optionIndex:(NSUInteger)recoveryOptionIndex delegate:(id)delegate didRecoverSelector:(SEL)didRecoverSelector contextInfo:(void *)contextInfo; + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKCopying.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKCopying.h new file mode 100644 index 0000000..f4ad767 --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKCopying.h @@ -0,0 +1,33 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract Extension protocol for NSCopying that adds the copy method, which is implemented on NSObject. + @discussion NSObject implicitly conforms to this protocol. + */ +@protocol FBSDKCopying + +/*! + @abstract Implemented by NSObject as a convenience to copyWithZone:. + @return A copy of the receiver. + */ +- (id)copy; + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKCoreKit.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKCoreKit.h new file mode 100644 index 0000000..1d15674 --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKCoreKit.h @@ -0,0 +1,38 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#define FBSDK_VERSION_STRING @"4.8.0" +#define FBSDK_TARGET_PLATFORM_VERSION @"v2.5" diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKGraphErrorRecoveryProcessor.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKGraphErrorRecoveryProcessor.h new file mode 100644 index 0000000..d2b0313 --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKGraphErrorRecoveryProcessor.h @@ -0,0 +1,97 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 "FBSDKConstants.h" + +@class FBSDKGraphErrorRecoveryProcessor; +@class FBSDKGraphRequest; + +/*! + @abstract Defines a delegate for `FBSDKGraphErrorRecoveryProcessor`. + */ +@protocol FBSDKGraphErrorRecoveryProcessorDelegate + +/*! + @abstract Indicates the error recovery has been attempted. + @param processor the processor instance. + @param didRecover YES if the recovery was successful. + @param error the error that that was attempted to be recovered from. + */ +- (void)processorDidAttemptRecovery:(FBSDKGraphErrorRecoveryProcessor *)processor didRecover:(BOOL)didRecover error:(NSError *)error; + +@optional +/*! + @abstract Indicates the processor is about to process the error. + @param processor the processor instance. + @param error the error is about to be processed. + @discussion return NO if the processor should not process the error. For example, + if you want to prevent alerts of localized messages but otherwise perform retries and recoveries, + you could return NO for errors where userInfo[FBSDKGraphRequestErrorCategoryKey] equal to FBSDKGraphRequestErrorCategoryOther + */ +- (BOOL)processorWillProcessError:(FBSDKGraphErrorRecoveryProcessor *)processor error:(NSError *)error; + +@end + +/*! + @abstract Defines a type that can process Facebook NSErrors with best practices. + @discussion Facebook NSErrors can contain FBSDKErrorRecoveryAttempting instances to recover from errors, or + localized messages to present to the user. This class will process the instances as follows: + + 1. If the error is temporary as indicated by FBSDKGraphRequestErrorCategoryKey, assume the recovery succeeded and + notify the delegate. + 2. If a FBSDKErrorRecoveryAttempting instance is available, display an alert (dispatched to main thread) + with the recovery options and call the instance's [ attemptRecoveryFromError:optionIndex:...]. + 3. If a FBSDKErrorRecoveryAttempting is not available, check the userInfo for FBSDKLocalizedErrorDescriptionKey + and present that in an alert (dispatched to main thread). + + By default, FBSDKGraphRequests use this type to process errors and retry the request upon a successful + recovery. + + Note that Facebook recovery attempters can present UI or even cause app switches (such as to login). Any such + work is dispatched to the main thread (therefore your request handlers may then run on the main thread). + + Login recovery requires FBSDKLoginKit. Login will use FBSDKLoginBehaviorNative and will prompt the user + for all permissions last granted. If any are declined on the new request, the recovery is not successful but + the `[FBSDKAccessToken currentAccessToken]` might still have been updated. + . + */ +@interface FBSDKGraphErrorRecoveryProcessor : NSObject + +/*! + @abstract Gets the delegate. Note this is a strong reference, and is nil'ed out after recovery is complete. + */ +@property (nonatomic, strong, readonly) iddelegate; + +/*! + @abstract Attempts to process the error, return YES if the error can be processed. + @param error the error to process. + @param request the relateed request that may be reissued. + @param delegate the delegate that will be retained until recovery is complete. + */ +- (BOOL)processError:(NSError *)error request:(FBSDKGraphRequest *)request delegate:(id) delegate; + +/*! + @abstract The callback for FBSDKErrorRecoveryAttempting + @param didRecover if the recovery succeeded + @param contextInfo unused + */ +- (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void *)contextInfo; + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKGraphRequest.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKGraphRequest.h new file mode 100644 index 0000000..5ae03e2 --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKGraphRequest.h @@ -0,0 +1,120 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +@class FBSDKAccessToken; + +/*! + @abstract Represents a request to the Facebook Graph API. + + @discussion `FBSDKGraphRequest` encapsulates the components of a request (the + Graph API path, the parameters, error recovery behavior) and should be + used in conjunction with `FBSDKGraphRequestConnection` to issue the request. + + Nearly all Graph APIs require an access token. Unless specified, the + `[FBSDKAccessToken currentAccessToken]` is used. Therefore, most requests + will require login first (see `FBSDKLoginManager` in FBSDKLoginKit.framework). + + A `- start` method is provided for convenience for single requests. + + By default, FBSDKGraphRequest will attempt to recover any errors returned from + Facebook. You can disable this via `disableErrorRecovery:`. + @see FBSDKGraphErrorRecoveryProcessor + */ +@interface FBSDKGraphRequest : NSObject + +/*! + @abstract Initializes a new instance that use use `[FBSDKAccessToken currentAccessToken]`. + @param graphPath the graph path (e.g., @"me"). + @param parameters the optional parameters dictionary. + */ +- (instancetype)initWithGraphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters; + +/*! + @abstract Initializes a new instance that use use `[FBSDKAccessToken currentAccessToken]`. + @param graphPath the graph path (e.g., @"me"). + @param parameters the optional parameters dictionary. + @param HTTPMethod the optional HTTP method. nil defaults to @"GET". + */ +- (instancetype)initWithGraphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod; + +/*! + @abstract Initializes a new instance. + @param graphPath the graph path (e.g., @"me"). + @param parameters the optional parameters dictionary. + @param tokenString the token string to use. Specifying nil will cause no token to be used. + @param version the optional Graph API version (e.g., @"v2.0"). nil defaults to FBSDK_TARGET_PLATFORM_VERSION. + @param HTTPMethod the optional HTTP method (e.g., @"POST"). nil defaults to @"GET". + */ +- (instancetype)initWithGraphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + tokenString:(NSString *)tokenString + version:(NSString *)version + HTTPMethod:(NSString *)HTTPMethod +NS_DESIGNATED_INITIALIZER; + +/*! + @abstract The request parameters. + */ +@property (nonatomic, strong, readonly) NSMutableDictionary *parameters; + +/*! + @abstract The access token string used by the request. + */ +@property (nonatomic, copy, readonly) NSString *tokenString; + +/*! + @abstract The Graph API endpoint to use for the request, for example "me". + */ +@property (nonatomic, copy, readonly) NSString *graphPath; + +/*! + @abstract The HTTPMethod to use for the request, for example "GET" or "POST". + */ +@property (nonatomic, copy, readonly) NSString *HTTPMethod; + +/*! + @abstract The Graph API version to use (e.g., "v2.0") + */ +@property (nonatomic, copy, readonly) NSString *version; + +/*! + @abstract If set, disables the automatic error recovery mechanism. + @param disable whether to disable the automatic error recovery mechanism + @discussion By default, non-batched FBSDKGraphRequest instances will automatically try to recover + from errors by constructing a `FBSDKGraphErrorRecoveryProcessor` instance that + re-issues the request on successful recoveries. The re-issued request will call the same + handler as the receiver but may occur with a different `FBSDKGraphRequestConnection` instance. + + This will override [FBSDKSettings setGraphErrorRecoveryDisabled:]. + */ +- (void)setGraphErrorRecoveryDisabled:(BOOL)disable; + +/*! + @abstract Starts a connection to the Graph API. + @param handler The handler block to call when the request completes. + */ +- (FBSDKGraphRequestConnection *)startWithCompletionHandler:(FBSDKGraphRequestHandler)handler; + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKGraphRequestConnection.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKGraphRequestConnection.h new file mode 100644 index 0000000..79ffb3f --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKGraphRequestConnection.h @@ -0,0 +1,325 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +@class FBSDKGraphRequest; +@class FBSDKGraphRequestConnection; + +/*! + @typedef FBSDKGraphRequestHandler + + @abstract + A block that is passed to addRequest to register for a callback with the results of that + request once the connection completes. + + @discussion + Pass a block of this type when calling addRequest. This will be called once + the request completes. The call occurs on the UI thread. + + @param connection The `FBSDKGraphRequestConnection` that sent the request. + + @param result The result of the request. This is a translation of + JSON data to `NSDictionary` and `NSArray` objects. This + is nil if there was an error. + + @param error The `NSError` representing any error that occurred. + + */ +typedef void (^FBSDKGraphRequestHandler)(FBSDKGraphRequestConnection *connection, + id result, + NSError *error); + +/*! + @protocol + + @abstract + The `FBSDKGraphRequestConnectionDelegate` protocol defines the methods used to receive network + activity progress information from a . + */ +@protocol FBSDKGraphRequestConnectionDelegate + +@optional + +/*! + @method + + @abstract + Tells the delegate the request connection will begin loading + + @discussion + If the is created using one of the convenience factory methods prefixed with + start, the object returned from the convenience method has already begun loading and this method + will not be called when the delegate is set. + + @param connection The request connection that is starting a network request + */ +- (void)requestConnectionWillBeginLoading:(FBSDKGraphRequestConnection *)connection; + +/*! + @method + + @abstract + Tells the delegate the request connection finished loading + + @discussion + If the request connection completes without a network error occuring then this method is called. + Invocation of this method does not indicate success of every made, only that the + request connection has no further activity. Use the error argument passed to the FBSDKGraphRequestHandler + block to determine success or failure of each . + + This method is invoked after the completion handler for each . + + @param connection The request connection that successfully completed a network request + */ +- (void)requestConnectionDidFinishLoading:(FBSDKGraphRequestConnection *)connection; + +/*! + @method + + @abstract + Tells the delegate the request connection failed with an error + + @discussion + If the request connection fails with a network error then this method is called. The `error` + argument specifies why the network connection failed. The `NSError` object passed to the + FBSDKGraphRequestHandler block may contain additional information. + + @param connection The request connection that successfully completed a network request + @param error The `NSError` representing the network error that occurred, if any. May be nil + in some circumstances. Consult the `NSError` for the for reliable + failure information. + */ +- (void)requestConnection:(FBSDKGraphRequestConnection *)connection + didFailWithError:(NSError *)error; + +/*! + @method + + @abstract + Tells the delegate how much data has been sent and is planned to send to the remote host + + @discussion + The byte count arguments refer to the aggregated objects, not a particular . + + Like `NSURLConnection`, the values may change in unexpected ways if data needs to be resent. + + @param connection The request connection transmitting data to a remote host + @param bytesWritten The number of bytes sent in the last transmission + @param totalBytesWritten The total number of bytes sent to the remote host + @param totalBytesExpectedToWrite The total number of bytes expected to send to the remote host + */ +- (void)requestConnection:(FBSDKGraphRequestConnection *)connection + didSendBodyData:(NSInteger)bytesWritten + totalBytesWritten:(NSInteger)totalBytesWritten +totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite; + +@end + +/*! + @class FBSDKGraphRequestConnection + + @abstract + The `FBSDKGraphRequestConnection` represents a single connection to Facebook to service a request. + + @discussion + The request settings are encapsulated in a reusable object. The + `FBSDKGraphRequestConnection` object encapsulates the concerns of a single communication + e.g. starting a connection, canceling a connection, or batching requests. + + */ +@interface FBSDKGraphRequestConnection : NSObject + +/*! + @abstract + The delegate object that receives updates. + */ +@property (nonatomic, assign) id delegate; + +/*! + @abstract Gets or sets the timeout interval to wait for a response before giving up. + */ +@property (nonatomic) NSTimeInterval timeout; + +/*! + @abstract + The raw response that was returned from the server. (readonly) + + @discussion + This property can be used to inspect HTTP headers that were returned from + the server. + + The property is nil until the request completes. If there was a response + then this property will be non-nil during the FBSDKGraphRequestHandler callback. + */ +@property (nonatomic, retain, readonly) NSHTTPURLResponse *URLResponse; + +/*! + @methodgroup Class methods + */ + +/*! + @method + + @abstract + This method sets the default timeout on all FBSDKGraphRequestConnection instances. Defaults to 60 seconds. + + @param defaultConnectionTimeout The timeout interval. + */ ++ (void)setDefaultConnectionTimeout:(NSTimeInterval)defaultConnectionTimeout; + +/*! + @methodgroup Adding requests + */ + +/*! + @method + + @abstract + This method adds an object to this connection. + + @param request A request to be included in the round-trip when start is called. + @param handler A handler to call back when the round-trip completes or times out. + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. + */ +- (void)addRequest:(FBSDKGraphRequest *)request + completionHandler:(FBSDKGraphRequestHandler)handler; + +/*! + @method + + @abstract + This method adds an object to this connection. + + @param request A request to be included in the round-trip when start is called. + + @param handler A handler to call back when the round-trip completes or times out. + The handler will be invoked on the main thread. + + @param name An optional name for this request. This can be used to feed + the results of one request to the input of another in the same + `FBSDKGraphRequestConnection` as described in + [Graph API Batch Requests]( https://developers.facebook.com/docs/reference/api/batch/ ). + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. This request can be named + to allow for using the request's response in a subsequent request. + */ +- (void)addRequest:(FBSDKGraphRequest *)request + completionHandler:(FBSDKGraphRequestHandler)handler + batchEntryName:(NSString *)name; + +/*! + @method + + @abstract + This method adds an object to this connection. + + @param request A request to be included in the round-trip when start is called. + + @param handler A handler to call back when the round-trip completes or times out. + + @param batchParameters The optional dictionary of parameters to include for this request + as described in [Graph API Batch Requests]( https://developers.facebook.com/docs/reference/api/batch/ ). + Examples include "depends_on", "name", or "omit_response_on_success". + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. This request can be named + to allow for using the request's response in a subsequent request. + */ +- (void)addRequest:(FBSDKGraphRequest *)request + completionHandler:(FBSDKGraphRequestHandler)handler + batchParameters:(NSDictionary *)batchParameters; + +/*! + @methodgroup Instance methods + */ + +/*! + @method + + @abstract + Signals that a connection should be logically terminated as the + application is no longer interested in a response. + + @discussion + Synchronously calls any handlers indicating the request was cancelled. Cancel + does not guarantee that the request-related processing will cease. It + does promise that all handlers will complete before the cancel returns. A call to + cancel prior to a start implies a cancellation of all requests associated + with the connection. + */ +- (void)cancel; + +/*! + @method + + @abstract + This method starts a connection with the server and is capable of handling all of the + requests that were added to the connection. + + @discussion By default, a connection is scheduled on the current thread in the default mode when it is created. + See `setDelegateQueue:` for other options. + + This method cannot be called twice for an `FBSDKGraphRequestConnection` instance. + */ +- (void)start; + +/*! + @abstract Determines the operation queue that is used to call methods on the connection's delegate. + @param queue The operation queue to use when calling delegate methods. + @discussion By default, a connection is scheduled on the current thread in the default mode when it is created. + You cannot reschedule a connection after it has started. + + This is very similar to `[NSURLConnection setDelegateQueue:]`. + */ +- (void)setDelegateQueue:(NSOperationQueue *)queue; + +/*! + @method + + @abstract + Overrides the default version for a batch request + + @discussion + The SDK automatically prepends a version part, such as "v2.0" to API paths in order to simplify API versioning + for applications. If you want to override the version part while using batch requests on the connection, call + this method to set the version for the batch request. + + @param version This is a string in the form @"v2.0" which will be used for the version part of an API path + */ +- (void)overrideVersionPartWith:(NSString *)version; + +@end + +/*! + @abstract The key in the result dictionary for requests to old versions of the Graph API + whose response is not a JSON object. + + @discussion When a request returns a non-JSON response (such as a "true" literal), that response + will be wrapped into a dictionary using this const as the key. This only applies for very few Graph API + prior to v2.1. + */ +FBSDK_EXTERN NSString *const FBSDKNonJSONResponseProperty; diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKGraphRequestDataAttachment.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKGraphRequestDataAttachment.h new file mode 100644 index 0000000..c179e29 --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKGraphRequestDataAttachment.h @@ -0,0 +1,52 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract A container class for data attachments so that additional metadata can be provided about the attachment. + */ +@interface FBSDKGraphRequestDataAttachment : NSObject + +/*! + @abstract Initializes the receiver with the attachment data and metadata. + @param data The attachment data (retained, not copied) + @param filename The filename for the attachment + @param contentType The content type for the attachment + */ +- (instancetype)initWithData:(NSData *)data + filename:(NSString *)filename + contentType:(NSString *)contentType +NS_DESIGNATED_INITIALIZER; + +/*! + @abstract The content type for the attachment. + */ +@property (nonatomic, copy, readonly) NSString *contentType; + +/*! + @abstract The attachment data. + */ +@property (nonatomic, strong, readonly) NSData *data; + +/*! + @abstract The filename for the attachment. + */ +@property (nonatomic, copy, readonly) NSString *filename; + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKMacros.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKMacros.h new file mode 100644 index 0000000..fd2e2ff --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKMacros.h @@ -0,0 +1,39 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +#ifdef __cplusplus +#define FBSDK_EXTERN extern "C" __attribute__((visibility ("default"))) +#else +#define FBSDK_EXTERN extern __attribute__((visibility ("default"))) +#endif + +#define FBSDK_STATIC_INLINE static inline + +#define FBSDK_NO_DESIGNATED_INITIALIZER() \ +@throw [NSException exceptionWithName:NSInvalidArgumentException \ + reason:[NSString stringWithFormat:@"unrecognized selector sent to instance %p", self] \ + userInfo:nil] + +#define FBSDK_NOT_DESIGNATED_INITIALIZER(DESIGNATED_INITIALIZER) \ +@throw [NSException exceptionWithName:NSInvalidArgumentException \ + reason:[NSString stringWithFormat:@"Please use the designated initializer [%p %@]", \ + self, \ + NSStringFromSelector(@selector(DESIGNATED_INITIALIZER))] \ + userInfo:nil] diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKMutableCopying.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKMutableCopying.h new file mode 100644 index 0000000..621fac9 --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKMutableCopying.h @@ -0,0 +1,35 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract Extension protocol for NSMutableCopying that adds the mutableCopy method, which is implemented on NSObject. + @discussion NSObject implicitly conforms to this protocol. + */ +@protocol FBSDKMutableCopying + +/*! + @abstract Implemented by NSObject as a convenience to mutableCopyWithZone:. + @return A mutable copy of the receiver. + */ +- (id)mutableCopy; + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKProfile.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKProfile.h new file mode 100644 index 0000000..11da3d9 --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKProfile.h @@ -0,0 +1,148 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 "FBSDKMacros.h" +#import "FBSDKProfilePictureView.h" + +/*! + @abstract Notification indicating that the `currentProfile` has changed. + @discussion the userInfo dictionary of the notification will contain keys + `FBSDKProfileChangeOldKey` and + `FBSDKProfileChangeNewKey`. + */ +FBSDK_EXTERN NSString *const FBSDKProfileDidChangeNotification; + +/* @abstract key in notification's userInfo object for getting the old profile. + @discussion If there was no old profile, the key will not be present. + */ +FBSDK_EXTERN NSString *const FBSDKProfileChangeOldKey; + +/* @abstract key in notification's userInfo object for getting the new profile. + @discussion If there is no new profile, the key will not be present. + */ +FBSDK_EXTERN NSString *const FBSDKProfileChangeNewKey; + +/*! + @abstract Represents an immutable Facebook profile + @discussion This class provides a global "currentProfile" instance to more easily + add social context to your application. When the profile changes, a notification is + posted so that you can update relevant parts of your UI and is persisted to NSUserDefaults. + + Typically, you will want to call `enableUpdatesOnAccessTokenChange:YES` so that + it automatically observes changes to the `[FBSDKAccessToken currentAccessToken]`. + + You can use this class to build your own `FBSDKProfilePictureView` or in place of typical requests to "/me". + */ +@interface FBSDKProfile : NSObject + +/*! + @abstract initializes a new instance. + @param userID the user ID + @param firstName the user's first name + @param middleName the user's middle name + @param lastName the user's last name + @param name the user's complete name + @param linkURL the link for this profile + @param refreshDate the optional date this profile was fetched. Defaults to [NSDate date]. + */ +- (instancetype)initWithUserID:(NSString *)userID + firstName:(NSString *)firstName + middleName:(NSString *)middleName + lastName:(NSString *)lastName + name:(NSString *)name + linkURL:(NSURL *)linkURL + refreshDate:(NSDate *)refreshDate NS_DESIGNATED_INITIALIZER; +/*! + @abstract The user id + */ +@property (nonatomic, readonly) NSString *userID; +/*! + @abstract The user's first name + */ +@property (nonatomic, readonly) NSString *firstName; +/*! + @abstract The user's middle name + */ +@property (nonatomic, readonly) NSString *middleName; +/*! + @abstract The user's last name + */ +@property (nonatomic, readonly) NSString *lastName; +/*! + @abstract The user's complete name + */ +@property (nonatomic, readonly) NSString *name; +/*! + @abstract A URL to the user's profile. + @discussion Consider using Bolts and `FBSDKAppLinkResolver` to resolve this + to an app link to link directly to the user's profile in the Facebook app. + */ +@property (nonatomic, readonly) NSURL *linkURL; + +/*! + @abstract The last time the profile data was fetched. + */ +@property (nonatomic, readonly) NSDate *refreshDate; + +/*! + @abstract Gets the current FBSDKProfile instance. + */ ++ (FBSDKProfile *)currentProfile; + +/*! + @abstract Sets the current instance and posts the appropriate notification if the profile parameter is different + than the receiver. + @param profile the profile to set + @discussion This persists the profile to NSUserDefaults. + */ ++ (void)setCurrentProfile:(FBSDKProfile *)profile; + +/*! + @abstract Indicates if `currentProfile` will automatically observe `FBSDKAccessTokenDidChangeNotification` notifications + @param enable YES is observing + @discussion If observing, this class will issue a graph request for public profile data when the current token's userID + differs from the current profile. You can observe `FBSDKProfileDidChangeNotification` for when the profile is updated. + + Note that if `[FBSDKAccessToken currentAccessToken]` is unset, the `currentProfile` instance remains. It's also possible + for `currentProfile` to return nil until the data is fetched. + */ ++ (void)enableUpdatesOnAccessTokenChange:(BOOL)enable; + +/*! + @abstract A convenience method for returning a complete `NSURL` for retrieving the user's profile image. + @param mode The picture mode + @param size The height and width. This will be rounded to integer precision. + */ +- (NSURL *)imageURLForPictureMode:(FBSDKProfilePictureMode)mode size:(CGSize)size; + +/*! + @abstract A convenience method for returning a Graph API path for retrieving the user's profile image. + @deprecated use `imageURLForPictureMode:size:` instead + @discussion You can pass this to a `FBSDKGraphRequest` instance to download the image. + @param mode The picture mode + @param size The height and width. This will be rounded to integer precision. + */ +- (NSString *)imagePathForPictureMode:(FBSDKProfilePictureMode)mode size:(CGSize)size +__attribute__ ((deprecated("use imageURLForPictureMode:size: instead"))); + +/*! + @abstract Returns YES if the profile is equivalent to the receiver. + @param profile the profile to compare to. + */ +- (BOOL)isEqualToProfile:(FBSDKProfile *)profile; +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKProfilePictureView.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKProfilePictureView.h new file mode 100644 index 0000000..f1f64cb --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKProfilePictureView.h @@ -0,0 +1,59 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @typedef FBSDKProfilePictureMode enum + @abstract Defines the aspect ratio mode for the source image of the profile picture. + */ +typedef NS_ENUM(NSUInteger, FBSDKProfilePictureMode) +{ + /*! + @abstract A square cropped version of the image will be included in the view. + */ + FBSDKProfilePictureModeSquare, + /*! + @abstract The original picture's aspect ratio will be used for the source image in the view. + */ + FBSDKProfilePictureModeNormal, +}; + +/*! + @abstract A view to display a profile picture. + */ +@interface FBSDKProfilePictureView : UIView + +/*! + @abstract The mode for the receiver to determine the aspect ratio of the source image. + */ +@property (nonatomic, assign) FBSDKProfilePictureMode pictureMode; + +/*! + @abstract The profile ID to show the picture for. + */ +@property (nonatomic, copy) NSString *profileID; + +/*! + @abstract Explicitly marks the receiver as needing to update the image. + @discussion This method is called whenever any properties that affect the source image are modified, but this can also + be used to trigger a manual update of the image if it needs to be re-downloaded. + */ +- (void)setNeedsImageUpdate; + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKSettings.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKSettings.h new file mode 100644 index 0000000..edc0040 --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKSettings.h @@ -0,0 +1,209 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/* + * Constants defining logging behavior. Use with <[FBSDKSettings setLoggingBehavior]>. + */ + +/*! Include access token in logging. */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorAccessTokens; + +/*! Log performance characteristics */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorPerformanceCharacteristics; + +/*! Log FBSDKAppEvents interactions */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorAppEvents; + +/*! Log Informational occurrences */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorInformational; + +/*! Log cache errors. */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorCacheErrors; + +/*! Log errors from SDK UI controls */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorUIControlErrors; + +/*! Log debug warnings from API response, i.e. when friends fields requested, but user_friends permission isn't granted. */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorGraphAPIDebugWarning; + +/*! Log warnings from API response, i.e. when requested feature will be deprecated in next version of API. + Info is the lowest level of severity, using it will result in logging all previously mentioned levels. + */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorGraphAPIDebugInfo; + +/*! Log errors from SDK network requests */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorNetworkRequests; + +/*! Log errors likely to be preventable by the developer. This is in the default set of enabled logging behaviors. */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorDeveloperErrors; + +@interface FBSDKSettings : NSObject + +/*! + @abstract Get the Facebook App ID used by the SDK. + @discussion If not explicitly set, the default will be read from the application's plist (FacebookAppID). + */ ++ (NSString *)appID; + +/*! + @abstract Set the Facebook App ID to be used by the SDK. + @param appID The Facebook App ID to be used by the SDK. + */ ++ (void)setAppID:(NSString *)appID; + +/*! + @abstract Get the default url scheme suffix used for sessions. + @discussion If not explicitly set, the default will be read from the application's plist (FacebookUrlSchemeSuffix). + */ ++ (NSString *)appURLSchemeSuffix; + +/*! + @abstract Set the app url scheme suffix used by the SDK. + @param appURLSchemeSuffix The url scheme suffix to be used by the SDK. + */ ++ (void)setAppURLSchemeSuffix:(NSString *)appURLSchemeSuffix; + +/*! + @abstract Retrieve the Client Token that has been set via [FBSDKSettings setClientToken]. + @discussion If not explicitly set, the default will be read from the application's plist (FacebookClientToken). + */ ++ (NSString *)clientToken; + +/*! + @abstract Sets the Client Token for the Facebook App. + @discussion This is needed for certain API calls when made anonymously, without a user-based access token. + @param clientToken The Facebook App's "client token", which, for a given appid can be found in the Security + section of the Advanced tab of the Facebook App settings found at + */ ++ (void)setClientToken:(NSString *)clientToken; + +/*! + @abstract A convenient way to toggle error recovery for all FBSDKGraphRequest instances created after this is set. + @param disableGraphErrorRecovery YES or NO. + */ ++ (void)setGraphErrorRecoveryDisabled:(BOOL)disableGraphErrorRecovery; + +/*! + @abstract Get the Facebook Display Name used by the SDK. + @discussion If not explicitly set, the default will be read from the application's plist (FacebookDisplayName). + */ ++ (NSString *)displayName; + +/*! + @abstract Set the default Facebook Display Name to be used by the SDK. + @discussion This should match the Display Name that has been set for the app with the corresponding Facebook App ID, + in the Facebook App Dashboard. + @param displayName The Facebook Display Name to be used by the SDK. + */ ++ (void)setDisplayName:(NSString *)displayName; + +/*! + @abstract Get the Facebook domain part. + @discussion If not explicitly set, the default will be read from the application's plist (FacebookDomainPart). + */ ++ (NSString *)facebookDomainPart; + +/*! + @abstract Set the subpart of the Facebook domain. + @discussion This can be used to change the Facebook domain (e.g. @"beta") so that requests will be sent to + graph.beta.facebook.com + @param facebookDomainPart The domain part to be inserted into facebook.com. + */ ++ (void)setFacebookDomainPart:(NSString *)facebookDomainPart; + +/*! + @abstract The quality of JPEG images sent to Facebook from the SDK. + @discussion If not explicitly set, the default is 0.9. + @see [UIImageJPEGRepresentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIImageJPEGRepresentation) */ ++ (CGFloat)JPEGCompressionQuality; + +/*! + @abstract Set the quality of JPEG images sent to Facebook from the SDK. + @param JPEGCompressionQuality The quality for JPEG images, expressed as a value from 0.0 to 1.0. + @see [UIImageJPEGRepresentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIImageJPEGRepresentation) */ ++ (void)setJPEGCompressionQuality:(CGFloat)JPEGCompressionQuality; + +/*! + @abstract + Gets whether data such as that generated through FBSDKAppEvents and sent to Facebook should be restricted from being used for other than analytics and conversions. Defaults to NO. This value is stored on the device and persists across app launches. + */ ++ (BOOL)limitEventAndDataUsage; + +/*! + @abstract + Sets whether data such as that generated through FBSDKAppEvents and sent to Facebook should be restricted from being used for other than analytics and conversions. Defaults to NO. This value is stored on the device and persists across app launches. + + @param limitEventAndDataUsage The desired value. + */ ++ (void)setLimitEventAndDataUsage:(BOOL)limitEventAndDataUsage; + +/*! + @abstract Retrieve the current iOS SDK version. + */ ++ (NSString *)sdkVersion; + +/*! + @abstract Retrieve the current Facebook SDK logging behavior. + */ ++ (NSSet *)loggingBehavior; + +/*! + @abstract Set the current Facebook SDK logging behavior. This should consist of strings defined as + constants with FBSDKLoggingBehavior*. + + @param loggingBehavior A set of strings indicating what information should be logged. If nil is provided, the logging + behavior is reset to the default set of enabled behaviors. Set to an empty set in order to disable all logging. + + @discussion You can also define this via an array in your app plist with key "FacebookLoggingBehavior" or add and remove individual values via enableLoggingBehavior: or disableLogginBehavior: + */ ++ (void)setLoggingBehavior:(NSSet *)loggingBehavior; + +/*! + @abstract Enable a particular Facebook SDK logging behavior. + + @param loggingBehavior The LoggingBehavior to enable. This should be a string defined as a constant with FBSDKLoggingBehavior*. + */ ++ (void)enableLoggingBehavior:(NSString *)loggingBehavior; + +/*! + @abstract Disable a particular Facebook SDK logging behavior. + + @param loggingBehavior The LoggingBehavior to disable. This should be a string defined as a constant with FBSDKLoggingBehavior*. + */ ++ (void)disableLoggingBehavior:(NSString *)loggingBehavior; + +/*! + @abstract Set the user defaults key used by legacy token caches. + + @param tokenInformationKeyName the key used by legacy token caches. + + @discussion Use this only if you customized FBSessionTokenCachingStrategy in v3.x of + the Facebook SDK for iOS. +*/ ++ (void)setLegacyUserDefaultTokenInformationKeyName:(NSString *)tokenInformationKeyName; + +/*! + @abstract Get the user defaults key used by legacy token caches. +*/ ++ (NSString *)legacyUserDefaultTokenInformationKeyName; + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKTestUsersManager.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKTestUsersManager.h new file mode 100644 index 0000000..7d2e0ac --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKTestUsersManager.h @@ -0,0 +1,102 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +@class FBSDKAccessToken; + +/*! + @typedef + + @abstract Callback block for returning an array of FBSDKAccessToken instances (and possibly `NSNull` instances); or an error. + */ +typedef void (^FBSDKTestUsersManagerRetrieveTestAccountTokensHandler)(NSArray *tokens, NSError *error) ; + +/*! + @typedef + + @abstract Callback block for removing a test user. + */ +typedef void (^FBSDKTestUsersManagerRemoveTestAccountHandler)(NSError *error) ; + + +/*! + @class FBSDKTestUsersManager + @abstract Provides methods for managing test accounts for testing Facebook integration. + + @discussion Facebook allows developers to create test accounts for testing their applications' + Facebook integration (see https://developers.facebook.com/docs/test_users/). This class + simplifies use of these accounts for writing tests. It is not designed for use in + production application code. + + This class will make Graph API calls on behalf of your app to manage test accounts and requires + an app id and app secret. You will typically use this class to write unit or integration tests. + Make sure you NEVER include your app secret in your production app. + */ +@interface FBSDKTestUsersManager : NSObject + +/*! + @abstract construct or return the shared instance + @param appID the Facebook app id + @param appSecret the Facebook app secret + */ ++ (instancetype)sharedInstanceForAppID:(NSString *)appID appSecret:(NSString *)appSecret; + +/*! + @abstract retrieve FBSDKAccessToken instances for test accounts with the specific permissions. + @param arraysOfPermissions an array of permissions sets, such as @[ [NSSet setWithObject:@"email"], [NSSet setWithObject:@"user_birthday"]] + if you needed two test accounts with email and birthday permissions, respectively. You can pass in empty nested sets + if you need two arbitrary test accounts. For convenience, passing nil is treated as @[ [NSSet set] ] + for fetching a single test user. + @param createIfNotFound if YES, new test accounts are created if no test accounts existed that fit the permissions + requirement + @param handler the callback to invoke which will return an array of `FBAccessTokenData` instances or an `NSError`. + If param `createIfNotFound` is NO, the array may contain `[NSNull null]` instances. + + @discussion If you are requesting test accounts with differing number of permissions, try to order + `arrayOfPermissionsArrays` so that the most number of permissions come first to minimize creation of new + test accounts. + */ +- (void)requestTestAccountTokensWithArraysOfPermissions:(NSArray *)arraysOfPermissions + createIfNotFound:(BOOL)createIfNotFound + completionHandler:(FBSDKTestUsersManagerRetrieveTestAccountTokensHandler)handler; + +/*! + @abstract add a test account with the specified permissions + @param permissions the set of permissions, e.g., [NSSet setWithObjects:@"email", @"user_friends"] + @param handler the callback handler + */ +- (void)addTestAccountWithPermissions:(NSSet *)permissions + completionHandler:(FBSDKTestUsersManagerRetrieveTestAccountTokensHandler)handler; + +/*! + @abstract remove a test account for the given user id + @param userId the user id + @param handler the callback handler + */ +- (void)removeTestAccount:(NSString *)userId completionHandler:(FBSDKTestUsersManagerRemoveTestAccountHandler)handler; + +/*! + @abstract Make two test users friends with each other. + @param first the token of the first user + @param second the token of the second user + @param callback the callback handler + */ +- (void)makeFriendsWithFirst:(FBSDKAccessToken *)first second:(FBSDKAccessToken *)second callback:(void (^)(NSError *))callback; + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKUtility.h b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKUtility.h new file mode 100644 index 0000000..46c490b --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Headers/FBSDKUtility.h @@ -0,0 +1,55 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract Class to contain common utility methods. + */ +@interface FBSDKUtility : NSObject + +/*! + @abstract Parses a query string into a dictionary. + @param queryString The query string value. + @return A dictionary with the key/value pairs. + */ ++ (NSDictionary *)dictionaryWithQueryString:(NSString *)queryString; + +/*! + @abstract Constructs a query string from a dictionary. + @param dictionary The dictionary with key/value pairs for the query string. + @param errorRef If an error occurs, upon return contains an NSError object that describes the problem. + @result Query string representation of the parameters. + */ ++ (NSString *)queryStringWithDictionary:(NSDictionary *)dictionary error:(NSError *__autoreleasing *)errorRef; + +/*! + @abstract Decodes a value from an URL. + @param value The value to decode. + @result The decoded value. + */ ++ (NSString *)URLDecode:(NSString *)value; + +/*! + @abstract Encodes a value for an URL. + @param value The value to encode. + @result The encoded value. + */ ++ (NSString *)URLEncode:(NSString *)value; + +@end diff --git a/dayPhoto/FBSDKCoreKit.framework/Info.plist b/dayPhoto/FBSDKCoreKit.framework/Info.plist new file mode 100644 index 0000000..4045ef4 Binary files /dev/null and b/dayPhoto/FBSDKCoreKit.framework/Info.plist differ diff --git a/dayPhoto/FBSDKCoreKit.framework/Modules/module.modulemap b/dayPhoto/FBSDKCoreKit.framework/Modules/module.modulemap new file mode 100644 index 0000000..3c3e6e6 --- /dev/null +++ b/dayPhoto/FBSDKCoreKit.framework/Modules/module.modulemap @@ -0,0 +1,31 @@ +framework module FBSDKCoreKit { + umbrella header "FBSDKCoreKit.h" + + export * + module * { export * } + + explicit module FBSDKButton { + header "FBSDKButton.h" + export * + } + + explicit module FBSDKAppLinkResolver { + header "FBSDKAppLinkResolver.h" + export * + } + + explicit module FBSDKGraphErrorRecoveryProcessor { + header "FBSDKGraphErrorRecoveryProcessor.h" + export * + } + + explicit module FBSDKGraphRequestDataAttachment { + header "FBSDKGraphRequestDataAttachment.h" + export * + } + + explicit module FBSDKTestUsersManager { + header "FBSDKTestUsersManager.h" + export * + } +} diff --git a/dayPhoto/FBSDKLoginKit.framework/FBSDKLoginKit b/dayPhoto/FBSDKLoginKit.framework/FBSDKLoginKit new file mode 100644 index 0000000..89b110b Binary files /dev/null and b/dayPhoto/FBSDKLoginKit.framework/FBSDKLoginKit differ diff --git a/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginButton.h b/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginButton.h new file mode 100644 index 0000000..51499d4 --- /dev/null +++ b/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginButton.h @@ -0,0 +1,128 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +#import "FBSDKTooltipView.h" + +@protocol FBSDKLoginButtonDelegate; + +/*! + @typedef NS_ENUM(NSUInteger, FBSDKLoginButtonTooltipBehavior) + @abstract Indicates the desired login tooltip behavior. + */ +typedef NS_ENUM(NSUInteger, FBSDKLoginButtonTooltipBehavior) +{ + /*! The default behavior. The tooltip will only be displayed if + the app is eligible (determined by possible server round trip) */ + FBSDKLoginButtonTooltipBehaviorAutomatic = 0, + /*! Force display of the tooltip (typically for UI testing) */ + FBSDKLoginButtonTooltipBehaviorForceDisplay = 1, + /*! Force disable. In this case you can still exert more refined + control by manually constructing a `FBSDKLoginTooltipView` instance. */ + FBSDKLoginButtonTooltipBehaviorDisable = 2 +}; + +/*! + @abstract A button that initiates a log in or log out flow upon tapping. + @discussion `FBSDKLoginButton` works with `[FBSDKAccessToken currentAccessToken]` to + determine what to display, and automatically starts authentication when tapped (i.e., + you do not need to manually subscribe action targets). + + Like `FBSDKLoginManager`, you should make sure your app delegate is connected to + `FBSDKApplicationDelegate` in order for the button's delegate to receive messages. + + `FBSDKLoginButton` has a fixed height, but you may change the width. `initWithFrame:CGRectZero` + will size the button to its minimum frame. +*/ +@interface FBSDKLoginButton : FBSDKButton + +/*! + @abstract The default audience to use, if publish permissions are requested at login time. + */ +@property (assign, nonatomic) FBSDKDefaultAudience defaultAudience; +/*! + @abstract Gets or sets the delegate. + */ +@property (weak, nonatomic) IBOutlet id delegate; +/*! + @abstract Gets or sets the login behavior to use + */ +@property (assign, nonatomic) FBSDKLoginBehavior loginBehavior; +/*! + @abstract The publish permissions to request. + + @discussion Use `defaultAudience` to specify the default audience to publish to. + Note this is converted to NSSet and is only + an NSArray for the convenience of literal syntax. + */ +@property (copy, nonatomic) NSArray *publishPermissions; +/*! + @abstract The read permissions to request. + + @discussion Note, that if read permissions are specified, then publish permissions should not be specified. This is converted to NSSet and is only + an NSArray for the convenience of literal syntax. + */ +@property (copy, nonatomic) NSArray *readPermissions; +/*! + @abstract Gets or sets the desired tooltip behavior. + */ +@property (assign, nonatomic) FBSDKLoginButtonTooltipBehavior tooltipBehavior; +/*! + @abstract Gets or sets the desired tooltip color style. + */ +@property (assign, nonatomic) FBSDKTooltipColorStyle tooltipColorStyle; + +@end + +/*! + @protocol + @abstract A delegate for `FBSDKLoginButton` + */ +@protocol FBSDKLoginButtonDelegate + +@required +/*! + @abstract Sent to the delegate when the button was used to login. + @param loginButton the sender + @param result The results of the login + @param error The error (if any) from the login + */ +- (void) loginButton:(FBSDKLoginButton *)loginButton +didCompleteWithResult:(FBSDKLoginManagerLoginResult *)result + error:(NSError *)error; + +/*! + @abstract Sent to the delegate when the button was used to logout. + @param loginButton The button that was clicked. +*/ +- (void)loginButtonDidLogOut:(FBSDKLoginButton *)loginButton; + +@optional +/*! + @abstract Sent to the delegate when the button is about to login. + @param loginButton the sender + @return YES if the login should be allowed to proceed, NO otherwise + */ +- (BOOL) loginButtonWillLogin:(FBSDKLoginButton *)loginButton; + +@end diff --git a/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginConstants.h b/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginConstants.h new file mode 100644 index 0000000..100c09a --- /dev/null +++ b/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginConstants.h @@ -0,0 +1,75 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract The error domain for all errors from FBSDKLoginKit + @discussion Error codes from the SDK in the range 300-399 are reserved for this domain. + */ +FBSDK_EXTERN NSString *const FBSDKLoginErrorDomain; + +/*! + @typedef NS_ENUM(NSInteger, FBSDKLoginErrorCode) + @abstract Error codes for FBSDKLoginErrorDomain. + */ +typedef NS_ENUM(NSInteger, FBSDKLoginErrorCode) +{ + /*! + @abstract Reserved. + */ + FBSDKLoginReservedErrorCode = 300, + /*! + @abstract The error code for unknown errors. + */ + FBSDKLoginUnknownErrorCode, + + /*! + @abstract The user's password has changed and must log in again + */ + FBSDKLoginPasswordChangedErrorCode, + /*! + @abstract The user must log in to their account on www.facebook.com to restore access + */ + FBSDKLoginUserCheckpointedErrorCode, + /*! + @abstract Indicates a failure to request new permissions because the user has changed. + */ + FBSDKLoginUserMismatchErrorCode, + /*! + @abstract The user must confirm their account with Facebook before logging in + */ + FBSDKLoginUnconfirmedUserErrorCode, + + /*! + @abstract The Accounts framework failed without returning an error, indicating the + app's slider in the iOS Facebook Settings (device Settings -> Facebook -> App Name) has + been disabled. + */ + FBSDKLoginSystemAccountAppDisabledErrorCode, + /*! + @abstract An error occurred related to Facebook system Account store + */ + FBSDKLoginSystemAccountUnavailableErrorCode, + /*! + @abstract The login response was missing a valid challenge string. + */ + FBSDKLoginBadChallengeString, +}; diff --git a/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginKit.h b/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginKit.h new file mode 100644 index 0000000..4723940 --- /dev/null +++ b/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginKit.h @@ -0,0 +1,25 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 +#import +#import +#import diff --git a/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginManager.h b/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginManager.h new file mode 100644 index 0000000..ee35bd8 --- /dev/null +++ b/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginManager.h @@ -0,0 +1,202 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +@class FBSDKLoginManagerLoginResult; + +/*! + @abstract Describes the call back to the FBSDKLoginManager + @param result the result of the authorization + @param error the authorization error, if any. + */ +typedef void (^FBSDKLoginManagerRequestTokenHandler)(FBSDKLoginManagerLoginResult *result, NSError *error); + + +/*! + @typedef FBSDKDefaultAudience enum + + @abstract + Passed to open to indicate which default audience to use for sessions that post data to Facebook. + + @discussion + Certain operations such as publishing a status or publishing a photo require an audience. When the user + grants an application permission to perform a publish operation, a default audience is selected as the + publication ceiling for the application. This enumerated value allows the application to select which + audience to ask the user to grant publish permission for. + */ +typedef NS_ENUM(NSUInteger, FBSDKDefaultAudience) +{ + /*! Indicates that the user's friends are able to see posts made by the application */ + FBSDKDefaultAudienceFriends = 0, + /*! Indicates that only the user is able to see posts made by the application */ + FBSDKDefaultAudienceOnlyMe, + /*! Indicates that all Facebook users are able to see posts made by the application */ + FBSDKDefaultAudienceEveryone, +}; + +/*! + @typedef FBSDKLoginBehavior enum + + @abstract + Passed to the \c FBSDKLoginManager to indicate how Facebook Login should be attempted. + + @discussion + Facebook Login authorizes the application to act on behalf of the user, using the user's + Facebook account. Usually a Facebook Login will rely on an account maintained outside of + the application, by the native Facebook application, the browser, or perhaps the device + itself. This avoids the need for a user to enter their username and password directly, and + provides the most secure and lowest friction way for a user to authorize the application to + interact with Facebook. + + The \c FBSDKLoginBehavior enum specifies which log-in methods may be used. The SDK + will determine the best behavior based on the current device (such as iOS version). + */ +typedef NS_ENUM(NSUInteger, FBSDKLoginBehavior) +{ + /*! + @abstract This is the default behavior, and indicates logging in through the native + Facebook app may be used. The SDK may still use Safari instead. + */ + FBSDKLoginBehaviorNative = 0, + /*! + @abstract Attempts log in through the Safari or SFSafariViewController, if available. + */ + FBSDKLoginBehaviorBrowser, + /*! + @abstract Attempts log in through the Facebook account currently signed in through + the device Settings. + @note If the account is not available to the app (either not configured by user or + as determined by the SDK) this behavior falls back to \c FBSDKLoginBehaviorNative. + */ + FBSDKLoginBehaviorSystemAccount, + /*! + @abstract Attemps log in through a modal \c UIWebView pop up + + @note This behavior is only available to certain types of apps. Please check the Facebook + Platform Policy to verify your app meets the restrictions. + */ + FBSDKLoginBehaviorWeb, +}; + +/*! + @abstract `FBSDKLoginManager` provides methods for logging the user in and out. + @discussion `FBSDKLoginManager` works directly with `[FBSDKAccessToken currentAccessToken]` and + sets the "currentAccessToken" upon successful authorizations (or sets `nil` in case of `logOut`). + + You should check `[FBSDKAccessToken currentAccessToken]` before calling logIn* to see if there is + a cached token available (typically in your viewDidLoad). + + If you are managing your own token instances outside of "currentAccessToken", you will need to set + "currentAccessToken" before calling logIn* to authorize futher permissions on your tokens. + */ +@interface FBSDKLoginManager : NSObject + +/*! + @abstract the default audience. + @discussion you should set this if you intend to ask for publish permissions. + */ +@property (assign, nonatomic) FBSDKDefaultAudience defaultAudience; + +/*! + @abstract the login behavior + */ +@property (assign, nonatomic) FBSDKLoginBehavior loginBehavior; + +/*! + @deprecated use logInWithReadPermissions:fromViewController:handler: instead + */ +- (void)logInWithReadPermissions:(NSArray *)permissions handler:(FBSDKLoginManagerRequestTokenHandler)handler +__attribute__ ((deprecated("use logInWithReadPermissions:fromViewController:handler: instead"))); + +/*! + @deprecated use logInWithPublishPermissions:fromViewController:handler: instead + */ +- (void)logInWithPublishPermissions:(NSArray *)permissions handler:(FBSDKLoginManagerRequestTokenHandler)handler +__attribute__ ((deprecated("use logInWithPublishPermissions:fromViewController:handler: instead"))); + +/*! + @abstract Logs the user in or authorizes additional permissions. + @param permissions the optional array of permissions. Note this is converted to NSSet and is only + an NSArray for the convenience of literal syntax. + @param fromViewController the view controller to present from. If nil, the topmost view controller will be + automatically determined as best as possible. + @param handler the callback. + @discussion Use this method when asking for read permissions. You should only ask for permissions when they + are needed and explain the value to the user. You can inspect the result.declinedPermissions to also + provide more information to the user if they decline permissions. + + If `[FBSDKAccessToken currentAccessToken]` is not nil, it will be treated as a reauthorization for that user + and will pass the "rerequest" flag to the login dialog. + + This method will present UI the user. You typically should check if `[FBSDKAccessToken currentAccessToken]` + already contains the permissions you need before asking to reduce unnecessary app switching. For example, + you could make that check at viewDidLoad. + */ +- (void)logInWithReadPermissions:(NSArray *)permissions + fromViewController:(UIViewController *)fromViewController + handler:(FBSDKLoginManagerRequestTokenHandler)handler; + +/*! + @abstract Logs the user in or authorizes additional permissions. + @param permissions the optional array of permissions. Note this is converted to NSSet and is only + an NSArray for the convenience of literal syntax. + @param fromViewController the view controller to present from. If nil, the topmost view controller will be + automatically determined as best as possible. + @param handler the callback. + @discussion Use this method when asking for publish permissions. You should only ask for permissions when they + are needed and explain the value to the user. You can inspect the result.declinedPermissions to also + provide more information to the user if they decline permissions. + + If `[FBSDKAccessToken currentAccessToken]` is not nil, it will be treated as a reauthorization for that user + and will pass the "rerequest" flag to the login dialog. + + This method will present UI the user. You typically should check if `[FBSDKAccessToken currentAccessToken]` + already contains the permissions you need before asking to reduce unnecessary app switching. For example, + you could make that check at viewDidLoad. + */ +- (void)logInWithPublishPermissions:(NSArray *)permissions + fromViewController:(UIViewController *)fromViewController + handler:(FBSDKLoginManagerRequestTokenHandler)handler; + +/*! + @abstract Logs the user out + @discussion This calls [FBSDKAccessToken setCurrentAccessToken:nil] and [FBSDKProfile setCurrentProfile:nil]. + */ +- (void)logOut; + +/*! + @method + + @abstract Issues an asychronous renewCredentialsForAccount call to the device's Facebook account store. + + @param handler The completion handler to call when the renewal is completed. This can be invoked on an arbitrary thread. + + @discussion This can be used to explicitly renew account credentials and is provided as a convenience wrapper around + `[ACAccountStore renewCredentialsForAccount:completion]`. Note the method will not issue the renewal call if the the + Facebook account has not been set on the device, or if access had not been granted to the account (though the handler + wil receive an error). + + If the `[FBSDKAccessToken currentAccessToken]` was from the account store, a succesful renewal will also set + a new "currentAccessToken". + */ ++ (void)renewSystemCredentials:(void (^)(ACAccountCredentialRenewResult result, NSError *error))handler; + +@end diff --git a/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginManagerLoginResult.h b/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginManagerLoginResult.h new file mode 100644 index 0000000..36a1af6 --- /dev/null +++ b/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginManagerLoginResult.h @@ -0,0 +1,62 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +@class FBSDKAccessToken; + +/*! + @abstract Describes the result of a login attempt. + */ +@interface FBSDKLoginManagerLoginResult : NSObject + +/*! + @abstract the access token. + */ +@property (copy, nonatomic) FBSDKAccessToken *token; + +/*! + @abstract whether the login was cancelled by the user. + */ +@property (readonly, nonatomic) BOOL isCancelled; + +/*! + @abstract the set of permissions granted by the user in the associated request. + @discussion inspect the token's permissions set for a complete list. + */ +@property (copy, nonatomic) NSSet *grantedPermissions; + +/*! + @abstract the set of permissions declined by the user in the associated request. + @discussion inspect the token's permissions set for a complete list. + */ +@property (copy, nonatomic) NSSet *declinedPermissions; + +/*! + @abstract Initializes a new instance. + @param token the access token + @param isCancelled whether the login was cancelled by the user + @param grantedPermissions the set of granted permissions + @param declinedPermissions the set of declined permissions + */ +- (instancetype)initWithToken:(FBSDKAccessToken *)token + isCancelled:(BOOL)isCancelled + grantedPermissions:(NSSet *)grantedPermissions + declinedPermissions:(NSSet *)declinedPermissions +NS_DESIGNATED_INITIALIZER; +@end diff --git a/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginTooltipView.h b/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginTooltipView.h new file mode 100644 index 0000000..e6a9411 --- /dev/null +++ b/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKLoginTooltipView.h @@ -0,0 +1,93 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +@protocol FBSDKLoginTooltipViewDelegate; + +/*! + @class FBSDKLoginTooltipView + + @abstract Represents a tooltip to be displayed next to a Facebook login button + to highlight features for new users. + + @discussion The `FBSDKLoginButton` may display this view automatically. If you do + not use the `FBSDKLoginButton`, you can manually call one of the `present*` methods + as appropriate and customize behavior via `FBSDKLoginTooltipViewDelegate` delegate. + + By default, the `FBSDKLoginTooltipView` is not added to the superview until it is + determined the app has migrated to the new login experience. You can override this + (e.g., to test the UI layout) by implementing the delegate or setting `forceDisplay` to YES. + + */ +@interface FBSDKLoginTooltipView : FBSDKTooltipView + +/*! @abstract the delegate */ +@property (nonatomic, assign) id delegate; + +/*! @abstract if set to YES, the view will always be displayed and the delegate's + `loginTooltipView:shouldAppear:` will NOT be called. */ +@property (nonatomic, assign) BOOL forceDisplay; + +@end + +/*! + @protocol + + @abstract + The `FBSDKLoginTooltipViewDelegate` protocol defines the methods used to receive event + notifications from `FBSDKLoginTooltipView` objects. + */ +@protocol FBSDKLoginTooltipViewDelegate + +@optional + +/*! + @abstract + Asks the delegate if the tooltip view should appear + + @param view The tooltip view. + @param appIsEligible The value fetched from the server identifying if the app + is eligible for the new login experience. + + @discussion Use this method to customize display behavior. + */ +- (BOOL)loginTooltipView:(FBSDKLoginTooltipView *)view shouldAppear:(BOOL)appIsEligible; + +/*! + @abstract + Tells the delegate the tooltip view will appear, specifically after it's been + added to the super view but before the fade in animation. + + @param view The tooltip view. + */ +- (void)loginTooltipViewWillAppear:(FBSDKLoginTooltipView *)view; + +/*! + @abstract + Tells the delegate the tooltip view will not appear (i.e., was not + added to the super view). + + @param view The tooltip view. + */ +- (void)loginTooltipViewWillNotAppear:(FBSDKLoginTooltipView *)view; + + +@end diff --git a/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKTooltipView.h b/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKTooltipView.h new file mode 100644 index 0000000..aff1067 --- /dev/null +++ b/dayPhoto/FBSDKLoginKit.framework/Headers/FBSDKTooltipView.h @@ -0,0 +1,141 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @typedef FBSDKTooltipViewArrowDirection enum + + @abstract + Passed on construction to determine arrow orientation. + */ +typedef NS_ENUM(NSUInteger, FBSDKTooltipViewArrowDirection) +{ + /*! View is located above given point, arrow is pointing down. */ + FBSDKTooltipViewArrowDirectionDown = 0, + /*! View is located below given point, arrow is pointing up. */ + FBSDKTooltipViewArrowDirectionUp = 1, +}; + +/*! + @typedef FBSDKTooltipColorStyle enum + + @abstract + Passed on construction to determine color styling. + */ +typedef NS_ENUM(NSUInteger, FBSDKTooltipColorStyle) +{ + /*! Light blue background, white text, faded blue close button. */ + FBSDKTooltipColorStyleFriendlyBlue = 0, + /*! Dark gray background, white text, light gray close button. */ + FBSDKTooltipColorStyleNeutralGray = 1, +}; + +/*! + @class FBSDKTooltipView + + @abstract + Tooltip bubble with text in it used to display tips for UI elements, + with a pointed arrow (to refer to the UI element). + + @discussion + The tooltip fades in and will automatically fade out. See `displayDuration`. + */ +@interface FBSDKTooltipView : UIView + +/*! + @abstract Gets or sets the amount of time in seconds the tooltip should be displayed. + + @discussion Set this to zero to make the display permanent until explicitly dismissed. + Defaults to six seconds. + */ +@property (nonatomic, assign) CFTimeInterval displayDuration; + +/*! + @abstract Gets or sets the color style after initialization. + + @discussion Defaults to value passed to -initWithTagline:message:colorStyle:. + */ +@property (nonatomic, assign) FBSDKTooltipColorStyle colorStyle; + +/*! + @abstract Gets or sets the message. + */ +@property (nonatomic, copy) NSString *message; + +/*! + @abstract Gets or sets the optional phrase that comprises the first part of the label (and is highlighted differently). + */ +@property (nonatomic, copy) NSString *tagline; + +/*! + @abstract + Designated initializer. + + @param tagline First part of the label, that will be highlighted with different color. Can be nil. + + @param message Main message to display. + + @param colorStyle Color style to use for tooltip. + + @discussion + If you need to show a tooltip for login, consider using the `FBSDKLoginTooltipView` view. + + @see FBSDKLoginTooltipView + */ +- (instancetype)initWithTagline:(NSString *)tagline message:(NSString *)message colorStyle:(FBSDKTooltipColorStyle)colorStyle; + +/*! + @abstract + Show tooltip at the top or at the bottom of given view. + Tooltip will be added to anchorView.window.rootViewController.view + + @param anchorView view to show at, must be already added to window view hierarchy, in order to decide + where tooltip will be shown. (If there's not enough space at the top of the anchorView in window bounds - + tooltip will be shown at the bottom of it) + + @discussion + Use this method to present the tooltip with automatic positioning or + use -presentInView:withArrowPosition:direction: for manual positioning + If anchorView is nil or has no window - this method does nothing. + */ +- (void)presentFromView:(UIView *)anchorView; + +/*! + @abstract + Adds tooltip to given view, with given position and arrow direction. + + @param view View to be used as superview. + + @param arrowPosition Point in view's cordinates, where arrow will be pointing + + @param arrowDirection whenever arrow should be pointing up (message bubble is below the arrow) or + down (message bubble is above the arrow). + */ +- (void)presentInView:(UIView *)view withArrowPosition:(CGPoint)arrowPosition direction:(FBSDKTooltipViewArrowDirection)arrowDirection; + +/*! + @abstract + Remove tooltip manually. + + @discussion + Calling this method isn't necessary - tooltip will dismiss itself automatically after the `displayDuration`. + */ +- (void)dismiss; + +@end diff --git a/dayPhoto/FBSDKLoginKit.framework/Info.plist b/dayPhoto/FBSDKLoginKit.framework/Info.plist new file mode 100644 index 0000000..8ce90dc Binary files /dev/null and b/dayPhoto/FBSDKLoginKit.framework/Info.plist differ diff --git a/dayPhoto/FBSDKLoginKit.framework/Modules/module.modulemap b/dayPhoto/FBSDKLoginKit.framework/Modules/module.modulemap new file mode 100644 index 0000000..4b1d57b --- /dev/null +++ b/dayPhoto/FBSDKLoginKit.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module FBSDKLoginKit { + umbrella header "FBSDKLoginKit.h" + + export * + module * { export * } +} diff --git a/dayPhoto/FBSDKShareKit.framework/FBSDKShareKit b/dayPhoto/FBSDKShareKit.framework/FBSDKShareKit new file mode 100644 index 0000000..cf78b30 Binary files /dev/null and b/dayPhoto/FBSDKShareKit.framework/FBSDKShareKit differ diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppGroupAddDialog.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppGroupAddDialog.h new file mode 100644 index 0000000..05b26ff --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppGroupAddDialog.h @@ -0,0 +1,101 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +@protocol FBSDKAppGroupAddDialogDelegate; + +/*! + @abstract A dialog for creating app groups. + */ +@interface FBSDKAppGroupAddDialog : NSObject + +/*! + @abstract Convenience method to build up an app group dialog with content and a delegate. + @param content The content for the app group. + @param delegate The receiver's delegate. + */ ++ (instancetype)showWithContent:(FBSDKAppGroupContent *)content + delegate:(id)delegate; + +/*! + @abstract The receiver's delegate or nil if it doesn't have a delegate. + */ +@property (nonatomic, weak) id delegate; + +/*! + @abstract The content for app group. + */ +@property (nonatomic, copy) FBSDKAppGroupContent *content; + +/*! + @abstract A Boolean value that indicates whether the receiver can initiate an app group dialog. + @discussion May return NO if the appropriate Facebook app is not installed and is required or an access token is + required but not available. This method does not validate the content on the receiver, so this can be checked before + building up the content. + @see validateWithError: + @result YES if the receiver can share, otherwise NO. + */ +- (BOOL)canShow; + +/*! + @abstract Begins the app group dialog from the receiver. + @result YES if the receiver was able to show the dialog, otherwise NO. + */ +- (BOOL)show; + +/*! + @abstract Validates the content on the receiver. + @param errorRef If an error occurs, upon return contains an NSError object that describes the problem. + @return YES if the content is valid, otherwise NO. + */ +- (BOOL)validateWithError:(NSError *__autoreleasing *)errorRef; + +@end + +/*! + @abstract A delegate for FBSDKAppGroupAddDialog. + @discussion The delegate is notified with the results of the app group request as long as the application has + permissions to receive the information. For example, if the person is not signed into the containing app, the shower + may not be able to distinguish between completion of an app group request and cancellation. + */ +@protocol FBSDKAppGroupAddDialogDelegate + +/*! + @abstract Sent to the delegate when the app group request completes without error. + @param appGroupAddDialog The FBSDKAppGroupAddDialog that completed. + @param results The results from the dialog. This may be nil or empty. + */ +- (void)appGroupAddDialog:(FBSDKAppGroupAddDialog *)appGroupAddDialog didCompleteWithResults:(NSDictionary *)results; + +/*! + @abstract Sent to the delegate when the app group request encounters an error. + @param appGroupAddDialog The FBSDKAppGroupAddDialog that completed. + @param error The error. + */ +- (void)appGroupAddDialog:(FBSDKAppGroupAddDialog *)appGroupAddDialog didFailWithError:(NSError *)error; + +/*! + @abstract Sent to the delegate when the app group dialog is cancelled. + @param appGroupAddDialog The FBSDKAppGroupAddDialog that completed. + */ +- (void)appGroupAddDialogDidCancel:(FBSDKAppGroupAddDialog *)appGroupAddDialog; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppGroupContent.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppGroupContent.h new file mode 100644 index 0000000..a5c5823 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppGroupContent.h @@ -0,0 +1,68 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @typedef NS_ENUM(NSUInteger, FBSDKAppGroupPrivacy) + @abstract Specifies the privacy of a group. + */ +typedef NS_ENUM(NSUInteger, FBSDKAppGroupPrivacy) +{ + /*! Anyone can see the group, who's in it and what members post. */ + FBSDKAppGroupPrivacyOpen = 0, + /*! Anyone can see the group and who's in it, but only members can see posts. */ + FBSDKAppGroupPrivacyClosed, +}; + +/*! + @abstract Converts an FBSDKAppGroupPrivacy to an NSString. + */ +FBSDK_EXTERN NSString *NSStringFromFBSDKAppGroupPrivacy(FBSDKAppGroupPrivacy privacy); + +/*! + @abstract A model for creating an app group. + */ +@interface FBSDKAppGroupContent : NSObject + +/*! + @abstract The description of the group. + */ +@property (nonatomic, copy) NSString *groupDescription; + +/*! + @abstract The name of the group. + */ +@property (nonatomic, copy) NSString *name; + +/*! + @abstract The privacy for the group. + */ +@property (nonatomic, assign) FBSDKAppGroupPrivacy privacy; + +/*! + @abstract Compares the receiver to another app group content. + @param content The other content + @return YES if the receiver's values are equal to the other content's values; otherwise NO + */ +- (BOOL)isEqualToAppGroupContent:(FBSDKAppGroupContent *)content; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppGroupJoinDialog.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppGroupJoinDialog.h new file mode 100644 index 0000000..70e4e7a --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppGroupJoinDialog.h @@ -0,0 +1,99 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +@protocol FBSDKAppGroupJoinDialogDelegate; + +/*! + @abstract A dialog for joining app groups. + */ +@interface FBSDKAppGroupJoinDialog : NSObject + +/*! + @abstract Convenience method to build up an app group dialog with content and a delegate. + @param groupID The ID for the group. + @param delegate The receiver's delegate. + */ ++ (instancetype)showWithGroupID:(NSString *)groupID + delegate:(id)delegate; + +/*! + @abstract The receiver's delegate or nil if it doesn't have a delegate. + */ +@property (nonatomic, weak) id delegate; + +/*! + @abstract The ID for group. + */ +@property (nonatomic, copy) NSString *groupID; + +/*! + @abstract A Boolean value that indicates whether the receiver can initiate an app group dialog. + @discussion May return NO if the appropriate Facebook app is not installed and is required or an access token is + required but not available. This method does not validate the content on the receiver, so this can be checked before + building up the content. + @see validateWithError: + @result YES if the receiver can share, otherwise NO. + */ +- (BOOL)canShow; + +/*! + @abstract Begins the app group dialog from the receiver. + @result YES if the receiver was able to show the dialog, otherwise NO. + */ +- (BOOL)show; + +/*! + @abstract Validates the content on the receiver. + @param errorRef If an error occurs, upon return contains an NSError object that describes the problem. + @return YES if the content is valid, otherwise NO. + */ +- (BOOL)validateWithError:(NSError *__autoreleasing *)errorRef; + +@end + +/*! + @abstract A delegate for FBSDKAppGroupJoinDialog. + @discussion The delegate is notified with the results of the app group request as long as the application has + permissions to receive the information. For example, if the person is not signed into the containing app, the shower + may not be able to distinguish between completion of an app group request and cancellation. + */ +@protocol FBSDKAppGroupJoinDialogDelegate + +/*! + @abstract Sent to the delegate when the app group request completes without error. + @param appGroupJoinDialog The FBSDKAppGroupJoinDialog that completed. + @param results The results from the dialog. This may be nil or empty. + */ +- (void)appGroupJoinDialog:(FBSDKAppGroupJoinDialog *)appGroupJoinDialog didCompleteWithResults:(NSDictionary *)results; + +/*! + @abstract Sent to the delegate when the app group request encounters an error. + @param appGroupJoinDialog The FBSDKAppGroupJoinDialog that completed. + @param error The error. + */ +- (void)appGroupJoinDialog:(FBSDKAppGroupJoinDialog *)appGroupJoinDialog didFailWithError:(NSError *)error; + +/*! + @abstract Sent to the delegate when the app group dialog is cancelled. + @param appGroupJoinDialog The FBSDKAppGroupJoinDialog that completed. + */ +- (void)appGroupJoinDialogDidCancel:(FBSDKAppGroupJoinDialog *)appGroupJoinDialog; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppInviteContent.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppInviteContent.h new file mode 100644 index 0000000..1feb828 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppInviteContent.h @@ -0,0 +1,54 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract A model for app invite. + */ +@interface FBSDKAppInviteContent : NSObject + +/*! + @abstract A URL to a preview image that will be displayed with the app invite + + @discussion This is optional. If you don't include it a fallback image will be used. +*/ +@property (nonatomic, copy) NSURL *appInvitePreviewImageURL; + +/*! + @abstract An app link target that will be used as a target when the user accept the invite. + + @discussion This is a requirement. + */ +@property (nonatomic, copy) NSURL *appLinkURL; + +/*! + @deprecated Use `appInvitePreviewImageURL` instead. + */ +@property (nonatomic, copy) NSURL *previewImageURL __attribute__ ((deprecated("use appInvitePreviewImageURL instead"))); + +/*! + @abstract Compares the receiver to another app invite content. + @param content The other content + @return YES if the receiver's values are equal to the other content's values; otherwise NO + */ +- (BOOL)isEqualToAppInviteContent:(FBSDKAppInviteContent *)content; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppInviteDialog.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppInviteDialog.h new file mode 100644 index 0000000..0859d4c --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKAppInviteDialog.h @@ -0,0 +1,111 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +@protocol FBSDKAppInviteDialogDelegate; + +/*! + @abstract A dialog for sending App Invites. + */ +@interface FBSDKAppInviteDialog : NSObject + +/*! + @abstract Convenience method to show a FBSDKAppInviteDialog + @param viewController A UIViewController to present the dialog from. + @param content The content for the app invite. + @param delegate The receiver's delegate. +*/ ++ (instancetype)showFromViewController:(UIViewController *)viewController + withContent:(FBSDKAppInviteContent *)content + delegate:(id)delegate; + + +/*! + @deprecated use showFromViewController:withContent:delegate: instead + */ ++ (instancetype)showWithContent:(FBSDKAppInviteContent *)content delegate:(id)delegate +__attribute__ ((deprecated("use showFromViewController:withContent:delegate: instead"))); + +/*! + @abstract A UIViewController to present the dialog from. + @discussion If not specified, the top most view controller will be automatically determined as best as possible. + */ +@property (nonatomic, weak) UIViewController *fromViewController; + +/*! + @abstract The receiver's delegate or nil if it doesn't have a delegate. + */ +@property (nonatomic, weak) id delegate; + +/*! + @abstract The content for app invite. + */ +@property (nonatomic, copy) FBSDKAppInviteContent *content; + +/*! + @abstract A Boolean value that indicates whether the receiver can initiate an app invite. + @discussion May return NO if the appropriate Facebook app is not installed and is required or an access token is + required but not available. This method does not validate the content on the receiver, so this can be checked before + building up the content. + @see validateWithError: + @result YES if the receiver can show the dialog, otherwise NO. + */ +- (BOOL)canShow; + +/*! + @abstract Begins the app invite from the receiver. + @result YES if the receiver was able to show the dialog, otherwise NO. + */ +- (BOOL)show; + +/*! + @abstract Validates the content on the receiver. + @param errorRef If an error occurs, upon return contains an NSError object that describes the problem. + @return YES if the content is valid, otherwise NO. + */ +- (BOOL)validateWithError:(NSError *__autoreleasing *)errorRef; + +@end + +/*! + @abstract A delegate for FBSDKAppInviteDialog. + @discussion The delegate is notified with the results of the app invite as long as the application has permissions to + receive the information. For example, if the person is not signed into the containing app, the shower may not be able + to distinguish between completion of an app invite and cancellation. + */ +@protocol FBSDKAppInviteDialogDelegate + +/*! + @abstract Sent to the delegate when the app invite completes without error. + @param appInviteDialog The FBSDKAppInviteDialog that completed. + @param results The results from the dialog. This may be nil or empty. + */ +- (void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didCompleteWithResults:(NSDictionary *)results; + +/*! + @abstract Sent to the delegate when the app invite encounters an error. + @param appInviteDialog The FBSDKAppInviteDialog that completed. + @param error The error. + */ +- (void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didFailWithError:(NSError *)error; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKGameRequestContent.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKGameRequestContent.h new file mode 100644 index 0000000..13edc06 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKGameRequestContent.h @@ -0,0 +1,131 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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, FBSDKGameRequestActionType) + @abstract Additional context about the nature of the request. + */ +typedef NS_ENUM(NSUInteger, FBSDKGameRequestActionType) +{ + /*! No action type */ + FBSDKGameRequestActionTypeNone = 0, + /*! Send action type: The user is sending an object to the friends. */ + FBSDKGameRequestActionTypeSend, + /*! Ask For action type: The user is asking for an object from friends. */ + FBSDKGameRequestActionTypeAskFor, + /*! Turn action type: It is the turn of the friends to play against the user in a match. (no object) */ + FBSDKGameRequestActionTypeTurn, +}; + +/*! + @typedef NS_ENUM(NSUInteger, FBSDKGameRequestFilters) + @abstract Filter for who can be displayed in the multi-friend selector. + */ +typedef NS_ENUM(NSUInteger, FBSDKGameRequestFilter) +{ + /*! No filter, all friends can be displayed. */ + FBSDKGameRequestFilterNone = 0, + /*! Friends using the app can be displayed. */ + FBSDKGameRequestFilterAppUsers, + /*! Friends not using the app can be displayed. */ + FBSDKGameRequestFilterAppNonUsers, +}; + +/*! + @abstract A model for a game request. + */ +@interface FBSDKGameRequestContent : NSObject + +/*! + @abstract Used when defining additional context about the nature of the request. + @discussion The parameter 'objectID' is required if the action type is either + 'FBSDKGameRequestSendActionType' or 'FBSDKGameRequestAskForActionType'. + @seealso objectID + */ +@property (nonatomic, assign) FBSDKGameRequestActionType actionType; + +/*! + @abstract Compares the receiver to another game request content. + @param content The other content + @return YES if the receiver's values are equal to the other content's values; otherwise NO + */ +- (BOOL)isEqualToGameRequestContent:(FBSDKGameRequestContent *)content; + +/*! + @abstract Additional freeform data you may pass for tracking. This will be stored as part of + the request objects created. The maximum length is 255 characters. + */ +@property (nonatomic, copy) NSString *data; + +/*! + @abstract This controls the set of friends someone sees if a multi-friend selector is shown. + It is FBSDKGameRequestNoFilter by default, meaning that all friends can be shown. + If specify as FBSDKGameRequestAppUsersFilter, only friends who use the app will be shown. + On the other hands, use FBSDKGameRequestAppNonUsersFilter to filter only friends who do not use the app. + @discussion The parameter name is preserved to be consistent with the counter part on desktop. + */ +@property (nonatomic, assign) FBSDKGameRequestFilter filters; + +/*! + @abstract A plain-text message to be sent as part of the request. This text will surface in the App Center view + of the request, but not on the notification jewel. Required parameter. + */ +@property (nonatomic, copy) NSString *message; + +/*! + @abstract The Open Graph object ID of the object being sent. + @seealso actionType + */ +@property (nonatomic, copy) NSString *objectID; + +/*! + @abstract An array of user IDs, usernames or invite tokens (NSString) of people to send request. + @discussion These may or may not be a friend of the sender. If this is specified by the app, + the sender will not have a choice of recipients. If not, the sender will see a multi-friend selector + + This is equivalent to the "to" parameter when using the web game request dialog. + */ +@property (nonatomic, copy) NSArray *recipients; + +/*! + @abstract An array of user IDs that will be included in the dialog as the first suggested friends. + Cannot be used together with filters. + @discussion This is equivalent to the "suggestions" parameter when using the web game request dialog. +*/ +@property (nonatomic, copy) NSArray *recipientSuggestions; + +/*! + @deprecated Use `recipientSuggestions` instead. +*/ +@property (nonatomic, copy) NSArray *suggestions __attribute__ ((deprecated("use recipientSuggestions instead"))); + +/*! + @abstract The title for the dialog. + */ +@property (nonatomic, copy) NSString *title; + +/*! + @deprecated Use `recipients` instead. + */ +@property (nonatomic, copy) NSArray *to __attribute__ ((deprecated("use recipients instead"))); + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKGameRequestDialog.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKGameRequestDialog.h new file mode 100644 index 0000000..2f5acc5 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKGameRequestDialog.h @@ -0,0 +1,105 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +@protocol FBSDKGameRequestDialogDelegate; + +/*! + @abstract A dialog for sending game requests. + */ +@interface FBSDKGameRequestDialog : NSObject + +/*! + @abstract Convenience method to build up a game request with content and a delegate. + @param content The content for the game request. + @param delegate The receiver's delegate. + */ ++ (instancetype)showWithContent:(FBSDKGameRequestContent *)content delegate:(id)delegate; + +/*! + @abstract The receiver's delegate or nil if it doesn't have a delegate. + */ +@property (nonatomic, weak) id delegate; + +/*! + @abstract The content for game request. + */ +@property (nonatomic, copy) FBSDKGameRequestContent *content; + +/*! + @abstract Specifies whether frictionless requests are enabled. + */ +@property (nonatomic, assign) BOOL frictionlessRequestsEnabled; + +/*! + @abstract A Boolean value that indicates whether the receiver can initiate a game request. + @discussion May return NO if the appropriate Facebook app is not installed and is required or an access token is + required but not available. This method does not validate the content on the receiver, so this can be checked before + building up the content. + @see validateWithError: + @result YES if the receiver can share, otherwise NO. + */ +- (BOOL)canShow; + +/*! + @abstract Begins the game request from the receiver. + @result YES if the receiver was able to show the dialog, otherwise NO. + */ +- (BOOL)show; + +/*! + @abstract Validates the content on the receiver. + @param errorRef If an error occurs, upon return contains an NSError object that describes the problem. + @return YES if the content is valid, otherwise NO. + */ +- (BOOL)validateWithError:(NSError *__autoreleasing *)errorRef; + +@end + +/*! + @abstract A delegate for FBSDKGameRequestDialog. + @discussion The delegate is notified with the results of the game request as long as the application has permissions to + receive the information. For example, if the person is not signed into the containing app, the shower may not be able + to distinguish between completion of a game request and cancellation. + */ +@protocol FBSDKGameRequestDialogDelegate + +/*! + @abstract Sent to the delegate when the game request completes without error. + @param gameRequestDialog The FBSDKGameRequestDialog that completed. + @param results The results from the dialog. This may be nil or empty. + */ +- (void)gameRequestDialog:(FBSDKGameRequestDialog *)gameRequestDialog didCompleteWithResults:(NSDictionary *)results; + +/*! + @abstract Sent to the delegate when the game request encounters an error. + @param gameRequestDialog The FBSDKGameRequestDialog that completed. + @param error The error. + */ +- (void)gameRequestDialog:(FBSDKGameRequestDialog *)gameRequestDialog didFailWithError:(NSError *)error; + +/*! + @abstract Sent to the delegate when the game request dialog is cancelled. + @param gameRequestDialog The FBSDKGameRequestDialog that completed. + */ +- (void)gameRequestDialogDidCancel:(FBSDKGameRequestDialog *)gameRequestDialog; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKLikeButton.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKLikeButton.h new file mode 100644 index 0000000..0b01c4e --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKLikeButton.h @@ -0,0 +1,42 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 +#import + +/*! + @abstract A button to like an object. + @discussion Tapping the receiver will invoke an API call to the Facebook app through a fast-app-switch that allows + the object to be liked. Upon return to the calling app, the view will update with the new state. If the + currentAccessToken has "publish_actions" permission and the object is an Open Graph object, then the like can happen + seamlessly without the fast-app-switch. + */ +@interface FBSDKLikeButton : FBSDKButton + +/*! + @abstract If YES, a sound is played when the receiver is toggled. + + @default YES + */ +@property (nonatomic, assign, getter = isSoundEnabled) BOOL soundEnabled; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKLikeControl.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKLikeControl.h new file mode 100644 index 0000000..bbc88f2 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKLikeControl.h @@ -0,0 +1,139 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 +#import + +/*! + @typedef NS_ENUM (NSUInteger, FBSDKLikeControlAuxiliaryPosition) + + @abstract Specifies the position of the auxiliary view relative to the like button. + */ +typedef NS_ENUM(NSUInteger, FBSDKLikeControlAuxiliaryPosition) +{ + /*! The auxiliary view is inline with the like button. */ + FBSDKLikeControlAuxiliaryPositionInline, + /*! The auxiliary view is above the like button. */ + FBSDKLikeControlAuxiliaryPositionTop, + /*! The auxiliary view is below the like button. */ + FBSDKLikeControlAuxiliaryPositionBottom, +}; + +/*! + @abstract Converts an FBSDKLikeControlAuxiliaryPosition to an NSString. + */ +FBSDK_EXTERN NSString *NSStringFromFBSDKLikeControlAuxiliaryPosition(FBSDKLikeControlAuxiliaryPosition auxiliaryPosition); + +/*! + @typedef NS_ENUM(NSUInteger, FBSDKLikeControlHorizontalAlignment) + + @abstract Specifies the horizontal alignment for FBSDKLikeControlStyleStandard with + FBSDKLikeControlAuxiliaryPositionTop or FBSDKLikeControlAuxiliaryPositionBottom. + */ +typedef NS_ENUM(NSUInteger, FBSDKLikeControlHorizontalAlignment) +{ + /*! The subviews are left aligned. */ + FBSDKLikeControlHorizontalAlignmentLeft, + /*! The subviews are center aligned. */ + FBSDKLikeControlHorizontalAlignmentCenter, + /*! The subviews are right aligned. */ + FBSDKLikeControlHorizontalAlignmentRight, +}; + +/*! + @abstract Converts an FBSDKLikeControlHorizontalAlignment to an NSString. + */ +FBSDK_EXTERN NSString *NSStringFromFBSDKLikeControlHorizontalAlignment(FBSDKLikeControlHorizontalAlignment horizontalAlignment); + +/*! + @typedef NS_ENUM (NSUInteger, FBSDKLikeControlStyle) + + @abstract Specifies the style of a like control. + */ +typedef NS_ENUM(NSUInteger, FBSDKLikeControlStyle) +{ + /*! Displays the button and the social sentence. */ + FBSDKLikeControlStyleStandard = 0, + /*! Displays the button and a box that contains the like count. */ + FBSDKLikeControlStyleBoxCount, +}; + +/*! + @abstract Converts an FBSDKLikeControlStyle to an NSString. + */ +FBSDK_EXTERN NSString *NSStringFromFBSDKLikeControlStyle(FBSDKLikeControlStyle style); + +/*! + @class FBSDKLikeControl + + @abstract UI control to like an object in the Facebook graph. + + @discussion Taps on the like button within this control will invoke an API call to the Facebook app through a + fast-app-switch that allows the user to like the object. Upon return to the calling app, the view will update + with the new state and send actions for the UIControlEventValueChanged event. + */ +@interface FBSDKLikeControl : UIControl + +/*! + @abstract The foreground color to use for the content of the receiver. + */ +@property (nonatomic, strong) UIColor *foregroundColor; + +/*! + @abstract The position for the auxiliary view for the receiver. + + @see FBSDKLikeControlAuxiliaryPosition + */ +@property (nonatomic, assign) FBSDKLikeControlAuxiliaryPosition likeControlAuxiliaryPosition; + +/*! + @abstract The text alignment of the social sentence. + + @discussion This value is only valid for FBSDKLikeControlStyleStandard with + FBSDKLikeControlAuxiliaryPositionTop|Bottom. + */ +@property (nonatomic, assign) FBSDKLikeControlHorizontalAlignment likeControlHorizontalAlignment; + +/*! + @abstract The style to use for the receiver. + + @see FBSDKLikeControlStyle + */ +@property (nonatomic, assign) FBSDKLikeControlStyle likeControlStyle; + +/*! + @abstract The preferred maximum width (in points) for autolayout. + + @discussion This property affects the size of the receiver when layout constraints are applied to it. During layout, + if the text extends beyond the width specified by this property, the additional text is flowed to one or more new + lines, thereby increasing the height of the receiver. + */ +@property (nonatomic, assign) CGFloat preferredMaxLayoutWidth; + +/*! + @abstract If YES, a sound is played when the receiver is toggled. + + @default YES + */ +@property (nonatomic, assign, getter = isSoundEnabled) BOOL soundEnabled; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKLikeObjectType.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKLikeObjectType.h new file mode 100644 index 0000000..dadff43 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKLikeObjectType.h @@ -0,0 +1,40 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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, FBSDKLikeObjectType) + @abstract Specifies the type of object referenced by the objectID for likes. + */ +typedef NS_ENUM(NSUInteger, FBSDKLikeObjectType) +{ + /*! The objectID refers to an unknown object type. */ + FBSDKLikeObjectTypeUnknown = 0, + /*! The objectID refers to an Open Graph object. */ + FBSDKLikeObjectTypeOpenGraph, + /*! The objectID refers to an Page object. */ + FBSDKLikeObjectTypePage, +}; + +/*! + @abstract Converts an FBLikeControlObjectType to an NSString. + */ +FBSDK_EXTERN NSString *NSStringFromFBSDKLikeObjectType(FBSDKLikeObjectType objectType); diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKLiking.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKLiking.h new file mode 100644 index 0000000..e2d4a4a --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKLiking.h @@ -0,0 +1,45 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract The common interface for components that initiate liking. + @see FBSDKLikeButton + @see FBSDKLikeControl + */ +@protocol FBSDKLiking + +/*! + @abstract The objectID for the object to like. + + @discussion This value may be an Open Graph object ID or a string representation of an URL that describes an + Open Graph object. The objects may be public objects, like pages, or objects that are defined by your application. + */ +@property (nonatomic, copy) NSString *objectID; + +/*! + @abstract The type of object referenced by the objectID. + + @discussion If the objectType is unknown, the control will determine the objectType by querying the server with the + objectID. Specifying a value for the objectType is an optimization that should be used if the type is known by the + consumer. Consider setting the objectType if it is known when setting the objectID. + */ +@property (nonatomic, assign) FBSDKLikeObjectType objectType; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKMessageDialog.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKMessageDialog.h new file mode 100644 index 0000000..2819eb7 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKMessageDialog.h @@ -0,0 +1,35 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract A dialog for sharing content through Messenger. + */ +@interface FBSDKMessageDialog : NSObject + +/*! + @abstract Convenience method to show a Message Share Dialog with content and a delegate. + @param content The content to be shared. + @param delegate The receiver's delegate. + */ ++ (instancetype)showWithContent:(id)content delegate:(id)delegate; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSendButton.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSendButton.h new file mode 100644 index 0000000..347f0e4 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSendButton.h @@ -0,0 +1,32 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract A button to send content through Messenger. + @discussion Tapping the receiver will invoke the FBSDKShareDialog with the attached shareContent. If the dialog cannot + be shown, the button will be disable. + */ +@interface FBSDKSendButton : FBSDKButton + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareAPI.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareAPI.h new file mode 100644 index 0000000..ddbeafe --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareAPI.h @@ -0,0 +1,79 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract A utility class for sharing through the graph API. Using this class requires an access token in + [FBSDKAccessToken currentAccessToken] that has been granted the "publish_actions" permission. + @discussion FBSDKShareAPI network requests are scheduled on the current run loop in the default run loop mode + (like NSURLConnection). If you want to use FBSDKShareAPI in a background thread, you must manage the run loop + yourself. + */ +@interface FBSDKShareAPI : NSObject + +/*! + @abstract Convenience method to build up a share API with content and a delegate. + @param content The content to be shared. + @param delegate The receiver's delegate. + */ ++ (instancetype)shareWithContent:(id)content delegate:(id)delegate; + +/*! + @abstract The message the person has provided through the custom dialog that will accompany the share content. + */ +@property (nonatomic, copy) NSString *message; + +/*! + @abstract The graph node to which content should be shared. + */ +@property (nonatomic, copy) NSString *graphNode; + +/*! + @abstract A Boolean value that indicates whether the receiver can send the share. + @discussion May return NO if the appropriate Facebook app is not installed and is required or an access token is + required but not available. This method does not validate the content on the receiver, so this can be checked before + building up the content. + @see [FBSDKSharing validateWithError:] + @result YES if the receiver can send, otherwise NO. + */ +- (BOOL)canShare; + +/*! + @abstract Creates an User Owned Open Graph object without an action. + @param openGraphObject The open graph object to create. + @discussion Use this method to create an object alone, when an action is not going to be posted with the object. If + the object will be used within an action, just put the object in the action and share that as the shareContent and the + object will be created in the process. The delegate will be messaged with the results. + + Also see https://developers.facebook.com/docs/sharing/opengraph/object-api#objectapi-creatinguser + + @result YES if the receiver was able to send the request to create the object, otherwise NO. + */ +- (BOOL)createOpenGraphObject:(FBSDKShareOpenGraphObject *)openGraphObject; + +/*! + @abstract Begins the send from the receiver. + @result YES if the receiver was able to send the share, otherwise NO. + */ +- (BOOL)share; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareButton.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareButton.h new file mode 100644 index 0000000..d6b46fd --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareButton.h @@ -0,0 +1,32 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract A button to share content. + @discussion Tapping the receiver will invoke the FBSDKShareDialog with the attached shareContent. If the dialog cannot + be shown, the button will be disabled. + */ +@interface FBSDKShareButton : FBSDKButton + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareConstants.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareConstants.h new file mode 100644 index 0000000..859f4fa --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareConstants.h @@ -0,0 +1,55 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract The error domain for all errors from FBSDKShareKit. + @discussion Error codes from the SDK in the range 200-299 are reserved for this domain. + */ +FBSDK_EXTERN NSString *const FBSDKShareErrorDomain; + +/*! + @typedef NS_ENUM(NSInteger, FBSDKShareErrorCode) + @abstract Error codes for FBSDKShareErrorDomain. + */ +typedef NS_ENUM(NSInteger, FBSDKShareErrorCode) +{ + /*! + @abstract Reserved. + */ + FBSDKShareReservedErrorCode = 200, + + /*! + @abstract The error code for errors from uploading open graph objects. + */ + FBSDKShareOpenGraphErrorCode, + + /*! + @abstract The error code for when a sharing dialog is not available. + @discussion Use the canShare methods to check for this case before calling show. + */ + FBSDKShareDialogNotAvailableErrorCode, + + /*! + @The error code for unknown errors. + */ + FBSDKShareUnknownErrorCode, +}; diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareDialog.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareDialog.h new file mode 100644 index 0000000..29489a6 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareDialog.h @@ -0,0 +1,52 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 +#import + +/*! + @abstract A dialog for sharing content on Facebook. + */ +@interface FBSDKShareDialog : NSObject + +/*! + @abstract Convenience method to show an FBSDKShareDialog with a fromViewController, content and a delegate. + @param viewController A UIViewController to present the dialog from, if appropriate. + @param content The content to be shared. + @param delegate The receiver's delegate. + */ ++ (instancetype)showFromViewController:(UIViewController *)viewController + withContent:(id)content + delegate:(id)delegate; + +/*! + @abstract A UIViewController to present the dialog from. + @discussion If not specified, the top most view controller will be automatically determined as best as possible. + */ +@property (nonatomic, weak) UIViewController *fromViewController; + +/*! + @abstract The mode with which to display the dialog. + @discussion Defaults to FBSDKShareDialogModeAutomatic, which will automatically choose the best available mode. + */ +@property (nonatomic, assign) FBSDKShareDialogMode mode; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareDialogMode.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareDialogMode.h new file mode 100644 index 0000000..bdea19e --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareDialogMode.h @@ -0,0 +1,64 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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, FBSDKShareDialogMode) + @abstract Modes for the FBSDKShareDialog. + @discussion The automatic mode will progressively check the availability of different modes and open the most + appropriate mode for the dialog that is available. + */ +typedef NS_ENUM(NSUInteger, FBSDKShareDialogMode) +{ + /*! + @abstract Acts with the most appropriate mode that is available. + */ + FBSDKShareDialogModeAutomatic = 0, + /*! + @Displays the dialog in the main native Facebook app. + */ + FBSDKShareDialogModeNative, + /*! + @Displays the dialog in the iOS integrated share sheet. + */ + FBSDKShareDialogModeShareSheet, + /*! + @Displays the dialog in Safari. + */ + FBSDKShareDialogModeBrowser, + /*! + @Displays the dialog in a UIWebView within the app. + */ + FBSDKShareDialogModeWeb, + /*! + @Displays the feed dialog in Safari. + */ + FBSDKShareDialogModeFeedBrowser, + /*! + @Displays the feed dialog in a UIWebView within the app. + */ + FBSDKShareDialogModeFeedWeb, +}; + +/*! + @abstract Converts an FBLikeControlObjectType to an NSString. + */ +FBSDK_EXTERN NSString *NSStringFromFBSDKShareDialogMode(FBSDKShareDialogMode dialogMode); diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareKit.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareKit.h new file mode 100644 index 0000000..c2406c8 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareKit.h @@ -0,0 +1,47 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareLinkContent.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareLinkContent.h new file mode 100644 index 0000000..9995df6 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareLinkContent.h @@ -0,0 +1,56 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract A model for status and link content to be shared. + */ +@interface FBSDKShareLinkContent : NSObject + +/*! + @abstract The description of the link. + @discussion If not specified, this field is automatically populated by information scraped from the contentURL, + typically the title of the page. This value may be discarded for specially handled links (ex: iTunes URLs). + @return The description of the link + */ +@property (nonatomic, copy) NSString *contentDescription; + +/*! + @abstract The title to display for this link. + @discussion This value may be discarded for specially handled links (ex: iTunes URLs). + @return The link title + */ +@property (nonatomic, copy) NSString *contentTitle; + +/*! + @abstract The URL of a picture to attach to this content. + @return The network URL of an image + */ +@property (nonatomic, copy) NSURL *imageURL; + +/*! + @abstract Compares the receiver to another link content. + @param content The other content + @return YES if the receiver's values are equal to the other content's values; otherwise NO + */ +- (BOOL)isEqualToShareLinkContent:(FBSDKShareLinkContent *)content; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareOpenGraphAction.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareOpenGraphAction.h new file mode 100644 index 0000000..5f6db0a --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareOpenGraphAction.h @@ -0,0 +1,69 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 +#import + +/*! + @abstract An Open Graph Action for sharing. + @discussion The property keys MUST have namespaces specified on them, such as `og:image`. + */ +@interface FBSDKShareOpenGraphAction : FBSDKShareOpenGraphValueContainer + +/*! + @abstract Convenience method to build a new action and set the object for the specified key. + @param actionType The action type of the receiver + @param object The Open Graph object represented by this action + @param key The key for the object + */ ++ (instancetype)actionWithType:(NSString *)actionType object:(FBSDKShareOpenGraphObject *)object key:(NSString *)key; + +/*! + @abstract Convenience method to build a new action and set the object for the specified key. + @param actionType The action type of the receiver + @param objectID The ID of an existing Open Graph object + @param key The key for the object + */ ++ (instancetype)actionWithType:(NSString *)actionType objectID:(NSString *)objectID key:(NSString *)key; + +/*! + @abstract Convenience method to build a new action and set the object for the specified key. + @param actionType The action type of the receiver + @param objectURL The URL to a page that defines the Open Graph object with meta tags + @param key The key for the object + */ ++ (instancetype)actionWithType:(NSString *)actionType objectURL:(NSURL *)objectURL key:(NSString *)key; + +/*! + @abstract Gets the action type. + @return The action type + */ +@property (nonatomic, copy) NSString *actionType; + +/*! + @abstract Compares the receiver to another Open Graph Action. + @param action The other action + @return YES if the receiver's values are equal to the other action's values; otherwise NO + */ +- (BOOL)isEqualToShareOpenGraphAction:(FBSDKShareOpenGraphAction *)action; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareOpenGraphContent.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareOpenGraphContent.h new file mode 100644 index 0000000..4393b0c --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareOpenGraphContent.h @@ -0,0 +1,49 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract A model for Open Graph content to be shared. + */ +@interface FBSDKShareOpenGraphContent : NSObject + +/*! + @abstract Open Graph Action to be shared. + @return The action + */ +@property (nonatomic, copy) FBSDKShareOpenGraphAction *action; + +/*! + @abstract Property name that points to the primary Open Graph Object in the action. + @discussion The value that this action points to will be use for rendering the preview for the share. + @return The property name for the Open Graph Object in the action + */ +@property (nonatomic, copy) NSString *previewPropertyName; + +/*! + @abstract Compares the receiver to another Open Graph content. + @param content The other content + @return YES if the receiver's values are equal to the other content's values; otherwise NO + */ +- (BOOL)isEqualToShareOpenGraphContent:(FBSDKShareOpenGraphContent *)content; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareOpenGraphObject.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareOpenGraphObject.h new file mode 100644 index 0000000..3a1e1a5 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareOpenGraphObject.h @@ -0,0 +1,58 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract An Open Graph Object for sharing. + @discussion The property keys MUST have namespaces specified on them, such as `og:image`, + and `og:type` is required. + + See https://developers.facebook.com/docs/sharing/opengraph/object-properties for other properties. + + You can specify nested namespaces inline to define complex properties. For example, the following + code will generate a fitness.course object with a location: + + FBSDKShareOpenGraphObject *course = [FBSDKShareOpenGraphObject objectWithProperties: + @{ + @"og:type": @"fitness.course", + @"og:title": @"Sample course", + @"fitness:metrics:location:latitude": @"41.40338", + @"fitness:metrics:location:longitude": @"2.17403", + }]; + */ +@interface FBSDKShareOpenGraphObject : FBSDKShareOpenGraphValueContainer + +/*! + @abstract Convenience method to build a new action and set the object for the specified key. + @param properties Properties for the Open Graph object, which will be parsed into the proper models + */ ++ (instancetype)objectWithProperties:(NSDictionary *)properties; + +/*! + @abstract Compares the receiver to another Open Graph Object. + @param object The other object + @return YES if the receiver's values are equal to the other object's values; otherwise NO + */ +- (BOOL)isEqualToShareOpenGraphObject:(FBSDKShareOpenGraphObject *)object; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareOpenGraphValueContainer.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareOpenGraphValueContainer.h new file mode 100644 index 0000000..4687828 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareOpenGraphValueContainer.h @@ -0,0 +1,160 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +@class FBSDKShareOpenGraphObject; +@class FBSDKSharePhoto; + +/*! + @abstract Protocol defining operations on open graph actions and objects. + @discussion The property keys MUST have namespaces specified on them, such as `og:image`. + */ +@protocol FBSDKShareOpenGraphValueContaining + +/*! + @abstract Gets an NSArray out of the receiver. + @param key The key for the value + @return The NSArray value or nil + */ +- (NSArray *)arrayForKey:(NSString *)key; + +/*! + @abstract Applies a given block object to the entries of the receiver. + @param block A block object to operate on entries in the receiver + */ +- (void)enumerateKeysAndObjectsUsingBlock:(void (^)(NSString *key, id object, BOOL *stop))block; + +/*! + @abstract Returns an enumerator object that lets you access each key in the receiver. + @return An enumerator object that lets you access each key in the receiver + */ +- (NSEnumerator *)keyEnumerator; + +/*! + @abstract Gets an NSNumber out of the receiver. + @param key The key for the value + @return The NSNumber value or nil + */ +- (NSNumber *)numberForKey:(NSString *)key; + +/*! + @abstract Returns an enumerator object that lets you access each value in the receiver. + @return An enumerator object that lets you access each value in the receiver + */ +- (NSEnumerator *)objectEnumerator; + +/*! + @abstract Gets an FBSDKShareOpenGraphObject out of the receiver. + @param key The key for the value + @return The FBSDKShareOpenGraphObject value or nil + */ +- (FBSDKShareOpenGraphObject *)objectForKey:(NSString *)key; + +/*! + @abstract Enables subscript access to the values in the receiver. + @param key The key for the value + @return The value + */ +- (id)objectForKeyedSubscript:(NSString *)key; + +/*! + @abstract Parses properties out of a dictionary into the receiver. + @param properties The properties to parse. + */ +- (void)parseProperties:(NSDictionary *)properties; + +/*! + @abstract Gets an FBSDKSharePhoto out of the receiver. + @param key The key for the value + @return The FBSDKSharePhoto value or nil + */ +- (FBSDKSharePhoto *)photoForKey:(NSString *)key; + +/*! + @abstract Removes a value from the receiver for the specified key. + @param key The key for the value + */ +- (void)removeObjectForKey:(NSString *)key; + +/*! + @abstract Sets an NSArray on the receiver. + @discussion This method will throw if the array contains any values that is not an NSNumber, NSString, NSURL, + FBSDKSharePhoto or FBSDKShareOpenGraphObject. + @param array The NSArray value + @param key The key for the value + */ +- (void)setArray:(NSArray *)array forKey:(NSString *)key; + +/*! + @abstract Sets an NSNumber on the receiver. + @param number The NSNumber value + @param key The key for the value + */ +- (void)setNumber:(NSNumber *)number forKey:(NSString *)key; + +/*! + @abstract Sets an FBSDKShareOpenGraphObject on the receiver. + @param object The FBSDKShareOpenGraphObject value + @param key The key for the value + */ +- (void)setObject:(FBSDKShareOpenGraphObject *)object forKey:(NSString *)key; + +/*! + @abstract Sets an FBSDKSharePhoto on the receiver. + @param photo The FBSDKSharePhoto value + @param key The key for the value + */ +- (void)setPhoto:(FBSDKSharePhoto *)photo forKey:(NSString *)key; + +/*! + @abstract Sets an NSString on the receiver. + @param string The NSString value + @param key The key for the value + */ +- (void)setString:(NSString *)string forKey:(NSString *)key; + +/*! + @abstract Sets an NSURL on the receiver. + @param URL The NSURL value + @param key The key for the value + */ +- (void)setURL:(NSURL *)URL forKey:(NSString *)key; + +/*! + @abstract Gets an NSString out of the receiver. + @param key The key for the value + @return The NSString value or nil + */ +- (NSString *)stringForKey:(NSString *)key; + +/*! + @abstract Gets an NSURL out of the receiver. + @param key The key for the value + @return The NSURL value or nil + */ +- (NSURL *)URLForKey:(NSString *)key; + +@end + +/*! + @abstract A base class to container Open Graph values. + */ +@interface FBSDKShareOpenGraphValueContainer : NSObject + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharePhoto.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharePhoto.h new file mode 100644 index 0000000..c3b91a6 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharePhoto.h @@ -0,0 +1,80 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract A photo for sharing. + */ +@interface FBSDKSharePhoto : NSObject + +/*! + @abstract Convenience method to build a new photo object with an image. + @param image If the photo is resident in memory, this method supplies the data + @param userGenerated Specifies whether the photo represented by the receiver was generated by the user or by the + application + */ ++ (instancetype)photoWithImage:(UIImage *)image userGenerated:(BOOL)userGenerated; + +/*! + @abstract Convenience method to build a new photo object with an imageURL. + @param imageURL The URL to the photo + @param userGenerated Specifies whether the photo represented by the receiver was generated by the user or by the + application + @discussion This method should only be used when adding photo content to open graph stories. + For example, if you're trying to share a photo from the web by itself, download the image and use + `photoWithImage:userGenerated:` instead. + */ ++ (instancetype)photoWithImageURL:(NSURL *)imageURL userGenerated:(BOOL)userGenerated; + +/*! + @abstract If the photo is resident in memory, this method supplies the data. + @return UIImage representation of the photo + */ +@property (nonatomic, strong) UIImage *image; + +/*! + @abstract The URL to the photo. + @return URL that points to a network location or the location of the photo on disk + */ +@property (nonatomic, copy) NSURL *imageURL; + +/*! + @abstract Specifies whether the photo represented by the receiver was generated by the user or by the application. + @return YES if the photo is user-generated, otherwise NO + */ +@property (nonatomic, assign, getter=isUserGenerated) BOOL userGenerated; + +/*! + @abstract Compares the receiver to another photo. + @param photo The other photo + @return YES if the receiver's values are equal to the other photo's values; otherwise NO + */ +- (BOOL)isEqualToSharePhoto:(FBSDKSharePhoto *)photo; + +/*! + @abstract The user generated caption for the photo. Note that the 'caption' must come from + * the user, as pre-filled content is forbidden by the Platform Policies (2.3). + @return the Photo's caption if exists else returns null. + */ +@property (nonatomic, copy) NSString *caption; + + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharePhotoContent.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharePhotoContent.h new file mode 100644 index 0000000..1fd0782 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharePhotoContent.h @@ -0,0 +1,41 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract A model for photo content to be shared. + */ +@interface FBSDKSharePhotoContent : NSObject + +/*! + @abstract Photos to be shared. + @return Array of the photos (FBSDKSharePhoto) + */ +@property (nonatomic, copy) NSArray *photos; + +/*! + @abstract Compares the receiver to another photo content. + @param content The other content + @return YES if the receiver's values are equal to the other content's values; otherwise NO + */ +- (BOOL)isEqualToSharePhotoContent:(FBSDKSharePhotoContent *)content; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareVideo.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareVideo.h new file mode 100644 index 0000000..2b6ae0c --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareVideo.h @@ -0,0 +1,48 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract A video for sharing. + */ +@interface FBSDKShareVideo : NSObject + +/*! + @abstract Convenience method to build a new video object with a videoURL. + @param videoURL The URL to the video + application + */ ++ (instancetype)videoWithVideoURL:(NSURL *)videoURL; + +/*! + @abstract The file URL to the video. + @return URL that points to the location of the video on disk + */ +@property (nonatomic, copy) NSURL *videoURL; + +/*! + @abstract Compares the receiver to another video. + @param video The other video + @return YES if the receiver's values are equal to the other video's values; otherwise NO + */ +- (BOOL)isEqualToShareVideo:(FBSDKShareVideo *)video; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareVideoContent.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareVideoContent.h new file mode 100644 index 0000000..bead676 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKShareVideoContent.h @@ -0,0 +1,49 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 +#import + +/*! + @abstract A model for video content to be shared. + */ +@interface FBSDKShareVideoContent : NSObject + +/*! + @abstract The photo that represents the video. + @return The photo + */ +@property (nonatomic, copy) FBSDKSharePhoto *previewPhoto; + +/*! + @abstract The video to be shared. + @return The video + */ +@property (nonatomic, copy) FBSDKShareVideo *video; + +/*! + @abstract Compares the receiver to another video content. + @param content The other content + @return YES if the receiver's values are equal to the other content's values; otherwise NO + */ +- (BOOL)isEqualToShareVideoContent:(FBSDKShareVideoContent *)content; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharing.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharing.h new file mode 100644 index 0000000..d6d373e --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharing.h @@ -0,0 +1,110 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +@protocol FBSDKSharingDelegate; + +/*! + @abstract The common interface for components that initiate sharing. + @see FBSDKShareDialog + @see FBSDKMessageDialog + @see FBSDKShareAPI + */ +@protocol FBSDKSharing + +/*! + @abstract The receiver's delegate or nil if it doesn't have a delegate. + */ +@property (nonatomic, weak) id delegate; + +/*! + @abstract The content to be shared. + */ +@property (nonatomic, copy) id shareContent; + +/*! + @abstract A Boolean value that indicates whether the receiver should fail if it finds an error with the share content. + @discussion If NO, the sharer will still be displayed without the data that was mis-configured. For example, an + invalid placeID specified on the shareContent would produce a data error. + */ +@property (nonatomic, assign) BOOL shouldFailOnDataError; + +/*! + @abstract Validates the content on the receiver. + @param errorRef If an error occurs, upon return contains an NSError object that describes the problem. + @return YES if the content is valid, otherwise NO. + */ +- (BOOL)validateWithError:(NSError **)errorRef; + +@end + +/*! + @abstract The common interface for dialogs that initiate sharing. + */ +@protocol FBSDKSharingDialog + +/*! + @abstract A Boolean value that indicates whether the receiver can initiate a share. + @discussion May return NO if the appropriate Facebook app is not installed and is required or an access token is + required but not available. This method does not validate the content on the receiver, so this can be checked before + building up the content. + @see [FBSDKSharing validateWithError:] + @result YES if the receiver can share, otherwise NO. + */ +- (BOOL)canShow; + +/*! + @abstract Shows the dialog. + @result YES if the receiver was able to begin sharing, otherwise NO. + */ +- (BOOL)show; + +@end + +/*! + @abstract A delegate for FBSDKSharing. + @discussion The delegate is notified with the results of the sharer as long as the application has permissions to + receive the information. For example, if the person is not signed into the containing app, the sharer may not be able + to distinguish between completion of a share and cancellation. + */ +@protocol FBSDKSharingDelegate + +/*! + @abstract Sent to the delegate when the share completes without error or cancellation. + @param sharer The FBSDKSharing that completed. + @param results The results from the sharer. This may be nil or empty. + */ +- (void)sharer:(id)sharer didCompleteWithResults:(NSDictionary *)results; + +/*! + @abstract Sent to the delegate when the sharer encounters an error. + @param sharer The FBSDKSharing that completed. + @param error The error. + */ +- (void)sharer:(id)sharer didFailWithError:(NSError *)error; + +/*! + @abstract Sent to the delegate when the sharer is cancelled. + @param sharer The FBSDKSharing that completed. + */ +- (void)sharerDidCancel:(id)sharer; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharingButton.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharingButton.h new file mode 100644 index 0000000..a3af423 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharingButton.h @@ -0,0 +1,35 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract The common interface for sharing buttons. + @see FBSDKSendButton + @see FBSDKShareButton + */ +@protocol FBSDKSharingButton + +/*! + @abstract The content to be shared. + */ +@property (nonatomic, copy) id shareContent; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharingContent.h b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharingContent.h new file mode 100644 index 0000000..5f70083 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Headers/FBSDKSharingContent.h @@ -0,0 +1,56 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright 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 + +/*! + @abstract A base interface for content to be shared. + */ +@protocol FBSDKSharingContent + +/*! + @abstract URL for the content being shared. + @discussion This URL will be checked for all link meta tags for linking in platform specific ways. See documentation + for App Links (https://developers.facebook.com/docs/applinks/) + @return URL representation of the content link + */ +@property (nonatomic, copy) NSURL *contentURL; + +/*! + @abstract List of IDs for taggable people to tag with this content. + @description See documentation for Taggable Friends + (https://developers.facebook.com/docs/graph-api/reference/user/taggable_friends) + @return Array of IDs for people to tag (NSString) + */ +@property (nonatomic, copy) NSArray *peopleIDs; + +/*! + @abstract The ID for a place to tag with this content. + @return The ID for the place to tag + */ +@property (nonatomic, copy) NSString *placeID; + +/*! + @abstract A value to be added to the referrer URL when a person follows a link from this shared content on feed. + @return The ref for the content. + */ +@property (nonatomic, copy) NSString *ref; + +@end diff --git a/dayPhoto/FBSDKShareKit.framework/Info.plist b/dayPhoto/FBSDKShareKit.framework/Info.plist new file mode 100644 index 0000000..53cfbe5 Binary files /dev/null and b/dayPhoto/FBSDKShareKit.framework/Info.plist differ diff --git a/dayPhoto/FBSDKShareKit.framework/Modules/module.modulemap b/dayPhoto/FBSDKShareKit.framework/Modules/module.modulemap new file mode 100644 index 0000000..faa8711 --- /dev/null +++ b/dayPhoto/FBSDKShareKit.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module FBSDKShareKit { + umbrella header "FBSDKShareKit.h" + + export * + module * { export * } +} diff --git a/dayPhoto/Fabric.framework/Fabric b/dayPhoto/Fabric.framework/Fabric new file mode 100755 index 0000000..68f7870 Binary files /dev/null and b/dayPhoto/Fabric.framework/Fabric differ diff --git a/dayPhoto/Fabric.framework/Headers/FABAttributes.h b/dayPhoto/Fabric.framework/Headers/FABAttributes.h new file mode 100644 index 0000000..f4e0639 --- /dev/null +++ b/dayPhoto/Fabric.framework/Headers/FABAttributes.h @@ -0,0 +1,48 @@ +// +// FABAttributes.h +// Fabric +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#pragma once + +#define FAB_UNAVAILABLE(x) __attribute__((unavailable(x))) + +#if __has_feature(nullability) + #define fab_nullable nullable + #define fab_nonnull nonnull + #define fab_null_unspecified null_unspecified + #define fab_null_resettable null_resettable + #define __fab_nullable __nullable + #define __fab_nonnull __nonnull + #define __fab_null_unspecified __null_unspecified +#else + #define fab_nullable + #define fab_nonnull + #define fab_null_unspecified + #define fab_null_resettable + #define __fab_nullable + #define __fab_nonnull + #define __fab_null_unspecified +#endif + +#ifndef NS_ASSUME_NONNULL_BEGIN + #define NS_ASSUME_NONNULL_BEGIN +#endif + +#ifndef NS_ASSUME_NONNULL_END + #define NS_ASSUME_NONNULL_END +#endif + + +/** + * The following macros are defined here to provide + * backwards compatability. If you are still using + * them you should migrate to the new versions that + * are defined above. + */ +#define FAB_NONNULL __fab_nonnull +#define FAB_NULLABLE __fab_nullable +#define FAB_START_NONNULL NS_ASSUME_NONNULL_BEGIN +#define FAB_END_NONNULL NS_ASSUME_NONNULL_END diff --git a/dayPhoto/Fabric.framework/Headers/Fabric.h b/dayPhoto/Fabric.framework/Headers/Fabric.h new file mode 100644 index 0000000..47a3d05 --- /dev/null +++ b/dayPhoto/Fabric.framework/Headers/Fabric.h @@ -0,0 +1,64 @@ +// +// Fabric.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import +#import "FABAttributes.h" + +NS_ASSUME_NONNULL_BEGIN + +#if TARGET_OS_IPHONE +#if __IPHONE_OS_VERSION_MIN_REQUIRED < 60000 + #error "Fabric's minimum iOS version is 6.0" +#endif +#else +#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + #error "Fabric's minimum OS X version is 10.7" +#endif +#endif + +/** + * Fabric Base. Coordinates configuration and starts all provided kits. + */ +@interface Fabric : NSObject + +/** + * Initialize Fabric and all provided kits. Call this method within your App Delegate's `application:didFinishLaunchingWithOptions:` and provide the kits you wish to use. + * + * For example, in Objective-C: + * + * `[Fabric with:@[[Crashlytics class], [Twitter class], [Digits class], [MoPub class]]];` + * + * Swift: + * + * `Fabric.with([Crashlytics.self(), Twitter.self(), Digits.self(), MoPub.self()])` + * + * Only the first call to this method is honored. Subsequent calls are no-ops. + * + * @param kitClasses An array of kit Class objects + * + * @return Returns the shared Fabric instance. In most cases this can be ignored. + */ ++ (instancetype)with:(NSArray *)kitClasses; + +/** + * Returns the Fabric singleton object. + */ ++ (instancetype)sharedSDK; + +/** + * This BOOL enables or disables debug logging, such as kit version information. The default value is NO. + */ +@property (nonatomic, assign) BOOL debug; + +/** + * Unavailable. Use `+sharedSDK` to retrieve the shared Fabric instance. + */ +- (id)init FAB_UNAVAILABLE("Use +sharedSDK to retrieve the shared Fabric instance."); + +@end + +NS_ASSUME_NONNULL_END + diff --git a/dayPhoto/Fabric.framework/Info.plist b/dayPhoto/Fabric.framework/Info.plist new file mode 100644 index 0000000..2b97876 --- /dev/null +++ b/dayPhoto/Fabric.framework/Info.plist @@ -0,0 +1,55 @@ + + + + + BuildMachineOSBuild + 14F1021 + CFBundleDevelopmentRegion + en + CFBundleExecutable + Fabric + CFBundleIdentifier + io.fabric.sdk.ios + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Fabric + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.6.1 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + iPhoneOS + + CFBundleVersion + 37 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 13B137 + DTPlatformName + iphoneos + DTPlatformVersion + 9.1 + DTSDKBuild + 13B137 + DTSDKName + iphoneos9.1 + DTXcode + 0710 + DTXcodeBuild + 7B91b + MinimumOSVersion + 6.0 + NSHumanReadableCopyright + Copyright © 2015 Twitter. All rights reserved. + UIDeviceFamily + + 1 + 2 + + + diff --git a/dayPhoto/Fabric.framework/Modules/module.modulemap b/dayPhoto/Fabric.framework/Modules/module.modulemap new file mode 100644 index 0000000..2a31223 --- /dev/null +++ b/dayPhoto/Fabric.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module Fabric { + umbrella header "Fabric.h" + + export * + module * { export * } +} \ No newline at end of file diff --git a/dayPhoto/Fabric.framework/run b/dayPhoto/Fabric.framework/run new file mode 100755 index 0000000..f4c5732 --- /dev/null +++ b/dayPhoto/Fabric.framework/run @@ -0,0 +1,28 @@ +#!/bin/sh + +# run +# +# Copyright (c) 2015 Crashlytics. All rights reserved. + +# Figure out where we're being called from +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) + +# Quote path in case of spaces or special chars +DIR="\"${DIR}" + +PATH_SEP="/" +VALIDATE_COMMAND="uploadDSYM\" $@ validate" +UPLOAD_COMMAND="uploadDSYM\" $@" + +# Ensure params are as expected, run in sync mode to validate +eval $DIR$PATH_SEP$VALIDATE_COMMAND +return_code=$? + +if [[ $return_code != 0 ]]; then + exit $return_code +fi + +# Verification passed, upload dSYM in background to prevent Xcode from waiting +# Note: Validation is performed again before upload. +# Output can still be found in Console.app +eval $DIR$PATH_SEP$UPLOAD_COMMAND > /dev/null 2>&1 & diff --git a/dayPhoto/Fabric.framework/uploadDSYM b/dayPhoto/Fabric.framework/uploadDSYM new file mode 100755 index 0000000..fa6658d Binary files /dev/null and b/dayPhoto/Fabric.framework/uploadDSYM differ diff --git a/dayPhoto/LICENSE b/dayPhoto/LICENSE new file mode 100755 index 0000000..3e36352 --- /dev/null +++ b/dayPhoto/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Flatstack + +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/dayPhoto/Podfile b/dayPhoto/Podfile new file mode 100755 index 0000000..9ea9ab4 --- /dev/null +++ b/dayPhoto/Podfile @@ -0,0 +1,16 @@ +platform :ios, '8.0' +source 'https://github.com/CocoaPods/Specs.git' +use_frameworks! + +pod 'FSHelpers+Swift' +pod 'VK-ios-sdk' +pod 'AFNetworking' +pod 'SDWebImage', '~> 3.7' +#pod 'NSDate-Extensions' +pod 'MagicalRecord' +#pod 'Reachability' +#pod 'SVProgressHUD', '~> 1.0' +#pod 'SSKeychain' +#pod 'NSData+Base64' +#pod 'MKStoreKit' +#pod 'NSDate-Extensions' diff --git a/dayPhoto/Podfile.lock b/dayPhoto/Podfile.lock new file mode 100755 index 0000000..68eba49 --- /dev/null +++ b/dayPhoto/Podfile.lock @@ -0,0 +1,44 @@ +PODS: + - AFNetworking (2.6.3): + - AFNetworking/NSURLConnection (= 2.6.3) + - AFNetworking/NSURLSession (= 2.6.3) + - AFNetworking/Reachability (= 2.6.3) + - AFNetworking/Security (= 2.6.3) + - AFNetworking/Serialization (= 2.6.3) + - AFNetworking/UIKit (= 2.6.3) + - AFNetworking/NSURLConnection (2.6.3): + - AFNetworking/Reachability + - AFNetworking/Security + - AFNetworking/Serialization + - AFNetworking/NSURLSession (2.6.3): + - AFNetworking/Reachability + - AFNetworking/Security + - AFNetworking/Serialization + - AFNetworking/Reachability (2.6.3) + - AFNetworking/Security (2.6.3) + - AFNetworking/Serialization (2.6.3) + - AFNetworking/UIKit (2.6.3): + - AFNetworking/NSURLConnection + - AFNetworking/NSURLSession + - FSHelpers+Swift (2.0) + - MagicalRecord (2.3.0) + - SDWebImage (3.7.3): + - SDWebImage/Core (= 3.7.3) + - SDWebImage/Core (3.7.3) + - VK-ios-sdk (1.3.8) + +DEPENDENCIES: + - AFNetworking + - FSHelpers+Swift + - MagicalRecord + - SDWebImage (~> 3.7) + - VK-ios-sdk + +SPEC CHECKSUMS: + AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60 + FSHelpers+Swift: 6d199597cf772fbeb5c009fe5715886ffba18719 + MagicalRecord: 89eb7d7ead39fb37f01c3d010665ee94d17f8dba + SDWebImage: 1d2b1a1efda1ade1b00b6f8498865f8ddedc8a84 + VK-ios-sdk: 63b3e084eecb1ed2c11ab3ac53f9309164973f9b + +COCOAPODS: 0.39.0 diff --git a/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h b/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h new file mode 100755 index 0000000..cf6def4 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h @@ -0,0 +1,70 @@ +// AFHTTPRequestOperation.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 "AFURLConnectionOperation.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + `AFHTTPRequestOperation` is a subclass of `AFURLConnectionOperation` for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request. + */ +@interface AFHTTPRequestOperation : AFURLConnectionOperation + +///------------------------------------------------ +/// @name Getting HTTP URL Connection Information +///------------------------------------------------ + +/** + The last HTTP response received by the operation's connection. + */ +@property (readonly, nonatomic, strong, nullable) NSHTTPURLResponse *response; + +/** + 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 AFHTTPResponse serializer, which uses the raw data as its response object. The serializer validates the status code to be in the `2XX` range, denoting success. If the response serializer generates an error in `-responseObjectForResponse:data:error:`, the `failure` callback of the session task or request operation will be executed; otherwise, the `success` callback will be executed. + + @warning `responseSerializer` must not be `nil`. Setting a response serializer will clear out any cached value + */ +@property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; + +/** + An object constructed by the `responseSerializer` from the response and response data. Returns `nil` unless the operation `isFinished`, has a `response`, and has `responseData` with non-zero content length. If an error occurs during serialization, `nil` will be returned, and the `error` property will be populated with the serialization error. + */ +@property (readonly, nonatomic, strong, nullable) id responseObject; + +///----------------------------------------------------------- +/// @name Setting Completion Block Success / Failure Callbacks +///----------------------------------------------------------- + +/** + Sets the `completionBlock` property with a block that executes either the specified success or failure block, depending on the state of the request on completion. If `error` returns a value, which can be caused by an unacceptable status code or content type, then `failure` is executed. Otherwise, `success` is executed. + + This method should be overridden in subclasses in order to specify the response object passed into the success block. + + @param success The block to be executed on the completion of a successful request. This block has no return value and takes two arguments: the receiver operation and the object constructed from the response data of the request. + @param failure The block to be executed on the completion of an unsuccessful request. This block has no return value and takes two arguments: the receiver operation and the error that occurred during the request. + */ +- (void)setCompletionBlockWithSuccess:(nullable void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(nullable void (^)(AFHTTPRequestOperation *operation, NSError *error))failure; + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m b/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m new file mode 100755 index 0000000..b8deda8 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m @@ -0,0 +1,206 @@ +// AFHTTPRequestOperation.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 "AFHTTPRequestOperation.h" + +static dispatch_queue_t http_request_operation_processing_queue() { + static dispatch_queue_t af_http_request_operation_processing_queue; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + af_http_request_operation_processing_queue = dispatch_queue_create("com.alamofire.networking.http-request.processing", DISPATCH_QUEUE_CONCURRENT); + }); + + return af_http_request_operation_processing_queue; +} + +static dispatch_group_t http_request_operation_completion_group() { + static dispatch_group_t af_http_request_operation_completion_group; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + af_http_request_operation_completion_group = dispatch_group_create(); + }); + + return af_http_request_operation_completion_group; +} + +#pragma mark - + +@interface AFURLConnectionOperation () +@property (readwrite, nonatomic, strong) NSURLRequest *request; +@property (readwrite, nonatomic, strong) NSURLResponse *response; +@end + +@interface AFHTTPRequestOperation () +@property (readwrite, nonatomic, strong) NSHTTPURLResponse *response; +@property (readwrite, nonatomic, strong) id responseObject; +@property (readwrite, nonatomic, strong) NSError *responseSerializationError; +@property (readwrite, nonatomic, strong) NSRecursiveLock *lock; +@end + +@implementation AFHTTPRequestOperation +@dynamic response; +@dynamic lock; + +- (instancetype)initWithRequest:(NSURLRequest *)urlRequest { + self = [super initWithRequest:urlRequest]; + if (!self) { + return nil; + } + + self.responseSerializer = [AFHTTPResponseSerializer serializer]; + + return self; +} + +- (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer { + NSParameterAssert(responseSerializer); + + [self.lock lock]; + _responseSerializer = responseSerializer; + self.responseObject = nil; + self.responseSerializationError = nil; + [self.lock unlock]; +} + +- (id)responseObject { + [self.lock lock]; + if (!_responseObject && [self isFinished] && !self.error) { + NSError *error = nil; + self.responseObject = [self.responseSerializer responseObjectForResponse:self.response data:self.responseData error:&error]; + if (error) { + self.responseSerializationError = error; + } + } + [self.lock unlock]; + + return _responseObject; +} + +- (NSError *)error { + if (_responseSerializationError) { + return _responseSerializationError; + } else { + return [super error]; + } +} + +#pragma mark - AFHTTPRequestOperation + +- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure +{ + // completionBlock is manually nilled out in AFURLConnectionOperation to break the retain cycle. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-retain-cycles" +#pragma clang diagnostic ignored "-Wgnu" + self.completionBlock = ^{ + if (self.completionGroup) { + dispatch_group_enter(self.completionGroup); + } + + dispatch_async(http_request_operation_processing_queue(), ^{ + if (self.error) { + if (failure) { + dispatch_group_async(self.completionGroup ?: http_request_operation_completion_group(), self.completionQueue ?: dispatch_get_main_queue(), ^{ + failure(self, self.error); + }); + } + } else { + id responseObject = self.responseObject; + if (self.error) { + if (failure) { + dispatch_group_async(self.completionGroup ?: http_request_operation_completion_group(), self.completionQueue ?: dispatch_get_main_queue(), ^{ + failure(self, self.error); + }); + } + } else { + if (success) { + dispatch_group_async(self.completionGroup ?: http_request_operation_completion_group(), self.completionQueue ?: dispatch_get_main_queue(), ^{ + success(self, responseObject); + }); + } + } + } + + if (self.completionGroup) { + dispatch_group_leave(self.completionGroup); + } + }); + }; +#pragma clang diagnostic pop +} + +#pragma mark - AFURLRequestOperation + +- (void)pause { + [super pause]; + + u_int64_t offset = 0; + if ([self.outputStream propertyForKey:NSStreamFileCurrentOffsetKey]) { + offset = [(NSNumber *)[self.outputStream propertyForKey:NSStreamFileCurrentOffsetKey] unsignedLongLongValue]; + } else { + offset = [(NSData *)[self.outputStream propertyForKey:NSStreamDataWrittenToMemoryStreamKey] length]; + } + + NSMutableURLRequest *mutableURLRequest = [self.request mutableCopy]; + if ([self.response respondsToSelector:@selector(allHeaderFields)] && [[self.response allHeaderFields] valueForKey:@"ETag"]) { + [mutableURLRequest setValue:[[self.response allHeaderFields] valueForKey:@"ETag"] forHTTPHeaderField:@"If-Range"]; + } + [mutableURLRequest setValue:[NSString stringWithFormat:@"bytes=%llu-", offset] forHTTPHeaderField:@"Range"]; + self.request = mutableURLRequest; +} + +#pragma mark - NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (id)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + + self.responseSerializer = [decoder decodeObjectOfClass:[AFHTTPResponseSerializer class] forKey:NSStringFromSelector(@selector(responseSerializer))]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + + [coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))]; +} + +#pragma mark - NSCopying + +- (id)copyWithZone:(NSZone *)zone { + AFHTTPRequestOperation *operation = [super copyWithZone:zone]; + + operation.responseSerializer = [self.responseSerializer copyWithZone:zone]; + operation.completionQueue = self.completionQueue; + operation.completionGroup = self.completionGroup; + + return operation; +} + +@end diff --git a/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h b/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h new file mode 100755 index 0000000..8170811 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h @@ -0,0 +1,326 @@ +// AFHTTPRequestOperationManager.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 +#import + +#if __IPHONE_OS_VERSION_MIN_REQUIRED +#import +#else +#import +#endif + +#import "AFHTTPRequestOperation.h" +#import "AFURLResponseSerialization.h" +#import "AFURLRequestSerialization.h" +#import "AFSecurityPolicy.h" +#import "AFNetworkReachabilityManager.h" + +#ifndef NS_DESIGNATED_INITIALIZER +#if __has_attribute(objc_designated_initializer) +#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define NS_DESIGNATED_INITIALIZER +#endif +#endif + +NS_ASSUME_NONNULL_BEGIN + +/** + `AFHTTPRequestOperationManager` encapsulates the common patterns of communicating with a web application over HTTP, including request creation, response serialization, network reachability monitoring, and security, as well as request operation management. + + ## 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 request operation construction for an `AFHTTPRequestOperationManager` subclass, override `HTTPRequestOperationWithRequest:success:failure`. + + ## 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. + + ## 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. + + ## NSSecureCoding & NSCopying Caveats + + `AFHTTPRequestOperationManager` conforms to the `NSSecureCoding` and `NSCopying` protocols, allowing operations to be archived to disk, and copied in memory, respectively. There are a few minor caveats to keep in mind, however: + + - Archives and copies of HTTP clients will be initialized with an empty operation queue. + - NSSecureCoding cannot serialize / deserialize block properties, so an archive of an HTTP client will not include any reachability callback block that may be set. + */ +@interface AFHTTPRequestOperationManager : NSObject + +/** + The URL used to monitor reachability, and 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 a JSON serializer, which serializes data from responses with a `application/json` MIME type, and falls back to the raw data object. The serializer validates the status code to be in the `2XX` range, denoting success. If the response serializer generates an error in `-responseObjectForResponse:data:error:`, the `failure` callback of the session task or request operation will be executed; otherwise, the `success` callback will be executed. + + @warning `responseSerializer` must not be `nil`. + */ +@property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; + +/** + The operation queue on which request operations are scheduled and run. + */ +@property (nonatomic, strong) NSOperationQueue *operationQueue; + +///------------------------------- +/// @name Managing URL Credentials +///------------------------------- + +/** + Whether request operations should consult the credential storage for authenticating the connection. `YES` by default. + + @see AFURLConnectionOperation -shouldUseCredentialStorage + */ +@property (nonatomic, assign) BOOL shouldUseCredentialStorage; + +/** + The credential used by request operations for authentication challenges. + + @see AFURLConnectionOperation -credential + */ +@property (nonatomic, strong, nullable) NSURLCredential *credential; + +///------------------------------- +/// @name Managing Security Policy +///------------------------------- + +/** + The security policy used by created request operations to evaluate server trust for secure connections. `AFHTTPRequestOperationManager` uses the `defaultPolicy` unless otherwise specified. + */ +@property (nonatomic, strong) AFSecurityPolicy *securityPolicy; + +///------------------------------------ +/// @name Managing Network Reachability +///------------------------------------ + +/** + The network reachability manager. `AFHTTPRequestOperationManager` uses the `sharedManager` by default. + */ +@property (readwrite, nonatomic, strong) AFNetworkReachabilityManager *reachabilityManager; + +///------------------------------- +/// @name Managing Callback Queues +///------------------------------- + +/** + The dispatch queue for the `completionBlock` of request operations. If `NULL` (default), the main queue is used. + */ +#if OS_OBJECT_USE_OBJC +@property (nonatomic, strong, nullable) dispatch_queue_t completionQueue; +#else +@property (nonatomic, assign, nullable) dispatch_queue_t completionQueue; +#endif + +/** + The dispatch group for the `completionBlock` of request operations. If `NULL` (default), a private dispatch group is used. + */ +#if OS_OBJECT_USE_OBJC +@property (nonatomic, strong, nullable) dispatch_group_t completionGroup; +#else +@property (nonatomic, assign, nullable) dispatch_group_t completionGroup; +#endif + +///--------------------------------------------- +/// @name Creating and Initializing HTTP Clients +///--------------------------------------------- + +/** + Creates and returns an `AFHTTPRequestOperationManager` object. + */ ++ (instancetype)manager; + +/** + Initializes an `AFHTTPRequestOperationManager` object with the specified base URL. + + This is the designated initializer. + + @param url The base URL for the HTTP client. + + @return The newly-initialized HTTP client + */ +- (instancetype)initWithBaseURL:(nullable NSURL *)url NS_DESIGNATED_INITIALIZER; + +///--------------------------------------- +/// @name Managing HTTP Request Operations +///--------------------------------------- + +/** + Creates an `AFHTTPRequestOperation`, and sets the response serializers to that of the HTTP client. + + @param request The request object to be loaded asynchronously during execution of the operation. + @param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the created request operation and the object created from the response data of request. + @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes two arguments:, the created request operation and the `NSError` object describing the network or parsing error that occurred. + */ +- (AFHTTPRequestOperation *)HTTPRequestOperationWithRequest:(NSURLRequest *)request + success:(nullable void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(nullable void (^)(AFHTTPRequestOperation *operation, NSError *error))failure; + +///--------------------------- +/// @name Making HTTP Requests +///--------------------------- + +/** + Creates and runs an `AFHTTPRequestOperation` 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 request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer. + @param failure A block object to be executed when the request operation 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 request operation and the error describing the network or parsing error that occurred. + + @see -HTTPRequestOperationWithRequest:success:failure: + */ +- (nullable AFHTTPRequestOperation *)GET:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(nullable void (^)(AFHTTPRequestOperation * __nullable operation, NSError *error))failure; + +/** + Creates and runs an `AFHTTPRequestOperation` 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 request operation finishes successfully. This block has no return value and takes a single arguments: the request operation. + @param failure A block object to be executed when the request operation 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 request operation and the error describing the network or parsing error that occurred. + + @see -HTTPRequestOperationWithRequest:success:failure: + */ +- (nullable AFHTTPRequestOperation *)HEAD:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(AFHTTPRequestOperation *operation))success + failure:(nullable void (^)(AFHTTPRequestOperation * __nullable operation, NSError *error))failure; + +/** + Creates and runs an `AFHTTPRequestOperation` 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 request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer. + @param failure A block object to be executed when the request operation 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 request operation and the error describing the network or parsing error that occurred. + + @see -HTTPRequestOperationWithRequest:success:failure: + */ +- (nullable AFHTTPRequestOperation *)POST:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(nullable void (^)(AFHTTPRequestOperation * __nullable operation, NSError *error))failure; + +/** + Creates and runs an `AFHTTPRequestOperation` 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 request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer. + @param failure A block object to be executed when the request operation 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 request operation and the error describing the network or parsing error that occurred. + + @see -HTTPRequestOperationWithRequest:success:failure: + */ +- (nullable AFHTTPRequestOperation *)POST:(NSString *)URLString + parameters:(nullable id)parameters + constructingBodyWithBlock:(nullable void (^)(id formData))block + success:(nullable void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(nullable void (^)(AFHTTPRequestOperation * __nullable operation, NSError *error))failure; + +/** + Creates and runs an `AFHTTPRequestOperation` 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 request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer. + @param failure A block object to be executed when the request operation 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 request operation and the error describing the network or parsing error that occurred. + + @see -HTTPRequestOperationWithRequest:success:failure: + */ +- (nullable AFHTTPRequestOperation *)PUT:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(nullable void (^)(AFHTTPRequestOperation * __nullable operation, NSError *error))failure; + +/** + Creates and runs an `AFHTTPRequestOperation` 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 request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer. + @param failure A block object to be executed when the request operation 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 request operation and the error describing the network or parsing error that occurred. + + @see -HTTPRequestOperationWithRequest:success:failure: + */ +- (nullable AFHTTPRequestOperation *)PATCH:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(nullable void (^)(AFHTTPRequestOperation * __nullable operation, NSError *error))failure; + +/** + Creates and runs an `AFHTTPRequestOperation` 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 request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer. + @param failure A block object to be executed when the request operation 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 request operation and the error describing the network or parsing error that occurred. + + @see -HTTPRequestOperationWithRequest:success:failure: + */ +- (nullable AFHTTPRequestOperation *)DELETE:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(nullable void (^)(AFHTTPRequestOperation * __nullable operation, NSError *error))failure; + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.m b/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.m new file mode 100755 index 0000000..ee682b7 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.m @@ -0,0 +1,290 @@ +// AFHTTPRequestOperationManager.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 + +#import "AFHTTPRequestOperationManager.h" +#import "AFHTTPRequestOperation.h" + +#import +#import + +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) +#import +#endif + +@interface AFHTTPRequestOperationManager () +@property (readwrite, nonatomic, strong) NSURL *baseURL; +@end + +@implementation AFHTTPRequestOperationManager + ++ (instancetype)manager { + return [[self alloc] initWithBaseURL:nil]; +} + +- (instancetype)init { + return [self initWithBaseURL:nil]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url { + self = [super init]; + 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]; + + self.securityPolicy = [AFSecurityPolicy defaultPolicy]; + + self.reachabilityManager = [AFNetworkReachabilityManager sharedManager]; + + self.operationQueue = [[NSOperationQueue alloc] init]; + + self.shouldUseCredentialStorage = YES; + + return self; +} + +#pragma mark - + +#ifdef _SYSTEMCONFIGURATION_H +#endif + +- (void)setRequestSerializer:(AFHTTPRequestSerializer *)requestSerializer { + NSParameterAssert(requestSerializer); + + _requestSerializer = requestSerializer; +} + +- (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer { + NSParameterAssert(responseSerializer); + + _responseSerializer = responseSerializer; +} + +#pragma mark - + +- (AFHTTPRequestOperation *)HTTPRequestOperationWithHTTPMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))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; + } + + return [self HTTPRequestOperationWithRequest:request success:success failure:failure]; +} + +- (AFHTTPRequestOperation *)HTTPRequestOperationWithRequest:(NSURLRequest *)request + success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure +{ + AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; + operation.responseSerializer = self.responseSerializer; + operation.shouldUseCredentialStorage = self.shouldUseCredentialStorage; + operation.credential = self.credential; + operation.securityPolicy = self.securityPolicy; + + [operation setCompletionBlockWithSuccess:success failure:failure]; + operation.completionQueue = self.completionQueue; + operation.completionGroup = self.completionGroup; + + return operation; +} + +#pragma mark - + +- (AFHTTPRequestOperation *)GET:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure +{ + AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithHTTPMethod:@"GET" URLString:URLString parameters:parameters success:success failure:failure]; + + [self.operationQueue addOperation:operation]; + + return operation; +} + +- (AFHTTPRequestOperation *)HEAD:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(AFHTTPRequestOperation *operation))success + failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure +{ + AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters success:^(AFHTTPRequestOperation *requestOperation, __unused id responseObject) { + if (success) { + success(requestOperation); + } + } failure:failure]; + + [self.operationQueue addOperation:operation]; + + return operation; +} + +- (AFHTTPRequestOperation *)POST:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure +{ + AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithHTTPMethod:@"POST" URLString:URLString parameters:parameters success:success failure:failure]; + + [self.operationQueue addOperation:operation]; + + return operation; +} + +- (AFHTTPRequestOperation *)POST:(NSString *)URLString + parameters:(id)parameters + constructingBodyWithBlock:(void (^)(id formData))block + success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(void (^)(AFHTTPRequestOperation *operation, 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; + } + + AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithRequest:request success:success failure:failure]; + + [self.operationQueue addOperation:operation]; + + return operation; +} + +- (AFHTTPRequestOperation *)PUT:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure +{ + AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters success:success failure:failure]; + + [self.operationQueue addOperation:operation]; + + return operation; +} + +- (AFHTTPRequestOperation *)PATCH:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure +{ + AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters success:success failure:failure]; + + [self.operationQueue addOperation:operation]; + + return operation; +} + +- (AFHTTPRequestOperation *)DELETE:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success + failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure +{ + AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithHTTPMethod:@"DELETE" URLString:URLString parameters:parameters success:success failure:failure]; + + [self.operationQueue addOperation:operation]; + + return operation; +} + +#pragma mark - NSObject + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@: %p, baseURL: %@, operationQueue: %@>", NSStringFromClass([self class]), self, [self.baseURL absoluteString], self.operationQueue]; +} + +#pragma mark - NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (id)initWithCoder:(NSCoder *)decoder { + NSURL *baseURL = [decoder decodeObjectForKey:NSStringFromSelector(@selector(baseURL))]; + + self = [self initWithBaseURL:baseURL]; + 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 { + [coder encodeObject:self.baseURL forKey:NSStringFromSelector(@selector(baseURL))]; + [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 + +- (id)copyWithZone:(NSZone *)zone { + AFHTTPRequestOperationManager *HTTPClient = [[[self class] allocWithZone:zone] initWithBaseURL:self.baseURL]; + + HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone]; + HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone]; + HTTPClient.securityPolicy = [self.securityPolicy copyWithZone:zone]; + + return HTTPClient; +} + +@end diff --git a/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h b/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h new file mode 100755 index 0000000..04b0876 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h @@ -0,0 +1,253 @@ +// 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 __IPHONE_OS_VERSION_MIN_REQUIRED +#import +#else +#import +#endif + +#import "AFURLSessionManager.h" + +#ifndef NS_DESIGNATED_INITIALIZER +#if __has_attribute(objc_designated_initializer) +#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define NS_DESIGNATED_INITIALIZER +#endif +#endif + +/** + `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. + */ + +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) || TARGET_OS_WATCH + +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 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 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 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 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 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 responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * __nullable task, NSError *error))failure; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m b/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m new file mode 100755 index 0000000..ed46b26 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m @@ -0,0 +1,328 @@ +// 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" + +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) || TARGET_WATCH_OS + +#import "AFURLRequestSerialization.h" +#import "AFURLResponseSerialization.h" + +#import +#import + +#ifdef _SYSTEMCONFIGURATION_H +#import +#import +#import +#import +#import +#endif + +#if TARGET_OS_IOS +#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 - + +#ifdef _SYSTEMCONFIGURATION_H +#endif + +- (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 +{ + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"GET" URLString:URLString parameters:parameters 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 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 +{ + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"POST" URLString:URLString parameters:parameters success:success failure:failure]; + + [dataTask resume]; + + return dataTask; +} + +- (NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(id)parameters + constructingBodyWithBlock:(void (^)(id formData))block + 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:nil 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 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 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 success:success failure:failure]; + + [dataTask resume]; + + return dataTask; +} + +- (NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(id)parameters + 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 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; +} + +- (id)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 + +- (id)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 + +#endif diff --git a/dayPhoto/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h b/dayPhoto/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h new file mode 100755 index 0000000..e2eb945 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h @@ -0,0 +1,207 @@ +// 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 + +#ifndef NS_DESIGNATED_INITIALIZER +#if __has_attribute(objc_designated_initializer) +#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define NS_DESIGNATED_INITIALIZER +#endif +#endif + +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 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_in`) 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/dayPhoto/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m b/dayPhoto/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m new file mode 100755 index 0000000..fe67781 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m @@ -0,0 +1,248 @@ +// 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, ^{ + struct sockaddr_in address; + bzero(&address, sizeof(address)); + address.sin_len = sizeof(address); + address.sin_family = AF_INET; + + _sharedManager = [self managerForAddress:&address]; + }); + + 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)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/dayPhoto/Pods/AFNetworking/AFNetworking/AFNetworking.h b/dayPhoto/Pods/AFNetworking/AFNetworking/AFNetworking.h new file mode 100755 index 0000000..6d442bb --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFNetworking.h @@ -0,0 +1,46 @@ +// 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 + +#ifndef _AFNETWORKING_ + #define _AFNETWORKING_ + + #import "AFURLRequestSerialization.h" + #import "AFURLResponseSerialization.h" + #import "AFSecurityPolicy.h" +#if !TARGET_OS_WATCH + #import "AFNetworkReachabilityManager.h" + #import "AFURLConnectionOperation.h" + #import "AFHTTPRequestOperation.h" + #import "AFHTTPRequestOperationManager.h" +#endif + +#if ( ( defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) || \ + ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 ) || \ + TARGET_OS_WATCH ) + #import "AFURLSessionManager.h" + #import "AFHTTPSessionManager.h" +#endif + +#endif /* _AFNETWORKING_ */ diff --git a/dayPhoto/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h b/dayPhoto/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h new file mode 100755 index 0000000..d968f49 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h @@ -0,0 +1,142 @@ +// 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 app bundle. Note that if you create an array with duplicate certificates, the duplicate certificates will be removed. Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches. + */ +@property (nonatomic, strong, nullable) NSArray *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 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; + +///------------------------------ +/// @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. + + @return Whether or not to trust the server. + + @warning This method has been deprecated in favor of `-evaluateServerTrust:forDomain:`. + */ +- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust DEPRECATED_ATTRIBUTE; + +/** + 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/dayPhoto/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m b/dayPhoto/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m new file mode 100755 index 0000000..2624775 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m @@ -0,0 +1,347 @@ +// 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 +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 + 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) NSArray *pinnedPublicKeys; +@end + +@implementation AFSecurityPolicy + ++ (NSArray *)defaultPinnedCertificates { + static NSArray *_defaultPinnedCertificates = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + NSBundle *bundle = [NSBundle bundleForClass:[self class]]; + NSArray *paths = [bundle pathsForResourcesOfType:@"cer" inDirectory:@"."]; + + NSMutableArray *certificates = [NSMutableArray arrayWithCapacity:[paths count]]; + for (NSString *path in paths) { + NSData *certificateData = [NSData dataWithContentsOfFile:path]; + [certificates addObject:certificateData]; + } + + _defaultPinnedCertificates = [[NSArray alloc] initWithArray:certificates]; + }); + + return _defaultPinnedCertificates; +} + ++ (instancetype)defaultPolicy { + AFSecurityPolicy *securityPolicy = [[self alloc] init]; + securityPolicy.SSLPinningMode = AFSSLPinningModeNone; + + return securityPolicy; +} + ++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode { + AFSecurityPolicy *securityPolicy = [[self alloc] init]; + securityPolicy.SSLPinningMode = pinningMode; + + [securityPolicy setPinnedCertificates:[self defaultPinnedCertificates]]; + + return securityPolicy; +} + +- (id)init { + self = [super init]; + if (!self) { + return nil; + } + + self.validatesDomainName = YES; + + return self; +} + +- (void)setPinnedCertificates:(NSArray *)pinnedCertificates { + _pinnedCertificates = [[NSOrderedSet orderedSetWithArray:pinnedCertificates] array]; + + if (self.pinnedCertificates) { + NSMutableArray *mutablePinnedPublicKeys = [NSMutableArray arrayWithCapacity:[self.pinnedCertificates count]]; + for (NSData *certificate in self.pinnedCertificates) { + id publicKey = AFPublicKeyForCertificate(certificate); + if (!publicKey) { + continue; + } + [mutablePinnedPublicKeys addObject:publicKey]; + } + self.pinnedPublicKeys = [NSArray arrayWithArray:mutablePinnedPublicKeys]; + } else { + self.pinnedPublicKeys = nil; + } +} + +#pragma mark - + +- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust { + return [self evaluateServerTrust:serverTrust forDomain:nil]; +} + +- (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; + } + + NSArray *serverCertificates = AFCertificateTrustChainForServerTrust(serverTrust); + 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; + } + + NSUInteger trustedCertificateCount = 0; + for (NSData *trustChainCertificate in serverCertificates) { + if ([self.pinnedCertificates containsObject:trustChainCertificate]) { + trustedCertificateCount++; + } + } + return trustedCertificateCount > 0; + } + 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/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h new file mode 100755 index 0000000..c21119e --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h @@ -0,0 +1,344 @@ +// AFURLConnectionOperation.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 +#import "AFURLRequestSerialization.h" +#import "AFURLResponseSerialization.h" +#import "AFSecurityPolicy.h" + +#ifndef NS_DESIGNATED_INITIALIZER +#if __has_attribute(objc_designated_initializer) +#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define NS_DESIGNATED_INITIALIZER +#endif +#endif + +/** + `AFURLConnectionOperation` is a subclass of `NSOperation` that implements `NSURLConnection` delegate methods. + + ## Subclassing Notes + + This is the base class of all network request operations. You may wish to create your own subclass in order to implement additional `NSURLConnection` delegate methods (see "`NSURLConnection` Delegate Methods" below), or to provide additional properties and/or class constructors. + + If you are creating a subclass that communicates over the HTTP or HTTPS protocols, you may want to consider subclassing `AFHTTPRequestOperation` instead, as it supports specifying acceptable content types or status codes. + + ## NSURLConnection Delegate Methods + + `AFURLConnectionOperation` implements the following `NSURLConnection` delegate methods: + + - `connection:didReceiveResponse:` + - `connection:didReceiveData:` + - `connectionDidFinishLoading:` + - `connection:didFailWithError:` + - `connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:` + - `connection:willCacheResponse:` + - `connectionShouldUseCredentialStorage:` + - `connection:needNewBodyStream:` + - `connection:willSendRequestForAuthenticationChallenge:` + + If any of these methods are overridden in a subclass, they _must_ call the `super` implementation first. + + ## Callbacks and Completion Blocks + + The built-in `completionBlock` provided by `NSOperation` allows for custom behavior to be executed after the request finishes. It is a common pattern for class constructors in subclasses to take callback block parameters, and execute them conditionally in the body of its `completionBlock`. Make sure to handle cancelled operations appropriately when setting a `completionBlock` (i.e. returning early before parsing response data). See the implementation of any of the `AFHTTPRequestOperation` subclasses for an example of this. + + Subclasses are strongly discouraged from overriding `setCompletionBlock:`, as `AFURLConnectionOperation`'s implementation includes a workaround to mitigate retain cycles, and what Apple rather ominously refers to as ["The Deallocation Problem"](http://developer.apple.com/library/ios/#technotes/tn2109/). + + ## SSL Pinning + + Relying on the CA trust model to validate SSL certificates exposes your app to security vulnerabilities, such as man-in-the-middle attacks. For applications that connect to known servers, SSL certificate pinning provides an increased level of security, by checking server certificate validity against those specified in the app bundle. + + SSL with certificate pinning is strongly recommended for any application that transmits sensitive information to an external webservice. + + Connections will be validated on all matching certificates with a `.cer` extension in the bundle root. + + ## NSCoding & NSCopying Conformance + + `AFURLConnectionOperation` conforms to the `NSCoding` and `NSCopying` protocols, allowing operations to be archived to disk, and copied in memory, respectively. However, because of the intrinsic limitations of capturing the exact state of an operation at a particular moment, there are some important caveats to keep in mind: + + ### NSCoding Caveats + + - Encoded operations do not include any block or stream properties. Be sure to set `completionBlock`, `outputStream`, and any callback blocks as necessary when using `-initWithCoder:` or `NSKeyedUnarchiver`. + - Operations are paused on `encodeWithCoder:`. If the operation was encoded while paused or still executing, its archived state will return `YES` for `isReady`. Otherwise, the state of an operation when encoding will remain unchanged. + + ### NSCopying Caveats + + - `-copy` and `-copyWithZone:` return a new operation with the `NSURLRequest` of the original. So rather than an exact copy of the operation at that particular instant, the copying mechanism returns a completely new instance, which can be useful for retrying operations. + - A copy of an operation will not include the `outputStream` of the original. + - Operation copies do not include `completionBlock`, as it often strongly captures a reference to `self`, which would otherwise have the unintuitive side-effect of pointing to the _original_ operation when copied. + */ + +NS_ASSUME_NONNULL_BEGIN + +@interface AFURLConnectionOperation : NSOperation + +///------------------------------- +/// @name Accessing Run Loop Modes +///------------------------------- + +/** + The run loop modes in which the operation will run on the network thread. By default, this is a single-member set containing `NSRunLoopCommonModes`. + */ +@property (nonatomic, strong) NSSet *runLoopModes; + +///----------------------------------------- +/// @name Getting URL Connection Information +///----------------------------------------- + +/** + The request used by the operation's connection. + */ +@property (readonly, nonatomic, strong) NSURLRequest *request; + +/** + The last response received by the operation's connection. + */ +@property (readonly, nonatomic, strong, nullable) NSURLResponse *response; + +/** + The error, if any, that occurred in the lifecycle of the request. + */ +@property (readonly, nonatomic, strong, nullable) NSError *error; + +///---------------------------- +/// @name Getting Response Data +///---------------------------- + +/** + The data received during the request. + */ +@property (readonly, nonatomic, strong, nullable) NSData *responseData; + +/** + The string representation of the response data. + */ +@property (readonly, nonatomic, copy, nullable) NSString *responseString; + +/** + The string encoding of the response. + + If the response does not specify a valid string encoding, `responseStringEncoding` will return `NSUTF8StringEncoding`. + */ +@property (readonly, nonatomic, assign) NSStringEncoding responseStringEncoding; + +///------------------------------- +/// @name Managing URL Credentials +///------------------------------- + +/** + Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default. + + This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`. + */ +@property (nonatomic, assign) BOOL shouldUseCredentialStorage; + +/** + The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. + + This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. + */ +@property (nonatomic, strong, nullable) NSURLCredential *credential; + +///------------------------------- +/// @name Managing Security Policy +///------------------------------- + +/** + The security policy used to evaluate server trust for secure connections. + */ +@property (nonatomic, strong) AFSecurityPolicy *securityPolicy; + +///------------------------ +/// @name Accessing Streams +///------------------------ + +/** + The input stream used to read data to be sent during the request. + + This property acts as a proxy to the `HTTPBodyStream` property of `request`. + */ +@property (nonatomic, strong) NSInputStream *inputStream; + +/** + The output stream that is used to write data received until the request is finished. + + By default, data is accumulated into a buffer that is stored into `responseData` upon completion of the request, with the intermediary `outputStream` property set to `nil`. When `outputStream` is set, the data will not be accumulated into an internal buffer, and as a result, the `responseData` property of the completed request will be `nil`. The output stream will be scheduled in the network thread runloop upon being set. + */ +@property (nonatomic, strong, nullable) NSOutputStream *outputStream; + +///--------------------------------- +/// @name Managing Callback Queues +///--------------------------------- + +/** + The dispatch queue for `completionBlock`. If `NULL` (default), the main queue is used. + */ +#if OS_OBJECT_USE_OBJC +@property (nonatomic, strong, nullable) dispatch_queue_t completionQueue; +#else +@property (nonatomic, assign, nullable) dispatch_queue_t completionQueue; +#endif + +/** + The dispatch group for `completionBlock`. If `NULL` (default), a private dispatch group is used. + */ +#if OS_OBJECT_USE_OBJC +@property (nonatomic, strong, nullable) dispatch_group_t completionGroup; +#else +@property (nonatomic, assign, nullable) dispatch_group_t completionGroup; +#endif + +///--------------------------------------------- +/// @name Managing Request Operation Information +///--------------------------------------------- + +/** + The user info dictionary for the receiver. + */ +@property (nonatomic, strong) NSDictionary *userInfo; +// FIXME: It doesn't seem that this userInfo is used anywhere in the implementation. + +///------------------------------------------------------ +/// @name Initializing an AFURLConnectionOperation Object +///------------------------------------------------------ + +/** + Initializes and returns a newly allocated operation object with a url connection configured with the specified url request. + + This is the designated initializer. + + @param urlRequest The request object to be used by the operation connection. + */ +- (instancetype)initWithRequest:(NSURLRequest *)urlRequest NS_DESIGNATED_INITIALIZER; + +///---------------------------------- +/// @name Pausing / Resuming Requests +///---------------------------------- + +/** + Pauses the execution of the request operation. + + A paused operation returns `NO` for `-isReady`, `-isExecuting`, and `-isFinished`. As such, it will remain in an `NSOperationQueue` until it is either cancelled or resumed. Pausing a finished, cancelled, or paused operation has no effect. + */ +- (void)pause; + +/** + Whether the request operation is currently paused. + + @return `YES` if the operation is currently paused, otherwise `NO`. + */ +- (BOOL)isPaused; + +/** + Resumes the execution of the paused request operation. + + Pause/Resume behavior varies depending on the underlying implementation for the operation class. In its base implementation, resuming a paused requests restarts the original request. However, since HTTP defines a specification for how to request a specific content range, `AFHTTPRequestOperation` will resume downloading the request from where it left off, instead of restarting the original request. + */ +- (void)resume; + +///---------------------------------------------- +/// @name Configuring Backgrounding Task Behavior +///---------------------------------------------- + +/** + Specifies that the operation should continue execution after the app has entered the background, and the expiration handler for that background task. + + @param handler A handler to be called shortly before the application’s remaining background time reaches 0. The handler is wrapped in a block that cancels the operation, and cleans up and marks the end of execution, unlike the `handler` parameter in `UIApplication -beginBackgroundTaskWithExpirationHandler:`, which expects this to be done in the handler itself. The handler is called synchronously on the main thread, thus blocking the application’s suspension momentarily while the application is notified. + */ +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) +- (void)setShouldExecuteAsBackgroundTaskWithExpirationHandler:(nullable void (^)(void))handler NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); +#endif + +///--------------------------------- +/// @name Setting Progress Callbacks +///--------------------------------- + +/** + Sets a callback to be called when an undetermined number of bytes have been uploaded to the server. + + @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 three arguments: 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)setUploadProgressBlock:(nullable void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))block; + +/** + Sets a callback to be called when an undetermined number of bytes have been downloaded from the server. + + @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 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 main thread. + */ +- (void)setDownloadProgressBlock:(nullable void (^)(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead))block; + +///------------------------------------------------- +/// @name Setting NSURLConnection Delegate Callbacks +///------------------------------------------------- + +/** + Sets a block to be executed when the connection will authenticate a challenge in order to download its request, as handled by the `NSURLConnectionDelegate` method `connection:willSendRequestForAuthenticationChallenge:`. + + @param block A block object to be executed when the connection will authenticate a challenge in order to download its request. The block has no return type and takes two arguments: the URL connection object, and the challenge that must be authenticated. This block must invoke one of the challenge-responder methods (NSURLAuthenticationChallengeSender protocol). + + If `allowsInvalidSSLCertificate` is set to YES, `connection:willSendRequestForAuthenticationChallenge:` will attempt to have the challenge sender use credentials with invalid SSL certificates. + */ +- (void)setWillSendRequestForAuthenticationChallengeBlock:(nullable void (^)(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge))block; + +/** + Sets a block to be executed when the server redirects the request from one URL to another URL, or when the request URL changed by the `NSURLProtocol` subclass handling the request in order to standardize its format, as handled by the `NSURLConnectionDataDelegate` method `connection:willSendRequest:redirectResponse:`. + + @param block A block object to be executed when the request URL was changed. The block returns an `NSURLRequest` object, the URL request to redirect, and takes three arguments: the URL connection object, the the proposed redirected request, and the URL response that caused the redirect. + */ +- (void)setRedirectResponseBlock:(nullable NSURLRequest * (^)(NSURLConnection *connection, NSURLRequest *request, NSURLResponse *redirectResponse))block; + + +/** + Sets a block to be executed to modify the response a connection will cache, if any, as handled by the `NSURLConnectionDelegate` method `connection:willCacheResponse:`. + + @param block A block object to be executed to determine what response a connection will cache, if any. The block returns an `NSCachedURLResponse` object, the cached response to store in memory or `nil` to prevent the response from being cached, and takes two arguments: the URL connection object, and the cached response provided for the request. + */ +- (void)setCacheResponseBlock:(nullable NSCachedURLResponse * (^)(NSURLConnection *connection, NSCachedURLResponse *cachedResponse))block; + +/// + +/** + + */ ++ (NSArray *)batchOfRequestOperations:(nullable NSArray *)operations + progressBlock:(nullable void (^)(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations))progressBlock + completionBlock:(nullable void (^)(NSArray *operations))completionBlock; + +@end + +///-------------------- +/// @name Notifications +///-------------------- + +/** + Posted when an operation begins executing. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingOperationDidStartNotification; + +/** + Posted when an operation finishes. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingOperationDidFinishNotification; + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m new file mode 100755 index 0000000..2126ca6 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m @@ -0,0 +1,792 @@ +// AFURLConnectionOperation.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 "AFURLConnectionOperation.h" + +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) +#import +#endif + +#if !__has_feature(objc_arc) +#error AFNetworking must be built with ARC. +// You can turn on ARC for only AFNetworking files by adding -fobjc-arc to the build phase for each of its files. +#endif + +typedef NS_ENUM(NSInteger, AFOperationState) { + AFOperationPausedState = -1, + AFOperationReadyState = 1, + AFOperationExecutingState = 2, + AFOperationFinishedState = 3, +}; + +static dispatch_group_t url_request_operation_completion_group() { + static dispatch_group_t af_url_request_operation_completion_group; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + af_url_request_operation_completion_group = dispatch_group_create(); + }); + + return af_url_request_operation_completion_group; +} + +static dispatch_queue_t url_request_operation_completion_queue() { + static dispatch_queue_t af_url_request_operation_completion_queue; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + af_url_request_operation_completion_queue = dispatch_queue_create("com.alamofire.networking.operation.queue", DISPATCH_QUEUE_CONCURRENT ); + }); + + return af_url_request_operation_completion_queue; +} + +static NSString * const kAFNetworkingLockName = @"com.alamofire.networking.operation.lock"; + +NSString * const AFNetworkingOperationDidStartNotification = @"com.alamofire.networking.operation.start"; +NSString * const AFNetworkingOperationDidFinishNotification = @"com.alamofire.networking.operation.finish"; + +typedef void (^AFURLConnectionOperationProgressBlock)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected); +typedef void (^AFURLConnectionOperationAuthenticationChallengeBlock)(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge); +typedef NSCachedURLResponse * (^AFURLConnectionOperationCacheResponseBlock)(NSURLConnection *connection, NSCachedURLResponse *cachedResponse); +typedef NSURLRequest * (^AFURLConnectionOperationRedirectResponseBlock)(NSURLConnection *connection, NSURLRequest *request, NSURLResponse *redirectResponse); +typedef void (^AFURLConnectionOperationBackgroundTaskCleanupBlock)(); + +static inline NSString * AFKeyPathFromOperationState(AFOperationState state) { + switch (state) { + case AFOperationReadyState: + return @"isReady"; + case AFOperationExecutingState: + return @"isExecuting"; + case AFOperationFinishedState: + return @"isFinished"; + case AFOperationPausedState: + return @"isPaused"; + default: { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunreachable-code" + return @"state"; +#pragma clang diagnostic pop + } + } +} + +static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperationState toState, BOOL isCancelled) { + switch (fromState) { + case AFOperationReadyState: + switch (toState) { + case AFOperationPausedState: + case AFOperationExecutingState: + return YES; + case AFOperationFinishedState: + return isCancelled; + default: + return NO; + } + case AFOperationExecutingState: + switch (toState) { + case AFOperationPausedState: + case AFOperationFinishedState: + return YES; + default: + return NO; + } + case AFOperationFinishedState: + return NO; + case AFOperationPausedState: + return toState == AFOperationReadyState; + default: { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunreachable-code" + switch (toState) { + case AFOperationPausedState: + case AFOperationReadyState: + case AFOperationExecutingState: + case AFOperationFinishedState: + return YES; + default: + return NO; + } + } +#pragma clang diagnostic pop + } +} + +@interface AFURLConnectionOperation () +@property (readwrite, nonatomic, assign) AFOperationState state; +@property (readwrite, nonatomic, strong) NSRecursiveLock *lock; +@property (readwrite, nonatomic, strong) NSURLConnection *connection; +@property (readwrite, nonatomic, strong) NSURLRequest *request; +@property (readwrite, nonatomic, strong) NSURLResponse *response; +@property (readwrite, nonatomic, strong) NSError *error; +@property (readwrite, nonatomic, strong) NSData *responseData; +@property (readwrite, nonatomic, copy) NSString *responseString; +@property (readwrite, nonatomic, assign) NSStringEncoding responseStringEncoding; +@property (readwrite, nonatomic, assign) long long totalBytesRead; +@property (readwrite, nonatomic, copy) AFURLConnectionOperationBackgroundTaskCleanupBlock backgroundTaskCleanup; +@property (readwrite, nonatomic, copy) AFURLConnectionOperationProgressBlock uploadProgress; +@property (readwrite, nonatomic, copy) AFURLConnectionOperationProgressBlock downloadProgress; +@property (readwrite, nonatomic, copy) AFURLConnectionOperationAuthenticationChallengeBlock authenticationChallenge; +@property (readwrite, nonatomic, copy) AFURLConnectionOperationCacheResponseBlock cacheResponse; +@property (readwrite, nonatomic, copy) AFURLConnectionOperationRedirectResponseBlock redirectResponse; + +- (void)operationDidStart; +- (void)finish; +- (void)cancelConnection; +@end + +@implementation AFURLConnectionOperation +@synthesize outputStream = _outputStream; + ++ (void)networkRequestThreadEntryPoint:(id)__unused object { + @autoreleasepool { + [[NSThread currentThread] setName:@"AFNetworking"]; + + NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; + [runLoop addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode]; + [runLoop run]; + } +} + ++ (NSThread *)networkRequestThread { + static NSThread *_networkRequestThread = nil; + static dispatch_once_t oncePredicate; + dispatch_once(&oncePredicate, ^{ + _networkRequestThread = [[NSThread alloc] initWithTarget:self selector:@selector(networkRequestThreadEntryPoint:) object:nil]; + [_networkRequestThread start]; + }); + + return _networkRequestThread; +} + +- (instancetype)initWithRequest:(NSURLRequest *)urlRequest { + NSParameterAssert(urlRequest); + + self = [super init]; + if (!self) { + return nil; + } + + _state = AFOperationReadyState; + + self.lock = [[NSRecursiveLock alloc] init]; + self.lock.name = kAFNetworkingLockName; + + self.runLoopModes = [NSSet setWithObject:NSRunLoopCommonModes]; + + self.request = urlRequest; + + self.shouldUseCredentialStorage = YES; + + self.securityPolicy = [AFSecurityPolicy defaultPolicy]; + + return self; +} + +- (instancetype)init NS_UNAVAILABLE +{ + return nil; +} + +- (void)dealloc { + if (_outputStream) { + [_outputStream close]; + _outputStream = nil; + } + + if (_backgroundTaskCleanup) { + _backgroundTaskCleanup(); + } +} + +#pragma mark - + +- (void)setResponseData:(NSData *)responseData { + [self.lock lock]; + if (!responseData) { + _responseData = nil; + } else { + _responseData = [NSData dataWithBytes:responseData.bytes length:responseData.length]; + } + [self.lock unlock]; +} + +- (NSString *)responseString { + [self.lock lock]; + if (!_responseString && self.response && self.responseData) { + self.responseString = [[NSString alloc] initWithData:self.responseData encoding:self.responseStringEncoding]; + } + [self.lock unlock]; + + return _responseString; +} + +- (NSStringEncoding)responseStringEncoding { + [self.lock lock]; + if (!_responseStringEncoding && self.response) { + NSStringEncoding stringEncoding = NSUTF8StringEncoding; + if (self.response.textEncodingName) { + CFStringEncoding IANAEncoding = CFStringConvertIANACharSetNameToEncoding((__bridge CFStringRef)self.response.textEncodingName); + if (IANAEncoding != kCFStringEncodingInvalidId) { + stringEncoding = CFStringConvertEncodingToNSStringEncoding(IANAEncoding); + } + } + + self.responseStringEncoding = stringEncoding; + } + [self.lock unlock]; + + return _responseStringEncoding; +} + +- (NSInputStream *)inputStream { + return self.request.HTTPBodyStream; +} + +- (void)setInputStream:(NSInputStream *)inputStream { + NSMutableURLRequest *mutableRequest = [self.request mutableCopy]; + mutableRequest.HTTPBodyStream = inputStream; + self.request = mutableRequest; +} + +- (NSOutputStream *)outputStream { + if (!_outputStream) { + self.outputStream = [NSOutputStream outputStreamToMemory]; + } + + return _outputStream; +} + +- (void)setOutputStream:(NSOutputStream *)outputStream { + [self.lock lock]; + if (outputStream != _outputStream) { + if (_outputStream) { + [_outputStream close]; + } + + _outputStream = outputStream; + } + [self.lock unlock]; +} + +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) +- (void)setShouldExecuteAsBackgroundTaskWithExpirationHandler:(void (^)(void))handler { + [self.lock lock]; + if (!self.backgroundTaskCleanup) { + UIApplication *application = [UIApplication sharedApplication]; + UIBackgroundTaskIdentifier __block backgroundTaskIdentifier = UIBackgroundTaskInvalid; + __weak __typeof(self)weakSelf = self; + + self.backgroundTaskCleanup = ^(){ + if (backgroundTaskIdentifier != UIBackgroundTaskInvalid) { + [[UIApplication sharedApplication] endBackgroundTask:backgroundTaskIdentifier]; + backgroundTaskIdentifier = UIBackgroundTaskInvalid; + } + }; + + backgroundTaskIdentifier = [application beginBackgroundTaskWithExpirationHandler:^{ + __strong __typeof(weakSelf)strongSelf = weakSelf; + + if (handler) { + handler(); + } + + if (strongSelf) { + [strongSelf cancel]; + strongSelf.backgroundTaskCleanup(); + } + }]; + } + [self.lock unlock]; +} +#endif + +#pragma mark - + +- (void)setState:(AFOperationState)state { + if (!AFStateTransitionIsValid(self.state, state, [self isCancelled])) { + return; + } + + [self.lock lock]; + NSString *oldStateKey = AFKeyPathFromOperationState(self.state); + NSString *newStateKey = AFKeyPathFromOperationState(state); + + [self willChangeValueForKey:newStateKey]; + [self willChangeValueForKey:oldStateKey]; + _state = state; + [self didChangeValueForKey:oldStateKey]; + [self didChangeValueForKey:newStateKey]; + [self.lock unlock]; +} + +- (void)pause { + if ([self isPaused] || [self isFinished] || [self isCancelled]) { + return; + } + + [self.lock lock]; + if ([self isExecuting]) { + [self performSelector:@selector(operationDidPause) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]]; + + dispatch_async(dispatch_get_main_queue(), ^{ + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + [notificationCenter postNotificationName:AFNetworkingOperationDidFinishNotification object:self]; + }); + } + + self.state = AFOperationPausedState; + [self.lock unlock]; +} + +- (void)operationDidPause { + [self.lock lock]; + [self.connection cancel]; + [self.lock unlock]; +} + +- (BOOL)isPaused { + return self.state == AFOperationPausedState; +} + +- (void)resume { + if (![self isPaused]) { + return; + } + + [self.lock lock]; + self.state = AFOperationReadyState; + + [self start]; + [self.lock unlock]; +} + +#pragma mark - + +- (void)setUploadProgressBlock:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))block { + self.uploadProgress = block; +} + +- (void)setDownloadProgressBlock:(void (^)(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead))block { + self.downloadProgress = block; +} + +- (void)setWillSendRequestForAuthenticationChallengeBlock:(void (^)(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge))block { + self.authenticationChallenge = block; +} + +- (void)setCacheResponseBlock:(NSCachedURLResponse * (^)(NSURLConnection *connection, NSCachedURLResponse *cachedResponse))block { + self.cacheResponse = block; +} + +- (void)setRedirectResponseBlock:(NSURLRequest * (^)(NSURLConnection *connection, NSURLRequest *request, NSURLResponse *redirectResponse))block { + self.redirectResponse = block; +} + +#pragma mark - NSOperation + +- (void)setCompletionBlock:(void (^)(void))block { + [self.lock lock]; + if (!block) { + [super setCompletionBlock:nil]; + } else { + __weak __typeof(self)weakSelf = self; + [super setCompletionBlock:^ { + __strong __typeof(weakSelf)strongSelf = weakSelf; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + dispatch_group_t group = strongSelf.completionGroup ?: url_request_operation_completion_group(); + dispatch_queue_t queue = strongSelf.completionQueue ?: dispatch_get_main_queue(); +#pragma clang diagnostic pop + + dispatch_group_async(group, queue, ^{ + block(); + }); + + dispatch_group_notify(group, url_request_operation_completion_queue(), ^{ + [strongSelf setCompletionBlock:nil]; + }); + }]; + } + [self.lock unlock]; +} + +- (BOOL)isReady { + return self.state == AFOperationReadyState && [super isReady]; +} + +- (BOOL)isExecuting { + return self.state == AFOperationExecutingState; +} + +- (BOOL)isFinished { + return self.state == AFOperationFinishedState; +} + +- (BOOL)isConcurrent { + return YES; +} + +- (void)start { + [self.lock lock]; + if ([self isCancelled]) { + [self performSelector:@selector(cancelConnection) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]]; + } else if ([self isReady]) { + self.state = AFOperationExecutingState; + + [self performSelector:@selector(operationDidStart) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]]; + } + [self.lock unlock]; +} + +- (void)operationDidStart { + [self.lock lock]; + if (![self isCancelled]) { + self.connection = [[NSURLConnection alloc] initWithRequest:self.request delegate:self startImmediately:NO]; + + NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; + for (NSString *runLoopMode in self.runLoopModes) { + [self.connection scheduleInRunLoop:runLoop forMode:runLoopMode]; + [self.outputStream scheduleInRunLoop:runLoop forMode:runLoopMode]; + } + + [self.outputStream open]; + [self.connection start]; + } + [self.lock unlock]; + + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingOperationDidStartNotification object:self]; + }); +} + +- (void)finish { + [self.lock lock]; + self.state = AFOperationFinishedState; + [self.lock unlock]; + + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingOperationDidFinishNotification object:self]; + }); +} + +- (void)cancel { + [self.lock lock]; + if (![self isFinished] && ![self isCancelled]) { + [super cancel]; + + if ([self isExecuting]) { + [self performSelector:@selector(cancelConnection) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]]; + } + } + [self.lock unlock]; +} + +- (void)cancelConnection { + NSDictionary *userInfo = nil; + if ([self.request URL]) { + userInfo = @{NSURLErrorFailingURLErrorKey : [self.request URL]}; + } + NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:userInfo]; + + if (![self isFinished]) { + if (self.connection) { + [self.connection cancel]; + [self performSelector:@selector(connection:didFailWithError:) withObject:self.connection withObject:error]; + } else { + // Accommodate race condition where `self.connection` has not yet been set before cancellation + self.error = error; + [self finish]; + } + } +} + +#pragma mark - + ++ (NSArray *)batchOfRequestOperations:(NSArray *)operations + progressBlock:(void (^)(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations))progressBlock + completionBlock:(void (^)(NSArray *operations))completionBlock +{ + if (!operations || [operations count] == 0) { + return @[[NSBlockOperation blockOperationWithBlock:^{ + dispatch_async(dispatch_get_main_queue(), ^{ + if (completionBlock) { + completionBlock(@[]); + } + }); + }]]; + } + + __block dispatch_group_t group = dispatch_group_create(); + NSBlockOperation *batchedOperation = [NSBlockOperation blockOperationWithBlock:^{ + dispatch_group_notify(group, dispatch_get_main_queue(), ^{ + if (completionBlock) { + completionBlock(operations); + } + }); + }]; + + for (AFURLConnectionOperation *operation in operations) { + operation.completionGroup = group; + void (^originalCompletionBlock)(void) = [operation.completionBlock copy]; + __weak __typeof(operation)weakOperation = operation; + operation.completionBlock = ^{ + __strong __typeof(weakOperation)strongOperation = weakOperation; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + dispatch_queue_t queue = strongOperation.completionQueue ?: dispatch_get_main_queue(); +#pragma clang diagnostic pop + dispatch_group_async(group, queue, ^{ + if (originalCompletionBlock) { + originalCompletionBlock(); + } + + NSUInteger numberOfFinishedOperations = [[operations indexesOfObjectsPassingTest:^BOOL(id op, NSUInteger __unused idx, BOOL __unused *stop) { + return [op isFinished]; + }] count]; + + if (progressBlock) { + progressBlock(numberOfFinishedOperations, [operations count]); + } + + dispatch_group_leave(group); + }); + }; + + dispatch_group_enter(group); + [batchedOperation addDependency:operation]; + } + + return [operations arrayByAddingObject:batchedOperation]; +} + +#pragma mark - NSObject + +- (NSString *)description { + [self.lock lock]; + NSString *description = [NSString stringWithFormat:@"<%@: %p, state: %@, cancelled: %@ request: %@, response: %@>", NSStringFromClass([self class]), self, AFKeyPathFromOperationState(self.state), ([self isCancelled] ? @"YES" : @"NO"), self.request, self.response]; + [self.lock unlock]; + return description; +} + +#pragma mark - NSURLConnectionDelegate + +- (void)connection:(NSURLConnection *)connection +willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge +{ + if (self.authenticationChallenge) { + self.authenticationChallenge(connection, challenge); + return; + } + + if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { + if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:challenge.protectionSpace.host]) { + NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; + [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge]; + } else { + [[challenge sender] cancelAuthenticationChallenge:challenge]; + } + } else { + if ([challenge previousFailureCount] == 0) { + if (self.credential) { + [[challenge sender] useCredential:self.credential forAuthenticationChallenge:challenge]; + } else { + [[challenge sender] continueWithoutCredentialForAuthenticationChallenge:challenge]; + } + } else { + [[challenge sender] continueWithoutCredentialForAuthenticationChallenge:challenge]; + } + } +} + +- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection __unused *)connection { + return self.shouldUseCredentialStorage; +} + +- (NSURLRequest *)connection:(NSURLConnection *)connection + willSendRequest:(NSURLRequest *)request + redirectResponse:(NSURLResponse *)redirectResponse +{ + if (self.redirectResponse) { + return self.redirectResponse(connection, request, redirectResponse); + } else { + return request; + } +} + +- (void)connection:(NSURLConnection __unused *)connection + didSendBodyData:(NSInteger)bytesWritten + totalBytesWritten:(NSInteger)totalBytesWritten +totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite +{ + dispatch_async(dispatch_get_main_queue(), ^{ + if (self.uploadProgress) { + self.uploadProgress((NSUInteger)bytesWritten, totalBytesWritten, totalBytesExpectedToWrite); + } + }); +} + +- (void)connection:(NSURLConnection __unused *)connection +didReceiveResponse:(NSURLResponse *)response +{ + self.response = response; +} + +- (void)connection:(NSURLConnection __unused *)connection + didReceiveData:(NSData *)data +{ + NSUInteger length = [data length]; + while (YES) { + NSInteger totalNumberOfBytesWritten = 0; + if ([self.outputStream hasSpaceAvailable]) { + const uint8_t *dataBuffer = (uint8_t *)[data bytes]; + + NSInteger numberOfBytesWritten = 0; + while (totalNumberOfBytesWritten < (NSInteger)length) { + numberOfBytesWritten = [self.outputStream write:&dataBuffer[(NSUInteger)totalNumberOfBytesWritten] maxLength:(length - (NSUInteger)totalNumberOfBytesWritten)]; + if (numberOfBytesWritten == -1) { + break; + } + + totalNumberOfBytesWritten += numberOfBytesWritten; + } + + break; + } else { + [self.connection cancel]; + if (self.outputStream.streamError) { + [self performSelector:@selector(connection:didFailWithError:) withObject:self.connection withObject:self.outputStream.streamError]; + } + return; + } + } + + dispatch_async(dispatch_get_main_queue(), ^{ + self.totalBytesRead += (long long)length; + + if (self.downloadProgress) { + self.downloadProgress(length, self.totalBytesRead, self.response.expectedContentLength); + } + }); +} + +- (void)connectionDidFinishLoading:(NSURLConnection __unused *)connection { + self.responseData = [self.outputStream propertyForKey:NSStreamDataWrittenToMemoryStreamKey]; + + [self.outputStream close]; + if (self.responseData) { + self.outputStream = nil; + } + + self.connection = nil; + + [self finish]; +} + +- (void)connection:(NSURLConnection __unused *)connection + didFailWithError:(NSError *)error +{ + self.error = error; + + [self.outputStream close]; + if (self.responseData) { + self.outputStream = nil; + } + + self.connection = nil; + + [self finish]; +} + +- (NSCachedURLResponse *)connection:(NSURLConnection *)connection + willCacheResponse:(NSCachedURLResponse *)cachedResponse +{ + if (self.cacheResponse) { + return self.cacheResponse(connection, cachedResponse); + } else { + if ([self isCancelled]) { + return nil; + } + + return cachedResponse; + } +} + +#pragma mark - NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (id)initWithCoder:(NSCoder *)decoder { + NSURLRequest *request = [decoder decodeObjectOfClass:[NSURLRequest class] forKey:NSStringFromSelector(@selector(request))]; + + self = [self initWithRequest:request]; + if (!self) { + return nil; + } + + self.state = (AFOperationState)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(state))] integerValue]; + self.response = [decoder decodeObjectOfClass:[NSHTTPURLResponse class] forKey:NSStringFromSelector(@selector(response))]; + self.error = [decoder decodeObjectOfClass:[NSError class] forKey:NSStringFromSelector(@selector(error))]; + self.responseData = [decoder decodeObjectOfClass:[NSData class] forKey:NSStringFromSelector(@selector(responseData))]; + self.totalBytesRead = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(totalBytesRead))] longLongValue]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [self pause]; + + [coder encodeObject:self.request forKey:NSStringFromSelector(@selector(request))]; + + switch (self.state) { + case AFOperationExecutingState: + case AFOperationPausedState: + [coder encodeInteger:AFOperationReadyState forKey:NSStringFromSelector(@selector(state))]; + break; + default: + [coder encodeInteger:self.state forKey:NSStringFromSelector(@selector(state))]; + break; + } + + [coder encodeObject:self.response forKey:NSStringFromSelector(@selector(response))]; + [coder encodeObject:self.error forKey:NSStringFromSelector(@selector(error))]; + [coder encodeObject:self.responseData forKey:NSStringFromSelector(@selector(responseData))]; + [coder encodeInt64:self.totalBytesRead forKey:NSStringFromSelector(@selector(totalBytesRead))]; +} + +#pragma mark - NSCopying + +- (id)copyWithZone:(NSZone *)zone { + AFURLConnectionOperation *operation = [(AFURLConnectionOperation *)[[self class] allocWithZone:zone] initWithRequest:self.request]; + + operation.uploadProgress = self.uploadProgress; + operation.downloadProgress = self.downloadProgress; + operation.authenticationChallenge = self.authenticationChallenge; + operation.cacheResponse = self.cacheResponse; + operation.redirectResponse = self.redirectResponse; + operation.completionQueue = self.completionQueue; + operation.completionGroup = self.completionGroup; + + return operation; +} + +@end diff --git a/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h new file mode 100755 index 0000000..15ced1d --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h @@ -0,0 +1,476 @@ +// 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 +#if TARGET_OS_IOS +#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 +#ifdef NS_SWIFT_NOTHROW +NS_SWIFT_NOTHROW +#endif +; +@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; + +/** + @deprecated This method has been deprecated. Use -setValue:forHTTPHeaderField: instead. + */ +- (void)setAuthorizationHeaderFieldWithToken:(NSString *)token DEPRECATED_ATTRIBUTE; + + +/** + 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 +///------------------------------- + +/** + @deprecated This method has been deprecated. Use -requestWithMethod:URLString:parameters:error: instead. + */ +- (NSMutableURLRequest *)requestWithMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(id)parameters DEPRECATED_ATTRIBUTE; + +/** + 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; + +/** + @deprecated This method has been deprecated. Use -multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:error: instead. + */ +- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(NSDictionary *)parameters + constructingBodyWithBlock:(void (^)(id formData))block DEPRECATED_ATTRIBUTE; + +/** + 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/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m new file mode 100755 index 0000000..7e22454 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m @@ -0,0 +1,1428 @@ +// 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 __IPHONE_OS_VERSION_MIN_REQUIRED +#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); + +static NSString * AFBase64EncodedStringFromString(NSString *string) { + NSData *data = [NSData dataWithBytes:[string UTF8String] length:[string lengthOfBytesUsingEncoding:NSUTF8StringEncoding]]; + NSUInteger length = [data length]; + NSMutableData *mutableData = [NSMutableData dataWithLength:((length + 2) / 3) * 4]; + + uint8_t *input = (uint8_t *)[data bytes]; + uint8_t *output = (uint8_t *)[mutableData mutableBytes]; + + for (NSUInteger i = 0; i < length; i += 3) { + NSUInteger value = 0; + for (NSUInteger j = i; j < (i + 3); j++) { + value <<= 8; + if (j < length) { + value |= (0xFF & input[j]); + } + } + + static uint8_t const kAFBase64EncodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + NSUInteger idx = (i / 3) * 4; + output[idx + 0] = kAFBase64EncodingTable[(value >> 18) & 0x3F]; + output[idx + 1] = kAFBase64EncodingTable[(value >> 12) & 0x3F]; + output[idx + 2] = (i + 1) < length ? kAFBase64EncodingTable[(value >> 6) & 0x3F] : '='; + output[idx + 3] = (i + 2) < length ? kAFBase64EncodingTable[(value >> 0) & 0x3F] : '='; + } + + return [[NSString alloc] initWithData:mutableData encoding:NSASCIIStringEncoding]; +} + +/** + 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; + +- (id)initWithField:(id)field value:(id)value; + +- (NSString *)URLEncodedStringValue; +@end + +@implementation AFQueryStringPair + +- (id)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 +{ + NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password]; + [self setValue:[NSString stringWithFormat:@"Basic %@", AFBase64EncodedStringFromString(basicAuthCredentials)] forHTTPHeaderField:@"Authorization"]; +} + +- (void)setAuthorizationHeaderFieldWithToken:(NSString *)token { + [self setValue:[NSString stringWithFormat:@"Token token=\"%@\"", token] 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 +{ + return [self requestWithMethod:method URLString:URLString parameters:parameters error:nil]; +} + +- (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 +{ + return [self multipartFormRequestWithMethod:method URLString:URLString parameters:parameters constructingBodyWithBlock:block error:nil]; +} + +- (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; +} + +- (id)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 + +- (id)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) { +#ifdef __UTTYPE__ + 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; + } +#else +#pragma unused (extension) + return @"application/octet-stream"; +#endif +} + +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; + +- (id)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 + +- (id)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 + +- (id)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 = length - (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 + +-(id)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 + +- (id)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 + +- (id)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 + +- (id)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 + +- (id)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 + +- (id)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 + +- (id)copyWithZone:(NSZone *)zone { + AFPropertyListRequestSerializer *serializer = [super copyWithZone:zone]; + serializer.format = self.format; + serializer.writeOptions = self.writeOptions; + + return serializer; +} + +@end diff --git a/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h new file mode 100755 index 0000000..1578b78 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h @@ -0,0 +1,315 @@ +// 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 +#ifdef NS_SWIFT_NOTHROW +NS_SWIFT_NOTHROW +#endif +; + +@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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) +/** + 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/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m new file mode 100755 index 0000000..cfa8287 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m @@ -0,0 +1,825 @@ +// 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" + +#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; +} + +- (id)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 + +- (id)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 + +- (id)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 + +- (id)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 + +- (id)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 + +- (id)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 + +- (id)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 + +- (id)copyWithZone:(NSZone *)zone { + AFPropertyListResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + serializer.format = self.format; + serializer.readOptions = self.readOptions; + + return serializer; +} + +@end + +#pragma mark - + +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) +#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 + 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + if (self.automaticallyInflatesResponseImage) { + return AFInflatedImageFromResponseWithDataAtScale((NSHTTPURLResponse *)response, data, self.imageScale); + } else { + return AFImageWithDataAtScale(data, self.imageScale); + } +#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) + // 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 + +- (id)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (!self) { + return nil; + } + +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + [coder encodeObject:@(self.imageScale) forKey:NSStringFromSelector(@selector(imageScale))]; + [coder encodeBool:self.automaticallyInflatesResponseImage forKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))]; +#endif +} + +#pragma mark - NSCopying + +- (id)copyWithZone:(NSZone *)zone { + AFImageResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + 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 + +- (id)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 + +- (id)copyWithZone:(NSZone *)zone { + AFCompoundResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; + serializer.responseSerializers = self.responseSerializers; + + return serializer; +} + +@end diff --git a/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h new file mode 100755 index 0000000..4498c89 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h @@ -0,0 +1,554 @@ +// 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 + +#ifndef NS_DESIGNATED_INITIALIZER +#if __has_attribute(objc_designated_initializer) +#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +#else +#define NS_DESIGNATED_INITIALIZER +#endif +#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 + +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) || TARGET_OS_WATCH + +@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 request operations 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. + */ +#if OS_OBJECT_USE_OBJC +@property (nonatomic, strong, nullable) dispatch_queue_t completionQueue; +#else +@property (nonatomic, assign, nullable) dispatch_queue_t completionQueue; +#endif + +/** + The dispatch group for `completionBlock`. If `NULL` (default), a private dispatch group is used. + */ +#if OS_OBJECT_USE_OBJC +@property (nonatomic, strong, nullable) dispatch_group_t completionGroup; +#else +@property (nonatomic, assign, nullable) dispatch_group_t completionGroup; +#endif + +///--------------------------------- +/// @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; + +///--------------------------- +/// @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 progress object monitoring the current upload progress. + @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:(NSProgress * __nullable __autoreleasing * __nullable)progress + 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 progress object monitoring the current upload progress. + @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:(NSProgress * __nullable __autoreleasing * __nullable)progress + 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 progress object monitoring the current upload progress. + @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:(NSProgress * __nullable __autoreleasing * __nullable)progress + 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 progress object monitoring the current download progress. + @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:(NSProgress * __nullable __autoreleasing * __nullable)progress + 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 progress object monitoring the current download progress. + @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:(NSProgress * __nullable __autoreleasing * __nullable)progress + 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 uploadTask The session upload 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:(NSURLSessionUploadTask *)uploadTask; + +/** + Returns the download progress of the specified task. + + @param downloadTask The session download 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:(NSURLSessionDownloadTask *)downloadTask; + +///----------------------------------------- +/// @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 + +#endif + +///-------------------- +/// @name Notifications +///-------------------- + +/** + Posted when a task begins executing. + + @deprecated Use `AFNetworkingTaskDidResumeNotification` instead. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidStartNotification DEPRECATED_ATTRIBUTE; + +/** + 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. + + @deprecated Use `AFNetworkingTaskDidCompleteNotification` instead. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidFinishNotification DEPRECATED_ATTRIBUTE; + +/** + 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 `AFNetworkingTaskDidFinishNotification` if response data exists for the task. + + @deprecated Use `AFNetworkingTaskDidCompleteResponseDataKey` instead. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidFinishResponseDataKey DEPRECATED_ATTRIBUTE; + +/** + The raw response data of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` 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 `AFNetworkingTaskDidFinishNotification` if the response was serialized. + + @deprecated Use `AFNetworkingTaskDidCompleteSerializedResponseKey` instead. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidFinishSerializedResponseKey DEPRECATED_ATTRIBUTE; + +/** + The serialized response object of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` 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 `AFNetworkingTaskDidFinishNotification` if the task has an associated response serializer. + + @deprecated Use `AFNetworkingTaskDidCompleteResponseSerializerKey` instead. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidFinishResponseSerializerKey DEPRECATED_ATTRIBUTE; + +/** + The response serializer used to serialize the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` 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 `AFNetworkingTaskDidFinishNotification` if an the response data has been stored directly to disk. + + @deprecated Use `AFNetworkingTaskDidCompleteAssetPathKey` instead. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidFinishAssetPathKey DEPRECATED_ATTRIBUTE; + +/** + The file path associated with the download task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` 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 `AFNetworkingTaskDidFinishNotification` if an error exists. + + @deprecated Use `AFNetworkingTaskDidCompleteErrorKey` instead. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidFinishErrorKey DEPRECATED_ATTRIBUTE; + +/** + Any error associated with the task, or the serialization of the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if an error exists. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteErrorKey; + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m new file mode 100755 index 0000000..8ec0f08 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m @@ -0,0 +1,1174 @@ +// 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 + +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) + +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 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 AFNetworkingTaskDidStartNotification = @"com.alamofire.networking.task.resume"; // Deprecated +NSString * const AFNetworkingTaskDidFinishNotification = @"com.alamofire.networking.task.complete"; // Deprecated + +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"; + +NSString * const AFNetworkingTaskDidFinishSerializedResponseKey = @"com.alamofire.networking.task.complete.serializedresponse"; // Deprecated +NSString * const AFNetworkingTaskDidFinishResponseSerializerKey = @"com.alamofire.networking.task.complete.responseserializer"; // Deprecated +NSString * const AFNetworkingTaskDidFinishResponseDataKey = @"com.alamofire.networking.complete.finish.responsedata"; // Deprecated +NSString * const AFNetworkingTaskDidFinishErrorKey = @"com.alamofire.networking.task.complete.error"; // Deprecated +NSString * const AFNetworkingTaskDidFinishAssetPathKey = @"com.alamofire.networking.task.complete.assetpath"; // Deprecated + +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 (^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 *progress; +@property (nonatomic, copy) NSURL *downloadFileURL; +@property (nonatomic, copy) AFURLSessionDownloadTaskDidFinishDownloadingBlock downloadTaskDidFinishDownloading; +@property (nonatomic, copy) AFURLSessionTaskCompletionHandler completionHandler; +@end + +@implementation AFURLSessionManagerTaskDelegate + +- (instancetype)init { + self = [super init]; + if (!self) { + return nil; + } + + self.mutableData = [NSMutableData data]; + + self.progress = [NSProgress progressWithTotalUnitCount:0]; + + return self; +} + +#pragma mark - NSURLSessionTaskDelegate + +- (void)URLSession:(__unused NSURLSession *)session + task:(__unused NSURLSessionTask *)task + didSendBodyData:(__unused int64_t)bytesSent + totalBytesSent:(int64_t)totalBytesSent +totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend +{ + self.progress.totalUnitCount = totalBytesExpectedToSend; + self.progress.completedUnitCount = totalBytesSent; +} + +- (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]; + } + } + } +} + +- (void)URLSession:(__unused NSURLSession *)session + downloadTask:(__unused NSURLSessionDownloadTask *)downloadTask + didWriteData:(__unused int64_t)bytesWritten + totalBytesWritten:(int64_t)totalBytesWritten +totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite +{ + self.progress.totalUnitCount = totalBytesExpectedToWrite; + self.progress.completedUnitCount = totalBytesWritten; +} + +- (void)URLSession:(__unused NSURLSession *)session + downloadTask:(__unused NSURLSessionDownloadTask *)downloadTask + didResumeAtOffset:(int64_t)fileOffset +expectedTotalBytes:(int64_t)expectedTotalBytes { + self.progress.totalUnitCount = expectedTotalBytes; + self.progress.completedUnitCount = fileOffset; +} + +@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 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]; + } + }]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidResume:) name:AFNSURLSessionTaskDidResumeNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidSuspend:) name:AFNSURLSessionTaskDidSuspendNotification object: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; + [self.lock unlock]; +} + +- (void)addDelegateForDataTask:(NSURLSessionDataTask *)dataTask + 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]; +} + +- (void)addDelegateForUploadTask:(NSURLSessionUploadTask *)uploadTask + progress:(NSProgress * __autoreleasing *)progress + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init]; + delegate.manager = self; + delegate.completionHandler = completionHandler; + + int64_t totalUnitCount = uploadTask.countOfBytesExpectedToSend; + if(totalUnitCount == NSURLSessionTransferSizeUnknown) { + NSString *contentLength = [uploadTask.originalRequest valueForHTTPHeaderField:@"Content-Length"]; + if(contentLength) { + totalUnitCount = (int64_t)[contentLength longLongValue]; + } + } + + if (delegate.progress) { + delegate.progress.totalUnitCount = totalUnitCount; + } else { + delegate.progress = [NSProgress progressWithTotalUnitCount:totalUnitCount]; + } + + delegate.progress.pausingHandler = ^{ + [uploadTask suspend]; + }; + delegate.progress.cancellationHandler = ^{ + [uploadTask cancel]; + }; + + if (progress) { + *progress = delegate.progress; + } + + uploadTask.taskDescription = self.taskDescriptionForSessionTasks; + + [self setDelegate:delegate forTask:uploadTask]; +} + +- (void)addDelegateForDownloadTask:(NSURLSessionDownloadTask *)downloadTask + progress:(NSProgress * __autoreleasing *)progress + 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); + }; + } + + if (progress) { + *progress = delegate.progress; + } + + downloadTask.taskDescription = self.taskDescriptionForSessionTasks; + + [self setDelegate:delegate forTask:downloadTask]; +} + +- (void)removeDelegateForTask:(NSURLSessionTask *)task { + NSParameterAssert(task); + + [self.lock lock]; + [self.mutableTaskDelegatesKeyedByTaskIdentifier removeObjectForKey:@(task.taskIdentifier)]; + [self.lock unlock]; +} + +- (void)removeAllDelegates { + [self.lock lock]; + [self.mutableTaskDelegatesKeyedByTaskIdentifier removeAllObjects]; + [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 - + +- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + __block NSURLSessionDataTask *dataTask = nil; + dispatch_sync(url_session_manager_creation_queue(), ^{ + dataTask = [self.session dataTaskWithRequest:request]; + }); + + [self addDelegateForDataTask:dataTask completionHandler:completionHandler]; + + return dataTask; +} + +#pragma mark - + +- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request + fromFile:(NSURL *)fileURL + progress:(NSProgress * __autoreleasing *)progress + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + __block NSURLSessionUploadTask *uploadTask = nil; + dispatch_sync(url_session_manager_creation_queue(), ^{ + 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:progress completionHandler:completionHandler]; + + return uploadTask; +} + +- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request + fromData:(NSData *)bodyData + progress:(NSProgress * __autoreleasing *)progress + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + __block NSURLSessionUploadTask *uploadTask = nil; + dispatch_sync(url_session_manager_creation_queue(), ^{ + uploadTask = [self.session uploadTaskWithRequest:request fromData:bodyData]; + }); + + [self addDelegateForUploadTask:uploadTask progress:progress completionHandler:completionHandler]; + + return uploadTask; +} + +- (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request + progress:(NSProgress * __autoreleasing *)progress + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler +{ + __block NSURLSessionUploadTask *uploadTask = nil; + dispatch_sync(url_session_manager_creation_queue(), ^{ + uploadTask = [self.session uploadTaskWithStreamedRequest:request]; + }); + + [self addDelegateForUploadTask:uploadTask progress:progress completionHandler:completionHandler]; + + return uploadTask; +} + +#pragma mark - + +- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request + progress:(NSProgress * __autoreleasing *)progress + destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination + completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler +{ + __block NSURLSessionDownloadTask *downloadTask = nil; + dispatch_sync(url_session_manager_creation_queue(), ^{ + downloadTask = [self.session downloadTaskWithRequest:request]; + }); + + [self addDelegateForDownloadTask:downloadTask progress:progress destination:destination completionHandler:completionHandler]; + + return downloadTask; +} + +- (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData + progress:(NSProgress * __autoreleasing *)progress + destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination + completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler +{ + __block NSURLSessionDownloadTask *downloadTask = nil; + dispatch_sync(url_session_manager_creation_queue(), ^{ + downloadTask = [self.session downloadTaskWithResumeData:resumeData]; + }); + + [self addDelegateForDownloadTask:downloadTask progress:progress destination:destination completionHandler:completionHandler]; + + return downloadTask; +} + +#pragma mark - + +- (NSProgress *)uploadProgressForTask:(NSURLSessionUploadTask *)uploadTask { + return [[self delegateForTask:uploadTask] progress]; +} + +- (NSProgress *)downloadProgressForTask:(NSURLSessionDownloadTask *)downloadTask { + return [[self delegateForTask:downloadTask] progress]; +} + +#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); + } + + [self removeAllDelegates]; + [[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 = NSURLSessionAuthChallengeCancelAuthenticationChallenge; + } + } 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 = NSURLSessionAuthChallengeCancelAuthenticationChallenge; + } + } 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]; + } + } + + AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task]; + [delegate URLSession:session task:task didSendBodyData:bytesSent totalBytesSent:totalBytesSent totalBytesExpectedToSend:totalUnitCount]; + + 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 +{ + AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:downloadTask]; + [delegate URLSession:session downloadTask:downloadTask didWriteData:bytesWritten totalBytesWritten:totalBytesWritten totalBytesExpectedToWrite: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 +{ + AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:downloadTask]; + [delegate URLSession:session downloadTask:downloadTask didResumeAtOffset:fileOffset expectedTotalBytes:expectedTotalBytes]; + + if (self.downloadTaskDidResume) { + self.downloadTaskDidResume(session, downloadTask, fileOffset, expectedTotalBytes); + } +} + +#pragma mark - NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (id)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 + +- (id)copyWithZone:(NSZone *)zone { + return [[[self class] allocWithZone:zone] initWithSessionConfiguration:self.session.configuration]; +} + +@end + +#endif diff --git a/dayPhoto/Pods/AFNetworking/LICENSE b/dayPhoto/Pods/AFNetworking/LICENSE new file mode 100755 index 0000000..91f125b --- /dev/null +++ b/dayPhoto/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/dayPhoto/Pods/AFNetworking/README.md b/dayPhoto/Pods/AFNetworking/README.md new file mode 100755 index 0000000..87ec4b2 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/README.md @@ -0,0 +1,394 @@ +

+ AFNetworking +

+ +[![Build Status](https://travis-ci.org/AFNetworking/AFNetworking.svg)](https://travis-ci.org/AFNetworking/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 2.0 Migration Guide](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-2.0-Migration-Guide) for an overview of the architectural changes from 1.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 with CocoaPods + +[CocoaPods](https://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). + +#### Podfile + +```ruby +platform :ios, '7.0' +pod "AFNetworking", "~> 2.0" +``` + +## Requirements + +| AFNetworking Version | Minimum iOS Target | Minimum OS X Target | Notes | +|:--------------------:|:---------------------------:|:----------------------------:|:-------------------------------------------------------------------------:| +| 2.x | iOS 6 | OS X 10.8 | Xcode 5 is required. `NSURLSession` subspec requires iOS 7 or OS X 10.9. | +| [1.x](https://github.com/AFNetworking/AFNetworking/tree/1.x) | iOS 5 | Mac OS X 10.7 | | +| [0.10.x](https://github.com/AFNetworking/AFNetworking/tree/0.10.x) | iOS 4 | Mac OS X 10.6 | | + +(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 + +### NSURLConnection + +- `AFURLConnectionOperation` +- `AFHTTPRequestOperation` +- `AFHTTPRequestOperationManager` + +### NSURLSession _(iOS 7 / Mac OS X 10.9)_ + +- `AFURLSessionManager` +- `AFHTTPSessionManager` + +### Serialization + +* `` + - `AFHTTPRequestSerializer` + - `AFJSONRequestSerializer` + - `AFPropertyListRequestSerializer` +* `` + - `AFHTTPResponseSerializer` + - `AFJSONResponseSerializer` + - `AFXMLParserResponseSerializer` + - `AFXMLDocumentResponseSerializer` _(Mac OS X)_ + - `AFPropertyListResponseSerializer` + - `AFImageResponseSerializer` + - `AFCompoundResponseSerializer` + +### Additional Functionality + +- `AFSecurityPolicy` +- `AFNetworkReachabilityManager` + +## Usage + +### HTTP Request Operation Manager + +`AFHTTPRequestOperationManager` encapsulates the common patterns of communicating with a web application over HTTP, including request creation, response serialization, network reachability monitoring, and security, as well as request operation management. + +#### `GET` Request + +```objective-c +AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; +[manager GET:@"http://example.com/resources.json" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) { + NSLog(@"JSON: %@", responseObject); +} failure:^(AFHTTPRequestOperation *operation, NSError *error) { + NSLog(@"Error: %@", error); +}]; +``` + +#### `POST` URL-Form-Encoded Request + +```objective-c +AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; +NSDictionary *parameters = @{@"foo": @"bar"}; +[manager POST:@"http://example.com/resources.json" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) { + NSLog(@"JSON: %@", responseObject); +} failure:^(AFHTTPRequestOperation *operation, NSError *error) { + NSLog(@"Error: %@", error); +}]; +``` + +#### `POST` Multi-Part Request + +```objective-c +AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; +NSDictionary *parameters = @{@"foo": @"bar"}; +NSURL *filePath = [NSURL fileURLWithPath:@"file://path/to/image.png"]; +[manager POST:@"http://example.com/resources.json" parameters:parameters constructingBodyWithBlock:^(id formData) { + [formData appendPartWithFileURL:filePath name:@"image" error:nil]; +} success:^(AFHTTPRequestOperation *operation, id responseObject) { + NSLog(@"Success: %@", responseObject); +} failure:^(AFHTTPRequestOperation *operation, NSError *error) { + NSLog(@"Error: %@", error); +}]; +``` + +--- + +### 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]]; +NSProgress *progress = nil; + +NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithStreamedRequest:request progress:&progress completionHandler:^(NSURLResponse *response, id responseObject, NSError *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]; +``` + +#### HTTP Manager Reachability + +```objective-c +NSURL *baseURL = [NSURL URLWithString:@"http://example.com/"]; +AFHTTPRequestOperationManager *manager = [[AFHTTPRequestOperationManager alloc] initWithBaseURL:baseURL]; + +NSOperationQueue *operationQueue = manager.operationQueue; +[manager.reachabilityManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { + switch (status) { + case AFNetworkReachabilityStatusReachableViaWWAN: + case AFNetworkReachabilityStatusReachableViaWiFi: + [operationQueue setSuspended:NO]; + break; + case AFNetworkReachabilityStatusNotReachable: + default: + [operationQueue setSuspended:YES]; + break; + } +}]; + +[manager.reachabilityManager 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 +AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; +manager.securityPolicy.allowInvalidCertificates = YES; // not recommended for production +``` + +--- + +### AFHTTPRequestOperation + +`AFHTTPRequestOperation` is a subclass of `AFURLConnectionOperation` for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request. + +Although `AFHTTPRequestOperationManager` is usually the best way to go about making requests, `AFHTTPRequestOperation` can be used by itself. + +#### `GET` with `AFHTTPRequestOperation` + +```objective-c +NSURL *URL = [NSURL URLWithString:@"http://example.com/resources/123.json"]; +NSURLRequest *request = [NSURLRequest requestWithURL:URL]; +AFHTTPRequestOperation *op = [[AFHTTPRequestOperation alloc] initWithRequest:request]; +op.responseSerializer = [AFJSONResponseSerializer serializer]; +[op setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { + NSLog(@"JSON: %@", responseObject); +} failure:^(AFHTTPRequestOperation *operation, NSError *error) { + NSLog(@"Error: %@", error); +}]; +[[NSOperationQueue mainQueue] addOperation:op]; +``` + +#### Batch of Operations + +```objective-c +NSMutableArray *mutableOperations = [NSMutableArray array]; +for (NSURL *fileURL in filesToUpload) { + NSURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:@"http://example.com/upload" parameters:nil constructingBodyWithBlock:^(id formData) { + [formData appendPartWithFileURL:fileURL name:@"images[]" error:nil]; + }]; + + AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; + + [mutableOperations addObject:operation]; +} + +NSArray *operations = [AFURLConnectionOperation batchOfRequestOperations:@[...] progressBlock:^(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations) { + NSLog(@"%lu of %lu complete", numberOfFinishedOperations, totalNumberOfOperations); +} completionBlock:^(NSArray *operations) { + NSLog(@"All operations in batch complete"); +}]; +[[NSOperationQueue mainQueue] addOperations:operations waitUntilFinished:NO]; +``` + +## Unit Tests + +AFNetworking includes a suite of unit tests within the Tests subdirectory. In order to run the unit tests, you must install the testing dependencies via [CocoaPods](https://cocoapods.org/): + + $ cd Tests + $ pod install + +Once testing dependencies are installed, you can execute the test suite via the 'iOS Tests' and 'OS X Tests' schemes within Xcode. + +### Running Tests from the Command Line + +Tests can also be run from the command line or within a continuous integration environment. The [`xcpretty`](https://github.com/supermarin/xcpretty) utility needs to be installed before running the tests from the command line: + + $ gem install xcpretty + +Once `xcpretty` is installed, you can execute the suite via `rake 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](https://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/graphs/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/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h new file mode 100755 index 0000000..3c7649b --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h @@ -0,0 +1,80 @@ +// 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#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 network request operation 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 is currently displayed in the status bar. + */ +@property (readonly, nonatomic, assign) BOOL isNetworkActivityIndicatorVisible; + +/** + 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; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m new file mode 100755 index 0000000..cf13180 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m @@ -0,0 +1,170 @@ +// 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 defined(__IPHONE_OS_VERSION_MAX_ALLOWED) + +#import "AFHTTPRequestOperation.h" + +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 +#import "AFURLSessionManager.h" +#endif + +static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.17; + +static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notification) { + if ([[notification object] isKindOfClass:[AFURLConnectionOperation class]]) { + return [(AFURLConnectionOperation *)[notification object] request]; + } + +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 + if ([[notification object] respondsToSelector:@selector(originalRequest)]) { + return [(NSURLSessionTask *)[notification object] originalRequest]; + } +#endif + + return nil; +} + +@interface AFNetworkActivityIndicatorManager () +@property (readwrite, nonatomic, assign) NSInteger activityCount; +@property (readwrite, nonatomic, strong) NSTimer *activityIndicatorVisibilityTimer; +@property (readonly, nonatomic, getter = isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; + +- (void)updateNetworkActivityIndicatorVisibility; +- (void)updateNetworkActivityIndicatorVisibilityDelayed; +@end + +@implementation AFNetworkActivityIndicatorManager +@dynamic networkActivityIndicatorVisible; + ++ (instancetype)sharedManager { + static AFNetworkActivityIndicatorManager *_sharedManager = nil; + static dispatch_once_t oncePredicate; + dispatch_once(&oncePredicate, ^{ + _sharedManager = [[self alloc] init]; + }); + + return _sharedManager; +} + ++ (NSSet *)keyPathsForValuesAffectingIsNetworkActivityIndicatorVisible { + return [NSSet setWithObject:@"activityCount"]; +} + +- (id)init { + self = [super init]; + if (!self) { + return nil; + } + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingOperationDidStartNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingOperationDidFinishNotification object:nil]; + +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 + [[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]; +#endif + + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + [_activityIndicatorVisibilityTimer invalidate]; +} + +- (void)updateNetworkActivityIndicatorVisibilityDelayed { + if (self.enabled) { + // Delay hiding of activity indicator for a short interval, to avoid flickering + if (![self isNetworkActivityIndicatorVisible]) { + [self.activityIndicatorVisibilityTimer invalidate]; + self.activityIndicatorVisibilityTimer = [NSTimer timerWithTimeInterval:kAFNetworkActivityIndicatorInvisibilityDelay target:self selector:@selector(updateNetworkActivityIndicatorVisibility) userInfo:nil repeats:NO]; + [[NSRunLoop mainRunLoop] addTimer:self.activityIndicatorVisibilityTimer forMode:NSRunLoopCommonModes]; + } else { + [self performSelectorOnMainThread:@selector(updateNetworkActivityIndicatorVisibility) withObject:nil waitUntilDone:NO modes:@[NSRunLoopCommonModes]]; + } + } +} + +- (BOOL)isNetworkActivityIndicatorVisible { + return self.activityCount > 0; +} + +- (void)updateNetworkActivityIndicatorVisibility { + [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:[self isNetworkActivityIndicatorVisible]]; +} + +- (void)setActivityCount:(NSInteger)activityCount { + @synchronized(self) { + _activityCount = activityCount; + } + + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateNetworkActivityIndicatorVisibilityDelayed]; + }); +} + +- (void)incrementActivityCount { + [self willChangeValueForKey:@"activityCount"]; + @synchronized(self) { + _activityCount++; + } + [self didChangeValueForKey:@"activityCount"]; + + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateNetworkActivityIndicatorVisibilityDelayed]; + }); +} + +- (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 updateNetworkActivityIndicatorVisibilityDelayed]; + }); +} + +- (void)networkRequestDidStart:(NSNotification *)notification { + if ([AFNetworkRequestFromNotification(notification) URL]) { + [self incrementActivityCount]; + } +} + +- (void)networkRequestDidFinish:(NSNotification *)notification { + if ([AFNetworkRequestFromNotification(notification) URL]) { + [self decrementActivityCount]; + } +} + +@end + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h new file mode 100755 index 0000000..0c8f9b5 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h @@ -0,0 +1,63 @@ +// 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import + +@class AFURLConnectionOperation; + +/** + 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 request operation or 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. + */ +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +- (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; +#endif + +///--------------------------------------- +/// @name Animating for Request Operations +///--------------------------------------- + +/** + Binds the animating state to the execution state of the specified operation. + + @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. + */ +- (void)setAnimatingWithStateOfOperation:(nullable AFURLConnectionOperation *)operation; + +@end + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m new file mode 100755 index 0000000..dd362b0 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m @@ -0,0 +1,171 @@ +// 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import "AFHTTPRequestOperation.h" + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +#import "AFURLSessionManager.h" +#endif + +@interface AFActivityIndicatorViewNotificationObserver : NSObject +@property (readonly, nonatomic, weak) UIActivityIndicatorView *activityIndicatorView; +- (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView; + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task; +#endif +- (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation; + +@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; +} + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { + [[self af_notificationObserver] setAnimatingWithStateOfTask:task]; +} +#endif + +- (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation { + [[self af_notificationObserver] setAnimatingWithStateOfOperation:operation]; +} + +@end + +@implementation AFActivityIndicatorViewNotificationObserver + +- (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView +{ + self = [super init]; + if (self) { + _activityIndicatorView = activityIndicatorView; + } + return self; +} + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +- (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]; + } + } +} +#endif + +#pragma mark - + +- (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation { + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + + [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil]; + + if (operation) { + if (![operation isFinished]) { + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreceiver-is-weak" +#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" + if ([operation isExecuting]) { + [self.activityIndicatorView startAnimating]; + } else { + [self.activityIndicatorView stopAnimating]; + } +#pragma clang diagnostic pop + + [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingOperationDidStartNotification object:operation]; + [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingOperationDidFinishNotification object:operation]; + } + } +} + +#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]; + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 + [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; +#endif + + [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil]; +} + +@end + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h new file mode 100755 index 0000000..97f5622 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h @@ -0,0 +1,99 @@ +// UIAlertView+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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class AFURLConnectionOperation; + +/** + This category adds methods to the UIKit framework's `UIAlertView` class. The methods in this category provide support for automatically showing an alert if a session task or request operation finishes with an error. Alert title and message are filled from the corresponding `localizedDescription` & `localizedRecoverySuggestion` or `localizedFailureReason` of the error. + */ +@interface UIAlertView (AFNetworking) + +///------------------------------------- +/// @name Showing Alert for Session Task +///------------------------------------- + +/** + Shows an alert view with the error of the specified session task, if any. + + @param task The session task. + @param delegate The alert view delegate. + */ +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 ++ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task + delegate:(nullable id)delegate NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); +#endif + +/** + Shows an alert view with the error of the specified session task, if any, with a custom cancel button title and other button titles. + + @param task The session task. + @param delegate The alert view delegate. + @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title. + @param otherButtonTitles The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see "Temporary Views". Titles of additional buttons to add to the receiver, terminated with `nil`. + */ +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 ++ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task + delegate:(nullable id)delegate + cancelButtonTitle:(nullable NSString *)cancelButtonTitle + otherButtonTitles:(nullable NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); +#endif + +///------------------------------------------ +/// @name Showing Alert for Request Operation +///------------------------------------------ + +/** + Shows an alert view with the error of the specified request operation, if any. + + @param operation The request operation. + @param delegate The alert view delegate. + */ ++ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation + delegate:(nullable id)delegate NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); + +/** + Shows an alert view with the error of the specified request operation, if any, with a custom cancel button title and other button titles. + + @param operation The request operation. + @param delegate The alert view delegate. + @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title. + @param otherButtonTitles The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see "Temporary Views". Titles of additional buttons to add to the receiver, terminated with `nil`. + */ ++ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation + delegate:(nullable id)delegate + cancelButtonTitle:(nullable NSString *)cancelButtonTitle + otherButtonTitles:(nullable NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.m b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.m new file mode 100755 index 0000000..0d1e9e7 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.m @@ -0,0 +1,141 @@ +// UIAlertView+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 "UIAlertView+AFNetworking.h" + +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import "AFURLConnectionOperation.h" + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +#import "AFURLSessionManager.h" +#endif + +static void AFGetAlertViewTitleAndMessageFromError(NSError *error, NSString * __autoreleasing *title, NSString * __autoreleasing *message) { + if (error.localizedDescription && (error.localizedRecoverySuggestion || error.localizedFailureReason)) { + *title = error.localizedDescription; + + if (error.localizedRecoverySuggestion) { + *message = error.localizedRecoverySuggestion; + } else { + *message = error.localizedFailureReason; + } + } else if (error.localizedDescription) { + *title = NSLocalizedStringFromTable(@"Error", @"AFNetworking", @"Fallback Error Description"); + *message = error.localizedDescription; + } else { + *title = NSLocalizedStringFromTable(@"Error", @"AFNetworking", @"Fallback Error Description"); + *message = [NSString stringWithFormat:NSLocalizedStringFromTable(@"%@ Error: %ld", @"AFNetworking", @"Fallback Error Failure Reason Format"), error.domain, (long)error.code]; + } +} + +@implementation UIAlertView (AFNetworking) + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 ++ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task + delegate:(id)delegate +{ + [self showAlertViewForTaskWithErrorOnCompletion:task delegate:delegate cancelButtonTitle:NSLocalizedStringFromTable(@"Dismiss", @"AFNetworking", @"UIAlertView Cancel Button Title") otherButtonTitles:nil, nil]; +} + ++ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task + delegate:(id)delegate + cancelButtonTitle:(NSString *)cancelButtonTitle + otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION +{ + NSMutableArray *mutableOtherTitles = [NSMutableArray array]; + va_list otherButtonTitleList; + va_start(otherButtonTitleList, otherButtonTitles); + { + for (NSString *otherButtonTitle = otherButtonTitles; otherButtonTitle != nil; otherButtonTitle = va_arg(otherButtonTitleList, NSString *)) { + [mutableOtherTitles addObject:otherButtonTitle]; + } + } + va_end(otherButtonTitleList); + + __block __weak id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingTaskDidCompleteNotification object:task queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) { + NSError *error = notification.userInfo[AFNetworkingTaskDidCompleteErrorKey]; + if (error) { + NSString *title, *message; + AFGetAlertViewTitleAndMessageFromError(error, &title, &message); + + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:nil delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:nil, nil]; + for (NSString *otherButtonTitle in mutableOtherTitles) { + [alertView addButtonWithTitle:otherButtonTitle]; + } + [alertView setTitle:title]; + [alertView setMessage:message]; + [alertView show]; + } + + [[NSNotificationCenter defaultCenter] removeObserver:observer]; + }]; +} +#endif + +#pragma mark - + ++ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation + delegate:(id)delegate +{ + [self showAlertViewForRequestOperationWithErrorOnCompletion:operation delegate:delegate cancelButtonTitle:NSLocalizedStringFromTable(@"Dismiss", @"AFNetworking", @"UIAlertView Cancel Button Title") otherButtonTitles:nil, nil]; +} + ++ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation + delegate:(id)delegate + cancelButtonTitle:(NSString *)cancelButtonTitle + otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION +{ + NSMutableArray *mutableOtherTitles = [NSMutableArray array]; + va_list otherButtonTitleList; + va_start(otherButtonTitleList, otherButtonTitles); + { + for (NSString *otherButtonTitle = otherButtonTitles; otherButtonTitle != nil; otherButtonTitle = va_arg(otherButtonTitleList, NSString *)) { + [mutableOtherTitles addObject:otherButtonTitle]; + } + } + va_end(otherButtonTitleList); + + __block __weak id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingOperationDidFinishNotification object:operation queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) { + + if (notification.object && [notification.object isKindOfClass:[AFURLConnectionOperation class]]) { + NSError *error = [(AFURLConnectionOperation *)notification.object error]; + if (error) { + NSString *title, *message; + AFGetAlertViewTitleAndMessageFromError(error, &title, &message); + + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:nil delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:nil, nil]; + for (NSString *otherButtonTitle in mutableOtherTitles) { + [alertView addButtonWithTitle:otherButtonTitle]; + } + [alertView setTitle:title]; + [alertView setMessage:message]; + [alertView show]; + } + } + + [[NSNotificationCenter defaultCenter] removeObserver:observer]; + }]; +} + +@end + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h new file mode 100755 index 0000000..7289bdb --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h @@ -0,0 +1,186 @@ +// 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol AFURLResponseSerialization, AFImageCache; + +/** + 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 Image Cache +///---------------------------- + +/** + The image cache used to improve image loading performance on scroll views. By default, `UIButton` will use the `sharedImageCache` of `UIImageView`. + */ ++ (id )sharedImageCache; + +/** + Set the cache used for image loading. + + @param imageCache The image cache. + */ ++ (void)setSharedImageCache:(__nullable id )imageCache; + +///------------------------------------ +/// @name Accessing Response Serializer +///------------------------------------ + +/** + The response serializer used to create an image representation from the server response and response data. By default, this is an instance of `AFImageResponseSerializer`. + + @discussion Subclasses of `AFImageResponseSerializer` could be used to perform post-processing, such as color correction, face detection, or other effects. See https://github.com/AFNetworking/AFCoreImageSerializer + */ +@property (nonatomic, strong) id imageResponseSerializer; + +///-------------------- +/// @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 request operation finishes successfully. This block has no return value and takes two arguments: the server response and the image. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image request operation finishes unsuccessfully, or that finishes successfully. This block has no return value and takes a single argument: the 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 (^)(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 request operation finishes successfully. This block has no return value and takes two arguments: the server response and the image. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image request operation finishes unsuccessfully, or that finishes successfully. This block has no return value and takes a single argument: the 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 (^)(NSError *error))failure; + + +///------------------------------ +/// @name Canceling Image Loading +///------------------------------ + +/** + Cancels any executing image operation for the specified control state of the receiver, if one exists. + + @param state The control state. + */ +- (void)cancelImageRequestOperationForState:(UIControlState)state; + +/** + Cancels any executing background image operation for the specified control state of the receiver, if one exists. + + @param state The control state. + */ +- (void)cancelBackgroundImageRequestOperationForState:(UIControlState)state; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m new file mode 100755 index 0000000..e5c36a5 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m @@ -0,0 +1,293 @@ +// 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import "AFURLResponseSerialization.h" +#import "AFHTTPRequestOperation.h" + +#import "UIImageView+AFNetworking.h" + +@interface UIButton (_AFNetworking) +@end + +@implementation UIButton (_AFNetworking) + ++ (NSOperationQueue *)af_sharedImageRequestOperationQueue { + static NSOperationQueue *_af_sharedImageRequestOperationQueue = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _af_sharedImageRequestOperationQueue = [[NSOperationQueue alloc] init]; + _af_sharedImageRequestOperationQueue.maxConcurrentOperationCount = NSOperationQueueDefaultMaxConcurrentOperationCount; + }); + + return _af_sharedImageRequestOperationQueue; +} + +#pragma mark - + +static char AFImageRequestOperationNormal; +static char AFImageRequestOperationHighlighted; +static char AFImageRequestOperationSelected; +static char AFImageRequestOperationDisabled; + +static const char * af_imageRequestOperationKeyForState(UIControlState state) { + switch (state) { + case UIControlStateHighlighted: + return &AFImageRequestOperationHighlighted; + case UIControlStateSelected: + return &AFImageRequestOperationSelected; + case UIControlStateDisabled: + return &AFImageRequestOperationDisabled; + case UIControlStateNormal: + default: + return &AFImageRequestOperationNormal; + } +} + +- (AFHTTPRequestOperation *)af_imageRequestOperationForState:(UIControlState)state { + return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, af_imageRequestOperationKeyForState(state)); +} + +- (void)af_setImageRequestOperation:(AFHTTPRequestOperation *)imageRequestOperation + forState:(UIControlState)state +{ + objc_setAssociatedObject(self, af_imageRequestOperationKeyForState(state), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +#pragma mark - + +static char AFBackgroundImageRequestOperationNormal; +static char AFBackgroundImageRequestOperationHighlighted; +static char AFBackgroundImageRequestOperationSelected; +static char AFBackgroundImageRequestOperationDisabled; + +static const char * af_backgroundImageRequestOperationKeyForState(UIControlState state) { + switch (state) { + case UIControlStateHighlighted: + return &AFBackgroundImageRequestOperationHighlighted; + case UIControlStateSelected: + return &AFBackgroundImageRequestOperationSelected; + case UIControlStateDisabled: + return &AFBackgroundImageRequestOperationDisabled; + case UIControlStateNormal: + default: + return &AFBackgroundImageRequestOperationNormal; + } +} + +- (AFHTTPRequestOperation *)af_backgroundImageRequestOperationForState:(UIControlState)state { + return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, af_backgroundImageRequestOperationKeyForState(state)); +} + +- (void)af_setBackgroundImageRequestOperation:(AFHTTPRequestOperation *)imageRequestOperation + forState:(UIControlState)state +{ + objc_setAssociatedObject(self, af_backgroundImageRequestOperationKeyForState(state), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +@end + +#pragma mark - + +@implementation UIButton (AFNetworking) + ++ (id )sharedImageCache { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + return objc_getAssociatedObject(self, @selector(sharedImageCache)) ?: [UIImageView sharedImageCache]; +#pragma clang diagnostic pop +} + ++ (void)setSharedImageCache:(__nullable id )imageCache { + objc_setAssociatedObject(self, @selector(sharedImageCache), imageCache, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +#pragma mark - + +- (id )imageResponseSerializer { + static id _af_defaultImageResponseSerializer = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _af_defaultImageResponseSerializer = [AFImageResponseSerializer serializer]; + }); + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + return objc_getAssociatedObject(self, @selector(imageResponseSerializer)) ?: _af_defaultImageResponseSerializer; +#pragma clang diagnostic pop +} + +- (void)setImageResponseSerializer:(id )serializer { + objc_setAssociatedObject(self, @selector(imageResponseSerializer), serializer, 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:(UIImage *)placeholderImage + success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * __nullable response, UIImage *image))success + failure:(void (^)(NSError *error))failure +{ + [self cancelImageRequestOperationForState:state]; + + UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest]; + if (cachedImage) { + if (success) { + success(urlRequest, nil, cachedImage); + } else { + [self setImage:cachedImage forState:state]; + } + + [self af_setImageRequestOperation:nil forState:state]; + } else { + if (placeholderImage) { + [self setImage:placeholderImage forState:state]; + } + + __weak __typeof(self)weakSelf = self; + AFHTTPRequestOperation *imageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest]; + imageRequestOperation.responseSerializer = self.imageResponseSerializer; + [imageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([[urlRequest URL] isEqual:[operation.request URL]]) { + if (success) { + success(operation.request, operation.response, responseObject); + } else if (responseObject) { + [strongSelf setImage:responseObject forState:state]; + } + } + [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest]; + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + if ([[urlRequest URL] isEqual:[operation.request URL]]) { + if (failure) { + failure(error); + } + } + }]; + + [self af_setImageRequestOperation:imageRequestOperation forState:state]; + [[[self class] af_sharedImageRequestOperationQueue] addOperation:imageRequestOperation]; + } +} + +#pragma mark - + +- (void)setBackgroundImageForState:(UIControlState)state + withURL:(NSURL *)url +{ + [self setBackgroundImageForState:state withURL:url placeholderImage:nil]; +} + +- (void)setBackgroundImageForState:(UIControlState)state + withURL:(NSURL *)url + placeholderImage:(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:(UIImage *)placeholderImage + success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * __nullable response, UIImage *image))success + failure:(void (^)(NSError *error))failure +{ + [self cancelBackgroundImageRequestOperationForState:state]; + + UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest]; + if (cachedImage) { + if (success) { + success(urlRequest, nil, cachedImage); + } else { + [self setBackgroundImage:cachedImage forState:state]; + } + + [self af_setBackgroundImageRequestOperation:nil forState:state]; + } else { + if (placeholderImage) { + [self setBackgroundImage:placeholderImage forState:state]; + } + + __weak __typeof(self)weakSelf = self; + AFHTTPRequestOperation *backgroundImageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest]; + backgroundImageRequestOperation.responseSerializer = self.imageResponseSerializer; + [backgroundImageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([[urlRequest URL] isEqual:[operation.request URL]]) { + if (success) { + success(operation.request, operation.response, responseObject); + } else if (responseObject) { + [strongSelf setBackgroundImage:responseObject forState:state]; + } + } + [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest]; + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + if ([[urlRequest URL] isEqual:[operation.request URL]]) { + if (failure) { + failure(error); + } + } + }]; + + [self af_setBackgroundImageRequestOperation:backgroundImageRequestOperation forState:state]; + [[[self class] af_sharedImageRequestOperationQueue] addOperation:backgroundImageRequestOperation]; + } +} + +#pragma mark - + +- (void)cancelImageRequestOperationForState:(UIControlState)state { + [[self af_imageRequestOperationForState:state] cancel]; + [self af_setImageRequestOperation:nil forState:state]; +} + +- (void)cancelBackgroundImageRequestOperationForState:(UIControlState)state { + [[self af_backgroundImageRequestOperationForState:state] cancel]; + [self af_setBackgroundImageRequestOperation:nil forState:state]; +} + +@end + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h new file mode 100755 index 0000000..3292920 --- /dev/null +++ b/dayPhoto/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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import + +@interface UIImage (AFNetworking) + ++ (UIImage*) safeImageWithData:(NSData*)data; + +@end + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h new file mode 100755 index 0000000..bf61915 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h @@ -0,0 +1,146 @@ +// 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol AFURLResponseSerialization, AFImageCache; + +/** + 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 Image Cache +///---------------------------- + +/** + The image cache used to improve image loading performance on scroll views. By default, this is an `NSCache` subclass conforming to the `AFImageCache` protocol, which listens for notification warnings and evicts objects accordingly. +*/ ++ (id )sharedImageCache; + +/** + Set the cache used for image loading. + + @param imageCache The image cache. + */ ++ (void)setSharedImageCache:(__nullable id )imageCache; + +///------------------------------------ +/// @name Accessing Response Serializer +///------------------------------------ + +/** + The response serializer used to create an image representation from the server response and response data. By default, this is an instance of `AFImageResponseSerializer`. + + @discussion Subclasses of `AFImageResponseSerializer` could be used to perform post-processing, such as color correction, face detection, or other effects. See https://github.com/AFNetworking/AFCoreImageSerializer + */ +@property (nonatomic, strong) id imageResponseSerializer; + +///-------------------- +/// @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 request operation 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 request operation 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)cancelImageRequestOperation; + +@end + +#pragma mark - + +/** + The `AFImageCache` protocol is adopted by an object used to cache images loaded by the AFNetworking category on `UIImageView`. + */ +@protocol AFImageCache + +/** + Returns a cached image for the specified request, if available. + + @param request The image request. + + @return The cached image. + */ +- (nullable UIImage *)cachedImageForRequest:(NSURLRequest *)request; + +/** + Caches a particular image for the specified request. + + @param image The image to cache. + @param request The request to be used as a cache key. + */ +- (void)cacheImage:(UIImage *)image + forRequest:(NSURLRequest *)request; +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m new file mode 100755 index 0000000..2efc160 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m @@ -0,0 +1,215 @@ +// 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import "AFHTTPRequestOperation.h" + +@interface AFImageCache : NSCache +@end + +#pragma mark - + +@interface UIImageView (_AFNetworking) +@property (readwrite, nonatomic, strong, setter = af_setImageRequestOperation:) AFHTTPRequestOperation *af_imageRequestOperation; +@end + +@implementation UIImageView (_AFNetworking) + ++ (NSOperationQueue *)af_sharedImageRequestOperationQueue { + static NSOperationQueue *_af_sharedImageRequestOperationQueue = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _af_sharedImageRequestOperationQueue = [[NSOperationQueue alloc] init]; + _af_sharedImageRequestOperationQueue.maxConcurrentOperationCount = NSOperationQueueDefaultMaxConcurrentOperationCount; + }); + + return _af_sharedImageRequestOperationQueue; +} + +- (AFHTTPRequestOperation *)af_imageRequestOperation { + return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, @selector(af_imageRequestOperation)); +} + +- (void)af_setImageRequestOperation:(AFHTTPRequestOperation *)imageRequestOperation { + objc_setAssociatedObject(self, @selector(af_imageRequestOperation), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +@end + +#pragma mark - + +@implementation UIImageView (AFNetworking) +@dynamic imageResponseSerializer; + ++ (id )sharedImageCache { + static AFImageCache *_af_defaultImageCache = nil; + static dispatch_once_t oncePredicate; + dispatch_once(&oncePredicate, ^{ + _af_defaultImageCache = [[AFImageCache alloc] init]; + + [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidReceiveMemoryWarningNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * __unused notification) { + [_af_defaultImageCache removeAllObjects]; + }]; + }); + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + return objc_getAssociatedObject(self, @selector(sharedImageCache)) ?: _af_defaultImageCache; +#pragma clang diagnostic pop +} + ++ (void)setSharedImageCache:(__nullable id )imageCache { + objc_setAssociatedObject(self, @selector(sharedImageCache), imageCache, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +#pragma mark - + +- (id )imageResponseSerializer { + static id _af_defaultImageResponseSerializer = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _af_defaultImageResponseSerializer = [AFImageResponseSerializer serializer]; + }); + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + return objc_getAssociatedObject(self, @selector(imageResponseSerializer)) ?: _af_defaultImageResponseSerializer; +#pragma clang diagnostic pop +} + +- (void)setImageResponseSerializer:(id )serializer { + objc_setAssociatedObject(self, @selector(imageResponseSerializer), serializer, 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 +{ + [self cancelImageRequestOperation]; + + UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest]; + if (cachedImage) { + if (success) { + success(urlRequest, nil, cachedImage); + } else { + self.image = cachedImage; + } + + self.af_imageRequestOperation = nil; + } else { + if (placeholderImage) { + self.image = placeholderImage; + } + + __weak __typeof(self)weakSelf = self; + self.af_imageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest]; + self.af_imageRequestOperation.responseSerializer = self.imageResponseSerializer; + [self.af_imageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([[urlRequest URL] isEqual:[strongSelf.af_imageRequestOperation.request URL]]) { + if (success) { + success(urlRequest, operation.response, responseObject); + } else if (responseObject) { + strongSelf.image = responseObject; + } + + if (operation == strongSelf.af_imageRequestOperation){ + strongSelf.af_imageRequestOperation = nil; + } + } + + [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest]; + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + if ([[urlRequest URL] isEqual:[strongSelf.af_imageRequestOperation.request URL]]) { + if (failure) { + failure(urlRequest, operation.response, error); + } + + if (operation == strongSelf.af_imageRequestOperation){ + strongSelf.af_imageRequestOperation = nil; + } + } + }]; + + [[[self class] af_sharedImageRequestOperationQueue] addOperation:self.af_imageRequestOperation]; + } +} + +- (void)cancelImageRequestOperation { + [self.af_imageRequestOperation cancel]; + self.af_imageRequestOperation = nil; +} + +@end + +#pragma mark - + +static inline NSString * AFImageCacheKeyFromURLRequest(NSURLRequest *request) { + return [[request URL] absoluteString]; +} + +@implementation AFImageCache + +- (UIImage *)cachedImageForRequest:(NSURLRequest *)request { + switch ([request cachePolicy]) { + case NSURLRequestReloadIgnoringCacheData: + case NSURLRequestReloadIgnoringLocalAndRemoteCacheData: + return nil; + default: + break; + } + + return [self objectForKey:AFImageCacheKeyFromURLRequest(request)]; +} + +- (void)cacheImage:(UIImage *)image + forRequest:(NSURLRequest *)request +{ + if (image && request) { + [self setObject:image forKey:AFImageCacheKeyFromURLRequest(request)]; + } +} + +@end + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h new file mode 100755 index 0000000..49850ed --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h @@ -0,0 +1,39 @@ +// 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 +#import + +#ifndef _UIKIT_AFNETWORKING_ + #define _UIKIT_AFNETWORKING_ + + #import "AFNetworkActivityIndicatorManager.h" + + #import "UIActivityIndicatorView+AFNetworking.h" + #import "UIAlertView+AFNetworking.h" + #import "UIButton+AFNetworking.h" + #import "UIImageView+AFNetworking.h" + #import "UIProgressView+AFNetworking.h" + #import "UIRefreshControl+AFNetworking.h" + #import "UIWebView+AFNetworking.h" +#endif /* _UIKIT_AFNETWORKING_ */ +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h new file mode 100755 index 0000000..5c00d6d --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h @@ -0,0 +1,91 @@ +// 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class AFURLConnectionOperation; + +/** + 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 or request operation. + */ +@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. + */ +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task + animated:(BOOL)animated; +#endif + +/** + 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. + */ +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task + animated:(BOOL)animated; +#endif + +///------------------------------------ +/// @name Setting Session Task Progress +///------------------------------------ + +/** + Binds the progress to the upload progress of the specified request operation. + + @param operation The request operation. + @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. + */ +- (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation + animated:(BOOL)animated; + +/** + Binds the progress to the download progress of the specified request operation. + + @param operation The request operation. + @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. + */ +- (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation + animated:(BOOL)animated; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m new file mode 100755 index 0000000..ad2c280 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m @@ -0,0 +1,182 @@ +// 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import "AFURLConnectionOperation.h" + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +#import "AFURLSessionManager.h" +#endif + +static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext; +static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext; + +@interface AFURLConnectionOperation (_UIProgressView) +@property (readwrite, nonatomic, copy) void (^uploadProgress)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected); +@property (readwrite, nonatomic, assign, setter = af_setUploadProgressAnimated:) BOOL af_uploadProgressAnimated; + +@property (readwrite, nonatomic, copy) void (^downloadProgress)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected); +@property (readwrite, nonatomic, assign, setter = af_setDownloadProgressAnimated:) BOOL af_downloadProgressAnimated; +@end + +@implementation AFURLConnectionOperation (_UIProgressView) +@dynamic uploadProgress; // Implemented in AFURLConnectionOperation +@dynamic af_uploadProgressAnimated; + +@dynamic downloadProgress; // Implemented in AFURLConnectionOperation +@dynamic af_downloadProgressAnimated; +@end + +#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 - + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +- (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]; +} +#endif + +#pragma mark - + +- (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation + animated:(BOOL)animated +{ + __weak __typeof(self)weakSelf = self; + void (^original)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) = [operation.uploadProgress copy]; + [operation setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) { + if (original) { + original(bytesWritten, totalBytesWritten, totalBytesExpectedToWrite); + } + + dispatch_async(dispatch_get_main_queue(), ^{ + if (totalBytesExpectedToWrite > 0) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + [strongSelf setProgress:(totalBytesWritten / (totalBytesExpectedToWrite * 1.0f)) animated:animated]; + } + }); + }]; +} + +- (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation + animated:(BOOL)animated +{ + __weak __typeof(self)weakSelf = self; + void (^original)(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) = [operation.downloadProgress copy]; + [operation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) { + if (original) { + original(bytesRead, totalBytesRead, totalBytesExpectedToRead); + } + + dispatch_async(dispatch_get_main_queue(), ^{ + if (totalBytesExpectedToRead > 0) { + __strong __typeof(weakSelf)strongSelf = weakSelf; + [strongSelf setProgress:(totalBytesRead / (totalBytesExpectedToRead * 1.0f)) animated:animated]; + } + }); + }]; +} + +#pragma mark - NSKeyValueObserving + +- (void)observeValueForKeyPath:(NSString *)keyPath + ofObject:(id)object + change:(__unused NSDictionary *)change + context:(void *)context +{ +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 + 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) {} + } + } + } +#endif +} + +@end + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h new file mode 100755 index 0000000..a65e390 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h @@ -0,0 +1,68 @@ +// 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class AFURLConnectionOperation; + +/** + 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 request operation or 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. + */ +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; +#endif + +///---------------------------------------- +/// @name Refreshing for Request Operations +///---------------------------------------- + +/** + Binds the refreshing state to the execution state of the specified operation. + + @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. + */ +- (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m new file mode 100755 index 0000000..4c19245 --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m @@ -0,0 +1,166 @@ +// 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import "AFHTTPRequestOperation.h" + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +#import "AFURLSessionManager.h" +#endif + +@interface AFRefreshControlNotificationObserver : NSObject +@property (readonly, nonatomic, weak) UIRefreshControl *refreshControl; +- (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl; + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; +#endif +- (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation; + +@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; +} + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { + [[self af_notificationObserver] setRefreshingWithStateOfTask:task]; +} +#endif + +- (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation { + [[self af_notificationObserver] setRefreshingWithStateOfOperation:operation]; +} + +@end + +@implementation AFRefreshControlNotificationObserver + +- (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl +{ + self = [super init]; + if (self) { + _refreshControl = refreshControl; + } + return self; +} + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 +- (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 + } +} +#endif + +- (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation { + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + + [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil]; + + if (operation) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreceiver-is-weak" +#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" + if (![operation isFinished]) { + if ([operation isExecuting]) { + [self.refreshControl beginRefreshing]; + } else { + [self.refreshControl endRefreshing]; + } + + [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingOperationDidStartNotification object:operation]; + [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingOperationDidFinishNotification object:operation]; + } +#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]; + +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 + [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; +#endif + + [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil]; + [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil]; +} + +@end + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h new file mode 100755 index 0000000..5d61d6a --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h @@ -0,0 +1,86 @@ +// 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class AFHTTPRequestSerializer, AFHTTPResponseSerializer; +@protocol AFURLRequestSerialization, AFURLResponseSerialization; + +/** + 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 request serializer used to serialize requests made with the `-loadRequest:...` category methods. By default, this is an instance of `AFHTTPRequestSerializer`. + */ +@property (nonatomic, strong) AFHTTPRequestSerializer * requestSerializer; + +/** + The response serializer used to serialize responses made with the `-loadRequest:...` category methods. By default, this is an instance of `AFHTTPResponseSerializer`. + */ +@property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; + +/** + 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 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 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 main thread. + @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 request operation 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:(nullable void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))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 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 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 main thread. + @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 request operation 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:(nullable void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress + success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success + failure:(nullable void (^)(NSError *error))failure; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m new file mode 100755 index 0000000..93eacaa --- /dev/null +++ b/dayPhoto/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m @@ -0,0 +1,159 @@ +// 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +#import "AFHTTPRequestOperation.h" +#import "AFURLResponseSerialization.h" +#import "AFURLRequestSerialization.h" + +@interface UIWebView (_AFNetworking) +@property (readwrite, nonatomic, strong, setter = af_setHTTPRequestOperation:) AFHTTPRequestOperation *af_HTTPRequestOperation; +@end + +@implementation UIWebView (_AFNetworking) + +- (AFHTTPRequestOperation *)af_HTTPRequestOperation { + return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, @selector(af_HTTPRequestOperation)); +} + +- (void)af_setHTTPRequestOperation:(AFHTTPRequestOperation *)operation { + objc_setAssociatedObject(self, @selector(af_HTTPRequestOperation), operation, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +@end + +#pragma mark - + +@implementation UIWebView (AFNetworking) + +- (AFHTTPRequestSerializer *)requestSerializer { + static AFHTTPRequestSerializer *_af_defaultRequestSerializer = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _af_defaultRequestSerializer = [AFHTTPRequestSerializer serializer]; + }); + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + return objc_getAssociatedObject(self, @selector(requestSerializer)) ?: _af_defaultRequestSerializer; +#pragma clang diagnostic pop +} + +- (void)setRequestSerializer:(AFHTTPRequestSerializer *)requestSerializer { + objc_setAssociatedObject(self, @selector(requestSerializer), requestSerializer, 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:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))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:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress + success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success + failure:(void (^)(NSError *error))failure +{ + NSParameterAssert(request); + + if (self.af_HTTPRequestOperation) { + [self.af_HTTPRequestOperation cancel]; + } + + request = [self.requestSerializer requestBySerializingRequest:request withParameters:nil error:nil]; + + self.af_HTTPRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; + self.af_HTTPRequestOperation.responseSerializer = self.responseSerializer; + + __weak __typeof(self)weakSelf = self; + [self.af_HTTPRequestOperation setDownloadProgressBlock:progress]; + [self.af_HTTPRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id __unused responseObject) { + NSData *data = success ? success(operation.response, operation.responseData) : operation.responseData; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" + __strong __typeof(weakSelf) strongSelf = weakSelf; + [strongSelf loadData:data MIMEType:(MIMEType ?: [operation.response MIMEType]) textEncodingName:(textEncodingName ?: [operation.response textEncodingName]) baseURL:[operation.response URL]]; + + if ([strongSelf.delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) { + [strongSelf.delegate webViewDidFinishLoad:strongSelf]; + } + +#pragma clang diagnostic pop + } failure:^(AFHTTPRequestOperation * __unused operation, NSError *error) { + if (failure) { + failure(error); + } + }]; + + [self.af_HTTPRequestOperation start]; + + if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { + [self.delegate webViewDidStartLoad:self]; + } +} + +@end + +#endif diff --git a/dayPhoto/Pods/FSHelpers+Swift/LICENSE b/dayPhoto/Pods/FSHelpers+Swift/LICENSE new file mode 100755 index 0000000..a0b57f2 --- /dev/null +++ b/dayPhoto/Pods/FSHelpers+Swift/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2015 FSHelper + +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/dayPhoto/Pods/FSHelpers+Swift/README.md b/dayPhoto/Pods/FSHelpers+Swift/README.md new file mode 100755 index 0000000..ce0412f --- /dev/null +++ b/dayPhoto/Pods/FSHelpers+Swift/README.md @@ -0,0 +1,13 @@ +FSHelper +================= + +## Installation + +Helpers is available through [CocoaPods](http://cocoapods.org). To install +it, simply add the following line to your Podfile: + + pod "FSHelper+Swift" + +or + + pod "FSHelper+ObjectiveC" diff --git a/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+Array.swift b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+Array.swift new file mode 100755 index 0000000..081cee2 --- /dev/null +++ b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+Array.swift @@ -0,0 +1,31 @@ +// +// FSExtensions+Array.swift +// SwiftHelpers +// +// Created by Kruperfone on 31.07.15. +// Copyright (c) 2015 FlatStack. All rights reserved. +// + +import Foundation + +public extension Array { + + public func fs_objectAtIndexOrNil (index:Int) -> Element? { + guard index < self.count && index >= 0 else {return nil} + return self[index] + } + + public func fs_shuffle () -> Array { + var array:Array = self + + for i in 0 ..< array.count { + let remainingCount = array.count - i + let exchangeIndex = i + Int(arc4random_uniform(UInt32(remainingCount))) + + guard i != exchangeIndex else {continue} + swap(&array[i], &array[exchangeIndex]) + } + + return array + } +} diff --git a/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+Dictionary.swift b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+Dictionary.swift new file mode 100755 index 0000000..c6647a2 --- /dev/null +++ b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+Dictionary.swift @@ -0,0 +1,17 @@ +// +// FSExtensions+Dictionary.swift +// SwiftHelpers +// +// Created by Kruperfone on 31.07.15. +// Copyright (c) 2015 FlatStack. All rights reserved. +// + +import Foundation + +public extension Dictionary { + + public func fs_objectForKey(key:Key, orDefault def:Value) -> Value { + guard let value = self[key] else {return def} + return value + } +} diff --git a/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+Double.swift b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+Double.swift new file mode 100755 index 0000000..44d6580 --- /dev/null +++ b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+Double.swift @@ -0,0 +1,17 @@ +// +// FSE+Double.swift +// SwiftHelpers +// +// Created by Kruperfone on 31.07.15. +// Copyright (c) 2015 FlatStack. All rights reserved. +// + +import Foundation + +public extension Double { + public var fs_dispatchTime: dispatch_time_t { + get { + return dispatch_time(DISPATCH_TIME_NOW,Int64(self * Double(NSEC_PER_SEC))) + } + } +} diff --git a/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+NSDate.swift b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+NSDate.swift new file mode 100755 index 0000000..bcf62a6 --- /dev/null +++ b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+NSDate.swift @@ -0,0 +1,169 @@ +// +// FSE+NSDate.swift +// SwiftHelpers +// +// Created by Kruperfone on 31.07.15. +// Copyright (c) 2015 FlatStack. All rights reserved. +// + +import Foundation + +public enum FSTimePeriod:NSTimeInterval { + case Second = 1 + case Minute = 60 + case Hour = 3600 + case Day = 86400 + case Week = 604800 +} + +public enum FSDatePeriod:Int { + case Unknow = -1 + case Today = 0 + case Tomorrow = 1 + case ThisWeek = 2 + + public init (date:NSDate) { + + if date.fs_isDateToday() { + self = .Today + return + } + + if date.fs_isTomorrow() { + self = .Tomorrow + return + } + + if date.fs_isThisWeek() { + self = .ThisWeek + return + } + + self = .Unknow + } +} + +public extension NSTimeInterval { + public var fs_timezone: NSTimeInterval { + let calendar = NSCalendar.currentCalendar() + let date = NSDate(timeIntervalSince1970: self) + + let timezoneOffset = NSTimeInterval(calendar.timeZone.secondsFromGMT) + let daylightOffset = calendar.timeZone.isDaylightSavingTimeForDate(date) ? calendar.timeZone.daylightSavingTimeOffset : 0 + + return timezoneOffset + daylightOffset + } +} + +public extension NSDate { + + public var fs_timezone: NSTimeInterval { + return self.timeIntervalSince1970.fs_timezone + } + + public func fs_isDateToday () -> Bool { + return NSDate().fs_midnightDate() == self.fs_midnightDate() + } + + public func fs_isTomorrow () -> Bool { + return self.fs_isEqualToDateIgnoringTime(NSDate().fs_tomorrow) + } + + public func fs_isThisWeek () -> Bool { + return self.fs_isSameWeekAsDate(NSDate()) + } + + public func fs_midnightDate () -> NSDate { + + let timestamp = self.timeIntervalSince1970 + self.fs_timezone + let midnightTimestamp = timestamp - timestamp%(FSTimePeriod.Day.rawValue) + + let result = NSDate(timeIntervalSince1970: midnightTimestamp - midnightTimestamp.fs_timezone) + return result + } + + public func fs_isSameWeekAsDate(date:NSDate) -> Bool + { + //Compare by date components is not working becouse it's start week from monday + + let calendar = NSCalendar.currentCalendar() + let timezone = NSTimeInterval(calendar.timeZone.secondsFromGMT) + let daylight = {(date: NSDate) -> NSTimeInterval in + return calendar.timeZone.isDaylightSavingTimeForDate(date) ? calendar.timeZone.daylightSavingTimeOffset : 0 + } + + //Getting interval without timezones + let greenwichInterval = self.timeIntervalSince1970 + timezone + daylight(self) + //Getting midnight +0 interval + let interval = greenwichInterval - greenwichInterval%(24*60*60) + + //Calculate number of week (since 1 January 1970 (Thursday)) + let numberOfWeeks: Int = { + + let wholeWeeks = Int(interval/FSTimePeriod.Week.rawValue) + + //Getting previous thursday interval + let thursday = NSTimeInterval(wholeWeeks)*FSTimePeriod.Week.rawValue + + //Calculate difference (in days) between current time and previous Thursday + let differenseDays = Int((interval - thursday)/FSTimePeriod.Day.rawValue) + //Calculate max difference in days. Based on calendar firstday index (1-7 where 1 is Sunday). Thursday index is 4. + let maxDifference = 1 + calendar.firstWeekday + + if differenseDays <= maxDifference { + //If differenct less or equal to max difference, than previous Thursday and current date is same week + return wholeWeeks + } else { + //If difference greather than max difference - interval in the next week + return wholeWeeks + 1 + } + }() + + //Get timestamp of current week Thursday + let weekInterval = NSTimeInterval(numberOfWeeks) * FSTimePeriod.Week.rawValue + //Calculate days which we must deduct to get first weekday + let correctionDays: NSTimeInterval = 5 - NSTimeInterval(calendar.firstWeekday) + //Convert correction days to time interval in seconds + let correctionInterval = correctionDays*FSTimePeriod.Day.rawValue + //Get first weekday timestamp (Sunday for USA and Monday for Russia for example) + let firstWeekday = weekInterval - correctionInterval + + //Get timestamp of the first weekday and last weekday + let minMidnightInterval = firstWeekday + let maxMidnightInterval = minMidnightInterval + FSTimePeriod.Week.rawValue - 1 + + //Calculate timezone modifiers + let minTimezoneOffset: NSTimeInterval = { + let date = NSDate(timeIntervalSince1970: minMidnightInterval) + return -(timezone + daylight(date)) + }() + let maxTimezoneOffset: NSTimeInterval = { + let date = NSDate(timeIntervalSince1970: maxMidnightInterval) + return -(timezone + daylight(date)) + }() + + //Add timezone to midnight intervals + let minInterval = UInt(minMidnightInterval + minTimezoneOffset) + let maxInterval = UInt(maxMidnightInterval + maxTimezoneOffset) + + //Get timestamp of comperation date + let dateInterval = UInt(date.timeIntervalSince1970) + + //Check if date is in week interval + return dateInterval >= minInterval && dateInterval <= maxInterval + } + + public func fs_isEqualToDateIgnoringTime (date:NSDate) -> Bool { + return self.fs_midnightDate() == date.fs_midnightDate() + } + + public func fs_dateByAddingDays (days: Int) -> NSDate { + let timeInterval:NSTimeInterval = self.timeIntervalSinceReferenceDate + FSTimePeriod.Day.rawValue * NSTimeInterval(days) + let newDate = NSDate(timeIntervalSinceReferenceDate: timeInterval) + return newDate + } + + public var fs_tomorrow: NSDate { + return self.fs_dateByAddingDays(1) + } +} diff --git a/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+String.swift b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+String.swift new file mode 100755 index 0000000..4f5ce6f --- /dev/null +++ b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+String.swift @@ -0,0 +1,73 @@ +// +// FSExtensions+String.swift +// SwiftHelpers +// +// Created by Kruperfone on 31.07.15. +// Copyright (c) 2015 FlatStack. All rights reserved. +// + +import UIKit + +public extension String { + + public func fs_getRowHeight (font: UIFont) -> CGFloat { + return self.fs_getStringHeight(font, width: CGFloat.max) + } + + public func fs_getLineCount (font: UIFont) -> Int { + let rowHeight = self.fs_getRowHeight(font) + return Int(ceil(rowHeight / font.lineHeight)) + } + + public func fs_URLEncodedString () -> String? { + return self.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLHostAllowedCharacterSet()) + } + + public func fs_URLDecodedString () -> String? { + return self.stringByRemovingPercentEncoding + } + + public func fs_emailValidate () -> Bool { + let emailRegEx = "(?:[a-z0-9!#$%\\&'*+/=?\\^_`{|}~-]+(?:\\.[a-z0-9!#$%\\&'*+/=?\\^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])" + + let regExPredicate:NSPredicate = NSPredicate(format: "SELF MATCHES %@", emailRegEx) + + return regExPredicate.evaluateWithObject(self) + } + + public func fs_getStringWidth (font: UIFont, height: CGFloat) -> CGFloat { + + let boundingSize:CGSize = CGSizeMake(CGFloat.max, height) + + let attributes = [NSFontAttributeName:font] + + let options : NSStringDrawingOptions = unsafeBitCast( + NSStringDrawingOptions.UsesLineFragmentOrigin.rawValue | + NSStringDrawingOptions.UsesFontLeading.rawValue, + NSStringDrawingOptions.self) + + let text = self as NSString + + let rect = text.boundingRectWithSize(boundingSize, options:options, attributes: attributes, context:nil) + + return ceil(rect.size.width) + } + + public func fs_getStringHeight (font: UIFont, width: CGFloat) -> CGFloat { + + let boundingSize:CGSize = CGSizeMake(width, CGFloat.max) + + let attributes = [NSFontAttributeName:font] + + let options : NSStringDrawingOptions = unsafeBitCast( + NSStringDrawingOptions.UsesLineFragmentOrigin.rawValue | + NSStringDrawingOptions.UsesFontLeading.rawValue, + NSStringDrawingOptions.self) + + let text = self as NSString + + let rect = text.boundingRectWithSize(boundingSize, options:options, attributes: attributes, context:nil) + + return ceil(rect.size.height) + } +} diff --git a/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UIColor.swift b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UIColor.swift new file mode 100755 index 0000000..12ebb25 --- /dev/null +++ b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UIColor.swift @@ -0,0 +1,64 @@ +// +// FSE+UIColor.swift +// SwiftHelpers +// +// Created by Kruperfone on 31.07.15. +// Copyright (c) 2015 FlatStack. All rights reserved. +// + +import UIKit + +public extension UIColor { + + convenience public init? (fs_hexString: String, alpha: CGFloat = 1) { + + let regex: NSRegularExpression = try! NSRegularExpression(pattern: "[^a-fA-F|0-9]", options: []) + + let match: Int = regex.numberOfMatchesInString(fs_hexString, options: NSMatchingOptions.ReportCompletion, range: NSMakeRange(0, fs_hexString.characters.count)) + + if (match != 0) { + self.init() + return nil + } + + var cString: String = fs_hexString.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet() as NSCharacterSet).uppercaseString + + if (cString.hasPrefix("#")) { + cString = cString.substringFromIndex(cString.startIndex.advancedBy(1)) + } + + if (cString.characters.count != 6) { + self.init() + return nil + } + + var rgbValue: UInt32 = 0 + NSScanner(string: cString).scanHexInt(&rgbValue) + + self.init( + red : CGFloat((rgbValue & 0xFF0000) >> 16) / 255, + green : CGFloat((rgbValue & 0x00FF00) >> 8) / 255, + blue : CGFloat((rgbValue & 0x0000FF) >> 0) / 255, + alpha : alpha + ) + } + + public func fs_hexString () -> String { + + // Special case, as white doesn't fall into the RGB color space + if (self == UIColor.whiteColor()) { + return "ffffff" + } + + var red : CGFloat = 0 + var blue : CGFloat = 0 + var green : CGFloat = 0 + var alpha : CGFloat = 0 + + self.getRed(&(red), green: &green, blue: &blue, alpha: &alpha) + + let hexString = NSString(format: "%02x%02x%02x", (Int(red*255)), (Int(green*255)), (Int(blue*255))) as String + + return hexString + } +} diff --git a/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UIImage.swift b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UIImage.swift new file mode 100755 index 0000000..84342b5 --- /dev/null +++ b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UIImage.swift @@ -0,0 +1,174 @@ +// +// FSE+UIImage.swift +// DayPhoto +// +// Created by Kruperfone on 23.09.15. +// Copyright © 2015 Flatstack. All rights reserved. +// + +import UIKit + +public struct FSBitmapPixel { + public var r: UInt8 + public var g: UInt8 + public var b: UInt8 + public var a: UInt8 + + public init (value: UInt32) { + self.r = UInt8((value >> 0) & 0xFF) + self.g = UInt8((value >> 8) & 0xFF) + self.b = UInt8((value >> 16) & 0xFF) + self.a = UInt8((value >> 24) & 0xFF) + } + + public init (color: UIColor) { + var red: CGFloat = -1 + var green: CGFloat = -1 + var blue: CGFloat = -1 + var alpha: CGFloat = -1 + + color.getRed(&red, green: &green, blue: &blue, alpha: &alpha) + + self.r = UInt8(red * 255) + self.g = UInt8(green * 255) + self.b = UInt8(blue * 255) + self.a = UInt8(alpha * 255) + } + + public var value: UInt32 { + let red = UInt32(self.r) << 0 + let green = UInt32(self.g) << 8 + let blue = UInt32(self.b) << 16 + let alpha = UInt32(self.a) << 24 + + let result = red+green+blue+alpha + + return result + } + + public var color: UIColor { + return UIColor( + red: CGFloat(self.r)/255, + green: CGFloat(self.g)/255, + blue: CGFloat(self.b)/255, + alpha: CGFloat(self.a)/255) + } + + public var description: String { + return "\(self.r)|\(self.g)|\(self.b)|\(self.a)" + } + + public var brightness: UInt8 { + return UInt8((CGFloat(self.brightness32)/(255*3))*255) + } + + private var brightness32: UInt32 { + return UInt32(self.r) + UInt32(self.g) + UInt32(self.b) + } +} + +public class FSBitmap: NSObject { + + private var bytesPerRow: Int { + return Int(self.size.width) + } + + public var data: UnsafeMutablePointer + public var size: (width: Int, height: Int) + + public init (data: UnsafeMutablePointer, size: (width: Int, height: Int)) { + self.size = size + self.data = data + super.init() + } + + public init (size: (width: Int, height: Int)) { + self.size = size + self.data = UnsafeMutablePointer(calloc(self.size.width*self.size.height, sizeof(UInt32))) + super.init() + } + + convenience public init (size: CGSize) { + self.init(size: (width: Int(size.width), height: Int(size.height))) + } + + public func getCGImage () -> CGImage { + let width = self.size.width + let height = self.size.height + + let bitsPerComponent = 8 + let bytesPerPixel = 4 + let bitsPerPixel = bytesPerPixel * 8 + let bytesPerRow = width * bytesPerPixel + + let colorSpace = CGColorSpaceCreateDeviceRGB() + + let renderingIntent = CGColorRenderingIntent.RenderingIntentDefault + + let bitmapInfo = CGBitmapInfo(rawValue: CGBitmapInfo(rawValue: CGImageAlphaInfo.PremultipliedLast.rawValue).rawValue | CGBitmapInfo.ByteOrder32Big.rawValue) + + let bitmapData = self.data + + let bufferLength = width * height * bytesPerPixel + let provider = CGDataProviderCreateWithData(nil, bitmapData, bufferLength, nil) + + let image = CGImageCreate(width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpace, bitmapInfo, provider, nil, true, renderingIntent) + + return image! + } + + public func getUIImage (scale: CGFloat = UIScreen.mainScreen().scale, orientation: UIImageOrientation = UIImageOrientation.Up) -> UIImage { + let image = self.getCGImage() + return UIImage(CGImage: image, scale: scale, orientation: orientation) + } + + public func getPixel (x: Int, _ y: Int) -> FSBitmapPixel { + return FSBitmapPixel(value: self.data[self.index(x, y)]) + } + + public func setPixel (pixel: FSBitmapPixel, point: (x: Int, y: Int)) { + self.data[self.index(point.x, point.y)] = pixel.value + } + + private func index (x: Int, _ y: Int) -> Int { + return self.bytesPerRow*y + x + } +} + +public extension UIImage { + + public func fs_getBitmap () -> FSBitmap { + let imageRef: CGImageRef? = self.CGImage + + //Get image width, height + let pixelsWide = CGImageGetWidth(imageRef) + let pixelsHigh = CGImageGetHeight(imageRef) + + // Declare the number of bytes per row. Each pixel in the bitmap in this + // example is represented by 4 bytes; 8 bits each of red, green, blue, and alpha. + let bytesPerPixel = 4 + let bitsPerComponent = 8 + + let bitmapBytesPerRow = Int(pixelsWide) * bytesPerPixel + + // Use the generic RGB color space. + let colorSpace = CGColorSpaceCreateDeviceRGB() + + // Allocate memory for image data. This is the destination in memory + // where any drawing to the bitmap context will be rendered. + let bitmapData = UnsafeMutablePointer(calloc(pixelsWide*pixelsHigh, sizeof(UInt32))) + + let bitmapInfo = CGBitmapInfo(rawValue: CGImageAlphaInfo.PremultipliedLast.rawValue).rawValue | CGBitmapInfo.ByteOrder32Big.rawValue + + let context = CGBitmapContextCreate(bitmapData, pixelsWide, pixelsHigh, bitsPerComponent, bitmapBytesPerRow, colorSpace, bitmapInfo) + CGContextDrawImage(context, CGRectMake(0, 0, CGFloat(pixelsWide), CGFloat(pixelsHigh)), imageRef) + + return FSBitmap(data: bitmapData, size: (pixelsWide, pixelsHigh)) + } + + public var fs_base64: String { + let imageData = UIImagePNGRepresentation(self)! + let base64String = imageData.base64EncodedStringWithOptions(NSDataBase64EncodingOptions(rawValue: 0)) + return base64String + } +} diff --git a/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UITableView.swift b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UITableView.swift new file mode 100755 index 0000000..99c4828 --- /dev/null +++ b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UITableView.swift @@ -0,0 +1,17 @@ +// +// FSExtensions+UITableView.swift +// SwiftHelpers +// +// Created by Kruperfone on 31.07.15. +// Copyright (c) 2015 FlatStack. All rights reserved. +// + +import UIKit + +public extension UITableView { + public func fs_deselectSelectedRow (animated:Bool) { + if ((self.indexPathForSelectedRow) != nil) { + self.deselectRowAtIndexPath(self.indexPathForSelectedRow!, animated: animated) + } + } +} diff --git a/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UITextView.swift b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UITextView.swift new file mode 100755 index 0000000..e84b674 --- /dev/null +++ b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UITextView.swift @@ -0,0 +1,148 @@ +// +// FSE+UITextField.swift +// SwiftHelpers +// +// Created by Kruperfone on 31.07.15. +// Copyright (c) 2015 FlatStack. All rights reserved. +// + +import UIKit + +public class FSTextView :UITextView { + + private(set) var placeholderLabel:UILabel = UILabel() + + @IBInspectable public var placeholderColor:UIColor { + set (value) { + self.placeholderLabel.textColor = value + } + get { + return self.placeholderLabel.textColor + } + } + + @IBInspectable public var placeholder: String? { + set (value) { + self.placeholderLabel.text = value + } + get { + return self.placeholderLabel.text + } + } + + override public var bounds: CGRect { + didSet { + self.placeholderLabel.preferredMaxLayoutWidth = self.frame.width + } + } + + deinit { + NSNotificationCenter.defaultCenter().removeObserver(self) + self.removeObserver(self, forKeyPath: "text") + } + + override init(frame: CGRect, textContainer: NSTextContainer?) { + super.init(frame: frame, textContainer: textContainer) + self.initialize() + } + + required public init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + self.initialize() + } + + private func initialize () { + self.setupInsets() + self.setupPlaceholder() + + self.addObserver(self, forKeyPath: "text", options: NSKeyValueObservingOptions.New, context: nil) + + NSNotificationCenter.defaultCenter().addObserver(self, selector: "textViewDidBeginEditing:", name: UITextViewTextDidBeginEditingNotification, object: self) + NSNotificationCenter.defaultCenter().addObserver(self, selector: "textViewDidChange:", name: UITextViewTextDidChangeNotification, object: self) + NSNotificationCenter.defaultCenter().addObserver(self, selector: "textViewDidEndEditing:", name: UITextViewTextDidEndEditingNotification, object: self) + } + + private func setupInsets () { + self.textContainerInset = UIEdgeInsetsMake(-4,0,0,0) + self.textContainer.lineFragmentPadding = 0 + } + + private func setupPlaceholder () { + self.placeholderLabel.preferredMaxLayoutWidth = self.frame.width + self.placeholderLabel.translatesAutoresizingMaskIntoConstraints = false + self.placeholderLabel.textColor = FSRGBA(198, 198, 204, 1) + self.placeholderLabel.userInteractionEnabled = false + self.placeholderLabel.numberOfLines = 0 + self.placeholderLabel.font = self.font + + self.addSubview(self.placeholderLabel) + + let insets = self.textContainerInset + let views = ["label": self.placeholderLabel] + let metrics = ["LEFT": insets.left, "TOP": insets.top, "RIGHT": insets.right, "BOTTOM": insets.bottom] + + var constraints:[NSLayoutConstraint] = [] + + constraints += NSLayoutConstraint.constraintsWithVisualFormat("H:|-LEFT-[label]-RIGHT-|", options: [], metrics: metrics, views: views) + constraints += NSLayoutConstraint.constraintsWithVisualFormat("V:|-TOP-[label]-(>=BOTTOM)-|", options: [], metrics: metrics, views: views) + for constraint in constraints { + constraint.priority = 751 + } + + self.addConstraints(constraints) + self.textViewDidChange(nil) + } + + override class public func fs_getTextHeight (forText text:String, width:CGFloat, font:UIFont) -> CGFloat { + let textView = FSTextView(frame: CGRectMake(0, 0, width, 0)) + textView.font = font + textView.text = text + return textView.fs_textHeight + } + + override public var fs_textHeight:CGFloat { + return super.fs_textHeight + } + + override public func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer) { + if keyPath == "text" || object as? NSObject == self { + self.textViewDidChange(nil) + } else { + super.observeValueForKeyPath(keyPath, ofObject: object, change: change, context: context) + } + } + + //MARK: - Notifications + func textViewDidBeginEditing (sender: AnyObject?) { + + } + + func textViewDidChange (sender: AnyObject?) { + if self.text.characters.count == 0 { + self.placeholderLabel.hidden = false + } else { + self.placeholderLabel.hidden = true + } + } + + func textViewDidEndEditing (sender: AnyObject?) { + + } + +} + +extension UITextView { + + class public func fs_getTextHeight (forText text:String, width:CGFloat, font:UIFont) -> CGFloat { + + let textView = UITextView(frame: CGRectMake(0, 0, width, 0)) + textView.font = font + textView.text = text + return textView.fs_textHeight + } + + public var fs_textHeight:CGFloat { + let size = self.sizeThatFits(CGSizeMake(self.fs_width, CGFloat.max)) + return size.height + 1 + } +} diff --git a/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UIView.swift b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UIView.swift new file mode 100755 index 0000000..f02bb71 --- /dev/null +++ b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSExtensions/FSE+UIView.swift @@ -0,0 +1,73 @@ +// +// FSExtensions+UIView.swift +// SwiftHelpers +// +// Created by Kruperfone on 31.07.15. +// Copyright (c) 2015 FlatStack. All rights reserved. +// + +import UIKit + +public extension UIView { + + //MARK: - Set size + + var fs_size: CGSize { + set (value) {self.frame.size = value} + get {return self.frame.size} + } + + var fs_width:CGFloat { + set (value) {self.fs_size = CGSizeMake(value, frame.size.height)} + get {return self.frame.size.width} + } + + var fs_height:CGFloat { + set (value) {self.fs_size = CGSizeMake(frame.size.width, value)} + get {return self.frame.size.height} + } + + //MARK: - Set origin + + var fs_origin: CGPoint { + set (value) {self.frame.origin = value} + get {return self.frame.origin} + } + + var fs_x: CGFloat { + set (value) {self.fs_origin = CGPointMake(value, frame.origin.y)} + get {return self.frame.origin.x} + } + + var fs_y: CGFloat { + set (value) {self.fs_origin = CGPointMake(frame.origin.x, value)} + get {return self.frame.origin.y} + } + + //MARK: - Other + + func fs_findAndResignFirstResponder () -> Bool { + if self.isFirstResponder() { + self.resignFirstResponder() + return true + } + + for view in subviews { + if view.fs_findAndResignFirstResponder() { + return true + } + } + + return false + } + + var fs_allSubviews: [UIView] { + var arr:[UIView] = [self] + + for view in subviews { + arr += view.fs_allSubviews + } + + return arr + } +} diff --git a/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSHelpers.swift b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSHelpers.swift new file mode 100755 index 0000000..c72c23a --- /dev/null +++ b/dayPhoto/Pods/FSHelpers+Swift/Swift/Helpers/FSHelpers.swift @@ -0,0 +1,170 @@ +// +// FSHelpers.swift +// DayPhoto +// +// Created by Kruperfone on 08.12.14. +// Copyright (c) 2014 Flatstack. All rights reserved. +// + + +import UIKit + +//MARK: - Application Directory + +public func FSApplicationDirectoryPath (directoryToSearch:NSSearchPathDirectory) -> String { + return NSSearchPathForDirectoriesInDomains(directoryToSearch, NSSearchPathDomainMask.UserDomainMask, true).first! +} + +public func FSApplicationDirectoryURL (directoryToSearch:NSSearchPathDirectory) -> NSURL { + return NSURL(string: FSApplicationDirectoryPath(directoryToSearch))! +} + +//MARK: - Interface + +public let FSScreenBounds: CGRect = UIScreen.mainScreen().bounds + +public func FSIsIPad () -> Bool { + return UIDevice.currentDevice().userInterfaceIdiom == UIUserInterfaceIdiom.Pad +} + +public func FSIsIPhone () -> Bool { + return UIDevice.currentDevice().userInterfaceIdiom == UIUserInterfaceIdiom.Phone +} + +public func FSScaleFactor () -> CGFloat { + return UIScreen.mainScreen().scale +} + +public func FSIsRetina () -> Bool { + return FSScaleFactor() == 2 +} + +public func FSDeviceOrientation () -> UIDeviceOrientation { + return UIDevice.currentDevice().orientation +} + +//MARK: - System Version + +public func FSSystemVersionEqualTo(version: String) -> Bool { + return UIDevice.currentDevice().systemVersion.compare(version, + options: NSStringCompareOptions.NumericSearch) == NSComparisonResult.OrderedSame +} + +public func FSSystemVersionGreatherThan(version: String) -> Bool { + return UIDevice.currentDevice().systemVersion.compare(version, + options: NSStringCompareOptions.NumericSearch) == NSComparisonResult.OrderedDescending +} + +public func FSSystemVersionGreatherThanOrEqualTo(version: String) -> Bool { + return UIDevice.currentDevice().systemVersion.compare(version, + options: NSStringCompareOptions.NumericSearch) != NSComparisonResult.OrderedAscending +} + +public func FSSystemVersionLessThan(version: String) -> Bool { + return UIDevice.currentDevice().systemVersion.compare(version, + options: NSStringCompareOptions.NumericSearch) == NSComparisonResult.OrderedAscending +} + +public func FSSystemVersionLessThanOrEqualTo(version: String) -> Bool { + return UIDevice.currentDevice().systemVersion.compare(version, + options: NSStringCompareOptions.NumericSearch) != NSComparisonResult.OrderedDescending +} + +//MARK: - Images and colors + +public func FSRGBA (r:CGFloat, _ g:CGFloat, _ b:CGFloat, _ a:CGFloat) -> UIColor { + return UIColor(red: r/255, green: g/255, blue: b/255, alpha: a) +} + +public func FSImageFromColor (color:UIColor) -> UIImage { + + let rect:CGRect = CGRectMake(0, 0, 1, 1) + UIGraphicsBeginImageContext(rect.size) + let context:CGContextRef = UIGraphicsGetCurrentContext()! + + CGContextSetFillColorWithColor(context, color.CGColor) + CGContextFillRect(context, rect) + + let image:UIImage = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + + return image +} + +public func FSRandomColor () -> UIColor { + let red = CGFloat(arc4random_uniform(255))/255.0 + let green = CGFloat(arc4random_uniform(255))/255.0 + let blue = CGFloat(arc4random_uniform(255))/255.0 + + return UIColor(red: red, green: green, blue: blue, alpha: 1) +} + +//MARK: - GCD + +public func FSDispatch_after_short (delay:Double, block:dispatch_block_t) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(delay * Double(NSEC_PER_SEC))), dispatch_get_main_queue(), block); +} + +//MARK: - Other + +public func FSDLog(message: String, function: String = __FUNCTION__, file: String = __FILE__, line: Int = __LINE__) { + #if DEBUG + print("Message \"\(message)\" (File: \(file), Function: \(function), Line: \(line))") + #endif +} + +//MARK: - Enumerations + +public enum FSScreenTypeInch { + case _3_5 + case _4 + case _4_7 + case _5_5 + + public var size:CGSize { + switch self { + case ._3_5: return CGSizeMake(320, 480) + case ._4: return CGSizeMake(320, 568) + case ._4_7: return CGSizeMake(375, 667) + case ._5_5: return CGSizeMake(414, 736) + } + } + + public init () { + self = FSScreenTypeInch.typeForSize(UIScreen.mainScreen().bounds.size) + } + + public init (size: CGSize) { + self = FSScreenTypeInch.typeForSize(size) + } + + static private func typeForSize (size: CGSize) -> FSScreenTypeInch { + let width = min(size.width, size.height) + let height = max(size.width, size.height) + + switch CGSizeMake(width, height) { + case FSScreenTypeInch._3_5.size: return FSScreenTypeInch._3_5 + case FSScreenTypeInch._4.size: return FSScreenTypeInch._4 + case FSScreenTypeInch._4_7.size: return FSScreenTypeInch._4_7 + case FSScreenTypeInch._5_5.size: return FSScreenTypeInch._5_5 + default: return FSScreenTypeInch._4 + } + } + + public func getScreenValue (value3_5 value3_5:Any, value4:Any, value4_7:Any, value5_5:Any) -> Any { + switch self { + case ._3_5: return value3_5 + case ._4: return value4 + case ._4_7: return value4_7 + case ._5_5: return value5_5 + } + } + + public func getScreenCGFloat (value3_5 value3_5:CGFloat, value4:CGFloat, value4_7:CGFloat, value5_5:CGFloat) -> CGFloat { + return self.getScreenValue(value3_5:value3_5, value4: value4, value4_7: value4_7, value5_5: value5_5) as! CGFloat + } + + public func getScreenCGFloat (value4 value4:CGFloat, value4_7:CGFloat, value5_5:CGFloat) -> CGFloat { + return self.getScreenCGFloat(value3_5:value4, value4: value4, value4_7: value4_7, value5_5: value5_5) + } +} diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/AFHTTPRequestOperation.h b/dayPhoto/Pods/Headers/Private/AFNetworking/AFHTTPRequestOperation.h new file mode 120000 index 0000000..ac762c8 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/AFHTTPRequestOperation.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFHTTPRequestOperation.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/AFHTTPRequestOperationManager.h b/dayPhoto/Pods/Headers/Private/AFNetworking/AFHTTPRequestOperationManager.h new file mode 120000 index 0000000..9dcc623 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/AFHTTPRequestOperationManager.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h b/dayPhoto/Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h new file mode 120000 index 0000000..56feb9f --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h b/dayPhoto/Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h new file mode 120000 index 0000000..67519d9 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h b/dayPhoto/Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h new file mode 120000 index 0000000..68fc774 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/AFNetworking.h b/dayPhoto/Pods/Headers/Private/AFNetworking/AFNetworking.h new file mode 120000 index 0000000..a5a38da --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFNetworking.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h b/dayPhoto/Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h new file mode 120000 index 0000000..fd1322d --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFSecurityPolicy.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/AFURLConnectionOperation.h b/dayPhoto/Pods/Headers/Private/AFNetworking/AFURLConnectionOperation.h new file mode 120000 index 0000000..d9b35fb --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/AFURLConnectionOperation.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFURLConnectionOperation.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h b/dayPhoto/Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h new file mode 120000 index 0000000..ca8209b --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h b/dayPhoto/Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h new file mode 120000 index 0000000..e36a765 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/AFURLSessionManager.h b/dayPhoto/Pods/Headers/Private/AFNetworking/AFURLSessionManager.h new file mode 120000 index 0000000..835101d --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/AFURLSessionManager.h @@ -0,0 +1 @@ +../../../AFNetworking/AFNetworking/AFURLSessionManager.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h b/dayPhoto/Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h new file mode 120000 index 0000000..c534ebf --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/UIAlertView+AFNetworking.h b/dayPhoto/Pods/Headers/Private/AFNetworking/UIAlertView+AFNetworking.h new file mode 120000 index 0000000..f992813 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/UIAlertView+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h b/dayPhoto/Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h new file mode 120000 index 0000000..8f2e221 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/UIImage+AFNetworking.h b/dayPhoto/Pods/Headers/Private/AFNetworking/UIImage+AFNetworking.h new file mode 120000 index 0000000..74f6649 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/UIImage+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h b/dayPhoto/Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h new file mode 120000 index 0000000..a95d673 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h b/dayPhoto/Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h new file mode 120000 index 0000000..95017cc --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h b/dayPhoto/Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h new file mode 120000 index 0000000..730b167 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h b/dayPhoto/Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h new file mode 120000 index 0000000..8efd826 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h b/dayPhoto/Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h new file mode 120000 index 0000000..c8df6ef --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h @@ -0,0 +1 @@ +../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalImportFunctions.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalImportFunctions.h new file mode 120000 index 0000000..6c64b47 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalImportFunctions.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/DataImport/MagicalImportFunctions.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+Actions.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+Actions.h new file mode 120000 index 0000000..a062df7 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+Actions.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Core/MagicalRecord+Actions.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+ErrorHandling.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+ErrorHandling.h new file mode 120000 index 0000000..0b21779 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+ErrorHandling.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Core/MagicalRecord+ErrorHandling.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+Options.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+Options.h new file mode 120000 index 0000000..9de19e7 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+Options.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Core/MagicalRecord+Options.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+Setup.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+Setup.h new file mode 120000 index 0000000..ac1e15b --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+Setup.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Core/MagicalRecord+Setup.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+ShorthandMethods.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+ShorthandMethods.h new file mode 120000 index 0000000..e9ae8f2 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+ShorthandMethods.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Core/MagicalRecord+ShorthandMethods.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+iCloud.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+iCloud.h new file mode 120000 index 0000000..d57b60e --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord+iCloud.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Core/MagicalRecord+iCloud.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord.h new file mode 120000 index 0000000..9cd2663 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecord.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/MagicalRecord.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecordDeprecationMacros.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecordDeprecationMacros.h new file mode 120000 index 0000000..1a8ff4e --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecordDeprecationMacros.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Core/MagicalRecordDeprecationMacros.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecordInternal.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecordInternal.h new file mode 120000 index 0000000..5a80fc7 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecordInternal.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Core/MagicalRecordInternal.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecordLogging.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecordLogging.h new file mode 120000 index 0000000..f2ea77f --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecordLogging.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Core/MagicalRecordLogging.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecordShorthandMethodAliases.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecordShorthandMethodAliases.h new file mode 120000 index 0000000..ff5489a --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/MagicalRecordShorthandMethodAliases.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Core/MagicalRecordShorthandMethodAliases.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSAttributeDescription+MagicalDataImport.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSAttributeDescription+MagicalDataImport.h new file mode 120000 index 0000000..035b368 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSAttributeDescription+MagicalDataImport.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/DataImport/NSAttributeDescription+MagicalDataImport.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSEntityDescription+MagicalDataImport.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSEntityDescription+MagicalDataImport.h new file mode 120000 index 0000000..3ffdcd2 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSEntityDescription+MagicalDataImport.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalAggregation.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalAggregation.h new file mode 120000 index 0000000..6b437f6 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalAggregation.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalDataImport.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalDataImport.h new file mode 120000 index 0000000..4f21d48 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalDataImport.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalFinders.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalFinders.h new file mode 120000 index 0000000..2d39fd8 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalFinders.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalRecord.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalRecord.h new file mode 120000 index 0000000..43a0624 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalRecord.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRecord.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalRequests.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalRequests.h new file mode 120000 index 0000000..01f8636 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObject+MagicalRequests.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRequests.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalChainSave.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalChainSave.h new file mode 120000 index 0000000..22fa24d --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalChainSave.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalChainSave.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalObserving.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalObserving.h new file mode 120000 index 0000000..05d08d2 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalObserving.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalRecord.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalRecord.h new file mode 120000 index 0000000..896fada --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalRecord.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalRecord.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalSaves.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalSaves.h new file mode 120000 index 0000000..cb6a2ef --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalSaves.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalSaves.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalThreading.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalThreading.h new file mode 120000 index 0000000..595194a --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectContext+MagicalThreading.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectModel+MagicalRecord.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectModel+MagicalRecord.h new file mode 120000 index 0000000..bca3102 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSManagedObjectModel+MagicalRecord.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSNumber+MagicalDataImport.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSNumber+MagicalDataImport.h new file mode 120000 index 0000000..8eff155 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSNumber+MagicalDataImport.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/DataImport/NSNumber+MagicalDataImport.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSObject+MagicalDataImport.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSObject+MagicalDataImport.h new file mode 120000 index 0000000..11dc59c --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSObject+MagicalDataImport.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSPersistentStore+MagicalRecord.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSPersistentStore+MagicalRecord.h new file mode 120000 index 0000000..b1aee03 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSPersistentStore+MagicalRecord.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/NSPersistentStore+MagicalRecord.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSPersistentStoreCoordinator+MagicalRecord.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSPersistentStoreCoordinator+MagicalRecord.h new file mode 120000 index 0000000..f3e3570 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSPersistentStoreCoordinator+MagicalRecord.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/NSPersistentStoreCoordinator+MagicalRecord.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSRelationshipDescription+MagicalDataImport.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSRelationshipDescription+MagicalDataImport.h new file mode 120000 index 0000000..0246a6c --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSRelationshipDescription+MagicalDataImport.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/DataImport/NSRelationshipDescription+MagicalDataImport.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSString+MagicalDataImport.h b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSString+MagicalDataImport.h new file mode 120000 index 0000000..faa3677 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/MagicalRecord/MagicalRecord/NSString+MagicalDataImport.h @@ -0,0 +1 @@ +../../../../MagicalRecord/MagicalRecord/Categories/DataImport/NSString+MagicalDataImport.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h b/dayPhoto/Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h new file mode 120000 index 0000000..8457498 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/NSData+ImageContentType.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/SDImageCache.h b/dayPhoto/Pods/Headers/Private/SDWebImage/SDImageCache.h new file mode 120000 index 0000000..0040b06 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/SDImageCache.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDImageCache.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageCompat.h b/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageCompat.h new file mode 120000 index 0000000..6ca2478 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageCompat.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageCompat.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageDecoder.h b/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageDecoder.h new file mode 120000 index 0000000..a2f3a68 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageDecoder.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageDecoder.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h b/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h new file mode 120000 index 0000000..303b03b --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageDownloader.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h b/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h new file mode 120000 index 0000000..99441c4 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageManager.h b/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageManager.h new file mode 120000 index 0000000..1b81848 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageManager.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageManager.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageOperation.h b/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageOperation.h new file mode 120000 index 0000000..20e5b89 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImageOperation.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImageOperation.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h b/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h new file mode 120000 index 0000000..50585c6 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/UIButton+WebCache.h b/dayPhoto/Pods/Headers/Private/SDWebImage/UIButton+WebCache.h new file mode 120000 index 0000000..19d2d8e --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/UIButton+WebCache.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIButton+WebCache.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/UIImage+GIF.h b/dayPhoto/Pods/Headers/Private/SDWebImage/UIImage+GIF.h new file mode 120000 index 0000000..14d5aad --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/UIImage+GIF.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIImage+GIF.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h b/dayPhoto/Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h new file mode 120000 index 0000000..1fb9650 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h b/dayPhoto/Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h new file mode 120000 index 0000000..fd4dea4 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h b/dayPhoto/Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h new file mode 120000 index 0000000..0c53a47 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIImageView+WebCache.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h b/dayPhoto/Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h new file mode 120000 index 0000000..f9890c4 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h @@ -0,0 +1 @@ +../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/NSData+MD5.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/NSData+MD5.h new file mode 120000 index 0000000..612e8b8 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/NSData+MD5.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Utils/NSData+MD5.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/NSError+VKError.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/NSError+VKError.h new file mode 120000 index 0000000..5f8ae06 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/NSError+VKError.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Core/NSError+VKError.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/NSString+MD5.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/NSString+MD5.h new file mode 120000 index 0000000..c595391 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/NSString+MD5.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Utils/NSString+MD5.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/OrderedDictionary.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/OrderedDictionary.h new file mode 120000 index 0000000..c0ac2c0 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/OrderedDictionary.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Utils/OrderedDictionary.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKAccessToken.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKAccessToken.h new file mode 120000 index 0000000..703b120 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKAccessToken.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/VKAccessToken.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKActivity.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKActivity.h new file mode 120000 index 0000000..f134aa9 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKActivity.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Views/VKActivity.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApi.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApi.h new file mode 120000 index 0000000..858ebf6 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApi.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/VKApi.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiBase.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiBase.h new file mode 120000 index 0000000..c15660c --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiBase.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/methods/VKApiBase.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiCaptcha.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiCaptcha.h new file mode 120000 index 0000000..b157c78 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiCaptcha.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/methods/VKApiCaptcha.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiConst.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiConst.h new file mode 120000 index 0000000..f5e13cb --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiConst.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/methods/VKApiConst.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiFriends.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiFriends.h new file mode 120000 index 0000000..d41b44e --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiFriends.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/methods/VKApiFriends.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiGroups.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiGroups.h new file mode 120000 index 0000000..b416805 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiGroups.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/methods/VKApiGroups.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiModels.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiModels.h new file mode 120000 index 0000000..3b42803 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiModels.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/methods/VKApiModels.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiObject.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiObject.h new file mode 120000 index 0000000..3f26410 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiObject.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/models/VKApiObject.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiObjectArray.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiObjectArray.h new file mode 120000 index 0000000..bd76241 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiObjectArray.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/models/VKApiObjectArray.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiPhotos.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiPhotos.h new file mode 120000 index 0000000..f6cae0a --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiPhotos.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/methods/VKApiPhotos.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiUsers.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiUsers.h new file mode 120000 index 0000000..18c4bf4 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiUsers.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/methods/VKApiUsers.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiWall.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiWall.h new file mode 120000 index 0000000..88780ad --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKApiWall.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/methods/VKApiWall.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKAudio.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKAudio.h new file mode 120000 index 0000000..57953b8 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKAudio.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/models/VKAudio.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKAuthorizationResult.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKAuthorizationResult.h new file mode 120000 index 0000000..0eb667b --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKAuthorizationResult.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/VKAuthorizationResult.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKAuthorizeController.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKAuthorizeController.h new file mode 120000 index 0000000..032874d --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKAuthorizeController.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Views/VKAuthorizeController.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKBatchRequest.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKBatchRequest.h new file mode 120000 index 0000000..997330b --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKBatchRequest.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/VKBatchRequest.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKBundle.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKBundle.h new file mode 120000 index 0000000..6f2ecda --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKBundle.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/VKBundle.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKCaptchaView.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKCaptchaView.h new file mode 120000 index 0000000..75218f5 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKCaptchaView.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Views/VKCaptchaView.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKCaptchaViewController.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKCaptchaViewController.h new file mode 120000 index 0000000..de7cb43 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKCaptchaViewController.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Views/VKCaptchaViewController.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKCounters.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKCounters.h new file mode 120000 index 0000000..7bc2e52 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKCounters.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/models/VKCounters.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKError.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKError.h new file mode 120000 index 0000000..bef8521 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKError.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Core/VKError.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKGroup.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKGroup.h new file mode 120000 index 0000000..9fb0777 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKGroup.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/models/VKGroup.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKHTTPClient.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKHTTPClient.h new file mode 120000 index 0000000..ad8af99 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKHTTPClient.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Core/VKHTTPClient.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKHTTPOperation.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKHTTPOperation.h new file mode 120000 index 0000000..d11bf22 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKHTTPOperation.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Core/VKHTTPOperation.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKImageParameters.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKImageParameters.h new file mode 120000 index 0000000..5b2cad6 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKImageParameters.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Image/VKImageParameters.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKJSONOperation.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKJSONOperation.h new file mode 120000 index 0000000..fc863c5 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKJSONOperation.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Core/VKJSONOperation.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKLikes.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKLikes.h new file mode 120000 index 0000000..4e84553 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKLikes.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/models/VKLikes.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKObject.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKObject.h new file mode 120000 index 0000000..34c482d --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKObject.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Core/VKObject.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKOperation.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKOperation.h new file mode 120000 index 0000000..4c56129 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKOperation.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Core/VKOperation.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKPermissions.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKPermissions.h new file mode 120000 index 0000000..20783be --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKPermissions.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/VKPermissions.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKPhoto.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKPhoto.h new file mode 120000 index 0000000..e0c336a --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKPhoto.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/models/VKPhoto.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKPhotoSize.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKPhotoSize.h new file mode 120000 index 0000000..a3687de --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKPhotoSize.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/models/VKPhotoSize.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKRelative.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKRelative.h new file mode 120000 index 0000000..e061164 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKRelative.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/models/VKRelative.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKRequest.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKRequest.h new file mode 120000 index 0000000..a386925 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKRequest.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Core/VKRequest.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKRequestsScheduler.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKRequestsScheduler.h new file mode 120000 index 0000000..93b45f1 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKRequestsScheduler.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Core/VKRequestsScheduler.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKResponse.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKResponse.h new file mode 120000 index 0000000..7f3781e --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKResponse.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Core/VKResponse.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKSchool.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKSchool.h new file mode 120000 index 0000000..828afff --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKSchool.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/models/VKSchool.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKSdk.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKSdk.h new file mode 120000 index 0000000..6a7d76a --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKSdk.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/VKSdk.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKSdkVersion.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKSdkVersion.h new file mode 120000 index 0000000..b38ef9b --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKSdkVersion.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/VKSdkVersion.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKShareDialogController.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKShareDialogController.h new file mode 120000 index 0000000..303bf4e --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKShareDialogController.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Views/VKShareDialogController.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKSharedTransitioningObject.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKSharedTransitioningObject.h new file mode 120000 index 0000000..efe9c1f --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKSharedTransitioningObject.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Views/VKSharedTransitioningObject.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUniversity.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUniversity.h new file mode 120000 index 0000000..fd57b3a --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUniversity.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/models/VKUniversity.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadImage.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadImage.h new file mode 120000 index 0000000..8cb228c --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadImage.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Image/VKUploadImage.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadMessagesPhotoRequest.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadMessagesPhotoRequest.h new file mode 120000 index 0000000..6526e6d --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadMessagesPhotoRequest.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/upload/VKUploadMessagesPhotoRequest.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadPhotoBase.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadPhotoBase.h new file mode 120000 index 0000000..1f2d27a --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadPhotoBase.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/upload/VKUploadPhotoBase.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadPhotoRequest.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadPhotoRequest.h new file mode 120000 index 0000000..64330b4 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadPhotoRequest.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/upload/VKUploadPhotoRequest.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadWallPhotoRequest.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadWallPhotoRequest.h new file mode 120000 index 0000000..0a7895c --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUploadWallPhotoRequest.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/upload/VKUploadWallPhotoRequest.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUser.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUser.h new file mode 120000 index 0000000..bbf0590 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUser.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/API/models/VKUser.h \ No newline at end of file diff --git a/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUtil.h b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUtil.h new file mode 120000 index 0000000..ccb68d6 --- /dev/null +++ b/dayPhoto/Pods/Headers/Private/VK-ios-sdk/VKUtil.h @@ -0,0 +1 @@ +../../../VK-ios-sdk/library/Source/Utils/VKUtil.h \ No newline at end of file diff --git a/dayPhoto/Pods/MagicalRecord/LICENSE b/dayPhoto/Pods/MagicalRecord/LICENSE new file mode 100644 index 0000000..287f101 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/LICENSE @@ -0,0 +1,26 @@ + Copyright (c) 2010-2015, Magical Panda Software, LLC + + 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: + + * Link to the MagicalRecord Repository at http:/github.com/magicalpanda/magicalrecord in the credits section of your application + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + This software license is in accordance with the standard MIT License. + + 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/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/MagicalImportFunctions.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/MagicalImportFunctions.h new file mode 100644 index 0000000..fc71f49 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/MagicalImportFunctions.h @@ -0,0 +1,26 @@ +// +// MagicalImportFunctions.h +// Magical Record +// +// Created by Saul Mora on 3/7/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import + +NSDate * MR_adjustDateForDST(NSDate *date); +NSDate * MR_dateFromString(NSString *value, NSString *format); +NSDate * MR_dateFromNumber(NSNumber *value, BOOL milliseconds); +NSNumber * MR_numberFromString(NSString *value); +NSString * MR_attributeNameFromString(NSString *value); +NSString * MR_primaryKeyNameFromString(NSString *value); + +#if TARGET_OS_IPHONE +#import +UIColor * MR_colorFromString(NSString *serializedColor); +#else +#import +NSColor * MR_colorFromString(NSString *serializedColor); +#endif + +NSInteger* MR_newColorComponentsFromString(NSString *serializedColor); diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/MagicalImportFunctions.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/MagicalImportFunctions.m new file mode 100644 index 0000000..bfd31a9 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/MagicalImportFunctions.m @@ -0,0 +1,124 @@ +// +// MagicalImportFunctions.m +// Magical Record +// +// Created by Saul Mora on 3/7/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import "MagicalImportFunctions.h" + + +#pragma mark - Data import helper functions + +NSString * MR_attributeNameFromString(NSString *value) +{ + NSString *firstCharacter = [[value substringToIndex:1] capitalizedString]; + return [firstCharacter stringByAppendingString:[value substringFromIndex:1]]; +} + +NSString * MR_primaryKeyNameFromString(NSString *value) +{ + NSString *firstCharacter = [[value substringToIndex:1] lowercaseString]; + return [firstCharacter stringByAppendingFormat:@"%@ID", [value substringFromIndex:1]]; +} + +NSDate * MR_adjustDateForDST(NSDate *date) +{ + NSTimeInterval dstOffset = [[NSTimeZone localTimeZone] daylightSavingTimeOffsetForDate:date]; + NSDate *actualDate = [date dateByAddingTimeInterval:dstOffset]; + + return actualDate; +} + +NSDate * MR_dateFromString(NSString *value, NSString *format) +{ + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + [formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; + [formatter setLocale:[NSLocale currentLocale]]; + [formatter setDateFormat:format]; + + NSDate *parsedDate = [formatter dateFromString:value]; + + return parsedDate; +} + +NSDate * MR_dateFromNumber(NSNumber *value, BOOL milliseconds) +{ + NSTimeInterval timeInterval = [value doubleValue]; + if (milliseconds) { + timeInterval = timeInterval / 1000.00; + } + return [NSDate dateWithTimeIntervalSince1970:timeInterval]; +} + +NSNumber * MR_numberFromString(NSString *value) { + return [NSNumber numberWithDouble:[value doubleValue]]; +} + +NSInteger* MR_newColorComponentsFromString(NSString *serializedColor) +{ + NSScanner *colorScanner = [NSScanner scannerWithString:serializedColor]; + NSString *colorType; + [colorScanner scanUpToString:@"(" intoString:&colorType]; + + NSInteger *componentValues = malloc(4 * sizeof(NSInteger)); + if (componentValues == NULL) + { + return NULL; + } + + if ([colorType hasPrefix:@"rgba"]) + { + NSCharacterSet *rgbaCharacterSet = [NSCharacterSet characterSetWithCharactersInString:@"(,)"]; + + NSInteger *componentValue = componentValues; + while (![colorScanner isAtEnd]) + { + [colorScanner scanCharactersFromSet:rgbaCharacterSet intoString:nil]; + [colorScanner scanInteger:componentValue]; + componentValue++; + } + } + + return componentValues; +} + +#if TARGET_OS_IPHONE + +UIColor * MR_colorFromString(NSString *serializedColor) +{ + NSInteger *componentValues = MR_newColorComponentsFromString(serializedColor); + if (componentValues == NULL) + { + return nil; + } + + UIColor *color = [UIColor colorWithRed:(componentValues[0] / 255.0f) + green:(componentValues[1] / 255.0f) + blue:(componentValues[2] / 255.0f) + alpha:componentValues[3]]; + + free(componentValues); + return color; +} + +#else + +NSColor * MR_colorFromString(NSString *serializedColor) +{ + NSInteger *componentValues = MR_newColorComponentsFromString(serializedColor); + if (componentValues == NULL) + { + return nil; + } + + NSColor *color = [NSColor colorWithDeviceRed:(componentValues[0] / 255.0f) + green:(componentValues[1] / 255.0f) + blue:(componentValues[2] / 255.0f) + alpha:componentValues[3]]; + free(componentValues); + return color; +} + +#endif diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSAttributeDescription+MagicalDataImport.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSAttributeDescription+MagicalDataImport.h new file mode 100644 index 0000000..ee99d5f --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSAttributeDescription+MagicalDataImport.h @@ -0,0 +1,16 @@ +// +// NSAttributeDescription+MagicalDataImport.h +// Magical Record +// +// Created by Saul Mora on 9/4/11. +// Copyright 2011 Magical Panda Software LLC. All rights reserved. +// + +#import + +@interface NSAttributeDescription (MagicalRecord_DataImport) + +- (NSString *) MR_primaryKey; +- (id) MR_valueForKeyPath:(NSString *)keyPath fromObjectData:(id)objectData; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSAttributeDescription+MagicalDataImport.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSAttributeDescription+MagicalDataImport.m new file mode 100644 index 0000000..b79f414 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSAttributeDescription+MagicalDataImport.m @@ -0,0 +1,73 @@ +// +// NSAttributeDescription+MagicalDataImport.m +// Magical Record +// +// Created by Saul Mora on 9/4/11. +// Copyright 2011 Magical Panda Software LLC. All rights reserved. +// + +#import "NSAttributeDescription+MagicalDataImport.h" +#import "NSManagedObject+MagicalDataImport.h" +#import "MagicalImportFunctions.h" + +@implementation NSAttributeDescription (MagicalRecord_DataImport) + +- (NSString *) MR_primaryKey; +{ + return nil; +} + +- (id) MR_valueForKeyPath:(NSString *)keyPath fromObjectData:(id)objectData; +{ + id value = [objectData valueForKeyPath:keyPath]; + + NSAttributeType attributeType = [self attributeType]; + NSString *desiredAttributeType = [[self userInfo] valueForKey:kMagicalRecordImportAttributeValueClassNameKey]; + if (desiredAttributeType) + { + if ([desiredAttributeType hasSuffix:@"Color"]) + { + value = MR_colorFromString(value); + } + } + else + { + if (attributeType == NSDateAttributeType) + { + if (![value isKindOfClass:[NSDate class]]) + { + NSString *dateFormat = [[self userInfo] valueForKey:kMagicalRecordImportCustomDateFormatKey]; + if ([value isKindOfClass:[NSNumber class]]) { + value = MR_dateFromNumber(value, [dateFormat isEqualToString:kMagicalRecordImportUnixTimeString]); + } + else { + value = MR_dateFromString([value description], dateFormat ?: kMagicalRecordImportDefaultDateFormatString); + } + } + } + else if (attributeType == NSInteger16AttributeType || + attributeType == NSInteger32AttributeType || + attributeType == NSInteger64AttributeType || + attributeType == NSDecimalAttributeType || + attributeType == NSDoubleAttributeType || + attributeType == NSFloatAttributeType) { + if (![value isKindOfClass:[NSNumber class]] && value != [NSNull null]) { + value = MR_numberFromString([value description]); + } + } + else if (attributeType == NSBooleanAttributeType) { + if (![value isKindOfClass:[NSNumber class]] && value != [NSNull null]) { + value = [NSNumber numberWithBool:[value boolValue]]; + } + } + else if (attributeType == NSStringAttributeType) { + if (![value isKindOfClass:[NSString class]] && value != [NSNull null]) { + value = [value description]; + } + } + } + + return value == [NSNull null] ? nil : value; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.h new file mode 100644 index 0000000..078ab30 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.h @@ -0,0 +1,27 @@ +// +// NSEntityDescription+MagicalDataImport.h +// Magical Record +// +// Created by Saul Mora on 9/5/11. +// Copyright 2011 Magical Panda Software LLC. All rights reserved. +// + +#import + +@interface NSEntityDescription (MagicalRecord_DataImport) + +- (NSAttributeDescription *) MR_primaryAttributeToRelateBy; +- (NSManagedObject *) MR_createInstanceInContext:(NSManagedObjectContext *)context; + +/** + * Safely returns an attribute description for the given name, otherwise returns nil. In certain circumstances, the keys of the dictionary returned by `attributesByName` are not standard NSStrings and won't match using object subscripting or standard `objectForKey:` lookups. + * + * There may be performance implications to using this method if your entity has hundreds or thousands of attributes. + * + * @param name Name of the attribute description in the `attributesByName` dictionary on this instance + * + * @return The attribute description for the given name, otherwise nil + */ +- (NSAttributeDescription *) MR_attributeDescriptionForName:(NSString *)name; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.m new file mode 100644 index 0000000..33d7dca --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.m @@ -0,0 +1,52 @@ +// +// NSEntityDescription+MagicalDataImport.m +// Magical Record +// +// Created by Saul Mora on 9/5/11. +// Copyright 2011 Magical Panda Software LLC. All rights reserved. +// + +#import "NSEntityDescription+MagicalDataImport.h" +#import "NSManagedObject+MagicalDataImport.h" +#import "NSManagedObject+MagicalRecord.h" +#import "MagicalImportFunctions.h" + +@implementation NSEntityDescription (MagicalRecord_DataImport) + +- (NSAttributeDescription *) MR_primaryAttributeToRelateBy; +{ + NSString *lookupKey = [[self userInfo] valueForKey:kMagicalRecordImportRelationshipLinkedByKey] ?: MR_primaryKeyNameFromString([self name]); + + return [self MR_attributeDescriptionForName:lookupKey]; +} + +- (NSManagedObject *) MR_createInstanceInContext:(NSManagedObjectContext *)context; +{ + Class relatedClass = NSClassFromString([self managedObjectClassName]); + NSManagedObject *newInstance = [relatedClass MR_createEntityInContext:context]; + + return newInstance; +} + +- (NSAttributeDescription *) MR_attributeDescriptionForName:(NSString *)name; +{ + __block NSAttributeDescription *attributeDescription; + + NSDictionary *attributesByName = [self attributesByName]; + + if ([attributesByName count] == 0) { + return nil; + } + + [attributesByName enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + if ([key isEqualToString:name]) { + attributeDescription = obj; + + *stop = YES; + } + }]; + + return attributeDescription; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSNumber+MagicalDataImport.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSNumber+MagicalDataImport.h new file mode 100644 index 0000000..5da2b91 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSNumber+MagicalDataImport.h @@ -0,0 +1,17 @@ +// +// NSNumber+MagicalDataImport.h +// Magical Record +// +// Created by Saul Mora on 9/4/11. +// Copyright 2011 Magical Panda Software LLC. All rights reserved. +// + +#import +#import + +@interface NSNumber (MagicalRecord_DataImport) + +- (NSString *) MR_lookupKeyForAttribute:(NSAttributeDescription *)attributeInfo; +- (id) MR_relatedValueForRelationship:(NSRelationshipDescription *)relationshipInfo; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSNumber+MagicalDataImport.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSNumber+MagicalDataImport.m new file mode 100644 index 0000000..561af39 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSNumber+MagicalDataImport.m @@ -0,0 +1,25 @@ +// +// NSNumber+MagicalDataImport.m +// Magical Record +// +// Created by Saul Mora on 9/4/11. +// Copyright 2011 Magical Panda Software LLC. All rights reserved. +// + +#import "NSNumber+MagicalDataImport.h" + + + +@implementation NSNumber (MagicalRecord_DataImport) + +- (id) MR_relatedValueForRelationship:(NSRelationshipDescription *)relationshipInfo +{ + return self; +} + +- (NSString *) MR_lookupKeyForAttribute:(NSAttributeDescription *)attributeInfo +{ + return nil; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.h new file mode 100644 index 0000000..80c1765 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.h @@ -0,0 +1,20 @@ +// +// NSDictionary+MagicalDataImport.h +// Magical Record +// +// Created by Saul Mora on 9/4/11. +// Copyright 2011 Magical Panda Software LLC. All rights reserved. +// + +#import +#import + +@interface NSObject (MagicalRecord_DataImport) + +- (NSString *) MR_lookupKeyForAttribute:(NSAttributeDescription *)attributeInfo; +- (id) MR_valueForAttribute:(NSAttributeDescription *)attributeInfo; + +- (NSString *) MR_lookupKeyForRelationship:(NSRelationshipDescription *)relationshipInfo; +- (id) MR_relatedValueForRelationship:(NSRelationshipDescription *)relationshipInfo; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.m new file mode 100644 index 0000000..ece3c59 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.m @@ -0,0 +1,70 @@ +// +// NSDictionary+MagicalDataImport.m +// Magical Record +// +// Created by Saul Mora on 9/4/11. +// Copyright 2011 Magical Panda Software LLC. All rights reserved. +// + +#import "NSObject+MagicalDataImport.h" +#import "NSAttributeDescription+MagicalDataImport.h" +#import "NSEntityDescription+MagicalDataImport.h" +#import "NSManagedObject+MagicalDataImport.h" +#import "NSRelationshipDescription+MagicalDataImport.h" +#import "MagicalRecordLogging.h" + +NSUInteger const kMagicalRecordImportMaximumAttributeFailoverDepth = 10; + + +@implementation NSObject (MagicalRecord_DataImport) + +- (NSString *) MR_lookupKeyForAttribute:(NSAttributeDescription *)attributeInfo; +{ + NSString *attributeName = [attributeInfo name]; + NSString *lookupKey = [[attributeInfo userInfo] valueForKey:kMagicalRecordImportAttributeKeyMapKey] ?: attributeName; + + id value = [self valueForKeyPath:lookupKey]; + + for (NSUInteger i = 1; i < kMagicalRecordImportMaximumAttributeFailoverDepth && value == nil; i++) + { + attributeName = [NSString stringWithFormat:@"%@.%lu", kMagicalRecordImportAttributeKeyMapKey, (unsigned long)i]; + lookupKey = [[attributeInfo userInfo] valueForKey:attributeName]; + if (lookupKey == nil) + { + return nil; + } + value = [self valueForKeyPath:lookupKey]; + } + + return value != nil ? lookupKey : nil; +} + +- (id) MR_valueForAttribute:(NSAttributeDescription *)attributeInfo +{ + NSString *lookupKey = [self MR_lookupKeyForAttribute:attributeInfo]; + return lookupKey ? [self valueForKeyPath:lookupKey] : nil; +} + +- (NSString *) MR_lookupKeyForRelationship:(NSRelationshipDescription *)relationshipInfo +{ + NSEntityDescription *destinationEntity = [relationshipInfo destinationEntity]; + if (destinationEntity == nil) + { + MRLogError(@"Unable to find entity for type '%@'", [self valueForKey:kMagicalRecordImportRelationshipTypeKey]); + return nil; + } + + NSString *primaryKeyName = [relationshipInfo MR_primaryKey]; + NSAttributeDescription *primaryKeyAttribute = [destinationEntity MR_attributeDescriptionForName:primaryKeyName]; + NSString *lookupKey = [self MR_lookupKeyForAttribute:primaryKeyAttribute] ?: [primaryKeyAttribute name]; + + return lookupKey; +} + +- (id) MR_relatedValueForRelationship:(NSRelationshipDescription *)relationshipInfo +{ + NSString *lookupKey = [self MR_lookupKeyForRelationship:relationshipInfo]; + return lookupKey ? [self valueForKeyPath:lookupKey] : nil; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSRelationshipDescription+MagicalDataImport.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSRelationshipDescription+MagicalDataImport.h new file mode 100644 index 0000000..118c943 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSRelationshipDescription+MagicalDataImport.h @@ -0,0 +1,15 @@ +// +// NSRelationshipDescription+MagicalDataImport.h +// Magical Record +// +// Created by Saul Mora on 9/4/11. +// Copyright 2011 Magical Panda Software LLC. All rights reserved. +// + +#import + +@interface NSRelationshipDescription (MagicalRecord_DataImport) + +- (NSString *) MR_primaryKey; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSRelationshipDescription+MagicalDataImport.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSRelationshipDescription+MagicalDataImport.m new file mode 100644 index 0000000..a6adbe0 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSRelationshipDescription+MagicalDataImport.m @@ -0,0 +1,23 @@ +// +// NSRelationshipDescription+MagicalDataImport.m +// Magical Record +// +// Created by Saul Mora on 9/4/11. +// Copyright 2011 Magical Panda Software LLC. All rights reserved. +// + +#import "NSRelationshipDescription+MagicalDataImport.h" +#import "NSManagedObject+MagicalDataImport.h" +#import "MagicalImportFunctions.h" + +@implementation NSRelationshipDescription (MagicalRecord_DataImport) + +- (NSString *) MR_primaryKey; +{ + NSString *primaryKeyName = [[self userInfo] valueForKey:kMagicalRecordImportRelationshipLinkedByKey] ?: + MR_primaryKeyNameFromString([[self destinationEntity] name]); + + return primaryKeyName; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSString+MagicalDataImport.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSString+MagicalDataImport.h new file mode 100644 index 0000000..3d3778a --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSString+MagicalDataImport.h @@ -0,0 +1,16 @@ +// +// NSString+MagicalRecord_MagicalDataImport.h +// Magical Record +// +// Created by Saul Mora on 12/10/11. +// Copyright (c) 2011 Magical Panda Software LLC. All rights reserved. +// + +#import +#import + +@interface NSString (MagicalRecord_DataImport) + +- (NSString *) MR_capitalizedFirstCharacterString; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSString+MagicalDataImport.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSString+MagicalDataImport.m new file mode 100644 index 0000000..6af78db --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/DataImport/NSString+MagicalDataImport.m @@ -0,0 +1,35 @@ +// +// NSString+MagicalRecord_MagicalDataImport.m +// Magical Record +// +// Created by Saul Mora on 12/10/11. +// Copyright (c) 2011 Magical Panda Software LLC. All rights reserved. +// + +#import "NSString+MagicalDataImport.h" + + +@implementation NSString (MagicalRecord_DataImport) + +- (NSString *) MR_capitalizedFirstCharacterString; +{ + if ([self length] > 0) + { + NSString *firstChar = [[self substringToIndex:1] capitalizedString]; + return [firstChar stringByAppendingString:[self substringFromIndex:1]]; + } + return self; +} + +- (id) MR_relatedValueForRelationship:(NSRelationshipDescription *)relationshipInfo +{ + return self; +} + +- (NSString *) MR_lookupKeyForAttribute:(NSAttributeDescription *)attributeInfo +{ + return nil; +} + +@end + diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.h new file mode 100644 index 0000000..046482a --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.h @@ -0,0 +1,68 @@ +// +// NSManagedObject+MagicalAggregation.h +// Magical Record +// +// Created by Saul Mora on 3/7/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import + +@interface NSManagedObject (MagicalAggregation) + ++ (NSNumber *) MR_numberOfEntities; ++ (NSNumber *) MR_numberOfEntitiesWithContext:(NSManagedObjectContext *)context; ++ (NSNumber *) MR_numberOfEntitiesWithPredicate:(NSPredicate *)searchTerm; ++ (NSNumber *) MR_numberOfEntitiesWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; + ++ (NSUInteger) MR_countOfEntities; ++ (NSUInteger) MR_countOfEntitiesWithContext:(NSManagedObjectContext *)context; ++ (NSUInteger) MR_countOfEntitiesWithPredicate:(NSPredicate *)searchFilter; ++ (NSUInteger) MR_countOfEntitiesWithPredicate:(NSPredicate *)searchFilter inContext:(NSManagedObjectContext *)context; + ++ (BOOL) MR_hasAtLeastOneEntity; ++ (BOOL) MR_hasAtLeastOneEntityInContext:(NSManagedObjectContext *)context; + +- (id) MR_minValueFor:(NSString *)property; +- (id) MR_maxValueFor:(NSString *)property; + ++ (id) MR_aggregateOperation:(NSString *)function onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)context; ++ (id) MR_aggregateOperation:(NSString *)function onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate; + +/** + * Supports aggregating values using a key-value collection operator that can be grouped by an attribute. + * See https://developer.apple.com/library/ios/documentation/cocoa/conceptual/KeyValueCoding/Articles/CollectionOperators.html for a list of valid collection operators. + * + * @since 2.3.0 + * + * @param collectionOperator Collection operator + * @param attributeName Entity attribute to apply the collection operator to + * @param predicate Predicate to filter results + * @param groupingKeyPath Key path to group results by + * @param context Context to perform the request in + * + * @return Results of the collection operator, filtered by the provided predicate and grouped by the provided key path + */ ++ (NSArray *) MR_aggregateOperation:(NSString *)collectionOperator onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate groupBy:(NSString*)groupingKeyPath inContext:(NSManagedObjectContext *)context; + +/** + * Supports aggregating values using a key-value collection operator that can be grouped by an attribute. + * See https://developer.apple.com/library/ios/documentation/cocoa/conceptual/KeyValueCoding/Articles/CollectionOperators.html for a list of valid collection operators. + * + * This method is run against the default MagicalRecordStack's context. + * + * @since 2.3.0 + * + * @param collectionOperator Collection operator + * @param attributeName Entity attribute to apply the collection operator to + * @param predicate Predicate to filter results + * @param groupingKeyPath Key path to group results by + * + * @return Results of the collection operator, filtered by the provided predicate and grouped by the provided key path + */ ++ (NSArray *) MR_aggregateOperation:(NSString *)collectionOperator onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate groupBy:(NSString*)groupingKeyPath; + +- (instancetype) MR_objectWithMinValueFor:(NSString *)property; +- (instancetype) MR_objectWithMinValueFor:(NSString *)property inContext:(NSManagedObjectContext *)context; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.m new file mode 100644 index 0000000..e7324a3 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.m @@ -0,0 +1,199 @@ +// +// NSManagedObject+MagicalAggregation.m +// Magical Record +// +// Created by Saul Mora on 3/7/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import "NSManagedObject+MagicalAggregation.h" +#import "NSEntityDescription+MagicalDataImport.h" +#import "NSManagedObjectContext+MagicalRecord.h" +#import "NSManagedObjectContext+MagicalThreading.h" +#import "NSManagedObject+MagicalRequests.h" +#import "NSManagedObject+MagicalRecord.h" +#import "NSManagedObject+MagicalFinders.h" +#import "MagicalRecord+ErrorHandling.h" + +@implementation NSManagedObject (MagicalAggregation) + +#pragma mark - +#pragma mark Number of Entities + ++ (NSNumber *) MR_numberOfEntitiesWithContext:(NSManagedObjectContext *)context +{ + return [NSNumber numberWithUnsignedInteger:[self MR_countOfEntitiesWithContext:context]]; +} + ++ (NSNumber *) MR_numberOfEntities +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_numberOfEntitiesWithContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSNumber *) MR_numberOfEntitiesWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context +{ + return [NSNumber numberWithUnsignedInteger:[self MR_countOfEntitiesWithPredicate:searchTerm inContext:context]]; +} + ++ (NSNumber *) MR_numberOfEntitiesWithPredicate:(NSPredicate *)searchTerm; +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_numberOfEntitiesWithPredicate:searchTerm + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSUInteger) MR_countOfEntities; +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_countOfEntitiesWithContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSUInteger) MR_countOfEntitiesWithContext:(NSManagedObjectContext *)context; +{ + return [self MR_countOfEntitiesWithPredicate:nil inContext:context]; +} + ++ (NSUInteger) MR_countOfEntitiesWithPredicate:(NSPredicate *)searchFilter; +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_countOfEntitiesWithPredicate:searchFilter inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSUInteger) MR_countOfEntitiesWithPredicate:(NSPredicate *)searchFilter inContext:(NSManagedObjectContext *)context; +{ + NSError *error = nil; + NSFetchRequest *request = [self MR_createFetchRequestInContext:context]; + + if (searchFilter) + { + [request setPredicate:searchFilter]; + } + + NSUInteger count = [context countForFetchRequest:request error:&error]; + [MagicalRecord handleErrors:error]; + + return count; +} + ++ (BOOL) MR_hasAtLeastOneEntity +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_hasAtLeastOneEntityInContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (BOOL) MR_hasAtLeastOneEntityInContext:(NSManagedObjectContext *)context +{ + return [[self MR_numberOfEntitiesWithContext:context] intValue] > 0; +} + +- (id) MR_minValueFor:(NSString *)property +{ + NSManagedObject *obj = [[self class] MR_findFirstByAttribute:property + withValue:[NSString stringWithFormat:@"min(%@)", property]]; + + return [obj valueForKey:property]; +} + +- (id) MR_maxValueFor:(NSString *)property +{ + NSManagedObject *obj = [[self class] MR_findFirstByAttribute:property + withValue:[NSString stringWithFormat:@"max(%@)", property]]; + + return [obj valueForKey:property]; +} + +- (id) MR_objectWithMinValueFor:(NSString *)property inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [[self class] MR_createFetchRequestInContext:context]; + + NSPredicate *searchFor = [NSPredicate predicateWithFormat:@"SELF = %@ AND %K = min(%@)", self, property, property]; + [request setPredicate:searchFor]; + + return [[self class] MR_executeFetchRequestAndReturnFirstObject:request inContext:context]; +} + +- (id) MR_objectWithMinValueFor:(NSString *)property +{ + return [self MR_objectWithMinValueFor:property inContext:[self managedObjectContext]]; +} + ++ (id) MR_aggregateOperation:(NSString *)function onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)context +{ + NSExpression *ex = [NSExpression expressionForFunction:function + arguments:[NSArray arrayWithObject:[NSExpression expressionForKeyPath:attributeName]]]; + + NSExpressionDescription *ed = [[NSExpressionDescription alloc] init]; + [ed setName:@"result"]; + [ed setExpression:ex]; + + // determine the type of attribute, required to set the expression return type + NSAttributeDescription *attributeDescription = [[self MR_entityDescriptionInContext:context] MR_attributeDescriptionForName:attributeName]; + [ed setExpressionResultType:[attributeDescription attributeType]]; + NSArray *properties = [NSArray arrayWithObject:ed]; + + NSFetchRequest *request = [self MR_requestAllWithPredicate:predicate inContext:context]; + [request setPropertiesToFetch:properties]; + [request setResultType:NSDictionaryResultType]; + + NSDictionary *resultsDictionary = [self MR_executeFetchRequestAndReturnFirstObject:request inContext:context]; + + return [resultsDictionary objectForKey:@"result"]; +} + ++ (id) MR_aggregateOperation:(NSString *)function onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_aggregateOperation:function + onAttribute:attributeName + withPredicate:predicate + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSArray *) MR_aggregateOperation:(NSString *)collectionOperator onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate groupBy:(NSString *)groupingKeyPath inContext:(NSManagedObjectContext *)context; +{ + NSExpression *expression = [NSExpression expressionForFunction:collectionOperator arguments:[NSArray arrayWithObject:[NSExpression expressionForKeyPath:attributeName]]]; + + NSExpressionDescription *expressionDescription = [[NSExpressionDescription alloc] init]; + + [expressionDescription setName:@"result"]; + [expressionDescription setExpression:expression]; + + NSAttributeDescription *attributeDescription = [[[self MR_entityDescriptionInContext:context] attributesByName] objectForKey:attributeName]; + [expressionDescription setExpressionResultType:[attributeDescription attributeType]]; + NSArray *properties = [NSArray arrayWithObjects:groupingKeyPath, expressionDescription, nil]; + + NSFetchRequest *fetchRequest = [self MR_requestAllWithPredicate:predicate inContext:context]; + [fetchRequest setPropertiesToFetch:properties]; + [fetchRequest setResultType:NSDictionaryResultType]; + [fetchRequest setPropertiesToGroupBy:[NSArray arrayWithObject:groupingKeyPath]]; + + NSArray *results = [self MR_executeFetchRequest:fetchRequest inContext:context]; + + return results; +} + ++ (NSArray *) MR_aggregateOperation:(NSString *)collectionOperator onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate groupBy:(NSString *)groupingKeyPath; +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_aggregateOperation:collectionOperator + onAttribute:attributeName + withPredicate:predicate groupBy:groupingKeyPath + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h new file mode 100644 index 0000000..c42533d --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h @@ -0,0 +1,39 @@ +// +// NSManagedObject+JSONHelpers.h +// +// Created by Saul Mora on 6/28/11. +// Copyright 2011 Magical Panda Software LLC. All rights reserved. +// + +#import + +extern NSString * const kMagicalRecordImportCustomDateFormatKey; +extern NSString * const kMagicalRecordImportDefaultDateFormatString; +extern NSString * const kMagicalRecordImportUnixTimeString; +extern NSString * const kMagicalRecordImportAttributeKeyMapKey; +extern NSString * const kMagicalRecordImportAttributeValueClassNameKey; + +extern NSString * const kMagicalRecordImportRelationshipMapKey; +extern NSString * const kMagicalRecordImportRelationshipLinkedByKey; +extern NSString * const kMagicalRecordImportRelationshipTypeKey; + +@protocol MagicalRecordDataImportProtocol + +@optional +- (BOOL) shouldImport:(id)data; +- (void) willImport:(id)data; +- (void) didImport:(id)data; + +@end + +@interface NSManagedObject (MagicalRecord_DataImport) + +- (BOOL) MR_importValuesForKeysWithObject:(id)objectData; + ++ (instancetype) MR_importFromObject:(id)data; ++ (instancetype) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context; + ++ (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData; ++ (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.m new file mode 100644 index 0000000..22fd9c6 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.m @@ -0,0 +1,360 @@ +// +// NSManagedObject+JSONHelpers.m +// +// Created by Saul Mora on 6/28/11. +// Copyright 2011 Magical Panda Software LLC. All rights reserved. +// + +#import "NSObject+MagicalDataImport.h" +#import "NSAttributeDescription+MagicalDataImport.h" +#import "NSEntityDescription+MagicalDataImport.h" +#import "NSManagedObjectContext+MagicalThreading.h" +#import "NSManagedObject+MagicalDataImport.h" +#import "NSManagedObject+MagicalFinders.h" +#import "NSManagedObject+MagicalRecord.h" +#import "NSRelationshipDescription+MagicalDataImport.h" +#import "NSString+MagicalDataImport.h" +#import "MagicalImportFunctions.h" +#import "MagicalRecordLogging.h" +#import + +NSString * const kMagicalRecordImportCustomDateFormatKey = @"dateFormat"; +NSString * const kMagicalRecordImportDefaultDateFormatString = @"yyyy-MM-dd'T'HH:mm:ssz"; +NSString * const kMagicalRecordImportUnixTimeString = @"UnixTime"; + +NSString * const kMagicalRecordImportAttributeKeyMapKey = @"mappedKeyName"; +NSString * const kMagicalRecordImportAttributeValueClassNameKey = @"attributeValueClassName"; + +NSString * const kMagicalRecordImportRelationshipMapKey = @"mappedKeyName"; +NSString * const kMagicalRecordImportRelationshipLinkedByKey = @"relatedByAttribute"; +NSString * const kMagicalRecordImportRelationshipTypeKey = @"type"; //this needs to be revisited + +NSString * const kMagicalRecordImportAttributeUseDefaultValueWhenNotPresent = @"useDefaultValueWhenNotPresent"; + +@implementation NSManagedObject (MagicalRecord_DataImport) + +- (BOOL) MR_importValue:(id)value forKey:(NSString *)key +{ + NSString *selectorString = [NSString stringWithFormat:@"import%@:", [key MR_capitalizedFirstCharacterString]]; + SEL selector = NSSelectorFromString(selectorString); + + if ([self respondsToSelector:selector]) + { + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:selector]]; + [invocation setTarget:self]; + [invocation setSelector:selector]; + [invocation setArgument:&value atIndex:2]; + [invocation invoke]; + + BOOL returnValue = YES; + [invocation getReturnValue:&returnValue]; + return returnValue; + } + + return NO; +} + +- (void) MR_setAttributes:(NSDictionary *)attributes forKeysWithObject:(id)objectData +{ + for (NSString *attributeName in attributes) + { + NSAttributeDescription *attributeInfo = [attributes valueForKey:attributeName]; + NSString *lookupKeyPath = [objectData MR_lookupKeyForAttribute:attributeInfo]; + + if (lookupKeyPath) + { + id value = [attributeInfo MR_valueForKeyPath:lookupKeyPath fromObjectData:objectData]; + if (![self MR_importValue:value forKey:attributeName]) + { + [self setValue:value forKey:attributeName]; + } + } + else + { + if ([[[attributeInfo userInfo] objectForKey:kMagicalRecordImportAttributeUseDefaultValueWhenNotPresent] boolValue]) + { + id value = [attributeInfo defaultValue]; + if (![self MR_importValue:value forKey:attributeName]) + { + [self setValue:value forKey:attributeName]; + } + } + } + } +} + +- (NSManagedObject *) MR_findObjectForRelationship:(NSRelationshipDescription *)relationshipInfo withData:(id)singleRelatedObjectData +{ + NSEntityDescription *destinationEntity = [relationshipInfo destinationEntity]; + NSManagedObject *objectForRelationship = nil; + + id relatedValue; + + // if its a primitive class, than handle singleRelatedObjectData as the key for relationship + if ([singleRelatedObjectData isKindOfClass:[NSString class]] || + [singleRelatedObjectData isKindOfClass:[NSNumber class]]) + { + relatedValue = singleRelatedObjectData; + } + else if ([singleRelatedObjectData isKindOfClass:[NSDictionary class]]) + { + relatedValue = [singleRelatedObjectData MR_relatedValueForRelationship:relationshipInfo]; + } + else + { + relatedValue = singleRelatedObjectData; + } + + if (relatedValue) + { + NSManagedObjectContext *context = [self managedObjectContext]; + Class managedObjectClass = NSClassFromString([destinationEntity managedObjectClassName]); + NSString *primaryKey = [relationshipInfo MR_primaryKey]; + objectForRelationship = [managedObjectClass MR_findFirstByAttribute:primaryKey + withValue:relatedValue + inContext:context]; + } + + return objectForRelationship; +} + +- (void) MR_addObject:(NSManagedObject *)relatedObject forRelationship:(NSRelationshipDescription *)relationshipInfo +{ + NSAssert2(relatedObject != nil, @"Cannot add nil to %@ for attribute %@", NSStringFromClass([self class]), [relationshipInfo name]); + NSAssert2([[relatedObject entity] isKindOfEntity:[relationshipInfo destinationEntity]], @"related object entity %@ not same as destination entity %@", [relatedObject entity], [relationshipInfo destinationEntity]); + + //add related object to set + NSString *addRelationMessageFormat = @"set%@:"; + id relationshipSource = self; + if ([relationshipInfo isToMany]) + { + addRelationMessageFormat = @"add%@Object:"; + if ([relationshipInfo respondsToSelector:@selector(isOrdered)] && [relationshipInfo isOrdered]) + { + //Need to get the ordered set + NSString *selectorName = [[relationshipInfo name] stringByAppendingString:@"Set"]; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + relationshipSource = [self performSelector:NSSelectorFromString(selectorName)]; +#pragma clang diagnostic pop + addRelationMessageFormat = @"addObject:"; + } + } + + NSString *addRelatedObjectToSetMessage = [NSString stringWithFormat:addRelationMessageFormat, MR_attributeNameFromString([relationshipInfo name])]; + + SEL selector = NSSelectorFromString(addRelatedObjectToSetMessage); + + @try + { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + [relationshipSource performSelector:selector withObject:relatedObject]; +#pragma clang diagnostic pop + } + @catch (NSException *exception) + { + MRLogError(@"Adding object for relationship failed: %@\n", relationshipInfo); + MRLogError(@"relatedObject.entity %@", [relatedObject entity]); + MRLogError(@"relationshipInfo.destinationEntity %@", [relationshipInfo destinationEntity]); + MRLogError(@"Add Relationship Selector: %@", addRelatedObjectToSetMessage); + MRLogError(@"perform selector error: %@", exception); + } +} + +- (void)MR_setRelationships:(NSDictionary *)relationships forKeysWithObject:(id)relationshipData withBlock:(void (^)(NSRelationshipDescription *, id))setRelationshipBlock +{ + for (NSString *relationshipName in relationships) + { + SEL shouldImportSelector = NSSelectorFromString([NSString stringWithFormat:@"shouldImport%@:", [relationshipName MR_capitalizedFirstCharacterString]]); + BOOL implementsShouldImport = (BOOL)[self respondsToSelector:shouldImportSelector]; + + NSRelationshipDescription *relationshipInfo = [relationships valueForKey:relationshipName]; + + NSString *lookupKey = [[relationshipInfo userInfo] valueForKey:kMagicalRecordImportRelationshipMapKey] ?: relationshipName; + + id relatedObjectData; + + @try + { + relatedObjectData = [relationshipData valueForKeyPath:lookupKey]; + } + @catch (NSException *exception) + { + MRLogWarn(@"Looking up a key for relationship failed while importing: %@\n", relationshipInfo); + MRLogWarn(@"lookupKey: %@", lookupKey); + MRLogWarn(@"relationshipInfo.destinationEntity %@", [relationshipInfo destinationEntity]); + MRLogWarn(@"relationshipData: %@", relationshipData); + MRLogWarn(@"Exception:\n%@: %@", [exception name], [exception reason]); + } + @finally + { + if (relatedObjectData == nil || [relatedObjectData isEqual:[NSNull null]]) + { + continue; + } + } + +#pragma clang diagnostic push +#pragma clang diagnostic ignored \ + "-Warc-performSelector-leaks" + if (implementsShouldImport && !(BOOL)[self performSelector:shouldImportSelector withObject:relatedObjectData]) + { + continue; + } +#pragma clang diagnostic pop + // Different values provided to the -shouldImport and -import methods?? + if ([self MR_importValue:relationshipData forKey:relationshipName]) + { + continue; + } + + if ([relationshipInfo isToMany] && [relatedObjectData isKindOfClass:[NSArray class]]) + { + for (id singleRelatedObjectData in relatedObjectData) + { + setRelationshipBlock(relationshipInfo, singleRelatedObjectData); + } + } + else + { + setRelationshipBlock(relationshipInfo, relatedObjectData); + } + } +} + +- (BOOL) MR_preImport:(id)objectData; +{ + if ([self respondsToSelector:@selector(shouldImport:)]) + { + BOOL shouldImport = (BOOL)[self shouldImport:objectData]; + if (!shouldImport) + { + return NO; + } + } + + if ([self respondsToSelector:@selector(willImport:)]) + { + [self willImport:objectData]; + } + + return YES; +} + +- (BOOL) MR_postImport:(id)objectData; +{ + if ([self respondsToSelector:@selector(didImport:)]) + { + [self performSelector:@selector(didImport:) withObject:objectData]; + } + + return YES; +} + +- (BOOL) MR_performDataImportFromObject:(id)objectData relationshipBlock:(void(^)(NSRelationshipDescription*, id))relationshipBlock; +{ + BOOL didStartimporting = [self MR_preImport:objectData]; + if (!didStartimporting) return NO; + + NSDictionary *attributes = [[self entity] attributesByName]; + [self MR_setAttributes:attributes forKeysWithObject:objectData]; + + NSDictionary *relationships = [[self entity] relationshipsByName]; + [self MR_setRelationships:relationships forKeysWithObject:objectData withBlock:relationshipBlock]; + + return [self MR_postImport:objectData]; +} + +- (BOOL)MR_importValuesForKeysWithObject:(id)objectData +{ + __weak typeof(self) weakself = self; + return [self MR_performDataImportFromObject:objectData + relationshipBlock:^(NSRelationshipDescription *relationshipInfo, id localObjectData) { + + NSManagedObject *relatedObject = [weakself MR_findObjectForRelationship:relationshipInfo withData:localObjectData]; + + if (relatedObject == nil) + { + NSEntityDescription *entityDescription = [relationshipInfo destinationEntity]; + relatedObject = [entityDescription MR_createInstanceInContext:[weakself managedObjectContext]]; + } + if ([localObjectData isKindOfClass:[NSDictionary class]]) + { + [relatedObject MR_importValuesForKeysWithObject:localObjectData]; + } + else if (localObjectData) + { + NSString *relatedByAttribute = [[relationshipInfo userInfo] objectForKey:kMagicalRecordImportRelationshipLinkedByKey] ?: MR_primaryKeyNameFromString([[relationshipInfo destinationEntity] name]); + + if (relatedByAttribute) + { + if (![relatedObject MR_importValue:localObjectData forKey:relatedByAttribute]) + { + [relatedObject setValue:localObjectData forKey:relatedByAttribute]; + } + } + } + + [weakself MR_addObject:relatedObject forRelationship:relationshipInfo]; + }]; +} + ++ (id) MR_importFromObject:(id)objectData inContext:(NSManagedObjectContext *)context; +{ + __block NSManagedObject *managedObject; + + [context performBlockAndWait:^{ + NSAttributeDescription *primaryAttribute = [[self MR_entityDescriptionInContext:context] MR_primaryAttributeToRelateBy]; + + id value = [objectData MR_valueForAttribute:primaryAttribute]; + + if (primaryAttribute != nil) + { + managedObject = [self MR_findFirstByAttribute:[primaryAttribute name] withValue:value inContext:context]; + } + if (managedObject == nil) + { + managedObject = [self MR_createEntityInContext:context]; + } + + [managedObject MR_importValuesForKeysWithObject:objectData]; + }]; + + return managedObject; +} + ++ (id) MR_importFromObject:(id)objectData +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_importFromObject:objectData inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_importFromArray:listOfObjectData inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context +{ + NSMutableArray *dataObjects = [NSMutableArray array]; + + [listOfObjectData enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) + { + NSDictionary *objectData = (NSDictionary *)obj; + + NSManagedObject *dataObject = [self MR_importFromObject:objectData inContext:context]; + + [dataObjects addObject:dataObject]; + }]; + + return dataObjects; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.h new file mode 100644 index 0000000..4163325 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.h @@ -0,0 +1,64 @@ +// +// NSManagedObject+MagicalFinders.h +// Magical Record +// +// Created by Saul Mora on 3/7/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import + +@interface NSManagedObject (MagicalFinders) + ++ (NSArray *) MR_findAll; ++ (NSArray *) MR_findAllInContext:(NSManagedObjectContext *)context; ++ (NSArray *) MR_findAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending; ++ (NSArray *) MR_findAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; ++ (NSArray *) MR_findAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm; ++ (NSArray *) MR_findAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; + ++ (NSArray *) MR_findAllWithPredicate:(NSPredicate *)searchTerm; ++ (NSArray *) MR_findAllWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; + ++ (instancetype) MR_findFirst; ++ (instancetype) MR_findFirstInContext:(NSManagedObjectContext *)context; ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchTerm; ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchterm sortedBy:(NSString *)property ascending:(BOOL)ascending; ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchterm sortedBy:(NSString *)property ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchTerm andRetrieveAttributes:(NSArray *)attributes; ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchTerm andRetrieveAttributes:(NSArray *)attributes inContext:(NSManagedObjectContext *)context; ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortBy ascending:(BOOL)ascending andRetrieveAttributes:(id)attributes, ...; ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortBy ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context andRetrieveAttributes:(id)attributes, ...; ++ (instancetype) MR_findFirstByAttribute:(NSString *)attribute withValue:(id)searchValue; ++ (instancetype) MR_findFirstByAttribute:(NSString *)attribute withValue:(id)searchValue inContext:(NSManagedObjectContext *)context; ++ (instancetype) MR_findFirstOrderedByAttribute:(NSString *)attribute ascending:(BOOL)ascending; ++ (instancetype) MR_findFirstOrderedByAttribute:(NSString *)attribute ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; + ++ (instancetype) MR_findFirstOrCreateByAttribute:(NSString *)attribute withValue:(id)searchValue; ++ (instancetype) MR_findFirstOrCreateByAttribute:(NSString *)attribute withValue:(id)searchValue inContext:(NSManagedObjectContext *)context; + ++ (NSArray *) MR_findByAttribute:(NSString *)attribute withValue:(id)searchValue; ++ (NSArray *) MR_findByAttribute:(NSString *)attribute withValue:(id)searchValue inContext:(NSManagedObjectContext *)context; ++ (NSArray *) MR_findByAttribute:(NSString *)attribute withValue:(id)searchValue andOrderBy:(NSString *)sortTerm ascending:(BOOL)ascending; ++ (NSArray *) MR_findByAttribute:(NSString *)attribute withValue:(id)searchValue andOrderBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + ++ (NSFetchedResultsController *) MR_fetchController:(NSFetchRequest *)request delegate:(id)delegate useFileCache:(BOOL)useFileCache groupedBy:(NSString *)groupKeyPath inContext:(NSManagedObjectContext *)context; + ++ (NSFetchedResultsController *) MR_fetchAllWithDelegate:(id)delegate; ++ (NSFetchedResultsController *) MR_fetchAllWithDelegate:(id)delegate inContext:(NSManagedObjectContext *)context; + ++ (NSFetchedResultsController *) MR_fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm groupBy:(NSString *)groupingKeyPath delegate:(id)delegate; ++ (NSFetchedResultsController *) MR_fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm groupBy:(NSString *)groupingKeyPath delegate:(id)delegate inContext:(NSManagedObjectContext *)context; + ++ (NSFetchedResultsController *) MR_fetchAllGroupedBy:(NSString *)group withPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortTerm ascending:(BOOL)ascending; ++ (NSFetchedResultsController *) MR_fetchAllGroupedBy:(NSString *)group withPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; + ++ (NSFetchedResultsController *) MR_fetchAllGroupedBy:(NSString *)group withPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortTerm ascending:(BOOL)ascending delegate:(id)delegate; ++ (NSFetchedResultsController *) MR_fetchAllGroupedBy:(NSString *)group withPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortTerm ascending:(BOOL)ascending delegate:(id)delegate inContext:(NSManagedObjectContext *)context; + +#endif + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.m new file mode 100644 index 0000000..99ee986 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.m @@ -0,0 +1,420 @@ + // +// NSManagedObject+MagicalFinders.m +// Magical Record +// +// Created by Saul Mora on 3/7/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import "NSManagedObject+MagicalFinders.h" +#import "NSManagedObject+MagicalRequests.h" +#import "NSManagedObject+MagicalRecord.h" +#import "NSManagedObjectContext+MagicalThreading.h" + +@implementation NSManagedObject (MagicalFinders) + +#pragma mark - Finding Data + + ++ (NSArray *) MR_findAllInContext:(NSManagedObjectContext *)context +{ + return [self MR_executeFetchRequest:[self MR_requestAllInContext:context] inContext:context]; +} + ++ (NSArray *) MR_findAll +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_findAllInContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSArray *) MR_findAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_requestAllSortedBy:sortTerm ascending:ascending inContext:context]; + + return [self MR_executeFetchRequest:request inContext:context]; +} + ++ (NSArray *) MR_findAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_findAllSortedBy:sortTerm + ascending:ascending + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSArray *) MR_findAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_requestAllSortedBy:sortTerm + ascending:ascending + withPredicate:searchTerm + inContext:context]; + + return [self MR_executeFetchRequest:request inContext:context]; +} + ++ (NSArray *) MR_findAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_findAllSortedBy:sortTerm + ascending:ascending + withPredicate:searchTerm + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + + ++ (NSArray *) MR_findAllWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_createFetchRequestInContext:context]; + [request setPredicate:searchTerm]; + + return [self MR_executeFetchRequest:request + inContext:context]; +} + ++ (NSArray *) MR_findAllWithPredicate:(NSPredicate *)searchTerm +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_findAllWithPredicate:searchTerm + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (instancetype) MR_findFirstInContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_createFetchRequestInContext:context]; + + return [self MR_executeFetchRequestAndReturnFirstObject:request inContext:context]; +} + ++ (instancetype) MR_findFirst +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_findFirstInContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (instancetype) MR_findFirstByAttribute:(NSString *)attribute withValue:(id)searchValue inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_requestFirstByAttribute:attribute withValue:searchValue inContext:context]; + return [self MR_executeFetchRequestAndReturnFirstObject:request inContext:context]; +} + ++ (instancetype) MR_findFirstByAttribute:(NSString *)attribute withValue:(id)searchValue +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_findFirstByAttribute:attribute + withValue:searchValue + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (instancetype) MR_findFirstOrderedByAttribute:(NSString *)attribute ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; +{ + NSFetchRequest *request = [self MR_requestAllSortedBy:attribute ascending:ascending inContext:context]; + [request setFetchLimit:1]; + + return [self MR_executeFetchRequestAndReturnFirstObject:request inContext:context]; +} + ++ (instancetype) MR_findFirstOrderedByAttribute:(NSString *)attribute ascending:(BOOL)ascending; +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_findFirstOrderedByAttribute:attribute + ascending:ascending + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (instancetype) MR_findFirstOrCreateByAttribute:(NSString *)attribute withValue:(id)searchValue +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_findFirstOrCreateByAttribute:attribute + withValue:searchValue + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (instancetype) MR_findFirstOrCreateByAttribute:(NSString *)attribute withValue:(id)searchValue inContext:(NSManagedObjectContext *)context +{ + id result = [self MR_findFirstByAttribute:attribute + withValue:searchValue + inContext:context]; + + if (result != nil) { + return result; + } + + result = [self MR_createEntityInContext:context]; + [result setValue:searchValue forKey:attribute]; + + return result; +} + ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchTerm +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_findFirstWithPredicate:searchTerm inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_requestFirstWithPredicate:searchTerm inContext:context]; + + return [self MR_executeFetchRequestAndReturnFirstObject:request inContext:context]; +} + ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchterm sortedBy:(NSString *)property ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_requestAllSortedBy:property ascending:ascending withPredicate:searchterm inContext:context]; + + return [self MR_executeFetchRequestAndReturnFirstObject:request inContext:context]; +} + ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchterm sortedBy:(NSString *)property ascending:(BOOL)ascending +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_findFirstWithPredicate:searchterm + sortedBy:property + ascending:ascending + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchTerm andRetrieveAttributes:(NSArray *)attributes inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_createFetchRequestInContext:context]; + [request setPredicate:searchTerm]; + [request setPropertiesToFetch:attributes]; + + return [self MR_executeFetchRequestAndReturnFirstObject:request inContext:context]; +} + ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchTerm andRetrieveAttributes:(NSArray *)attributes +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_findFirstWithPredicate:searchTerm + andRetrieveAttributes:attributes + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortBy ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context andRetrieveAttributes:(id)attributes, ... +{ + NSFetchRequest *request = [self MR_requestAllSortedBy:sortBy + ascending:ascending + withPredicate:searchTerm + inContext:context]; + [request setPropertiesToFetch:[self MR_propertiesNamed:attributes inContext:context]]; + + return [self MR_executeFetchRequestAndReturnFirstObject:request inContext:context]; +} + ++ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortBy ascending:(BOOL)ascending andRetrieveAttributes:(id)attributes, ... +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_findFirstWithPredicate:searchTerm + sortedBy:sortBy + ascending:ascending + inContext:[NSManagedObjectContext MR_contextForCurrentThread] + andRetrieveAttributes:attributes]; +#pragma clang diagnostic pop +} + ++ (NSArray *) MR_findByAttribute:(NSString *)attribute withValue:(id)searchValue inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_requestAllWhere:attribute isEqualTo:searchValue inContext:context]; + + return [self MR_executeFetchRequest:request inContext:context]; +} + ++ (NSArray *) MR_findByAttribute:(NSString *)attribute withValue:(id)searchValue +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_findByAttribute:attribute + withValue:searchValue + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSArray *) MR_findByAttribute:(NSString *)attribute withValue:(id)searchValue andOrderBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context +{ + NSPredicate *searchTerm = [NSPredicate predicateWithFormat:@"%K = %@", attribute, searchValue]; + NSFetchRequest *request = [self MR_requestAllSortedBy:sortTerm ascending:ascending withPredicate:searchTerm inContext:context]; + + return [self MR_executeFetchRequest:request inContext:context]; +} + ++ (NSArray *) MR_findByAttribute:(NSString *)attribute withValue:(id)searchValue andOrderBy:(NSString *)sortTerm ascending:(BOOL)ascending +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_findByAttribute:attribute + withValue:searchValue + andOrderBy:sortTerm + ascending:ascending + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + + +#pragma mark - +#pragma mark NSFetchedResultsController helpers + + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + ++ (NSFetchedResultsController *) MR_fetchController:(NSFetchRequest *)request delegate:(id)delegate useFileCache:(BOOL)useFileCache groupedBy:(NSString *)groupKeyPath inContext:(NSManagedObjectContext *)context; +{ + NSString *cacheName = useFileCache ? [NSString stringWithFormat:@"MagicalRecord-Cache-%@", NSStringFromClass([self class])] : nil; + + NSFetchedResultsController *controller = + [[NSFetchedResultsController alloc] initWithFetchRequest:request + managedObjectContext:context + sectionNameKeyPath:groupKeyPath + cacheName:cacheName]; + controller.delegate = delegate; + + return controller; +} + ++ (NSFetchedResultsController *) MR_fetchAllWithDelegate:(id)delegate; +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_fetchAllWithDelegate:delegate inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSFetchedResultsController *) MR_fetchAllWithDelegate:(id)delegate inContext:(NSManagedObjectContext *)context; +{ + NSFetchRequest *request = [self MR_requestAllInContext:context]; + NSFetchedResultsController *controller = [self MR_fetchController:request delegate:delegate useFileCache:NO groupedBy:nil inContext:context]; + + [self MR_performFetch:controller]; + return controller; +} + ++ (NSFetchedResultsController *) MR_fetchAllGroupedBy:(NSString *)group withPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortTerm ascending:(BOOL)ascending delegate:(id)delegate inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_requestAllSortedBy:sortTerm + ascending:ascending + withPredicate:searchTerm + inContext:context]; + + NSFetchedResultsController *controller = [self MR_fetchController:request + delegate:delegate + useFileCache:NO + groupedBy:group + inContext:context]; + + [self MR_performFetch:controller]; + return controller; +} + ++ (NSFetchedResultsController *) MR_fetchAllGroupedBy:(NSString *)group withPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortTerm ascending:(BOOL)ascending delegate:(id)delegate +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_fetchAllGroupedBy:group + withPredicate:searchTerm + sortedBy:sortTerm + ascending:ascending + delegate:delegate + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSFetchedResultsController *) MR_fetchAllGroupedBy:(NSString *)group withPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; +{ + return [self MR_fetchAllGroupedBy:group + withPredicate:searchTerm + sortedBy:sortTerm + ascending:ascending + delegate:nil + inContext:context]; +} + ++ (NSFetchedResultsController *) MR_fetchAllGroupedBy:(NSString *)group withPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortTerm ascending:(BOOL)ascending +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_fetchAllGroupedBy:group + withPredicate:searchTerm + sortedBy:sortTerm + ascending:ascending + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + + ++ (NSFetchedResultsController *) MR_fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm groupBy:(NSString *)groupingKeyPath inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_requestAllSortedBy:sortTerm + ascending:ascending + withPredicate:searchTerm + inContext:context]; + NSFetchedResultsController *controller = [self MR_fetchController:request + delegate:nil + useFileCache:NO + groupedBy:groupingKeyPath + inContext:context]; + + [self MR_performFetch:controller]; + return controller; +} + ++ (NSFetchedResultsController *) MR_fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm groupBy:(NSString *)groupingKeyPath; +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_fetchAllSortedBy:sortTerm + ascending:ascending + withPredicate:searchTerm + groupBy:groupingKeyPath + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSFetchedResultsController *) MR_fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm groupBy:(NSString *)groupingKeyPath delegate:(id)delegate inContext:(NSManagedObjectContext *)context +{ + return [self MR_fetchAllGroupedBy:groupingKeyPath + withPredicate:searchTerm + sortedBy:sortTerm + ascending:ascending + delegate:delegate + inContext:context]; +} + ++ (NSFetchedResultsController *) MR_fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm groupBy:(NSString *)groupingKeyPath delegate:(id)delegate +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_fetchAllSortedBy:sortTerm + ascending:ascending + withPredicate:searchTerm + groupBy:groupingKeyPath + delegate:delegate + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + +#endif + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRecord.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRecord.h new file mode 100644 index 0000000..b1b70de --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRecord.h @@ -0,0 +1,74 @@ +// +// +// Created by Saul Mora on 11/15/09. +// Copyright 2010 Magical Panda Software, LLC All rights reserved. +// + +#import +#import + +@interface NSManagedObject (MagicalRecord) + +/** + * If the NSManagedObject subclass calling this method has implemented the `entityName` method, then the return value of that will be used. + * If `entityName` is not implemented, then the name of the class is returned. If the class is written in Swift, the module name will be removed. + * + * @return String based name for the entity + */ ++ (NSString *) MR_entityName; + ++ (NSUInteger) MR_defaultBatchSize; ++ (void) MR_setDefaultBatchSize:(NSUInteger)newBatchSize; + ++ (NSArray *) MR_executeFetchRequest:(NSFetchRequest *)request; ++ (NSArray *) MR_executeFetchRequest:(NSFetchRequest *)request inContext:(NSManagedObjectContext *)context; ++ (instancetype) MR_executeFetchRequestAndReturnFirstObject:(NSFetchRequest *)request; ++ (instancetype) MR_executeFetchRequestAndReturnFirstObject:(NSFetchRequest *)request inContext:(NSManagedObjectContext *)context; + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + ++ (BOOL) MR_performFetch:(NSFetchedResultsController *)controller; + +#endif + ++ (NSEntityDescription *) MR_entityDescription; ++ (NSEntityDescription *) MR_entityDescriptionInContext:(NSManagedObjectContext *)context; ++ (NSArray *) MR_propertiesNamed:(NSArray *)properties; ++ (NSArray *) MR_propertiesNamed:(NSArray *)properties inContext:(NSManagedObjectContext *)context; + ++ (instancetype) MR_createEntity; ++ (instancetype) MR_createEntityInContext:(NSManagedObjectContext *)context; + +- (BOOL) MR_deleteEntity; +- (BOOL) MR_deleteEntityInContext:(NSManagedObjectContext *)context; + ++ (BOOL) MR_deleteAllMatchingPredicate:(NSPredicate *)predicate; ++ (BOOL) MR_deleteAllMatchingPredicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)context; + ++ (BOOL) MR_truncateAll; ++ (BOOL) MR_truncateAllInContext:(NSManagedObjectContext *)context; + ++ (NSArray *) MR_ascendingSortDescriptors:(NSArray *)attributesToSortBy; ++ (NSArray *) MR_descendingSortDescriptors:(NSArray *)attributesToSortBy; + +- (instancetype) MR_inContext:(NSManagedObjectContext *)otherContext; +- (instancetype) MR_inThreadContext; + +@end + +@protocol MagicalRecord_MOGenerator + +@optional ++ (NSString *)entityName; +- (instancetype) entityInManagedObjectContext:(NSManagedObjectContext *)object; +- (instancetype) insertInManagedObjectContext:(NSManagedObjectContext *)object; + +@end + +#pragma mark - Deprecated Methods — DO NOT USE +@interface NSManagedObject (MagicalRecordDeprecated) + ++ (instancetype) MR_createInContext:(NSManagedObjectContext *)context MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("4.0", "MR_createEntityInContext:"); +- (BOOL) MR_deleteInContext:(NSManagedObjectContext *)context MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("4.0", "MR_deleteEntityInContext:"); + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRecord.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRecord.m new file mode 100644 index 0000000..9cb172a --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRecord.m @@ -0,0 +1,330 @@ + +// Created by Saul Mora on 11/15/09. +// Copyright 2010 Magical Panda Software, LLC All rights reserved. +// + +#import "NSManagedObject+MagicalRecord.h" +#import "NSManagedObject+MagicalRequests.h" +#import "NSManagedObjectContext+MagicalThreading.h" +#import "MagicalRecord+ErrorHandling.h" +#import "MagicalRecordLogging.h" + +static NSUInteger kMagicalRecordDefaultBatchSize = 20; + +@implementation NSManagedObject (MagicalRecord) + ++ (NSString *) MR_entityName; +{ + NSString *entityName; + + if ([self respondsToSelector:@selector(entityName)]) + { + entityName = [self performSelector:@selector(entityName)]; + } + + if ([entityName length] == 0) + { + // Remove module prefix from Swift subclasses + entityName = [NSStringFromClass(self) componentsSeparatedByString:@"."].lastObject; + } + + return entityName; +} + ++ (void) MR_setDefaultBatchSize:(NSUInteger)newBatchSize +{ + @synchronized(self) + { + kMagicalRecordDefaultBatchSize = newBatchSize; + } +} + ++ (NSUInteger) MR_defaultBatchSize +{ + return kMagicalRecordDefaultBatchSize; +} + ++ (NSArray *) MR_executeFetchRequest:(NSFetchRequest *)request inContext:(NSManagedObjectContext *)context +{ + __block NSArray *results = nil; + [context performBlockAndWait:^{ + + NSError *error = nil; + + results = [context executeFetchRequest:request error:&error]; + + if (results == nil) + { + [MagicalRecord handleErrors:error]; + } + + }]; + return results; +} + ++ (NSArray *) MR_executeFetchRequest:(NSFetchRequest *)request +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_executeFetchRequest:request inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (id) MR_executeFetchRequestAndReturnFirstObject:(NSFetchRequest *)request inContext:(NSManagedObjectContext *)context +{ + [request setFetchLimit:1]; + + NSArray *results = [self MR_executeFetchRequest:request inContext:context]; + if ([results count] == 0) + { + return nil; + } + return [results firstObject]; +} + ++ (id) MR_executeFetchRequestAndReturnFirstObject:(NSFetchRequest *)request +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_executeFetchRequestAndReturnFirstObject:request inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + +#if TARGET_OS_IPHONE + ++ (BOOL) MR_performFetch:(NSFetchedResultsController *)controller +{ + NSError *error = nil; + BOOL success = [controller performFetch:&error]; + if (!success) + { + [MagicalRecord handleErrors:error]; + } + return success; +} + +#endif + ++ (NSEntityDescription *) MR_entityDescription +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_entityDescriptionInContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSEntityDescription *) MR_entityDescriptionInContext:(NSManagedObjectContext *)context +{ + NSString *entityName = [self MR_entityName]; + return [NSEntityDescription entityForName:entityName inManagedObjectContext:context]; +} + ++ (NSArray *) MR_propertiesNamed:(NSArray *)properties +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_propertiesNamed:properties inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSArray *) MR_propertiesNamed:(NSArray *)properties inContext:(NSManagedObjectContext *)context +{ + NSEntityDescription *description = [self MR_entityDescriptionInContext:context]; + NSMutableArray *propertiesWanted = [NSMutableArray array]; + + if (properties) + { + NSDictionary *propDict = [description propertiesByName]; + + for (NSString *propertyName in properties) + { + NSPropertyDescription *property = [propDict objectForKey:propertyName]; + if (property) + { + [propertiesWanted addObject:property]; + } + else + { + MRLogWarn(@"Property '%@' not found in %lx properties for %@", propertyName, (unsigned long)[propDict count], NSStringFromClass(self)); + } + } + } + return propertiesWanted; +} + ++ (NSArray *) MR_sortAscending:(BOOL)ascending attributes:(NSArray *)attributesToSortBy +{ + NSMutableArray *attributes = [NSMutableArray array]; + + for (NSString *attributeName in attributesToSortBy) + { + NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:attributeName ascending:ascending]; + [attributes addObject:sortDescriptor]; + } + + return attributes; +} + ++ (NSArray *) MR_ascendingSortDescriptors:(NSArray *)attributesToSortBy +{ + return [self MR_sortAscending:YES attributes:attributesToSortBy]; +} + ++ (NSArray *) MR_descendingSortDescriptors:(NSArray *)attributesToSortBy +{ + return [self MR_sortAscending:NO attributes:attributesToSortBy]; +} + +#pragma mark - + ++ (id) MR_createEntityInContext:(NSManagedObjectContext *)context +{ + if ([self respondsToSelector:@selector(insertInManagedObjectContext:)] && context != nil) + { + id entity = [self performSelector:@selector(insertInManagedObjectContext:) withObject:context]; + return entity; + } + else + { + NSEntityDescription *entity = nil; + if (context == nil) + { + entity = [self MR_entityDescription]; + } + else + { + entity = [self MR_entityDescriptionInContext:context]; + } + + if (entity == nil) + { + return nil; + } + + return [[self alloc] initWithEntity:entity insertIntoManagedObjectContext:context]; + } +} + ++ (id) MR_createEntity +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + NSManagedObject *newEntity = [self MR_createEntityInContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop + + return newEntity; +} + +- (BOOL) MR_deleteEntityInContext:(NSManagedObjectContext *)context +{ + NSError *error = nil; + NSManagedObject *inContext = [context existingObjectWithID:[self objectID] error:&error]; + + [MagicalRecord handleErrors:error]; + + [context deleteObject:inContext]; + + return YES; +} + +- (BOOL) MR_deleteEntity +{ + [self MR_deleteEntityInContext:[self managedObjectContext]]; + return YES; +} + ++ (BOOL) MR_deleteAllMatchingPredicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_requestAllWithPredicate:predicate inContext:context]; + [request setReturnsObjectsAsFaults:YES]; + [request setIncludesPropertyValues:NO]; + + NSArray *objectsToTruncate = [self MR_executeFetchRequest:request inContext:context]; + + for (id objectToTruncate in objectsToTruncate) + { + [objectToTruncate MR_deleteInContext:context]; + } + + return YES; +} + ++ (BOOL) MR_deleteAllMatchingPredicate:(NSPredicate *)predicate +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_deleteAllMatchingPredicate:predicate inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (BOOL) MR_truncateAllInContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_requestAllInContext:context]; + [request setReturnsObjectsAsFaults:YES]; + [request setIncludesPropertyValues:NO]; + + NSArray *objectsToDelete = [self MR_executeFetchRequest:request inContext:context]; + for (NSManagedObject *objectToDelete in objectsToDelete) + { + [objectToDelete MR_deleteEntityInContext:context]; + } + return YES; +} + ++ (BOOL) MR_truncateAll +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [self MR_truncateAllInContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop + + return YES; +} + +- (id) MR_inContext:(NSManagedObjectContext *)otherContext +{ + NSError *error = nil; + + if ([[self objectID] isTemporaryID]) + { + BOOL success = [[self managedObjectContext] obtainPermanentIDsForObjects:@[self] error:&error]; + if (!success) + { + [MagicalRecord handleErrors:error]; + return nil; + } + } + + error = nil; + + NSManagedObject *inContext = [otherContext existingObjectWithID:[self objectID] error:&error]; + [MagicalRecord handleErrors:error]; + + return inContext; +} + +- (id) MR_inThreadContext +{ + NSManagedObject *weakSelf = self; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [weakSelf MR_inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + +@end + +#pragma mark - Deprecated Methods — DO NOT USE +@implementation NSManagedObject (MagicalRecordDeprecated) + ++ (instancetype) MR_createInContext:(NSManagedObjectContext *)context +{ + return [self MR_createEntityInContext:context]; +} + +- (BOOL) MR_deleteInContext:(NSManagedObjectContext *)context +{ + return [self MR_deleteEntityInContext:context]; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRequests.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRequests.h new file mode 100644 index 0000000..53d8541 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRequests.h @@ -0,0 +1,32 @@ +// +// NSManagedObject+MagicalRequests.h +// Magical Record +// +// Created by Saul Mora on 3/7/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import + +@interface NSManagedObject (MagicalRequests) + ++ (NSFetchRequest *) MR_createFetchRequest; ++ (NSFetchRequest *) MR_createFetchRequestInContext:(NSManagedObjectContext *)context; + ++ (NSFetchRequest *) MR_requestAll; ++ (NSFetchRequest *) MR_requestAllInContext:(NSManagedObjectContext *)context; ++ (NSFetchRequest *) MR_requestAllWithPredicate:(NSPredicate *)searchTerm; ++ (NSFetchRequest *) MR_requestAllWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; ++ (NSFetchRequest *) MR_requestAllWhere:(NSString *)property isEqualTo:(id)value; ++ (NSFetchRequest *) MR_requestAllWhere:(NSString *)property isEqualTo:(id)value inContext:(NSManagedObjectContext *)context; ++ (NSFetchRequest *) MR_requestFirstWithPredicate:(NSPredicate *)searchTerm; ++ (NSFetchRequest *) MR_requestFirstWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; ++ (NSFetchRequest *) MR_requestFirstByAttribute:(NSString *)attribute withValue:(id)searchValue; ++ (NSFetchRequest *) MR_requestFirstByAttribute:(NSString *)attribute withValue:(id)searchValue inContext:(NSManagedObjectContext *)context; ++ (NSFetchRequest *) MR_requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending; ++ (NSFetchRequest *) MR_requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; ++ (NSFetchRequest *) MR_requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm; ++ (NSFetchRequest *) MR_requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; + + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRequests.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRequests.m new file mode 100644 index 0000000..8e4f0d8 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRequests.m @@ -0,0 +1,173 @@ +// +// NSManagedObject+MagicalRequests.m +// Magical Record +// +// Created by Saul Mora on 3/7/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import "NSManagedObject+MagicalRequests.h" +#import "NSManagedObject+MagicalRecord.h" +#import "NSManagedObjectContext+MagicalThreading.h" + +@implementation NSManagedObject (MagicalRequests) + + ++ (NSFetchRequest *)MR_createFetchRequestInContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [[NSFetchRequest alloc] init]; + [request setEntity:[self MR_entityDescriptionInContext:context]]; + + return request; +} + ++ (NSFetchRequest *) MR_createFetchRequest +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_createFetchRequestInContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + + ++ (NSFetchRequest *) MR_requestAll +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_createFetchRequestInContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSFetchRequest *) MR_requestAllInContext:(NSManagedObjectContext *)context +{ + return [self MR_createFetchRequestInContext:context]; +} + ++ (NSFetchRequest *) MR_requestAllWithPredicate:(NSPredicate *)searchTerm; +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_requestAllWithPredicate:searchTerm inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSFetchRequest *) MR_requestAllWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; +{ + NSFetchRequest *request = [self MR_createFetchRequestInContext:context]; + [request setPredicate:searchTerm]; + + return request; +} + ++ (NSFetchRequest *) MR_requestAllWhere:(NSString *)property isEqualTo:(id)value +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_requestAllWhere:property isEqualTo:value inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSFetchRequest *) MR_requestAllWhere:(NSString *)property isEqualTo:(id)value inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_createFetchRequestInContext:context]; + [request setPredicate:[NSPredicate predicateWithFormat:@"%K = %@", property, value]]; + + return request; +} + ++ (NSFetchRequest *) MR_requestFirstWithPredicate:(NSPredicate *)searchTerm +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_requestFirstWithPredicate:searchTerm inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSFetchRequest *) MR_requestFirstWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_createFetchRequestInContext:context]; + [request setPredicate:searchTerm]; + [request setFetchLimit:1]; + + return request; +} + ++ (NSFetchRequest *) MR_requestFirstByAttribute:(NSString *)attribute withValue:(id)searchValue; +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_requestFirstByAttribute:attribute withValue:searchValue inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSFetchRequest *) MR_requestFirstByAttribute:(NSString *)attribute withValue:(id)searchValue inContext:(NSManagedObjectContext *)context; +{ + NSFetchRequest *request = [self MR_requestAllWhere:attribute isEqualTo:searchValue inContext:context]; + [request setFetchLimit:1]; + + return request; +} + ++ (NSFetchRequest *) MR_requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context +{ + return [self MR_requestAllSortedBy:sortTerm + ascending:ascending + withPredicate:nil + inContext:context]; +} + ++ (NSFetchRequest *) MR_requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [self MR_requestAllSortedBy:sortTerm + ascending:ascending + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop +} + ++ (NSFetchRequest *) MR_requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context +{ + NSFetchRequest *request = [self MR_requestAllInContext:context]; + if (searchTerm) + { + [request setPredicate:searchTerm]; + } + [request setFetchBatchSize:[self MR_defaultBatchSize]]; + + NSMutableArray* sortDescriptors = [[NSMutableArray alloc] init]; + NSArray* sortKeys = [sortTerm componentsSeparatedByString:@","]; + for (__strong NSString* sortKey in sortKeys) + { + NSArray * sortComponents = [sortKey componentsSeparatedByString:@":"]; + if (sortComponents.count > 1) + { + NSString * customAscending = sortComponents.lastObject; + ascending = customAscending.boolValue; + sortKey = sortComponents[0]; + } + + NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:sortKey ascending:ascending]; + [sortDescriptors addObject:sortDescriptor]; + } + + [request setSortDescriptors:sortDescriptors]; + + return request; +} + ++ (NSFetchRequest *) MR_requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm; +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + NSFetchRequest *request = [self MR_requestAllSortedBy:sortTerm + ascending:ascending + withPredicate:searchTerm + inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; +#pragma clang diagnostic pop + + return request; +} + + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalChainSave.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalChainSave.h new file mode 100644 index 0000000..5769bdc --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalChainSave.h @@ -0,0 +1,35 @@ +// +// NSManagedObjectContext+MagicalChainSave.h +// Magical Record +// +// Created by Lee on 8/27/14. +// Copyright (c) 2014 Magical Panda Software LLC. All rights reserved. +// + +#import +#import + +@interface NSManagedObjectContext (MagicalRecordChainSave) +/** + Creates a child context for the current context that you can make changes within, before saving up through all parent contexts to the main queue context, and finally to the saving context. This method will return immediately, and execute the save initially on a background thread, and then on the appropriate thread for each context it saves. + + @param block Block that is passed a managed object context. +*/ +- (void)MR_saveWithBlock:(void (^)(NSManagedObjectContext *localContext))block; + +/** + Creates a child context for the current context that you can make changes within, before saving up through all parent contexts to the main queue context, and finally to the saving context. This method will return immediately, and execute the save initially on a background thread, and then on the appropriate thread for each context it saves. + + @param block Block that is passed a managed object context. + @param completion Completion block that is called once all contexts have been saved, or if an error is encountered. + */ +- (void)MR_saveWithBlock:(void (^)(NSManagedObjectContext *localContext))block completion:(MRSaveCompletionHandler)completion; + +/** + Creates a child context for the current context that you can make changes within, before saving up through all parent contexts to the main queue context, and finally to the saving context. This method will not return until the save has completed, blocking the thread it is called on. + + @param block Block that is passed a managed object context. + */ +- (void)MR_saveWithBlockAndWait:(void (^)(NSManagedObjectContext *localContext))block; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalChainSave.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalChainSave.m new file mode 100644 index 0000000..a3e1e9e --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalChainSave.m @@ -0,0 +1,50 @@ +// +// NSManagedObjectContext+MagicalChainSave.m +// Magical Record +// +// Created by Lee on 8/27/14. +// Copyright (c) 2014 Magical Panda Software LLC. All rights reserved. +// + +#import "NSManagedObjectContext+MagicalChainSave.h" +#import "NSManagedObjectContext+MagicalRecord.h" + +@implementation NSManagedObjectContext (MagicalRecord_ChainSave) +- (void)MR_saveWithBlock:(void (^)(NSManagedObjectContext *localContext))block; +{ + [self MR_saveWithBlock:block completion:nil]; +} + +- (void)MR_saveWithBlock:(void (^)(NSManagedObjectContext *localContext))block completion:(MRSaveCompletionHandler)completion; +{ + NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextWithParent:self]; + + [localContext performBlock:^{ + [localContext MR_setWorkingName:NSStringFromSelector(_cmd)]; + + if (block) { + block(localContext); + } + + [localContext MR_saveWithOptions:MRSaveParentContexts completion:completion]; + }]; +} + +#pragma mark - Synchronous saving + +- (void)MR_saveWithBlockAndWait:(void (^)(NSManagedObjectContext *localContext))block; +{ + NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextWithParent:self]; + + [localContext performBlockAndWait:^{ + [localContext MR_setWorkingName:NSStringFromSelector(_cmd)]; + + if (block) { + block(localContext); + } + + [localContext MR_saveWithOptions:MRSaveParentContexts|MRSaveSynchronously completion:nil]; + }]; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.h new file mode 100644 index 0000000..728acab --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.h @@ -0,0 +1,69 @@ +// +// NSManagedObjectContext+MagicalObserving.h +// Magical Record +// +// Created by Saul Mora on 3/9/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import + +extern NSString * const kMagicalRecordDidMergeChangesFromiCloudNotification; + +/** + Category methods to aid in observing changes in other contexts. + + @since Available in v2.0 and later. + */ +@interface NSManagedObjectContext (MagicalObserving) + +/** + Merge changes from another context into self. + + @param otherContext Managed object context to observe. + + @since Available in v2.0 and later. + */ +- (void) MR_observeContext:(NSManagedObjectContext *)otherContext; + +/** + Stops merging changes from the supplied context into self. + + @param otherContext Managed object context to stop observing. + + @since Available in v2.0 and later. + */ +- (void) MR_stopObservingContext:(NSManagedObjectContext *)otherContext; + +/** + Merges changes from another context into self on the main thread. + + @param otherContext Managed object context to observe. + + @since Available in v2.0 and later. + */ +- (void) MR_observeContextOnMainThread:(NSManagedObjectContext *)otherContext; + +/** + Merges changes from the supplied persistent store coordinator into self in response to changes from iCloud. + + @param coordinator Persistent store coordinator + + @see -MR_stopObservingiCloudChangesInCoordinator: + + @since Available in v2.0 and later. + */ +- (void) MR_observeiCloudChangesInCoordinator:(NSPersistentStoreCoordinator *)coordinator; + +/** + Stops observation and merging of changes from the supplied persistent store coordinator in response to changes from iCloud. + + @param coordinator Persistent store coordinator + + @see -MR_observeiCloudChangesInCoordinator: + + @since Available in v2.0 and later. + */ +- (void) MR_stopObservingiCloudChangesInCoordinator:(NSPersistentStoreCoordinator *)coordinator; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.m new file mode 100644 index 0000000..949634a --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.m @@ -0,0 +1,108 @@ +// +// NSManagedObjectContext+MagicalObserving.m +// Magical Record +// +// Created by Saul Mora on 3/9/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import "NSManagedObjectContext+MagicalObserving.h" +#import "NSManagedObjectContext+MagicalRecord.h" +#import "MagicalRecord+iCloud.h" +#import "MagicalRecordLogging.h" + +NSString * const kMagicalRecordDidMergeChangesFromiCloudNotification = @"kMagicalRecordDidMergeChangesFromiCloudNotification"; + +@implementation NSManagedObjectContext (MagicalObserving) + +#pragma mark - Context Observation Helpers + +- (void) MR_observeContext:(NSManagedObjectContext *)otherContext +{ + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + [notificationCenter addObserver:self + selector:@selector(MR_mergeChangesFromNotification:) + name:NSManagedObjectContextDidSaveNotification + object:otherContext]; +} + +- (void) MR_stopObservingContext:(NSManagedObjectContext *)otherContext +{ + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + + [notificationCenter removeObserver:self + name:NSManagedObjectContextDidSaveNotification + object:otherContext]; +} + +- (void) MR_observeContextOnMainThread:(NSManagedObjectContext *)otherContext +{ + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + [notificationCenter addObserver:self + selector:@selector(MR_mergeChangesOnMainThread:) + name:NSManagedObjectContextDidSaveNotification + object:otherContext]; +} + +#pragma mark - Context iCloud Merge Helpers + +- (void) MR_mergeChangesFromiCloud:(NSNotification *)notification; +{ + [self performBlock:^{ + + MRLogVerbose(@"Merging changes From iCloud %@context%@", + self == [NSManagedObjectContext MR_defaultContext] ? @"*** DEFAULT *** " : @"", + ([NSThread isMainThread] ? @" *** on Main Thread ***" : @"")); + + [self mergeChangesFromContextDidSaveNotification:notification]; + + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + + [notificationCenter postNotificationName:kMagicalRecordDidMergeChangesFromiCloudNotification + object:self + userInfo:[notification userInfo]]; + }]; +} + +- (void) MR_mergeChangesFromNotification:(NSNotification *)notification; +{ + MRLogVerbose(@"Merging changes to %@context%@", + self == [NSManagedObjectContext MR_defaultContext] ? @"*** DEFAULT *** " : @"", + ([NSThread isMainThread] ? @" *** on Main Thread ***" : @"")); + + [self mergeChangesFromContextDidSaveNotification:notification]; +} + +- (void) MR_mergeChangesOnMainThread:(NSNotification *)notification; +{ + if ([NSThread isMainThread]) + { + [self MR_mergeChangesFromNotification:notification]; + } + else + { + [self performSelectorOnMainThread:@selector(MR_mergeChangesFromNotification:) withObject:notification waitUntilDone:YES]; + } +} + +- (void) MR_observeiCloudChangesInCoordinator:(NSPersistentStoreCoordinator *)coordinator; +{ + if (![MagicalRecord isICloudEnabled]) return; + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + [notificationCenter addObserver:self + selector:@selector(MR_mergeChangesFromiCloud:) + name:NSPersistentStoreDidImportUbiquitousContentChangesNotification + object:coordinator]; + +} + +- (void) MR_stopObservingiCloudChangesInCoordinator:(NSPersistentStoreCoordinator *)coordinator; +{ + if (![MagicalRecord isICloudEnabled]) return; + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + [notificationCenter removeObserver:self + name:NSPersistentStoreDidImportUbiquitousContentChangesNotification + object:coordinator]; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalRecord.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalRecord.h new file mode 100644 index 0000000..b2accdb --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalRecord.h @@ -0,0 +1,129 @@ +// +// NSManagedObjectContext+MagicalRecord.h +// +// Created by Saul Mora on 11/23/09. +// Copyright 2010 Magical Panda Software, LLC All rights reserved. +// + +#import +#import + +@interface NSManagedObjectContext (MagicalRecord) + +#pragma mark - Setup + +/** + Initializes MagicalRecord's default contexts using the provided persistent store coordinator. + + @param coordinator Persistent Store Coordinator + */ ++ (void) MR_initializeDefaultContextWithCoordinator:(NSPersistentStoreCoordinator *)coordinator; + +#pragma mark - Default Contexts +/** + Root context responsible for sending changes to the main persistent store coordinator that will be saved to disk. + + @discussion Use this context for making and saving changes. All saves will be merged into the context returned by `MR_defaultContext` as well. + + @return Private context used for saving changes to disk on a background thread + */ ++ (NSManagedObjectContext *) MR_rootSavingContext; + +/** + @discussion Please do not use this context for saving changes, as it will block the main thread when doing so. + + @return Main queue context that can be observed for changes + */ ++ (NSManagedObjectContext *) MR_defaultContext; + +#pragma mark - Context Creation + +/** + Creates and returns a new managed object context of type `NSPrivateQueueConcurrencyType`, with it's parent context set to the root saving context. + @return Private context with the parent set to the root saving context + */ ++ (NSManagedObjectContext *) MR_context; + +/** + Creates and returns a new managed object context of type `NSPrivateQueueConcurrencyType`, with it's parent context set to the root saving context. + + @param parentContext Context to set as the parent of the newly initialized context + + @return Private context with the parent set to the provided context + */ ++ (NSManagedObjectContext *) MR_contextWithParent:(NSManagedObjectContext *)parentContext; + +/** + Creates and returns a new managed object context of type `NSPrivateQueueConcurrencyType`, with it's persistent store coordinator set to the provided coordinator. + + @param coordinator A persistent store coordinator + + @return Private context with it's persistent store coordinator set to the provided coordinator + */ ++ (NSManagedObjectContext *) MR_contextWithStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator; + +/** + Initializes a context of type `NSMainQueueConcurrencyType`. + + @return A context initialized using the `NSPrivateQueueConcurrencyType` concurrency type. + */ ++ (NSManagedObjectContext *) MR_newMainQueueContext NS_RETURNS_RETAINED; + +/** + Initializes a context of type `NSPrivateQueueConcurrencyType`. + + @return A context initialized using the `NSPrivateQueueConcurrencyType` concurrency type. + */ ++ (NSManagedObjectContext *) MR_newPrivateQueueContext NS_RETURNS_RETAINED; + +#pragma mark - Debugging + +/** + Sets a working name for the context, which will be used in debug logs. + + @param workingName Name for the context + */ +- (void) MR_setWorkingName:(NSString *)workingName; + +/** + @return Working name for the context + */ +- (NSString *) MR_workingName; + +/** + @return Description of this context + */ +- (NSString *) MR_description; + +/** + @return Description of the parent contexts of this context + */ +- (NSString *) MR_parentChain; + + +#pragma mark - Helpers + +/** + Reset the default context. + */ ++ (void) MR_resetDefaultContext; + +/** + Delete the provided objects from the context + + @param objects An object conforming to `NSFastEnumeration`, containing NSManagedObject instances + */ +- (void) MR_deleteObjects:(id )objects; + +@end + +#pragma mark - Deprecated Methods — DO NOT USE +@interface NSManagedObjectContext (MagicalRecordDeprecated) + ++ (NSManagedObjectContext *) MR_contextWithoutParent MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("4.0", "MR_newPrivateQueueContext"); ++ (NSManagedObjectContext *) MR_newContext MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("4.0", "MR_context"); ++ (NSManagedObjectContext *) MR_newContextWithParent:(NSManagedObjectContext *)parentContext MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("4.0", "MR_contextWithParent:"); ++ (NSManagedObjectContext *) MR_newContextWithStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("4.0", "MR_contextWithStoreCoordinator:"); + + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalRecord.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalRecord.m new file mode 100644 index 0000000..c8787e5 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalRecord.m @@ -0,0 +1,324 @@ +// +// NSManagedObjectContext+MagicalRecord.m +// +// Created by Saul Mora on 11/23/09. +// Copyright 2010 Magical Panda Software, LLC All rights reserved. +// + +#import "NSManagedObjectContext+MagicalRecord.h" +#import "NSManagedObjectContext+MagicalObserving.h" +#import "NSManagedObjectContext+MagicalThreading.h" +#import "NSPersistentStoreCoordinator+MagicalRecord.h" +#import "MagicalRecord+ErrorHandling.h" +#import "MagicalRecord+iCloud.h" +#import "MagicalRecordLogging.h" + +static NSString * const MagicalRecordContextWorkingName = @"MagicalRecordContextWorkingName"; + +static NSManagedObjectContext *MagicalRecordRootSavingContext; +static NSManagedObjectContext *MagicalRecordDefaultContext; + +static id MagicalRecordUbiquitySetupNotificationObserver; + +@implementation NSManagedObjectContext (MagicalRecord) + +#pragma mark - Setup + ++ (void) MR_initializeDefaultContextWithCoordinator:(NSPersistentStoreCoordinator *)coordinator; +{ + NSAssert(coordinator, @"Provided coordinator cannot be nil!"); + if (MagicalRecordDefaultContext == nil) + { + NSManagedObjectContext *rootContext = [self MR_contextWithStoreCoordinator:coordinator]; + [self MR_setRootSavingContext:rootContext]; + + NSManagedObjectContext *defaultContext = [self MR_newMainQueueContext]; + [self MR_setDefaultContext:defaultContext]; + + [defaultContext setParentContext:rootContext]; + } +} + +#pragma mark - Default Contexts + ++ (NSManagedObjectContext *) MR_defaultContext +{ + @synchronized(self) { + NSAssert(MagicalRecordDefaultContext != nil, @"Default context is nil! Did you forget to initialize the Core Data Stack?"); + return MagicalRecordDefaultContext; + } +} + ++ (NSManagedObjectContext *) MR_rootSavingContext; +{ + return MagicalRecordRootSavingContext; +} + +#pragma mark - Context Creation + ++ (NSManagedObjectContext *) MR_context +{ + return [self MR_contextWithParent:[self MR_rootSavingContext]]; +} + ++ (NSManagedObjectContext *) MR_contextWithParent:(NSManagedObjectContext *)parentContext +{ + NSManagedObjectContext *context = [self MR_newPrivateQueueContext]; + [context setParentContext:parentContext]; + [context MR_obtainPermanentIDsBeforeSaving]; + return context; +} + ++ (NSManagedObjectContext *) MR_contextWithStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator +{ + NSManagedObjectContext *context = nil; + if (coordinator != nil) + { + context = [self MR_newPrivateQueueContext]; + [context performBlockAndWait:^{ + [context setPersistentStoreCoordinator:coordinator]; + MRLogVerbose(@"Created new context %@ with store coordinator: %@", [context MR_workingName], coordinator); + }]; + } + return context; +} + ++ (NSManagedObjectContext *) MR_newMainQueueContext +{ + NSManagedObjectContext *context = [[self alloc] initWithConcurrencyType:NSMainQueueConcurrencyType]; + MRLogInfo(@"Created new main queue context: %@", context); + return context; +} + ++ (NSManagedObjectContext *) MR_newPrivateQueueContext +{ + NSManagedObjectContext *context = [[self alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; + MRLogInfo(@"Created new private queue context: %@", context); + return context; +} + +#pragma mark - Debugging + +- (void) MR_setWorkingName:(NSString *)workingName +{ + [[self userInfo] setObject:workingName forKey:MagicalRecordContextWorkingName]; +} + +- (NSString *) MR_workingName +{ + NSString *workingName = [[self userInfo] objectForKey:MagicalRecordContextWorkingName]; + + if ([workingName length] == 0) + { + workingName = @"Untitled Context"; + } + + return workingName; +} + +- (NSString *) MR_description +{ + NSString *onMainThread = [NSThread isMainThread] ? @"the main thread" : @"a background thread"; + + __block NSString *workingName; + + [self performBlockAndWait:^{ + workingName = [self MR_workingName]; + }]; + + return [NSString stringWithFormat:@"<%@ (%p): %@> on %@", NSStringFromClass([self class]), self, workingName, onMainThread]; +} + +- (NSString *) MR_parentChain +{ + NSMutableString *familyTree = [@"\n" mutableCopy]; + NSManagedObjectContext *currentContext = self; + do + { + [familyTree appendFormat:@"- %@ (%p) %@\n", [currentContext MR_workingName], currentContext, (currentContext == self ? @"(*)" : @"")]; + } + while ((currentContext = [currentContext parentContext])); + + return [NSString stringWithString:familyTree]; +} + +#pragma mark - Helpers + ++ (void) MR_resetDefaultContext +{ + NSManagedObjectContext *defaultContext = [NSManagedObjectContext MR_defaultContext]; + NSAssert(NSConfinementConcurrencyType == [defaultContext concurrencyType], @"Do not call this method on a confinement context."); + + if ([NSThread isMainThread] == NO) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self MR_resetDefaultContext]; + }); + + return; + } + + [defaultContext reset]; +} + +- (void) MR_deleteObjects:(id )objects +{ + for (NSManagedObject *managedObject in objects) + { + [self deleteObject:managedObject]; + } +} + +#pragma mark - Notification Handlers + +- (void) MR_contextWillSave:(NSNotification *)notification +{ + NSManagedObjectContext *context = [notification object]; + NSSet *insertedObjects = [context insertedObjects]; + + if ([insertedObjects count]) + { + MRLogVerbose(@"Context '%@' is about to save: obtaining permanent IDs for %lu new inserted object(s).", [context MR_workingName], (unsigned long)[insertedObjects count]); + NSError *error = nil; + BOOL success = [context obtainPermanentIDsForObjects:[insertedObjects allObjects] error:&error]; + if (!success) + { + [MagicalRecord handleErrors:error]; + } + } +} + ++ (void)rootContextDidSave:(NSNotification *)notification +{ + if ([notification object] != [self MR_rootSavingContext]) + { + return; + } + + if ([NSThread isMainThread] == NO) + { + dispatch_async(dispatch_get_main_queue(), ^{ + [self rootContextDidSave:notification]; + }); + + return; + } + + for (NSManagedObject *object in [[notification userInfo] objectForKey:NSUpdatedObjectsKey]) + { + [[[self MR_defaultContext] objectWithID:[object objectID]] willAccessValueForKey:nil]; + } + + [[self MR_defaultContext] mergeChangesFromContextDidSaveNotification:notification]; +} + +#pragma mark - Private Methods + ++ (void) MR_cleanUp +{ + [self MR_setDefaultContext:nil]; + [self MR_setRootSavingContext:nil]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [self MR_clearNonMainThreadContextsCache]; +#pragma clang diagnostic pop +} + +- (void) MR_obtainPermanentIDsBeforeSaving +{ + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(MR_contextWillSave:) + name:NSManagedObjectContextWillSaveNotification + object:self]; +} + ++ (void) MR_setDefaultContext:(NSManagedObjectContext *)moc +{ + if (MagicalRecordDefaultContext) + { + [[NSNotificationCenter defaultCenter] removeObserver:MagicalRecordDefaultContext]; + } + + NSPersistentStoreCoordinator *coordinator = [NSPersistentStoreCoordinator MR_defaultStoreCoordinator]; + if (MagicalRecordUbiquitySetupNotificationObserver) + { + [[NSNotificationCenter defaultCenter] removeObserver:MagicalRecordUbiquitySetupNotificationObserver]; + MagicalRecordUbiquitySetupNotificationObserver = nil; + } + + if ([MagicalRecord isICloudEnabled]) + { + [MagicalRecordDefaultContext MR_stopObservingiCloudChangesInCoordinator:coordinator]; + } + + MagicalRecordDefaultContext = moc; + [MagicalRecordDefaultContext MR_setWorkingName:@"MagicalRecord Default Context"]; + + if ((MagicalRecordDefaultContext != nil) && ([self MR_rootSavingContext] != nil)) { + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(rootContextDidSave:) + name:NSManagedObjectContextDidSaveNotification + object:[self MR_rootSavingContext]]; + } + + [moc MR_obtainPermanentIDsBeforeSaving]; + if ([MagicalRecord isICloudEnabled]) + { + [MagicalRecordDefaultContext MR_observeiCloudChangesInCoordinator:coordinator]; + } + else + { + // If icloud is NOT enabled at the time of this method being called, listen for it to be setup later, and THEN set up observing cloud changes + MagicalRecordUbiquitySetupNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMagicalRecordPSCDidCompleteiCloudSetupNotification + object:nil + queue:[NSOperationQueue mainQueue] + usingBlock:^(NSNotification *note) { + [[NSManagedObjectContext MR_defaultContext] MR_observeiCloudChangesInCoordinator:coordinator]; + }]; + } + MRLogInfo(@"Set default context: %@", MagicalRecordDefaultContext); +} + ++ (void)MR_setRootSavingContext:(NSManagedObjectContext *)context +{ + if (MagicalRecordRootSavingContext) + { + [[NSNotificationCenter defaultCenter] removeObserver:MagicalRecordRootSavingContext]; + } + + MagicalRecordRootSavingContext = context; + + [MagicalRecordRootSavingContext performBlock:^{ + [MagicalRecordRootSavingContext MR_obtainPermanentIDsBeforeSaving]; + [MagicalRecordRootSavingContext setMergePolicy:NSMergeByPropertyObjectTrumpMergePolicy]; + [MagicalRecordRootSavingContext MR_setWorkingName:@"MagicalRecord Root Saving Context"]; + }]; + + MRLogInfo(@"Set root saving context: %@", MagicalRecordRootSavingContext); +} + +@end + +#pragma mark - Deprecated Methods — DO NOT USE +@implementation NSManagedObjectContext (MagicalRecordDeprecated) + ++ (NSManagedObjectContext *) MR_contextWithoutParent +{ + return [self MR_newPrivateQueueContext]; +} + ++ (NSManagedObjectContext *) MR_newContext +{ + return [self MR_context]; +} + ++ (NSManagedObjectContext *) MR_newContextWithParent:(NSManagedObjectContext *)parentContext +{ + return [self MR_contextWithParent:parentContext]; +} + ++ (NSManagedObjectContext *) MR_newContextWithStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator +{ + return [self MR_contextWithStoreCoordinator:coordinator]; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalSaves.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalSaves.h new file mode 100644 index 0000000..a0404d2 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalSaves.h @@ -0,0 +1,91 @@ +// +// NSManagedObjectContext+MagicalSaves.h +// Magical Record +// +// Created by Saul Mora on 3/9/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import +#import + +typedef NS_OPTIONS(NSUInteger, MRSaveOptions) { + /** No options — used for cleanliness only */ + MRSaveOptionNone = 0, + + /** When saving, continue saving parent contexts until the changes are present in the persistent store */ + MRSaveParentContexts = 1 << 1, + + /** Perform saves synchronously, blocking execution on the current thread until the save is complete */ + MRSaveSynchronously = 1 << 2, + + /** Perform saves synchronously, blocking execution on the current thread until the save is complete; however, saves root context asynchronously */ + MRSaveSynchronouslyExceptRootContext = 1 << 3 +}; + +typedef void (^MRSaveCompletionHandler)(BOOL contextDidSave, NSError *error); + +@interface NSManagedObjectContext (MagicalSaves) + +/** + Asynchronously save changes in the current context and it's parent. + Executes a save on the current context's dispatch queue asynchronously. This method only saves the current context, and the parent of the current context if one is set. The completion block will always be called on the main queue. + + @param completion Completion block that is called after the save has completed. The block is passed a success state as a `BOOL` and an `NSError` instance if an error occurs. Always called on the main queue. + + @since Available in v2.1.0 and later. +*/ +- (void) MR_saveOnlySelfWithCompletion:(MRSaveCompletionHandler)completion; + +/** + Asynchronously save changes in the current context all the way back to the persistent store. + Executes asynchronous saves on the current context, and any ancestors, until the changes have been persisted to the assigned persistent store. The completion block will always be called on the main queue. + + @param completion Completion block that is called after the save has completed. The block is passed a success state as a `BOOL` and an `NSError` instance if an error occurs. Always called on the main queue. + + @since Available in v2.1.0 and later. + */ +- (void) MR_saveToPersistentStoreWithCompletion:(MRSaveCompletionHandler)completion; + +/** + Synchronously save changes in the current context and it's parent. + Executes a save on the current context's dispatch queue. This method only saves the current context, and the parent of the current context if one is set. The method will not return until the save is complete. + + @since Available in v2.1.0 and later. + */ +- (void) MR_saveOnlySelfAndWait; + +/** + Synchronously save changes in the current context all the way back to the persistent store. + Executes saves on the current context, and any ancestors, until the changes have been persisted to the assigned persistent store. The method will not return until the save is complete. + + @since Available in v2.1.0 and later. + */ +- (void) MR_saveToPersistentStoreAndWait; + +/** + Save the current context with options. + All other save methods are conveniences to this method. + + @param saveOptions Bitmasked options for the save process. + @param completion Completion block that is called after the save has completed. The block is passed a success state as a `BOOL` and an `NSError` instance if an error occurs. Always called on the main queue. + + @since Available in v2.1.0 and later. + */ +- (void) MR_saveWithOptions:(MRSaveOptions)saveOptions completion:(MRSaveCompletionHandler)completion; + +@end + +#pragma mark - Deprecated Methods — DO NOT USE +@interface NSManagedObjectContext (MagicalSavesDeprecated) + +- (void) MR_save MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("3.0", "MR_saveToPersistentStoreAndWait"); +- (void) MR_saveWithErrorCallback:(void(^)(NSError *error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0"); +- (void) MR_saveInBackgroundCompletion:(void (^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0"); +- (void) MR_saveInBackgroundErrorHandler:(void (^)(NSError *error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0"); +- (void) MR_saveInBackgroundErrorHandler:(void (^)(NSError *error))errorCallback completion:(void (^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0"); +- (void) MR_saveNestedContexts MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("3.0", "MR_saveToPersistentStoreWithCompletion:"); +- (void) MR_saveNestedContextsErrorHandler:(void (^)(NSError *error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("3.0", "MR_saveToPersistentStoreWithCompletion:"); +- (void) MR_saveNestedContextsErrorHandler:(void (^)(NSError *error))errorCallback completion:(void (^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("3.0", "MR_saveToPersistentStoreWithCompletion:"); + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalSaves.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalSaves.m new file mode 100644 index 0000000..c95cdbd --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalSaves.m @@ -0,0 +1,219 @@ +// +// NSManagedObjectContext+MagicalSaves.m +// Magical Record +// +// Created by Saul Mora on 3/9/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import "NSManagedObjectContext+MagicalSaves.h" +#import "NSManagedObjectContext+MagicalRecord.h" +#import "MagicalRecord+ErrorHandling.h" +#import "MagicalRecordLogging.h" + +@implementation NSManagedObjectContext (MagicalSaves) + +- (void) MR_saveOnlySelfWithCompletion:(MRSaveCompletionHandler)completion; +{ + [self MR_saveWithOptions:MRSaveOptionNone completion:completion]; +} + +- (void) MR_saveOnlySelfAndWait; +{ + [self MR_saveWithOptions:MRSaveSynchronously completion:nil]; +} + +- (void) MR_saveToPersistentStoreWithCompletion:(MRSaveCompletionHandler)completion; +{ + [self MR_saveWithOptions:MRSaveParentContexts completion:completion]; +} + +- (void) MR_saveToPersistentStoreAndWait; +{ + [self MR_saveWithOptions:MRSaveParentContexts | MRSaveSynchronously completion:nil]; +} + +- (void) MR_saveWithOptions:(MRSaveOptions)saveOptions completion:(MRSaveCompletionHandler)completion; +{ + __block BOOL hasChanges = NO; + + if ([self concurrencyType] == NSConfinementConcurrencyType) + { + hasChanges = [self hasChanges]; + } + else + { + [self performBlockAndWait:^{ + hasChanges = [self hasChanges]; + }]; + } + + if (!hasChanges) + { + MRLogVerbose(@"NO CHANGES IN ** %@ ** CONTEXT - NOT SAVING", [self MR_workingName]); + + if (completion) + { + dispatch_async(dispatch_get_main_queue(), ^{ + completion(NO, nil); + }); + } + + return; + } + + BOOL shouldSaveParentContexts = ((saveOptions & MRSaveParentContexts) == MRSaveParentContexts); + BOOL shouldSaveSynchronously = ((saveOptions & MRSaveSynchronously) == MRSaveSynchronously); + BOOL shouldSaveSynchronouslyExceptRoot = ((saveOptions & MRSaveSynchronouslyExceptRootContext) == MRSaveSynchronouslyExceptRootContext); + + BOOL saveSynchronously = (shouldSaveSynchronously && !shouldSaveSynchronouslyExceptRoot) || + (shouldSaveSynchronouslyExceptRoot && (self != [[self class] MR_rootSavingContext])); + + id saveBlock = ^{ + MRLogInfo(@"→ Saving %@", [self MR_description]); + MRLogVerbose(@"→ Save Parents? %@", shouldSaveParentContexts ? @"YES" : @"NO"); + MRLogVerbose(@"→ Save Synchronously? %@", saveSynchronously ? @"YES" : @"NO"); + + BOOL saveResult = NO; + NSError *error = nil; + + @try + { + saveResult = [self save:&error]; + } + @catch(NSException *exception) + { + MRLogError(@"Unable to perform save: %@", (id)[exception userInfo] ?: (id)[exception reason]); + } + @finally + { + [MagicalRecord handleErrors:error]; + + if (saveResult && shouldSaveParentContexts && [self parentContext]) + { + // Add/remove the synchronous save option from the mask if necessary + MRSaveOptions modifiedOptions = saveOptions; + + if (saveSynchronously) + { + modifiedOptions |= MRSaveSynchronously; + } + else + { + modifiedOptions &= ~MRSaveSynchronously; + } + + // If we're saving parent contexts, do so + [[self parentContext] MR_saveWithOptions:modifiedOptions completion:completion]; + } + else + { + if (saveResult) + { + MRLogVerbose(@"→ Finished saving: %@", [self MR_description]); + } + + if (completion) + { + dispatch_async(dispatch_get_main_queue(), ^{ + completion(saveResult, error); + }); + } + } + } + }; + + if (saveSynchronously) + { + [self performBlockAndWait:saveBlock]; + } + else + { + [self performBlock:saveBlock]; + } +} + +@end + +#pragma mark - Deprecated Methods — DO NOT USE +@implementation NSManagedObjectContext (MagicalSavesDeprecated) + +- (void) MR_save; +{ + [self MR_saveToPersistentStoreAndWait]; +} + +- (void) MR_saveWithErrorCallback:(void (^)(NSError *error))errorCallback; +{ + [self MR_saveWithOptions:MRSaveSynchronously | MRSaveParentContexts completion:^(BOOL contextDidSave, NSError *error) { + if (!contextDidSave && errorCallback) + { + errorCallback(error); + } + }]; +} + +- (void) MR_saveInBackgroundCompletion:(void (^)(void))completion; +{ + [self MR_saveOnlySelfWithCompletion:^(BOOL contextDidSave, NSError *error) { + if (contextDidSave && completion) + { + completion(); + } + }]; +} + +- (void) MR_saveInBackgroundErrorHandler:(void (^)(NSError *error))errorCallback; +{ + [self MR_saveOnlySelfWithCompletion:^(BOOL contextDidSave, NSError *error) { + if (!contextDidSave && errorCallback) + { + errorCallback(error); + } + }]; +} + +- (void) MR_saveInBackgroundErrorHandler:(void (^)(NSError *error))errorCallback completion:(void (^)(void))completion; +{ + [self MR_saveOnlySelfWithCompletion:^(BOOL contextDidSave, NSError *error) { + if (contextDidSave && completion) + { + completion(); + } + else if (errorCallback) + { + errorCallback(error); + } + }]; +} + +- (void) MR_saveNestedContexts; +{ + [self MR_saveToPersistentStoreWithCompletion:nil]; +} + +- (void) MR_saveNestedContextsErrorHandler:(void (^)(NSError *error))errorCallback; +{ + [self MR_saveToPersistentStoreWithCompletion:^(BOOL contextDidSave, NSError *error) { + if (!contextDidSave && errorCallback) + { + errorCallback(error); + } + }]; +} + +- (void) MR_saveNestedContextsErrorHandler:(void (^)(NSError *error))errorCallback completion:(void (^)(void))completion; +{ + [self MR_saveToPersistentStoreWithCompletion:^(BOOL contextDidSave, NSError *error) { + if (contextDidSave && completion) + { + completion(); + } + else if (errorCallback) + { + errorCallback(error); + } + }]; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.h new file mode 100644 index 0000000..babadfc --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.h @@ -0,0 +1,18 @@ +// +// NSManagedObjectContext+MagicalThreading.h +// Magical Record +// +// Created by Saul Mora on 3/9/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import + +@interface NSManagedObjectContext (MagicalThreading) + ++ (NSManagedObjectContext *) MR_contextForCurrentThread __attribute((deprecated("This method will be removed in MagicalRecord 3.0"))); ++ (void) MR_clearNonMainThreadContextsCache __attribute((deprecated("This method will be removed in MagicalRecord 3.0"))); ++ (void) MR_resetContextForCurrentThread __attribute((deprecated("This method will be removed in MagicalRecord 3.0"))); ++ (void) MR_clearContextForCurrentThread __attribute((deprecated("This method will be removed in MagicalRecord 3.0"))); + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.m new file mode 100644 index 0000000..a5cb786 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.m @@ -0,0 +1,69 @@ +// +// NSManagedObjectContext+MagicalThreading.m +// Magical Record +// +// Created by Saul Mora on 3/9/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import "NSManagedObjectContext+MagicalThreading.h" +#import "NSManagedObjectContext+MagicalRecord.h" +#import "NSManagedObject+MagicalRecord.h" +#include + +static NSString const * kMagicalRecordManagedObjectContextKey = @"MagicalRecord_NSManagedObjectContextForThreadKey"; +static NSString const * kMagicalRecordManagedObjectContextCacheVersionKey = @"MagicalRecord_CacheVersionOfNSManagedObjectContextForThreadKey"; +static volatile int32_t contextsCacheVersion = 0; + + +@implementation NSManagedObjectContext (MagicalThreading) + ++ (void)MR_resetContextForCurrentThread +{ + [[NSManagedObjectContext MR_contextForCurrentThread] reset]; +} + ++ (void) MR_clearNonMainThreadContextsCache +{ + OSAtomicIncrement32(&contextsCacheVersion); +} + ++ (NSManagedObjectContext *) MR_contextForCurrentThread; +{ + if ([NSThread isMainThread]) + { + return [self MR_defaultContext]; + } + else + { + // contextsCacheVersion can change (atomically) at any time, so grab a copy to ensure that we always + // use the same value throughout the remainder of this method. We are OK with this method returning + // an outdated context if MR_clearNonMainThreadContextsCache is called from another thread while this + // method is being executed. This behavior is unrelated to our choice to use a counter for synchronization. + // We would have the same behavior if we used @synchronized() (or any other lock-based synchronization + // method) since MR_clearNonMainThreadContextsCache would have to wait until this method finished before + // it could acquire the mutex, resulting in us still returning an outdated context in that case as well. + int32_t targetCacheVersionForContext = contextsCacheVersion; + + NSMutableDictionary *threadDict = [[NSThread currentThread] threadDictionary]; + NSManagedObjectContext *threadContext = [threadDict objectForKey:kMagicalRecordManagedObjectContextKey]; + NSNumber *currentCacheVersionForContext = [threadDict objectForKey:kMagicalRecordManagedObjectContextCacheVersionKey]; + NSAssert((threadContext && currentCacheVersionForContext) || (!threadContext && !currentCacheVersionForContext), + @"The Magical Record keys should either both be present or neither be present, otherwise we're in an inconsistent state!"); + if ((threadContext == nil) || (currentCacheVersionForContext == nil) || ((int32_t)[currentCacheVersionForContext integerValue] != targetCacheVersionForContext)) + { + threadContext = [self MR_contextWithParent:[NSManagedObjectContext MR_defaultContext]]; + [threadDict setObject:threadContext forKey:kMagicalRecordManagedObjectContextKey]; + [threadDict setObject:[NSNumber numberWithInteger:targetCacheVersionForContext] + forKey:kMagicalRecordManagedObjectContextCacheVersionKey]; + } + return threadContext; + } +} + ++ (void) MR_clearContextForCurrentThread { + [[[NSThread currentThread] threadDictionary] removeObjectForKey:kMagicalRecordManagedObjectContextKey]; + [[[NSThread currentThread] threadDictionary] removeObjectForKey:kMagicalRecordManagedObjectContextCacheVersionKey]; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.h new file mode 100644 index 0000000..2c0c075 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.h @@ -0,0 +1,22 @@ +// +// NSManagedObjectModel+MagicalRecord.h +// +// Created by Saul Mora on 3/11/10. +// Copyright 2010 Magical Panda Software, LLC All rights reserved. +// + +#import + +@interface NSManagedObjectModel (MagicalRecord) + ++ (NSManagedObjectModel *) MR_defaultManagedObjectModel; + ++ (void) MR_setDefaultManagedObjectModel:(NSManagedObjectModel *)newDefaultModel; + ++ (NSManagedObjectModel *) MR_mergedObjectModelFromMainBundle; ++ (NSManagedObjectModel *) MR_newManagedObjectModelNamed:(NSString *)modelFileName NS_RETURNS_RETAINED; ++ (NSManagedObjectModel *) MR_managedObjectModelNamed:(NSString *)modelFileName; ++ (NSManagedObjectModel *) MR_newModelNamed:(NSString *) modelName inBundleNamed:(NSString *) bundleName NS_RETURNS_RETAINED; ++ (NSManagedObjectModel *) MR_newModelNamed:(NSString *) modelName inBundle:(NSBundle*) bundle NS_RETURNS_RETAINED; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.m new file mode 100644 index 0000000..e0fb9f5 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.m @@ -0,0 +1,73 @@ +// +// NSManagedObjectModel+MagicalRecord.m +// +// Created by Saul Mora on 3/11/10. +// Copyright 2010 Magical Panda Software, LLC All rights reserved. +// + +#import "NSManagedObjectModel+MagicalRecord.h" +#import "MagicalRecord+Options.h" + +static NSManagedObjectModel *defaultManagedObjectModel_ = nil; + +@implementation NSManagedObjectModel (MagicalRecord) + ++ (NSManagedObjectModel *) MR_defaultManagedObjectModel +{ + if (defaultManagedObjectModel_ == nil && [MagicalRecord shouldAutoCreateManagedObjectModel]) + { + [self MR_setDefaultManagedObjectModel:[self MR_mergedObjectModelFromMainBundle]]; + } + return defaultManagedObjectModel_; +} + ++ (void) MR_setDefaultManagedObjectModel:(NSManagedObjectModel *)newDefaultModel +{ + defaultManagedObjectModel_ = newDefaultModel; +} + ++ (NSManagedObjectModel *) MR_mergedObjectModelFromMainBundle; +{ + return [self mergedModelFromBundles:nil]; +} + ++ (NSManagedObjectModel *) MR_newModelNamed:(NSString *) modelName inBundleNamed:(NSString *) bundleName +{ + NSString *path = [[NSBundle mainBundle] pathForResource:[modelName stringByDeletingPathExtension] + ofType:[modelName pathExtension] + inDirectory:bundleName]; + NSURL *modelUrl = [NSURL fileURLWithPath:path]; + + NSManagedObjectModel *mom = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelUrl]; + + return mom; +} + ++ (NSManagedObjectModel *) MR_newModelNamed:(NSString *) modelName inBundle:(NSBundle*) bundle +{ + NSString *path = [bundle pathForResource:[modelName stringByDeletingPathExtension] + ofType:[modelName pathExtension]]; + NSURL *modelUrl = [NSURL fileURLWithPath:path]; + + NSManagedObjectModel *mom = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelUrl]; + + return mom; +} + ++ (NSManagedObjectModel *) MR_newManagedObjectModelNamed:(NSString *)modelFileName +{ + NSString *path = [[NSBundle mainBundle] pathForResource:[modelFileName stringByDeletingPathExtension] + ofType:[modelFileName pathExtension]]; + NSURL *momURL = [NSURL fileURLWithPath:path]; + + NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:momURL]; + return model; +} + ++ (NSManagedObjectModel *) MR_managedObjectModelNamed:(NSString *)modelFileName +{ + NSManagedObjectModel *model = [self MR_newManagedObjectModelNamed:modelFileName]; + return model; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStore+MagicalRecord.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStore+MagicalRecord.h new file mode 100644 index 0000000..560d3a2 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStore+MagicalRecord.h @@ -0,0 +1,27 @@ +// +// NSPersistentStore+MagicalRecord.h +// +// Created by Saul Mora on 3/11/10. +// Copyright 2010 Magical Panda Software, LLC All rights reserved. +// + +#import + +// option to autodelete store if it already exists + +extern NSString * const kMagicalRecordDefaultStoreFileName; + + +@interface NSPersistentStore (MagicalRecord) + ++ (NSURL *) MR_defaultLocalStoreUrl; + ++ (NSPersistentStore *) MR_defaultPersistentStore; ++ (void) MR_setDefaultPersistentStore:(NSPersistentStore *) store; + ++ (NSURL *) MR_urlForStoreName:(NSString *)storeFileName; ++ (NSURL *) MR_cloudURLForUbiqutiousContainer:(NSString *)bucketName; + +@end + + diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStore+MagicalRecord.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStore+MagicalRecord.m new file mode 100644 index 0000000..77507a7 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStore+MagicalRecord.m @@ -0,0 +1,66 @@ +// +// NSPersistentStore+MagicalRecord.m +// +// Created by Saul Mora on 3/11/10. +// Copyright 2010 Magical Panda Software, LLC All rights reserved. +// + +#import "NSPersistentStore+MagicalRecord.h" + +NSString * const kMagicalRecordDefaultStoreFileName = @"CoreDataStore.sqlite"; + +static NSPersistentStore *defaultPersistentStore_ = nil; + + +@implementation NSPersistentStore (MagicalRecord) + ++ (NSPersistentStore *) MR_defaultPersistentStore +{ + return defaultPersistentStore_; +} + ++ (void) MR_setDefaultPersistentStore:(NSPersistentStore *)store +{ + defaultPersistentStore_ = store; +} + ++ (NSString *) MR_directory:(NSSearchPathDirectory)type +{ + return [NSSearchPathForDirectoriesInDomains(type, NSUserDomainMask, YES) lastObject]; +} + ++ (NSString *)MR_applicationDocumentsDirectory +{ + return [self MR_directory:NSDocumentDirectory]; +} + ++ (NSString *)MR_applicationStorageDirectory +{ + NSString *applicationName = [[[NSBundle mainBundle] infoDictionary] valueForKey:(NSString *)kCFBundleNameKey]; + return [[self MR_directory:NSApplicationSupportDirectory] stringByAppendingPathComponent:applicationName]; +} + ++ (NSURL *) MR_urlForStoreName:(NSString *)storeFileName +{ + NSString *pathForStoreName = [[self MR_applicationStorageDirectory] stringByAppendingPathComponent:storeFileName]; + return [NSURL fileURLWithPath:pathForStoreName]; +} + ++ (NSURL *) MR_cloudURLForUbiqutiousContainer:(NSString *)bucketName; +{ + NSFileManager *fileManager = [[NSFileManager alloc] init]; + NSURL *cloudURL = nil; + if ([fileManager respondsToSelector:@selector(URLForUbiquityContainerIdentifier:)]) + { + cloudURL = [fileManager URLForUbiquityContainerIdentifier:bucketName]; + } + + return cloudURL; +} + ++ (NSURL *) MR_defaultLocalStoreUrl +{ + return [self MR_urlForStoreName:kMagicalRecordDefaultStoreFileName]; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStoreCoordinator+MagicalRecord.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStoreCoordinator+MagicalRecord.h new file mode 100644 index 0000000..08ea2b2 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStoreCoordinator+MagicalRecord.h @@ -0,0 +1,50 @@ +// +// NSPersistentStoreCoordinator+MagicalRecord.h +// +// Created by Saul Mora on 3/11/10. +// Copyright 2010 Magical Panda Software, LLC All rights reserved. +// + +#import + +extern NSString * const kMagicalRecordPSCDidCompleteiCloudSetupNotification; +extern NSString * const kMagicalRecordPSCMismatchWillDeleteStore; +extern NSString * const kMagicalRecordPSCMismatchDidDeleteStore; +extern NSString * const kMagicalRecordPSCMismatchWillRecreateStore; +extern NSString * const kMagicalRecordPSCMismatchDidRecreateStore; +extern NSString * const kMagicalRecordPSCMismatchCouldNotDeleteStore; +extern NSString * const kMagicalRecordPSCMismatchCouldNotRecreateStore; + +@interface NSPersistentStoreCoordinator (MagicalRecord) + ++ (NSPersistentStoreCoordinator *) MR_defaultStoreCoordinator; ++ (void) MR_setDefaultStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator; + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithInMemoryStore; + ++ (NSPersistentStoreCoordinator *) MR_newPersistentStoreCoordinator NS_RETURNS_RETAINED; + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithSqliteStoreNamed:(NSString *)storeFileName; ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithAutoMigratingSqliteStoreNamed:(NSString *)storeFileName; ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithSqliteStoreAtURL:(NSURL *)storeURL; ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithAutoMigratingSqliteStoreAtURL:(NSURL *)storeURL; ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithPersistentStore:(NSPersistentStore *)persistentStore; ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent; ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreAtURL:(NSURL *)storeURL cloudStorePathComponent:(NSString *)subPathComponent; + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent completion:(void(^)(void))completionHandler; ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreAtURL:(NSURL *)storeURL cloudStorePathComponent:(NSString *)subPathComponent completion:(void (^)(void))completionHandler; + +- (NSPersistentStore *) MR_addInMemoryStore; +- (NSPersistentStore *) MR_addAutoMigratingSqliteStoreNamed:(NSString *) storeFileName; +- (NSPersistentStore *) MR_addAutoMigratingSqliteStoreAtURL:(NSURL *)storeURL; + +- (NSPersistentStore *) MR_addSqliteStoreNamed:(id)storeFileName withOptions:(__autoreleasing NSDictionary *)options; +- (NSPersistentStore *) MR_addSqliteStoreNamed:(id)storeFileName configuration:(NSString *)configuration withOptions:(__autoreleasing NSDictionary *)options; + +- (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent; +- (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreAtURL:(NSURL *)storeURL cloudStorePathComponent:(NSString *)subPathComponent; +- (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent completion:(void(^)(void))completionBlock; +- (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreAtURL:(NSURL *)storeURL cloudStorePathComponent:(NSString *)subPathComponent completion:(void (^)(void))completionBlock; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStoreCoordinator+MagicalRecord.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStoreCoordinator+MagicalRecord.m new file mode 100644 index 0000000..fe11737 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Categories/NSPersistentStoreCoordinator+MagicalRecord.m @@ -0,0 +1,454 @@ +// +// NSPersistentStoreCoordinator+MagicalRecord.m +// +// Created by Saul Mora on 3/11/10. +// Copyright 2010 Magical Panda Software, LLC All rights reserved. +// + +#import "NSPersistentStoreCoordinator+MagicalRecord.h" +#import "NSPersistentStore+MagicalRecord.h" +#import "NSManagedObjectModel+MagicalRecord.h" +#import "MagicalRecord+ErrorHandling.h" +#import "MagicalRecordLogging.h" + + +static NSPersistentStoreCoordinator *defaultCoordinator_ = nil; +NSString * const kMagicalRecordPSCDidCompleteiCloudSetupNotification = @"kMagicalRecordPSCDidCompleteiCloudSetupNotification"; +NSString * const kMagicalRecordPSCMismatchWillDeleteStore = @"kMagicalRecordPSCMismatchWillDeleteStore"; +NSString * const kMagicalRecordPSCMismatchDidDeleteStore = @"kMagicalRecordPSCMismatchDidDeleteStore"; +NSString * const kMagicalRecordPSCMismatchWillRecreateStore = @"kMagicalRecordPSCMismatchWillRecreateStore"; +NSString * const kMagicalRecordPSCMismatchDidRecreateStore = @"kMagicalRecordPSCMismatchDidRecreateStore"; +NSString * const kMagicalRecordPSCMismatchCouldNotDeleteStore = @"kMagicalRecordPSCMismatchCouldNotDeleteStore"; +NSString * const kMagicalRecordPSCMismatchCouldNotRecreateStore = @"kMagicalRecordPSCMismatchCouldNotRecreateStore"; + +@interface NSDictionary (MagicalRecordMerging) + +- (NSMutableDictionary*) MR_dictionaryByMergingDictionary:(NSDictionary*)d; + +@end + +@interface MagicalRecord (iCloudPrivate) + ++ (void) setICloudEnabled:(BOOL)enabled; + +@end + +@implementation NSPersistentStoreCoordinator (MagicalRecord) + ++ (NSPersistentStoreCoordinator *) MR_defaultStoreCoordinator +{ + if (defaultCoordinator_ == nil && [MagicalRecord shouldAutoCreateDefaultPersistentStoreCoordinator]) + { + [self MR_setDefaultStoreCoordinator:[self MR_newPersistentStoreCoordinator]]; + } + return defaultCoordinator_; +} + ++ (void) MR_setDefaultStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator +{ + defaultCoordinator_ = coordinator; + + if (defaultCoordinator_ != nil) + { + NSArray *persistentStores = [defaultCoordinator_ persistentStores]; + + if ([persistentStores count] && [NSPersistentStore MR_defaultPersistentStore] == nil) + { + [NSPersistentStore MR_setDefaultPersistentStore:[persistentStores firstObject]]; + } + } +} + +- (void) MR_createPathToStoreFileIfNeccessary:(NSURL *)urlForStore +{ + NSFileManager *fileManager = [NSFileManager defaultManager]; + NSURL *pathToStore = [urlForStore URLByDeletingLastPathComponent]; + + NSError *error = nil; + BOOL pathWasCreated = [fileManager createDirectoryAtPath:[pathToStore path] withIntermediateDirectories:YES attributes:nil error:&error]; + + if (!pathWasCreated) + { + [MagicalRecord handleErrors:error]; + } +} + +- (NSPersistentStore *) MR_addSqliteStoreNamed:(id)storeFileName withOptions:(__autoreleasing NSDictionary *)options +{ + return [self MR_addSqliteStoreNamed:storeFileName configuration:nil withOptions:options]; +} + +- (NSPersistentStore *) MR_addSqliteStoreNamed:(id)storeFileName configuration:(NSString *)configuration withOptions:(__autoreleasing NSDictionary *)options +{ + NSURL *url = [storeFileName isKindOfClass:[NSURL class]] ? storeFileName : [NSPersistentStore MR_urlForStoreName:storeFileName]; + NSError *error = nil; + + [self MR_createPathToStoreFileIfNeccessary:url]; + + NSPersistentStore *store = [self addPersistentStoreWithType:NSSQLiteStoreType + configuration:configuration + URL:url + options:options + error:&error]; + + if (!store) + { + if ([MagicalRecord shouldDeleteStoreOnModelMismatch]) + { + BOOL isMigrationError = (([error code] == NSPersistentStoreIncompatibleVersionHashError) || ([error code] == NSMigrationMissingSourceModelError) || ([error code] == NSMigrationError)); + if ([[error domain] isEqualToString:NSCocoaErrorDomain] && isMigrationError) + { + [[NSNotificationCenter defaultCenter] postNotificationName:kMagicalRecordPSCMismatchWillDeleteStore object:nil]; + + NSError * deleteStoreError; + // Could not open the database, so... kill it! (AND WAL bits) + NSString *rawURL = [url absoluteString]; + NSURL *shmSidecar = [NSURL URLWithString:[rawURL stringByAppendingString:@"-shm"]]; + NSURL *walSidecar = [NSURL URLWithString:[rawURL stringByAppendingString:@"-wal"]]; + [[NSFileManager defaultManager] removeItemAtURL:url error:&deleteStoreError]; + [[NSFileManager defaultManager] removeItemAtURL:shmSidecar error:nil]; + [[NSFileManager defaultManager] removeItemAtURL:walSidecar error:nil]; + + MRLogWarn(@"Removed incompatible model version: %@", [url lastPathComponent]); + if(deleteStoreError) { + [[NSNotificationCenter defaultCenter] postNotificationName:kMagicalRecordPSCMismatchCouldNotDeleteStore object:nil userInfo:@{@"Error":deleteStoreError}]; + } + else { + [[NSNotificationCenter defaultCenter] postNotificationName:kMagicalRecordPSCMismatchDidDeleteStore object:nil]; + } + + [[NSNotificationCenter defaultCenter] postNotificationName:kMagicalRecordPSCMismatchWillRecreateStore object:nil]; + // Try one more time to create the store + store = [self addPersistentStoreWithType:NSSQLiteStoreType + configuration:nil + URL:url + options:options + error:&error]; + if (store) + { + [[NSNotificationCenter defaultCenter] postNotificationName:kMagicalRecordPSCMismatchDidRecreateStore object:nil]; + // If we successfully added a store, remove the error that was initially created + error = nil; + } + else { + [[NSNotificationCenter defaultCenter] postNotificationName:kMagicalRecordPSCMismatchCouldNotRecreateStore object:nil userInfo:@{@"Error":error}]; + } + } + } + [MagicalRecord handleErrors:error]; + } + return store; +} + +- (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey storeIdentifier:(id)storeIdentifier cloudStorePathComponent:(NSString *)subPathComponent completion:(void(^)(void))completionBlock +{ + NSAssert([contentNameKey containsString:@"."] == NO, @"NSPersistentStoreUbiquitousContentNameKey cannot contain a period."); + + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + + NSURL *cloudURL = [NSPersistentStore MR_cloudURLForUbiqutiousContainer:containerID]; + if (subPathComponent) + { + cloudURL = [cloudURL URLByAppendingPathComponent:subPathComponent]; + } + + [MagicalRecord setICloudEnabled:cloudURL != nil]; + + NSDictionary *options = [[self class] MR_autoMigrationOptions]; + if (cloudURL) //iCloud is available + { + NSMutableDictionary *iCloudOptions = [[NSMutableDictionary alloc] init]; + [iCloudOptions setObject:cloudURL forKey:NSPersistentStoreUbiquitousContentURLKey]; + + if ([contentNameKey length] > 0) + { + [iCloudOptions setObject:contentNameKey forKey:NSPersistentStoreUbiquitousContentNameKey]; + } + + options = [options MR_dictionaryByMergingDictionary:iCloudOptions]; + } + else + { + MRLogWarn(@"iCloud is not enabled"); + } + + + if ([self respondsToSelector:@selector(performBlockAndWait:)]) + { + [self performSelector:@selector(performBlockAndWait:) withObject:^{ + [self MR_addSqliteStoreNamed:storeIdentifier withOptions:options]; + }]; + } + else + { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [self lock]; +#pragma clang diagnostic pop + [self MR_addSqliteStoreNamed:storeIdentifier withOptions:options]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [self unlock]; +#pragma clang diagnostic pop + } + + dispatch_async(dispatch_get_main_queue(), ^{ + if ([NSPersistentStore MR_defaultPersistentStore] == nil) + { + [NSPersistentStore MR_setDefaultPersistentStore:[[self persistentStores] firstObject]]; + } + if (completionBlock) + { + completionBlock(); + } + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + [notificationCenter postNotificationName:kMagicalRecordPSCDidCompleteiCloudSetupNotification object:nil]; + }); + }); +} + + + +#pragma mark - Public Instance Methods + +- (NSPersistentStore *) MR_addInMemoryStore +{ + NSError *error = nil; + NSPersistentStore *store = [self addPersistentStoreWithType:NSInMemoryStoreType + configuration:nil + URL:nil + options:nil + error:&error]; + if (!store) + { + [MagicalRecord handleErrors:error]; + } + return store; +} + ++ (NSDictionary *) MR_autoMigrationOptions; +{ + // Adding the journalling mode recommended by apple + NSMutableDictionary *sqliteOptions = [NSMutableDictionary dictionary]; + [sqliteOptions setObject:@"WAL" forKey:@"journal_mode"]; + + NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, + [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, + sqliteOptions, NSSQLitePragmasOption, + nil]; + return options; +} + +- (NSPersistentStore *) MR_addAutoMigratingSqliteStoreNamed:(NSString *) storeFileName; +{ + NSDictionary *options = [[self class] MR_autoMigrationOptions]; + return [self MR_addSqliteStoreNamed:storeFileName withOptions:options]; +} + +- (NSPersistentStore *) MR_addAutoMigratingSqliteStoreAtURL:(NSURL *)storeURL +{ + NSDictionary *options = [[self class] MR_autoMigrationOptions]; + return [self MR_addSqliteStoreNamed:storeURL withOptions:options]; +} + + +#pragma mark - Public Class Methods + + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithAutoMigratingSqliteStoreNamed:(NSString *) storeFileName +{ + NSManagedObjectModel *model = [NSManagedObjectModel MR_defaultManagedObjectModel]; + NSPersistentStoreCoordinator *coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model]; + + [coordinator MR_addAutoMigratingSqliteStoreNamed:storeFileName]; + + //HACK: lame solution to fix automigration error "Migration failed after first pass" + if ([[coordinator persistentStores] count] == 0) + { + [coordinator performSelector:@selector(MR_addAutoMigratingSqliteStoreNamed:) withObject:storeFileName afterDelay:0.5]; + } + + return coordinator; +} + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithAutoMigratingSqliteStoreAtURL:(NSURL *)storeURL +{ + NSManagedObjectModel *model = [NSManagedObjectModel MR_defaultManagedObjectModel]; + NSPersistentStoreCoordinator *coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model]; + + [coordinator MR_addAutoMigratingSqliteStoreAtURL:storeURL]; + + //HACK: lame solution to fix automigration error "Migration failed after first pass" + if ([[coordinator persistentStores] count] == 0) + { + [coordinator performSelector:@selector(MR_addAutoMigratingSqliteStoreAtURL:) withObject:storeURL afterDelay:0.5]; + } + + return coordinator; +} + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithInMemoryStore +{ + NSManagedObjectModel *model = [NSManagedObjectModel MR_defaultManagedObjectModel]; + NSPersistentStoreCoordinator *coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model]; + + [coordinator MR_addInMemoryStore]; + + return coordinator; +} + ++ (NSPersistentStoreCoordinator *) MR_newPersistentStoreCoordinator +{ + NSPersistentStoreCoordinator *coordinator = [self MR_coordinatorWithSqliteStoreNamed:[MagicalRecord defaultStoreName]]; + + return coordinator; +} + +- (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent; +{ + [self MR_addiCloudContainerID:containerID + contentNameKey:contentNameKey + localStoreNamed:localStoreName + cloudStorePathComponent:subPathComponent + completion:nil]; +} + +- (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreAtURL:(NSURL *)storeURL cloudStorePathComponent:(NSString *)subPathComponent +{ + [self MR_addiCloudContainerID:containerID + contentNameKey:contentNameKey + localStoreAtURL:storeURL + cloudStorePathComponent:subPathComponent + completion:nil]; +} + +- (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent completion:(void(^)(void))completionBlock; +{ + [self MR_addiCloudContainerID:containerID + contentNameKey:contentNameKey + storeIdentifier:localStoreName + cloudStorePathComponent:subPathComponent + completion:completionBlock]; +} + +- (void) MR_addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreAtURL:(NSURL *)storeURL cloudStorePathComponent:(NSString *)subPathComponent completion:(void(^)(void))completionBlock; +{ + [self MR_addiCloudContainerID:containerID + contentNameKey:contentNameKey + storeIdentifier:storeURL + cloudStorePathComponent:subPathComponent + completion:completionBlock]; +} + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(NSString *)containerID + contentNameKey:(NSString *)contentNameKey + localStoreNamed:(NSString *)localStoreName + cloudStorePathComponent:(NSString *)subPathComponent; +{ + return [self MR_coordinatorWithiCloudContainerID:containerID + contentNameKey:contentNameKey + localStoreNamed:localStoreName + cloudStorePathComponent:subPathComponent + completion:nil]; +} + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(NSString *)containerID + contentNameKey:(NSString *)contentNameKey + localStoreAtURL:(NSURL *)storeURL + cloudStorePathComponent:(NSString *)subPathComponent +{ + return [self MR_coordinatorWithiCloudContainerID:containerID + contentNameKey:contentNameKey + localStoreAtURL:storeURL + cloudStorePathComponent:subPathComponent + completion:nil]; +} + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(NSString *)containerID + contentNameKey:(NSString *)contentNameKey + localStoreNamed:(NSString *)localStoreName + cloudStorePathComponent:(NSString *)subPathComponent + completion:(void(^)(void))completionHandler; +{ + NSManagedObjectModel *model = [NSManagedObjectModel MR_defaultManagedObjectModel]; + NSPersistentStoreCoordinator *psc = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model]; + + [psc MR_addiCloudContainerID:containerID + contentNameKey:contentNameKey + localStoreNamed:localStoreName + cloudStorePathComponent:subPathComponent + completion:completionHandler]; + + return psc; +} + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(NSString *)containerID + contentNameKey:(NSString *)contentNameKey + localStoreAtURL:(NSURL *)storeURL + cloudStorePathComponent:(NSString *)subPathComponent + completion:(void (^)(void))completionHandler +{ + NSManagedObjectModel *model = [NSManagedObjectModel MR_defaultManagedObjectModel]; + NSPersistentStoreCoordinator *psc = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model]; + + [psc MR_addiCloudContainerID:containerID + contentNameKey:contentNameKey + localStoreAtURL:storeURL + cloudStorePathComponent:subPathComponent + completion:completionHandler]; + + return psc; +} + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithPersistentStore:(NSPersistentStore *)persistentStore; +{ + NSManagedObjectModel *model = [NSManagedObjectModel MR_defaultManagedObjectModel]; + NSPersistentStoreCoordinator *psc = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model]; + + [psc MR_addSqliteStoreNamed:[persistentStore URL] withOptions:nil]; + + return psc; +} + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithSqliteStoreNamed:(NSString *)storeFileName withOptions:(NSDictionary *)options +{ + NSManagedObjectModel *model = [NSManagedObjectModel MR_defaultManagedObjectModel]; + NSPersistentStoreCoordinator *psc = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model]; + + [psc MR_addSqliteStoreNamed:storeFileName withOptions:options]; + return psc; +} + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithSqliteStoreAtURL:(NSURL *)storeURL withOptions:(NSDictionary *)options +{ + NSManagedObjectModel *model = [NSManagedObjectModel MR_defaultManagedObjectModel]; + NSPersistentStoreCoordinator *psc = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model]; + + [psc MR_addSqliteStoreNamed:storeURL withOptions:options]; + return psc; +} + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithSqliteStoreNamed:(NSString *)storeFileName +{ + return [self MR_coordinatorWithSqliteStoreNamed:storeFileName withOptions:nil]; +} + ++ (NSPersistentStoreCoordinator *) MR_coordinatorWithSqliteStoreAtURL:(NSURL *)storeURL +{ + return [self MR_coordinatorWithSqliteStoreAtURL:storeURL withOptions:nil]; +} + +@end + + +@implementation NSDictionary (Merging) + +- (NSMutableDictionary *) MR_dictionaryByMergingDictionary:(NSDictionary *)d; +{ + NSMutableDictionary *mutDict = [self mutableCopy]; + [mutDict addEntriesFromDictionary:d]; + return mutDict; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Actions.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Actions.h new file mode 100644 index 0000000..fa999d7 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Actions.h @@ -0,0 +1,34 @@ +// +// MagicalRecord+Actions.h +// +// Created by Saul Mora on 2/24/11. +// Copyright 2011 Magical Panda Software. All rights reserved. +// + +#import +#import +#import +#import + +@interface MagicalRecord (Actions) + +/* For all background saving operations. These calls will be sent to a different thread/queue. + */ ++ (void) saveWithBlock:(void(^)(NSManagedObjectContext *localContext))block; ++ (void) saveWithBlock:(void(^)(NSManagedObjectContext *localContext))block completion:(MRSaveCompletionHandler)completion; + +/* For saving on the current thread as the caller, only with a seperate context. Useful when you're managing your own threads/queues and need a serial call to create or change data + */ ++ (void) saveWithBlockAndWait:(void(^)(NSManagedObjectContext *localContext))block; + +@end + +@interface MagicalRecord (ActionsDeprecated) + ++ (void) saveUsingCurrentThreadContextWithBlock:(void (^)(NSManagedObjectContext *localContext))block completion:(MRSaveCompletionHandler)completion MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0"); ++ (void) saveUsingCurrentThreadContextWithBlockAndWait:(void (^)(NSManagedObjectContext *localContext))block MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0"); ++ (void) saveInBackgroundWithBlock:(void(^)(NSManagedObjectContext *localContext))block MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0"); ++ (void) saveInBackgroundWithBlock:(void(^)(NSManagedObjectContext *localContext))block completion:(void(^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0"); ++ (void) saveInBackgroundUsingCurrentContextWithBlock:(void (^)(NSManagedObjectContext *localContext))block completion:(void (^)(void))completion errorHandler:(void (^)(NSError *error))errorHandler MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0"); + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Actions.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Actions.m new file mode 100644 index 0000000..812521c --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Actions.m @@ -0,0 +1,143 @@ +// +// MagicalRecord+Actions.m +// +// Created by Saul Mora on 2/24/11. +// Copyright 2011 Magical Panda Software. All rights reserved. +// + +#import "MagicalRecord+Actions.h" +#import "NSManagedObjectContext+MagicalRecord.h" +#import "NSManagedObjectContext+MagicalThreading.h" + +@implementation MagicalRecord (Actions) + +#pragma mark - Asynchronous saving + ++ (void) saveWithBlock:(void(^)(NSManagedObjectContext *localContext))block; +{ + [self saveWithBlock:block completion:nil]; +} + ++ (void) saveWithBlock:(void(^)(NSManagedObjectContext *localContext))block completion:(MRSaveCompletionHandler)completion; +{ + NSManagedObjectContext *savingContext = [NSManagedObjectContext MR_rootSavingContext]; + NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextWithParent:savingContext]; + + [localContext performBlock:^{ + [localContext MR_setWorkingName:NSStringFromSelector(_cmd)]; + + if (block) { + block(localContext); + } + + [localContext MR_saveWithOptions:MRSaveParentContexts completion:completion]; + }]; +} + +#pragma mark - Synchronous saving + ++ (void) saveWithBlockAndWait:(void(^)(NSManagedObjectContext *localContext))block; +{ + NSManagedObjectContext *savingContext = [NSManagedObjectContext MR_rootSavingContext]; + NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextWithParent:savingContext]; + + [localContext performBlockAndWait:^{ + [localContext MR_setWorkingName:NSStringFromSelector(_cmd)]; + + if (block) { + block(localContext); + } + + [localContext MR_saveWithOptions:MRSaveParentContexts|MRSaveSynchronously completion:nil]; + }]; +} + +@end + +#pragma mark - Deprecated Methods — DO NOT USE +@implementation MagicalRecord (ActionsDeprecated) + ++ (void) saveUsingCurrentThreadContextWithBlock:(void (^)(NSManagedObjectContext *localContext))block completion:(MRSaveCompletionHandler)completion; +{ + NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextForCurrentThread]; + + [localContext performBlock:^{ + [localContext MR_setWorkingName:NSStringFromSelector(_cmd)]; + + if (block) { + block(localContext); + } + + [localContext MR_saveWithOptions:MRSaveParentContexts completion:completion]; + }]; +} + ++ (void) saveUsingCurrentThreadContextWithBlockAndWait:(void (^)(NSManagedObjectContext *localContext))block; +{ + NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextForCurrentThread]; + + [localContext performBlockAndWait:^{ + [localContext MR_setWorkingName:NSStringFromSelector(_cmd)]; + + if (block) { + block(localContext); + } + + [localContext MR_saveWithOptions:MRSaveParentContexts|MRSaveSynchronously completion:nil]; + }]; +} + ++ (void) saveInBackgroundWithBlock:(void(^)(NSManagedObjectContext *localContext))block +{ + [[self class] saveWithBlock:block completion:nil]; +} + ++ (void) saveInBackgroundWithBlock:(void(^)(NSManagedObjectContext *localContext))block completion:(void(^)(void))completion +{ + NSManagedObjectContext *savingContext = [NSManagedObjectContext MR_rootSavingContext]; + NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextWithParent:savingContext]; + + [localContext performBlock:^{ + [localContext MR_setWorkingName:NSStringFromSelector(_cmd)]; + + if (block) + { + block(localContext); + } + + [localContext MR_saveToPersistentStoreAndWait]; + + if (completion) + { + completion(); + } + }]; +} + ++ (void) saveInBackgroundUsingCurrentContextWithBlock:(void (^)(NSManagedObjectContext *localContext))block completion:(void (^)(void))completion errorHandler:(void (^)(NSError *error))errorHandler; +{ + NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextForCurrentThread]; + + [localContext performBlock:^{ + [localContext MR_setWorkingName:NSStringFromSelector(_cmd)]; + + if (block) { + block(localContext); + } + + [localContext MR_saveToPersistentStoreWithCompletion:^(BOOL contextDidSave, NSError *error) { + if (contextDidSave) { + if (completion) { + completion(); + } + } + else { + if (errorHandler) { + errorHandler(error); + } + } + }]; + }]; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ErrorHandling.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ErrorHandling.h new file mode 100644 index 0000000..e7fd15d --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ErrorHandling.h @@ -0,0 +1,20 @@ +// +// MagicalRecord+ErrorHandling.h +// Magical Record +// +// Created by Saul Mora on 3/6/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import + +@interface MagicalRecord (ErrorHandling) + ++ (void) handleErrors:(NSError *)error; +- (void) handleErrors:(NSError *)error; + ++ (void) setErrorHandlerTarget:(id)target action:(SEL)action; ++ (SEL) errorHandlerAction; ++ (id) errorHandlerTarget; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ErrorHandling.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ErrorHandling.m new file mode 100644 index 0000000..3f1f126 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ErrorHandling.m @@ -0,0 +1,95 @@ +// +// MagicalRecord+ErrorHandling.m +// Magical Record +// +// Created by Saul Mora on 3/6/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import "MagicalRecord+ErrorHandling.h" +#import "MagicalRecordLogging.h" + + +__weak static id errorHandlerTarget = nil; +static SEL errorHandlerAction = nil; + + +@implementation MagicalRecord (ErrorHandling) + ++ (void) cleanUpErrorHanding; +{ + errorHandlerTarget = nil; + errorHandlerAction = nil; +} + ++ (void) defaultErrorHandler:(NSError *)error +{ + NSDictionary *userInfo = [error userInfo]; + for (NSArray *detailedError in [userInfo allValues]) + { + if ([detailedError isKindOfClass:[NSArray class]]) + { + for (NSError *e in detailedError) + { + if ([e respondsToSelector:@selector(userInfo)]) + { + MRLogError(@"Error Details: %@", [e userInfo]); + } + else + { + MRLogError(@"Error Details: %@", e); + } + } + } + else + { + MRLogError(@"Error: %@", detailedError); + } + } + MRLogError(@"Error Message: %@", [error localizedDescription]); + MRLogError(@"Error Domain: %@", [error domain]); + MRLogError(@"Recovery Suggestion: %@", [error localizedRecoverySuggestion]); +} + ++ (void) handleErrors:(NSError *)error +{ + if (error) + { + // If a custom error handler is set, call that + if (errorHandlerTarget != nil && errorHandlerAction != nil) + { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + [errorHandlerTarget performSelector:errorHandlerAction withObject:error]; +#pragma clang diagnostic pop + } + else + { + // Otherwise, fall back to the default error handling + [self defaultErrorHandler:error]; + } + } +} + ++ (id) errorHandlerTarget +{ + return errorHandlerTarget; +} + ++ (SEL) errorHandlerAction +{ + return errorHandlerAction; +} + ++ (void) setErrorHandlerTarget:(id)target action:(SEL)action +{ + errorHandlerTarget = target; /* Deliberately don't retain to avoid potential retain cycles */ + errorHandlerAction = action; +} + +- (void) handleErrors:(NSError *)error +{ + [[self class] handleErrors:error]; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Options.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Options.h new file mode 100644 index 0000000..75f47e3 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Options.h @@ -0,0 +1,148 @@ +// +// MagicalRecord+Options.h +// Magical Record +// +// Created by Saul Mora on 3/6/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import + +/** + Defines "levels" of logging that will be used as values in a bitmask that filters log messages. + + @since Available in v2.3 and later. + */ +typedef NS_ENUM (NSUInteger, MagicalRecordLoggingMask) +{ + /** Log all errors */ + MagicalRecordLoggingMaskError = 1 << 0, + + /** Log warnings, and all errors */ + MagicalRecordLoggingMaskWarn = 1 << 1, + + /** Log informative messagess, warnings and all errors */ + MagicalRecordLoggingMaskInfo = 1 << 2, + + /** Log debugging messages, informative messages, warnings and all errors */ + MagicalRecordLoggingMaskDebug = 1 << 3, + + /** Log verbose diagnostic information, debugging messages, informative messages, messages, warnings and all errors */ + MagicalRecordLoggingMaskVerbose = 1 << 4, +}; + +/** + Defines a mask for logging that will be used by to filter log messages. + + @since Available in v2.3 and later. + */ +typedef NS_ENUM (NSUInteger, MagicalRecordLoggingLevel) +{ + /** Don't log anything */ + MagicalRecordLoggingLevelOff = 0, + + /** Log all errors and fatal messages */ + MagicalRecordLoggingLevelError = (MagicalRecordLoggingMaskError), + + /** Log warnings, errors and fatal messages */ + MagicalRecordLoggingLevelWarn = (MagicalRecordLoggingLevelError | MagicalRecordLoggingMaskWarn), + + /** Log informative, warning and error messages */ + MagicalRecordLoggingLevelInfo = (MagicalRecordLoggingLevelWarn | MagicalRecordLoggingMaskInfo), + + /** Log all debugging, informative, warning and error messages */ + MagicalRecordLoggingLevelDebug = (MagicalRecordLoggingLevelInfo | MagicalRecordLoggingMaskDebug), + + /** Log verbose diagnostic, debugging, informative, warning and error messages */ + MagicalRecordLoggingLevelVerbose = (MagicalRecordLoggingLevelDebug | MagicalRecordLoggingMaskVerbose), + + /** Log everything */ + MagicalRecordLoggingLevelAll = NSUIntegerMax +}; + + +@interface MagicalRecord (Options) + +/** + @name Configuration Options + */ + +/** + If this is true, the default managed object model will be automatically created if it doesn't exist when calling `[NSManagedObjectModel MR_defaultManagedObjectModel]`. + + @return current value of shouldAutoCreateManagedObjectModel. + + @since Available in v2.0.4 and later. + */ ++ (BOOL) shouldAutoCreateManagedObjectModel; + +/** + Setting this to true will make MagicalRecord create the default managed object model automatically if it doesn't exist when calling `[NSManagedObjectModel MR_defaultManagedObjectModel]`. + + @param autoCreate BOOL value that flags whether the default persistent store should be automatically created. + + @since Available in v2.0.4 and later. + */ ++ (void) setShouldAutoCreateManagedObjectModel:(BOOL)autoCreate; + +/** + If this is true, the default persistent store will be automatically created if it doesn't exist when calling `[NSPersistentStoreCoordinator MR_defaultStoreCoordinator]`. + + @return current value of shouldAutoCreateDefaultPersistentStoreCoordinator. + + @since Available in v2.0.4 and later. + */ ++ (BOOL) shouldAutoCreateDefaultPersistentStoreCoordinator; + +/** + Setting this to true will make MagicalRecord create the default persistent store automatically if it doesn't exist when calling `[NSPersistentStoreCoordinator MR_defaultStoreCoordinator]`. + + @param autoCreate BOOL value that flags whether the default persistent store should be automatically created. + + @since Available in v2.0.4 and later. + */ ++ (void) setShouldAutoCreateDefaultPersistentStoreCoordinator:(BOOL)autoCreate; + +/** + If this is true and MagicalRecord encounters a store with a version that does not match that of the model, the store will be removed from the disk. + This is extremely useful during development where frequent model changes can potentially require a delete and reinstall of the app. + + @return current value of shouldDeleteStoreOnModelMismatch + + @since Available in v2.0.4 and later. + */ ++ (BOOL) shouldDeleteStoreOnModelMismatch; + +/** + Setting this to true will make MagicalRecord delete any stores that it encounters which do not match the version of their model. + This is extremely useful during development where frequent model changes can potentially require a delete and reinstall of the app. + + @param shouldDelete BOOL value that flags whether mismatched stores should be deleted + + @since Available in v2.0.4 and later. + */ ++ (void) setShouldDeleteStoreOnModelMismatch:(BOOL)shouldDelete; + +/** + @name Logging Levels + */ + +/** + Returns the logging mask set for MagicalRecord in the current application. + + @return Current MagicalRecordLoggingLevel + + @since Available in v2.3 and later. + */ ++ (MagicalRecordLoggingLevel) loggingLevel; + +/** + Sets the logging mask set for MagicalRecord in the current application. + + @param level Any value from MagicalRecordLogLevel + + @since Available in v2.3 and later. + */ ++ (void) setLoggingLevel:(MagicalRecordLoggingLevel)level; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Options.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Options.m new file mode 100644 index 0000000..b9ba785 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Options.m @@ -0,0 +1,64 @@ +// +// MagicalRecord+Options.m +// Magical Record +// +// Created by Saul Mora on 3/6/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import "MagicalRecord+Options.h" + +#ifdef DEBUG +static MagicalRecordLoggingLevel kMagicalRecordLoggingLevel = MagicalRecordLoggingLevelDebug; +#else +static MagicalRecordLoggingLevel kMagicalRecordLoggingLevel = MagicalRecordLoggingLevelError; +#endif +static BOOL kMagicalRecordShouldAutoCreateManagedObjectModel = NO; +static BOOL kMagicalRecordShouldAutoCreateDefaultPersistentStoreCoordinator = NO; +static BOOL kMagicalRecordShouldDeleteStoreOnModelMismatch = NO; + +@implementation MagicalRecord (Options) + +#pragma mark - Configuration Options + ++ (BOOL) shouldAutoCreateManagedObjectModel; +{ + return kMagicalRecordShouldAutoCreateManagedObjectModel; +} + ++ (void) setShouldAutoCreateManagedObjectModel:(BOOL)autoCreate; +{ + kMagicalRecordShouldAutoCreateManagedObjectModel = autoCreate; +} + ++ (BOOL) shouldAutoCreateDefaultPersistentStoreCoordinator; +{ + return kMagicalRecordShouldAutoCreateDefaultPersistentStoreCoordinator; +} + ++ (void) setShouldAutoCreateDefaultPersistentStoreCoordinator:(BOOL)autoCreate; +{ + kMagicalRecordShouldAutoCreateDefaultPersistentStoreCoordinator = autoCreate; +} + ++ (BOOL) shouldDeleteStoreOnModelMismatch; +{ + return kMagicalRecordShouldDeleteStoreOnModelMismatch; +} + ++ (void) setShouldDeleteStoreOnModelMismatch:(BOOL)shouldDelete; +{ + kMagicalRecordShouldDeleteStoreOnModelMismatch = shouldDelete; +} + ++ (MagicalRecordLoggingLevel) loggingLevel; +{ + return kMagicalRecordLoggingLevel; +} + ++ (void) setLoggingLevel:(MagicalRecordLoggingLevel)level; +{ + kMagicalRecordLoggingLevel = level; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Setup.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Setup.h new file mode 100644 index 0000000..666db69 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Setup.h @@ -0,0 +1,24 @@ +// +// MagicalRecord+Setup.h +// Magical Record +// +// Created by Saul Mora on 3/7/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import + +@interface MagicalRecord (Setup) + ++ (void) setupCoreDataStack; ++ (void) setupCoreDataStackWithInMemoryStore; ++ (void) setupAutoMigratingCoreDataStack; + ++ (void) setupCoreDataStackWithStoreNamed:(NSString *)storeName; ++ (void) setupCoreDataStackWithAutoMigratingSqliteStoreNamed:(NSString *)storeName; + ++ (void) setupCoreDataStackWithStoreAtURL:(NSURL *)storeURL; ++ (void) setupCoreDataStackWithAutoMigratingSqliteStoreAtURL:(NSURL *)storeURL; + + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Setup.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Setup.m new file mode 100644 index 0000000..d0829fd --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+Setup.m @@ -0,0 +1,76 @@ +// +// MagicalRecord+Setup.m +// Magical Record +// +// Created by Saul Mora on 3/7/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import "MagicalRecord+Setup.h" +#import "NSManagedObject+MagicalRecord.h" +#import "NSPersistentStoreCoordinator+MagicalRecord.h" +#import "NSManagedObjectContext+MagicalRecord.h" + +@implementation MagicalRecord (Setup) + ++ (void) setupCoreDataStack +{ + [self setupCoreDataStackWithStoreNamed:[self defaultStoreName]]; +} + ++ (void) setupAutoMigratingCoreDataStack +{ + [self setupCoreDataStackWithAutoMigratingSqliteStoreNamed:[self defaultStoreName]]; +} + ++ (void) setupCoreDataStackWithStoreNamed:(NSString *)storeName +{ + if ([NSPersistentStoreCoordinator MR_defaultStoreCoordinator] != nil) return; + + NSPersistentStoreCoordinator *coordinator = [NSPersistentStoreCoordinator MR_coordinatorWithSqliteStoreNamed:storeName]; + [NSPersistentStoreCoordinator MR_setDefaultStoreCoordinator:coordinator]; + + [NSManagedObjectContext MR_initializeDefaultContextWithCoordinator:coordinator]; +} + ++ (void) setupCoreDataStackWithAutoMigratingSqliteStoreNamed:(NSString *)storeName +{ + if ([NSPersistentStoreCoordinator MR_defaultStoreCoordinator] != nil) return; + + NSPersistentStoreCoordinator *coordinator = [NSPersistentStoreCoordinator MR_coordinatorWithAutoMigratingSqliteStoreNamed:storeName]; + [NSPersistentStoreCoordinator MR_setDefaultStoreCoordinator:coordinator]; + + [NSManagedObjectContext MR_initializeDefaultContextWithCoordinator:coordinator]; +} + ++ (void) setupCoreDataStackWithStoreAtURL:(NSURL *)storeURL +{ + if ([NSPersistentStoreCoordinator MR_defaultStoreCoordinator] != nil) return; + + NSPersistentStoreCoordinator *coordinator = [NSPersistentStoreCoordinator MR_coordinatorWithSqliteStoreAtURL:storeURL]; + [NSPersistentStoreCoordinator MR_setDefaultStoreCoordinator:coordinator]; + + [NSManagedObjectContext MR_initializeDefaultContextWithCoordinator:coordinator]; +} + ++ (void) setupCoreDataStackWithAutoMigratingSqliteStoreAtURL:(NSURL *)storeURL +{ + if ([NSPersistentStoreCoordinator MR_defaultStoreCoordinator] != nil) return; + + NSPersistentStoreCoordinator *coordinator = [NSPersistentStoreCoordinator MR_coordinatorWithAutoMigratingSqliteStoreAtURL:storeURL]; + [NSPersistentStoreCoordinator MR_setDefaultStoreCoordinator:coordinator]; + + [NSManagedObjectContext MR_initializeDefaultContextWithCoordinator:coordinator]; +} + ++ (void) setupCoreDataStackWithInMemoryStore; +{ + if ([NSPersistentStoreCoordinator MR_defaultStoreCoordinator] != nil) return; + + NSPersistentStoreCoordinator *coordinator = [NSPersistentStoreCoordinator MR_coordinatorWithInMemoryStore]; + [NSPersistentStoreCoordinator MR_setDefaultStoreCoordinator:coordinator]; + + [NSManagedObjectContext MR_initializeDefaultContextWithCoordinator:coordinator]; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ShorthandMethods.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ShorthandMethods.h new file mode 100644 index 0000000..bf38be2 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ShorthandMethods.h @@ -0,0 +1,10 @@ +// +// Copyright (c) 2015 Magical Panda Software LLC. All rights reserved. + +#import + +@interface MagicalRecord (ShorthandMethods) + ++ (void)enableShorthandMethods; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ShorthandMethods.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ShorthandMethods.m new file mode 100644 index 0000000..80e7410 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+ShorthandMethods.m @@ -0,0 +1,135 @@ +// +// Copyright (c) 2015 Magical Panda Software LLC. All rights reserved. + +#import "MagicalRecord+ShorthandMethods.h" +#import + +static NSString *const kMagicalRecordCategoryPrefix = @"MR_"; +static BOOL kMagicalRecordShorthandMethodsSwizzled = NO; + +@implementation MagicalRecord (ShorthandMethods) + ++ (void)enableShorthandMethods +{ + if (kMagicalRecordShorthandMethodsSwizzled == NO) + { + NSArray *classes = [self classesToSwizzle]; + + [classes enumerateObjectsUsingBlock:^(id object, NSUInteger idx, BOOL *stop) { + Class objectClass = (Class)object; + + [self updateResolveMethodsForClass:objectClass]; + }]; + + kMagicalRecordShorthandMethodsSwizzled = YES; + } +} + ++ (NSArray *)classesToSwizzle +{ + return @[ [NSManagedObject class], + [NSManagedObjectContext class], + [NSManagedObjectModel class], + [NSPersistentStore class], + [NSPersistentStoreCoordinator class] ]; +} + ++ (NSArray *)methodNameBlacklist +{ + return @[ NSStringFromSelector(@selector(entityName)) ]; +} + ++ (BOOL)MR_resolveClassMethod:(SEL)originalSelector +{ + BOOL resolvedClassMethod = [self MR_resolveClassMethod:originalSelector]; + if (!resolvedClassMethod) + { + resolvedClassMethod = MRAddShortHandMethodForPrefixedClassMethod(self, originalSelector, kMagicalRecordCategoryPrefix); + } + return resolvedClassMethod; +} + ++ (BOOL)MR_resolveInstanceMethod:(SEL)originalSelector +{ + BOOL resolvedClassMethod = [self MR_resolveInstanceMethod:originalSelector]; + if (!resolvedClassMethod) + { + resolvedClassMethod = MRAddShorthandMethodForPrefixedInstanceMethod(self, originalSelector, kMagicalRecordCategoryPrefix); + } + return resolvedClassMethod; +} + +// In order to add support for non-prefixed AND prefixed methods, we need to swap the existing resolveClassMethod: and resolveInstanceMethod: implementations with the one in this class. ++ (void)updateResolveMethodsForClass:(Class)objectClass +{ + MRReplaceSelectorForTargetWithSourceImplementation(self, @selector(MR_resolveClassMethod:), objectClass, @selector(resolveClassMethod:)); + MRReplaceSelectorForTargetWithSourceImplementation(self, @selector(MR_resolveInstanceMethod:), objectClass, @selector(resolveInstanceMethod:)); +} + +static void MRReplaceSelectorForTargetWithSourceImplementation(Class sourceClass, SEL sourceSelector, Class targetClass, SEL targetSelector) +{ + Method sourceClassMethod = class_getClassMethod(sourceClass, sourceSelector); + Method targetClassMethod = class_getClassMethod(targetClass, targetSelector); + + Class targetMetaClass = objc_getMetaClass([NSStringFromClass(targetClass) cStringUsingEncoding:NSUTF8StringEncoding]); + + BOOL methodWasAdded = class_addMethod(targetMetaClass, sourceSelector, + method_getImplementation(targetClassMethod), + method_getTypeEncoding(targetClassMethod)); + + if (methodWasAdded) + { + class_replaceMethod(targetMetaClass, targetSelector, + method_getImplementation(sourceClassMethod), + method_getTypeEncoding(sourceClassMethod)); + } +} + +static BOOL MRAddShorthandMethodForPrefixedInstanceMethod(Class objectClass, SEL originalSelector, NSString *prefix) +{ + NSString *originalSelectorString = NSStringFromSelector(originalSelector); + + if ([originalSelectorString hasPrefix:prefix] == NO && + ([originalSelectorString hasPrefix:@"_"] || [originalSelectorString hasPrefix:@"init"])) + { + NSString *prefixedSelector = [prefix stringByAppendingString:originalSelectorString]; + Method existingMethod = class_getInstanceMethod(objectClass, NSSelectorFromString(prefixedSelector)); + + if (existingMethod) + { + BOOL methodWasAdded = class_addMethod(objectClass, + originalSelector, + method_getImplementation(existingMethod), + method_getTypeEncoding(existingMethod)); + + return methodWasAdded; + } + } + return NO; +} + +static BOOL MRAddShortHandMethodForPrefixedClassMethod(Class objectClass, SEL originalSelector, NSString *prefix) +{ + NSString *originalSelectorString = NSStringFromSelector(originalSelector); + + if ([originalSelectorString hasPrefix:prefix] == NO && + [originalSelectorString hasSuffix:@"entityName"] == NO) + { + NSString *prefixedSelector = [prefix stringByAppendingString:originalSelectorString]; + Method existingMethod = class_getClassMethod(objectClass, NSSelectorFromString(prefixedSelector)); + + if (existingMethod) + { + Class metaClass = objc_getMetaClass([NSStringFromClass(objectClass) cStringUsingEncoding:NSUTF8StringEncoding]); + BOOL methodWasAdded = class_addMethod(metaClass, + originalSelector, + method_getImplementation(existingMethod), + method_getTypeEncoding(existingMethod)); + + return methodWasAdded; + } + } + return NO; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+iCloud.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+iCloud.h new file mode 100644 index 0000000..d6e82d2 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+iCloud.h @@ -0,0 +1,43 @@ +// +// MagicalRecord+iCloud.h +// Magical Record +// +// Created by Saul Mora on 3/7/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import + +@interface MagicalRecord (iCloud) + ++ (BOOL)isICloudEnabled; + ++ (void)setupCoreDataStackWithiCloudContainer:(NSString *)containerID + localStoreNamed:(NSString *)localStore; + ++ (void)setupCoreDataStackWithiCloudContainer:(NSString *)containerID + contentNameKey:(NSString *)contentNameKey + localStoreNamed:(NSString *)localStoreName + cloudStorePathComponent:(NSString *)pathSubcomponent; + ++ (void)setupCoreDataStackWithiCloudContainer:(NSString *)containerID + contentNameKey:(NSString *)contentNameKey + localStoreNamed:(NSString *)localStoreName + cloudStorePathComponent:(NSString *)pathSubcomponent + completion:(void (^)(void))completion; + ++ (void)setupCoreDataStackWithiCloudContainer:(NSString *)containerID + localStoreAtURL:(NSURL *)storeURL; + ++ (void)setupCoreDataStackWithiCloudContainer:(NSString *)containerID + contentNameKey:(NSString *)contentNameKey + localStoreAtURL:(NSURL *)storeURL + cloudStorePathComponent:(NSString *)pathSubcomponent; + ++ (void)setupCoreDataStackWithiCloudContainer:(NSString *)containerID + contentNameKey:(NSString *)contentNameKey + localStoreAtURL:(NSURL *)storeURL + cloudStorePathComponent:(NSString *)pathSubcomponent + completion:(void (^)(void))completion; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+iCloud.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+iCloud.m new file mode 100644 index 0000000..90c6b45 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecord+iCloud.m @@ -0,0 +1,86 @@ +// +// MagicalRecord+iCloud.m +// Magical Record +// +// Created by Saul Mora on 3/7/12. +// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved. +// + +#import "MagicalRecord+iCloud.h" +#import "NSPersistentStoreCoordinator+MagicalRecord.h" +#import "NSManagedObjectContext+MagicalRecord.h" + +static BOOL _iCloudEnabled = NO; + +@implementation MagicalRecord (iCloud) + +#pragma mark - iCloud Methods + ++ (BOOL) isICloudEnabled; +{ + return _iCloudEnabled; +} + ++ (void) setICloudEnabled:(BOOL)enabled; +{ + @synchronized(self) + { + _iCloudEnabled = enabled; + } +} + ++ (void) setupCoreDataStackWithiCloudContainer:(NSString *)containerID localStoreNamed:(NSString *)localStore; +{ + [self setupCoreDataStackWithiCloudContainer:containerID + contentNameKey:nil + localStoreNamed:localStore + cloudStorePathComponent:nil]; +} + ++ (void) setupCoreDataStackWithiCloudContainer:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)pathSubcomponent; +{ + [self setupCoreDataStackWithiCloudContainer:containerID + contentNameKey:contentNameKey + localStoreNamed:localStoreName + cloudStorePathComponent:pathSubcomponent + completion:nil]; +} + ++ (void) setupCoreDataStackWithiCloudContainer:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)pathSubcomponent completion:(void(^)(void))completion; +{ + NSPersistentStoreCoordinator *coordinator = [NSPersistentStoreCoordinator MR_coordinatorWithiCloudContainerID:containerID + contentNameKey:contentNameKey + localStoreNamed:localStoreName + cloudStorePathComponent:pathSubcomponent + completion:completion]; + [NSPersistentStoreCoordinator MR_setDefaultStoreCoordinator:coordinator]; + [NSManagedObjectContext MR_initializeDefaultContextWithCoordinator:coordinator]; +} + ++ (void) setupCoreDataStackWithiCloudContainer:(NSString *)containerID localStoreAtURL:(NSURL *)storeURL +{ + NSString *contentNameKey = [[[NSBundle mainBundle] infoDictionary] objectForKey:(id)kCFBundleIdentifierKey]; + [self setupCoreDataStackWithiCloudContainer:containerID + contentNameKey:contentNameKey + localStoreAtURL:storeURL + cloudStorePathComponent:nil]; +} + ++ (void) setupCoreDataStackWithiCloudContainer:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreAtURL:(NSURL *)storeURL cloudStorePathComponent:(NSString *)pathSubcomponent +{ + [self setupCoreDataStackWithiCloudContainer:containerID + contentNameKey:contentNameKey + localStoreAtURL:storeURL + cloudStorePathComponent:pathSubcomponent + completion:nil]; +} + ++ (void) setupCoreDataStackWithiCloudContainer:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreAtURL:(NSURL *)storeURL cloudStorePathComponent:(NSString *)pathSubcomponent completion:(void (^)(void))completion +{ + NSPersistentStoreCoordinator *coordinator = [NSPersistentStoreCoordinator MR_coordinatorWithiCloudContainerID:containerID contentNameKey:contentNameKey localStoreAtURL:storeURL cloudStorePathComponent:pathSubcomponent completion:completion]; + + [NSPersistentStoreCoordinator MR_setDefaultStoreCoordinator:coordinator]; + [NSManagedObjectContext MR_initializeDefaultContextWithCoordinator:coordinator]; +} + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordDeprecationMacros.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordDeprecationMacros.h new file mode 100644 index 0000000..22d80f1 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordDeprecationMacros.h @@ -0,0 +1,7 @@ +// +// Created by Tony Arnold on 10/04/2014. +// Copyright (c) 2014 Magical Panda Software LLC. All rights reserved. +// + +#define MR_DEPRECATED_WILL_BE_REMOVED_IN(VERSION) __attribute__((deprecated("This method has been deprecated and will be removed in MagicalRecord " VERSION "."))) +#define MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE(VERSION, METHOD) __attribute__((deprecated("This method has been deprecated and will be removed in MagicalRecord " VERSION ". Please use `" METHOD "` instead."))) diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordInternal.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordInternal.h new file mode 100644 index 0000000..526d98d --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordInternal.h @@ -0,0 +1,98 @@ +// +// MagicalRecord.h +// +// Created by Saul Mora on 3/11/10. +// Copyright 2010 Magical Panda Software, LLC All rights reserved. +// + +#import + +/** + Defines current and historical version numbers for MagicalRecord. + + @since Available in v2.3 and later. + */ +typedef NS_ENUM(NSUInteger, MagicalRecordVersionTag) +{ + /** Version 2.2.0 */ + MagicalRecordVersionTag2_2 = 220, + + /** Version 2.3.0 */ + MagicalRecordVersionTag2_3 = 230, + + /** Version 3.0.0 */ + MagicalRecordVersionTag3_0 = 300 +}; + +// enable to use caches for the fetchedResultsControllers (iOS only) +// #define STORE_USE_CACHE + +#ifdef NS_BLOCKS_AVAILABLE + +extern NSString * const kMagicalRecordCleanedUpNotification; + +@class NSManagedObjectContext; +typedef void (^CoreDataBlock)(NSManagedObjectContext *context); + +#endif + +/** + Provides class methods to help setup, save, handle errors and provide information about the currently loaded version of MagicalRecord. + + @since Available in v1.0 and later. + */ +@interface MagicalRecord : NSObject + +/** + Returns the current version of MagicalRecord. See the MagicalRecordVersionTag enumeration for valid current and historical values. + + @return The current version as a double. + + @since Available in v2.3 and later. + */ ++ (MagicalRecordVersionTag) version; + +/** + Provides information about the current stack, including the model, coordinator, persistent store, the default context and any parent contexts of the default context. + + @return Description of the current state of the stack. + + @since Available in v2.3 and later. + */ ++ (NSString *) currentStack; + +/** + Cleans up the entire MagicalRecord stack. Sets the default model, store and context to nil before posting a kMagicalRecordCleanedUpNotification notification. + + @since Available in v1.0 and later. + */ ++ (void) cleanUp; + +/** + Calls NSBundle's -bundleForClass: to determine the bundle to search for the default model within. + + @param modelClass Class to set the model from + + @since Available in v2.0 and later. + */ ++ (void) setDefaultModelFromClass:(Class)modelClass; + +/** + Looks for a momd file with the specified name, and if found sets it as the default model. + + @param modelName Model name as a string, including file extension + + @since Available in v1.0 and later. + */ ++ (void) setDefaultModelNamed:(NSString *)modelName; + +/** + Determines the store file name your app should use. This method is used by the MagicalRecord SQLite stacks when a store file is not specified. The file name returned is in the form ".sqlite". `` is taken from the application's info dictionary, which is retrieved from the method [[NSBundle mainBundle] infoDictionary]. If no bundle name is available, "CoreDataStore.sqlite" will be used. + + @return String of the form .sqlite + + @since Available in v2.0 and later. + */ ++ (NSString *) defaultStoreName; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordInternal.m b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordInternal.m new file mode 100644 index 0000000..230f04b --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordInternal.m @@ -0,0 +1,111 @@ +// +// MagicalRecord.m +// +// Created by Saul Mora on 3/11/10. +// Copyright 2010 Magical Panda Software, LLC All rights reserved. +// + +#import "MagicalRecord.h" + +NSString * const kMagicalRecordCleanedUpNotification = @"kMagicalRecordCleanedUpNotification"; + +@interface MagicalRecord (Internal) + ++ (void) cleanUpStack; ++ (void) cleanUpErrorHanding; + +@end + +@interface NSManagedObjectContext (MagicalRecordInternal) + ++ (void) MR_cleanUp; + +@end + + +@implementation MagicalRecord + ++ (MagicalRecordVersionTag) version +{ + return MagicalRecordVersionTag2_3; +} + ++ (void) cleanUp +{ + [self cleanUpErrorHanding]; + [self cleanUpStack]; + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + [notificationCenter postNotificationName:kMagicalRecordCleanedUpNotification + object:nil + userInfo:nil]; +} + ++ (void) cleanUpStack; +{ + [NSManagedObjectContext MR_cleanUp]; + [NSManagedObjectModel MR_setDefaultManagedObjectModel:nil]; + [NSPersistentStoreCoordinator MR_setDefaultStoreCoordinator:nil]; + [NSPersistentStore MR_setDefaultPersistentStore:nil]; +} + ++ (NSString *) currentStack +{ + NSMutableString *status = [NSMutableString stringWithString:@"Current Default Core Data Stack: ---- \n"]; + + [status appendFormat:@"Model: %@\n", [[NSManagedObjectModel MR_defaultManagedObjectModel] entityVersionHashesByName]]; + [status appendFormat:@"Coordinator: %@\n", [NSPersistentStoreCoordinator MR_defaultStoreCoordinator]]; + [status appendFormat:@"Store: %@\n", [NSPersistentStore MR_defaultPersistentStore]]; + [status appendFormat:@"Default Context: %@\n", [[NSManagedObjectContext MR_defaultContext] MR_description]]; + [status appendFormat:@"Context Chain: \n%@\n", [[NSManagedObjectContext MR_defaultContext] MR_parentChain]]; + + return status; +} + ++ (void) setDefaultModelNamed:(NSString *)modelName; +{ + NSManagedObjectModel *model = [NSManagedObjectModel MR_managedObjectModelNamed:modelName]; + [NSManagedObjectModel MR_setDefaultManagedObjectModel:model]; +} + ++ (void) setDefaultModelFromClass:(Class)modelClass; +{ + NSBundle *bundle = [NSBundle bundleForClass:modelClass]; + NSManagedObjectModel *model = [NSManagedObjectModel mergedModelFromBundles:[NSArray arrayWithObject:bundle]]; + [NSManagedObjectModel MR_setDefaultManagedObjectModel:model]; +} + ++ (NSString *) defaultStoreName; +{ + NSString *defaultName = [[[NSBundle mainBundle] infoDictionary] valueForKey:(id)kCFBundleNameKey]; + if (defaultName == nil) + { + defaultName = kMagicalRecordDefaultStoreFileName; + } + if (![defaultName hasSuffix:@"sqlite"]) + { + defaultName = [defaultName stringByAppendingPathExtension:@"sqlite"]; + } + + return defaultName; +} + + +#pragma mark - initialize + ++ (void) initialize; +{ + if (self == [MagicalRecord class]) + { + [self setShouldAutoCreateManagedObjectModel:YES]; + [self setShouldAutoCreateDefaultPersistentStoreCoordinator:NO]; +#ifdef DEBUG + [self setShouldDeleteStoreOnModelMismatch:YES]; +#else + [self setShouldDeleteStoreOnModelMismatch:NO]; +#endif + } +} + +@end + + diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordLogging.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordLogging.h new file mode 100644 index 0000000..8cc2625 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordLogging.h @@ -0,0 +1,49 @@ +// +// MagicalRecordLogging.h +// MagicalRecord +// +// Created by Saul Mora on 10/4/13. +// Copyright (c) 2013 Magical Panda Software LLC. All rights reserved. +// + +#import + +#if MR_LOGGING_DISABLED + +#define MRLogError(frmt, ...) ((void)0) +#define MRLogWarn(frmt, ...) ((void)0) +#define MRLogInfo(frmt, ...) ((void)0) +#define MRLogDebug(frmt, ...) ((void)0) +#define MRLogVerbose(frmt, ...) ((void)0) + +#else + +#ifndef MR_LOGGING_CONTEXT +#define MR_LOGGING_CONTEXT 0 +#endif + +#if __has_include("CocoaLumberjack.h") + #define MR_LOG_LEVEL_DEF (DDLogLevel)[MagicalRecord loggingLevel] + #define CAST (DDLogFlag) + #import +#else + #define MR_LOG_LEVEL_DEF [MagicalRecord loggingLevel] + #define LOG_ASYNC_ENABLED YES + #define CAST + #define LOG_MAYBE(async, lvl, flg, ctx, tag, fnct, frmt, ...) \ + do \ + { \ + if ((lvl & flg) == flg) \ + { \ + NSLog(frmt, ##__VA_ARGS__); \ + } \ + } while (0) +#endif + +#define MRLogError(frmt, ...) LOG_MAYBE(NO, MR_LOG_LEVEL_DEF, CAST MagicalRecordLoggingMaskError, MR_LOGGING_CONTEXT, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) +#define MRLogWarn(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, MR_LOG_LEVEL_DEF, CAST MagicalRecordLoggingMaskWarn, MR_LOGGING_CONTEXT, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) +#define MRLogInfo(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, MR_LOG_LEVEL_DEF, CAST MagicalRecordLoggingMaskInfo, MR_LOGGING_CONTEXT, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) +#define MRLogDebug(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, MR_LOG_LEVEL_DEF, CAST MagicalRecordLoggingMaskDebug, MR_LOGGING_CONTEXT, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) +#define MRLogVerbose(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, MR_LOG_LEVEL_DEF, CAST MagicalRecordLoggingMaskVerbose, MR_LOGGING_CONTEXT, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) + +#endif diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordShorthandMethodAliases.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordShorthandMethodAliases.h new file mode 100644 index 0000000..9342873 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/Core/MagicalRecordShorthandMethodAliases.h @@ -0,0 +1,273 @@ +#import +#import + + +@interface NSManagedObject (MagicalAggregationShortHand) + ++ (NSNumber *) numberOfEntities; ++ (NSNumber *) numberOfEntitiesWithContext:(NSManagedObjectContext *)context; ++ (NSNumber *) numberOfEntitiesWithPredicate:(NSPredicate *)searchTerm; ++ (NSNumber *) numberOfEntitiesWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; ++ (NSUInteger) countOfEntities; ++ (NSUInteger) countOfEntitiesWithContext:(NSManagedObjectContext *)context; ++ (NSUInteger) countOfEntitiesWithPredicate:(NSPredicate *)searchFilter; ++ (NSUInteger) countOfEntitiesWithPredicate:(NSPredicate *)searchFilter inContext:(NSManagedObjectContext *)context; ++ (BOOL) hasAtLeastOneEntity; ++ (BOOL) hasAtLeastOneEntityInContext:(NSManagedObjectContext *)context; +- (id) minValueFor:(NSString *)property; +- (id) maxValueFor:(NSString *)property; ++ (id) aggregateOperation:(NSString *)function onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)context; ++ (id) aggregateOperation:(NSString *)function onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate; ++ (NSArray *) aggregateOperation:(NSString *)collectionOperator onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate groupBy:(NSString*)groupingKeyPath inContext:(NSManagedObjectContext *)context; ++ (NSArray *) aggregateOperation:(NSString *)collectionOperator onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate groupBy:(NSString*)groupingKeyPath; +- (instancetype) objectWithMinValueFor:(NSString *)property; +- (instancetype) objectWithMinValueFor:(NSString *)property inContext:(NSManagedObjectContext *)context; + +@end + + +@interface NSManagedObject (MagicalFindersShortHand) + ++ (NSArray *) findAll; ++ (NSArray *) findAllInContext:(NSManagedObjectContext *)context; ++ (NSArray *) findAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending; ++ (NSArray *) findAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; ++ (NSArray *) findAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm; ++ (NSArray *) findAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; ++ (NSArray *) findAllWithPredicate:(NSPredicate *)searchTerm; ++ (NSArray *) findAllWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; ++ (instancetype) findFirst; ++ (instancetype) findFirstInContext:(NSManagedObjectContext *)context; ++ (instancetype) findFirstWithPredicate:(NSPredicate *)searchTerm; ++ (instancetype) findFirstWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; ++ (instancetype) findFirstWithPredicate:(NSPredicate *)searchterm sortedBy:(NSString *)property ascending:(BOOL)ascending; ++ (instancetype) findFirstWithPredicate:(NSPredicate *)searchterm sortedBy:(NSString *)property ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; ++ (instancetype) findFirstWithPredicate:(NSPredicate *)searchTerm andRetrieveAttributes:(NSArray *)attributes; ++ (instancetype) findFirstWithPredicate:(NSPredicate *)searchTerm andRetrieveAttributes:(NSArray *)attributes inContext:(NSManagedObjectContext *)context; ++ (instancetype) findFirstWithPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortBy ascending:(BOOL)ascending andRetrieveAttributes:(id)attributes, ...; ++ (instancetype) findFirstWithPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortBy ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context andRetrieveAttributes:(id)attributes, ...; ++ (instancetype) findFirstByAttribute:(NSString *)attribute withValue:(id)searchValue; ++ (instancetype) findFirstByAttribute:(NSString *)attribute withValue:(id)searchValue inContext:(NSManagedObjectContext *)context; ++ (instancetype) findFirstOrderedByAttribute:(NSString *)attribute ascending:(BOOL)ascending; ++ (instancetype) findFirstOrderedByAttribute:(NSString *)attribute ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; ++ (instancetype) findFirstOrCreateByAttribute:(NSString *)attribute withValue:(id)searchValue; ++ (instancetype) findFirstOrCreateByAttribute:(NSString *)attribute withValue:(id)searchValue inContext:(NSManagedObjectContext *)context; ++ (NSArray *) findByAttribute:(NSString *)attribute withValue:(id)searchValue; ++ (NSArray *) findByAttribute:(NSString *)attribute withValue:(id)searchValue inContext:(NSManagedObjectContext *)context; ++ (NSArray *) findByAttribute:(NSString *)attribute withValue:(id)searchValue andOrderBy:(NSString *)sortTerm ascending:(BOOL)ascending; ++ (NSArray *) findByAttribute:(NSString *)attribute withValue:(id)searchValue andOrderBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + ++ (NSFetchedResultsController *) fetchController:(NSFetchRequest *)request delegate:(id)delegate useFileCache:(BOOL)useFileCache groupedBy:(NSString *)groupKeyPath inContext:(NSManagedObjectContext *)context; + +#endif /* TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR */ + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + ++ (NSFetchedResultsController *) fetchAllWithDelegate:(id)delegate; + +#endif /* TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR */ + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + ++ (NSFetchedResultsController *) fetchAllWithDelegate:(id)delegate inContext:(NSManagedObjectContext *)context; + +#endif /* TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR */ + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + ++ (NSFetchedResultsController *) fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm groupBy:(NSString *)groupingKeyPath delegate:(id)delegate; + +#endif /* TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR */ + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + ++ (NSFetchedResultsController *) fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm groupBy:(NSString *)groupingKeyPath delegate:(id)delegate inContext:(NSManagedObjectContext *)context; + +#endif /* TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR */ + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + ++ (NSFetchedResultsController *) fetchAllGroupedBy:(NSString *)group withPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortTerm ascending:(BOOL)ascending; + +#endif /* TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR */ + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + ++ (NSFetchedResultsController *) fetchAllGroupedBy:(NSString *)group withPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; + +#endif /* TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR */ + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + ++ (NSFetchedResultsController *) fetchAllGroupedBy:(NSString *)group withPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortTerm ascending:(BOOL)ascending delegate:(id)delegate; + +#endif /* TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR */ + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + ++ (NSFetchedResultsController *) fetchAllGroupedBy:(NSString *)group withPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortTerm ascending:(BOOL)ascending delegate:(id)delegate inContext:(NSManagedObjectContext *)context; + +#endif /* TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR */ + +@end + + +@interface NSManagedObject (MagicalRequestsShortHand) + ++ (NSFetchRequest *) createFetchRequest; ++ (NSFetchRequest *) createFetchRequestInContext:(NSManagedObjectContext *)context; ++ (NSFetchRequest *) requestAll; ++ (NSFetchRequest *) requestAllInContext:(NSManagedObjectContext *)context; ++ (NSFetchRequest *) requestAllWithPredicate:(NSPredicate *)searchTerm; ++ (NSFetchRequest *) requestAllWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; ++ (NSFetchRequest *) requestAllWhere:(NSString *)property isEqualTo:(id)value; ++ (NSFetchRequest *) requestAllWhere:(NSString *)property isEqualTo:(id)value inContext:(NSManagedObjectContext *)context; ++ (NSFetchRequest *) requestFirstWithPredicate:(NSPredicate *)searchTerm; ++ (NSFetchRequest *) requestFirstWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; ++ (NSFetchRequest *) requestFirstByAttribute:(NSString *)attribute withValue:(id)searchValue; ++ (NSFetchRequest *) requestFirstByAttribute:(NSString *)attribute withValue:(id)searchValue inContext:(NSManagedObjectContext *)context; ++ (NSFetchRequest *) requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending; ++ (NSFetchRequest *) requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; ++ (NSFetchRequest *) requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm; ++ (NSFetchRequest *) requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context; + +@end + + +@interface NSManagedObjectContext (MagicalRecordChainSaveShortHand) + +- (void)saveWithBlock:(void (^)(NSManagedObjectContext *localContext))block; +- (void)saveWithBlock:(void (^)(NSManagedObjectContext *localContext))block completion:(MRSaveCompletionHandler)completion; +- (void)saveWithBlockAndWait:(void (^)(NSManagedObjectContext *localContext))block; + +@end + + +@interface NSManagedObjectContext (MagicalObservingShortHand) + +- (void) observeContext:(NSManagedObjectContext *)otherContext; +- (void) stopObservingContext:(NSManagedObjectContext *)otherContext; +- (void) observeContextOnMainThread:(NSManagedObjectContext *)otherContext; +- (void) observeiCloudChangesInCoordinator:(NSPersistentStoreCoordinator *)coordinator; +- (void) stopObservingiCloudChangesInCoordinator:(NSPersistentStoreCoordinator *)coordinator; + +@end + + +@interface NSManagedObjectContext (MagicalRecordShortHand) + ++ (void) initializeDefaultContextWithCoordinator:(NSPersistentStoreCoordinator *)coordinator; ++ (NSManagedObjectContext *) rootSavingContext; ++ (NSManagedObjectContext *) defaultContext; ++ (NSManagedObjectContext *) context; ++ (NSManagedObjectContext *) contextWithParent:(NSManagedObjectContext *)parentContext; ++ (NSManagedObjectContext *) contextWithStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator; ++ (NSManagedObjectContext *) newMainQueueContext NS_RETURNS_RETAINED; ++ (NSManagedObjectContext *) newPrivateQueueContext NS_RETURNS_RETAINED; +- (void) setWorkingName:(NSString *)workingName; +- (NSString *) workingName; +- (NSString *) description; +- (NSString *) parentChain; ++ (void) resetDefaultContext; +- (void) deleteObjects:(id )objects; + +@end + + +@interface NSManagedObjectContext (MagicalRecordDeprecatedShortHand) + ++ (NSManagedObjectContext *) contextWithoutParent MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("4.0", "MR_newPrivateQueueContext"); ++ (NSManagedObjectContext *) newContext MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("4.0", "MR_context"); ++ (NSManagedObjectContext *) newContextWithParent:(NSManagedObjectContext *)parentContext MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("4.0", "MR_contextWithParent:"); ++ (NSManagedObjectContext *) newContextWithStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("4.0", "MR_contextWithStoreCoordinator:"); + +@end + + +@interface NSManagedObjectContext (MagicalSavesShortHand) + +- (void) saveOnlySelfWithCompletion:(MRSaveCompletionHandler)completion; +- (void) saveToPersistentStoreWithCompletion:(MRSaveCompletionHandler)completion; +- (void) saveOnlySelfAndWait; +- (void) saveToPersistentStoreAndWait; +- (void) saveWithOptions:(MRSaveOptions)saveOptions completion:(MRSaveCompletionHandler)completion; + +@end + + +@interface NSManagedObjectContext (MagicalSavesDeprecatedShortHand) + +- (void) save MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("3.0", "MR_saveToPersistentStoreAndWait"); +- (void) saveWithErrorCallback:(void(^)(NSError *error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0"); +- (void) saveInBackgroundCompletion:(void (^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0"); +- (void) saveInBackgroundErrorHandler:(void (^)(NSError *error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0"); +- (void) saveInBackgroundErrorHandler:(void (^)(NSError *error))errorCallback completion:(void (^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0"); +- (void) saveNestedContexts MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("3.0", "MR_saveToPersistentStoreWithCompletion:"); +- (void) saveNestedContextsErrorHandler:(void (^)(NSError *error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("3.0", "MR_saveToPersistentStoreWithCompletion:"); +- (void) saveNestedContextsErrorHandler:(void (^)(NSError *error))errorCallback completion:(void (^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("3.0", "MR_saveToPersistentStoreWithCompletion:"); + +@end + + +@interface NSManagedObjectContext (MagicalThreadingShortHand) + ++ (NSManagedObjectContext *) contextForCurrentThread __attribute((deprecated("This method will be removed in MagicalRecord 3.0"))); ++ (void) clearNonMainThreadContextsCache __attribute((deprecated("This method will be removed in MagicalRecord 3.0"))); ++ (void) resetContextForCurrentThread __attribute((deprecated("This method will be removed in MagicalRecord 3.0"))); ++ (void) clearContextForCurrentThread __attribute((deprecated("This method will be removed in MagicalRecord 3.0"))); + +@end + + +@interface NSManagedObjectModel (MagicalRecordShortHand) + ++ (NSManagedObjectModel *) defaultManagedObjectModel; ++ (void) setDefaultManagedObjectModel:(NSManagedObjectModel *)newDefaultModel; ++ (NSManagedObjectModel *) mergedObjectModelFromMainBundle; ++ (NSManagedObjectModel *) newManagedObjectModelNamed:(NSString *)modelFileName NS_RETURNS_RETAINED; ++ (NSManagedObjectModel *) managedObjectModelNamed:(NSString *)modelFileName; ++ (NSManagedObjectModel *) newModelNamed:(NSString *) modelName inBundleNamed:(NSString *) bundleName NS_RETURNS_RETAINED; ++ (NSManagedObjectModel *) newModelNamed:(NSString *) modelName inBundle:(NSBundle*) bundle NS_RETURNS_RETAINED; + +@end + + +@interface NSPersistentStore (MagicalRecordShortHand) + ++ (NSURL *) defaultLocalStoreUrl; ++ (NSPersistentStore *) defaultPersistentStore; ++ (void) setDefaultPersistentStore:(NSPersistentStore *) store; ++ (NSURL *) urlForStoreName:(NSString *)storeFileName; ++ (NSURL *) cloudURLForUbiqutiousContainer:(NSString *)bucketName; + +@end + + +@interface NSPersistentStoreCoordinator (MagicalRecordShortHand) + ++ (NSPersistentStoreCoordinator *) defaultStoreCoordinator; ++ (void) setDefaultStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator; ++ (NSPersistentStoreCoordinator *) coordinatorWithInMemoryStore; ++ (NSPersistentStoreCoordinator *) newPersistentStoreCoordinator NS_RETURNS_RETAINED; ++ (NSPersistentStoreCoordinator *) coordinatorWithSqliteStoreNamed:(NSString *)storeFileName; ++ (NSPersistentStoreCoordinator *) coordinatorWithAutoMigratingSqliteStoreNamed:(NSString *)storeFileName; ++ (NSPersistentStoreCoordinator *) coordinatorWithSqliteStoreAtURL:(NSURL *)storeURL; ++ (NSPersistentStoreCoordinator *) coordinatorWithAutoMigratingSqliteStoreAtURL:(NSURL *)storeURL; ++ (NSPersistentStoreCoordinator *) coordinatorWithPersistentStore:(NSPersistentStore *)persistentStore; ++ (NSPersistentStoreCoordinator *) coordinatorWithiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent; ++ (NSPersistentStoreCoordinator *) coordinatorWithiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreAtURL:(NSURL *)storeURL cloudStorePathComponent:(NSString *)subPathComponent; ++ (NSPersistentStoreCoordinator *) coordinatorWithiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent completion:(void(^)(void))completionHandler; ++ (NSPersistentStoreCoordinator *) coordinatorWithiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreAtURL:(NSURL *)storeURL cloudStorePathComponent:(NSString *)subPathComponent completion:(void (^)(void))completionHandler; +- (NSPersistentStore *) addInMemoryStore; +- (NSPersistentStore *) addAutoMigratingSqliteStoreNamed:(NSString *) storeFileName; +- (NSPersistentStore *) addAutoMigratingSqliteStoreAtURL:(NSURL *)storeURL; +- (NSPersistentStore *) addSqliteStoreNamed:(id)storeFileName withOptions:(__autoreleasing NSDictionary *)options; +- (NSPersistentStore *) addSqliteStoreNamed:(id)storeFileName configuration:(NSString *)configuration withOptions:(__autoreleasing NSDictionary *)options; +- (void) addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent; +- (void) addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreAtURL:(NSURL *)storeURL cloudStorePathComponent:(NSString *)subPathComponent; +- (void) addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreNamed:(NSString *)localStoreName cloudStorePathComponent:(NSString *)subPathComponent completion:(void(^)(void))completionBlock; +- (void) addiCloudContainerID:(NSString *)containerID contentNameKey:(NSString *)contentNameKey localStoreAtURL:(NSURL *)storeURL cloudStorePathComponent:(NSString *)subPathComponent completion:(void (^)(void))completionBlock; + +@end diff --git a/dayPhoto/Pods/MagicalRecord/MagicalRecord/MagicalRecord.h b/dayPhoto/Pods/MagicalRecord/MagicalRecord/MagicalRecord.h new file mode 100644 index 0000000..0b5fd97 --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/MagicalRecord/MagicalRecord.h @@ -0,0 +1,46 @@ +// +// MagicalRecord.h +// +// Created by Saul Mora on 28/07/10. +// Copyright 2010 Magical Panda Software, LLC All rights reserved. +// + +#import +#import + +//! Project version number for MagicalRecord. +FOUNDATION_EXPORT double MagicalRecordVersionNumber; + +//! Project version string for MagicalRecord. +FOUNDATION_EXPORT const unsigned char MagicalRecordVersionString[]; + +#import +#import + +#import +#import +#import +#import +#import + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/dayPhoto/Pods/MagicalRecord/README.md b/dayPhoto/Pods/MagicalRecord/README.md new file mode 100644 index 0000000..1f5e89b --- /dev/null +++ b/dayPhoto/Pods/MagicalRecord/README.md @@ -0,0 +1,41 @@ +# ![Awesome](https://github.com/magicalpanda/magicalpanda.github.com/blob/master/images/awesome_logo_small.png?raw=true) MagicalRecord + +[![Circle CI](https://circleci.com/gh/magicalpanda/MagicalRecord/tree/develop.svg?style=svg)](https://circleci.com/gh/magicalpanda/MagicalRecord/tree/develop) + +In software engineering, the active record pattern is a design pattern found in software that stores its data in relational databases. It was named by Martin Fowler in his book Patterns of Enterprise Application Architecture. The interface to such an object would include functions such as Insert, Update, and Delete, plus properties that correspond more-or-less directly to the columns in the underlying database table. + +> Active record is an approach to accessing data in a database. A database table or view is wrapped into a class; thus an object instance is tied to a single row in the table. After creation of an object, a new row is added to the table upon save. Any object loaded gets its information from the database; when an object is updated, the corresponding row in the table is also updated. The wrapper class implements accessor methods or properties for each column in the table or view. + +> *- [Wikipedia]("http://en.wikipedia.org/wiki/Active_record_pattern")* + +MagicalRecord was inspired by the ease of Ruby on Rails' Active Record fetching. The goals of this code are: + +* Clean up my Core Data related code +* Allow for clear, simple, one-line fetches +* Still allow the modification of the NSFetchRequest when request optimizations are needed + +## Documentation + +- [Installation](Docs/Installing-MagicalRecord.md) +- [Getting Started](Docs/Getting-Started.md) +- [Working with Managed Object Contexts](Docs/Working-with-Managed-Object-Contexts.md) +- [Creating Entities](Docs/Creating-Entities.md) +- [Deleting Entities](Docs/Deleting-Entities.md) +- [Fetching Entities](Docs/Fetching-Entities.md) +- [Saving Entities](Docs/Saving-Entities.md) +- [Importing Data](Docs/Importing-Data.md) +- [Logging](Docs/Logging.md) +* [Other Resources](Docs/Other-Resources.md) + +## Support + +MagicalRecord is provided as-is, free of charge. For support, you have a few choices: + +- Ask your support question on [Stackoverflow.com](http://stackoverflow.com), and tag your question with **MagicalRecord**. The core team will be notified of your question only if you mark your question with this tag. The general Stack Overflow community is provided the opportunity to answer the question to help you faster, and to reap the reputation points. If the community is unable to answer, we'll try to step in and answer your question. +- If you believe you have found a bug in MagicalRecord, please submit a support ticket on the [Github Issues page for MagicalRecord](http://github.com/magicalpanda/magicalrecord/issues). We'll get to them as soon as we can. Please do **NOT** ask general questions on the issue tracker. Support questions will be closed unanswered. +- For more personal or immediate support, [MagicalPanda](http://magicalpanda.com/) is available for hire to consult on your project. + + +## Twitter + +Follow [@MagicalRecord](http://twitter.com/magicalrecord) on twitter to stay up to date with the latest updates relating to MagicalRecord. diff --git a/dayPhoto/Pods/Manifest.lock b/dayPhoto/Pods/Manifest.lock new file mode 100755 index 0000000..68eba49 --- /dev/null +++ b/dayPhoto/Pods/Manifest.lock @@ -0,0 +1,44 @@ +PODS: + - AFNetworking (2.6.3): + - AFNetworking/NSURLConnection (= 2.6.3) + - AFNetworking/NSURLSession (= 2.6.3) + - AFNetworking/Reachability (= 2.6.3) + - AFNetworking/Security (= 2.6.3) + - AFNetworking/Serialization (= 2.6.3) + - AFNetworking/UIKit (= 2.6.3) + - AFNetworking/NSURLConnection (2.6.3): + - AFNetworking/Reachability + - AFNetworking/Security + - AFNetworking/Serialization + - AFNetworking/NSURLSession (2.6.3): + - AFNetworking/Reachability + - AFNetworking/Security + - AFNetworking/Serialization + - AFNetworking/Reachability (2.6.3) + - AFNetworking/Security (2.6.3) + - AFNetworking/Serialization (2.6.3) + - AFNetworking/UIKit (2.6.3): + - AFNetworking/NSURLConnection + - AFNetworking/NSURLSession + - FSHelpers+Swift (2.0) + - MagicalRecord (2.3.0) + - SDWebImage (3.7.3): + - SDWebImage/Core (= 3.7.3) + - SDWebImage/Core (3.7.3) + - VK-ios-sdk (1.3.8) + +DEPENDENCIES: + - AFNetworking + - FSHelpers+Swift + - MagicalRecord + - SDWebImage (~> 3.7) + - VK-ios-sdk + +SPEC CHECKSUMS: + AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60 + FSHelpers+Swift: 6d199597cf772fbeb5c009fe5715886ffba18719 + MagicalRecord: 89eb7d7ead39fb37f01c3d010665ee94d17f8dba + SDWebImage: 1d2b1a1efda1ade1b00b6f8498865f8ddedc8a84 + VK-ios-sdk: 63b3e084eecb1ed2c11ab3ac53f9309164973f9b + +COCOAPODS: 0.39.0 diff --git a/dayPhoto/Pods/Pods.xcodeproj/project.pbxproj b/dayPhoto/Pods/Pods.xcodeproj/project.pbxproj new file mode 100755 index 0000000..fcff669 --- /dev/null +++ b/dayPhoto/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,3445 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 0030569EC6F7C3C9F8242B1C5AB32DCD /* VKOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 19AD7D84C9DA39B1E78C60E9D483ECBD /* VKOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0118770ACFD36A90A368A4C87765C5C9 /* VKShareDialogController.h in Headers */ = {isa = PBXBuildFile; fileRef = C83AAC37BD4CF52BBD2E236B54869947 /* VKShareDialogController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0249D817973CA82B303A4056920C5809 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB6066063B48D3EAC1E909311CD0FB2A /* CoreGraphics.framework */; }; + 03A4A15339FAA5A05916007578D33018 /* VKApiFriends.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E0F1F9DDB6659830C3E417FB3345C67 /* VKApiFriends.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 03A53BA16A24F52F6DB5C90D78AAA9CF /* VKHTTPOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = DA2724B95A8DA5F33591E506AC9AB483 /* VKHTTPOperation.m */; }; + 03B2775C1E1FAD8B617AD1A5264635F8 /* VKCaptchaView.h in Headers */ = {isa = PBXBuildFile; fileRef = A1E59D8A15A1B049713CD5709F2171FD /* VKCaptchaView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 03BC01DC376505B1696A86D0C6FB2B2D /* VKUploadWallPhotoRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 169A95359C0177BB437A4E47C27FAF10 /* VKUploadWallPhotoRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 054BC5DDB42F7A646B88CEA89EF9BA86 /* VKError.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CBA0E156105B03FB9F4E28907A4364A /* VKError.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 05D8B604EE79D5702E013BAE34D379B5 /* VKApiGroups.m in Sources */ = {isa = PBXBuildFile; fileRef = FA6D7FC8145C3112828D49BC7141153C /* VKApiGroups.m */; }; + 0627EC150C177700387C9E0C44C5D20E /* MagicalRecord+ShorthandMethods.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CFE7F037CFF94E1C419558C0A78C804 /* MagicalRecord+ShorthandMethods.m */; }; + 0635A2D041497FFFDB75970E013875ED /* VKBatchRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AAA90FB17C6A9BBCF8FBF56BA367834 /* VKBatchRequest.m */; }; + 06A1D889F41FC751E2819344372FBA67 /* VKApiCaptcha.h in Headers */ = {isa = PBXBuildFile; fileRef = 379724F18F38DFE84BD35970C4931FBC /* VKApiCaptcha.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 06B2244136E373B7A5AFAFD51325F9BD /* VKApiPhotos.h in Headers */ = {isa = PBXBuildFile; fileRef = 45418E4B7395EA84F4161D78A92FE770 /* VKApiPhotos.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 072553FA6A186BBBA329B450F0C979A3 /* VKBundle.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA8F6E4988AF56A851C9215C156647A /* VKBundle.m */; }; + 09CD5E8011F9FF90817B4CEA30CCAF79 /* NSManagedObject+MagicalDataImport.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A6286DABBA17F5AD91FCF2B014C2B0B /* NSManagedObject+MagicalDataImport.m */; }; + 09E64866A37EAC1852E7FA08CF2BBB07 /* NSAttributeDescription+MagicalDataImport.m in Sources */ = {isa = PBXBuildFile; fileRef = 967F0A407D46DC0C2637608A24F5DC36 /* NSAttributeDescription+MagicalDataImport.m */; }; + 09E6DECD5AB594104764C6F81EB71537 /* MagicalRecordInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = B4BB0CF5D47A4E94614BDFE0308E7127 /* MagicalRecordInternal.m */; }; + 0A4073F0F0E0FD5ADA889FA44A9BB51C /* NSManagedObjectContext+MagicalRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = B95C9730F5C5AEAD3DCF7EA13D51F38A /* NSManagedObjectContext+MagicalRecord.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0A78320E9454E8FFFEF1C62ECA278A73 /* VKUniversity.m in Sources */ = {isa = PBXBuildFile; fileRef = 53E5CA98E2BE0A7967C46422EE158BE8 /* VKUniversity.m */; }; + 0B2782E46C3D9034598FCD3CF319DD11 /* VKLikes.m in Sources */ = {isa = PBXBuildFile; fileRef = A0EE3A0C165CFF90F68DE2EF2B4F4E0F /* VKLikes.m */; }; + 0B379B6CEFB17721877BC33B6344DDE7 /* NSData+MD5.h in Headers */ = {isa = PBXBuildFile; fileRef = F7D945C11B8CCEBF390DB91229F1EBE1 /* NSData+MD5.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0B8782FD87EA4D6A9796D891FDFB81FA /* AFNetworking-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = BDD7062C3B55ED1A6C64C50E479894C3 /* AFNetworking-dummy.m */; }; + 0B8AF25ED975F75779E49932B1009728 /* VKCaptchaViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 316184DA15C558D7F7C67A490946E398 /* VKCaptchaViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0C9D47FF9B4920710B4C13A1C075615F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9382A6D4252264618D0117AC1069D871 /* Foundation.framework */; }; + 0D6AC35459E60DB595DEDD8D3D73BA52 /* VKApiObjectArray.m in Sources */ = {isa = PBXBuildFile; fileRef = C3260972180B09FF73D2627A26FB0213 /* VKApiObjectArray.m */; }; + 0DD7E3DD1F4CC60A9F7131A652AC0408 /* FSE+Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = 577C96E1A5A0A74C9DD319F235217DD0 /* FSE+Array.swift */; }; + 0E1548093CDCE75E2807E18BB466BDAD /* AFHTTPRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = FAB9871C3C4A71C2450D492DD8719A4F /* AFHTTPRequestOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10076D84089A8C3E544558184CE079FB /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EC58FA8B3DFD0AF722E12886BC8AAECD /* SafariServices.framework */; }; + 106FC9E7FC58B50211F24BF02130B732 /* VKApiWall.h in Headers */ = {isa = PBXBuildFile; fileRef = 11D3D9219700DC2C9D65B6B399A65631 /* VKApiWall.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1251BC18BF5F1069A9AA0850DFFAA8FC /* VKObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 531F2DC3DAC12369276B8C566A6980A4 /* VKObject.m */; }; + 12F8F095C78FFC929CBF283E1B5783C5 /* UIButton+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = A1D159C0E7BD18F18C50F813353921AE /* UIButton+AFNetworking.m */; }; + 14E96EEEEE0E84103195890E3D1AED79 /* VKAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = FF69751A95A8FA9477D2D74BB86BB42C /* VKAudio.m */; }; + 16692DBAAAF03D52D7DC82E2B1CA26A3 /* VKApiBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A2D751020287A82AB6C76887AB874F50 /* VKApiBase.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 16BCA6019103BCD0EA2D97A74715A51A /* SDWebImageDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9328874347810009DBFA845BCC0867A2 /* SDWebImageDecoder.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 171686A1897980922731CA7B5A8B8401 /* VKRelative.h in Headers */ = {isa = PBXBuildFile; fileRef = E5E4B11C2E2902BD172B2F51724DD05B /* VKRelative.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 17C26BF91F1C3E82258D2C6E2ADB094B /* AFURLConnectionOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D9443B99A68B01EE454712592075AF5 /* AFURLConnectionOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 188EA5D8A6A6FB95FD7E27134155E297 /* SDWebImagePrefetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = AF208B8E772893C74E76B768E723492A /* SDWebImagePrefetcher.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 1D25E516C199714AEA5CA5F659CCCE78 /* NSManagedObjectContext+MagicalObserving.h in Headers */ = {isa = PBXBuildFile; fileRef = F893819961D9C6B069D3F2EB187AAA60 /* NSManagedObjectContext+MagicalObserving.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1DF0AF8ACEBA9ED7C731801D493EA1D3 /* VKSdkResources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 957440F9C89943F6361D92718BC610AF /* VKSdkResources.bundle */; }; + 1ECBE6788B4B35C0A8445E38FA182D2C /* AFHTTPRequestOperationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 37DA3226D8FF6AB58895C240752EEE92 /* AFHTTPRequestOperationManager.m */; }; + 204F308E96D1FD806274AEA1A13B6B20 /* AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = A0DCECBE25AE9FD26B9B58140965BDC4 /* AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 23E2066A7E9CA5FC52E235AA552FAB2F /* VKPermissions.h in Headers */ = {isa = PBXBuildFile; fileRef = E8CAFD04652328AA8F59E07A3626266C /* VKPermissions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2471FC0F59B66AEDC1804251E1F4AE51 /* SDWebImageCompat.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AA3598C34A918456A19C1F85125D1CE /* SDWebImageCompat.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 24CBB179B4BECCF49ECBE2C0FA1C3528 /* NSError+VKError.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E8544B9142CED3FF56851C10242F34 /* NSError+VKError.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 257AFDCDF0383CD3F7A11A3ACCE316C0 /* VKResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = E0181697B49C487F800CEDAF217ECB78 /* VKResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 27099263F2D3C310CE0D6DA0F4F5E440 /* VKApiUsers.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A0757BEA3BA889E863D72ACD74D878F /* VKApiUsers.m */; }; + 2820895236106ADBD8CAE01972EE42C1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9382A6D4252264618D0117AC1069D871 /* Foundation.framework */; }; + 2882BE2377E8FC2421C2CA879467AE65 /* UIActivityIndicatorView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 90AD7B766CBC048FE123FE61E2654B47 /* UIActivityIndicatorView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 28C8C72451F7254476E113D08C4CDB56 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB6066063B48D3EAC1E909311CD0FB2A /* CoreGraphics.framework */; }; + 291B1234462A24C47A12E8CA15CF85FE /* VKApiUsers.h in Headers */ = {isa = PBXBuildFile; fileRef = 11E0A66F8BB186F196F57A6E0C03E117 /* VKApiUsers.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 29B9B41FA649E1E2F41AC28C8E885D70 /* VKImageParameters.m in Sources */ = {isa = PBXBuildFile; fileRef = BBD1F9C55EBACA9D154EA76B8873DAB0 /* VKImageParameters.m */; }; + 2A77F38FE22978DCED7F724F8C554723 /* NSString+MagicalDataImport.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FF15E31ABE9DC0FB4B133E6386D6C1C /* NSString+MagicalDataImport.m */; }; + 2B417BAAF97B639CDA094654D5A7C76C /* MagicalRecord+ShorthandMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = 5BDA6683CE8A4EB965FC92D5E9D0B547 /* MagicalRecord+ShorthandMethods.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2CF5CFB725E5CDBB259690467623D104 /* SDWebImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 573534E1DE839F369A065D7DCA5E020A /* SDWebImageManager.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 2D0151DC879F60D123184A3ABA6C33CA /* SDWebImageDownloaderOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F3147584BCD90348E6D4BEFC2559352D /* SDWebImageDownloaderOperation.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 2D14091F1AE22B3B6877CE2F5194BA0A /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B83FB9FA4E8E7A8E3A59CDC0D1EF6EB /* AFURLResponseSerialization.m */; }; + 2DBC831C00474A7A52AD4C8705472BB5 /* UIImageView+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 63E2C3C6066C50DB20D28256C76348A8 /* UIImageView+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2F06B9F672E672810C0228E991E0BCA0 /* UIImage+MultiFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 36D84A427E480367E9BCB3E58B151793 /* UIImage+MultiFormat.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3022D16E3C05AA0FDF3519B8D91531CC /* UIImage+MultiFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B1E107B0E21F75E870B2064CED25A67 /* UIImage+MultiFormat.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 3165B2FEAB48577B3979B9CA09CFEEDD /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24F010A013E6DF829F2DE6B7A5F950B7 /* Security.framework */; }; + 317A57748C9329EC2ABBF55832F27AA7 /* VKOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 899996AC456B764AC637C16C6A80376C /* VKOperation.m */; }; + 319A493CFA79094906A9CD41F574E489 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9382A6D4252264618D0117AC1069D871 /* Foundation.framework */; }; + 322EC484ADA51CD029DD3E2DA10EA27C /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEF47E684574DD6B8012F5FCA701B4FB /* SystemConfiguration.framework */; }; + 324E7901734B7B3CF94B389B3F8199A7 /* VKSchool.h in Headers */ = {isa = PBXBuildFile; fileRef = 20CD0C38FB4713443739953899A5D201 /* VKSchool.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 33CE122D6CA60443C1220903DDF51775 /* VKPhotoSize.h in Headers */ = {isa = PBXBuildFile; fileRef = DDB5E2396DE2DCD1C6E13DACF3F30ED6 /* VKPhotoSize.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3421EA4BB7D507FEF0A5AC23CF5CEB31 /* VKError.m in Sources */ = {isa = PBXBuildFile; fileRef = 7CF9F09E3C5905434B8BE7B5EDB4E1DE /* VKError.m */; }; + 34A177E5296911DDB4E430A82ACCB64B /* NSData+ImageContentType.h in Headers */ = {isa = PBXBuildFile; fileRef = 869647607E70D8D09B11330DC1720709 /* NSData+ImageContentType.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 34C7345081A9099032D2DD6ACFD3B015 /* AFSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = FFF46FEBEDC7276A918416C9E6E46DFD /* AFSecurityPolicy.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3651EC8D1CF24D25FDDDF5FBE09FF0FA /* FSHelpers+Swift-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = DDCD0A29450F2A8D6199CF6A69136DB0 /* FSHelpers+Swift-dummy.m */; }; + 36BEEF5338EF31B0955DC632E0482747 /* NSManagedObject+MagicalRecord.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B029DD39F29EA9186FF68BFB6ACED9B /* NSManagedObject+MagicalRecord.m */; }; + 36D7B63319C8DB245D4171A278930730 /* VKSchool.m in Sources */ = {isa = PBXBuildFile; fileRef = CC2050D0103146AECC017F075203E0AF /* VKSchool.m */; }; + 39E894BC289FE09DBD5C9E843AE0A44D /* UIImageView+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = BD3BA348DDBEF671458176F098DEAED1 /* UIImageView+WebCache.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 39F0A159E7343857E0B7CD5EFD767AFC /* VKUser.h in Headers */ = {isa = PBXBuildFile; fileRef = A6EEF4EC2889A46CFE74DA01840E9F79 /* VKUser.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3AB6061A7C819691F4C64439A9DF301E /* NSManagedObject+MagicalFinders.h in Headers */ = {isa = PBXBuildFile; fileRef = 9EA18F9CA5C1EF102D14951A52F68E9B /* NSManagedObject+MagicalFinders.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3BA806775193D365919BE19DF69F9883 /* VKPhoto.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D18E754CA5D818AE2A905512681A0B8 /* VKPhoto.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3BFEC1F842226F4A2EA83742A489AF04 /* NSManagedObjectContext+MagicalObserving.m in Sources */ = {isa = PBXBuildFile; fileRef = 46E425C522CC16BFF7C2D4D93CC0FAE6 /* NSManagedObjectContext+MagicalObserving.m */; }; + 3DD7C1ADF1DA17264B11B3FCA93CDD9A /* MagicalRecord+iCloud.m in Sources */ = {isa = PBXBuildFile; fileRef = 14E903B4AE4522E44A6A92AD59B68702 /* MagicalRecord+iCloud.m */; }; + 3E7F2EACD4312C1D9D64BEBC797625D2 /* VKAuthorizeController.m in Sources */ = {isa = PBXBuildFile; fileRef = E9991B895C35E9F04A013E1D7EE83E4E /* VKAuthorizeController.m */; }; + 3F5DC541B71A33F6D5AA5012C7630425 /* MagicalRecord+Setup.m in Sources */ = {isa = PBXBuildFile; fileRef = EE5E662C115A021EFC70E57794147BB0 /* MagicalRecord+Setup.m */; }; + 400B514DB9D87FC01ECFD336A05D450C /* UIImage+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 146868522E267C080A54A81CB89548B2 /* UIImage+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 407C2477A514E0D015CE201DC3040600 /* SDWebImageDownloaderOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = B5987825C280EB337B1B8E70D37A53B1 /* SDWebImageDownloaderOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 423698669A7E33B7CF8D457F77172F3A /* NSEntityDescription+MagicalDataImport.h in Headers */ = {isa = PBXBuildFile; fileRef = 8FF384C4CD58C9AAACBA9BE15130FEBC /* NSEntityDescription+MagicalDataImport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 42C73B49C777583B6CAC4CAFB984370A /* MagicalRecord+Setup.h in Headers */ = {isa = PBXBuildFile; fileRef = 95EDC08FDF81B8BB7975CA6FA8DD1357 /* MagicalRecord+Setup.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 438151B3D667A8B3D478F37E744BACF3 /* NSManagedObjectContext+MagicalThreading.m in Sources */ = {isa = PBXBuildFile; fileRef = 769A7581AB9D6C153EE709F21630A847 /* NSManagedObjectContext+MagicalThreading.m */; }; + 43941378AD3B225AED52A01031D78688 /* SDWebImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F837DBDF389BE44AFD44BE5C6FB0AEE /* SDWebImageDownloader.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 440EF9265687751FED239F5D0A805CA0 /* SDWebImage-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 97A611F7C094E902D652F0A1AF00D1FF /* SDWebImage-dummy.m */; }; + 44FBD4BED7EC0F0835002425D78154C4 /* MagicalRecord+Options.m in Sources */ = {isa = PBXBuildFile; fileRef = A02CC1C2EB217ECBD40021C8C0791DBB /* MagicalRecord+Options.m */; }; + 47545B1B9E17230D8A59D6A535F8A9BD /* UIRefreshControl+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 12E2EB9002BE99A16275FC057B096C4E /* UIRefreshControl+AFNetworking.m */; }; + 47C66C3FA72DE0E4F301E48E472722C5 /* AFNetworkReachabilityManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DE3BE2C7D4A9B746667937CB1806DF8 /* AFNetworkReachabilityManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 48E133ACD5808F13911D84BF71393ECB /* VKUploadPhotoBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 441264903F82C2488522A2C796195EC8 /* VKUploadPhotoBase.m */; }; + 49063CFE2BE637CB9319D1F794D3B752 /* NSPersistentStoreCoordinator+MagicalRecord.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F90F00B0B49AD24C036C5DD9D338C59 /* NSPersistentStoreCoordinator+MagicalRecord.m */; }; + 493F1C04C15A633FFB836FDAF5843A25 /* FSE+UIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0E26C12DC92DBD0B123449DD675C25 /* FSE+UIImage.swift */; }; + 4AF03CEF9D62284839DEDF282051A296 /* VK-ios-sdk-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 1990ACCF3924B1C99C0FAD54EA7F1758 /* VK-ios-sdk-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4BA75222986126911EE5398E7BAD01E1 /* VKApiGroups.h in Headers */ = {isa = PBXBuildFile; fileRef = 6CF2E2D629635BB108F6A236B7849418 /* VKApiGroups.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4BB3EA4A10F948E503AFAA8B5BC8227D /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 07DD635AB9224364E57D5D6CAF1DF7A3 /* AFHTTPRequestOperation.m */; }; + 4CB3BB8C12F9699CDCEE67D827A2E1AA /* VKResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = C00988E439ECF4667BDDCBD763CEB904 /* VKResponse.m */; }; + 4DDCDDA916DC12F251967A2D87A6CEE6 /* VKApiConst.m in Sources */ = {isa = PBXBuildFile; fileRef = 86976E27BD165F3C7B342E6A986AEDA1 /* VKApiConst.m */; }; + 4E0E0D6B04E41AAB0423E577640AE062 /* VKImageParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 97288B95F2FC00961F0D65C9558ABE4B /* VKImageParameters.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 51BD968A5272425BC34B023B25BCC3B6 /* FSE+UITableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 353897333CD0412EF9EBD393329F0051 /* FSE+UITableView.swift */; }; + 51E7FDECF9BE53640620B46BE32EA986 /* VKApiObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 44858C7287493E1D723EF1AE5A3F5EFA /* VKApiObject.m */; }; + 526D61E71F5185ECCEF516EA9E097C02 /* Pods-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = D5BA710D01BB6EBDDEF0A43633BB9D4A /* Pods-dummy.m */; }; + 530F7C0FBD424EDBD70D7A1C238BFD85 /* VKLikes.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EC0045F455522FB630A330CC16F0B0 /* VKLikes.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 531E011974C43CA8B6E8DE8A84B40CB7 /* NSPersistentStore+MagicalRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBD642E3D7F950433A9CBD96248BE8C /* NSPersistentStore+MagicalRecord.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 543581C47C14270C7A0313F85941E342 /* VKGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = B938627014C49CF76D42D14851BC19E7 /* VKGroup.m */; }; + 55C3344C29A6E2E90CA88EC064C8CB77 /* VKCounters.h in Headers */ = {isa = PBXBuildFile; fileRef = C7A55CB44610D9B29974F40B0E131DE9 /* VKCounters.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 565DBB9129441D06C3D401E5DF8F1456 /* NSRelationshipDescription+MagicalDataImport.m in Sources */ = {isa = PBXBuildFile; fileRef = B27DAA512A10DFABCEF0678F52DCE2A4 /* NSRelationshipDescription+MagicalDataImport.m */; }; + 59F1576E4873715F0A40C1DEA3A9619E /* AFURLResponseSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 702BC3157376FB0268BEC87FC021438D /* AFURLResponseSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5B00374D3D3B0137797495E6204268A2 /* MagicalRecord+Actions.h in Headers */ = {isa = PBXBuildFile; fileRef = E58F3E4E6691BE619DCFCE43A2BEE137 /* MagicalRecord+Actions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5B4CB552A92D0FA5AAA345D21262A249 /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = A220D00E4C7BA313322B421B988F84CD /* UIImageView+AFNetworking.m */; }; + 5BD26E2BA7F25DA8DC57CB5ECBBBA635 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 024F32113F833BE193E18688BB520561 /* QuartzCore.framework */; }; + 5C4917B074EAEBC84917CDB90E19C909 /* VKActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = 9555233A671A36E40E7E3EE8044DD46E /* VKActivity.m */; }; + 5CEC0BCD13065D2F4C7CA64103407AFD /* UIAlertView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = BF072250768A53474C1EF3BB0DC63596 /* UIAlertView+AFNetworking.m */; }; + 5D012A226951EE3B34E87C3AEEE62B84 /* VKApiModels.h in Headers */ = {isa = PBXBuildFile; fileRef = AE2F51DE19DC96E9FCB5B38DD7172E31 /* VKApiModels.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5D7129CD978AD8AD8CC0CC2A9A6332E0 /* AFHTTPSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 27041EABC6F7592A703D536BBB56BB05 /* AFHTTPSessionManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5E1ABFE8E8856793F0A110DFD1B2748D /* VKCaptchaViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 564CF30076E634FCCC579752545C9DAA /* VKCaptchaViewController.m */; }; + 5E295E5AC9A5373F6B94863F7AB6D056 /* UIRefreshControl+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D49465E8799A20F9FB58E2983FE5BD6 /* UIRefreshControl+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5E8285AEE2CD73AF0A10DC48E0C7FDC0 /* VKSharedTransitioningObject.h in Headers */ = {isa = PBXBuildFile; fileRef = C910310A32D0ED59B59559C9F21B15E0 /* VKSharedTransitioningObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 649B602896140C8B7377E9FF0E63C136 /* FSE+UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05143787791B36F06250AC233BD278E3 /* FSE+UIColor.swift */; }; + 6508C3C9DDE78837D9D6DCD85BAB137E /* SDWebImage-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 7437F398A1CC077AC02CDF999E825EC4 /* SDWebImage-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 65F01CF0C6589727E00A8B73ED1C2110 /* FSE+NSDate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A7B49A45A67051CA0B6F0B0ABF7501E /* FSE+NSDate.swift */; }; + 686BC6937CAE77DD805397717F6EBC52 /* VKApiObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 196E6689A6F4B757F170219EBDCF78CB /* VKApiObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 68A9CCF311B01C961886D3A20BC3D14B /* NSPersistentStoreCoordinator+MagicalRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 55FBAC7AC5DE48744285348417CDEAD0 /* NSPersistentStoreCoordinator+MagicalRecord.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 690EE3683EBD80520773E3E93AFC8CCF /* UIButton+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D75CD4CAEF7CBC075888BCB23B79CD9 /* UIButton+WebCache.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 691136C99817A113C3694D0219D67778 /* VKPermissions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5599F6DC588A808FCD9017200AB11B96 /* VKPermissions.m */; }; + 69B5FD3EF01FFA1DE9D9AE13A1BA139C /* NSManagedObject+MagicalRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DDB8DDB27F1AAF709108B98003FB40B /* NSManagedObject+MagicalRecord.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 69C9ACB276130464A6691C40C9B5C53A /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 276ADBBA17F9E4DCB540724799C0446C /* CoreData.framework */; }; + 6AE317CD5B9E434DCC636BCF7C6E28F4 /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 562D0D3624D662E4E7C8BA29C4EEE4CE /* AFNetworkActivityIndicatorManager.m */; }; + 6D96A2EC3B206F63D2764478B0201144 /* MagicalImportFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 73804EA4D2DA84A49E56BE25CED0323A /* MagicalImportFunctions.m */; }; + 6DB953C6CA6DC5CC8110F46CC4002A7B /* VKAuthorizeController.h in Headers */ = {isa = PBXBuildFile; fileRef = 23A2D6BE699365B86659F8E05A933B6A /* VKAuthorizeController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6E66BFF397CE9B15F7C91FC8E630AD51 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 340BD3CB8A2BE41C34DE26C9CC80DE47 /* UIKit.framework */; }; + 6EE083F00175248938B7EC22919C1550 /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B0416C08408E29B03DDCFA714FE34E19 /* AFURLSessionManager.m */; }; + 6FED892127561AFCEC7D866B4C73ECAD /* MagicalRecord-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = CEE39FC9BB7F88F270149DB2E908D3E5 /* MagicalRecord-dummy.m */; }; + 716058EEB86C24CD2A9963D325FFB11A /* NSObject+MagicalDataImport.h in Headers */ = {isa = PBXBuildFile; fileRef = 50475C7CD24F20E1425B3A9C72AFD07D /* NSObject+MagicalDataImport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7274F17440CDF2D7E148E1D04ACC9020 /* VKRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = CA33B926AB37395B9BEC530D8E9AE272 /* VKRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 727E87F437DDC37EBE96D60AD20F05C3 /* SDImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 7021DAA1F6E8B3FA1EB7412C60B54114 /* SDImageCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 72FE3BAC7F96ED2E6BEF36B24AC5ACA3 /* FSE+Double.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1756FDEE6E67D7E4B9AA78F6408BC1B9 /* FSE+Double.swift */; }; + 739888A46EADAA177440476AFF0ACB76 /* UIImage+GIF.h in Headers */ = {isa = PBXBuildFile; fileRef = 7906A59A87CDC17F4590661BC15FAEDE /* UIImage+GIF.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 76FBF00F0B08B995DB26A240D43DAA44 /* VKHTTPOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 4317A7710AFAE0CC86B660DB7C870CE6 /* VKHTTPOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 793162BACBE26965AF9EA9EE39950C98 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9382A6D4252264618D0117AC1069D871 /* Foundation.framework */; }; + 7C17A82751B5633249468B4477E8E8E6 /* VKAuthorizationResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EFDAC1D97EE837FF51769795753FC16 /* VKAuthorizationResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7D7DAB989FB25A2C6CF69600378BC8C0 /* UIProgressView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C7D2B4FE55CDDA037B5C54654B21435 /* UIProgressView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7E4F46EEE9D054638F315BAFFACB44A3 /* NSData+MD5.m in Sources */ = {isa = PBXBuildFile; fileRef = 779DE10C9A4A8A499174EDDE1D02A10F /* NSData+MD5.m */; }; + 7F51237FF442AAC50B32A4FBD0C9636B /* SDWebImageCompat.h in Headers */ = {isa = PBXBuildFile; fileRef = 18D4BC474880B3402BA99167AC7A685E /* SDWebImageCompat.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7F8A95AD5E4F13DBDB4B937F20CBAD5F /* VKCaptchaView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6987AB30586313BB2269917FB3B4F77A /* VKCaptchaView.m */; }; + 813F360497C515D67049CA30039E867E /* NSManagedObjectContext+MagicalChainSave.m in Sources */ = {isa = PBXBuildFile; fileRef = A6B9859FA047ED846B8D304492980F79 /* NSManagedObjectContext+MagicalChainSave.m */; }; + 8143F69FF926253FCE2FB2D02B00D311 /* VKSdk.h in Headers */ = {isa = PBXBuildFile; fileRef = 84AB0E9DCC09E3D794D0FAEA0567CCA5 /* VKSdk.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 824EB2574FD207D57FCC6791BD48C254 /* AFHTTPRequestOperationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C89FE439B45BA1FBB5F0C647C83165A /* AFHTTPRequestOperationManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 87208C5DECF2F5602D2F32961A9404B1 /* VKUploadMessagesPhotoRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = E1F16DFBBC4E0B4FB2F5A384ED98DC86 /* VKUploadMessagesPhotoRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 884AFB443EFD7C014FBED9430619FC97 /* NSString+MD5.h in Headers */ = {isa = PBXBuildFile; fileRef = C87604CB83F40A9FEB4B67E3300DB637 /* NSString+MD5.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 885DCB857BED64366CD0414FFEC57918 /* UIImageView+HighlightedWebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = BB02D51418CB121D9E19F8DAF776F0AE /* UIImageView+HighlightedWebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8A781A5D6624ED6B977B31642AF0852D /* VKCounters.m in Sources */ = {isa = PBXBuildFile; fileRef = C4BE6AD8967794699E865B596788A531 /* VKCounters.m */; }; + 8AE17AD5A3C6FDE46C108C35226ACABB /* NSManagedObjectContext+MagicalThreading.h in Headers */ = {isa = PBXBuildFile; fileRef = 3540AFC3A5D699A88836931375CCF0F9 /* NSManagedObjectContext+MagicalThreading.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8B8184EF4F4ABF5210B583C96B6716AF /* UIImageView+HighlightedWebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 2122B6330470088D37076DC3BADABF94 /* UIImageView+HighlightedWebCache.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 8C232DE5F46B6DC68267392CCB3FBEA9 /* MagicalRecordInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 75C4B7459DEA2D6EEFF43A4D67C3DD15 /* MagicalRecordInternal.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8D9D417B4BFE628DB1C84B4EE7CC7B11 /* VKPhoto.m in Sources */ = {isa = PBXBuildFile; fileRef = 177EC1BB77D2DAB1201231A666537B8B /* VKPhoto.m */; }; + 903F758794754A0F61FF598A9357C1B3 /* SDWebImageDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8DA2D632EB92BA82DDB7549CD6705F /* SDWebImageDecoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 91BB10A7B88405FD2907FC2F2E18B6EE /* FSHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = F390DE53862AAEDB25A25C7D84558D4E /* FSHelpers.swift */; }; + 921F9023DEE0379E9CBF31386853299B /* NSPersistentStore+MagicalRecord.m in Sources */ = {isa = PBXBuildFile; fileRef = 92707F37C1AAF1F4D479033121742721 /* NSPersistentStore+MagicalRecord.m */; }; + 928196C4C1432FE1205B508ECF45ABA8 /* VKApiObjectArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 58519F4464A415FDB77C43679ADDC5EB /* VKApiObjectArray.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 928FDDA96F2801C07BE65C799716D9EE /* NSManagedObjectModel+MagicalRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = D81B4D934F747FFB5962D4D031300360 /* NSManagedObjectModel+MagicalRecord.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 934129414B2163444A969524DACDC6DE /* VKApiFriends.m in Sources */ = {isa = PBXBuildFile; fileRef = 11F4BBC36F01076DE0125A7707244132 /* VKApiFriends.m */; }; + 9366222323F3EE9D1222B3F53777EF0E /* VKSdk.m in Sources */ = {isa = PBXBuildFile; fileRef = 5FBD7FC333FCC7B876A3EB45B8FEB494 /* VKSdk.m */; }; + 93A6F43226C91DD31F1F3B7B1C92B17A /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = B23BDDA81ADC14D5D854DE2C8C1A1159 /* AFSecurityPolicy.m */; }; + 94BECC51E7D09D3D9698BAB28ED55EB9 /* VKRequestsScheduler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D51DFA85D32A5F7E04A162873003CDC /* VKRequestsScheduler.m */; }; + 94CC77C4067608AF0C0B18986B7F0D36 /* VKApiConst.h in Headers */ = {isa = PBXBuildFile; fileRef = A231CEA8817539A26296B2D2F4BD6AAF /* VKApiConst.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 96DC46A526627958F3C1D8A942626A7A /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9640DF6D71F0034FCADEE93C7E5EEF48 /* AFNetworkReachabilityManager.m */; }; + 975ED8F9AAB206ED75BB64832F1558EA /* VKActivity.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B5B86907EE3F926E3CE02994FBB6585 /* VKActivity.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9A25806DDAAAD63507BA23ED30FFF2E5 /* NSError+VKError.m in Sources */ = {isa = PBXBuildFile; fileRef = 76CF9EFAAFAD412D3B7A4D01FAE498AF /* NSError+VKError.m */; }; + 9B10E1B4ED5EF579C65C6739F8AF1B08 /* UIButton+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = FB81569AFFDB541951BFB2AC2FB70E39 /* UIButton+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9CBAB9E9A4754D3E62A001899B91DBF3 /* VK-ios-sdk-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7654753CC884AD462EBB4AC18C0B3016 /* VK-ios-sdk-dummy.m */; }; + 9EDCAEE5BEAA20A79815F5AEC95DBDE5 /* VKPhotoSize.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E54353C3EBAC025363D96EF997ED45B /* VKPhotoSize.m */; }; + 9FC2D648F6D1B8574DB4D08C5EB97B47 /* AFURLSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E21A3484B1F47EDC88D31E3B905D0B23 /* AFURLSessionManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A1CDBC9E34923C72D92CD2700D84B2B3 /* VKHTTPClient.h in Headers */ = {isa = PBXBuildFile; fileRef = F984E542865506C58B1E77ACBFE9E0E6 /* VKHTTPClient.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A28A9AE59E8E6FA7D4652D8D10852149 /* MagicalImportFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 66BFA812DB5E5154EFB3CF07E7D8795E /* MagicalImportFunctions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A352E8339852C84EAB38A9D423C988A6 /* FSE+Dictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CFF5C2FAD320FD2DF75D15645B265B0 /* FSE+Dictionary.swift */; }; + A39AA3BE388CDBE99AA1F144F1BD47EB /* SDWebImagePrefetcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C423ECDFC9231709691A801ED8B6BFC /* SDWebImagePrefetcher.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A39CD90B1902A8F482A0229B6535E38F /* MagicalRecord+iCloud.h in Headers */ = {isa = PBXBuildFile; fileRef = 021B260C85CD33E9F51CFD2E698A573F /* MagicalRecord+iCloud.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A4CB3550A0219B0E645492FBA2436924 /* UIButton+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 205D879035D467AA2198F6EF9D08634B /* UIButton+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A646AB1DC187BDFA7B614CBD2CC2C329 /* NSRelationshipDescription+MagicalDataImport.h in Headers */ = {isa = PBXBuildFile; fileRef = CB8CC73E1198A10582D126E0D3CB2503 /* NSRelationshipDescription+MagicalDataImport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A95E3CF2E6AFFD0EBA0F9243EBE0D277 /* VKApi.h in Headers */ = {isa = PBXBuildFile; fileRef = E679ADB4FBDBEB80F3AA11349702F4D9 /* VKApi.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AB34A7628A42D1ADFB3355D32D51634E /* UIKit+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 03A638278DABD02F40DD183172678CA8 /* UIKit+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + ABA6B8433FA3CA74EF08E212229D2A58 /* VKUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 348A49004B6EA4F1027C8FD084ADFA7B /* VKUser.m */; }; + AC8D580DF124A0A2D7FB8A67EC0B1F92 /* NSString+MagicalDataImport.h in Headers */ = {isa = PBXBuildFile; fileRef = 908EE49484B48FC7B52931CBFEC9C7BB /* NSString+MagicalDataImport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AD72B2C4E443C10DD957DA990D9DB081 /* UIView+WebCacheOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 065083D54FC242BDA7574B4D7BC2E897 /* UIView+WebCacheOperation.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + AE19B3A9E02F03A2E40B3AD7F7CF84E5 /* VKUploadWallPhotoRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CD069AC9B919E6E461FF35C9F670E79 /* VKUploadWallPhotoRequest.m */; }; + AE38374980FF6F5F9EE64B1690FEF0F5 /* NSData+ImageContentType.m in Sources */ = {isa = PBXBuildFile; fileRef = E634F356DDD8925726CA969E9430C39E /* NSData+ImageContentType.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + AFAE43E7F4E2F2700AD8EAA5377808C7 /* MagicalRecord-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = E7464829F96F2BD8D09B54ADDE8A4C3D /* MagicalRecord-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B0B634E8BD7AC19DFA5960880A0E87E2 /* VKUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = A216F8AEE8959BE4E735E6F02B701EF7 /* VKUtil.m */; }; + B1CC5A46B4698303B786930309C9030F /* VKApi.m in Sources */ = {isa = PBXBuildFile; fileRef = E715973AAC07D4D834E95853F1337BA7 /* VKApi.m */; }; + B26BE8070598230F5A42D38F258CD3BB /* VKRequestsScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A21AF1D89CC90E935D8A3991A9E3A72 /* VKRequestsScheduler.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B33913C94574BECF1431FD5DA4FF6514 /* UIProgressView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = BA0CC9FA3EFC9E4572D5B7B8AD895BC8 /* UIProgressView+AFNetworking.m */; }; + B4F653D1F700ACD5AD121559579229D1 /* MagicalRecord+Options.h in Headers */ = {isa = PBXBuildFile; fileRef = E73C072418D998D16612089AFC06EE9A /* MagicalRecord+Options.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B5F70217D81ED63572FA748AE5092196 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 340BD3CB8A2BE41C34DE26C9CC80DE47 /* UIKit.framework */; }; + B6958FDC33BF5532BC3F4587F7049A83 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EA632290B8EF3684394F5F39ABCA1C3 /* MobileCoreServices.framework */; }; + B69889803343F92117ADE09364C700D6 /* SDWebImageDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 26A1F0BA8D91107A9EE96BC09E6233BB /* SDWebImageDownloader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B74543C1D34E87B0029C19DE296E2D6C /* OrderedDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = DC8927ECF814C9D733A6000CC266D98D /* OrderedDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B780B3B83CEE9600960816C8531B6445 /* FSHelpers+Swift-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 94231952C87A753A2D0D590D4FA8020D /* FSHelpers+Swift-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B8E051AE222124F3922022CD3BDD7C38 /* NSEntityDescription+MagicalDataImport.m in Sources */ = {isa = PBXBuildFile; fileRef = 71B7796ADD8E9B0904A711B4F256D588 /* NSEntityDescription+MagicalDataImport.m */; }; + B98978495A4E311729BD4DC109A4BEAE /* VKGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 8774EBE251A6062672F836437A9BECBE /* VKGroup.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B99DD521195BB3CB12ECAA6939D3006F /* VKBatchRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F9BDBAC13AE9B9F5F78AE982ED91DD9 /* VKBatchRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B9E1D0853B60953A8DBDAB545EF85446 /* MagicalRecordLogging.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D3CDBDBE6816CBCFA6B3FB18413BD40 /* MagicalRecordLogging.h */; settings = {ATTRIBUTES = (Public, ); }; }; + BB03009E1FD1B7C12EECC1EE9D3D2F0E /* OrderedDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F91E005A76666D524594EB663D92AAD /* OrderedDictionary.m */; }; + BB95485AEEC37D04AA87C2799DAAD40F /* MagicalRecordDeprecationMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = EAC70F09CB2ACF1251DBFF161F0B59B3 /* MagicalRecordDeprecationMacros.h */; settings = {ATTRIBUTES = (Public, ); }; }; + BBD744EC671D101750F37A46AC71621A /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24F010A013E6DF829F2DE6B7A5F950B7 /* Security.framework */; }; + BC9687C602078FA8B1A7761E9E263625 /* VKUploadPhotoRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = A92D377E1EDEC295C9DDE1D075F1F23A /* VKUploadPhotoRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C03955BC3E8FAD8323F6A54AECFCFF85 /* UIView+WebCacheOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 66EE9B37C706FC0BD90E4E8DC68D7A04 /* UIView+WebCacheOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0D57C25AD592CA7301C1F6B1105A6AA /* NSAttributeDescription+MagicalDataImport.h in Headers */ = {isa = PBXBuildFile; fileRef = 276ADBB44B87DE827C19BE46C360492B /* NSAttributeDescription+MagicalDataImport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C17F389C1A633E6AC888527FFCC9E637 /* VKUploadPhotoBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 2865B833A6897CFCC8EFC3661E0E1EEC /* VKUploadPhotoBase.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C1F35A8F2C9F043CD2793B591BB8EA48 /* NSManagedObject+MagicalFinders.m in Sources */ = {isa = PBXBuildFile; fileRef = 45285D5AF9062E3890E13A50BB90F0D1 /* NSManagedObject+MagicalFinders.m */; }; + C25A453B10F3723738200716FEC2E760 /* NSManagedObject+MagicalDataImport.h in Headers */ = {isa = PBXBuildFile; fileRef = 21D838F2F6FC5278BEBDCA31A243548C /* NSManagedObject+MagicalDataImport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C316F34E25BD5B0453C6B11DA191EBBA /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DBB46DD6C992B3267367B881AC91DA8E /* AFHTTPSessionManager.m */; }; + C4A596775FE729E13A119CAD3210A99C /* AFNetworkActivityIndicatorManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C8B2E7BE789074D66EBCCF073F9FD5A /* AFNetworkActivityIndicatorManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C56486FF84F427973FCD9996FF0DEA29 /* VKJSONOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = D268E4471AB40C20AB047E3A47C21F2A /* VKJSONOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C57A1382EEE1D962C0E916D70CC4B4A3 /* UIImage+GIF.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D57D628A47C93125F07743858E5D415 /* UIImage+GIF.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + C57FFEC01297CAAF01AD798435A0BFE0 /* MagicalRecord+ErrorHandling.m in Sources */ = {isa = PBXBuildFile; fileRef = D08AA138BC564F682ECC44AAE2412732 /* MagicalRecord+ErrorHandling.m */; }; + C64E5F365334C60BB93FD1CAEDDD0789 /* VKApiPhotos.m in Sources */ = {isa = PBXBuildFile; fileRef = CF74D4ECE219BE56F99727BE008F71FB /* VKApiPhotos.m */; }; + C699AE47EBA2933B22A729D92D682E2B /* VKShareDialogController.m in Sources */ = {isa = PBXBuildFile; fileRef = DB81530E5BB2EF77B71B7FC4A9CAFBF7 /* VKShareDialogController.m */; }; + C866BB6CC70FAC30F2134082E013CE85 /* SDWebImageManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 622D08F534CCE61B627C0729A09F5846 /* SDWebImageManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA1FC0E3273FF68DA837600721ECB68A /* NSManagedObjectModel+MagicalRecord.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F75181C63355B96D183E17CFB891FE1 /* NSManagedObjectModel+MagicalRecord.m */; }; + CB49CB8BEE386B1C25BE3647964CFDC2 /* Pods-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E7F51FF48AFE1F7ED8AF687F671BCA7 /* Pods-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CFABF6FC21B980B79BBF8D7CD1F6DFC7 /* AFURLRequestSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = D619D15871F376F659C33F4BEE3C97DB /* AFURLRequestSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D50687DA23F3324D2A93D4FBBE39F9AC /* VKAccessToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 40AAAC1D45C7C5A1A593AC0F38FFEAC6 /* VKAccessToken.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D6233ECA1C5E895C190B73E0D1E6BBE6 /* FSE+String.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1A477B1CAA3F662661AF4CAA294B929 /* FSE+String.swift */; }; + D634812764DC6B8FB2934FDF1CE55832 /* VKUploadImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EC51BCB6B6747C7069E7E3D5E8B9AFD /* VKUploadImage.m */; }; + D69381C1E4968044DEE025F78796A99D /* VKRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 353C83543447A278865B8B055AD298CF /* VKRequest.m */; }; + D6B45F9539F3BC48E91141911944665E /* MagicalRecord+ErrorHandling.h in Headers */ = {isa = PBXBuildFile; fileRef = E806F223B053F32E9FF52AAAF02F3123 /* MagicalRecord+ErrorHandling.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D7CB2530A9C0EF56F0A418EAAD4EF03C /* SDWebImageOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 6967B6FF132F86ACFB91804B95FE983B /* SDWebImageOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D9EB7EC69DF284A9C49808A1F905AF51 /* VKUploadPhotoRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 145C118B68A9BA8D6DB7826662101DFF /* VKUploadPhotoRequest.m */; }; + DAB06B0360990CF26615990E3E5ADA03 /* MagicalRecordShorthandMethodAliases.h in Headers */ = {isa = PBXBuildFile; fileRef = 239647F3E13A2BC210ADF981DAD3E977 /* MagicalRecordShorthandMethodAliases.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DB52E3ED7904BA42F3D27F55E11345E0 /* NSManagedObject+MagicalRequests.m in Sources */ = {isa = PBXBuildFile; fileRef = B5F92D02054F19E30C96ACE0CA7215D3 /* NSManagedObject+MagicalRequests.m */; }; + DC93D2FAE6250473CB5F7EAA09A7630E /* VKApiWall.m in Sources */ = {isa = PBXBuildFile; fileRef = 87ABED29D2258B4A3F424A4F53A744B9 /* VKApiWall.m */; }; + DD101F3C4125C3E6CDFDA152766ECF35 /* VKApiBase.m in Sources */ = {isa = PBXBuildFile; fileRef = A045F04DF84167F1B7C32D0E6B6BDE2F /* VKApiBase.m */; }; + DD6A1406132A84669A2756D6DDB374E7 /* VKUploadMessagesPhotoRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 536A02766B462B81BCFE92C29A8BA30B /* VKUploadMessagesPhotoRequest.m */; }; + DE298DEEB7932CE31AD87997CC48CB4C /* NSManagedObject+MagicalAggregation.h in Headers */ = {isa = PBXBuildFile; fileRef = 38F262C37CEC9568FF62D55EBF95BDFA /* NSManagedObject+MagicalAggregation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DE5DC73991DD7B19405BDD007DEAC7EF /* VKSharedTransitioningObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E9422AFC3F0DB77C426E754AC90F456 /* VKSharedTransitioningObject.m */; }; + DEA962343EB32A47A8B0383D136E4F8E /* FSE+UITextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF320B7C9C606E3414D84AFB606139E8 /* FSE+UITextView.swift */; }; + DFFF5D143FE089AEA49571FCB9416C1A /* VKUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = F7D14E6A24B899350C6387E356CB44D8 /* VKUtil.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E333313B64A195D32B209A6727BD8E2B /* VKUniversity.h in Headers */ = {isa = PBXBuildFile; fileRef = 80D325CCEF8CD17D42AA4AD99213886F /* VKUniversity.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E3C40B2130B9F1624FCA313A0EDBD319 /* VKRelative.m in Sources */ = {isa = PBXBuildFile; fileRef = 0ED28E6B3A0397E045E8E7DAC4FE7E4A /* VKRelative.m */; }; + E4FF1388561CEA6536DD601C59E0E2D8 /* NSManagedObjectContext+MagicalSaves.m in Sources */ = {isa = PBXBuildFile; fileRef = 1713DDDF036127FC7C2FC1FD4214C4AE /* NSManagedObjectContext+MagicalSaves.m */; }; + E545A82A0403185DE1149929FF57E5AF /* UIAlertView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = D7EFA1C924C18B4342EA91248D504287 /* UIAlertView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E5AFD667735FBACB059D7053A4A97B40 /* VKApiCaptcha.m in Sources */ = {isa = PBXBuildFile; fileRef = 82B71B918221056176D13B0874C14659 /* VKApiCaptcha.m */; }; + E6BD5D77A9883F4A5E0713FE3A5306DF /* VKJSONOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A4A26FC9F99D7F74CD7B5FBE7F06811 /* VKJSONOperation.m */; }; + E7480BF3024B8455144C52DEE9828089 /* VKObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 98A671C004441854D40433A5581774A0 /* VKObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E77D53BE66AAB24ADDF385997041C6BF /* UIWebView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 45B3C92C6740A6769F005B08144F0398 /* UIWebView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E86F1CB1FA3EFA9D0002ED8836615DD2 /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 7377F8316B50BE0E397171CDFA25BE6F /* AFURLConnectionOperation.m */; }; + EA35017FFC45ACF8DB07ECA7273A7814 /* MagicalRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 60BC7F4F0DDAE89117B825BE7A17FA71 /* MagicalRecord.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EAF7D8A4E92BFF9F3EA255FDA02EAF8A /* UIWebView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 96DA87697DF0D7DB55D1BBC8AE70968A /* UIWebView+AFNetworking.m */; }; + EC7F8A7755FB1581432601C143CB119F /* FSE+UIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606EA07A1D27C1ADBD6A6890C804B1CD /* FSE+UIView.swift */; }; + EDDB85EA0EDA4790B149F57EC96C7617 /* NSString+MD5.m in Sources */ = {isa = PBXBuildFile; fileRef = EB77563B3EA88410F9C7A11B82E1FDFD /* NSString+MD5.m */; }; + EDEAD33A07F51A8FFA6B200F400ACE82 /* UIActivityIndicatorView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE5F4139E042A97EA8F204D49E3422B /* UIActivityIndicatorView+AFNetworking.m */; }; + EF342A50B60D99AC3B6105F596B5DEF7 /* VKAudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BB04C60CAA512D268AA040E1C21A56D /* VKAudio.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EFBFA8B3FF8A5422A8C167963A573A7E /* VKUploadImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 742AA69B682B55F8F1C37266E586433F /* VKUploadImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F080F5FF04BCE148EF695C74977530CA /* NSManagedObject+MagicalRequests.h in Headers */ = {isa = PBXBuildFile; fileRef = E00669A5EF5C331CE610BA3E2DD6B653 /* NSManagedObject+MagicalRequests.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F1033AD1301FB934D5A283063724E96F /* UIImageView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 44D9B337ADF3E0E8CB0829C7645476C3 /* UIImageView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F1BD31D300A89AF93664D31CE3238374 /* VKAuthorizationResult.m in Sources */ = {isa = PBXBuildFile; fileRef = A966E58D01E476E7253A32BD1D0CB47C /* VKAuthorizationResult.m */; }; + F1F8D1CD51E348CBDA66CE9FF0F75B52 /* NSObject+MagicalDataImport.m in Sources */ = {isa = PBXBuildFile; fileRef = F2C8076A4367F432B4869457710D3886 /* NSObject+MagicalDataImport.m */; }; + F3086DFFAA5BBA34A0A5AA264BCD64A5 /* NSManagedObject+MagicalAggregation.m in Sources */ = {isa = PBXBuildFile; fileRef = 269A6D876B29D5CC469298E172E2612F /* NSManagedObject+MagicalAggregation.m */; }; + F31306D57FCFFFBDC8E91FBCFF481DDA /* VKHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F88CB1239B3702B4D4AC78CF47EFF61D /* VKHTTPClient.m */; }; + F33391FC1B0FDB33D085F6FD1079C792 /* VKSdkVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = 899C3A681FE9B2A2C39987C81AFA6585 /* VKSdkVersion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F3983E43D3CA1C2EFB3BF3C8E2A9DE59 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9382A6D4252264618D0117AC1069D871 /* Foundation.framework */; }; + F4A4C372BA33C448EC27FDE4C51622DA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9382A6D4252264618D0117AC1069D871 /* Foundation.framework */; }; + F675AB96665109835EF9EFF4E538EDD3 /* VKAccessToken.m in Sources */ = {isa = PBXBuildFile; fileRef = 5622F43F2DEAC905D9A9809BF3A84535 /* VKAccessToken.m */; }; + F6ACAD8A1BEB1E1797344EA5084461F5 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C90A3CC926EA128D80EA3EC24BE2FCAE /* ImageIO.framework */; }; + F7B7200B1DD5F3AA6EF4FB8A7E4D5675 /* NSNumber+MagicalDataImport.m in Sources */ = {isa = PBXBuildFile; fileRef = CD05DB70C9B8F6BD2FAC00BF14E94FB6 /* NSNumber+MagicalDataImport.m */; }; + F83326DEEC9CD488904E548568458CF3 /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580A6DBE586D529E2DAA87209AB2568 /* AFURLRequestSerialization.m */; }; + F88C0E6DE5AC49863509F37F75FCAA7B /* VKBundle.h in Headers */ = {isa = PBXBuildFile; fileRef = EF6AE872855248E99675CECAFB15EC18 /* VKBundle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F91242ED504E8C3E87D16D0753D0F38D /* NSNumber+MagicalDataImport.h in Headers */ = {isa = PBXBuildFile; fileRef = DB57EE1252EA7EF343F7CE5C96716D9D /* NSNumber+MagicalDataImport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F98BB0EAA67E75D5E7D1C1C00DEAF1B5 /* SDImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 475EA7D9690CE8790F837C4F19BF791C /* SDImageCache.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + F9D5BDB5A9863478100780CCF5CECE90 /* NSManagedObjectContext+MagicalSaves.h in Headers */ = {isa = PBXBuildFile; fileRef = 7562C14FFFE011449825B46B66D47757 /* NSManagedObjectContext+MagicalSaves.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FCBDA0BC8866EAA9CE5DBE734E922861 /* AFNetworking-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 07045992E333B7A71663CC5E90D70520 /* AFNetworking-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FED654D996F54BAA458DC0A4E86EBA11 /* NSManagedObjectContext+MagicalRecord.m in Sources */ = {isa = PBXBuildFile; fileRef = 98A4B2D1F357388334F68514235C513A /* NSManagedObjectContext+MagicalRecord.m */; }; + FEED8A5A1CD3155F407ACA912C239A9A /* NSManagedObjectContext+MagicalChainSave.h in Headers */ = {isa = PBXBuildFile; fileRef = AF387099925E95E2BF3D3EE21484DB20 /* NSManagedObjectContext+MagicalChainSave.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FEF32063C461B20B65DB2A06A30BB6F7 /* MagicalRecord+Actions.m in Sources */ = {isa = PBXBuildFile; fileRef = 344569E9480EF3DA39180B0837A25DE3 /* MagicalRecord+Actions.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 08E3E8B9DF50C9147AAD52271DFBE54A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = F57A84A12251464F3567966CEB83EDDB; + remoteInfo = "FSHelpers+Swift"; + }; + B86323599AD4C6E402085A144CE4AF00 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3E8869F00367E6AD1554FDEEDFFBE3C6; + remoteInfo = "VK-ios-sdk"; + }; + E877DA4D5796871C3618733CF92738ED /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = A5DFC851CDF2FAEED678C23407C6E244; + remoteInfo = AFNetworking; + }; + FA423A3E9C9DD634833D8D03610A553F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = AD47E339A26F876F910CD9E671989350; + remoteInfo = MagicalRecord; + }; + FCC97D138D1C9211D59EF1F38C48EB00 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = BD3098D90737863716274F3FB21D34B4; + remoteInfo = SDWebImage; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 01A016E4FE63BD78BEA028978C3CB316 /* Pods-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-acknowledgements.plist"; sourceTree = ""; }; + 021B260C85CD33E9F51CFD2E698A573F /* MagicalRecord+iCloud.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "MagicalRecord+iCloud.h"; path = "MagicalRecord/Core/MagicalRecord+iCloud.h"; sourceTree = ""; }; + 024F32113F833BE193E18688BB520561 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + 03A638278DABD02F40DD183172678CA8 /* UIKit+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIKit+AFNetworking.h"; path = "UIKit+AFNetworking/UIKit+AFNetworking.h"; sourceTree = ""; }; + 05143787791B36F06250AC233BD278E3 /* FSE+UIColor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "FSE+UIColor.swift"; path = "Swift/Helpers/FSExtensions/FSE+UIColor.swift"; sourceTree = ""; }; + 065083D54FC242BDA7574B4D7BC2E897 /* UIView+WebCacheOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+WebCacheOperation.m"; path = "SDWebImage/UIView+WebCacheOperation.m"; sourceTree = ""; }; + 07045992E333B7A71663CC5E90D70520 /* AFNetworking-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AFNetworking-umbrella.h"; sourceTree = ""; }; + 07DD635AB9224364E57D5D6CAF1DF7A3 /* AFHTTPRequestOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFHTTPRequestOperation.m; path = AFNetworking/AFHTTPRequestOperation.m; sourceTree = ""; }; + 07E8544B9142CED3FF56851C10242F34 /* NSError+VKError.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSError+VKError.h"; path = "library/Source/Core/NSError+VKError.h"; sourceTree = ""; }; + 0A6286DABBA17F5AD91FCF2B014C2B0B /* NSManagedObject+MagicalDataImport.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSManagedObject+MagicalDataImport.m"; path = "MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.m"; sourceTree = ""; }; + 0AA3598C34A918456A19C1F85125D1CE /* SDWebImageCompat.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageCompat.m; path = SDWebImage/SDWebImageCompat.m; sourceTree = ""; }; + 0B83FB9FA4E8E7A8E3A59CDC0D1EF6EB /* AFURLResponseSerialization.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLResponseSerialization.m; path = AFNetworking/AFURLResponseSerialization.m; sourceTree = ""; }; + 0BB04C60CAA512D268AA040E1C21A56D /* VKAudio.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKAudio.h; path = library/Source/API/models/VKAudio.h; sourceTree = ""; }; + 0C7D2B4FE55CDDA037B5C54654B21435 /* UIProgressView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIProgressView+AFNetworking.h"; path = "UIKit+AFNetworking/UIProgressView+AFNetworking.h"; sourceTree = ""; }; + 0CD069AC9B919E6E461FF35C9F670E79 /* VKUploadWallPhotoRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKUploadWallPhotoRequest.m; path = library/Source/API/upload/VKUploadWallPhotoRequest.m; sourceTree = ""; }; + 0D49465E8799A20F9FB58E2983FE5BD6 /* UIRefreshControl+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIRefreshControl+AFNetworking.h"; path = "UIKit+AFNetworking/UIRefreshControl+AFNetworking.h"; sourceTree = ""; }; + 0DF67F310A21B2589AEFF2786401A46B /* AFNetworking.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AFNetworking.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 0ED28E6B3A0397E045E8E7DAC4FE7E4A /* VKRelative.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKRelative.m; path = library/Source/API/models/VKRelative.m; sourceTree = ""; }; + 0EE5F4139E042A97EA8F204D49E3422B /* UIActivityIndicatorView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIActivityIndicatorView+AFNetworking.m"; path = "UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m"; sourceTree = ""; }; + 11D3D9219700DC2C9D65B6B399A65631 /* VKApiWall.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKApiWall.h; path = library/Source/API/methods/VKApiWall.h; sourceTree = ""; }; + 11E0A66F8BB186F196F57A6E0C03E117 /* VKApiUsers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKApiUsers.h; path = library/Source/API/methods/VKApiUsers.h; sourceTree = ""; }; + 11F4BBC36F01076DE0125A7707244132 /* VKApiFriends.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKApiFriends.m; path = library/Source/API/methods/VKApiFriends.m; sourceTree = ""; }; + 12E2EB9002BE99A16275FC057B096C4E /* UIRefreshControl+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIRefreshControl+AFNetworking.m"; path = "UIKit+AFNetworking/UIRefreshControl+AFNetworking.m"; sourceTree = ""; }; + 12FF91FCE473E003510AEE2B13FB0BF7 /* Pods-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-frameworks.sh"; sourceTree = ""; }; + 145C118B68A9BA8D6DB7826662101DFF /* VKUploadPhotoRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKUploadPhotoRequest.m; path = library/Source/API/upload/VKUploadPhotoRequest.m; sourceTree = ""; }; + 146868522E267C080A54A81CB89548B2 /* UIImage+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+AFNetworking.h"; path = "UIKit+AFNetworking/UIImage+AFNetworking.h"; sourceTree = ""; }; + 14E903B4AE4522E44A6A92AD59B68702 /* MagicalRecord+iCloud.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "MagicalRecord+iCloud.m"; path = "MagicalRecord/Core/MagicalRecord+iCloud.m"; sourceTree = ""; }; + 1637E7E39308DE2D1923D3399C0BF904 /* Pods.debug staging.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods.debug staging.xcconfig"; sourceTree = ""; }; + 169A95359C0177BB437A4E47C27FAF10 /* VKUploadWallPhotoRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKUploadWallPhotoRequest.h; path = library/Source/API/upload/VKUploadWallPhotoRequest.h; sourceTree = ""; }; + 1713DDDF036127FC7C2FC1FD4214C4AE /* NSManagedObjectContext+MagicalSaves.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSManagedObjectContext+MagicalSaves.m"; path = "MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalSaves.m"; sourceTree = ""; }; + 1756FDEE6E67D7E4B9AA78F6408BC1B9 /* FSE+Double.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "FSE+Double.swift"; path = "Swift/Helpers/FSExtensions/FSE+Double.swift"; sourceTree = ""; }; + 177EC1BB77D2DAB1201231A666537B8B /* VKPhoto.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKPhoto.m; path = library/Source/API/models/VKPhoto.m; sourceTree = ""; }; + 18D4BC474880B3402BA99167AC7A685E /* SDWebImageCompat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageCompat.h; path = SDWebImage/SDWebImageCompat.h; sourceTree = ""; }; + 196E6689A6F4B757F170219EBDCF78CB /* VKApiObject.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKApiObject.h; path = library/Source/API/models/VKApiObject.h; sourceTree = ""; }; + 1990ACCF3924B1C99C0FAD54EA7F1758 /* VK-ios-sdk-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "VK-ios-sdk-umbrella.h"; sourceTree = ""; }; + 19AD7D84C9DA39B1E78C60E9D483ECBD /* VKOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKOperation.h; path = library/Source/Core/VKOperation.h; sourceTree = ""; }; + 1C0508C7FE80247C22A20E5A3145D05B /* AFNetworking-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AFNetworking-prefix.pch"; sourceTree = ""; }; + 1C89FE439B45BA1FBB5F0C647C83165A /* AFHTTPRequestOperationManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFHTTPRequestOperationManager.h; path = AFNetworking/AFHTTPRequestOperationManager.h; sourceTree = ""; }; + 1D18E754CA5D818AE2A905512681A0B8 /* VKPhoto.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKPhoto.h; path = library/Source/API/models/VKPhoto.h; sourceTree = ""; }; + 1D75CD4CAEF7CBC075888BCB23B79CD9 /* UIButton+WebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIButton+WebCache.m"; path = "SDWebImage/UIButton+WebCache.m"; sourceTree = ""; }; + 1D9443B99A68B01EE454712592075AF5 /* AFURLConnectionOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLConnectionOperation.h; path = AFNetworking/AFURLConnectionOperation.h; sourceTree = ""; }; + 1E0F1F9DDB6659830C3E417FB3345C67 /* VKApiFriends.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKApiFriends.h; path = library/Source/API/methods/VKApiFriends.h; sourceTree = ""; }; + 1F75181C63355B96D183E17CFB891FE1 /* NSManagedObjectModel+MagicalRecord.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSManagedObjectModel+MagicalRecord.m"; path = "MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.m"; sourceTree = ""; }; + 1F90F00B0B49AD24C036C5DD9D338C59 /* NSPersistentStoreCoordinator+MagicalRecord.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSPersistentStoreCoordinator+MagicalRecord.m"; path = "MagicalRecord/Categories/NSPersistentStoreCoordinator+MagicalRecord.m"; sourceTree = ""; }; + 205D879035D467AA2198F6EF9D08634B /* UIButton+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIButton+AFNetworking.h"; path = "UIKit+AFNetworking/UIButton+AFNetworking.h"; sourceTree = ""; }; + 20CD0C38FB4713443739953899A5D201 /* VKSchool.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKSchool.h; path = library/Source/API/models/VKSchool.h; sourceTree = ""; }; + 20E52ABB730F66E79F84F484EED886F2 /* SDWebImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDWebImage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 2122B6330470088D37076DC3BADABF94 /* UIImageView+HighlightedWebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+HighlightedWebCache.m"; path = "SDWebImage/UIImageView+HighlightedWebCache.m"; sourceTree = ""; }; + 21D838F2F6FC5278BEBDCA31A243548C /* NSManagedObject+MagicalDataImport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSManagedObject+MagicalDataImport.h"; path = "MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h"; sourceTree = ""; }; + 22A08F694018BCF5F6A9889AA537CBA3 /* VK-ios-sdk.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "VK-ios-sdk.xcconfig"; sourceTree = ""; }; + 239647F3E13A2BC210ADF981DAD3E977 /* MagicalRecordShorthandMethodAliases.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MagicalRecordShorthandMethodAliases.h; path = MagicalRecord/Core/MagicalRecordShorthandMethodAliases.h; sourceTree = ""; }; + 23A2D6BE699365B86659F8E05A933B6A /* VKAuthorizeController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKAuthorizeController.h; path = library/Source/Views/VKAuthorizeController.h; sourceTree = ""; }; + 23E29897B83CDDC102A59881C71C6C5D /* Pods-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-resources.sh"; sourceTree = ""; }; + 24F010A013E6DF829F2DE6B7A5F950B7 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; + 269A6D876B29D5CC469298E172E2612F /* NSManagedObject+MagicalAggregation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSManagedObject+MagicalAggregation.m"; path = "MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.m"; sourceTree = ""; }; + 26A1F0BA8D91107A9EE96BC09E6233BB /* SDWebImageDownloader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageDownloader.h; path = SDWebImage/SDWebImageDownloader.h; sourceTree = ""; }; + 27041EABC6F7592A703D536BBB56BB05 /* AFHTTPSessionManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFHTTPSessionManager.h; path = AFNetworking/AFHTTPSessionManager.h; sourceTree = ""; }; + 276ADBB44B87DE827C19BE46C360492B /* NSAttributeDescription+MagicalDataImport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSAttributeDescription+MagicalDataImport.h"; path = "MagicalRecord/Categories/DataImport/NSAttributeDescription+MagicalDataImport.h"; sourceTree = ""; }; + 276ADBBA17F9E4DCB540724799C0446C /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/CoreData.framework; sourceTree = DEVELOPER_DIR; }; + 2865B833A6897CFCC8EFC3661E0E1EEC /* VKUploadPhotoBase.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKUploadPhotoBase.h; path = library/Source/API/upload/VKUploadPhotoBase.h; sourceTree = ""; }; + 2C8B2E7BE789074D66EBCCF073F9FD5A /* AFNetworkActivityIndicatorManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworkActivityIndicatorManager.h; path = "UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h"; sourceTree = ""; }; + 2E54353C3EBAC025363D96EF997ED45B /* VKPhotoSize.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKPhotoSize.m; path = library/Source/API/models/VKPhotoSize.m; sourceTree = ""; }; + 2E8EA69F3DF290C2840DCD35D85A6A8A /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.debug.xcconfig; sourceTree = ""; }; + 2EFDAC1D97EE837FF51769795753FC16 /* VKAuthorizationResult.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKAuthorizationResult.h; path = library/Source/VKAuthorizationResult.h; sourceTree = ""; }; + 2F894C279E90FE9B0941451DCDFFFCA4 /* Pods.release staging.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods.release staging.xcconfig"; sourceTree = ""; }; + 316184DA15C558D7F7C67A490946E398 /* VKCaptchaViewController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKCaptchaViewController.h; path = library/Source/Views/VKCaptchaViewController.h; sourceTree = ""; }; + 340BD3CB8A2BE41C34DE26C9CC80DE47 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + 344569E9480EF3DA39180B0837A25DE3 /* MagicalRecord+Actions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "MagicalRecord+Actions.m"; path = "MagicalRecord/Core/MagicalRecord+Actions.m"; sourceTree = ""; }; + 348A49004B6EA4F1027C8FD084ADFA7B /* VKUser.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKUser.m; path = library/Source/API/models/VKUser.m; sourceTree = ""; }; + 353897333CD0412EF9EBD393329F0051 /* FSE+UITableView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "FSE+UITableView.swift"; path = "Swift/Helpers/FSExtensions/FSE+UITableView.swift"; sourceTree = ""; }; + 353C83543447A278865B8B055AD298CF /* VKRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKRequest.m; path = library/Source/Core/VKRequest.m; sourceTree = ""; }; + 354034E942BB4E32E03AFDFEF1C3AE92 /* VK-ios-sdk-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "VK-ios-sdk-prefix.pch"; sourceTree = ""; }; + 3540AFC3A5D699A88836931375CCF0F9 /* NSManagedObjectContext+MagicalThreading.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSManagedObjectContext+MagicalThreading.h"; path = "MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.h"; sourceTree = ""; }; + 36D84A427E480367E9BCB3E58B151793 /* UIImage+MultiFormat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+MultiFormat.h"; path = "SDWebImage/UIImage+MultiFormat.h"; sourceTree = ""; }; + 379724F18F38DFE84BD35970C4931FBC /* VKApiCaptcha.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKApiCaptcha.h; path = library/Source/API/methods/VKApiCaptcha.h; sourceTree = ""; }; + 37DA3226D8FF6AB58895C240752EEE92 /* AFHTTPRequestOperationManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFHTTPRequestOperationManager.m; path = AFNetworking/AFHTTPRequestOperationManager.m; sourceTree = ""; }; + 38A104D73A27726D741BA2FCC9C9F62D /* MagicalRecord.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MagicalRecord.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 38F262C37CEC9568FF62D55EBF95BDFA /* NSManagedObject+MagicalAggregation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSManagedObject+MagicalAggregation.h"; path = "MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.h"; sourceTree = ""; }; + 3AAA90FB17C6A9BBCF8FBF56BA367834 /* VKBatchRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKBatchRequest.m; path = library/Source/VKBatchRequest.m; sourceTree = ""; }; + 3B1E107B0E21F75E870B2064CED25A67 /* UIImage+MultiFormat.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+MultiFormat.m"; path = "SDWebImage/UIImage+MultiFormat.m"; sourceTree = ""; }; + 3C7E0C2F93D80675C3B4C326C92E6321 /* MagicalRecord.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = MagicalRecord.xcconfig; sourceTree = ""; }; + 3DE3BE2C7D4A9B746667937CB1806DF8 /* AFNetworkReachabilityManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworkReachabilityManager.h; path = AFNetworking/AFNetworkReachabilityManager.h; sourceTree = ""; }; + 3F91E005A76666D524594EB663D92AAD /* OrderedDictionary.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = OrderedDictionary.m; path = library/Source/Utils/OrderedDictionary.m; sourceTree = ""; }; + 40AAAC1D45C7C5A1A593AC0F38FFEAC6 /* VKAccessToken.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKAccessToken.h; path = library/Source/VKAccessToken.h; sourceTree = ""; }; + 4317A7710AFAE0CC86B660DB7C870CE6 /* VKHTTPOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKHTTPOperation.h; path = library/Source/Core/VKHTTPOperation.h; sourceTree = ""; }; + 441264903F82C2488522A2C796195EC8 /* VKUploadPhotoBase.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKUploadPhotoBase.m; path = library/Source/API/upload/VKUploadPhotoBase.m; sourceTree = ""; }; + 44858C7287493E1D723EF1AE5A3F5EFA /* VKApiObject.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKApiObject.m; path = library/Source/API/models/VKApiObject.m; sourceTree = ""; }; + 44D9B337ADF3E0E8CB0829C7645476C3 /* UIImageView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+AFNetworking.h"; path = "UIKit+AFNetworking/UIImageView+AFNetworking.h"; sourceTree = ""; }; + 45285D5AF9062E3890E13A50BB90F0D1 /* NSManagedObject+MagicalFinders.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSManagedObject+MagicalFinders.m"; path = "MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.m"; sourceTree = ""; }; + 45418E4B7395EA84F4161D78A92FE770 /* VKApiPhotos.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKApiPhotos.h; path = library/Source/API/methods/VKApiPhotos.h; sourceTree = ""; }; + 4580A6DBE586D529E2DAA87209AB2568 /* AFURLRequestSerialization.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLRequestSerialization.m; path = AFNetworking/AFURLRequestSerialization.m; sourceTree = ""; }; + 45B3C92C6740A6769F005B08144F0398 /* UIWebView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIWebView+AFNetworking.h"; path = "UIKit+AFNetworking/UIWebView+AFNetworking.h"; sourceTree = ""; }; + 45E3BF92F68E96CCAB01F98F961F1458 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 46E425C522CC16BFF7C2D4D93CC0FAE6 /* NSManagedObjectContext+MagicalObserving.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSManagedObjectContext+MagicalObserving.m"; path = "MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.m"; sourceTree = ""; }; + 475EA7D9690CE8790F837C4F19BF791C /* SDImageCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDImageCache.m; path = SDWebImage/SDImageCache.m; sourceTree = ""; }; + 4A0757BEA3BA889E863D72ACD74D878F /* VKApiUsers.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKApiUsers.m; path = library/Source/API/methods/VKApiUsers.m; sourceTree = ""; }; + 4B8DA2D632EB92BA82DDB7549CD6705F /* SDWebImageDecoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageDecoder.h; path = SDWebImage/SDWebImageDecoder.h; sourceTree = ""; }; + 4CFE7F037CFF94E1C419558C0A78C804 /* MagicalRecord+ShorthandMethods.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "MagicalRecord+ShorthandMethods.m"; path = "MagicalRecord/Core/MagicalRecord+ShorthandMethods.m"; sourceTree = ""; }; + 4E7F51FF48AFE1F7ED8AF687F671BCA7 /* Pods-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-umbrella.h"; sourceTree = ""; }; + 4E9422AFC3F0DB77C426E754AC90F456 /* VKSharedTransitioningObject.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKSharedTransitioningObject.m; path = library/Source/Views/VKSharedTransitioningObject.m; sourceTree = ""; }; + 4EC51BCB6B6747C7069E7E3D5E8B9AFD /* VKUploadImage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKUploadImage.m; path = library/Source/Image/VKUploadImage.m; sourceTree = ""; }; + 4F837DBDF389BE44AFD44BE5C6FB0AEE /* SDWebImageDownloader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageDownloader.m; path = SDWebImage/SDWebImageDownloader.m; sourceTree = ""; }; + 4FAF2E40605B356592476B27E7818A9D /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 50475C7CD24F20E1425B3A9C72AFD07D /* NSObject+MagicalDataImport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSObject+MagicalDataImport.h"; path = "MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.h"; sourceTree = ""; }; + 531F2DC3DAC12369276B8C566A6980A4 /* VKObject.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKObject.m; path = library/Source/Core/VKObject.m; sourceTree = ""; }; + 536A02766B462B81BCFE92C29A8BA30B /* VKUploadMessagesPhotoRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKUploadMessagesPhotoRequest.m; path = library/Source/API/upload/VKUploadMessagesPhotoRequest.m; sourceTree = ""; }; + 53E5CA98E2BE0A7967C46422EE158BE8 /* VKUniversity.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKUniversity.m; path = library/Source/API/models/VKUniversity.m; sourceTree = ""; }; + 54224BDDB981DCBDE3D50967BD8C8FBA /* VK-ios-sdk.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "VK-ios-sdk.modulemap"; sourceTree = ""; }; + 5599F6DC588A808FCD9017200AB11B96 /* VKPermissions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKPermissions.m; path = library/Source/VKPermissions.m; sourceTree = ""; }; + 55FBAC7AC5DE48744285348417CDEAD0 /* NSPersistentStoreCoordinator+MagicalRecord.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSPersistentStoreCoordinator+MagicalRecord.h"; path = "MagicalRecord/Categories/NSPersistentStoreCoordinator+MagicalRecord.h"; sourceTree = ""; }; + 5622F43F2DEAC905D9A9809BF3A84535 /* VKAccessToken.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKAccessToken.m; path = library/Source/VKAccessToken.m; sourceTree = ""; }; + 562D0D3624D662E4E7C8BA29C4EEE4CE /* AFNetworkActivityIndicatorManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFNetworkActivityIndicatorManager.m; path = "UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m"; sourceTree = ""; }; + 564CF30076E634FCCC579752545C9DAA /* VKCaptchaViewController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKCaptchaViewController.m; path = library/Source/Views/VKCaptchaViewController.m; sourceTree = ""; }; + 573534E1DE839F369A065D7DCA5E020A /* SDWebImageManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageManager.m; path = SDWebImage/SDWebImageManager.m; sourceTree = ""; }; + 577C96E1A5A0A74C9DD319F235217DD0 /* FSE+Array.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "FSE+Array.swift"; path = "Swift/Helpers/FSExtensions/FSE+Array.swift"; sourceTree = ""; }; + 58519F4464A415FDB77C43679ADDC5EB /* VKApiObjectArray.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKApiObjectArray.h; path = library/Source/API/models/VKApiObjectArray.h; sourceTree = ""; }; + 5BDA6683CE8A4EB965FC92D5E9D0B547 /* MagicalRecord+ShorthandMethods.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "MagicalRecord+ShorthandMethods.h"; path = "MagicalRecord/Core/MagicalRecord+ShorthandMethods.h"; sourceTree = ""; }; + 5C423ECDFC9231709691A801ED8B6BFC /* SDWebImagePrefetcher.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImagePrefetcher.h; path = SDWebImage/SDWebImagePrefetcher.h; sourceTree = ""; }; + 5CBA0E156105B03FB9F4E28907A4364A /* VKError.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKError.h; path = library/Source/Core/VKError.h; sourceTree = ""; }; + 5F682D7B06B7F4F6D38C7B5A2656EA19 /* FSHelpers+Swift.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "FSHelpers+Swift.modulemap"; sourceTree = ""; }; + 5FBD7FC333FCC7B876A3EB45B8FEB494 /* VKSdk.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKSdk.m; path = library/Source/VKSdk.m; sourceTree = ""; }; + 606EA07A1D27C1ADBD6A6890C804B1CD /* FSE+UIView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "FSE+UIView.swift"; path = "Swift/Helpers/FSExtensions/FSE+UIView.swift"; sourceTree = ""; }; + 60BC7F4F0DDAE89117B825BE7A17FA71 /* MagicalRecord.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MagicalRecord.h; path = MagicalRecord/MagicalRecord.h; sourceTree = ""; }; + 622D08F534CCE61B627C0729A09F5846 /* SDWebImageManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageManager.h; path = SDWebImage/SDWebImageManager.h; sourceTree = ""; }; + 63520E35F4B59449A6BD8520C2B4E748 /* MagicalRecord-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MagicalRecord-prefix.pch"; sourceTree = ""; }; + 63E2C3C6066C50DB20D28256C76348A8 /* UIImageView+WebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+WebCache.h"; path = "SDWebImage/UIImageView+WebCache.h"; sourceTree = ""; }; + 6434470EB7046175533C2A7EE559E7A3 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 64CAA6AE38867C4C5B2365C33FF446CA /* Pods.appstore debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods.appstore debug.xcconfig"; sourceTree = ""; }; + 65598129003809C22109BAA142F0146D /* Pods.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Pods.modulemap; sourceTree = ""; }; + 66BFA812DB5E5154EFB3CF07E7D8795E /* MagicalImportFunctions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MagicalImportFunctions.h; path = MagicalRecord/Categories/DataImport/MagicalImportFunctions.h; sourceTree = ""; }; + 66EE9B37C706FC0BD90E4E8DC68D7A04 /* UIView+WebCacheOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+WebCacheOperation.h"; path = "SDWebImage/UIView+WebCacheOperation.h"; sourceTree = ""; }; + 688CDA9EA90EEBC8015BDD288D3F626F /* FSHelpers_Swift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FSHelpers_Swift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6967B6FF132F86ACFB91804B95FE983B /* SDWebImageOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageOperation.h; path = SDWebImage/SDWebImageOperation.h; sourceTree = ""; }; + 6987AB30586313BB2269917FB3B4F77A /* VKCaptchaView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKCaptchaView.m; path = library/Source/Views/VKCaptchaView.m; sourceTree = ""; }; + 6B029DD39F29EA9186FF68BFB6ACED9B /* NSManagedObject+MagicalRecord.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSManagedObject+MagicalRecord.m"; path = "MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRecord.m"; sourceTree = ""; }; + 6B3A7AD12B70DB84CF99389C04E39740 /* Pods.test staging.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods.test staging.xcconfig"; sourceTree = ""; }; + 6CF2E2D629635BB108F6A236B7849418 /* VKApiGroups.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKApiGroups.h; path = library/Source/API/methods/VKApiGroups.h; sourceTree = ""; }; + 6CFF5C2FAD320FD2DF75D15645B265B0 /* FSE+Dictionary.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "FSE+Dictionary.swift"; path = "Swift/Helpers/FSExtensions/FSE+Dictionary.swift"; sourceTree = ""; }; + 6D3CDBDBE6816CBCFA6B3FB18413BD40 /* MagicalRecordLogging.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MagicalRecordLogging.h; path = MagicalRecord/Core/MagicalRecordLogging.h; sourceTree = ""; }; + 6F9BDBAC13AE9B9F5F78AE982ED91DD9 /* VKBatchRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKBatchRequest.h; path = library/Source/VKBatchRequest.h; sourceTree = ""; }; + 7021DAA1F6E8B3FA1EB7412C60B54114 /* SDImageCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDImageCache.h; path = SDWebImage/SDImageCache.h; sourceTree = ""; }; + 702BC3157376FB0268BEC87FC021438D /* AFURLResponseSerialization.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLResponseSerialization.h; path = AFNetworking/AFURLResponseSerialization.h; sourceTree = ""; }; + 71B7796ADD8E9B0904A711B4F256D588 /* NSEntityDescription+MagicalDataImport.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSEntityDescription+MagicalDataImport.m"; path = "MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.m"; sourceTree = ""; }; + 7377F8316B50BE0E397171CDFA25BE6F /* AFURLConnectionOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLConnectionOperation.m; path = AFNetworking/AFURLConnectionOperation.m; sourceTree = ""; }; + 73804EA4D2DA84A49E56BE25CED0323A /* MagicalImportFunctions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MagicalImportFunctions.m; path = MagicalRecord/Categories/DataImport/MagicalImportFunctions.m; sourceTree = ""; }; + 742AA69B682B55F8F1C37266E586433F /* VKUploadImage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKUploadImage.h; path = library/Source/Image/VKUploadImage.h; sourceTree = ""; }; + 7437F398A1CC077AC02CDF999E825EC4 /* SDWebImage-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SDWebImage-umbrella.h"; sourceTree = ""; }; + 7562C14FFFE011449825B46B66D47757 /* NSManagedObjectContext+MagicalSaves.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSManagedObjectContext+MagicalSaves.h"; path = "MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalSaves.h"; sourceTree = ""; }; + 75C4B7459DEA2D6EEFF43A4D67C3DD15 /* MagicalRecordInternal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MagicalRecordInternal.h; path = MagicalRecord/Core/MagicalRecordInternal.h; sourceTree = ""; }; + 7654753CC884AD462EBB4AC18C0B3016 /* VK-ios-sdk-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "VK-ios-sdk-dummy.m"; sourceTree = ""; }; + 769A7581AB9D6C153EE709F21630A847 /* NSManagedObjectContext+MagicalThreading.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSManagedObjectContext+MagicalThreading.m"; path = "MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.m"; sourceTree = ""; }; + 76C8FED475633B4F481C181A9C1A834E /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 76CF9EFAAFAD412D3B7A4D01FAE498AF /* NSError+VKError.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSError+VKError.m"; path = "library/Source/Core/NSError+VKError.m"; sourceTree = ""; }; + 779DE10C9A4A8A499174EDDE1D02A10F /* NSData+MD5.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSData+MD5.m"; path = "library/Source/Utils/NSData+MD5.m"; sourceTree = ""; }; + 7906A59A87CDC17F4590661BC15FAEDE /* UIImage+GIF.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+GIF.h"; path = "SDWebImage/UIImage+GIF.h"; sourceTree = ""; }; + 7A21AF1D89CC90E935D8A3991A9E3A72 /* VKRequestsScheduler.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKRequestsScheduler.h; path = library/Source/Core/VKRequestsScheduler.h; sourceTree = ""; }; + 7A7B49A45A67051CA0B6F0B0ABF7501E /* FSE+NSDate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "FSE+NSDate.swift"; path = "Swift/Helpers/FSExtensions/FSE+NSDate.swift"; sourceTree = ""; }; + 7B5B86907EE3F926E3CE02994FBB6585 /* VKActivity.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKActivity.h; path = library/Source/Views/VKActivity.h; sourceTree = ""; }; + 7CF9F09E3C5905434B8BE7B5EDB4E1DE /* VKError.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKError.m; path = library/Source/Core/VKError.m; sourceTree = ""; }; + 7D57D628A47C93125F07743858E5D415 /* UIImage+GIF.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+GIF.m"; path = "SDWebImage/UIImage+GIF.m"; sourceTree = ""; }; + 7DDB8DDB27F1AAF709108B98003FB40B /* NSManagedObject+MagicalRecord.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSManagedObject+MagicalRecord.h"; path = "MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRecord.h"; sourceTree = ""; }; + 7E874BD12335FBE1CA46F0348B229166 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 80D325CCEF8CD17D42AA4AD99213886F /* VKUniversity.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKUniversity.h; path = library/Source/API/models/VKUniversity.h; sourceTree = ""; }; + 80EB9495077AF406556B9758F24F0A5A /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.release.xcconfig; sourceTree = ""; }; + 82B71B918221056176D13B0874C14659 /* VKApiCaptcha.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKApiCaptcha.m; path = library/Source/API/methods/VKApiCaptcha.m; sourceTree = ""; }; + 84AB0E9DCC09E3D794D0FAEA0567CCA5 /* VKSdk.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKSdk.h; path = library/Source/VKSdk.h; sourceTree = ""; }; + 869647607E70D8D09B11330DC1720709 /* NSData+ImageContentType.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSData+ImageContentType.h"; path = "SDWebImage/NSData+ImageContentType.h"; sourceTree = ""; }; + 86976E27BD165F3C7B342E6A986AEDA1 /* VKApiConst.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKApiConst.m; path = library/Source/API/methods/VKApiConst.m; sourceTree = ""; }; + 8774EBE251A6062672F836437A9BECBE /* VKGroup.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKGroup.h; path = library/Source/API/models/VKGroup.h; sourceTree = ""; }; + 87ABED29D2258B4A3F424A4F53A744B9 /* VKApiWall.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKApiWall.m; path = library/Source/API/methods/VKApiWall.m; sourceTree = ""; }; + 88A7FE96C599EFF1F27D3D34C4DAD21D /* AFNetworking.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = AFNetworking.modulemap; sourceTree = ""; }; + 899996AC456B764AC637C16C6A80376C /* VKOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKOperation.m; path = library/Source/Core/VKOperation.m; sourceTree = ""; }; + 899C3A681FE9B2A2C39987C81AFA6585 /* VKSdkVersion.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKSdkVersion.h; path = library/Source/VKSdkVersion.h; sourceTree = ""; }; + 8A4A26FC9F99D7F74CD7B5FBE7F06811 /* VKJSONOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKJSONOperation.m; path = library/Source/Core/VKJSONOperation.m; sourceTree = ""; }; + 8B0E26C12DC92DBD0B123449DD675C25 /* FSE+UIImage.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "FSE+UIImage.swift"; path = "Swift/Helpers/FSExtensions/FSE+UIImage.swift"; sourceTree = ""; }; + 8FF384C4CD58C9AAACBA9BE15130FEBC /* NSEntityDescription+MagicalDataImport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSEntityDescription+MagicalDataImport.h"; path = "MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.h"; sourceTree = ""; }; + 908EE49484B48FC7B52931CBFEC9C7BB /* NSString+MagicalDataImport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSString+MagicalDataImport.h"; path = "MagicalRecord/Categories/DataImport/NSString+MagicalDataImport.h"; sourceTree = ""; }; + 90AD7B766CBC048FE123FE61E2654B47 /* UIActivityIndicatorView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIActivityIndicatorView+AFNetworking.h"; path = "UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h"; sourceTree = ""; }; + 91F3786F71EA2B2A89AD32D8BA323514 /* AFNetworking.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = AFNetworking.xcconfig; sourceTree = ""; }; + 92707F37C1AAF1F4D479033121742721 /* NSPersistentStore+MagicalRecord.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSPersistentStore+MagicalRecord.m"; path = "MagicalRecord/Categories/NSPersistentStore+MagicalRecord.m"; sourceTree = ""; }; + 9328874347810009DBFA845BCC0867A2 /* SDWebImageDecoder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageDecoder.m; path = SDWebImage/SDWebImageDecoder.m; sourceTree = ""; }; + 9382A6D4252264618D0117AC1069D871 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 94231952C87A753A2D0D590D4FA8020D /* FSHelpers+Swift-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FSHelpers+Swift-umbrella.h"; sourceTree = ""; }; + 9555233A671A36E40E7E3EE8044DD46E /* VKActivity.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKActivity.m; path = library/Source/Views/VKActivity.m; sourceTree = ""; }; + 957440F9C89943F6361D92718BC610AF /* VKSdkResources.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; path = VKSdkResources.bundle; sourceTree = ""; }; + 95EDC08FDF81B8BB7975CA6FA8DD1357 /* MagicalRecord+Setup.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "MagicalRecord+Setup.h"; path = "MagicalRecord/Core/MagicalRecord+Setup.h"; sourceTree = ""; }; + 9640DF6D71F0034FCADEE93C7E5EEF48 /* AFNetworkReachabilityManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFNetworkReachabilityManager.m; path = AFNetworking/AFNetworkReachabilityManager.m; sourceTree = ""; }; + 967F0A407D46DC0C2637608A24F5DC36 /* NSAttributeDescription+MagicalDataImport.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSAttributeDescription+MagicalDataImport.m"; path = "MagicalRecord/Categories/DataImport/NSAttributeDescription+MagicalDataImport.m"; sourceTree = ""; }; + 96DA87697DF0D7DB55D1BBC8AE70968A /* UIWebView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIWebView+AFNetworking.m"; path = "UIKit+AFNetworking/UIWebView+AFNetworking.m"; sourceTree = ""; }; + 97288B95F2FC00961F0D65C9558ABE4B /* VKImageParameters.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKImageParameters.h; path = library/Source/Image/VKImageParameters.h; sourceTree = ""; }; + 97A611F7C094E902D652F0A1AF00D1FF /* SDWebImage-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SDWebImage-dummy.m"; sourceTree = ""; }; + 98A4B2D1F357388334F68514235C513A /* NSManagedObjectContext+MagicalRecord.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSManagedObjectContext+MagicalRecord.m"; path = "MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalRecord.m"; sourceTree = ""; }; + 98A671C004441854D40433A5581774A0 /* VKObject.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKObject.h; path = library/Source/Core/VKObject.h; sourceTree = ""; }; + 9D51DFA85D32A5F7E04A162873003CDC /* VKRequestsScheduler.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKRequestsScheduler.m; path = library/Source/Core/VKRequestsScheduler.m; sourceTree = ""; }; + 9EA18F9CA5C1EF102D14951A52F68E9B /* NSManagedObject+MagicalFinders.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSManagedObject+MagicalFinders.h"; path = "MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.h"; sourceTree = ""; }; + 9EA632290B8EF3684394F5F39ABCA1C3 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/MobileCoreServices.framework; sourceTree = DEVELOPER_DIR; }; + 9FF15E31ABE9DC0FB4B133E6386D6C1C /* NSString+MagicalDataImport.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSString+MagicalDataImport.m"; path = "MagicalRecord/Categories/DataImport/NSString+MagicalDataImport.m"; sourceTree = ""; }; + A02CC1C2EB217ECBD40021C8C0791DBB /* MagicalRecord+Options.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "MagicalRecord+Options.m"; path = "MagicalRecord/Core/MagicalRecord+Options.m"; sourceTree = ""; }; + A045F04DF84167F1B7C32D0E6B6BDE2F /* VKApiBase.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKApiBase.m; path = library/Source/API/methods/VKApiBase.m; sourceTree = ""; }; + A0DCECBE25AE9FD26B9B58140965BDC4 /* AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworking.h; path = AFNetworking/AFNetworking.h; sourceTree = ""; }; + A0EE3A0C165CFF90F68DE2EF2B4F4E0F /* VKLikes.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKLikes.m; path = library/Source/API/models/VKLikes.m; sourceTree = ""; }; + A1D159C0E7BD18F18C50F813353921AE /* UIButton+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIButton+AFNetworking.m"; path = "UIKit+AFNetworking/UIButton+AFNetworking.m"; sourceTree = ""; }; + A1E59D8A15A1B049713CD5709F2171FD /* VKCaptchaView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKCaptchaView.h; path = library/Source/Views/VKCaptchaView.h; sourceTree = ""; }; + A216F8AEE8959BE4E735E6F02B701EF7 /* VKUtil.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKUtil.m; path = library/Source/Utils/VKUtil.m; sourceTree = ""; }; + A220D00E4C7BA313322B421B988F84CD /* UIImageView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+AFNetworking.m"; path = "UIKit+AFNetworking/UIImageView+AFNetworking.m"; sourceTree = ""; }; + A231CEA8817539A26296B2D2F4BD6AAF /* VKApiConst.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKApiConst.h; path = library/Source/API/methods/VKApiConst.h; sourceTree = ""; }; + A2D751020287A82AB6C76887AB874F50 /* VKApiBase.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKApiBase.h; path = library/Source/API/methods/VKApiBase.h; sourceTree = ""; }; + A2EBF22716D56EF1BB93209A0D80FE68 /* SDWebImage-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SDWebImage-prefix.pch"; sourceTree = ""; }; + A6B9859FA047ED846B8D304492980F79 /* NSManagedObjectContext+MagicalChainSave.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSManagedObjectContext+MagicalChainSave.m"; path = "MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalChainSave.m"; sourceTree = ""; }; + A6EEF4EC2889A46CFE74DA01840E9F79 /* VKUser.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKUser.h; path = library/Source/API/models/VKUser.h; sourceTree = ""; }; + A92D377E1EDEC295C9DDE1D075F1F23A /* VKUploadPhotoRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKUploadPhotoRequest.h; path = library/Source/API/upload/VKUploadPhotoRequest.h; sourceTree = ""; }; + A966E58D01E476E7253A32BD1D0CB47C /* VKAuthorizationResult.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKAuthorizationResult.m; path = library/Source/VKAuthorizationResult.m; sourceTree = ""; }; + AE2F51DE19DC96E9FCB5B38DD7172E31 /* VKApiModels.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKApiModels.h; path = library/Source/API/methods/VKApiModels.h; sourceTree = ""; }; + AF208B8E772893C74E76B768E723492A /* SDWebImagePrefetcher.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImagePrefetcher.m; path = SDWebImage/SDWebImagePrefetcher.m; sourceTree = ""; }; + AF387099925E95E2BF3D3EE21484DB20 /* NSManagedObjectContext+MagicalChainSave.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSManagedObjectContext+MagicalChainSave.h"; path = "MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalChainSave.h"; sourceTree = ""; }; + B0416C08408E29B03DDCFA714FE34E19 /* AFURLSessionManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLSessionManager.m; path = AFNetworking/AFURLSessionManager.m; sourceTree = ""; }; + B23BDDA81ADC14D5D854DE2C8C1A1159 /* AFSecurityPolicy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFSecurityPolicy.m; path = AFNetworking/AFSecurityPolicy.m; sourceTree = ""; }; + B27DAA512A10DFABCEF0678F52DCE2A4 /* NSRelationshipDescription+MagicalDataImport.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSRelationshipDescription+MagicalDataImport.m"; path = "MagicalRecord/Categories/DataImport/NSRelationshipDescription+MagicalDataImport.m"; sourceTree = ""; }; + B4BB0CF5D47A4E94614BDFE0308E7127 /* MagicalRecordInternal.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MagicalRecordInternal.m; path = MagicalRecord/Core/MagicalRecordInternal.m; sourceTree = ""; }; + B5987825C280EB337B1B8E70D37A53B1 /* SDWebImageDownloaderOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageDownloaderOperation.h; path = SDWebImage/SDWebImageDownloaderOperation.h; sourceTree = ""; }; + B5F92D02054F19E30C96ACE0CA7215D3 /* NSManagedObject+MagicalRequests.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSManagedObject+MagicalRequests.m"; path = "MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRequests.m"; sourceTree = ""; }; + B70703D5CE50C6DF45C342F7536ACEC4 /* MagicalRecord.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = MagicalRecord.modulemap; sourceTree = ""; }; + B938627014C49CF76D42D14851BC19E7 /* VKGroup.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKGroup.m; path = library/Source/API/models/VKGroup.m; sourceTree = ""; }; + B95C9730F5C5AEAD3DCF7EA13D51F38A /* NSManagedObjectContext+MagicalRecord.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSManagedObjectContext+MagicalRecord.h"; path = "MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalRecord.h"; sourceTree = ""; }; + BA0CC9FA3EFC9E4572D5B7B8AD895BC8 /* UIProgressView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIProgressView+AFNetworking.m"; path = "UIKit+AFNetworking/UIProgressView+AFNetworking.m"; sourceTree = ""; }; + BA51BED25644F8D68D7B6238136D4B32 /* VK_ios_sdk.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = VK_ios_sdk.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + BB02D51418CB121D9E19F8DAF776F0AE /* UIImageView+HighlightedWebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+HighlightedWebCache.h"; path = "SDWebImage/UIImageView+HighlightedWebCache.h"; sourceTree = ""; }; + BBD1F9C55EBACA9D154EA76B8873DAB0 /* VKImageParameters.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKImageParameters.m; path = library/Source/Image/VKImageParameters.m; sourceTree = ""; }; + BC596147DDDBA5B508F93F83AF6AA6C7 /* Pods.appstore.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.appstore.xcconfig; sourceTree = ""; }; + BCBD642E3D7F950433A9CBD96248BE8C /* NSPersistentStore+MagicalRecord.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSPersistentStore+MagicalRecord.h"; path = "MagicalRecord/Categories/NSPersistentStore+MagicalRecord.h"; sourceTree = ""; }; + BCF41BE6BC23F08CBFB3B71346EC2CD6 /* Pods.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.test.xcconfig; sourceTree = ""; }; + BD3BA348DDBEF671458176F098DEAED1 /* UIImageView+WebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+WebCache.m"; path = "SDWebImage/UIImageView+WebCache.m"; sourceTree = ""; }; + BDD7062C3B55ED1A6C64C50E479894C3 /* AFNetworking-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "AFNetworking-dummy.m"; sourceTree = ""; }; + BF072250768A53474C1EF3BB0DC63596 /* UIAlertView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIAlertView+AFNetworking.m"; path = "UIKit+AFNetworking/UIAlertView+AFNetworking.m"; sourceTree = ""; }; + C00988E439ECF4667BDDCBD763CEB904 /* VKResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKResponse.m; path = library/Source/Core/VKResponse.m; sourceTree = ""; }; + C1A477B1CAA3F662661AF4CAA294B929 /* FSE+String.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "FSE+String.swift"; path = "Swift/Helpers/FSExtensions/FSE+String.swift"; sourceTree = ""; }; + C3260972180B09FF73D2627A26FB0213 /* VKApiObjectArray.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKApiObjectArray.m; path = library/Source/API/models/VKApiObjectArray.m; sourceTree = ""; }; + C4BE6AD8967794699E865B596788A531 /* VKCounters.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKCounters.m; path = library/Source/API/models/VKCounters.m; sourceTree = ""; }; + C7A55CB44610D9B29974F40B0E131DE9 /* VKCounters.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKCounters.h; path = library/Source/API/models/VKCounters.h; sourceTree = ""; }; + C83AAC37BD4CF52BBD2E236B54869947 /* VKShareDialogController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKShareDialogController.h; path = library/Source/Views/VKShareDialogController.h; sourceTree = ""; }; + C87604CB83F40A9FEB4B67E3300DB637 /* NSString+MD5.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSString+MD5.h"; path = "library/Source/Utils/NSString+MD5.h"; sourceTree = ""; }; + C90A3CC926EA128D80EA3EC24BE2FCAE /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/ImageIO.framework; sourceTree = DEVELOPER_DIR; }; + C910310A32D0ED59B59559C9F21B15E0 /* VKSharedTransitioningObject.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKSharedTransitioningObject.h; path = library/Source/Views/VKSharedTransitioningObject.h; sourceTree = ""; }; + CA33B926AB37395B9BEC530D8E9AE272 /* VKRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKRequest.h; path = library/Source/Core/VKRequest.h; sourceTree = ""; }; + CA8835CD5FED033FBC2F3829A3EB5621 /* Pods-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-acknowledgements.markdown"; sourceTree = ""; }; + CB6066063B48D3EAC1E909311CD0FB2A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; }; + CB8CC73E1198A10582D126E0D3CB2503 /* NSRelationshipDescription+MagicalDataImport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSRelationshipDescription+MagicalDataImport.h"; path = "MagicalRecord/Categories/DataImport/NSRelationshipDescription+MagicalDataImport.h"; sourceTree = ""; }; + CC2050D0103146AECC017F075203E0AF /* VKSchool.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKSchool.m; path = library/Source/API/models/VKSchool.m; sourceTree = ""; }; + CD05DB70C9B8F6BD2FAC00BF14E94FB6 /* NSNumber+MagicalDataImport.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSNumber+MagicalDataImport.m"; path = "MagicalRecord/Categories/DataImport/NSNumber+MagicalDataImport.m"; sourceTree = ""; }; + CEE39FC9BB7F88F270149DB2E908D3E5 /* MagicalRecord-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "MagicalRecord-dummy.m"; sourceTree = ""; }; + CEF47E684574DD6B8012F5FCA701B4FB /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; + CF74D4ECE219BE56F99727BE008F71FB /* VKApiPhotos.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKApiPhotos.m; path = library/Source/API/methods/VKApiPhotos.m; sourceTree = ""; }; + D08AA138BC564F682ECC44AAE2412732 /* MagicalRecord+ErrorHandling.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "MagicalRecord+ErrorHandling.m"; path = "MagicalRecord/Core/MagicalRecord+ErrorHandling.m"; sourceTree = ""; }; + D268E4471AB40C20AB047E3A47C21F2A /* VKJSONOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKJSONOperation.h; path = library/Source/Core/VKJSONOperation.h; sourceTree = ""; }; + D5BA710D01BB6EBDDEF0A43633BB9D4A /* Pods-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-dummy.m"; sourceTree = ""; }; + D619D15871F376F659C33F4BEE3C97DB /* AFURLRequestSerialization.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLRequestSerialization.h; path = AFNetworking/AFURLRequestSerialization.h; sourceTree = ""; }; + D7EFA1C924C18B4342EA91248D504287 /* UIAlertView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIAlertView+AFNetworking.h"; path = "UIKit+AFNetworking/UIAlertView+AFNetworking.h"; sourceTree = ""; }; + D81B4D934F747FFB5962D4D031300360 /* NSManagedObjectModel+MagicalRecord.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSManagedObjectModel+MagicalRecord.h"; path = "MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.h"; sourceTree = ""; }; + D83713637529C27EC3A774EB2B819E16 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + DA2724B95A8DA5F33591E506AC9AB483 /* VKHTTPOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKHTTPOperation.m; path = library/Source/Core/VKHTTPOperation.m; sourceTree = ""; }; + DAA8F6E4988AF56A851C9215C156647A /* VKBundle.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKBundle.m; path = library/Source/VKBundle.m; sourceTree = ""; }; + DB57EE1252EA7EF343F7CE5C96716D9D /* NSNumber+MagicalDataImport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSNumber+MagicalDataImport.h"; path = "MagicalRecord/Categories/DataImport/NSNumber+MagicalDataImport.h"; sourceTree = ""; }; + DB81530E5BB2EF77B71B7FC4A9CAFBF7 /* VKShareDialogController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKShareDialogController.m; path = library/Source/Views/VKShareDialogController.m; sourceTree = ""; }; + DBB46DD6C992B3267367B881AC91DA8E /* AFHTTPSessionManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFHTTPSessionManager.m; path = AFNetworking/AFHTTPSessionManager.m; sourceTree = ""; }; + DC8927ECF814C9D733A6000CC266D98D /* OrderedDictionary.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = OrderedDictionary.h; path = library/Source/Utils/OrderedDictionary.h; sourceTree = ""; }; + DDB5E2396DE2DCD1C6E13DACF3F30ED6 /* VKPhotoSize.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKPhotoSize.h; path = library/Source/API/models/VKPhotoSize.h; sourceTree = ""; }; + DDCD0A29450F2A8D6199CF6A69136DB0 /* FSHelpers+Swift-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FSHelpers+Swift-dummy.m"; sourceTree = ""; }; + DF320B7C9C606E3414D84AFB606139E8 /* FSE+UITextView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "FSE+UITextView.swift"; path = "Swift/Helpers/FSExtensions/FSE+UITextView.swift"; sourceTree = ""; }; + E00669A5EF5C331CE610BA3E2DD6B653 /* NSManagedObject+MagicalRequests.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSManagedObject+MagicalRequests.h"; path = "MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRequests.h"; sourceTree = ""; }; + E0181697B49C487F800CEDAF217ECB78 /* VKResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKResponse.h; path = library/Source/Core/VKResponse.h; sourceTree = ""; }; + E1EC0045F455522FB630A330CC16F0B0 /* VKLikes.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKLikes.h; path = library/Source/API/models/VKLikes.h; sourceTree = ""; }; + E1F16DFBBC4E0B4FB2F5A384ED98DC86 /* VKUploadMessagesPhotoRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKUploadMessagesPhotoRequest.h; path = library/Source/API/upload/VKUploadMessagesPhotoRequest.h; sourceTree = ""; }; + E21A3484B1F47EDC88D31E3B905D0B23 /* AFURLSessionManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLSessionManager.h; path = AFNetworking/AFURLSessionManager.h; sourceTree = ""; }; + E2D692415D8A3D176070945C19A19E70 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + E3E5A1792E518E463B81B3DF5A8AFDDD /* FSHelpers+Swift-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FSHelpers+Swift-prefix.pch"; sourceTree = ""; }; + E58F3E4E6691BE619DCFCE43A2BEE137 /* MagicalRecord+Actions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "MagicalRecord+Actions.h"; path = "MagicalRecord/Core/MagicalRecord+Actions.h"; sourceTree = ""; }; + E5E4B11C2E2902BD172B2F51724DD05B /* VKRelative.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKRelative.h; path = library/Source/API/models/VKRelative.h; sourceTree = ""; }; + E634F356DDD8925726CA969E9430C39E /* NSData+ImageContentType.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSData+ImageContentType.m"; path = "SDWebImage/NSData+ImageContentType.m"; sourceTree = ""; }; + E679ADB4FBDBEB80F3AA11349702F4D9 /* VKApi.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKApi.h; path = library/Source/API/VKApi.h; sourceTree = ""; }; + E715973AAC07D4D834E95853F1337BA7 /* VKApi.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKApi.m; path = library/Source/API/VKApi.m; sourceTree = ""; }; + E73C072418D998D16612089AFC06EE9A /* MagicalRecord+Options.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "MagicalRecord+Options.h"; path = "MagicalRecord/Core/MagicalRecord+Options.h"; sourceTree = ""; }; + E7464829F96F2BD8D09B54ADDE8A4C3D /* MagicalRecord-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MagicalRecord-umbrella.h"; sourceTree = ""; }; + E806F223B053F32E9FF52AAAF02F3123 /* MagicalRecord+ErrorHandling.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "MagicalRecord+ErrorHandling.h"; path = "MagicalRecord/Core/MagicalRecord+ErrorHandling.h"; sourceTree = ""; }; + E8CAFD04652328AA8F59E07A3626266C /* VKPermissions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKPermissions.h; path = library/Source/VKPermissions.h; sourceTree = ""; }; + E9991B895C35E9F04A013E1D7EE83E4E /* VKAuthorizeController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKAuthorizeController.m; path = library/Source/Views/VKAuthorizeController.m; sourceTree = ""; }; + EAC70F09CB2ACF1251DBFF161F0B59B3 /* MagicalRecordDeprecationMacros.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MagicalRecordDeprecationMacros.h; path = MagicalRecord/Core/MagicalRecordDeprecationMacros.h; sourceTree = ""; }; + EB77563B3EA88410F9C7A11B82E1FDFD /* NSString+MD5.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSString+MD5.m"; path = "library/Source/Utils/NSString+MD5.m"; sourceTree = ""; }; + EC58FA8B3DFD0AF722E12886BC8AAECD /* SafariServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SafariServices.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/SafariServices.framework; sourceTree = DEVELOPER_DIR; }; + ED24697386EAC6549C781263D8DDFE14 /* SDWebImage.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SDWebImage.xcconfig; sourceTree = ""; }; + EE5E662C115A021EFC70E57794147BB0 /* MagicalRecord+Setup.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "MagicalRecord+Setup.m"; path = "MagicalRecord/Core/MagicalRecord+Setup.m"; sourceTree = ""; }; + EE6F98422250B7D75629C24B3BFAB70C /* FSHelpers+Swift.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "FSHelpers+Swift.xcconfig"; sourceTree = ""; }; + EF6AE872855248E99675CECAFB15EC18 /* VKBundle.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKBundle.h; path = library/Source/VKBundle.h; sourceTree = ""; }; + F2C8076A4367F432B4869457710D3886 /* NSObject+MagicalDataImport.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSObject+MagicalDataImport.m"; path = "MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.m"; sourceTree = ""; }; + F3147584BCD90348E6D4BEFC2559352D /* SDWebImageDownloaderOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageDownloaderOperation.m; path = SDWebImage/SDWebImageDownloaderOperation.m; sourceTree = ""; }; + F390DE53862AAEDB25A25C7D84558D4E /* FSHelpers.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FSHelpers.swift; path = Swift/Helpers/FSHelpers.swift; sourceTree = ""; }; + F7D14E6A24B899350C6387E356CB44D8 /* VKUtil.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKUtil.h; path = library/Source/Utils/VKUtil.h; sourceTree = ""; }; + F7D945C11B8CCEBF390DB91229F1EBE1 /* NSData+MD5.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSData+MD5.h"; path = "library/Source/Utils/NSData+MD5.h"; sourceTree = ""; }; + F88CB1239B3702B4D4AC78CF47EFF61D /* VKHTTPClient.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKHTTPClient.m; path = library/Source/Core/VKHTTPClient.m; sourceTree = ""; }; + F893819961D9C6B069D3F2EB187AAA60 /* NSManagedObjectContext+MagicalObserving.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSManagedObjectContext+MagicalObserving.h"; path = "MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.h"; sourceTree = ""; }; + F8CC4EC7299DEDCB731E9234C2FFB46C /* SDWebImage.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = SDWebImage.modulemap; sourceTree = ""; }; + F984E542865506C58B1E77ACBFE9E0E6 /* VKHTTPClient.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = VKHTTPClient.h; path = library/Source/Core/VKHTTPClient.h; sourceTree = ""; }; + FA6D7FC8145C3112828D49BC7141153C /* VKApiGroups.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKApiGroups.m; path = library/Source/API/methods/VKApiGroups.m; sourceTree = ""; }; + FAB9871C3C4A71C2450D492DD8719A4F /* AFHTTPRequestOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFHTTPRequestOperation.h; path = AFNetworking/AFHTTPRequestOperation.h; sourceTree = ""; }; + FB81569AFFDB541951BFB2AC2FB70E39 /* UIButton+WebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIButton+WebCache.h"; path = "SDWebImage/UIButton+WebCache.h"; sourceTree = ""; }; + FF69751A95A8FA9477D2D74BB86BB42C /* VKAudio.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = VKAudio.m; path = library/Source/API/models/VKAudio.m; sourceTree = ""; }; + FFF46FEBEDC7276A918416C9E6E46DFD /* AFSecurityPolicy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFSecurityPolicy.h; path = AFNetworking/AFSecurityPolicy.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 112BDE3F79ACCBC59869EBA062F513F9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 69C9ACB276130464A6691C40C9B5C53A /* CoreData.framework in Frameworks */, + 2820895236106ADBD8CAE01972EE42C1 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4F8AC0F585B55653C4924E5ED48CBD71 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F3983E43D3CA1C2EFB3BF3C8E2A9DE59 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5686E2E09FC81EF5532D35DC88501975 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F4A4C372BA33C448EC27FDE4C51622DA /* Foundation.framework in Frameworks */, + F6ACAD8A1BEB1E1797344EA5084461F5 /* ImageIO.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D316BA1012400EFF8394256483B2F7AA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 793162BACBE26965AF9EA9EE39950C98 /* Foundation.framework in Frameworks */, + 5BD26E2BA7F25DA8DC57CB5ECBBBA635 /* QuartzCore.framework in Frameworks */, + 6E66BFF397CE9B15F7C91FC8E630AD51 /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DD1DFE546C8C31A20A2A01742DDEB270 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 28C8C72451F7254476E113D08C4CDB56 /* CoreGraphics.framework in Frameworks */, + 0C9D47FF9B4920710B4C13A1C075615F /* Foundation.framework in Frameworks */, + 10076D84089A8C3E544558184CE079FB /* SafariServices.framework in Frameworks */, + BBD744EC671D101750F37A46AC71621A /* Security.framework in Frameworks */, + B5F70217D81ED63572FA748AE5092196 /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FABCF001C825245E47D6397E6670D844 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0249D817973CA82B303A4056920C5809 /* CoreGraphics.framework in Frameworks */, + 319A493CFA79094906A9CD41F574E489 /* Foundation.framework in Frameworks */, + B6958FDC33BF5532BC3F4587F7049A83 /* MobileCoreServices.framework in Frameworks */, + 3165B2FEAB48577B3979B9CA09CFEEDD /* Security.framework in Frameworks */, + 322EC484ADA51CD029DD3E2DA10EA27C /* SystemConfiguration.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0DB3768BA98AAFEC61C130F05A73ACC4 /* Reachability */ = { + isa = PBXGroup; + children = ( + 3DE3BE2C7D4A9B746667937CB1806DF8 /* AFNetworkReachabilityManager.h */, + 9640DF6D71F0034FCADEE93C7E5EEF48 /* AFNetworkReachabilityManager.m */, + ); + name = Reachability; + sourceTree = ""; + }; + 185791ACB2A5870CE9725DE1914B7E11 /* Core */ = { + isa = PBXGroup; + children = ( + 869647607E70D8D09B11330DC1720709 /* NSData+ImageContentType.h */, + E634F356DDD8925726CA969E9430C39E /* NSData+ImageContentType.m */, + 7021DAA1F6E8B3FA1EB7412C60B54114 /* SDImageCache.h */, + 475EA7D9690CE8790F837C4F19BF791C /* SDImageCache.m */, + 18D4BC474880B3402BA99167AC7A685E /* SDWebImageCompat.h */, + 0AA3598C34A918456A19C1F85125D1CE /* SDWebImageCompat.m */, + 4B8DA2D632EB92BA82DDB7549CD6705F /* SDWebImageDecoder.h */, + 9328874347810009DBFA845BCC0867A2 /* SDWebImageDecoder.m */, + 26A1F0BA8D91107A9EE96BC09E6233BB /* SDWebImageDownloader.h */, + 4F837DBDF389BE44AFD44BE5C6FB0AEE /* SDWebImageDownloader.m */, + B5987825C280EB337B1B8E70D37A53B1 /* SDWebImageDownloaderOperation.h */, + F3147584BCD90348E6D4BEFC2559352D /* SDWebImageDownloaderOperation.m */, + 622D08F534CCE61B627C0729A09F5846 /* SDWebImageManager.h */, + 573534E1DE839F369A065D7DCA5E020A /* SDWebImageManager.m */, + 6967B6FF132F86ACFB91804B95FE983B /* SDWebImageOperation.h */, + 5C423ECDFC9231709691A801ED8B6BFC /* SDWebImagePrefetcher.h */, + AF208B8E772893C74E76B768E723492A /* SDWebImagePrefetcher.m */, + FB81569AFFDB541951BFB2AC2FB70E39 /* UIButton+WebCache.h */, + 1D75CD4CAEF7CBC075888BCB23B79CD9 /* UIButton+WebCache.m */, + 7906A59A87CDC17F4590661BC15FAEDE /* UIImage+GIF.h */, + 7D57D628A47C93125F07743858E5D415 /* UIImage+GIF.m */, + 36D84A427E480367E9BCB3E58B151793 /* UIImage+MultiFormat.h */, + 3B1E107B0E21F75E870B2064CED25A67 /* UIImage+MultiFormat.m */, + BB02D51418CB121D9E19F8DAF776F0AE /* UIImageView+HighlightedWebCache.h */, + 2122B6330470088D37076DC3BADABF94 /* UIImageView+HighlightedWebCache.m */, + 63E2C3C6066C50DB20D28256C76348A8 /* UIImageView+WebCache.h */, + BD3BA348DDBEF671458176F098DEAED1 /* UIImageView+WebCache.m */, + 66EE9B37C706FC0BD90E4E8DC68D7A04 /* UIView+WebCacheOperation.h */, + 065083D54FC242BDA7574B4D7BC2E897 /* UIView+WebCacheOperation.m */, + ); + name = Core; + sourceTree = ""; + }; + 1CAF78575181CCCA49FC2C8F39F2FCB0 /* Pods */ = { + isa = PBXGroup; + children = ( + 45E3BF92F68E96CCAB01F98F961F1458 /* Info.plist */, + 65598129003809C22109BAA142F0146D /* Pods.modulemap */, + CA8835CD5FED033FBC2F3829A3EB5621 /* Pods-acknowledgements.markdown */, + 01A016E4FE63BD78BEA028978C3CB316 /* Pods-acknowledgements.plist */, + D5BA710D01BB6EBDDEF0A43633BB9D4A /* Pods-dummy.m */, + 12FF91FCE473E003510AEE2B13FB0BF7 /* Pods-frameworks.sh */, + 23E29897B83CDDC102A59881C71C6C5D /* Pods-resources.sh */, + 4E7F51FF48AFE1F7ED8AF687F671BCA7 /* Pods-umbrella.h */, + BC596147DDDBA5B508F93F83AF6AA6C7 /* Pods.appstore.xcconfig */, + 64CAA6AE38867C4C5B2365C33FF446CA /* Pods.appstore debug.xcconfig */, + 2E8EA69F3DF290C2840DCD35D85A6A8A /* Pods.debug.xcconfig */, + 1637E7E39308DE2D1923D3399C0BF904 /* Pods.debug staging.xcconfig */, + 80EB9495077AF406556B9758F24F0A5A /* Pods.release.xcconfig */, + 2F894C279E90FE9B0941451DCDFFFCA4 /* Pods.release staging.xcconfig */, + BCF41BE6BC23F08CBFB3B71346EC2CD6 /* Pods.test.xcconfig */, + 6B3A7AD12B70DB84CF99389C04E39740 /* Pods.test staging.xcconfig */, + ); + name = Pods; + path = "Target Support Files/Pods"; + sourceTree = ""; + }; + 2A1786B40A84ACB9DC53FA6BB912FB1F /* VK-ios-sdk */ = { + isa = PBXGroup; + children = ( + F7D945C11B8CCEBF390DB91229F1EBE1 /* NSData+MD5.h */, + 779DE10C9A4A8A499174EDDE1D02A10F /* NSData+MD5.m */, + 07E8544B9142CED3FF56851C10242F34 /* NSError+VKError.h */, + 76CF9EFAAFAD412D3B7A4D01FAE498AF /* NSError+VKError.m */, + C87604CB83F40A9FEB4B67E3300DB637 /* NSString+MD5.h */, + EB77563B3EA88410F9C7A11B82E1FDFD /* NSString+MD5.m */, + DC8927ECF814C9D733A6000CC266D98D /* OrderedDictionary.h */, + 3F91E005A76666D524594EB663D92AAD /* OrderedDictionary.m */, + 40AAAC1D45C7C5A1A593AC0F38FFEAC6 /* VKAccessToken.h */, + 5622F43F2DEAC905D9A9809BF3A84535 /* VKAccessToken.m */, + 7B5B86907EE3F926E3CE02994FBB6585 /* VKActivity.h */, + 9555233A671A36E40E7E3EE8044DD46E /* VKActivity.m */, + E679ADB4FBDBEB80F3AA11349702F4D9 /* VKApi.h */, + E715973AAC07D4D834E95853F1337BA7 /* VKApi.m */, + A2D751020287A82AB6C76887AB874F50 /* VKApiBase.h */, + A045F04DF84167F1B7C32D0E6B6BDE2F /* VKApiBase.m */, + 379724F18F38DFE84BD35970C4931FBC /* VKApiCaptcha.h */, + 82B71B918221056176D13B0874C14659 /* VKApiCaptcha.m */, + A231CEA8817539A26296B2D2F4BD6AAF /* VKApiConst.h */, + 86976E27BD165F3C7B342E6A986AEDA1 /* VKApiConst.m */, + 1E0F1F9DDB6659830C3E417FB3345C67 /* VKApiFriends.h */, + 11F4BBC36F01076DE0125A7707244132 /* VKApiFriends.m */, + 6CF2E2D629635BB108F6A236B7849418 /* VKApiGroups.h */, + FA6D7FC8145C3112828D49BC7141153C /* VKApiGroups.m */, + AE2F51DE19DC96E9FCB5B38DD7172E31 /* VKApiModels.h */, + 196E6689A6F4B757F170219EBDCF78CB /* VKApiObject.h */, + 44858C7287493E1D723EF1AE5A3F5EFA /* VKApiObject.m */, + 58519F4464A415FDB77C43679ADDC5EB /* VKApiObjectArray.h */, + C3260972180B09FF73D2627A26FB0213 /* VKApiObjectArray.m */, + 45418E4B7395EA84F4161D78A92FE770 /* VKApiPhotos.h */, + CF74D4ECE219BE56F99727BE008F71FB /* VKApiPhotos.m */, + 11E0A66F8BB186F196F57A6E0C03E117 /* VKApiUsers.h */, + 4A0757BEA3BA889E863D72ACD74D878F /* VKApiUsers.m */, + 11D3D9219700DC2C9D65B6B399A65631 /* VKApiWall.h */, + 87ABED29D2258B4A3F424A4F53A744B9 /* VKApiWall.m */, + 0BB04C60CAA512D268AA040E1C21A56D /* VKAudio.h */, + FF69751A95A8FA9477D2D74BB86BB42C /* VKAudio.m */, + 2EFDAC1D97EE837FF51769795753FC16 /* VKAuthorizationResult.h */, + A966E58D01E476E7253A32BD1D0CB47C /* VKAuthorizationResult.m */, + 23A2D6BE699365B86659F8E05A933B6A /* VKAuthorizeController.h */, + E9991B895C35E9F04A013E1D7EE83E4E /* VKAuthorizeController.m */, + 6F9BDBAC13AE9B9F5F78AE982ED91DD9 /* VKBatchRequest.h */, + 3AAA90FB17C6A9BBCF8FBF56BA367834 /* VKBatchRequest.m */, + EF6AE872855248E99675CECAFB15EC18 /* VKBundle.h */, + DAA8F6E4988AF56A851C9215C156647A /* VKBundle.m */, + A1E59D8A15A1B049713CD5709F2171FD /* VKCaptchaView.h */, + 6987AB30586313BB2269917FB3B4F77A /* VKCaptchaView.m */, + 316184DA15C558D7F7C67A490946E398 /* VKCaptchaViewController.h */, + 564CF30076E634FCCC579752545C9DAA /* VKCaptchaViewController.m */, + C7A55CB44610D9B29974F40B0E131DE9 /* VKCounters.h */, + C4BE6AD8967794699E865B596788A531 /* VKCounters.m */, + 5CBA0E156105B03FB9F4E28907A4364A /* VKError.h */, + 7CF9F09E3C5905434B8BE7B5EDB4E1DE /* VKError.m */, + 8774EBE251A6062672F836437A9BECBE /* VKGroup.h */, + B938627014C49CF76D42D14851BC19E7 /* VKGroup.m */, + F984E542865506C58B1E77ACBFE9E0E6 /* VKHTTPClient.h */, + F88CB1239B3702B4D4AC78CF47EFF61D /* VKHTTPClient.m */, + 4317A7710AFAE0CC86B660DB7C870CE6 /* VKHTTPOperation.h */, + DA2724B95A8DA5F33591E506AC9AB483 /* VKHTTPOperation.m */, + 97288B95F2FC00961F0D65C9558ABE4B /* VKImageParameters.h */, + BBD1F9C55EBACA9D154EA76B8873DAB0 /* VKImageParameters.m */, + D268E4471AB40C20AB047E3A47C21F2A /* VKJSONOperation.h */, + 8A4A26FC9F99D7F74CD7B5FBE7F06811 /* VKJSONOperation.m */, + E1EC0045F455522FB630A330CC16F0B0 /* VKLikes.h */, + A0EE3A0C165CFF90F68DE2EF2B4F4E0F /* VKLikes.m */, + 98A671C004441854D40433A5581774A0 /* VKObject.h */, + 531F2DC3DAC12369276B8C566A6980A4 /* VKObject.m */, + 19AD7D84C9DA39B1E78C60E9D483ECBD /* VKOperation.h */, + 899996AC456B764AC637C16C6A80376C /* VKOperation.m */, + E8CAFD04652328AA8F59E07A3626266C /* VKPermissions.h */, + 5599F6DC588A808FCD9017200AB11B96 /* VKPermissions.m */, + 1D18E754CA5D818AE2A905512681A0B8 /* VKPhoto.h */, + 177EC1BB77D2DAB1201231A666537B8B /* VKPhoto.m */, + DDB5E2396DE2DCD1C6E13DACF3F30ED6 /* VKPhotoSize.h */, + 2E54353C3EBAC025363D96EF997ED45B /* VKPhotoSize.m */, + E5E4B11C2E2902BD172B2F51724DD05B /* VKRelative.h */, + 0ED28E6B3A0397E045E8E7DAC4FE7E4A /* VKRelative.m */, + CA33B926AB37395B9BEC530D8E9AE272 /* VKRequest.h */, + 353C83543447A278865B8B055AD298CF /* VKRequest.m */, + 7A21AF1D89CC90E935D8A3991A9E3A72 /* VKRequestsScheduler.h */, + 9D51DFA85D32A5F7E04A162873003CDC /* VKRequestsScheduler.m */, + E0181697B49C487F800CEDAF217ECB78 /* VKResponse.h */, + C00988E439ECF4667BDDCBD763CEB904 /* VKResponse.m */, + 20CD0C38FB4713443739953899A5D201 /* VKSchool.h */, + CC2050D0103146AECC017F075203E0AF /* VKSchool.m */, + 84AB0E9DCC09E3D794D0FAEA0567CCA5 /* VKSdk.h */, + 5FBD7FC333FCC7B876A3EB45B8FEB494 /* VKSdk.m */, + 899C3A681FE9B2A2C39987C81AFA6585 /* VKSdkVersion.h */, + C83AAC37BD4CF52BBD2E236B54869947 /* VKShareDialogController.h */, + DB81530E5BB2EF77B71B7FC4A9CAFBF7 /* VKShareDialogController.m */, + C910310A32D0ED59B59559C9F21B15E0 /* VKSharedTransitioningObject.h */, + 4E9422AFC3F0DB77C426E754AC90F456 /* VKSharedTransitioningObject.m */, + 80D325CCEF8CD17D42AA4AD99213886F /* VKUniversity.h */, + 53E5CA98E2BE0A7967C46422EE158BE8 /* VKUniversity.m */, + 742AA69B682B55F8F1C37266E586433F /* VKUploadImage.h */, + 4EC51BCB6B6747C7069E7E3D5E8B9AFD /* VKUploadImage.m */, + E1F16DFBBC4E0B4FB2F5A384ED98DC86 /* VKUploadMessagesPhotoRequest.h */, + 536A02766B462B81BCFE92C29A8BA30B /* VKUploadMessagesPhotoRequest.m */, + 2865B833A6897CFCC8EFC3661E0E1EEC /* VKUploadPhotoBase.h */, + 441264903F82C2488522A2C796195EC8 /* VKUploadPhotoBase.m */, + A92D377E1EDEC295C9DDE1D075F1F23A /* VKUploadPhotoRequest.h */, + 145C118B68A9BA8D6DB7826662101DFF /* VKUploadPhotoRequest.m */, + 169A95359C0177BB437A4E47C27FAF10 /* VKUploadWallPhotoRequest.h */, + 0CD069AC9B919E6E461FF35C9F670E79 /* VKUploadWallPhotoRequest.m */, + A6EEF4EC2889A46CFE74DA01840E9F79 /* VKUser.h */, + 348A49004B6EA4F1027C8FD084ADFA7B /* VKUser.m */, + F7D14E6A24B899350C6387E356CB44D8 /* VKUtil.h */, + A216F8AEE8959BE4E735E6F02B701EF7 /* VKUtil.m */, + DFB849AFE778B4882403C06CD90C8272 /* Resources */, + A01F96E02353D5C19705393C31232E96 /* Support Files */, + ); + path = "VK-ios-sdk"; + sourceTree = ""; + }; + 319124E2A4172CBB51711A56022B138A /* UIKit */ = { + isa = PBXGroup; + children = ( + 2C8B2E7BE789074D66EBCCF073F9FD5A /* AFNetworkActivityIndicatorManager.h */, + 562D0D3624D662E4E7C8BA29C4EEE4CE /* AFNetworkActivityIndicatorManager.m */, + 90AD7B766CBC048FE123FE61E2654B47 /* UIActivityIndicatorView+AFNetworking.h */, + 0EE5F4139E042A97EA8F204D49E3422B /* UIActivityIndicatorView+AFNetworking.m */, + D7EFA1C924C18B4342EA91248D504287 /* UIAlertView+AFNetworking.h */, + BF072250768A53474C1EF3BB0DC63596 /* UIAlertView+AFNetworking.m */, + 205D879035D467AA2198F6EF9D08634B /* UIButton+AFNetworking.h */, + A1D159C0E7BD18F18C50F813353921AE /* UIButton+AFNetworking.m */, + 146868522E267C080A54A81CB89548B2 /* UIImage+AFNetworking.h */, + 44D9B337ADF3E0E8CB0829C7645476C3 /* UIImageView+AFNetworking.h */, + A220D00E4C7BA313322B421B988F84CD /* UIImageView+AFNetworking.m */, + 03A638278DABD02F40DD183172678CA8 /* UIKit+AFNetworking.h */, + 0C7D2B4FE55CDDA037B5C54654B21435 /* UIProgressView+AFNetworking.h */, + BA0CC9FA3EFC9E4572D5B7B8AD895BC8 /* UIProgressView+AFNetworking.m */, + 0D49465E8799A20F9FB58E2983FE5BD6 /* UIRefreshControl+AFNetworking.h */, + 12E2EB9002BE99A16275FC057B096C4E /* UIRefreshControl+AFNetworking.m */, + 45B3C92C6740A6769F005B08144F0398 /* UIWebView+AFNetworking.h */, + 96DA87697DF0D7DB55D1BBC8AE70968A /* UIWebView+AFNetworking.m */, + ); + name = UIKit; + sourceTree = ""; + }; + 339F83A98F822D90A33F164759C78E83 /* Products */ = { + isa = PBXGroup; + children = ( + 0DF67F310A21B2589AEFF2786401A46B /* AFNetworking.framework */, + 688CDA9EA90EEBC8015BDD288D3F626F /* FSHelpers_Swift.framework */, + 38A104D73A27726D741BA2FCC9C9F62D /* MagicalRecord.framework */, + D83713637529C27EC3A774EB2B819E16 /* Pods.framework */, + 20E52ABB730F66E79F84F484EED886F2 /* SDWebImage.framework */, + BA51BED25644F8D68D7B6238136D4B32 /* VK_ios_sdk.framework */, + ); + name = Products; + sourceTree = ""; + }; + 465D739DE21224108A3B23655DBC615D /* Support Files */ = { + isa = PBXGroup; + children = ( + 7E874BD12335FBE1CA46F0348B229166 /* Info.plist */, + B70703D5CE50C6DF45C342F7536ACEC4 /* MagicalRecord.modulemap */, + 3C7E0C2F93D80675C3B4C326C92E6321 /* MagicalRecord.xcconfig */, + CEE39FC9BB7F88F270149DB2E908D3E5 /* MagicalRecord-dummy.m */, + 63520E35F4B59449A6BD8520C2B4E748 /* MagicalRecord-prefix.pch */, + E7464829F96F2BD8D09B54ADDE8A4C3D /* MagicalRecord-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/MagicalRecord"; + sourceTree = ""; + }; + 476405246DD5318980DCAB7599D5D887 /* FSHelpers+Swift */ = { + isa = PBXGroup; + children = ( + 577C96E1A5A0A74C9DD319F235217DD0 /* FSE+Array.swift */, + 6CFF5C2FAD320FD2DF75D15645B265B0 /* FSE+Dictionary.swift */, + 1756FDEE6E67D7E4B9AA78F6408BC1B9 /* FSE+Double.swift */, + 7A7B49A45A67051CA0B6F0B0ABF7501E /* FSE+NSDate.swift */, + C1A477B1CAA3F662661AF4CAA294B929 /* FSE+String.swift */, + 05143787791B36F06250AC233BD278E3 /* FSE+UIColor.swift */, + 8B0E26C12DC92DBD0B123449DD675C25 /* FSE+UIImage.swift */, + 353897333CD0412EF9EBD393329F0051 /* FSE+UITableView.swift */, + DF320B7C9C606E3414D84AFB606139E8 /* FSE+UITextView.swift */, + 606EA07A1D27C1ADBD6A6890C804B1CD /* FSE+UIView.swift */, + F390DE53862AAEDB25A25C7D84558D4E /* FSHelpers.swift */, + CD49D7457A5898B5AA602B685763C033 /* Support Files */, + ); + path = "FSHelpers+Swift"; + sourceTree = ""; + }; + 52C6DED295E7BC45E8F48988483F5271 /* NSURLConnection */ = { + isa = PBXGroup; + children = ( + FAB9871C3C4A71C2450D492DD8719A4F /* AFHTTPRequestOperation.h */, + 07DD635AB9224364E57D5D6CAF1DF7A3 /* AFHTTPRequestOperation.m */, + 1C89FE439B45BA1FBB5F0C647C83165A /* AFHTTPRequestOperationManager.h */, + 37DA3226D8FF6AB58895C240752EEE92 /* AFHTTPRequestOperationManager.m */, + 1D9443B99A68B01EE454712592075AF5 /* AFURLConnectionOperation.h */, + 7377F8316B50BE0E397171CDFA25BE6F /* AFURLConnectionOperation.m */, + ); + name = NSURLConnection; + sourceTree = ""; + }; + 7ACF0B2890DB864D0C79315CEAF66B64 /* MagicalRecord */ = { + isa = PBXGroup; + children = ( + 66BFA812DB5E5154EFB3CF07E7D8795E /* MagicalImportFunctions.h */, + 73804EA4D2DA84A49E56BE25CED0323A /* MagicalImportFunctions.m */, + 60BC7F4F0DDAE89117B825BE7A17FA71 /* MagicalRecord.h */, + E58F3E4E6691BE619DCFCE43A2BEE137 /* MagicalRecord+Actions.h */, + 344569E9480EF3DA39180B0837A25DE3 /* MagicalRecord+Actions.m */, + E806F223B053F32E9FF52AAAF02F3123 /* MagicalRecord+ErrorHandling.h */, + D08AA138BC564F682ECC44AAE2412732 /* MagicalRecord+ErrorHandling.m */, + 021B260C85CD33E9F51CFD2E698A573F /* MagicalRecord+iCloud.h */, + 14E903B4AE4522E44A6A92AD59B68702 /* MagicalRecord+iCloud.m */, + E73C072418D998D16612089AFC06EE9A /* MagicalRecord+Options.h */, + A02CC1C2EB217ECBD40021C8C0791DBB /* MagicalRecord+Options.m */, + 95EDC08FDF81B8BB7975CA6FA8DD1357 /* MagicalRecord+Setup.h */, + EE5E662C115A021EFC70E57794147BB0 /* MagicalRecord+Setup.m */, + 5BDA6683CE8A4EB965FC92D5E9D0B547 /* MagicalRecord+ShorthandMethods.h */, + 4CFE7F037CFF94E1C419558C0A78C804 /* MagicalRecord+ShorthandMethods.m */, + EAC70F09CB2ACF1251DBFF161F0B59B3 /* MagicalRecordDeprecationMacros.h */, + 75C4B7459DEA2D6EEFF43A4D67C3DD15 /* MagicalRecordInternal.h */, + B4BB0CF5D47A4E94614BDFE0308E7127 /* MagicalRecordInternal.m */, + 6D3CDBDBE6816CBCFA6B3FB18413BD40 /* MagicalRecordLogging.h */, + 239647F3E13A2BC210ADF981DAD3E977 /* MagicalRecordShorthandMethodAliases.h */, + 276ADBB44B87DE827C19BE46C360492B /* NSAttributeDescription+MagicalDataImport.h */, + 967F0A407D46DC0C2637608A24F5DC36 /* NSAttributeDescription+MagicalDataImport.m */, + 8FF384C4CD58C9AAACBA9BE15130FEBC /* NSEntityDescription+MagicalDataImport.h */, + 71B7796ADD8E9B0904A711B4F256D588 /* NSEntityDescription+MagicalDataImport.m */, + 38F262C37CEC9568FF62D55EBF95BDFA /* NSManagedObject+MagicalAggregation.h */, + 269A6D876B29D5CC469298E172E2612F /* NSManagedObject+MagicalAggregation.m */, + 21D838F2F6FC5278BEBDCA31A243548C /* NSManagedObject+MagicalDataImport.h */, + 0A6286DABBA17F5AD91FCF2B014C2B0B /* NSManagedObject+MagicalDataImport.m */, + 9EA18F9CA5C1EF102D14951A52F68E9B /* NSManagedObject+MagicalFinders.h */, + 45285D5AF9062E3890E13A50BB90F0D1 /* NSManagedObject+MagicalFinders.m */, + 7DDB8DDB27F1AAF709108B98003FB40B /* NSManagedObject+MagicalRecord.h */, + 6B029DD39F29EA9186FF68BFB6ACED9B /* NSManagedObject+MagicalRecord.m */, + E00669A5EF5C331CE610BA3E2DD6B653 /* NSManagedObject+MagicalRequests.h */, + B5F92D02054F19E30C96ACE0CA7215D3 /* NSManagedObject+MagicalRequests.m */, + AF387099925E95E2BF3D3EE21484DB20 /* NSManagedObjectContext+MagicalChainSave.h */, + A6B9859FA047ED846B8D304492980F79 /* NSManagedObjectContext+MagicalChainSave.m */, + F893819961D9C6B069D3F2EB187AAA60 /* NSManagedObjectContext+MagicalObserving.h */, + 46E425C522CC16BFF7C2D4D93CC0FAE6 /* NSManagedObjectContext+MagicalObserving.m */, + B95C9730F5C5AEAD3DCF7EA13D51F38A /* NSManagedObjectContext+MagicalRecord.h */, + 98A4B2D1F357388334F68514235C513A /* NSManagedObjectContext+MagicalRecord.m */, + 7562C14FFFE011449825B46B66D47757 /* NSManagedObjectContext+MagicalSaves.h */, + 1713DDDF036127FC7C2FC1FD4214C4AE /* NSManagedObjectContext+MagicalSaves.m */, + 3540AFC3A5D699A88836931375CCF0F9 /* NSManagedObjectContext+MagicalThreading.h */, + 769A7581AB9D6C153EE709F21630A847 /* NSManagedObjectContext+MagicalThreading.m */, + D81B4D934F747FFB5962D4D031300360 /* NSManagedObjectModel+MagicalRecord.h */, + 1F75181C63355B96D183E17CFB891FE1 /* NSManagedObjectModel+MagicalRecord.m */, + DB57EE1252EA7EF343F7CE5C96716D9D /* NSNumber+MagicalDataImport.h */, + CD05DB70C9B8F6BD2FAC00BF14E94FB6 /* NSNumber+MagicalDataImport.m */, + 50475C7CD24F20E1425B3A9C72AFD07D /* NSObject+MagicalDataImport.h */, + F2C8076A4367F432B4869457710D3886 /* NSObject+MagicalDataImport.m */, + BCBD642E3D7F950433A9CBD96248BE8C /* NSPersistentStore+MagicalRecord.h */, + 92707F37C1AAF1F4D479033121742721 /* NSPersistentStore+MagicalRecord.m */, + 55FBAC7AC5DE48744285348417CDEAD0 /* NSPersistentStoreCoordinator+MagicalRecord.h */, + 1F90F00B0B49AD24C036C5DD9D338C59 /* NSPersistentStoreCoordinator+MagicalRecord.m */, + CB8CC73E1198A10582D126E0D3CB2503 /* NSRelationshipDescription+MagicalDataImport.h */, + B27DAA512A10DFABCEF0678F52DCE2A4 /* NSRelationshipDescription+MagicalDataImport.m */, + 908EE49484B48FC7B52931CBFEC9C7BB /* NSString+MagicalDataImport.h */, + 9FF15E31ABE9DC0FB4B133E6386D6C1C /* NSString+MagicalDataImport.m */, + 465D739DE21224108A3B23655DBC615D /* Support Files */, + ); + path = MagicalRecord; + sourceTree = ""; + }; + 7DB346D0F39D3F0E887471402A8071AB = { + isa = PBXGroup; + children = ( + BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */, + 876F80F8AFD1240ED0B7B9EA9C5BFAD8 /* Frameworks */, + B1844935522FDBEBFCF6644B1FD4CE87 /* Pods */, + 339F83A98F822D90A33F164759C78E83 /* Products */, + AA81B0033EB5201B56FF5BE91E23C382 /* Targets Support Files */, + ); + sourceTree = ""; + }; + 7EE24967550C62524F3726CB89F753BF /* iOS */ = { + isa = PBXGroup; + children = ( + 276ADBBA17F9E4DCB540724799C0446C /* CoreData.framework */, + CB6066063B48D3EAC1E909311CD0FB2A /* CoreGraphics.framework */, + 9382A6D4252264618D0117AC1069D871 /* Foundation.framework */, + C90A3CC926EA128D80EA3EC24BE2FCAE /* ImageIO.framework */, + 9EA632290B8EF3684394F5F39ABCA1C3 /* MobileCoreServices.framework */, + 024F32113F833BE193E18688BB520561 /* QuartzCore.framework */, + EC58FA8B3DFD0AF722E12886BC8AAECD /* SafariServices.framework */, + 24F010A013E6DF829F2DE6B7A5F950B7 /* Security.framework */, + CEF47E684574DD6B8012F5FCA701B4FB /* SystemConfiguration.framework */, + 340BD3CB8A2BE41C34DE26C9CC80DE47 /* UIKit.framework */, + ); + name = iOS; + sourceTree = ""; + }; + 8243A678478357EE90B464881AB000C5 /* SDWebImage */ = { + isa = PBXGroup; + children = ( + 185791ACB2A5870CE9725DE1914B7E11 /* Core */, + B03C60C3AF6F2944A73DCFFC9E44F6EA /* Support Files */, + ); + path = SDWebImage; + sourceTree = ""; + }; + 876F80F8AFD1240ED0B7B9EA9C5BFAD8 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 7EE24967550C62524F3726CB89F753BF /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + 9798CFB66E27BBA6B39234434F86E1C8 /* Support Files */ = { + isa = PBXGroup; + children = ( + 88A7FE96C599EFF1F27D3D34C4DAD21D /* AFNetworking.modulemap */, + 91F3786F71EA2B2A89AD32D8BA323514 /* AFNetworking.xcconfig */, + BDD7062C3B55ED1A6C64C50E479894C3 /* AFNetworking-dummy.m */, + 1C0508C7FE80247C22A20E5A3145D05B /* AFNetworking-prefix.pch */, + 07045992E333B7A71663CC5E90D70520 /* AFNetworking-umbrella.h */, + 76C8FED475633B4F481C181A9C1A834E /* Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/AFNetworking"; + sourceTree = ""; + }; + A01F96E02353D5C19705393C31232E96 /* Support Files */ = { + isa = PBXGroup; + children = ( + E2D692415D8A3D176070945C19A19E70 /* Info.plist */, + 54224BDDB981DCBDE3D50967BD8C8FBA /* VK-ios-sdk.modulemap */, + 22A08F694018BCF5F6A9889AA537CBA3 /* VK-ios-sdk.xcconfig */, + 7654753CC884AD462EBB4AC18C0B3016 /* VK-ios-sdk-dummy.m */, + 354034E942BB4E32E03AFDFEF1C3AE92 /* VK-ios-sdk-prefix.pch */, + 1990ACCF3924B1C99C0FAD54EA7F1758 /* VK-ios-sdk-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/VK-ios-sdk"; + sourceTree = ""; + }; + AA81B0033EB5201B56FF5BE91E23C382 /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + 1CAF78575181CCCA49FC2C8F39F2FCB0 /* Pods */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + AC61982E8513768D294E35A04D44B890 /* AFNetworking */ = { + isa = PBXGroup; + children = ( + A0DCECBE25AE9FD26B9B58140965BDC4 /* AFNetworking.h */, + 52C6DED295E7BC45E8F48988483F5271 /* NSURLConnection */, + ED96241068786B66D0B83FFB66C69E81 /* NSURLSession */, + 0DB3768BA98AAFEC61C130F05A73ACC4 /* Reachability */, + B34A26E2DD8E357BF728CDD724DBC10F /* Security */, + EA2461CBB62EA47738B3F9DFE39CC8E4 /* Serialization */, + 9798CFB66E27BBA6B39234434F86E1C8 /* Support Files */, + 319124E2A4172CBB51711A56022B138A /* UIKit */, + ); + path = AFNetworking; + sourceTree = ""; + }; + B03C60C3AF6F2944A73DCFFC9E44F6EA /* Support Files */ = { + isa = PBXGroup; + children = ( + 6434470EB7046175533C2A7EE559E7A3 /* Info.plist */, + F8CC4EC7299DEDCB731E9234C2FFB46C /* SDWebImage.modulemap */, + ED24697386EAC6549C781263D8DDFE14 /* SDWebImage.xcconfig */, + 97A611F7C094E902D652F0A1AF00D1FF /* SDWebImage-dummy.m */, + A2EBF22716D56EF1BB93209A0D80FE68 /* SDWebImage-prefix.pch */, + 7437F398A1CC077AC02CDF999E825EC4 /* SDWebImage-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/SDWebImage"; + sourceTree = ""; + }; + B1844935522FDBEBFCF6644B1FD4CE87 /* Pods */ = { + isa = PBXGroup; + children = ( + AC61982E8513768D294E35A04D44B890 /* AFNetworking */, + 476405246DD5318980DCAB7599D5D887 /* FSHelpers+Swift */, + 7ACF0B2890DB864D0C79315CEAF66B64 /* MagicalRecord */, + 8243A678478357EE90B464881AB000C5 /* SDWebImage */, + 2A1786B40A84ACB9DC53FA6BB912FB1F /* VK-ios-sdk */, + ); + name = Pods; + sourceTree = ""; + }; + B34A26E2DD8E357BF728CDD724DBC10F /* Security */ = { + isa = PBXGroup; + children = ( + FFF46FEBEDC7276A918416C9E6E46DFD /* AFSecurityPolicy.h */, + B23BDDA81ADC14D5D854DE2C8C1A1159 /* AFSecurityPolicy.m */, + ); + name = Security; + sourceTree = ""; + }; + CD49D7457A5898B5AA602B685763C033 /* Support Files */ = { + isa = PBXGroup; + children = ( + 5F682D7B06B7F4F6D38C7B5A2656EA19 /* FSHelpers+Swift.modulemap */, + EE6F98422250B7D75629C24B3BFAB70C /* FSHelpers+Swift.xcconfig */, + DDCD0A29450F2A8D6199CF6A69136DB0 /* FSHelpers+Swift-dummy.m */, + E3E5A1792E518E463B81B3DF5A8AFDDD /* FSHelpers+Swift-prefix.pch */, + 94231952C87A753A2D0D590D4FA8020D /* FSHelpers+Swift-umbrella.h */, + 4FAF2E40605B356592476B27E7818A9D /* Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/FSHelpers+Swift"; + sourceTree = ""; + }; + DFB849AFE778B4882403C06CD90C8272 /* Resources */ = { + isa = PBXGroup; + children = ( + 957440F9C89943F6361D92718BC610AF /* VKSdkResources.bundle */, + ); + name = Resources; + sourceTree = ""; + }; + EA2461CBB62EA47738B3F9DFE39CC8E4 /* Serialization */ = { + isa = PBXGroup; + children = ( + D619D15871F376F659C33F4BEE3C97DB /* AFURLRequestSerialization.h */, + 4580A6DBE586D529E2DAA87209AB2568 /* AFURLRequestSerialization.m */, + 702BC3157376FB0268BEC87FC021438D /* AFURLResponseSerialization.h */, + 0B83FB9FA4E8E7A8E3A59CDC0D1EF6EB /* AFURLResponseSerialization.m */, + ); + name = Serialization; + sourceTree = ""; + }; + ED96241068786B66D0B83FFB66C69E81 /* NSURLSession */ = { + isa = PBXGroup; + children = ( + 27041EABC6F7592A703D536BBB56BB05 /* AFHTTPSessionManager.h */, + DBB46DD6C992B3267367B881AC91DA8E /* AFHTTPSessionManager.m */, + E21A3484B1F47EDC88D31E3B905D0B23 /* AFURLSessionManager.h */, + B0416C08408E29B03DDCFA714FE34E19 /* AFURLSessionManager.m */, + ); + name = NSURLSession; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 5CBAD43044B144630087BF6516DECA16 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 0E1548093CDCE75E2807E18BB466BDAD /* AFHTTPRequestOperation.h in Headers */, + 824EB2574FD207D57FCC6791BD48C254 /* AFHTTPRequestOperationManager.h in Headers */, + 5D7129CD978AD8AD8CC0CC2A9A6332E0 /* AFHTTPSessionManager.h in Headers */, + C4A596775FE729E13A119CAD3210A99C /* AFNetworkActivityIndicatorManager.h in Headers */, + FCBDA0BC8866EAA9CE5DBE734E922861 /* AFNetworking-umbrella.h in Headers */, + 204F308E96D1FD806274AEA1A13B6B20 /* AFNetworking.h in Headers */, + 47C66C3FA72DE0E4F301E48E472722C5 /* AFNetworkReachabilityManager.h in Headers */, + 34C7345081A9099032D2DD6ACFD3B015 /* AFSecurityPolicy.h in Headers */, + 17C26BF91F1C3E82258D2C6E2ADB094B /* AFURLConnectionOperation.h in Headers */, + CFABF6FC21B980B79BBF8D7CD1F6DFC7 /* AFURLRequestSerialization.h in Headers */, + 59F1576E4873715F0A40C1DEA3A9619E /* AFURLResponseSerialization.h in Headers */, + 9FC2D648F6D1B8574DB4D08C5EB97B47 /* AFURLSessionManager.h in Headers */, + 2882BE2377E8FC2421C2CA879467AE65 /* UIActivityIndicatorView+AFNetworking.h in Headers */, + E545A82A0403185DE1149929FF57E5AF /* UIAlertView+AFNetworking.h in Headers */, + A4CB3550A0219B0E645492FBA2436924 /* UIButton+AFNetworking.h in Headers */, + 400B514DB9D87FC01ECFD336A05D450C /* UIImage+AFNetworking.h in Headers */, + F1033AD1301FB934D5A283063724E96F /* UIImageView+AFNetworking.h in Headers */, + AB34A7628A42D1ADFB3355D32D51634E /* UIKit+AFNetworking.h in Headers */, + 7D7DAB989FB25A2C6CF69600378BC8C0 /* UIProgressView+AFNetworking.h in Headers */, + 5E295E5AC9A5373F6B94863F7AB6D056 /* UIRefreshControl+AFNetworking.h in Headers */, + E77D53BE66AAB24ADDF385997041C6BF /* UIWebView+AFNetworking.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 916913889FB171E0DE4AC9B48B07AB37 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + CB49CB8BEE386B1C25BE3647964CFDC2 /* Pods-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9C57E9DFD66FD4E649004E7845C01153 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + B780B3B83CEE9600960816C8531B6445 /* FSHelpers+Swift-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9D48AA8EAB474F201658D7656F2AC7B7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 34A177E5296911DDB4E430A82ACCB64B /* NSData+ImageContentType.h in Headers */, + 727E87F437DDC37EBE96D60AD20F05C3 /* SDImageCache.h in Headers */, + 6508C3C9DDE78837D9D6DCD85BAB137E /* SDWebImage-umbrella.h in Headers */, + 7F51237FF442AAC50B32A4FBD0C9636B /* SDWebImageCompat.h in Headers */, + 903F758794754A0F61FF598A9357C1B3 /* SDWebImageDecoder.h in Headers */, + B69889803343F92117ADE09364C700D6 /* SDWebImageDownloader.h in Headers */, + 407C2477A514E0D015CE201DC3040600 /* SDWebImageDownloaderOperation.h in Headers */, + C866BB6CC70FAC30F2134082E013CE85 /* SDWebImageManager.h in Headers */, + D7CB2530A9C0EF56F0A418EAAD4EF03C /* SDWebImageOperation.h in Headers */, + A39AA3BE388CDBE99AA1F144F1BD47EB /* SDWebImagePrefetcher.h in Headers */, + 9B10E1B4ED5EF579C65C6739F8AF1B08 /* UIButton+WebCache.h in Headers */, + 739888A46EADAA177440476AFF0ACB76 /* UIImage+GIF.h in Headers */, + 2F06B9F672E672810C0228E991E0BCA0 /* UIImage+MultiFormat.h in Headers */, + 885DCB857BED64366CD0414FFEC57918 /* UIImageView+HighlightedWebCache.h in Headers */, + 2DBC831C00474A7A52AD4C8705472BB5 /* UIImageView+WebCache.h in Headers */, + C03955BC3E8FAD8323F6A54AECFCFF85 /* UIView+WebCacheOperation.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A359E94ACCC9BB2F92AB46641EC76BD0 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 0B379B6CEFB17721877BC33B6344DDE7 /* NSData+MD5.h in Headers */, + 24CBB179B4BECCF49ECBE2C0FA1C3528 /* NSError+VKError.h in Headers */, + 884AFB443EFD7C014FBED9430619FC97 /* NSString+MD5.h in Headers */, + B74543C1D34E87B0029C19DE296E2D6C /* OrderedDictionary.h in Headers */, + 4AF03CEF9D62284839DEDF282051A296 /* VK-ios-sdk-umbrella.h in Headers */, + D50687DA23F3324D2A93D4FBBE39F9AC /* VKAccessToken.h in Headers */, + 975ED8F9AAB206ED75BB64832F1558EA /* VKActivity.h in Headers */, + A95E3CF2E6AFFD0EBA0F9243EBE0D277 /* VKApi.h in Headers */, + 16692DBAAAF03D52D7DC82E2B1CA26A3 /* VKApiBase.h in Headers */, + 06A1D889F41FC751E2819344372FBA67 /* VKApiCaptcha.h in Headers */, + 94CC77C4067608AF0C0B18986B7F0D36 /* VKApiConst.h in Headers */, + 03A4A15339FAA5A05916007578D33018 /* VKApiFriends.h in Headers */, + 4BA75222986126911EE5398E7BAD01E1 /* VKApiGroups.h in Headers */, + 5D012A226951EE3B34E87C3AEEE62B84 /* VKApiModels.h in Headers */, + 686BC6937CAE77DD805397717F6EBC52 /* VKApiObject.h in Headers */, + 928196C4C1432FE1205B508ECF45ABA8 /* VKApiObjectArray.h in Headers */, + 06B2244136E373B7A5AFAFD51325F9BD /* VKApiPhotos.h in Headers */, + 291B1234462A24C47A12E8CA15CF85FE /* VKApiUsers.h in Headers */, + 106FC9E7FC58B50211F24BF02130B732 /* VKApiWall.h in Headers */, + EF342A50B60D99AC3B6105F596B5DEF7 /* VKAudio.h in Headers */, + 7C17A82751B5633249468B4477E8E8E6 /* VKAuthorizationResult.h in Headers */, + 6DB953C6CA6DC5CC8110F46CC4002A7B /* VKAuthorizeController.h in Headers */, + B99DD521195BB3CB12ECAA6939D3006F /* VKBatchRequest.h in Headers */, + F88C0E6DE5AC49863509F37F75FCAA7B /* VKBundle.h in Headers */, + 03B2775C1E1FAD8B617AD1A5264635F8 /* VKCaptchaView.h in Headers */, + 0B8AF25ED975F75779E49932B1009728 /* VKCaptchaViewController.h in Headers */, + 55C3344C29A6E2E90CA88EC064C8CB77 /* VKCounters.h in Headers */, + 054BC5DDB42F7A646B88CEA89EF9BA86 /* VKError.h in Headers */, + B98978495A4E311729BD4DC109A4BEAE /* VKGroup.h in Headers */, + A1CDBC9E34923C72D92CD2700D84B2B3 /* VKHTTPClient.h in Headers */, + 76FBF00F0B08B995DB26A240D43DAA44 /* VKHTTPOperation.h in Headers */, + 4E0E0D6B04E41AAB0423E577640AE062 /* VKImageParameters.h in Headers */, + C56486FF84F427973FCD9996FF0DEA29 /* VKJSONOperation.h in Headers */, + 530F7C0FBD424EDBD70D7A1C238BFD85 /* VKLikes.h in Headers */, + E7480BF3024B8455144C52DEE9828089 /* VKObject.h in Headers */, + 0030569EC6F7C3C9F8242B1C5AB32DCD /* VKOperation.h in Headers */, + 23E2066A7E9CA5FC52E235AA552FAB2F /* VKPermissions.h in Headers */, + 3BA806775193D365919BE19DF69F9883 /* VKPhoto.h in Headers */, + 33CE122D6CA60443C1220903DDF51775 /* VKPhotoSize.h in Headers */, + 171686A1897980922731CA7B5A8B8401 /* VKRelative.h in Headers */, + 7274F17440CDF2D7E148E1D04ACC9020 /* VKRequest.h in Headers */, + B26BE8070598230F5A42D38F258CD3BB /* VKRequestsScheduler.h in Headers */, + 257AFDCDF0383CD3F7A11A3ACCE316C0 /* VKResponse.h in Headers */, + 324E7901734B7B3CF94B389B3F8199A7 /* VKSchool.h in Headers */, + 8143F69FF926253FCE2FB2D02B00D311 /* VKSdk.h in Headers */, + F33391FC1B0FDB33D085F6FD1079C792 /* VKSdkVersion.h in Headers */, + 0118770ACFD36A90A368A4C87765C5C9 /* VKShareDialogController.h in Headers */, + 5E8285AEE2CD73AF0A10DC48E0C7FDC0 /* VKSharedTransitioningObject.h in Headers */, + E333313B64A195D32B209A6727BD8E2B /* VKUniversity.h in Headers */, + EFBFA8B3FF8A5422A8C167963A573A7E /* VKUploadImage.h in Headers */, + 87208C5DECF2F5602D2F32961A9404B1 /* VKUploadMessagesPhotoRequest.h in Headers */, + C17F389C1A633E6AC888527FFCC9E637 /* VKUploadPhotoBase.h in Headers */, + BC9687C602078FA8B1A7761E9E263625 /* VKUploadPhotoRequest.h in Headers */, + 03BC01DC376505B1696A86D0C6FB2B2D /* VKUploadWallPhotoRequest.h in Headers */, + 39F0A159E7343857E0B7CD5EFD767AFC /* VKUser.h in Headers */, + DFFF5D143FE089AEA49571FCB9416C1A /* VKUtil.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D769378F3265020E3878409CD6A2989C /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + A28A9AE59E8E6FA7D4652D8D10852149 /* MagicalImportFunctions.h in Headers */, + 5B00374D3D3B0137797495E6204268A2 /* MagicalRecord+Actions.h in Headers */, + D6B45F9539F3BC48E91141911944665E /* MagicalRecord+ErrorHandling.h in Headers */, + A39CD90B1902A8F482A0229B6535E38F /* MagicalRecord+iCloud.h in Headers */, + B4F653D1F700ACD5AD121559579229D1 /* MagicalRecord+Options.h in Headers */, + 42C73B49C777583B6CAC4CAFB984370A /* MagicalRecord+Setup.h in Headers */, + 2B417BAAF97B639CDA094654D5A7C76C /* MagicalRecord+ShorthandMethods.h in Headers */, + AFAE43E7F4E2F2700AD8EAA5377808C7 /* MagicalRecord-umbrella.h in Headers */, + EA35017FFC45ACF8DB07ECA7273A7814 /* MagicalRecord.h in Headers */, + BB95485AEEC37D04AA87C2799DAAD40F /* MagicalRecordDeprecationMacros.h in Headers */, + 8C232DE5F46B6DC68267392CCB3FBEA9 /* MagicalRecordInternal.h in Headers */, + B9E1D0853B60953A8DBDAB545EF85446 /* MagicalRecordLogging.h in Headers */, + DAB06B0360990CF26615990E3E5ADA03 /* MagicalRecordShorthandMethodAliases.h in Headers */, + C0D57C25AD592CA7301C1F6B1105A6AA /* NSAttributeDescription+MagicalDataImport.h in Headers */, + 423698669A7E33B7CF8D457F77172F3A /* NSEntityDescription+MagicalDataImport.h in Headers */, + DE298DEEB7932CE31AD87997CC48CB4C /* NSManagedObject+MagicalAggregation.h in Headers */, + C25A453B10F3723738200716FEC2E760 /* NSManagedObject+MagicalDataImport.h in Headers */, + 3AB6061A7C819691F4C64439A9DF301E /* NSManagedObject+MagicalFinders.h in Headers */, + 69B5FD3EF01FFA1DE9D9AE13A1BA139C /* NSManagedObject+MagicalRecord.h in Headers */, + F080F5FF04BCE148EF695C74977530CA /* NSManagedObject+MagicalRequests.h in Headers */, + FEED8A5A1CD3155F407ACA912C239A9A /* NSManagedObjectContext+MagicalChainSave.h in Headers */, + 1D25E516C199714AEA5CA5F659CCCE78 /* NSManagedObjectContext+MagicalObserving.h in Headers */, + 0A4073F0F0E0FD5ADA889FA44A9BB51C /* NSManagedObjectContext+MagicalRecord.h in Headers */, + F9D5BDB5A9863478100780CCF5CECE90 /* NSManagedObjectContext+MagicalSaves.h in Headers */, + 8AE17AD5A3C6FDE46C108C35226ACABB /* NSManagedObjectContext+MagicalThreading.h in Headers */, + 928FDDA96F2801C07BE65C799716D9EE /* NSManagedObjectModel+MagicalRecord.h in Headers */, + F91242ED504E8C3E87D16D0753D0F38D /* NSNumber+MagicalDataImport.h in Headers */, + 716058EEB86C24CD2A9963D325FFB11A /* NSObject+MagicalDataImport.h in Headers */, + 531E011974C43CA8B6E8DE8A84B40CB7 /* NSPersistentStore+MagicalRecord.h in Headers */, + 68A9CCF311B01C961886D3A20BC3D14B /* NSPersistentStoreCoordinator+MagicalRecord.h in Headers */, + A646AB1DC187BDFA7B614CBD2CC2C329 /* NSRelationshipDescription+MagicalDataImport.h in Headers */, + AC8D580DF124A0A2D7FB8A67EC0B1F92 /* NSString+MagicalDataImport.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 3E8869F00367E6AD1554FDEEDFFBE3C6 /* VK-ios-sdk */ = { + isa = PBXNativeTarget; + buildConfigurationList = B5A3DDFA9592AC2C711F1B7A6B5D14A2 /* Build configuration list for PBXNativeTarget "VK-ios-sdk" */; + buildPhases = ( + 2B88E3BA1D5C5EAD4F0AEC4442C8B780 /* Sources */, + DD1DFE546C8C31A20A2A01742DDEB270 /* Frameworks */, + A359E94ACCC9BB2F92AB46641EC76BD0 /* Headers */, + 818601BA0C047D6053BA3FA8DDA9FEC9 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "VK-ios-sdk"; + productName = "VK-ios-sdk"; + productReference = BA51BED25644F8D68D7B6238136D4B32 /* VK_ios_sdk.framework */; + productType = "com.apple.product-type.framework"; + }; + 7DBF54ED7C8060AFC783C08A27B453BE /* Pods */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2F6BB7505ABCFFDB179A4115EA6720E0 /* Build configuration list for PBXNativeTarget "Pods" */; + buildPhases = ( + A138A7C5A10A39C72A178BF053DC2F11 /* Sources */, + 4F8AC0F585B55653C4924E5ED48CBD71 /* Frameworks */, + 916913889FB171E0DE4AC9B48B07AB37 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + D04114B09FDE7C91C8D3F923C2958EAB /* PBXTargetDependency */, + 15A0FBD6CDA1D60EC4461D4E511CACC8 /* PBXTargetDependency */, + 43C8AD8E405A109E10A6F5E22F648183 /* PBXTargetDependency */, + 2AE2F04888826250231203DDB062AD89 /* PBXTargetDependency */, + 31BBA0BB345232DD9749EEFC0ED3AD68 /* PBXTargetDependency */, + ); + name = Pods; + productName = Pods; + productReference = D83713637529C27EC3A774EB2B819E16 /* Pods.framework */; + productType = "com.apple.product-type.framework"; + }; + A5DFC851CDF2FAEED678C23407C6E244 /* AFNetworking */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8AF69AC0F1153A6514674F4360579D05 /* Build configuration list for PBXNativeTarget "AFNetworking" */; + buildPhases = ( + 00DA0860B8B7E3BDF91DDDF14EB3C5D1 /* Sources */, + FABCF001C825245E47D6397E6670D844 /* Frameworks */, + 5CBAD43044B144630087BF6516DECA16 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AFNetworking; + productName = AFNetworking; + productReference = 0DF67F310A21B2589AEFF2786401A46B /* AFNetworking.framework */; + productType = "com.apple.product-type.framework"; + }; + AD47E339A26F876F910CD9E671989350 /* MagicalRecord */ = { + isa = PBXNativeTarget; + buildConfigurationList = C3DD98F93CFF0CDAF92F03F2D77E6BF2 /* Build configuration list for PBXNativeTarget "MagicalRecord" */; + buildPhases = ( + 599C5A9217D2613663CFF2AE142CB5EB /* Sources */, + 112BDE3F79ACCBC59869EBA062F513F9 /* Frameworks */, + D769378F3265020E3878409CD6A2989C /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MagicalRecord; + productName = MagicalRecord; + productReference = 38A104D73A27726D741BA2FCC9C9F62D /* MagicalRecord.framework */; + productType = "com.apple.product-type.framework"; + }; + BD3098D90737863716274F3FB21D34B4 /* SDWebImage */ = { + isa = PBXNativeTarget; + buildConfigurationList = 48A7BA27F3245F790347AFE513283EA3 /* Build configuration list for PBXNativeTarget "SDWebImage" */; + buildPhases = ( + 38BC950C66372B41FDD98A4FEE166231 /* Sources */, + 5686E2E09FC81EF5532D35DC88501975 /* Frameworks */, + 9D48AA8EAB474F201658D7656F2AC7B7 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SDWebImage; + productName = SDWebImage; + productReference = 20E52ABB730F66E79F84F484EED886F2 /* SDWebImage.framework */; + productType = "com.apple.product-type.framework"; + }; + F57A84A12251464F3567966CEB83EDDB /* FSHelpers+Swift */ = { + isa = PBXNativeTarget; + buildConfigurationList = F2C78B4BD50ED116399C6051EF403B0B /* Build configuration list for PBXNativeTarget "FSHelpers+Swift" */; + buildPhases = ( + 11275C0CAE5B316FBE19ACE11ABB17B8 /* Sources */, + D316BA1012400EFF8394256483B2F7AA /* Frameworks */, + 9C57E9DFD66FD4E649004E7845C01153 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "FSHelpers+Swift"; + productName = "FSHelpers+Swift"; + productReference = 688CDA9EA90EEBC8015BDD288D3F626F /* FSHelpers_Swift.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0700; + LastUpgradeCheck = 0700; + }; + buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7DB346D0F39D3F0E887471402A8071AB; + productRefGroup = 339F83A98F822D90A33F164759C78E83 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A5DFC851CDF2FAEED678C23407C6E244 /* AFNetworking */, + F57A84A12251464F3567966CEB83EDDB /* FSHelpers+Swift */, + AD47E339A26F876F910CD9E671989350 /* MagicalRecord */, + 7DBF54ED7C8060AFC783C08A27B453BE /* Pods */, + BD3098D90737863716274F3FB21D34B4 /* SDWebImage */, + 3E8869F00367E6AD1554FDEEDFFBE3C6 /* VK-ios-sdk */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 818601BA0C047D6053BA3FA8DDA9FEC9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1DF0AF8ACEBA9ED7C731801D493EA1D3 /* VKSdkResources.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 00DA0860B8B7E3BDF91DDDF14EB3C5D1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4BB3EA4A10F948E503AFAA8B5BC8227D /* AFHTTPRequestOperation.m in Sources */, + 1ECBE6788B4B35C0A8445E38FA182D2C /* AFHTTPRequestOperationManager.m in Sources */, + C316F34E25BD5B0453C6B11DA191EBBA /* AFHTTPSessionManager.m in Sources */, + 6AE317CD5B9E434DCC636BCF7C6E28F4 /* AFNetworkActivityIndicatorManager.m in Sources */, + 0B8782FD87EA4D6A9796D891FDFB81FA /* AFNetworking-dummy.m in Sources */, + 96DC46A526627958F3C1D8A942626A7A /* AFNetworkReachabilityManager.m in Sources */, + 93A6F43226C91DD31F1F3B7B1C92B17A /* AFSecurityPolicy.m in Sources */, + E86F1CB1FA3EFA9D0002ED8836615DD2 /* AFURLConnectionOperation.m in Sources */, + F83326DEEC9CD488904E548568458CF3 /* AFURLRequestSerialization.m in Sources */, + 2D14091F1AE22B3B6877CE2F5194BA0A /* AFURLResponseSerialization.m in Sources */, + 6EE083F00175248938B7EC22919C1550 /* AFURLSessionManager.m in Sources */, + EDEAD33A07F51A8FFA6B200F400ACE82 /* UIActivityIndicatorView+AFNetworking.m in Sources */, + 5CEC0BCD13065D2F4C7CA64103407AFD /* UIAlertView+AFNetworking.m in Sources */, + 12F8F095C78FFC929CBF283E1B5783C5 /* UIButton+AFNetworking.m in Sources */, + 5B4CB552A92D0FA5AAA345D21262A249 /* UIImageView+AFNetworking.m in Sources */, + B33913C94574BECF1431FD5DA4FF6514 /* UIProgressView+AFNetworking.m in Sources */, + 47545B1B9E17230D8A59D6A535F8A9BD /* UIRefreshControl+AFNetworking.m in Sources */, + EAF7D8A4E92BFF9F3EA255FDA02EAF8A /* UIWebView+AFNetworking.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 11275C0CAE5B316FBE19ACE11ABB17B8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0DD7E3DD1F4CC60A9F7131A652AC0408 /* FSE+Array.swift in Sources */, + A352E8339852C84EAB38A9D423C988A6 /* FSE+Dictionary.swift in Sources */, + 72FE3BAC7F96ED2E6BEF36B24AC5ACA3 /* FSE+Double.swift in Sources */, + 65F01CF0C6589727E00A8B73ED1C2110 /* FSE+NSDate.swift in Sources */, + D6233ECA1C5E895C190B73E0D1E6BBE6 /* FSE+String.swift in Sources */, + 649B602896140C8B7377E9FF0E63C136 /* FSE+UIColor.swift in Sources */, + 493F1C04C15A633FFB836FDAF5843A25 /* FSE+UIImage.swift in Sources */, + 51BD968A5272425BC34B023B25BCC3B6 /* FSE+UITableView.swift in Sources */, + DEA962343EB32A47A8B0383D136E4F8E /* FSE+UITextView.swift in Sources */, + EC7F8A7755FB1581432601C143CB119F /* FSE+UIView.swift in Sources */, + 3651EC8D1CF24D25FDDDF5FBE09FF0FA /* FSHelpers+Swift-dummy.m in Sources */, + 91BB10A7B88405FD2907FC2F2E18B6EE /* FSHelpers.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2B88E3BA1D5C5EAD4F0AEC4442C8B780 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E4F46EEE9D054638F315BAFFACB44A3 /* NSData+MD5.m in Sources */, + 9A25806DDAAAD63507BA23ED30FFF2E5 /* NSError+VKError.m in Sources */, + EDDB85EA0EDA4790B149F57EC96C7617 /* NSString+MD5.m in Sources */, + BB03009E1FD1B7C12EECC1EE9D3D2F0E /* OrderedDictionary.m in Sources */, + 9CBAB9E9A4754D3E62A001899B91DBF3 /* VK-ios-sdk-dummy.m in Sources */, + F675AB96665109835EF9EFF4E538EDD3 /* VKAccessToken.m in Sources */, + 5C4917B074EAEBC84917CDB90E19C909 /* VKActivity.m in Sources */, + B1CC5A46B4698303B786930309C9030F /* VKApi.m in Sources */, + DD101F3C4125C3E6CDFDA152766ECF35 /* VKApiBase.m in Sources */, + E5AFD667735FBACB059D7053A4A97B40 /* VKApiCaptcha.m in Sources */, + 4DDCDDA916DC12F251967A2D87A6CEE6 /* VKApiConst.m in Sources */, + 934129414B2163444A969524DACDC6DE /* VKApiFriends.m in Sources */, + 05D8B604EE79D5702E013BAE34D379B5 /* VKApiGroups.m in Sources */, + 51E7FDECF9BE53640620B46BE32EA986 /* VKApiObject.m in Sources */, + 0D6AC35459E60DB595DEDD8D3D73BA52 /* VKApiObjectArray.m in Sources */, + C64E5F365334C60BB93FD1CAEDDD0789 /* VKApiPhotos.m in Sources */, + 27099263F2D3C310CE0D6DA0F4F5E440 /* VKApiUsers.m in Sources */, + DC93D2FAE6250473CB5F7EAA09A7630E /* VKApiWall.m in Sources */, + 14E96EEEEE0E84103195890E3D1AED79 /* VKAudio.m in Sources */, + F1BD31D300A89AF93664D31CE3238374 /* VKAuthorizationResult.m in Sources */, + 3E7F2EACD4312C1D9D64BEBC797625D2 /* VKAuthorizeController.m in Sources */, + 0635A2D041497FFFDB75970E013875ED /* VKBatchRequest.m in Sources */, + 072553FA6A186BBBA329B450F0C979A3 /* VKBundle.m in Sources */, + 7F8A95AD5E4F13DBDB4B937F20CBAD5F /* VKCaptchaView.m in Sources */, + 5E1ABFE8E8856793F0A110DFD1B2748D /* VKCaptchaViewController.m in Sources */, + 8A781A5D6624ED6B977B31642AF0852D /* VKCounters.m in Sources */, + 3421EA4BB7D507FEF0A5AC23CF5CEB31 /* VKError.m in Sources */, + 543581C47C14270C7A0313F85941E342 /* VKGroup.m in Sources */, + F31306D57FCFFFBDC8E91FBCFF481DDA /* VKHTTPClient.m in Sources */, + 03A53BA16A24F52F6DB5C90D78AAA9CF /* VKHTTPOperation.m in Sources */, + 29B9B41FA649E1E2F41AC28C8E885D70 /* VKImageParameters.m in Sources */, + E6BD5D77A9883F4A5E0713FE3A5306DF /* VKJSONOperation.m in Sources */, + 0B2782E46C3D9034598FCD3CF319DD11 /* VKLikes.m in Sources */, + 1251BC18BF5F1069A9AA0850DFFAA8FC /* VKObject.m in Sources */, + 317A57748C9329EC2ABBF55832F27AA7 /* VKOperation.m in Sources */, + 691136C99817A113C3694D0219D67778 /* VKPermissions.m in Sources */, + 8D9D417B4BFE628DB1C84B4EE7CC7B11 /* VKPhoto.m in Sources */, + 9EDCAEE5BEAA20A79815F5AEC95DBDE5 /* VKPhotoSize.m in Sources */, + E3C40B2130B9F1624FCA313A0EDBD319 /* VKRelative.m in Sources */, + D69381C1E4968044DEE025F78796A99D /* VKRequest.m in Sources */, + 94BECC51E7D09D3D9698BAB28ED55EB9 /* VKRequestsScheduler.m in Sources */, + 4CB3BB8C12F9699CDCEE67D827A2E1AA /* VKResponse.m in Sources */, + 36D7B63319C8DB245D4171A278930730 /* VKSchool.m in Sources */, + 9366222323F3EE9D1222B3F53777EF0E /* VKSdk.m in Sources */, + C699AE47EBA2933B22A729D92D682E2B /* VKShareDialogController.m in Sources */, + DE5DC73991DD7B19405BDD007DEAC7EF /* VKSharedTransitioningObject.m in Sources */, + 0A78320E9454E8FFFEF1C62ECA278A73 /* VKUniversity.m in Sources */, + D634812764DC6B8FB2934FDF1CE55832 /* VKUploadImage.m in Sources */, + DD6A1406132A84669A2756D6DDB374E7 /* VKUploadMessagesPhotoRequest.m in Sources */, + 48E133ACD5808F13911D84BF71393ECB /* VKUploadPhotoBase.m in Sources */, + D9EB7EC69DF284A9C49808A1F905AF51 /* VKUploadPhotoRequest.m in Sources */, + AE19B3A9E02F03A2E40B3AD7F7CF84E5 /* VKUploadWallPhotoRequest.m in Sources */, + ABA6B8433FA3CA74EF08E212229D2A58 /* VKUser.m in Sources */, + B0B634E8BD7AC19DFA5960880A0E87E2 /* VKUtil.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 38BC950C66372B41FDD98A4FEE166231 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AE38374980FF6F5F9EE64B1690FEF0F5 /* NSData+ImageContentType.m in Sources */, + F98BB0EAA67E75D5E7D1C1C00DEAF1B5 /* SDImageCache.m in Sources */, + 440EF9265687751FED239F5D0A805CA0 /* SDWebImage-dummy.m in Sources */, + 2471FC0F59B66AEDC1804251E1F4AE51 /* SDWebImageCompat.m in Sources */, + 16BCA6019103BCD0EA2D97A74715A51A /* SDWebImageDecoder.m in Sources */, + 43941378AD3B225AED52A01031D78688 /* SDWebImageDownloader.m in Sources */, + 2D0151DC879F60D123184A3ABA6C33CA /* SDWebImageDownloaderOperation.m in Sources */, + 2CF5CFB725E5CDBB259690467623D104 /* SDWebImageManager.m in Sources */, + 188EA5D8A6A6FB95FD7E27134155E297 /* SDWebImagePrefetcher.m in Sources */, + 690EE3683EBD80520773E3E93AFC8CCF /* UIButton+WebCache.m in Sources */, + C57A1382EEE1D962C0E916D70CC4B4A3 /* UIImage+GIF.m in Sources */, + 3022D16E3C05AA0FDF3519B8D91531CC /* UIImage+MultiFormat.m in Sources */, + 8B8184EF4F4ABF5210B583C96B6716AF /* UIImageView+HighlightedWebCache.m in Sources */, + 39E894BC289FE09DBD5C9E843AE0A44D /* UIImageView+WebCache.m in Sources */, + AD72B2C4E443C10DD957DA990D9DB081 /* UIView+WebCacheOperation.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 599C5A9217D2613663CFF2AE142CB5EB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D96A2EC3B206F63D2764478B0201144 /* MagicalImportFunctions.m in Sources */, + FEF32063C461B20B65DB2A06A30BB6F7 /* MagicalRecord+Actions.m in Sources */, + C57FFEC01297CAAF01AD798435A0BFE0 /* MagicalRecord+ErrorHandling.m in Sources */, + 3DD7C1ADF1DA17264B11B3FCA93CDD9A /* MagicalRecord+iCloud.m in Sources */, + 44FBD4BED7EC0F0835002425D78154C4 /* MagicalRecord+Options.m in Sources */, + 3F5DC541B71A33F6D5AA5012C7630425 /* MagicalRecord+Setup.m in Sources */, + 0627EC150C177700387C9E0C44C5D20E /* MagicalRecord+ShorthandMethods.m in Sources */, + 6FED892127561AFCEC7D866B4C73ECAD /* MagicalRecord-dummy.m in Sources */, + 09E6DECD5AB594104764C6F81EB71537 /* MagicalRecordInternal.m in Sources */, + 09E64866A37EAC1852E7FA08CF2BBB07 /* NSAttributeDescription+MagicalDataImport.m in Sources */, + B8E051AE222124F3922022CD3BDD7C38 /* NSEntityDescription+MagicalDataImport.m in Sources */, + F3086DFFAA5BBA34A0A5AA264BCD64A5 /* NSManagedObject+MagicalAggregation.m in Sources */, + 09CD5E8011F9FF90817B4CEA30CCAF79 /* NSManagedObject+MagicalDataImport.m in Sources */, + C1F35A8F2C9F043CD2793B591BB8EA48 /* NSManagedObject+MagicalFinders.m in Sources */, + 36BEEF5338EF31B0955DC632E0482747 /* NSManagedObject+MagicalRecord.m in Sources */, + DB52E3ED7904BA42F3D27F55E11345E0 /* NSManagedObject+MagicalRequests.m in Sources */, + 813F360497C515D67049CA30039E867E /* NSManagedObjectContext+MagicalChainSave.m in Sources */, + 3BFEC1F842226F4A2EA83742A489AF04 /* NSManagedObjectContext+MagicalObserving.m in Sources */, + FED654D996F54BAA458DC0A4E86EBA11 /* NSManagedObjectContext+MagicalRecord.m in Sources */, + E4FF1388561CEA6536DD601C59E0E2D8 /* NSManagedObjectContext+MagicalSaves.m in Sources */, + 438151B3D667A8B3D478F37E744BACF3 /* NSManagedObjectContext+MagicalThreading.m in Sources */, + CA1FC0E3273FF68DA837600721ECB68A /* NSManagedObjectModel+MagicalRecord.m in Sources */, + F7B7200B1DD5F3AA6EF4FB8A7E4D5675 /* NSNumber+MagicalDataImport.m in Sources */, + F1F8D1CD51E348CBDA66CE9FF0F75B52 /* NSObject+MagicalDataImport.m in Sources */, + 921F9023DEE0379E9CBF31386853299B /* NSPersistentStore+MagicalRecord.m in Sources */, + 49063CFE2BE637CB9319D1F794D3B752 /* NSPersistentStoreCoordinator+MagicalRecord.m in Sources */, + 565DBB9129441D06C3D401E5DF8F1456 /* NSRelationshipDescription+MagicalDataImport.m in Sources */, + 2A77F38FE22978DCED7F724F8C554723 /* NSString+MagicalDataImport.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A138A7C5A10A39C72A178BF053DC2F11 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 526D61E71F5185ECCEF516EA9E097C02 /* Pods-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 15A0FBD6CDA1D60EC4461D4E511CACC8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "FSHelpers+Swift"; + target = F57A84A12251464F3567966CEB83EDDB /* FSHelpers+Swift */; + targetProxy = 08E3E8B9DF50C9147AAD52271DFBE54A /* PBXContainerItemProxy */; + }; + 2AE2F04888826250231203DDB062AD89 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = SDWebImage; + target = BD3098D90737863716274F3FB21D34B4 /* SDWebImage */; + targetProxy = FCC97D138D1C9211D59EF1F38C48EB00 /* PBXContainerItemProxy */; + }; + 31BBA0BB345232DD9749EEFC0ED3AD68 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "VK-ios-sdk"; + target = 3E8869F00367E6AD1554FDEEDFFBE3C6 /* VK-ios-sdk */; + targetProxy = B86323599AD4C6E402085A144CE4AF00 /* PBXContainerItemProxy */; + }; + 43C8AD8E405A109E10A6F5E22F648183 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = MagicalRecord; + target = AD47E339A26F876F910CD9E671989350 /* MagicalRecord */; + targetProxy = FA423A3E9C9DD634833D8D03610A553F /* PBXContainerItemProxy */; + }; + D04114B09FDE7C91C8D3F923C2958EAB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = AFNetworking; + target = A5DFC851CDF2FAEED678C23407C6E244 /* AFNetworking */; + targetProxy = E877DA4D5796871C3618733CF92738ED /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 010D7572C153488AE395070E02474D84 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2E8EA69F3DF290C2840DCD35D85A6A8A /* Pods.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + INFOPLIST_FILE = "Target Support Files/Pods/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods/Pods.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_NAME = Pods; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 02B9730D8079D760C8397FD1A1C7A72C /* AppStore Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 64CAA6AE38867C4C5B2365C33FF446CA /* Pods.appstore debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + INFOPLIST_FILE = "Target Support Files/Pods/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods/Pods.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_NAME = Pods; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "AppStore Debug"; + }; + 06C7D58B6FAE12CACBF638BD917C55CD /* AppStore Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3C7E0C2F93D80675C3B4C326C92E6321 /* MagicalRecord.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/MagicalRecord/MagicalRecord-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/MagicalRecord/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/MagicalRecord/MagicalRecord.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = MagicalRecord; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "AppStore Debug"; + }; + 07F7B05C6251C1E39EAB87A458AD5BCB /* AppStore 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 = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = "APPSTORE_DEBUG=1"; + 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 = 8.0; + STRIP_INSTALLED_PRODUCT = NO; + VALIDATE_PRODUCT = YES; + }; + name = "AppStore Debug"; + }; + 0B1DC9EEA44F577F18E3200E7A826F5F /* Release Staging */ = { + 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 = "RELEASE_STAGING=1"; + 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 = 8.0; + STRIP_INSTALLED_PRODUCT = NO; + VALIDATE_PRODUCT = YES; + }; + name = "Release Staging"; + }; + 12C94E99AD7810FDB964B632A596B874 /* Test Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22A08F694018BCF5F6A9889AA537CBA3 /* VK-ios-sdk.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/VK-ios-sdk/VK-ios-sdk-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/VK-ios-sdk/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/VK-ios-sdk/VK-ios-sdk.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = VK_ios_sdk; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Test Staging"; + }; + 16640635C4814D7FF1D44DFA9601212F /* Debug Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EE6F98422250B7D75629C24B3BFAB70C /* FSHelpers+Swift.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/FSHelpers+Swift/FSHelpers+Swift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/FSHelpers+Swift/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/FSHelpers+Swift/FSHelpers+Swift.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = FSHelpers_Swift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Debug Staging"; + }; + 20E79CC3AF30ADD9740E1DD8C5DC2625 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22A08F694018BCF5F6A9889AA537CBA3 /* VK-ios-sdk.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/VK-ios-sdk/VK-ios-sdk-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/VK-ios-sdk/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/VK-ios-sdk/VK-ios-sdk.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = VK_ios_sdk; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 2152AC71546E99EEC9DC10E0D27C3011 /* Test */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BCF41BE6BC23F08CBFB3B71346EC2CD6 /* Pods.test.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + INFOPLIST_FILE = "Target Support Files/Pods/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods/Pods.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_NAME = Pods; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Test; + }; + 303BCFB7CEEDDDA8A996A6CD8E98B15B /* Release Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3C7E0C2F93D80675C3B4C326C92E6321 /* MagicalRecord.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/MagicalRecord/MagicalRecord-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/MagicalRecord/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/MagicalRecord/MagicalRecord.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = MagicalRecord; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Release Staging"; + }; + 349CA38D0C34D3E863DC504EA22272F6 /* AppStore Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ED24697386EAC6549C781263D8DDFE14 /* SDWebImage.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SDWebImage/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/SDWebImage/SDWebImage.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = SDWebImage; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "AppStore Debug"; + }; + 35ADC83C37193A76525217EB465FBF56 /* AppStore */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BC596147DDDBA5B508F93F83AF6AA6C7 /* Pods.appstore.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + INFOPLIST_FILE = "Target Support Files/Pods/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods/Pods.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_NAME = Pods; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = AppStore; + }; + 38656C25A354A85C2792434C1EAB8CE4 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 91F3786F71EA2B2A89AD32D8BA323514 /* AFNetworking.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = 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; + }; + 3F63BA742F9A28F873B31792095E0713 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22A08F694018BCF5F6A9889AA537CBA3 /* VK-ios-sdk.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/VK-ios-sdk/VK-ios-sdk-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/VK-ios-sdk/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/VK-ios-sdk/VK-ios-sdk.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = VK_ios_sdk; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 423A3E88FFF1502B528D35AF2B0083E7 /* Test */ = { + 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 = "TEST=1"; + 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 = 8.0; + STRIP_INSTALLED_PRODUCT = NO; + VALIDATE_PRODUCT = YES; + }; + name = Test; + }; + 5252ED9A1067B97EC22230FE21386277 /* Test */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ED24697386EAC6549C781263D8DDFE14 /* SDWebImage.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SDWebImage/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/SDWebImage/SDWebImage.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = SDWebImage; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Test; + }; + 5343D52E4EB72BFBD6ABA253B8F35376 /* Test */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EE6F98422250B7D75629C24B3BFAB70C /* FSHelpers+Swift.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/FSHelpers+Swift/FSHelpers+Swift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/FSHelpers+Swift/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/FSHelpers+Swift/FSHelpers+Swift.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = FSHelpers_Swift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Test; + }; + 5BE7CCA0AF0704E38128D0527E3AFBAC /* Release Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2F894C279E90FE9B0941451DCDFFFCA4 /* Pods.release staging.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + INFOPLIST_FILE = "Target Support Files/Pods/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods/Pods.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_NAME = Pods; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Release Staging"; + }; + 631ED2BD8F7632B6C05FFC0B0680AAF3 /* Test */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22A08F694018BCF5F6A9889AA537CBA3 /* VK-ios-sdk.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/VK-ios-sdk/VK-ios-sdk-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/VK-ios-sdk/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/VK-ios-sdk/VK-ios-sdk.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = VK_ios_sdk; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Test; + }; + 648EA151BC2DC9CD97BE66C97BB2195F /* AppStore Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22A08F694018BCF5F6A9889AA537CBA3 /* VK-ios-sdk.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/VK-ios-sdk/VK-ios-sdk-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/VK-ios-sdk/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/VK-ios-sdk/VK-ios-sdk.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = VK_ios_sdk; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "AppStore Debug"; + }; + 67975B8E7233B384E96F4BEDFA8316E5 /* AppStore */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ED24697386EAC6549C781263D8DDFE14 /* SDWebImage.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SDWebImage/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/SDWebImage/SDWebImage.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = SDWebImage; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = AppStore; + }; + 6AA833FD5781CA04CE918C35CB25B1A3 /* Test */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3C7E0C2F93D80675C3B4C326C92E6321 /* MagicalRecord.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/MagicalRecord/MagicalRecord-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/MagicalRecord/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/MagicalRecord/MagicalRecord.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = MagicalRecord; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Test; + }; + 6EFEEDC52762D0E5BD4A70C67A978B19 /* Debug Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 91F3786F71EA2B2A89AD32D8BA323514 /* AFNetworking.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = 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 = "Debug Staging"; + }; + 6F2E5349C2C6A2B145150F66860EC308 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EE6F98422250B7D75629C24B3BFAB70C /* FSHelpers+Swift.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/FSHelpers+Swift/FSHelpers+Swift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/FSHelpers+Swift/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/FSHelpers+Swift/FSHelpers+Swift.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = FSHelpers_Swift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 707E11007FFFFACC17C38C6214302152 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3C7E0C2F93D80675C3B4C326C92E6321 /* MagicalRecord.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/MagicalRecord/MagicalRecord-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/MagicalRecord/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/MagicalRecord/MagicalRecord.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = MagicalRecord; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 70F0777AF36A501753E62C4DC87514AD /* Test Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EE6F98422250B7D75629C24B3BFAB70C /* FSHelpers+Swift.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/FSHelpers+Swift/FSHelpers+Swift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/FSHelpers+Swift/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/FSHelpers+Swift/FSHelpers+Swift.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = FSHelpers_Swift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Test Staging"; + }; + 7C318F33ADD3831D211B9CEABDFEA669 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ED24697386EAC6549C781263D8DDFE14 /* SDWebImage.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SDWebImage/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/SDWebImage/SDWebImage.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = SDWebImage; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 818FDD6AFC9C6817C11C1720CFDB3433 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EE6F98422250B7D75629C24B3BFAB70C /* FSHelpers+Swift.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/FSHelpers+Swift/FSHelpers+Swift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/FSHelpers+Swift/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/FSHelpers+Swift/FSHelpers+Swift.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = FSHelpers_Swift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 8800449D5BFC2FFAE612FC1BB6713DCB /* Debug Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ED24697386EAC6549C781263D8DDFE14 /* SDWebImage.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SDWebImage/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/SDWebImage/SDWebImage.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = SDWebImage; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Debug Staging"; + }; + 8EFF4CBBDB7B1D9B452F78B6202EAE4B /* Test Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 6B3A7AD12B70DB84CF99389C04E39740 /* Pods.test staging.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + INFOPLIST_FILE = "Target Support Files/Pods/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods/Pods.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_NAME = Pods; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Test Staging"; + }; + 91E584347B7A46D2D20FCDDE73829BD2 /* AppStore Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 91F3786F71EA2B2A89AD32D8BA323514 /* AFNetworking.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = 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 = "AppStore Debug"; + }; + 9591593D23F763D74C9A114E3E14EFCE /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3C7E0C2F93D80675C3B4C326C92E6321 /* MagicalRecord.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/MagicalRecord/MagicalRecord-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/MagicalRecord/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/MagicalRecord/MagicalRecord.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = MagicalRecord; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 97612FB0C6B448D4599D7DBC40C145C8 /* Debug Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3C7E0C2F93D80675C3B4C326C92E6321 /* MagicalRecord.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/MagicalRecord/MagicalRecord-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/MagicalRecord/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/MagicalRecord/MagicalRecord.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = MagicalRecord; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Debug Staging"; + }; + A1920919C8648FF6F4AC9C2718ED4CBB /* Debug Staging */ = { + 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 = "DEBUG_STAGING=1"; + 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 = 8.0; + STRIP_INSTALLED_PRODUCT = NO; + VALIDATE_PRODUCT = YES; + }; + name = "Debug Staging"; + }; + A70CDAD61F90AC503C7D04CC22DA2923 /* 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; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + ONLY_ACTIVE_ARCH = YES; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + A8FA9AC63C7B27709BCAB594608E3532 /* AppStore Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EE6F98422250B7D75629C24B3BFAB70C /* FSHelpers+Swift.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/FSHelpers+Swift/FSHelpers+Swift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/FSHelpers+Swift/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/FSHelpers+Swift/FSHelpers+Swift.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = FSHelpers_Swift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "AppStore Debug"; + }; + AEA89C525901F5D2DB9501018D27B50A /* AppStore */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3C7E0C2F93D80675C3B4C326C92E6321 /* MagicalRecord.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/MagicalRecord/MagicalRecord-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/MagicalRecord/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/MagicalRecord/MagicalRecord.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = MagicalRecord; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = AppStore; + }; + B29599F568AFCA29E186BBF1C7DC610B /* Release Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22A08F694018BCF5F6A9889AA537CBA3 /* VK-ios-sdk.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/VK-ios-sdk/VK-ios-sdk-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/VK-ios-sdk/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/VK-ios-sdk/VK-ios-sdk.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = VK_ios_sdk; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Release Staging"; + }; + B3688FBB115ED5252BA3C68607216086 /* Test Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 91F3786F71EA2B2A89AD32D8BA323514 /* AFNetworking.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = 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 = "Test Staging"; + }; + BAA289D8065F42AECA067421994158B1 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 91F3786F71EA2B2A89AD32D8BA323514 /* AFNetworking.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = 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; + }; + BAE3691D63DC211C12E91F460EA9D637 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 80EB9495077AF406556B9758F24F0A5A /* Pods.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + INFOPLIST_FILE = "Target Support Files/Pods/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods/Pods.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_NAME = Pods; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + CCA9DCF944A84D4F328C348207CC5804 /* Test Staging */ = { + 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 = "TEST_STAGING=1"; + 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 = 8.0; + STRIP_INSTALLED_PRODUCT = NO; + VALIDATE_PRODUCT = YES; + }; + name = "Test Staging"; + }; + D4D04CCC521059AB0B3B46A4A72E2DAB /* Debug Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 1637E7E39308DE2D1923D3399C0BF904 /* Pods.debug staging.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + INFOPLIST_FILE = "Target Support Files/Pods/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods/Pods.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_NAME = Pods; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Debug Staging"; + }; + DB2B0B8033630805F05CC49B654CF739 /* Release Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 91F3786F71EA2B2A89AD32D8BA323514 /* AFNetworking.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = 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 Staging"; + }; + DE78A672A3D757E26EB5B9E1BFD4700B /* AppStore */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22A08F694018BCF5F6A9889AA537CBA3 /* VK-ios-sdk.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/VK-ios-sdk/VK-ios-sdk-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/VK-ios-sdk/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/VK-ios-sdk/VK-ios-sdk.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = VK_ios_sdk; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = AppStore; + }; + DF154F85BC1AD495D9201BA87967E5F4 /* Test Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3C7E0C2F93D80675C3B4C326C92E6321 /* MagicalRecord.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/MagicalRecord/MagicalRecord-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/MagicalRecord/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/MagicalRecord/MagicalRecord.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = MagicalRecord; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Test Staging"; + }; + EB000209445AAC9C59BAC72F2136CB68 /* AppStore */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 91F3786F71EA2B2A89AD32D8BA323514 /* AFNetworking.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = 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 = AppStore; + }; + ED0661AF786257934C31ECA2707C8FFB /* Debug Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22A08F694018BCF5F6A9889AA537CBA3 /* VK-ios-sdk.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/VK-ios-sdk/VK-ios-sdk-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/VK-ios-sdk/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/VK-ios-sdk/VK-ios-sdk.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = VK_ios_sdk; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Debug Staging"; + }; + F18CEE664BF5804006C72B034679BB31 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ED24697386EAC6549C781263D8DDFE14 /* SDWebImage.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SDWebImage/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/SDWebImage/SDWebImage.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = SDWebImage; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + F4F48CF14EEDE423DFA527B5D281B6FD /* Release Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ED24697386EAC6549C781263D8DDFE14 /* SDWebImage.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SDWebImage/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/SDWebImage/SDWebImage.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = SDWebImage; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Release Staging"; + }; + F761F1DFA7DB84EE0A1D152F20AC8194 /* Test Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ED24697386EAC6549C781263D8DDFE14 /* SDWebImage.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SDWebImage/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/SDWebImage/SDWebImage.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = SDWebImage; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Test Staging"; + }; + F7F76DE24CB0D5B0FF45AC2AF13D0B70 /* AppStore */ = { + 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 = "APPSTORE=1"; + 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 = 8.0; + STRIP_INSTALLED_PRODUCT = NO; + VALIDATE_PRODUCT = YES; + }; + name = AppStore; + }; + FB45FFD90572718D82AB9092B750F0CA /* 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 = "RELEASE=1"; + 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 = 8.0; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + FD8A6F9B64B94BD3A9F5848741A0B7BA /* Release Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EE6F98422250B7D75629C24B3BFAB70C /* FSHelpers+Swift.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/FSHelpers+Swift/FSHelpers+Swift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/FSHelpers+Swift/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/FSHelpers+Swift/FSHelpers+Swift.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = FSHelpers_Swift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Release Staging"; + }; + FDBA4ECA1C2863F95F01B86B181FA21D /* Test */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 91F3786F71EA2B2A89AD32D8BA323514 /* AFNetworking.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = 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 = Test; + }; + FEE4A25748FDAEECCAD87840FA249F0D /* AppStore */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EE6F98422250B7D75629C24B3BFAB70C /* FSHelpers+Swift.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/FSHelpers+Swift/FSHelpers+Swift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/FSHelpers+Swift/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/FSHelpers+Swift/FSHelpers+Swift.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = FSHelpers_Swift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = AppStore; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F7F76DE24CB0D5B0FF45AC2AF13D0B70 /* AppStore */, + 07F7B05C6251C1E39EAB87A458AD5BCB /* AppStore Debug */, + A70CDAD61F90AC503C7D04CC22DA2923 /* Debug */, + A1920919C8648FF6F4AC9C2718ED4CBB /* Debug Staging */, + FB45FFD90572718D82AB9092B750F0CA /* Release */, + 0B1DC9EEA44F577F18E3200E7A826F5F /* Release Staging */, + 423A3E88FFF1502B528D35AF2B0083E7 /* Test */, + CCA9DCF944A84D4F328C348207CC5804 /* Test Staging */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2F6BB7505ABCFFDB179A4115EA6720E0 /* Build configuration list for PBXNativeTarget "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 35ADC83C37193A76525217EB465FBF56 /* AppStore */, + 02B9730D8079D760C8397FD1A1C7A72C /* AppStore Debug */, + 010D7572C153488AE395070E02474D84 /* Debug */, + D4D04CCC521059AB0B3B46A4A72E2DAB /* Debug Staging */, + BAE3691D63DC211C12E91F460EA9D637 /* Release */, + 5BE7CCA0AF0704E38128D0527E3AFBAC /* Release Staging */, + 2152AC71546E99EEC9DC10E0D27C3011 /* Test */, + 8EFF4CBBDB7B1D9B452F78B6202EAE4B /* Test Staging */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 48A7BA27F3245F790347AFE513283EA3 /* Build configuration list for PBXNativeTarget "SDWebImage" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 67975B8E7233B384E96F4BEDFA8316E5 /* AppStore */, + 349CA38D0C34D3E863DC504EA22272F6 /* AppStore Debug */, + F18CEE664BF5804006C72B034679BB31 /* Debug */, + 8800449D5BFC2FFAE612FC1BB6713DCB /* Debug Staging */, + 7C318F33ADD3831D211B9CEABDFEA669 /* Release */, + F4F48CF14EEDE423DFA527B5D281B6FD /* Release Staging */, + 5252ED9A1067B97EC22230FE21386277 /* Test */, + F761F1DFA7DB84EE0A1D152F20AC8194 /* Test Staging */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8AF69AC0F1153A6514674F4360579D05 /* Build configuration list for PBXNativeTarget "AFNetworking" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EB000209445AAC9C59BAC72F2136CB68 /* AppStore */, + 91E584347B7A46D2D20FCDDE73829BD2 /* AppStore Debug */, + 38656C25A354A85C2792434C1EAB8CE4 /* Debug */, + 6EFEEDC52762D0E5BD4A70C67A978B19 /* Debug Staging */, + BAA289D8065F42AECA067421994158B1 /* Release */, + DB2B0B8033630805F05CC49B654CF739 /* Release Staging */, + FDBA4ECA1C2863F95F01B86B181FA21D /* Test */, + B3688FBB115ED5252BA3C68607216086 /* Test Staging */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B5A3DDFA9592AC2C711F1B7A6B5D14A2 /* Build configuration list for PBXNativeTarget "VK-ios-sdk" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DE78A672A3D757E26EB5B9E1BFD4700B /* AppStore */, + 648EA151BC2DC9CD97BE66C97BB2195F /* AppStore Debug */, + 3F63BA742F9A28F873B31792095E0713 /* Debug */, + ED0661AF786257934C31ECA2707C8FFB /* Debug Staging */, + 20E79CC3AF30ADD9740E1DD8C5DC2625 /* Release */, + B29599F568AFCA29E186BBF1C7DC610B /* Release Staging */, + 631ED2BD8F7632B6C05FFC0B0680AAF3 /* Test */, + 12C94E99AD7810FDB964B632A596B874 /* Test Staging */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C3DD98F93CFF0CDAF92F03F2D77E6BF2 /* Build configuration list for PBXNativeTarget "MagicalRecord" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AEA89C525901F5D2DB9501018D27B50A /* AppStore */, + 06C7D58B6FAE12CACBF638BD917C55CD /* AppStore Debug */, + 9591593D23F763D74C9A114E3E14EFCE /* Debug */, + 97612FB0C6B448D4599D7DBC40C145C8 /* Debug Staging */, + 707E11007FFFFACC17C38C6214302152 /* Release */, + 303BCFB7CEEDDDA8A996A6CD8E98B15B /* Release Staging */, + 6AA833FD5781CA04CE918C35CB25B1A3 /* Test */, + DF154F85BC1AD495D9201BA87967E5F4 /* Test Staging */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F2C78B4BD50ED116399C6051EF403B0B /* Build configuration list for PBXNativeTarget "FSHelpers+Swift" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FEE4A25748FDAEECCAD87840FA249F0D /* AppStore */, + A8FA9AC63C7B27709BCAB594608E3532 /* AppStore Debug */, + 6F2E5349C2C6A2B145150F66860EC308 /* Debug */, + 16640635C4814D7FF1D44DFA9601212F /* Debug Staging */, + 818FDD6AFC9C6817C11C1720CFDB3433 /* Release */, + FD8A6F9B64B94BD3A9F5848741A0B7BA /* Release Staging */, + 5343D52E4EB72BFBD6ABA253B8F35376 /* Test */, + 70F0777AF36A501753E62C4DC87514AD /* Test Staging */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; +} diff --git a/dayPhoto/Pods/SDWebImage/LICENSE b/dayPhoto/Pods/SDWebImage/LICENSE new file mode 100644 index 0000000..ae783e1 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2009 Olivier Poitrey + +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/dayPhoto/Pods/SDWebImage/README.md b/dayPhoto/Pods/SDWebImage/README.md new file mode 100644 index 0000000..bc47123 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/README.md @@ -0,0 +1,315 @@ +Web Image +========= +[![Build Status](http://img.shields.io/travis/rs/SDWebImage/master.svg?style=flat)](https://travis-ci.org/rs/SDWebImage) +[![Pod Version](http://img.shields.io/cocoapods/v/SDWebImage.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/) +[![Pod Platform](http://img.shields.io/cocoapods/p/SDWebImage.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/) +[![Pod License](http://img.shields.io/cocoapods/l/SDWebImage.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0.html) +[![Dependency Status](https://www.versioneye.com/objective-c/sdwebimage/3.3/badge.svg?style=flat)](https://www.versioneye.com/objective-c/sdwebimage/3.3) +[![Reference Status](https://www.versioneye.com/objective-c/sdwebimage/reference_badge.svg?style=flat)](https://www.versioneye.com/objective-c/sdwebimage/references) +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/rs/SDWebImage) + +This library provides a category for UIImageView with support for remote images coming from the web. + +It provides: + +- An UIImageView category adding web image and cache management to the Cocoa Touch framework +- An asynchronous image downloader +- An asynchronous memory + disk image caching with automatic cache expiration handling +- Animated GIF support +- WebP format support +- A background image decompression +- A guarantee that the same URL won't be downloaded several times +- A guarantee that bogus URLs won't be retried again and again +- A guarantee that main thread will never be blocked +- Performances! +- Use GCD and ARC +- Arm64 support + +NOTE: The version 3.0 of SDWebImage isn't fully backward compatible with 2.0 and requires iOS 5.1.1 +minimum deployement version. If you need iOS < 5.0 support, please use the last [2.0 version](https://github.com/rs/SDWebImage/tree/2.0-compat). + +[How is SDWebImage better than X?](https://github.com/rs/SDWebImage/wiki/How-is-SDWebImage-better-than-X%3F) + +Who Use It +---------- + +Find out [who uses SDWebImage](https://github.com/rs/SDWebImage/wiki/Who-Uses-SDWebImage) and add your app to the list. + +How To Use +---------- + +API documentation is available at [CocoaDocs - SDWebImage](http://cocoadocs.org/docsets/SDWebImage/) + +### Using UIImageView+WebCache category with UITableView + +Just #import the UIImageView+WebCache.h header, and call the sd_setImageWithURL:placeholderImage: +method from the tableView:cellForRowAtIndexPath: UITableViewDataSource method. Everything will be +handled for you, from async downloads to caching management. + +```objective-c +#import + +... + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *MyIdentifier = @"MyIdentifier"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; + + if (cell == nil) + { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault + reuseIdentifier:MyIdentifier] autorelease]; + } + + // Here we use the new provided sd_setImageWithURL: method to load the web image + [cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"] + placeholderImage:[UIImage imageNamed:@"placeholder.png"]]; + + cell.textLabel.text = @"My Text"; + return cell; +} +``` + +### Using blocks + +With blocks, you can be notified about the image download progress and whenever the image retrival +has completed with success or not: + +```objective-c +// Here we use the new provided sd_setImageWithURL: method to load the web image +[cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"] + placeholderImage:[UIImage imageNamed:@"placeholder.png"] + completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {... completion code here ...}]; +``` + +Note: neither your success nor failure block will be call if your image request is canceled before completion. + +### Using SDWebImageManager + +The SDWebImageManager is the class behind the UIImageView+WebCache category. It ties the +asynchronous downloader with the image cache store. You can use this class directly to benefit +from web image downloading with caching in another context than a UIView (ie: with Cocoa). + +Here is a simple example of how to use SDWebImageManager: + +```objective-c +SDWebImageManager *manager = [SDWebImageManager sharedManager]; +[manager downloadImageWithURL:imageURL + options:0 + progress:^(NSInteger receivedSize, NSInteger expectedSize) { + // progression tracking code + } + completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (image) { + // do something with image + } + }]; +``` + +### Using Asynchronous Image Downloader Independently + +It's also possible to use the async image downloader independently: + +```objective-c +[SDWebImageDownloader.sharedDownloader downloadImageWithURL:imageURL + options:0 + progress:^(NSInteger receivedSize, NSInteger expectedSize) + { + // progression tracking code + } + completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) + { + if (image && finished) + { + // do something with image + } + }]; +``` + +### Using Asynchronous Image Caching Independently + +It is also possible to use the async based image cache store independently. SDImageCache +maintains a memory cache and an optional disk cache. Disk cache write operations are performed +asynchronous so it doesn't add unnecessary latency to the UI. + +The SDImageCache class provides a singleton instance for convenience but you can create your own +instance if you want to create separated cache namespace. + +To lookup the cache, you use the `queryDiskCacheForKey:done:` method. If the method returns nil, it means the cache +doesn't currently own the image. You are thus responsible for generating and caching it. The cache +key is an application unique identifier for the image to cache. It is generally the absolute URL of +the image. + +```objective-c +SDImageCache *imageCache = [[SDImageCache alloc] initWithNamespace:@"myNamespace"]; +[imageCache queryDiskCacheForKey:myCacheKey done:^(UIImage *image) +{ + // image is not nil if image was found +}]; +``` + +By default SDImageCache will lookup the disk cache if an image can't be found in the memory cache. +You can prevent this from happening by calling the alternative method `imageFromMemoryCacheForKey:`. + +To store an image into the cache, you use the storeImage:forKey: method: + +```objective-c +[[SDImageCache sharedImageCache] storeImage:myImage forKey:myCacheKey]; +``` + +By default, the image will be stored in memory cache as well as on disk cache (asynchronously). If +you want only the memory cache, use the alternative method storeImage:forKey:toDisk: with a negative +third argument. + +### Using cache key filter + +Sometime, you may not want to use the image URL as cache key because part of the URL is dynamic +(i.e.: for access control purpose). SDWebImageManager provides a way to set a cache key filter that +takes the NSURL as input, and output a cache key NSString. + +The following example sets a filter in the application delegate that will remove any query-string from +the URL before to use it as a cache key: + +```objective-c +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + SDWebImageManager.sharedManager.cacheKeyFilter = ^(NSURL *url) { + url = [[NSURL alloc] initWithScheme:url.scheme host:url.host path:url.path]; + return [url absoluteString]; + }; + + // Your app init code... + return YES; +} +``` + + +Common Problems +--------------- + +### Using dynamic image size with UITableViewCell + +UITableView determines the size of the image by the first image set for a cell. If your remote images +don't have the same size as your placeholder image, you may experience strange anamorphic scaling issue. +The following article gives a way to workaround this issue: + +[http://www.wrichards.com/blog/2011/11/sdwebimage-fixed-width-cell-images/](http://www.wrichards.com/blog/2011/11/sdwebimage-fixed-width-cell-images/) + + +### Handle image refresh + +SDWebImage does very aggressive caching by default. It ignores all kind of caching control header returned by the HTTP server and cache the returned images with no time restriction. It implies your images URLs are static URLs pointing to images that never change. If the pointed image happen to change, some parts of the URL should change accordingly. + +If you don't control the image server you're using, you may not be able to change the URL when its content is updated. This is the case for Facebook avatar URLs for instance. In such case, you may use the `SDWebImageRefreshCached` flag. This will slightly degrade the performance but will respect the HTTP caching control headers: + +``` objective-c +[imageView sd_setImageWithURL:[NSURL URLWithString:@"https://graph.facebook.com/olivier.poitrey/picture"] + placeholderImage:[UIImage imageNamed:@"avatar-placeholder.png"] + options:SDWebImageRefreshCached]; +``` + +### Add a progress indicator + +See this category: https://github.com/JJSaccolo/UIActivityIndicator-for-SDWebImage + +Installation +------------ + +There are three ways to use SDWebImage in your project: +- using Cocoapods +- copying all the files into your project +- importing the project as a static library + +### 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 in your projects. See the [Get Started](http://cocoapods.org/#get_started) section for more details. + +#### Podfile +``` +platform :ios, '6.1' +pod 'SDWebImage', '~>3.7' +``` + +### Installation with Carthage (iOS 8+) + +[Carthage](https://github.com/Carthage/Carthage) is a lightweight dependency manager for Swift and Objective-C. It leverages CocoaTouch modules and ins less invasive than CocoaPods. + +To install with carthage, follow the instruction on [Carthage](https://github.com/Carthage/Carthage) + +#### Cartfile +``` +github "rs/SDWebImage" +``` + +#### Usage +Swift + +``` +import WebImage + +``` + +Objective-C + +``` +@import WebImage; +``` + +### Installation by cloning the repository + +In order to gain access to all the files from the repository, you should clone it. +``` +git clone --recursive https://github.com/rs/SDWebImage.git +``` + +### Add the SDWebImage project to your project + +- Download and unzip the last version of the framework from the [download page](https://github.com/rs/SDWebImage/releases) +- Right-click on the project navigator and select "Add Files to "Your Project": +- In the dialog, select SDWebImage.framework: +- Check the "Copy items into destination group's folder (if needed)" checkbox + +### Add dependencies + +- In you application project app’s target settings, find the "Build Phases" section and open the "Link Binary With Libraries" block: +- Click the "+" button again and select the "ImageIO.framework", this is needed by the progressive download feature: + +### Add Linker Flag + +Open the "Build Settings" tab, in the "Linking" section, locate the "Other Linker Flags" setting and add the "-ObjC" flag: + +![Other Linker Flags](http://dl.dropbox.com/u/123346/SDWebImage/10_other_linker_flags.jpg) + +Alternatively, if this causes compilation problems with frameworks that extend optional libraries, such as Parse, RestKit or opencv2, instead of the -ObjC flag use: +``` +-force_load SDWebImage.framework/Versions/Current/SDWebImage +``` + +If you're using Cocoa Pods and have any frameworks that extend optional libraries, such as Parsen RestKit or opencv2, instead of the -ObjC flag use: +``` +-force_load $(TARGET_BUILD_DIR)/libPods.a +``` + +### Import headers in your source files + +In the source files where you need to use the library, import the header file: + +```objective-c +#import +``` + +### Build Project + +At this point your workspace should build without error. If you are having problem, post to the Issue and the +community can help you solve it. + +Future Enhancements +------------------- + +- LRU memory cache cleanup instead of reset on memory warning + +## Licenses + +All source code is licensed under the [MIT License](https://raw.github.com/rs/SDWebImage/master/LICENSE). diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h b/dayPhoto/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h new file mode 100644 index 0000000..69c76dc --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h @@ -0,0 +1,26 @@ +// +// Created by Fabrice Aneche on 06/01/14. +// Copyright (c) 2014 Dailymotion. All rights reserved. +// + +#import + +@interface NSData (ImageContentType) + +/** + * Compute the content type for an image data + * + * @param data the input data + * + * @return the content type as string (i.e. image/jpeg, image/gif) + */ ++ (NSString *)sd_contentTypeForImageData:(NSData *)data; + +@end + + +@interface NSData (ImageContentTypeDeprecated) + ++ (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`"); + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m b/dayPhoto/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m new file mode 100644 index 0000000..0941cfa --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m @@ -0,0 +1,49 @@ +// +// Created by Fabrice Aneche on 06/01/14. +// Copyright (c) 2014 Dailymotion. All rights reserved. +// + +#import "NSData+ImageContentType.h" + + +@implementation NSData (ImageContentType) + ++ (NSString *)sd_contentTypeForImageData:(NSData *)data { + uint8_t c; + [data getBytes:&c length:1]; + switch (c) { + case 0xFF: + return @"image/jpeg"; + case 0x89: + return @"image/png"; + case 0x47: + return @"image/gif"; + case 0x49: + case 0x4D: + return @"image/tiff"; + case 0x52: + // R as RIFF for WEBP + if ([data length] < 12) { + return nil; + } + + NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; + if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { + return @"image/webp"; + } + + return nil; + } + return nil; +} + +@end + + +@implementation NSData (ImageContentTypeDeprecated) + ++ (NSString *)contentTypeForImageData:(NSData *)data { + return [self sd_contentTypeForImageData:data]; +} + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDImageCache.h b/dayPhoto/Pods/SDWebImage/SDWebImage/SDImageCache.h new file mode 100644 index 0000000..8e08aa1 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDImageCache.h @@ -0,0 +1,262 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" + +typedef NS_ENUM(NSInteger, SDImageCacheType) { + /** + * The image wasn't available the SDWebImage caches, but was downloaded from the web. + */ + SDImageCacheTypeNone, + /** + * The image was obtained from the disk cache. + */ + SDImageCacheTypeDisk, + /** + * The image was obtained from the memory cache. + */ + SDImageCacheTypeMemory +}; + +typedef void(^SDWebImageQueryCompletedBlock)(UIImage *image, SDImageCacheType cacheType); + +typedef void(^SDWebImageCheckCacheCompletionBlock)(BOOL isInCache); + +typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger totalSize); + +/** + * SDImageCache maintains a memory cache and an optional disk cache. Disk cache write operations are performed + * asynchronous so it doesn’t add unnecessary latency to the UI. + */ +@interface SDImageCache : NSObject + +/** + * Decompressing images that are downloaded and cached can improve peformance but can consume lot of memory. + * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. + */ +@property (assign, nonatomic) BOOL shouldDecompressImages; + +/** + * The maximum "total cost" of the in-memory image cache. The cost function is the number of pixels held in memory. + */ +@property (assign, nonatomic) NSUInteger maxMemoryCost; + +/** + * The maximum number of objects the cache should hold. + */ +@property (assign, nonatomic) NSUInteger maxMemoryCountLimit; + +/** + * The maximum length of time to keep an image in the cache, in seconds + */ +@property (assign, nonatomic) NSInteger maxCacheAge; + +/** + * The maximum size of the cache, in bytes. + */ +@property (assign, nonatomic) NSUInteger maxCacheSize; + +/** + * Returns global shared cache instance + * + * @return SDImageCache global instance + */ ++ (SDImageCache *)sharedImageCache; + +/** + * Init a new cache store with a specific namespace + * + * @param ns The namespace to use for this cache store + */ +- (id)initWithNamespace:(NSString *)ns; + +/** + * Init a new cache store with a specific namespace and directory + * + * @param ns The namespace to use for this cache store + * @param directory Directory to cache disk images in + */ +- (id)initWithNamespace:(NSString *)ns diskCacheDirectory:(NSString *)directory; + +-(NSString *)makeDiskCachePath:(NSString*)fullNamespace; + +/** + * Add a read-only cache path to search for images pre-cached by SDImageCache + * Useful if you want to bundle pre-loaded images with your app + * + * @param path The path to use for this read-only cache path + */ +- (void)addReadOnlyCachePath:(NSString *)path; + +/** + * Store an image into memory and disk cache at the given key. + * + * @param image The image to store + * @param key The unique image cache key, usually it's image absolute URL + */ +- (void)storeImage:(UIImage *)image forKey:(NSString *)key; + +/** + * Store an image into memory and optionally disk cache at the given key. + * + * @param image The image to store + * @param key The unique image cache key, usually it's image absolute URL + * @param toDisk Store the image to disk cache if YES + */ +- (void)storeImage:(UIImage *)image forKey:(NSString *)key toDisk:(BOOL)toDisk; + +/** + * Store an image into memory and optionally disk cache at the given key. + * + * @param image The image to store + * @param recalculate BOOL indicates if imageData can be used or a new data should be constructed from the UIImage + * @param imageData The image data as returned by the server, this representation will be used for disk storage + * instead of converting the given image object into a storable/compressed image format in order + * to save quality and CPU + * @param key The unique image cache key, usually it's image absolute URL + * @param toDisk Store the image to disk cache if YES + */ +- (void)storeImage:(UIImage *)image recalculateFromImage:(BOOL)recalculate imageData:(NSData *)imageData forKey:(NSString *)key toDisk:(BOOL)toDisk; + +/** + * Query the disk cache asynchronously. + * + * @param key The unique key used to store the wanted image + */ +- (NSOperation *)queryDiskCacheForKey:(NSString *)key done:(SDWebImageQueryCompletedBlock)doneBlock; + +/** + * Query the memory cache synchronously. + * + * @param key The unique key used to store the wanted image + */ +- (UIImage *)imageFromMemoryCacheForKey:(NSString *)key; + +/** + * Query the disk cache synchronously after checking the memory cache. + * + * @param key The unique key used to store the wanted image + */ +- (UIImage *)imageFromDiskCacheForKey:(NSString *)key; + +/** + * Remove the image from memory and disk cache synchronously + * + * @param key The unique image cache key + */ +- (void)removeImageForKey:(NSString *)key; + + +/** + * Remove the image from memory and disk cache asynchronously + * + * @param key The unique image cache key + * @param completion An block that should be executed after the image has been removed (optional) + */ +- (void)removeImageForKey:(NSString *)key withCompletion:(SDWebImageNoParamsBlock)completion; + +/** + * Remove the image from memory and optionally disk cache asynchronously + * + * @param key The unique image cache key + * @param fromDisk Also remove cache entry from disk if YES + */ +- (void)removeImageForKey:(NSString *)key fromDisk:(BOOL)fromDisk; + +/** + * Remove the image from memory and optionally disk cache asynchronously + * + * @param key The unique image cache key + * @param fromDisk Also remove cache entry from disk if YES + * @param completion An block that should be executed after the image has been removed (optional) + */ +- (void)removeImageForKey:(NSString *)key fromDisk:(BOOL)fromDisk withCompletion:(SDWebImageNoParamsBlock)completion; + +/** + * Clear all memory cached images + */ +- (void)clearMemory; + +/** + * Clear all disk cached images. Non-blocking method - returns immediately. + * @param completion An block that should be executed after cache expiration completes (optional) + */ +- (void)clearDiskOnCompletion:(SDWebImageNoParamsBlock)completion; + +/** + * Clear all disk cached images + * @see clearDiskOnCompletion: + */ +- (void)clearDisk; + +/** + * Remove all expired cached image from disk. Non-blocking method - returns immediately. + * @param completionBlock An block that should be executed after cache expiration completes (optional) + */ +- (void)cleanDiskWithCompletionBlock:(SDWebImageNoParamsBlock)completionBlock; + +/** + * Remove all expired cached image from disk + * @see cleanDiskWithCompletionBlock: + */ +- (void)cleanDisk; + +/** + * Get the size used by the disk cache + */ +- (NSUInteger)getSize; + +/** + * Get the number of images in the disk cache + */ +- (NSUInteger)getDiskCount; + +/** + * Asynchronously calculate the disk cache's size. + */ +- (void)calculateSizeWithCompletionBlock:(SDWebImageCalculateSizeBlock)completionBlock; + +/** + * Async check if image exists in disk cache already (does not load the image) + * + * @param key the key describing the url + * @param completionBlock the block to be executed when the check is done. + * @note the completion block will be always executed on the main queue + */ +- (void)diskImageExistsWithKey:(NSString *)key completion:(SDWebImageCheckCacheCompletionBlock)completionBlock; + +/** + * Check if image exists in disk cache already (does not load the image) + * + * @param key the key describing the url + * + * @return YES if an image exists for the given key + */ +- (BOOL)diskImageExistsWithKey:(NSString *)key; + +/** + * Get the cache path for a certain key (needs the cache path root folder) + * + * @param key the key (can be obtained from url using cacheKeyForURL) + * @param path the cach path root folder + * + * @return the cache path + */ +- (NSString *)cachePathForKey:(NSString *)key inPath:(NSString *)path; + +/** + * Get the default cache path for a certain key + * + * @param key the key (can be obtained from url using cacheKeyForURL) + * + * @return the default cache path + */ +- (NSString *)defaultCachePathForKey:(NSString *)key; + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDImageCache.m b/dayPhoto/Pods/SDWebImage/SDWebImage/SDImageCache.m new file mode 100644 index 0000000..2202602 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDImageCache.m @@ -0,0 +1,601 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDImageCache.h" +#import "SDWebImageDecoder.h" +#import "UIImage+MultiFormat.h" +#import + +// See https://github.com/rs/SDWebImage/pull/1141 for discussion +@interface AutoPurgeCache : NSCache +@end + +@implementation AutoPurgeCache + +- (id)init +{ + self = [super init]; + if (self) { + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(removeAllObjects) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; + } + return self; +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; + +} + +@end + +static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week +// PNG signature bytes and data (below) +static unsigned char kPNGSignatureBytes[8] = {0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A}; +static NSData *kPNGSignatureData = nil; + +BOOL ImageDataHasPNGPreffix(NSData *data); + +BOOL ImageDataHasPNGPreffix(NSData *data) { + NSUInteger pngSignatureLength = [kPNGSignatureData length]; + if ([data length] >= pngSignatureLength) { + if ([[data subdataWithRange:NSMakeRange(0, pngSignatureLength)] isEqualToData:kPNGSignatureData]) { + return YES; + } + } + + return NO; +} + +FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { + return image.size.height * image.size.width * image.scale * image.scale; +} + +@interface SDImageCache () + +@property (strong, nonatomic) NSCache *memCache; +@property (strong, nonatomic) NSString *diskCachePath; +@property (strong, nonatomic) NSMutableArray *customPaths; +@property (SDDispatchQueueSetterSementics, nonatomic) dispatch_queue_t ioQueue; + +@end + + +@implementation SDImageCache { + NSFileManager *_fileManager; +} + ++ (SDImageCache *)sharedImageCache { + static dispatch_once_t once; + static id instance; + dispatch_once(&once, ^{ + instance = [self new]; + }); + return instance; +} + +- (id)init { + return [self initWithNamespace:@"default"]; +} + +- (id)initWithNamespace:(NSString *)ns { + NSString *path = [self makeDiskCachePath:ns]; + return [self initWithNamespace:ns diskCacheDirectory:path]; +} + +- (id)initWithNamespace:(NSString *)ns diskCacheDirectory:(NSString *)directory { + if ((self = [super init])) { + NSString *fullNamespace = [@"com.hackemist.SDWebImageCache." stringByAppendingString:ns]; + + // initialise PNG signature data + kPNGSignatureData = [NSData dataWithBytes:kPNGSignatureBytes length:8]; + + // Create IO serial queue + _ioQueue = dispatch_queue_create("com.hackemist.SDWebImageCache", DISPATCH_QUEUE_SERIAL); + + // Init default values + _maxCacheAge = kDefaultCacheMaxCacheAge; + + // Init the memory cache + _memCache = [[AutoPurgeCache alloc] init]; + _memCache.name = fullNamespace; + + // Init the disk cache + if (directory != nil) { + _diskCachePath = [directory stringByAppendingPathComponent:fullNamespace]; + } else { + NSString *path = [self makeDiskCachePath:ns]; + _diskCachePath = path; + } + + // Set decompression to YES + _shouldDecompressImages = YES; + + dispatch_sync(_ioQueue, ^{ + _fileManager = [NSFileManager new]; + }); + +#if TARGET_OS_IPHONE + // Subscribe to app events + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(clearMemory) + name:UIApplicationDidReceiveMemoryWarningNotification + object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(cleanDisk) + name:UIApplicationWillTerminateNotification + object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(backgroundCleanDisk) + name:UIApplicationDidEnterBackgroundNotification + object:nil]; +#endif + } + + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + SDDispatchQueueRelease(_ioQueue); +} + +- (void)addReadOnlyCachePath:(NSString *)path { + if (!self.customPaths) { + self.customPaths = [NSMutableArray new]; + } + + if (![self.customPaths containsObject:path]) { + [self.customPaths addObject:path]; + } +} + +- (NSString *)cachePathForKey:(NSString *)key inPath:(NSString *)path { + NSString *filename = [self cachedFileNameForKey:key]; + return [path stringByAppendingPathComponent:filename]; +} + +- (NSString *)defaultCachePathForKey:(NSString *)key { + return [self cachePathForKey:key inPath:self.diskCachePath]; +} + +#pragma mark SDImageCache (private) + +- (NSString *)cachedFileNameForKey:(NSString *)key { + const char *str = [key UTF8String]; + if (str == NULL) { + str = ""; + } + unsigned char r[CC_MD5_DIGEST_LENGTH]; + CC_MD5(str, (CC_LONG)strlen(str), r); + NSString *filename = [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", + r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15]]; + + return filename; +} + +#pragma mark ImageCache + +// Init the disk cache +-(NSString *)makeDiskCachePath:(NSString*)fullNamespace{ + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); + return [paths[0] stringByAppendingPathComponent:fullNamespace]; +} + +- (void)storeImage:(UIImage *)image recalculateFromImage:(BOOL)recalculate imageData:(NSData *)imageData forKey:(NSString *)key toDisk:(BOOL)toDisk { + if (!image || !key) { + return; + } + + NSUInteger cost = SDCacheCostForImage(image); + [self.memCache setObject:image forKey:key cost:cost]; + + if (toDisk) { + dispatch_async(self.ioQueue, ^{ + NSData *data = imageData; + + if (image && (recalculate || !data)) { +#if TARGET_OS_IPHONE + // We need to determine if the image is a PNG or a JPEG + // PNGs are easier to detect because they have a unique signature (http://www.w3.org/TR/PNG-Structure.html) + // The first eight bytes of a PNG file always contain the following (decimal) values: + // 137 80 78 71 13 10 26 10 + + // If the imageData is nil (i.e. if trying to save a UIImage directly or the image was transformed on download) + // and the image has an alpha channel, we will consider it PNG to avoid losing the transparency + int alphaInfo = CGImageGetAlphaInfo(image.CGImage); + BOOL hasAlpha = !(alphaInfo == kCGImageAlphaNone || + alphaInfo == kCGImageAlphaNoneSkipFirst || + alphaInfo == kCGImageAlphaNoneSkipLast); + BOOL imageIsPng = hasAlpha; + + // But if we have an image data, we will look at the preffix + if ([imageData length] >= [kPNGSignatureData length]) { + imageIsPng = ImageDataHasPNGPreffix(imageData); + } + + if (imageIsPng) { + data = UIImagePNGRepresentation(image); + } + else { + data = UIImageJPEGRepresentation(image, (CGFloat)1.0); + } +#else + data = [NSBitmapImageRep representationOfImageRepsInArray:image.representations usingType: NSJPEGFileType properties:nil]; +#endif + } + + if (data) { + if (![_fileManager fileExistsAtPath:_diskCachePath]) { + [_fileManager createDirectoryAtPath:_diskCachePath withIntermediateDirectories:YES attributes:nil error:NULL]; + } + + [_fileManager createFileAtPath:[self defaultCachePathForKey:key] contents:data attributes:nil]; + } + }); + } +} + +- (void)storeImage:(UIImage *)image forKey:(NSString *)key { + [self storeImage:image recalculateFromImage:YES imageData:nil forKey:key toDisk:YES]; +} + +- (void)storeImage:(UIImage *)image forKey:(NSString *)key toDisk:(BOOL)toDisk { + [self storeImage:image recalculateFromImage:YES imageData:nil forKey:key toDisk:toDisk]; +} + +- (BOOL)diskImageExistsWithKey:(NSString *)key { + BOOL exists = NO; + + // this is an exception to access the filemanager on another queue than ioQueue, but we are using the shared instance + // from apple docs on NSFileManager: The methods of the shared NSFileManager object can be called from multiple threads safely. + exists = [[NSFileManager defaultManager] fileExistsAtPath:[self defaultCachePathForKey:key]]; + + return exists; +} + +- (void)diskImageExistsWithKey:(NSString *)key completion:(SDWebImageCheckCacheCompletionBlock)completionBlock { + dispatch_async(_ioQueue, ^{ + BOOL exists = [_fileManager fileExistsAtPath:[self defaultCachePathForKey:key]]; + if (completionBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + completionBlock(exists); + }); + } + }); +} + +- (UIImage *)imageFromMemoryCacheForKey:(NSString *)key { + return [self.memCache objectForKey:key]; +} + +- (UIImage *)imageFromDiskCacheForKey:(NSString *)key { + // First check the in-memory cache... + UIImage *image = [self imageFromMemoryCacheForKey:key]; + if (image) { + return image; + } + + // Second check the disk cache... + UIImage *diskImage = [self diskImageForKey:key]; + if (diskImage) { + NSUInteger cost = SDCacheCostForImage(diskImage); + [self.memCache setObject:diskImage forKey:key cost:cost]; + } + + return diskImage; +} + +- (NSData *)diskImageDataBySearchingAllPathsForKey:(NSString *)key { + NSString *defaultPath = [self defaultCachePathForKey:key]; + NSData *data = [NSData dataWithContentsOfFile:defaultPath]; + if (data) { + return data; + } + + NSArray *customPaths = [self.customPaths copy]; + for (NSString *path in customPaths) { + NSString *filePath = [self cachePathForKey:key inPath:path]; + NSData *imageData = [NSData dataWithContentsOfFile:filePath]; + if (imageData) { + return imageData; + } + } + + return nil; +} + +- (UIImage *)diskImageForKey:(NSString *)key { + NSData *data = [self diskImageDataBySearchingAllPathsForKey:key]; + if (data) { + UIImage *image = [UIImage sd_imageWithData:data]; + image = [self scaledImageForKey:key image:image]; + if (self.shouldDecompressImages) { + image = [UIImage decodedImageWithImage:image]; + } + return image; + } + else { + return nil; + } +} + +- (UIImage *)scaledImageForKey:(NSString *)key image:(UIImage *)image { + return SDScaledImageForKey(key, image); +} + +- (NSOperation *)queryDiskCacheForKey:(NSString *)key done:(SDWebImageQueryCompletedBlock)doneBlock { + if (!doneBlock) { + return nil; + } + + if (!key) { + doneBlock(nil, SDImageCacheTypeNone); + return nil; + } + + // First check the in-memory cache... + UIImage *image = [self imageFromMemoryCacheForKey:key]; + if (image) { + doneBlock(image, SDImageCacheTypeMemory); + return nil; + } + + NSOperation *operation = [NSOperation new]; + dispatch_async(self.ioQueue, ^{ + if (operation.isCancelled) { + return; + } + + @autoreleasepool { + UIImage *diskImage = [self diskImageForKey:key]; + if (diskImage) { + NSUInteger cost = SDCacheCostForImage(diskImage); + [self.memCache setObject:diskImage forKey:key cost:cost]; + } + + dispatch_async(dispatch_get_main_queue(), ^{ + doneBlock(diskImage, SDImageCacheTypeDisk); + }); + } + }); + + return operation; +} + +- (void)removeImageForKey:(NSString *)key { + [self removeImageForKey:key withCompletion:nil]; +} + +- (void)removeImageForKey:(NSString *)key withCompletion:(SDWebImageNoParamsBlock)completion { + [self removeImageForKey:key fromDisk:YES withCompletion:completion]; +} + +- (void)removeImageForKey:(NSString *)key fromDisk:(BOOL)fromDisk { + [self removeImageForKey:key fromDisk:fromDisk withCompletion:nil]; +} + +- (void)removeImageForKey:(NSString *)key fromDisk:(BOOL)fromDisk withCompletion:(SDWebImageNoParamsBlock)completion { + + if (key == nil) { + return; + } + + [self.memCache removeObjectForKey:key]; + + if (fromDisk) { + dispatch_async(self.ioQueue, ^{ + [_fileManager removeItemAtPath:[self defaultCachePathForKey:key] error:nil]; + + if (completion) { + dispatch_async(dispatch_get_main_queue(), ^{ + completion(); + }); + } + }); + } else if (completion){ + completion(); + } + +} + +- (void)setMaxMemoryCost:(NSUInteger)maxMemoryCost { + self.memCache.totalCostLimit = maxMemoryCost; +} + +- (NSUInteger)maxMemoryCost { + return self.memCache.totalCostLimit; +} + +- (NSUInteger)maxMemoryCountLimit { + return self.memCache.countLimit; +} + +- (void)setMaxMemoryCountLimit:(NSUInteger)maxCountLimit { + self.memCache.countLimit = maxCountLimit; +} + +- (void)clearMemory { + [self.memCache removeAllObjects]; +} + +- (void)clearDisk { + [self clearDiskOnCompletion:nil]; +} + +- (void)clearDiskOnCompletion:(SDWebImageNoParamsBlock)completion +{ + dispatch_async(self.ioQueue, ^{ + [_fileManager removeItemAtPath:self.diskCachePath error:nil]; + [_fileManager createDirectoryAtPath:self.diskCachePath + withIntermediateDirectories:YES + attributes:nil + error:NULL]; + + if (completion) { + dispatch_async(dispatch_get_main_queue(), ^{ + completion(); + }); + } + }); +} + +- (void)cleanDisk { + [self cleanDiskWithCompletionBlock:nil]; +} + +- (void)cleanDiskWithCompletionBlock:(SDWebImageNoParamsBlock)completionBlock { + dispatch_async(self.ioQueue, ^{ + NSURL *diskCacheURL = [NSURL fileURLWithPath:self.diskCachePath isDirectory:YES]; + NSArray *resourceKeys = @[NSURLIsDirectoryKey, NSURLContentModificationDateKey, NSURLTotalFileAllocatedSizeKey]; + + // This enumerator prefetches useful properties for our cache files. + NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtURL:diskCacheURL + includingPropertiesForKeys:resourceKeys + options:NSDirectoryEnumerationSkipsHiddenFiles + errorHandler:NULL]; + + NSDate *expirationDate = [NSDate dateWithTimeIntervalSinceNow:-self.maxCacheAge]; + NSMutableDictionary *cacheFiles = [NSMutableDictionary dictionary]; + NSUInteger currentCacheSize = 0; + + // Enumerate all of the files in the cache directory. This loop has two purposes: + // + // 1. Removing files that are older than the expiration date. + // 2. Storing file attributes for the size-based cleanup pass. + NSMutableArray *urlsToDelete = [[NSMutableArray alloc] init]; + for (NSURL *fileURL in fileEnumerator) { + NSDictionary *resourceValues = [fileURL resourceValuesForKeys:resourceKeys error:NULL]; + + // Skip directories. + if ([resourceValues[NSURLIsDirectoryKey] boolValue]) { + continue; + } + + // Remove files that are older than the expiration date; + NSDate *modificationDate = resourceValues[NSURLContentModificationDateKey]; + if ([[modificationDate laterDate:expirationDate] isEqualToDate:expirationDate]) { + [urlsToDelete addObject:fileURL]; + continue; + } + + // Store a reference to this file and account for its total size. + NSNumber *totalAllocatedSize = resourceValues[NSURLTotalFileAllocatedSizeKey]; + currentCacheSize += [totalAllocatedSize unsignedIntegerValue]; + [cacheFiles setObject:resourceValues forKey:fileURL]; + } + + for (NSURL *fileURL in urlsToDelete) { + [_fileManager removeItemAtURL:fileURL error:nil]; + } + + // If our remaining disk cache exceeds a configured maximum size, perform a second + // size-based cleanup pass. We delete the oldest files first. + if (self.maxCacheSize > 0 && currentCacheSize > self.maxCacheSize) { + // Target half of our maximum cache size for this cleanup pass. + const NSUInteger desiredCacheSize = self.maxCacheSize / 2; + + // Sort the remaining cache files by their last modification time (oldest first). + NSArray *sortedFiles = [cacheFiles keysSortedByValueWithOptions:NSSortConcurrent + usingComparator:^NSComparisonResult(id obj1, id obj2) { + return [obj1[NSURLContentModificationDateKey] compare:obj2[NSURLContentModificationDateKey]]; + }]; + + // Delete files until we fall below our desired cache size. + for (NSURL *fileURL in sortedFiles) { + if ([_fileManager removeItemAtURL:fileURL error:nil]) { + NSDictionary *resourceValues = cacheFiles[fileURL]; + NSNumber *totalAllocatedSize = resourceValues[NSURLTotalFileAllocatedSizeKey]; + currentCacheSize -= [totalAllocatedSize unsignedIntegerValue]; + + if (currentCacheSize < desiredCacheSize) { + break; + } + } + } + } + if (completionBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + completionBlock(); + }); + } + }); +} + +- (void)backgroundCleanDisk { + Class UIApplicationClass = NSClassFromString(@"UIApplication"); + if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) { + return; + } + UIApplication *application = [UIApplication performSelector:@selector(sharedApplication)]; + __block UIBackgroundTaskIdentifier bgTask = [application beginBackgroundTaskWithExpirationHandler:^{ + // Clean up any unfinished task business by marking where you + // stopped or ending the task outright. + [application endBackgroundTask:bgTask]; + bgTask = UIBackgroundTaskInvalid; + }]; + + // Start the long-running task and return immediately. + [self cleanDiskWithCompletionBlock:^{ + [application endBackgroundTask:bgTask]; + bgTask = UIBackgroundTaskInvalid; + }]; +} + +- (NSUInteger)getSize { + __block NSUInteger size = 0; + dispatch_sync(self.ioQueue, ^{ + NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtPath:self.diskCachePath]; + for (NSString *fileName in fileEnumerator) { + NSString *filePath = [self.diskCachePath stringByAppendingPathComponent:fileName]; + NSDictionary *attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil]; + size += [attrs fileSize]; + } + }); + return size; +} + +- (NSUInteger)getDiskCount { + __block NSUInteger count = 0; + dispatch_sync(self.ioQueue, ^{ + NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtPath:self.diskCachePath]; + count = [[fileEnumerator allObjects] count]; + }); + return count; +} + +- (void)calculateSizeWithCompletionBlock:(SDWebImageCalculateSizeBlock)completionBlock { + NSURL *diskCacheURL = [NSURL fileURLWithPath:self.diskCachePath isDirectory:YES]; + + dispatch_async(self.ioQueue, ^{ + NSUInteger fileCount = 0; + NSUInteger totalSize = 0; + + NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtURL:diskCacheURL + includingPropertiesForKeys:@[NSFileSize] + options:NSDirectoryEnumerationSkipsHiddenFiles + errorHandler:NULL]; + + for (NSURL *fileURL in fileEnumerator) { + NSNumber *fileSize; + [fileURL getResourceValue:&fileSize forKey:NSURLFileSizeKey error:NULL]; + totalSize += [fileSize unsignedIntegerValue]; + fileCount += 1; + } + + if (completionBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + completionBlock(fileCount, totalSize); + }); + } + }); +} + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h new file mode 100644 index 0000000..9773545 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h @@ -0,0 +1,72 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * (c) Jamie Pinkham + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import + +#ifdef __OBJC_GC__ +#error SDWebImage does not support Objective-C Garbage Collection +#endif + +#if __IPHONE_OS_VERSION_MIN_REQUIRED != 20000 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 +#error SDWebImage doesn't support Deployement Target version < 5.0 +#endif + +#if !TARGET_OS_IPHONE +#import +#ifndef UIImage +#define UIImage NSImage +#endif +#ifndef UIImageView +#define UIImageView NSImageView +#endif +#else + +#import + +#endif + +#ifndef NS_ENUM +#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type +#endif + +#ifndef NS_OPTIONS +#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type +#endif + +#if OS_OBJECT_USE_OBJC + #undef SDDispatchQueueRelease + #undef SDDispatchQueueSetterSementics + #define SDDispatchQueueRelease(q) + #define SDDispatchQueueSetterSementics strong +#else +#undef SDDispatchQueueRelease +#undef SDDispatchQueueSetterSementics +#define SDDispatchQueueRelease(q) (dispatch_release(q)) +#define SDDispatchQueueSetterSementics assign +#endif + +extern UIImage *SDScaledImageForKey(NSString *key, UIImage *image); + +typedef void(^SDWebImageNoParamsBlock)(); + +extern NSString *const SDWebImageErrorDomain; + +#define dispatch_main_sync_safe(block)\ + if ([NSThread isMainThread]) {\ + block();\ + } else {\ + dispatch_sync(dispatch_get_main_queue(), block);\ + } + +#define dispatch_main_async_safe(block)\ + if ([NSThread isMainThread]) {\ + block();\ + } else {\ + dispatch_async(dispatch_get_main_queue(), block);\ + } diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m new file mode 100644 index 0000000..54fb60e --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m @@ -0,0 +1,51 @@ +// +// SDWebImageCompat.m +// SDWebImage +// +// Created by Olivier Poitrey on 11/12/12. +// Copyright (c) 2012 Dailymotion. All rights reserved. +// + +#import "SDWebImageCompat.h" + +#if !__has_feature(objc_arc) +#error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag +#endif + +inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) { + if (!image) { + return nil; + } + + if ([image.images count] > 0) { + NSMutableArray *scaledImages = [NSMutableArray array]; + + for (UIImage *tempImage in image.images) { + [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; + } + + return [UIImage animatedImageWithImages:scaledImages duration:image.duration]; + } + else { + if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { + CGFloat scale = 1.0; + if (key.length >= 8) { + NSRange range = [key rangeOfString:@"@2x."]; + if (range.location != NSNotFound) { + scale = 2.0; + } + + range = [key rangeOfString:@"@3x."]; + if (range.location != NSNotFound) { + scale = 3.0; + } + } + + UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; + image = scaledImage; + } + return image; + } +} + +NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.h b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.h new file mode 100644 index 0000000..0176a7b --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.h @@ -0,0 +1,18 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * Created by james on 9/28/11. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" + +@interface UIImage (ForceDecode) + ++ (UIImage *)decodedImageWithImage:(UIImage *)image; + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.m b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.m new file mode 100644 index 0000000..79ddb30 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.m @@ -0,0 +1,72 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * Created by james on 9/28/11. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageDecoder.h" + +@implementation UIImage (ForceDecode) + ++ (UIImage *)decodedImageWithImage:(UIImage *)image { + if (image.images) { + // Do not decode animated images + return image; + } + + CGImageRef imageRef = image.CGImage; + CGSize imageSize = CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)); + CGRect imageRect = (CGRect){.origin = CGPointZero, .size = imageSize}; + + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef); + + int infoMask = (bitmapInfo & kCGBitmapAlphaInfoMask); + BOOL anyNonAlpha = (infoMask == kCGImageAlphaNone || + infoMask == kCGImageAlphaNoneSkipFirst || + infoMask == kCGImageAlphaNoneSkipLast); + + // CGBitmapContextCreate doesn't support kCGImageAlphaNone with RGB. + // https://developer.apple.com/library/mac/#qa/qa1037/_index.html + if (infoMask == kCGImageAlphaNone && CGColorSpaceGetNumberOfComponents(colorSpace) > 1) { + // Unset the old alpha info. + bitmapInfo &= ~kCGBitmapAlphaInfoMask; + + // Set noneSkipFirst. + bitmapInfo |= kCGImageAlphaNoneSkipFirst; + } + // Some PNGs tell us they have alpha but only 3 components. Odd. + else if (!anyNonAlpha && CGColorSpaceGetNumberOfComponents(colorSpace) == 3) { + // Unset the old alpha info. + bitmapInfo &= ~kCGBitmapAlphaInfoMask; + bitmapInfo |= kCGImageAlphaPremultipliedFirst; + } + + // It calculates the bytes-per-row based on the bitsPerComponent and width arguments. + CGContextRef context = CGBitmapContextCreate(NULL, + imageSize.width, + imageSize.height, + CGImageGetBitsPerComponent(imageRef), + 0, + colorSpace, + bitmapInfo); + CGColorSpaceRelease(colorSpace); + + // If failed, return undecompressed image + if (!context) return image; + + CGContextDrawImage(context, imageRect, imageRef); + CGImageRef decompressedImageRef = CGBitmapContextCreateImage(context); + + CGContextRelease(context); + + UIImage *decompressedImage = [UIImage imageWithCGImage:decompressedImageRef scale:image.scale orientation:image.imageOrientation]; + CGImageRelease(decompressedImageRef); + return decompressedImage; +} + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h new file mode 100644 index 0000000..b8db86f --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h @@ -0,0 +1,186 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" +#import "SDWebImageOperation.h" + +typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) { + SDWebImageDownloaderLowPriority = 1 << 0, + SDWebImageDownloaderProgressiveDownload = 1 << 1, + + /** + * By default, request prevent the of NSURLCache. With this flag, NSURLCache + * is used with default policies. + */ + SDWebImageDownloaderUseNSURLCache = 1 << 2, + + /** + * Call completion block with nil image/imageData if the image was read from NSURLCache + * (to be combined with `SDWebImageDownloaderUseNSURLCache`). + */ + + SDWebImageDownloaderIgnoreCachedResponse = 1 << 3, + /** + * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for + * extra time in background to let the request finish. If the background task expires the operation will be cancelled. + */ + + SDWebImageDownloaderContinueInBackground = 1 << 4, + + /** + * Handles cookies stored in NSHTTPCookieStore by setting + * NSMutableURLRequest.HTTPShouldHandleCookies = YES; + */ + SDWebImageDownloaderHandleCookies = 1 << 5, + + /** + * Enable to allow untrusted SSL ceriticates. + * Useful for testing purposes. Use with caution in production. + */ + SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6, + + /** + * Put the image in the high priority queue. + */ + SDWebImageDownloaderHighPriority = 1 << 7, +}; + +typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) { + /** + * Default value. All download operations will execute in queue style (first-in-first-out). + */ + SDWebImageDownloaderFIFOExecutionOrder, + + /** + * All download operations will execute in stack style (last-in-first-out). + */ + SDWebImageDownloaderLIFOExecutionOrder +}; + +extern NSString *const SDWebImageDownloadStartNotification; +extern NSString *const SDWebImageDownloadStopNotification; + +typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize); + +typedef void(^SDWebImageDownloaderCompletedBlock)(UIImage *image, NSData *data, NSError *error, BOOL finished); + +typedef NSDictionary *(^SDWebImageDownloaderHeadersFilterBlock)(NSURL *url, NSDictionary *headers); + +/** + * Asynchronous downloader dedicated and optimized for image loading. + */ +@interface SDWebImageDownloader : NSObject + +/** + * Decompressing images that are downloaded and cached can improve peformance but can consume lot of memory. + * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. + */ +@property (assign, nonatomic) BOOL shouldDecompressImages; + +@property (assign, nonatomic) NSInteger maxConcurrentDownloads; + +/** + * Shows the current amount of downloads that still need to be downloaded + */ +@property (readonly, nonatomic) NSUInteger currentDownloadCount; + + +/** + * The timeout value (in seconds) for the download operation. Default: 15.0. + */ +@property (assign, nonatomic) NSTimeInterval downloadTimeout; + + +/** + * Changes download operations execution order. Default value is `SDWebImageDownloaderFIFOExecutionOrder`. + */ +@property (assign, nonatomic) SDWebImageDownloaderExecutionOrder executionOrder; + +/** + * Singleton method, returns the shared instance + * + * @return global shared instance of downloader class + */ ++ (SDWebImageDownloader *)sharedDownloader; + +/** + * Set username + */ +@property (strong, nonatomic) NSString *username; + +/** + * Set password + */ +@property (strong, nonatomic) NSString *password; + +/** + * Set filter to pick headers for downloading image HTTP request. + * + * This block will be invoked for each downloading image request, returned + * NSDictionary will be used as headers in corresponding HTTP request. + */ +@property (nonatomic, copy) SDWebImageDownloaderHeadersFilterBlock headersFilter; + +/** + * Set a value for a HTTP header to be appended to each download HTTP request. + * + * @param value The value for the header field. Use `nil` value to remove the header. + * @param field The name of the header field to set. + */ +- (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field; + +/** + * Returns the value of the specified HTTP header field. + * + * @return The value associated with the header field field, or `nil` if there is no corresponding header field. + */ +- (NSString *)valueForHTTPHeaderField:(NSString *)field; + +/** + * Sets a subclass of `SDWebImageDownloaderOperation` as the default + * `NSOperation` to be used each time SDWebImage constructs a request + * operation to download an image. + * + * @param operationClass The subclass of `SDWebImageDownloaderOperation` to set + * as default. Passing `nil` will revert to `SDWebImageDownloaderOperation`. + */ +- (void)setOperationClass:(Class)operationClass; + +/** + * Creates a SDWebImageDownloader async downloader instance with a given URL + * + * The delegate will be informed when the image is finish downloaded or an error has happen. + * + * @see SDWebImageDownloaderDelegate + * + * @param url The URL to the image to download + * @param options The options to be used for this download + * @param progressBlock A block called repeatedly while the image is downloading + * @param completedBlock A block called once the download is completed. + * If the download succeeded, the image parameter is set, in case of error, + * error parameter is set with the error. The last parameter is always YES + * if SDWebImageDownloaderProgressiveDownload isn't use. With the + * SDWebImageDownloaderProgressiveDownload option, this block is called + * repeatedly with the partial image object and the finished argument set to NO + * before to be called a last time with the full image and finished argument + * set to YES. In case of error, the finished argument is always YES. + * + * @return A cancellable SDWebImageOperation + */ +- (id )downloadImageWithURL:(NSURL *)url + options:(SDWebImageDownloaderOptions)options + progress:(SDWebImageDownloaderProgressBlock)progressBlock + completed:(SDWebImageDownloaderCompletedBlock)completedBlock; + +/** + * Sets the download queue suspension state + */ +- (void)setSuspended:(BOOL)suspended; + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.m b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.m new file mode 100644 index 0000000..acda892 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.m @@ -0,0 +1,228 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageDownloader.h" +#import "SDWebImageDownloaderOperation.h" +#import + +static NSString *const kProgressCallbackKey = @"progress"; +static NSString *const kCompletedCallbackKey = @"completed"; + +@interface SDWebImageDownloader () + +@property (strong, nonatomic) NSOperationQueue *downloadQueue; +@property (weak, nonatomic) NSOperation *lastAddedOperation; +@property (assign, nonatomic) Class operationClass; +@property (strong, nonatomic) NSMutableDictionary *URLCallbacks; +@property (strong, nonatomic) NSMutableDictionary *HTTPHeaders; +// This queue is used to serialize the handling of the network responses of all the download operation in a single queue +@property (SDDispatchQueueSetterSementics, nonatomic) dispatch_queue_t barrierQueue; + +@end + +@implementation SDWebImageDownloader + ++ (void)initialize { + // Bind SDNetworkActivityIndicator if available (download it here: http://github.com/rs/SDNetworkActivityIndicator ) + // To use it, just add #import "SDNetworkActivityIndicator.h" in addition to the SDWebImage import + if (NSClassFromString(@"SDNetworkActivityIndicator")) { + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + id activityIndicator = [NSClassFromString(@"SDNetworkActivityIndicator") performSelector:NSSelectorFromString(@"sharedActivityIndicator")]; +#pragma clang diagnostic pop + + // Remove observer in case it was previously added. + [[NSNotificationCenter defaultCenter] removeObserver:activityIndicator name:SDWebImageDownloadStartNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:activityIndicator name:SDWebImageDownloadStopNotification object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:activityIndicator + selector:NSSelectorFromString(@"startActivity") + name:SDWebImageDownloadStartNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:activityIndicator + selector:NSSelectorFromString(@"stopActivity") + name:SDWebImageDownloadStopNotification object:nil]; + } +} + ++ (SDWebImageDownloader *)sharedDownloader { + static dispatch_once_t once; + static id instance; + dispatch_once(&once, ^{ + instance = [self new]; + }); + return instance; +} + +- (id)init { + if ((self = [super init])) { + _operationClass = [SDWebImageDownloaderOperation class]; + _shouldDecompressImages = YES; + _executionOrder = SDWebImageDownloaderFIFOExecutionOrder; + _downloadQueue = [NSOperationQueue new]; + _downloadQueue.maxConcurrentOperationCount = 6; + _URLCallbacks = [NSMutableDictionary new]; +#ifdef SD_WEBP + _HTTPHeaders = [@{@"Accept": @"image/webp,image/*;q=0.8"} mutableCopy]; +#else + _HTTPHeaders = [@{@"Accept": @"image/*;q=0.8"} mutableCopy]; +#endif + _barrierQueue = dispatch_queue_create("com.hackemist.SDWebImageDownloaderBarrierQueue", DISPATCH_QUEUE_CONCURRENT); + _downloadTimeout = 15.0; + } + return self; +} + +- (void)dealloc { + [self.downloadQueue cancelAllOperations]; + SDDispatchQueueRelease(_barrierQueue); +} + +- (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field { + if (value) { + self.HTTPHeaders[field] = value; + } + else { + [self.HTTPHeaders removeObjectForKey:field]; + } +} + +- (NSString *)valueForHTTPHeaderField:(NSString *)field { + return self.HTTPHeaders[field]; +} + +- (void)setMaxConcurrentDownloads:(NSInteger)maxConcurrentDownloads { + _downloadQueue.maxConcurrentOperationCount = maxConcurrentDownloads; +} + +- (NSUInteger)currentDownloadCount { + return _downloadQueue.operationCount; +} + +- (NSInteger)maxConcurrentDownloads { + return _downloadQueue.maxConcurrentOperationCount; +} + +- (void)setOperationClass:(Class)operationClass { + _operationClass = operationClass ?: [SDWebImageDownloaderOperation class]; +} + +- (id )downloadImageWithURL:(NSURL *)url options:(SDWebImageDownloaderOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageDownloaderCompletedBlock)completedBlock { + __block SDWebImageDownloaderOperation *operation; + __weak __typeof(self)wself = self; + + [self addProgressCallback:progressBlock andCompletedBlock:completedBlock forURL:url createCallback:^{ + NSTimeInterval timeoutInterval = wself.downloadTimeout; + if (timeoutInterval == 0.0) { + timeoutInterval = 15.0; + } + + // In order to prevent from potential duplicate caching (NSURLCache + SDImageCache) we disable the cache for image requests if told otherwise + NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url cachePolicy:(options & SDWebImageDownloaderUseNSURLCache ? NSURLRequestUseProtocolCachePolicy : NSURLRequestReloadIgnoringLocalCacheData) timeoutInterval:timeoutInterval]; + request.HTTPShouldHandleCookies = (options & SDWebImageDownloaderHandleCookies); + request.HTTPShouldUsePipelining = YES; + if (wself.headersFilter) { + request.allHTTPHeaderFields = wself.headersFilter(url, [wself.HTTPHeaders copy]); + } + else { + request.allHTTPHeaderFields = wself.HTTPHeaders; + } + operation = [[wself.operationClass alloc] initWithRequest:request + options:options + progress:^(NSInteger receivedSize, NSInteger expectedSize) { + SDWebImageDownloader *sself = wself; + if (!sself) return; + __block NSArray *callbacksForURL; + dispatch_sync(sself.barrierQueue, ^{ + callbacksForURL = [sself.URLCallbacks[url] copy]; + }); + for (NSDictionary *callbacks in callbacksForURL) { + SDWebImageDownloaderProgressBlock callback = callbacks[kProgressCallbackKey]; + if (callback) callback(receivedSize, expectedSize); + } + } + completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) { + SDWebImageDownloader *sself = wself; + if (!sself) return; + __block NSArray *callbacksForURL; + dispatch_barrier_sync(sself.barrierQueue, ^{ + callbacksForURL = [sself.URLCallbacks[url] copy]; + if (finished) { + [sself.URLCallbacks removeObjectForKey:url]; + } + }); + for (NSDictionary *callbacks in callbacksForURL) { + SDWebImageDownloaderCompletedBlock callback = callbacks[kCompletedCallbackKey]; + if (callback) callback(image, data, error, finished); + } + } + cancelled:^{ + SDWebImageDownloader *sself = wself; + if (!sself) return; + dispatch_barrier_async(sself.barrierQueue, ^{ + [sself.URLCallbacks removeObjectForKey:url]; + }); + }]; + operation.shouldDecompressImages = wself.shouldDecompressImages; + + if (wself.username && wself.password) { + operation.credential = [NSURLCredential credentialWithUser:wself.username password:wself.password persistence:NSURLCredentialPersistenceForSession]; + } + + if (options & SDWebImageDownloaderHighPriority) { + operation.queuePriority = NSOperationQueuePriorityHigh; + } else if (options & SDWebImageDownloaderLowPriority) { + operation.queuePriority = NSOperationQueuePriorityLow; + } + + [wself.downloadQueue addOperation:operation]; + if (wself.executionOrder == SDWebImageDownloaderLIFOExecutionOrder) { + // Emulate LIFO execution order by systematically adding new operations as last operation's dependency + [wself.lastAddedOperation addDependency:operation]; + wself.lastAddedOperation = operation; + } + }]; + + return operation; +} + +- (void)addProgressCallback:(SDWebImageDownloaderProgressBlock)progressBlock andCompletedBlock:(SDWebImageDownloaderCompletedBlock)completedBlock forURL:(NSURL *)url createCallback:(SDWebImageNoParamsBlock)createCallback { + // The URL will be used as the key to the callbacks dictionary so it cannot be nil. If it is nil immediately call the completed block with no image or data. + if (url == nil) { + if (completedBlock != nil) { + completedBlock(nil, nil, nil, NO); + } + return; + } + + dispatch_barrier_sync(self.barrierQueue, ^{ + BOOL first = NO; + if (!self.URLCallbacks[url]) { + self.URLCallbacks[url] = [NSMutableArray new]; + first = YES; + } + + // Handle single download of simultaneous download request for the same URL + NSMutableArray *callbacksForURL = self.URLCallbacks[url]; + NSMutableDictionary *callbacks = [NSMutableDictionary new]; + if (progressBlock) callbacks[kProgressCallbackKey] = [progressBlock copy]; + if (completedBlock) callbacks[kCompletedCallbackKey] = [completedBlock copy]; + [callbacksForURL addObject:callbacks]; + self.URLCallbacks[url] = callbacksForURL; + + if (first) { + createCallback(); + } + }); +} + +- (void)setSuspended:(BOOL)suspended { + [self.downloadQueue setSuspended:suspended]; +} + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h new file mode 100644 index 0000000..dd48b22 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h @@ -0,0 +1,78 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageDownloader.h" +#import "SDWebImageOperation.h" + +extern NSString *const SDWebImageDownloadStartNotification; +extern NSString *const SDWebImageDownloadReceiveResponseNotification; +extern NSString *const SDWebImageDownloadStopNotification; +extern NSString *const SDWebImageDownloadFinishNotification; + +@interface SDWebImageDownloaderOperation : NSOperation + +/** + * The request used by the operation's connection. + */ +@property (strong, nonatomic, readonly) NSURLRequest *request; + + +@property (assign, nonatomic) BOOL shouldDecompressImages; + +/** + * Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default. + * + * This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`. + */ +@property (nonatomic, assign) BOOL shouldUseCredentialStorage; + +/** + * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. + * + * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. + */ +@property (nonatomic, strong) NSURLCredential *credential; + +/** + * The SDWebImageDownloaderOptions for the receiver. + */ +@property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; + +/** + * The expected size of data. + */ +@property (assign, nonatomic) NSInteger expectedSize; + +/** + * The response returned by the operation's connection. + */ +@property (strong, nonatomic) NSURLResponse *response; + +/** + * Initializes a `SDWebImageDownloaderOperation` object + * + * @see SDWebImageDownloaderOperation + * + * @param request the URL request + * @param options downloader options + * @param progressBlock the block executed when a new chunk of data arrives. + * @note the progress block is executed on a background queue + * @param completedBlock the block executed when the download is done. + * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue + * @param cancelBlock the block executed if the download (operation) is cancelled + * + * @return the initialized instance + */ +- (id)initWithRequest:(NSURLRequest *)request + options:(SDWebImageDownloaderOptions)options + progress:(SDWebImageDownloaderProgressBlock)progressBlock + completed:(SDWebImageDownloaderCompletedBlock)completedBlock + cancelled:(SDWebImageNoParamsBlock)cancelBlock; + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.m b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.m new file mode 100644 index 0000000..5a8bd11 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.m @@ -0,0 +1,466 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageDownloaderOperation.h" +#import "SDWebImageDecoder.h" +#import "UIImage+MultiFormat.h" +#import +#import "SDWebImageManager.h" + +NSString *const SDWebImageDownloadStartNotification = @"SDWebImageDownloadStartNotification"; +NSString *const SDWebImageDownloadReceiveResponseNotification = @"SDWebImageDownloadReceiveResponseNotification"; +NSString *const SDWebImageDownloadStopNotification = @"SDWebImageDownloadStopNotification"; +NSString *const SDWebImageDownloadFinishNotification = @"SDWebImageDownloadFinishNotification"; + +@interface SDWebImageDownloaderOperation () + +@property (copy, nonatomic) SDWebImageDownloaderProgressBlock progressBlock; +@property (copy, nonatomic) SDWebImageDownloaderCompletedBlock completedBlock; +@property (copy, nonatomic) SDWebImageNoParamsBlock cancelBlock; + +@property (assign, nonatomic, getter = isExecuting) BOOL executing; +@property (assign, nonatomic, getter = isFinished) BOOL finished; +@property (strong, nonatomic) NSMutableData *imageData; +@property (strong, nonatomic) NSURLConnection *connection; +@property (strong, atomic) NSThread *thread; + +#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 +@property (assign, nonatomic) UIBackgroundTaskIdentifier backgroundTaskId; +#endif + +@end + +@implementation SDWebImageDownloaderOperation { + size_t width, height; + UIImageOrientation orientation; + BOOL responseFromCached; +} + +@synthesize executing = _executing; +@synthesize finished = _finished; + +- (id)initWithRequest:(NSURLRequest *)request + options:(SDWebImageDownloaderOptions)options + progress:(SDWebImageDownloaderProgressBlock)progressBlock + completed:(SDWebImageDownloaderCompletedBlock)completedBlock + cancelled:(SDWebImageNoParamsBlock)cancelBlock { + if ((self = [super init])) { + _request = request; + _shouldDecompressImages = YES; + _shouldUseCredentialStorage = YES; + _options = options; + _progressBlock = [progressBlock copy]; + _completedBlock = [completedBlock copy]; + _cancelBlock = [cancelBlock copy]; + _executing = NO; + _finished = NO; + _expectedSize = 0; + responseFromCached = YES; // Initially wrong until `connection:willCacheResponse:` is called or not called + } + return self; +} + +- (void)start { + @synchronized (self) { + if (self.isCancelled) { + self.finished = YES; + [self reset]; + return; + } + +#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 + Class UIApplicationClass = NSClassFromString(@"UIApplication"); + BOOL hasApplication = UIApplicationClass && [UIApplicationClass respondsToSelector:@selector(sharedApplication)]; + if (hasApplication && [self shouldContinueWhenAppEntersBackground]) { + __weak __typeof__ (self) wself = self; + UIApplication * app = [UIApplicationClass performSelector:@selector(sharedApplication)]; + self.backgroundTaskId = [app beginBackgroundTaskWithExpirationHandler:^{ + __strong __typeof (wself) sself = wself; + + if (sself) { + [sself cancel]; + + [app endBackgroundTask:sself.backgroundTaskId]; + sself.backgroundTaskId = UIBackgroundTaskInvalid; + } + }]; + } +#endif + + self.executing = YES; + self.connection = [[NSURLConnection alloc] initWithRequest:self.request delegate:self startImmediately:NO]; + self.thread = [NSThread currentThread]; + } + + [self.connection start]; + + if (self.connection) { + if (self.progressBlock) { + self.progressBlock(0, NSURLResponseUnknownLength); + } + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStartNotification object:self]; + }); + + if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_5_1) { + // Make sure to run the runloop in our background thread so it can process downloaded data + // Note: we use a timeout to work around an issue with NSURLConnection cancel under iOS 5 + // not waking up the runloop, leading to dead threads (see https://github.com/rs/SDWebImage/issues/466) + CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, false); + } + else { + CFRunLoopRun(); + } + + if (!self.isFinished) { + [self.connection cancel]; + [self connection:self.connection didFailWithError:[NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorTimedOut userInfo:@{NSURLErrorFailingURLErrorKey : self.request.URL}]]; + } + } + else { + if (self.completedBlock) { + self.completedBlock(nil, nil, [NSError errorWithDomain:NSURLErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"Connection can't be initialized"}], YES); + } + } + +#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 + Class UIApplicationClass = NSClassFromString(@"UIApplication"); + if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) { + return; + } + if (self.backgroundTaskId != UIBackgroundTaskInvalid) { + UIApplication * app = [UIApplication performSelector:@selector(sharedApplication)]; + [app endBackgroundTask:self.backgroundTaskId]; + self.backgroundTaskId = UIBackgroundTaskInvalid; + } +#endif +} + +- (void)cancel { + @synchronized (self) { + if (self.thread) { + [self performSelector:@selector(cancelInternalAndStop) onThread:self.thread withObject:nil waitUntilDone:NO]; + } + else { + [self cancelInternal]; + } + } +} + +- (void)cancelInternalAndStop { + if (self.isFinished) return; + [self cancelInternal]; + CFRunLoopStop(CFRunLoopGetCurrent()); +} + +- (void)cancelInternal { + if (self.isFinished) return; + [super cancel]; + if (self.cancelBlock) self.cancelBlock(); + + if (self.connection) { + [self.connection cancel]; + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:self]; + }); + + // As we cancelled the connection, its callback won't be called and thus won't + // maintain the isFinished and isExecuting flags. + if (self.isExecuting) self.executing = NO; + if (!self.isFinished) self.finished = YES; + } + + [self reset]; +} + +- (void)done { + self.finished = YES; + self.executing = NO; + [self reset]; +} + +- (void)reset { + self.cancelBlock = nil; + self.completedBlock = nil; + self.progressBlock = nil; + self.connection = nil; + self.imageData = nil; + self.thread = nil; +} + +- (void)setFinished:(BOOL)finished { + [self willChangeValueForKey:@"isFinished"]; + _finished = finished; + [self didChangeValueForKey:@"isFinished"]; +} + +- (void)setExecuting:(BOOL)executing { + [self willChangeValueForKey:@"isExecuting"]; + _executing = executing; + [self didChangeValueForKey:@"isExecuting"]; +} + +- (BOOL)isConcurrent { + return YES; +} + +#pragma mark NSURLConnection (delegate) + +- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { + + //'304 Not Modified' is an exceptional one + if (![response respondsToSelector:@selector(statusCode)] || ([((NSHTTPURLResponse *)response) statusCode] < 400 && [((NSHTTPURLResponse *)response) statusCode] != 304)) { + NSInteger expected = response.expectedContentLength > 0 ? (NSInteger)response.expectedContentLength : 0; + self.expectedSize = expected; + if (self.progressBlock) { + self.progressBlock(0, expected); + } + + self.imageData = [[NSMutableData alloc] initWithCapacity:expected]; + self.response = response; + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadReceiveResponseNotification object:self]; + }); + } + else { + NSUInteger code = [((NSHTTPURLResponse *)response) statusCode]; + + //This is the case when server returns '304 Not Modified'. It means that remote image is not changed. + //In case of 304 we need just cancel the operation and return cached image from the cache. + if (code == 304) { + [self cancelInternal]; + } else { + [self.connection cancel]; + } + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:self]; + }); + + if (self.completedBlock) { + self.completedBlock(nil, nil, [NSError errorWithDomain:NSURLErrorDomain code:[((NSHTTPURLResponse *)response) statusCode] userInfo:nil], YES); + } + CFRunLoopStop(CFRunLoopGetCurrent()); + [self done]; + } +} + +- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { + [self.imageData appendData:data]; + + if ((self.options & SDWebImageDownloaderProgressiveDownload) && self.expectedSize > 0 && self.completedBlock) { + // The following code is from http://www.cocoaintheshell.com/2011/05/progressive-images-download-imageio/ + // Thanks to the author @Nyx0uf + + // Get the total bytes downloaded + const NSInteger totalSize = self.imageData.length; + + // Update the data source, we must pass ALL the data, not just the new bytes + CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)self.imageData, NULL); + + if (width + height == 0) { + CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); + if (properties) { + NSInteger orientationValue = -1; + CFTypeRef val = CFDictionaryGetValue(properties, kCGImagePropertyPixelHeight); + if (val) CFNumberGetValue(val, kCFNumberLongType, &height); + val = CFDictionaryGetValue(properties, kCGImagePropertyPixelWidth); + if (val) CFNumberGetValue(val, kCFNumberLongType, &width); + val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); + if (val) CFNumberGetValue(val, kCFNumberNSIntegerType, &orientationValue); + CFRelease(properties); + + // When we draw to Core Graphics, we lose orientation information, + // which means the image below born of initWithCGIImage will be + // oriented incorrectly sometimes. (Unlike the image born of initWithData + // in connectionDidFinishLoading.) So save it here and pass it on later. + orientation = [[self class] orientationFromPropertyValue:(orientationValue == -1 ? 1 : orientationValue)]; + } + + } + + if (width + height > 0 && totalSize < self.expectedSize) { + // Create the image + CGImageRef partialImageRef = CGImageSourceCreateImageAtIndex(imageSource, 0, NULL); + +#ifdef TARGET_OS_IPHONE + // Workaround for iOS anamorphic image + if (partialImageRef) { + const size_t partialHeight = CGImageGetHeight(partialImageRef); + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGContextRef bmContext = CGBitmapContextCreate(NULL, width, height, 8, width * 4, colorSpace, kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedFirst); + CGColorSpaceRelease(colorSpace); + if (bmContext) { + CGContextDrawImage(bmContext, (CGRect){.origin.x = 0.0f, .origin.y = 0.0f, .size.width = width, .size.height = partialHeight}, partialImageRef); + CGImageRelease(partialImageRef); + partialImageRef = CGBitmapContextCreateImage(bmContext); + CGContextRelease(bmContext); + } + else { + CGImageRelease(partialImageRef); + partialImageRef = nil; + } + } +#endif + + if (partialImageRef) { + UIImage *image = [UIImage imageWithCGImage:partialImageRef scale:1 orientation:orientation]; + NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL]; + UIImage *scaledImage = [self scaledImageForKey:key image:image]; + if (self.shouldDecompressImages) { + image = [UIImage decodedImageWithImage:scaledImage]; + } + else { + image = scaledImage; + } + CGImageRelease(partialImageRef); + dispatch_main_sync_safe(^{ + if (self.completedBlock) { + self.completedBlock(image, nil, nil, NO); + } + }); + } + } + + CFRelease(imageSource); + } + + if (self.progressBlock) { + self.progressBlock(self.imageData.length, self.expectedSize); + } +} + ++ (UIImageOrientation)orientationFromPropertyValue:(NSInteger)value { + switch (value) { + case 1: + return UIImageOrientationUp; + case 3: + return UIImageOrientationDown; + case 8: + return UIImageOrientationLeft; + case 6: + return UIImageOrientationRight; + case 2: + return UIImageOrientationUpMirrored; + case 4: + return UIImageOrientationDownMirrored; + case 5: + return UIImageOrientationLeftMirrored; + case 7: + return UIImageOrientationRightMirrored; + default: + return UIImageOrientationUp; + } +} + +- (UIImage *)scaledImageForKey:(NSString *)key image:(UIImage *)image { + return SDScaledImageForKey(key, image); +} + +- (void)connectionDidFinishLoading:(NSURLConnection *)aConnection { + SDWebImageDownloaderCompletedBlock completionBlock = self.completedBlock; + @synchronized(self) { + CFRunLoopStop(CFRunLoopGetCurrent()); + self.thread = nil; + self.connection = nil; + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:self]; + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadFinishNotification object:self]; + }); + } + + if (![[NSURLCache sharedURLCache] cachedResponseForRequest:_request]) { + responseFromCached = NO; + } + + if (completionBlock) { + if (self.options & SDWebImageDownloaderIgnoreCachedResponse && responseFromCached) { + completionBlock(nil, nil, nil, YES); + } else if (self.imageData) { + UIImage *image = [UIImage sd_imageWithData:self.imageData]; + NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL]; + image = [self scaledImageForKey:key image:image]; + + // Do not force decoding animated GIFs + if (!image.images) { + if (self.shouldDecompressImages) { + image = [UIImage decodedImageWithImage:image]; + } + } + if (CGSizeEqualToSize(image.size, CGSizeZero)) { + completionBlock(nil, nil, [NSError errorWithDomain:SDWebImageErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"Downloaded image has 0 pixels"}], YES); + } + else { + completionBlock(image, self.imageData, nil, YES); + } + } else { + completionBlock(nil, nil, [NSError errorWithDomain:SDWebImageErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"Image data is nil"}], YES); + } + } + self.completionBlock = nil; + [self done]; +} + +- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { + @synchronized(self) { + CFRunLoopStop(CFRunLoopGetCurrent()); + self.thread = nil; + self.connection = nil; + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:self]; + }); + } + + if (self.completedBlock) { + self.completedBlock(nil, nil, error, YES); + } + self.completionBlock = nil; + [self done]; +} + +- (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse { + responseFromCached = NO; // If this method is called, it means the response wasn't read from cache + if (self.request.cachePolicy == NSURLRequestReloadIgnoringLocalCacheData) { + // Prevents caching of responses + return nil; + } + else { + return cachedResponse; + } +} + +- (BOOL)shouldContinueWhenAppEntersBackground { + return self.options & SDWebImageDownloaderContinueInBackground; +} + +- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection __unused *)connection { + return self.shouldUseCredentialStorage; +} + +- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge{ + if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { + if (!(self.options & SDWebImageDownloaderAllowInvalidSSLCertificates) && + [challenge.sender respondsToSelector:@selector(performDefaultHandlingForAuthenticationChallenge:)]) { + [challenge.sender performDefaultHandlingForAuthenticationChallenge:challenge]; + } else { + NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; + [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge]; + } + } else { + if ([challenge previousFailureCount] == 0) { + if (self.credential) { + [[challenge sender] useCredential:self.credential forAuthenticationChallenge:challenge]; + } else { + [[challenge sender] continueWithoutCredentialForAuthenticationChallenge:challenge]; + } + } else { + [[challenge sender] continueWithoutCredentialForAuthenticationChallenge:challenge]; + } + } +} + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageManager.h b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageManager.h new file mode 100644 index 0000000..7f80e24 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageManager.h @@ -0,0 +1,299 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" +#import "SDWebImageOperation.h" +#import "SDWebImageDownloader.h" +#import "SDImageCache.h" + +typedef NS_OPTIONS(NSUInteger, SDWebImageOptions) { + /** + * By default, when a URL fail to be downloaded, the URL is blacklisted so the library won't keep trying. + * This flag disable this blacklisting. + */ + SDWebImageRetryFailed = 1 << 0, + + /** + * By default, image downloads are started during UI interactions, this flags disable this feature, + * leading to delayed download on UIScrollView deceleration for instance. + */ + SDWebImageLowPriority = 1 << 1, + + /** + * This flag disables on-disk caching + */ + SDWebImageCacheMemoryOnly = 1 << 2, + + /** + * This flag enables progressive download, the image is displayed progressively during download as a browser would do. + * By default, the image is only displayed once completely downloaded. + */ + SDWebImageProgressiveDownload = 1 << 3, + + /** + * Even if the image is cached, respect the HTTP response cache control, and refresh the image from remote location if needed. + * The disk caching will be handled by NSURLCache instead of SDWebImage leading to slight performance degradation. + * This option helps deal with images changing behind the same request URL, e.g. Facebook graph api profile pics. + * If a cached image is refreshed, the completion block is called once with the cached image and again with the final image. + * + * Use this flag only if you can't make your URLs static with embeded cache busting parameter. + */ + SDWebImageRefreshCached = 1 << 4, + + /** + * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for + * extra time in background to let the request finish. If the background task expires the operation will be cancelled. + */ + SDWebImageContinueInBackground = 1 << 5, + + /** + * Handles cookies stored in NSHTTPCookieStore by setting + * NSMutableURLRequest.HTTPShouldHandleCookies = YES; + */ + SDWebImageHandleCookies = 1 << 6, + + /** + * Enable to allow untrusted SSL ceriticates. + * Useful for testing purposes. Use with caution in production. + */ + SDWebImageAllowInvalidSSLCertificates = 1 << 7, + + /** + * By default, image are loaded in the order they were queued. This flag move them to + * the front of the queue and is loaded immediately instead of waiting for the current queue to be loaded (which + * could take a while). + */ + SDWebImageHighPriority = 1 << 8, + + /** + * By default, placeholder images are loaded while the image is loading. This flag will delay the loading + * of the placeholder image until after the image has finished loading. + */ + SDWebImageDelayPlaceholder = 1 << 9, + + /** + * We usually don't call transformDownloadedImage delegate method on animated images, + * as most transformation code would mangle it. + * Use this flag to transform them anyway. + */ + SDWebImageTransformAnimatedImage = 1 << 10, + + /** + * By default, image is added to the imageView after download. But in some cases, we want to + * have the hand before setting the image (apply a filter or add it with cross-fade animation for instance) + * Use this flag if you want to manually set the image in the completion when success + */ + SDWebImageAvoidAutoSetImage = 1 << 11 +}; + +typedef void(^SDWebImageCompletionBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL); + +typedef void(^SDWebImageCompletionWithFinishedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL); + +typedef NSString *(^SDWebImageCacheKeyFilterBlock)(NSURL *url); + + +@class SDWebImageManager; + +@protocol SDWebImageManagerDelegate + +@optional + +/** + * Controls which image should be downloaded when the image is not found in the cache. + * + * @param imageManager The current `SDWebImageManager` + * @param imageURL The url of the image to be downloaded + * + * @return Return NO to prevent the downloading of the image on cache misses. If not implemented, YES is implied. + */ +- (BOOL)imageManager:(SDWebImageManager *)imageManager shouldDownloadImageForURL:(NSURL *)imageURL; + +/** + * Allows to transform the image immediately after it has been downloaded and just before to cache it on disk and memory. + * NOTE: This method is called from a global queue in order to not to block the main thread. + * + * @param imageManager The current `SDWebImageManager` + * @param image The image to transform + * @param imageURL The url of the image to transform + * + * @return The transformed image object. + */ +- (UIImage *)imageManager:(SDWebImageManager *)imageManager transformDownloadedImage:(UIImage *)image withURL:(NSURL *)imageURL; + +@end + +/** + * The SDWebImageManager is the class behind the UIImageView+WebCache category and likes. + * It ties the asynchronous downloader (SDWebImageDownloader) with the image cache store (SDImageCache). + * You can use this class directly to benefit from web image downloading with caching in another context than + * a UIView. + * + * Here is a simple example of how to use SDWebImageManager: + * + * @code + +SDWebImageManager *manager = [SDWebImageManager sharedManager]; +[manager downloadImageWithURL:imageURL + options:0 + progress:nil + completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (image) { + // do something with image + } + }]; + + * @endcode + */ +@interface SDWebImageManager : NSObject + +@property (weak, nonatomic) id delegate; + +@property (strong, nonatomic, readonly) SDImageCache *imageCache; +@property (strong, nonatomic, readonly) SDWebImageDownloader *imageDownloader; + +/** + * The cache filter is a block used each time SDWebImageManager need to convert an URL into a cache key. This can + * be used to remove dynamic part of an image URL. + * + * The following example sets a filter in the application delegate that will remove any query-string from the + * URL before to use it as a cache key: + * + * @code + +[[SDWebImageManager sharedManager] setCacheKeyFilter:^(NSURL *url) { + url = [[NSURL alloc] initWithScheme:url.scheme host:url.host path:url.path]; + return [url absoluteString]; +}]; + + * @endcode + */ +@property (nonatomic, copy) SDWebImageCacheKeyFilterBlock cacheKeyFilter; + +/** + * Returns global SDWebImageManager instance. + * + * @return SDWebImageManager shared instance + */ ++ (SDWebImageManager *)sharedManager; + +/** + * Downloads the image at the given URL if not present in cache or return the cached version otherwise. + * + * @param url The URL to the image + * @param options A mask to specify options to use for this request + * @param progressBlock A block called while image is downloading + * @param completedBlock A block called when operation has been completed. + * + * This parameter is required. + * + * This block has no return value and takes the requested UIImage as first parameter. + * In case of error the image parameter is nil and the second parameter may contain an NSError. + * + * The third parameter is an `SDImageCacheType` enum indicating if the image was retrived from the local cache + * or from the memory cache or from the network. + * + * The last parameter is set to NO when the SDWebImageProgressiveDownload option is used and the image is + * downloading. This block is thus called repetidly with a partial image. When image is fully downloaded, the + * block is called a last time with the full image and the last parameter set to YES. + * + * @return Returns an NSObject conforming to SDWebImageOperation. Should be an instance of SDWebImageDownloaderOperation + */ +- (id )downloadImageWithURL:(NSURL *)url + options:(SDWebImageOptions)options + progress:(SDWebImageDownloaderProgressBlock)progressBlock + completed:(SDWebImageCompletionWithFinishedBlock)completedBlock; + +/** + * Saves image to cache for given URL + * + * @param image The image to cache + * @param url The URL to the image + * + */ + +- (void)saveImageToCache:(UIImage *)image forURL:(NSURL *)url; + +/** + * Cancel all current opreations + */ +- (void)cancelAll; + +/** + * Check one or more operations running + */ +- (BOOL)isRunning; + +/** + * Check if image has already been cached + * + * @param url image url + * + * @return if the image was already cached + */ +- (BOOL)cachedImageExistsForURL:(NSURL *)url; + +/** + * Check if image has already been cached on disk only + * + * @param url image url + * + * @return if the image was already cached (disk only) + */ +- (BOOL)diskImageExistsForURL:(NSURL *)url; + +/** + * Async check if image has already been cached + * + * @param url image url + * @param completionBlock the block to be executed when the check is finished + * + * @note the completion block is always executed on the main queue + */ +- (void)cachedImageExistsForURL:(NSURL *)url + completion:(SDWebImageCheckCacheCompletionBlock)completionBlock; + +/** + * Async check if image has already been cached on disk only + * + * @param url image url + * @param completionBlock the block to be executed when the check is finished + * + * @note the completion block is always executed on the main queue + */ +- (void)diskImageExistsForURL:(NSURL *)url + completion:(SDWebImageCheckCacheCompletionBlock)completionBlock; + + +/** + *Return the cache key for a given URL + */ +- (NSString *)cacheKeyForURL:(NSURL *)url; + +@end + + +#pragma mark - Deprecated + +typedef void(^SDWebImageCompletedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType) __deprecated_msg("Block type deprecated. Use `SDWebImageCompletionBlock`"); +typedef void(^SDWebImageCompletedWithFinishedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished) __deprecated_msg("Block type deprecated. Use `SDWebImageCompletionWithFinishedBlock`"); + + +@interface SDWebImageManager (Deprecated) + +/** + * Downloads the image at the given URL if not present in cache or return the cached version otherwise. + * + * @deprecated This method has been deprecated. Use `downloadImageWithURL:options:progress:completed:` + */ +- (id )downloadWithURL:(NSURL *)url + options:(SDWebImageOptions)options + progress:(SDWebImageDownloaderProgressBlock)progressBlock + completed:(SDWebImageCompletedWithFinishedBlock)completedBlock __deprecated_msg("Method deprecated. Use `downloadImageWithURL:options:progress:completed:`"); + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageManager.m b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageManager.m new file mode 100644 index 0000000..3980ced --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageManager.m @@ -0,0 +1,354 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageManager.h" +#import + +@interface SDWebImageCombinedOperation : NSObject + +@property (assign, nonatomic, getter = isCancelled) BOOL cancelled; +@property (copy, nonatomic) SDWebImageNoParamsBlock cancelBlock; +@property (strong, nonatomic) NSOperation *cacheOperation; + +@end + +@interface SDWebImageManager () + +@property (strong, nonatomic, readwrite) SDImageCache *imageCache; +@property (strong, nonatomic, readwrite) SDWebImageDownloader *imageDownloader; +@property (strong, nonatomic) NSMutableSet *failedURLs; +@property (strong, nonatomic) NSMutableArray *runningOperations; + +@end + +@implementation SDWebImageManager + ++ (id)sharedManager { + static dispatch_once_t once; + static id instance; + dispatch_once(&once, ^{ + instance = [self new]; + }); + return instance; +} + +- (id)init { + if ((self = [super init])) { + _imageCache = [self createCache]; + _imageDownloader = [SDWebImageDownloader sharedDownloader]; + _failedURLs = [NSMutableSet new]; + _runningOperations = [NSMutableArray new]; + } + return self; +} + +- (SDImageCache *)createCache { + return [SDImageCache sharedImageCache]; +} + +- (NSString *)cacheKeyForURL:(NSURL *)url { + if (self.cacheKeyFilter) { + return self.cacheKeyFilter(url); + } + else { + return [url absoluteString]; + } +} + +- (BOOL)cachedImageExistsForURL:(NSURL *)url { + NSString *key = [self cacheKeyForURL:url]; + if ([self.imageCache imageFromMemoryCacheForKey:key] != nil) return YES; + return [self.imageCache diskImageExistsWithKey:key]; +} + +- (BOOL)diskImageExistsForURL:(NSURL *)url { + NSString *key = [self cacheKeyForURL:url]; + return [self.imageCache diskImageExistsWithKey:key]; +} + +- (void)cachedImageExistsForURL:(NSURL *)url + completion:(SDWebImageCheckCacheCompletionBlock)completionBlock { + NSString *key = [self cacheKeyForURL:url]; + + BOOL isInMemoryCache = ([self.imageCache imageFromMemoryCacheForKey:key] != nil); + + if (isInMemoryCache) { + // making sure we call the completion block on the main queue + dispatch_async(dispatch_get_main_queue(), ^{ + if (completionBlock) { + completionBlock(YES); + } + }); + return; + } + + [self.imageCache diskImageExistsWithKey:key completion:^(BOOL isInDiskCache) { + // the completion block of checkDiskCacheForImageWithKey:completion: is always called on the main queue, no need to further dispatch + if (completionBlock) { + completionBlock(isInDiskCache); + } + }]; +} + +- (void)diskImageExistsForURL:(NSURL *)url + completion:(SDWebImageCheckCacheCompletionBlock)completionBlock { + NSString *key = [self cacheKeyForURL:url]; + + [self.imageCache diskImageExistsWithKey:key completion:^(BOOL isInDiskCache) { + // the completion block of checkDiskCacheForImageWithKey:completion: is always called on the main queue, no need to further dispatch + if (completionBlock) { + completionBlock(isInDiskCache); + } + }]; +} + +- (id )downloadImageWithURL:(NSURL *)url + options:(SDWebImageOptions)options + progress:(SDWebImageDownloaderProgressBlock)progressBlock + completed:(SDWebImageCompletionWithFinishedBlock)completedBlock { + // Invoking this method without a completedBlock is pointless + NSAssert(completedBlock != nil, @"If you mean to prefetch the image, use -[SDWebImagePrefetcher prefetchURLs] instead"); + + // Very common mistake is to send the URL using NSString object instead of NSURL. For some strange reason, XCode won't + // throw any warning for this type mismatch. Here we failsafe this error by allowing URLs to be passed as NSString. + if ([url isKindOfClass:NSString.class]) { + url = [NSURL URLWithString:(NSString *)url]; + } + + // Prevents app crashing on argument type error like sending NSNull instead of NSURL + if (![url isKindOfClass:NSURL.class]) { + url = nil; + } + + __block SDWebImageCombinedOperation *operation = [SDWebImageCombinedOperation new]; + __weak SDWebImageCombinedOperation *weakOperation = operation; + + BOOL isFailedUrl = NO; + @synchronized (self.failedURLs) { + isFailedUrl = [self.failedURLs containsObject:url]; + } + + if (!url || (!(options & SDWebImageRetryFailed) && isFailedUrl)) { + dispatch_main_sync_safe(^{ + NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorFileDoesNotExist userInfo:nil]; + completedBlock(nil, error, SDImageCacheTypeNone, YES, url); + }); + return operation; + } + + @synchronized (self.runningOperations) { + [self.runningOperations addObject:operation]; + } + NSString *key = [self cacheKeyForURL:url]; + + operation.cacheOperation = [self.imageCache queryDiskCacheForKey:key done:^(UIImage *image, SDImageCacheType cacheType) { + if (operation.isCancelled) { + @synchronized (self.runningOperations) { + [self.runningOperations removeObject:operation]; + } + + return; + } + + if ((!image || options & SDWebImageRefreshCached) && (![self.delegate respondsToSelector:@selector(imageManager:shouldDownloadImageForURL:)] || [self.delegate imageManager:self shouldDownloadImageForURL:url])) { + if (image && options & SDWebImageRefreshCached) { + dispatch_main_sync_safe(^{ + // If image was found in the cache bug SDWebImageRefreshCached is provided, notify about the cached image + // AND try to re-download it in order to let a chance to NSURLCache to refresh it from server. + completedBlock(image, nil, cacheType, YES, url); + }); + } + + // download if no image or requested to refresh anyway, and download allowed by delegate + SDWebImageDownloaderOptions downloaderOptions = 0; + if (options & SDWebImageLowPriority) downloaderOptions |= SDWebImageDownloaderLowPriority; + if (options & SDWebImageProgressiveDownload) downloaderOptions |= SDWebImageDownloaderProgressiveDownload; + if (options & SDWebImageRefreshCached) downloaderOptions |= SDWebImageDownloaderUseNSURLCache; + if (options & SDWebImageContinueInBackground) downloaderOptions |= SDWebImageDownloaderContinueInBackground; + if (options & SDWebImageHandleCookies) downloaderOptions |= SDWebImageDownloaderHandleCookies; + if (options & SDWebImageAllowInvalidSSLCertificates) downloaderOptions |= SDWebImageDownloaderAllowInvalidSSLCertificates; + if (options & SDWebImageHighPriority) downloaderOptions |= SDWebImageDownloaderHighPriority; + if (image && options & SDWebImageRefreshCached) { + // force progressive off if image already cached but forced refreshing + downloaderOptions &= ~SDWebImageDownloaderProgressiveDownload; + // ignore image read from NSURLCache if image if cached but force refreshing + downloaderOptions |= SDWebImageDownloaderIgnoreCachedResponse; + } + id subOperation = [self.imageDownloader downloadImageWithURL:url options:downloaderOptions progress:progressBlock completed:^(UIImage *downloadedImage, NSData *data, NSError *error, BOOL finished) { + if (weakOperation.isCancelled) { + // Do nothing if the operation was cancelled + // See #699 for more details + // if we would call the completedBlock, there could be a race condition between this block and another completedBlock for the same object, so if this one is called second, we will overwrite the new data + } + else if (error) { + dispatch_main_sync_safe(^{ + if (!weakOperation.isCancelled) { + completedBlock(nil, error, SDImageCacheTypeNone, finished, url); + } + }); + + BOOL shouldBeFailedURLAlliOSVersion = (error.code != NSURLErrorNotConnectedToInternet && error.code != NSURLErrorCancelled && error.code != NSURLErrorTimedOut); + BOOL shouldBeFailedURLiOS7 = (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1 && error.code != NSURLErrorInternationalRoamingOff && error.code != NSURLErrorCallIsActive && error.code != NSURLErrorDataNotAllowed); + if (shouldBeFailedURLAlliOSVersion || shouldBeFailedURLiOS7) { + @synchronized (self.failedURLs) { + [self.failedURLs addObject:url]; + } + } + } + else { + if ((options & SDWebImageRetryFailed)) { + @synchronized (self.failedURLs) { + [self.failedURLs removeObject:url]; + } + } + + BOOL cacheOnDisk = !(options & SDWebImageCacheMemoryOnly); + + if (options & SDWebImageRefreshCached && image && !downloadedImage) { + // Image refresh hit the NSURLCache cache, do not call the completion block + } + else if (downloadedImage && (!downloadedImage.images || (options & SDWebImageTransformAnimatedImage)) && [self.delegate respondsToSelector:@selector(imageManager:transformDownloadedImage:withURL:)]) { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ + UIImage *transformedImage = [self.delegate imageManager:self transformDownloadedImage:downloadedImage withURL:url]; + + if (transformedImage && finished) { + BOOL imageWasTransformed = ![transformedImage isEqual:downloadedImage]; + [self.imageCache storeImage:transformedImage recalculateFromImage:imageWasTransformed imageData:(imageWasTransformed ? nil : data) forKey:key toDisk:cacheOnDisk]; + } + + dispatch_main_sync_safe(^{ + if (!weakOperation.isCancelled) { + completedBlock(transformedImage, nil, SDImageCacheTypeNone, finished, url); + } + }); + }); + } + else { + if (downloadedImage && finished) { + [self.imageCache storeImage:downloadedImage recalculateFromImage:NO imageData:data forKey:key toDisk:cacheOnDisk]; + } + + dispatch_main_sync_safe(^{ + if (!weakOperation.isCancelled) { + completedBlock(downloadedImage, nil, SDImageCacheTypeNone, finished, url); + } + }); + } + } + + if (finished) { + @synchronized (self.runningOperations) { + [self.runningOperations removeObject:operation]; + } + } + }]; + operation.cancelBlock = ^{ + [subOperation cancel]; + + @synchronized (self.runningOperations) { + [self.runningOperations removeObject:weakOperation]; + } + }; + } + else if (image) { + dispatch_main_sync_safe(^{ + if (!weakOperation.isCancelled) { + completedBlock(image, nil, cacheType, YES, url); + } + }); + @synchronized (self.runningOperations) { + [self.runningOperations removeObject:operation]; + } + } + else { + // Image not in cache and download disallowed by delegate + dispatch_main_sync_safe(^{ + if (!weakOperation.isCancelled) { + completedBlock(nil, nil, SDImageCacheTypeNone, YES, url); + } + }); + @synchronized (self.runningOperations) { + [self.runningOperations removeObject:operation]; + } + } + }]; + + return operation; +} + +- (void)saveImageToCache:(UIImage *)image forURL:(NSURL *)url { + if (image && url) { + NSString *key = [self cacheKeyForURL:url]; + [self.imageCache storeImage:image forKey:key toDisk:YES]; + } +} + +- (void)cancelAll { + @synchronized (self.runningOperations) { + NSArray *copiedOperations = [self.runningOperations copy]; + [copiedOperations makeObjectsPerformSelector:@selector(cancel)]; + [self.runningOperations removeObjectsInArray:copiedOperations]; + } +} + +- (BOOL)isRunning { + return self.runningOperations.count > 0; +} + +@end + + +@implementation SDWebImageCombinedOperation + +- (void)setCancelBlock:(SDWebImageNoParamsBlock)cancelBlock { + // check if the operation is already cancelled, then we just call the cancelBlock + if (self.isCancelled) { + if (cancelBlock) { + cancelBlock(); + } + _cancelBlock = nil; // don't forget to nil the cancelBlock, otherwise we will get crashes + } else { + _cancelBlock = [cancelBlock copy]; + } +} + +- (void)cancel { + self.cancelled = YES; + if (self.cacheOperation) { + [self.cacheOperation cancel]; + self.cacheOperation = nil; + } + if (self.cancelBlock) { + self.cancelBlock(); + + // TODO: this is a temporary fix to #809. + // Until we can figure the exact cause of the crash, going with the ivar instead of the setter +// self.cancelBlock = nil; + _cancelBlock = nil; + } +} + +@end + + +@implementation SDWebImageManager (Deprecated) + +// deprecated method, uses the non deprecated method +// adapter for the completion block +- (id )downloadWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedWithFinishedBlock)completedBlock { + return [self downloadImageWithURL:url + options:options + progress:progressBlock + completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType, finished); + } + }]; +} + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h new file mode 100644 index 0000000..71094ee --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h @@ -0,0 +1,15 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import + +@protocol SDWebImageOperation + +- (void)cancel; + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h new file mode 100644 index 0000000..7bb67ac --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h @@ -0,0 +1,103 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageManager.h" + +@class SDWebImagePrefetcher; + +@protocol SDWebImagePrefetcherDelegate + +@optional + +/** + * Called when an image was prefetched. + * + * @param imagePrefetcher The current image prefetcher + * @param imageURL The image url that was prefetched + * @param finishedCount The total number of images that were prefetched (successful or not) + * @param totalCount The total number of images that were to be prefetched + */ +- (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; + +/** + * Called when all images are prefetched. + * @param imagePrefetcher The current image prefetcher + * @param totalCount The total number of images that were prefetched (whether successful or not) + * @param skippedCount The total number of images that were skipped + */ +- (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; + +@end + +typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); +typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); + +/** + * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. + */ +@interface SDWebImagePrefetcher : NSObject + +/** + * The web image manager + */ +@property (strong, nonatomic, readonly) SDWebImageManager *manager; + +/** + * Maximum number of URLs to prefetch at the same time. Defaults to 3. + */ +@property (nonatomic, assign) NSUInteger maxConcurrentDownloads; + +/** + * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. + */ +@property (nonatomic, assign) SDWebImageOptions options; + +/** + * Queue options for Prefetcher. Defaults to Main Queue. + */ +@property (nonatomic, assign) dispatch_queue_t prefetcherQueue; + +@property (weak, nonatomic) id delegate; + +/** + * Return the global image prefetcher instance. + */ ++ (SDWebImagePrefetcher *)sharedImagePrefetcher; + +/** + * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, + * currently one image is downloaded at a time, + * and skips images for failed downloads and proceed to the next image in the list + * + * @param urls list of URLs to prefetch + */ +- (void)prefetchURLs:(NSArray *)urls; + +/** + * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, + * currently one image is downloaded at a time, + * and skips images for failed downloads and proceed to the next image in the list + * + * @param urls list of URLs to prefetch + * @param progressBlock block to be called when progress updates; + * first parameter is the number of completed (successful or not) requests, + * second parameter is the total number of images originally requested to be prefetched + * @param completionBlock block to be called when prefetching is completed + * first param is the number of completed (successful or not) requests, + * second parameter is the number of skipped requests + */ +- (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock; + +/** + * Remove and cancel queued list + */ +- (void)cancelPrefetching; + + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m new file mode 100644 index 0000000..8756bd0 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m @@ -0,0 +1,145 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImagePrefetcher.h" + +#if (!defined(DEBUG) && !defined (SD_VERBOSE)) || defined(SD_LOG_NONE) +#define NSLog(...) +#endif + +@interface SDWebImagePrefetcher () + +@property (strong, nonatomic) SDWebImageManager *manager; +@property (strong, nonatomic) NSArray *prefetchURLs; +@property (assign, nonatomic) NSUInteger requestedCount; +@property (assign, nonatomic) NSUInteger skippedCount; +@property (assign, nonatomic) NSUInteger finishedCount; +@property (assign, nonatomic) NSTimeInterval startedTime; +@property (copy, nonatomic) SDWebImagePrefetcherCompletionBlock completionBlock; +@property (copy, nonatomic) SDWebImagePrefetcherProgressBlock progressBlock; + +@end + +@implementation SDWebImagePrefetcher + ++ (SDWebImagePrefetcher *)sharedImagePrefetcher { + static dispatch_once_t once; + static id instance; + dispatch_once(&once, ^{ + instance = [self new]; + }); + return instance; +} + +- (id)init { + if ((self = [super init])) { + _manager = [SDWebImageManager new]; + _options = SDWebImageLowPriority; + _prefetcherQueue = dispatch_get_main_queue(); + self.maxConcurrentDownloads = 3; + } + return self; +} + +- (void)setMaxConcurrentDownloads:(NSUInteger)maxConcurrentDownloads { + self.manager.imageDownloader.maxConcurrentDownloads = maxConcurrentDownloads; +} + +- (NSUInteger)maxConcurrentDownloads { + return self.manager.imageDownloader.maxConcurrentDownloads; +} + +- (void)startPrefetchingAtIndex:(NSUInteger)index { + if (index >= self.prefetchURLs.count) return; + self.requestedCount++; + [self.manager downloadImageWithURL:self.prefetchURLs[index] options:self.options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (!finished) return; + self.finishedCount++; + + if (image) { + if (self.progressBlock) { + self.progressBlock(self.finishedCount,[self.prefetchURLs count]); + } + NSLog(@"Prefetched %@ out of %@", @(self.finishedCount), @(self.prefetchURLs.count)); + } + else { + if (self.progressBlock) { + self.progressBlock(self.finishedCount,[self.prefetchURLs count]); + } + NSLog(@"Prefetched %@ out of %@ (Failed)", @(self.finishedCount), @(self.prefetchURLs.count)); + + // Add last failed + self.skippedCount++; + } + if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didPrefetchURL:finishedCount:totalCount:)]) { + [self.delegate imagePrefetcher:self + didPrefetchURL:self.prefetchURLs[index] + finishedCount:self.finishedCount + totalCount:self.prefetchURLs.count + ]; + } + if (self.prefetchURLs.count > self.requestedCount) { + dispatch_async(self.prefetcherQueue, ^{ + [self startPrefetchingAtIndex:self.requestedCount]; + }); + } + else if (self.finishedCount == self.requestedCount) { + [self reportStatus]; + if (self.completionBlock) { + self.completionBlock(self.finishedCount, self.skippedCount); + self.completionBlock = nil; + } + self.progressBlock = nil; + } + }]; +} + +- (void)reportStatus { + NSUInteger total = [self.prefetchURLs count]; + NSLog(@"Finished prefetching (%@ successful, %@ skipped, timeElasped %.2f)", @(total - self.skippedCount), @(self.skippedCount), CFAbsoluteTimeGetCurrent() - self.startedTime); + if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didFinishWithTotalCount:skippedCount:)]) { + [self.delegate imagePrefetcher:self + didFinishWithTotalCount:(total - self.skippedCount) + skippedCount:self.skippedCount + ]; + } +} + +- (void)prefetchURLs:(NSArray *)urls { + [self prefetchURLs:urls progress:nil completed:nil]; +} + +- (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock { + [self cancelPrefetching]; // Prevent duplicate prefetch request + self.startedTime = CFAbsoluteTimeGetCurrent(); + self.prefetchURLs = urls; + self.completionBlock = completionBlock; + self.progressBlock = progressBlock; + + if(urls.count == 0){ + if(completionBlock){ + completionBlock(0,0); + } + }else{ + // Starts prefetching from the very first image on the list with the max allowed concurrency + NSUInteger listCount = self.prefetchURLs.count; + for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) { + [self startPrefetchingAtIndex:i]; + } + } +} + +- (void)cancelPrefetching { + self.prefetchURLs = nil; + self.skippedCount = 0; + self.requestedCount = 0; + self.finishedCount = 0; + [self.manager cancelAll]; +} + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/UIButton+WebCache.h b/dayPhoto/Pods/SDWebImage/SDWebImage/UIButton+WebCache.h new file mode 100644 index 0000000..48ad0d5 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/UIButton+WebCache.h @@ -0,0 +1,229 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" +#import "SDWebImageManager.h" + +/** + * Integrates SDWebImage async downloading and caching of remote images with UIButtonView. + */ +@interface UIButton (WebCache) + +/** + * Get the current image URL. + */ +- (NSURL *)sd_currentImageURL; + +/** + * Get the image URL for a control state. + * + * @param state Which state you want to know the URL for. The values are described in UIControlState. + */ +- (NSURL *)sd_imageURLForState:(UIControlState)state; + +/** + * Set the imageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + */ +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state; + +/** + * Set the imageView `image` with an `url` and a placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @see sd_setImageWithURL:placeholderImage:options: + */ +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + */ +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options; + +/** + * Set the imageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrived from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url`, placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrived from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrived from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the backgroundImageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + */ +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state; + +/** + * Set the backgroundImageView `image` with an `url` and a placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @see sd_setImageWithURL:placeholderImage:options: + */ +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder; + +/** + * Set the backgroundImageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + */ +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options; + +/** + * Set the backgroundImageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrived from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the backgroundImageView `image` with an `url`, placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param state The state that uses the specified title. The values are described in UIControlState. + * @param placeholder The image to be set initially, until the image request finishes. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrived from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the backgroundImageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrived from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Cancel the current image download + */ +- (void)sd_cancelImageLoadForState:(UIControlState)state; + +/** + * Cancel the current backgroundImage download + */ +- (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state; + +@end + + +@interface UIButton (WebCacheDeprecated) + +- (NSURL *)currentImageURL __deprecated_msg("Use `sd_currentImageURL`"); +- (NSURL *)imageURLForState:(UIControlState)state __deprecated_msg("Use `sd_imageURLForState:`"); + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:`"); +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:placeholderImage:`"); +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:placeholderImage:options:`"); + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:completed:`"); +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:placeholderImage:completed:`"); +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:placeholderImage:options:completed:`"); + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:`"); +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:placeholderImage:`"); +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:placeholderImage:options:`"); + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:completed:`"); +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:placeholderImage:completed:`"); +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:placeholderImage:options:completed:`"); + +- (void)cancelCurrentImageLoad __deprecated_msg("Use `sd_cancelImageLoadForState:`"); +- (void)cancelBackgroundImageLoadForState:(UIControlState)state __deprecated_msg("Use `sd_cancelBackgroundImageLoadForState:`"); + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/UIButton+WebCache.m b/dayPhoto/Pods/SDWebImage/SDWebImage/UIButton+WebCache.m new file mode 100644 index 0000000..33f7c29 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/UIButton+WebCache.m @@ -0,0 +1,260 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIButton+WebCache.h" +#import "objc/runtime.h" +#import "UIView+WebCacheOperation.h" + +static char imageURLStorageKey; + +@implementation UIButton (WebCache) + +- (NSURL *)sd_currentImageURL { + NSURL *url = self.imageURLStorage[@(self.state)]; + + if (!url) { + url = self.imageURLStorage[@(UIControlStateNormal)]; + } + + return url; +} + +- (NSURL *)sd_imageURLForState:(UIControlState)state { + return self.imageURLStorage[@(state)]; +} + +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state { + [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil]; +} + +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil]; +} + +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; +} + +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { + + [self setImage:placeholder forState:state]; + [self sd_cancelImageLoadForState:state]; + + if (!url) { + [self.imageURLStorage removeObjectForKey:@(state)]; + + dispatch_main_async_safe(^{ + NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; + if (completedBlock) { + completedBlock(nil, error, SDImageCacheTypeNone, url); + } + }); + + return; + } + + self.imageURLStorage[@(state)] = url; + + __weak __typeof(self)wself = self; + id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (!wself) return; + dispatch_main_sync_safe(^{ + __strong UIButton *sself = wself; + if (!sself) return; + if (image) { + [sself setImage:image forState:state]; + } + if (completedBlock && finished) { + completedBlock(image, error, cacheType, url); + } + }); + }]; + [self sd_setImageLoadOperation:operation forState:state]; +} + +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil]; +} + +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil]; +} + +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; +} + +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock]; +} + +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock]; +} + +- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_cancelImageLoadForState:state]; + + [self setBackgroundImage:placeholder forState:state]; + + if (url) { + __weak __typeof(self)wself = self; + id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (!wself) return; + dispatch_main_sync_safe(^{ + __strong UIButton *sself = wself; + if (!sself) return; + if (image) { + [sself setBackgroundImage:image forState:state]; + } + if (completedBlock && finished) { + completedBlock(image, error, cacheType, url); + } + }); + }]; + [self sd_setBackgroundImageLoadOperation:operation forState:state]; + } else { + dispatch_main_async_safe(^{ + NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; + if (completedBlock) { + completedBlock(nil, error, SDImageCacheTypeNone, url); + } + }); + } +} + +- (void)sd_setImageLoadOperation:(id)operation forState:(UIControlState)state { + [self sd_setImageLoadOperation:operation forKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)]]; +} + +- (void)sd_cancelImageLoadForState:(UIControlState)state { + [self sd_cancelImageLoadOperationWithKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)]]; +} + +- (void)sd_setBackgroundImageLoadOperation:(id)operation forState:(UIControlState)state { + [self sd_setImageLoadOperation:operation forKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)]]; +} + +- (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state { + [self sd_cancelImageLoadOperationWithKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)]]; +} + +- (NSMutableDictionary *)imageURLStorage { + NSMutableDictionary *storage = objc_getAssociatedObject(self, &imageURLStorageKey); + if (!storage) + { + storage = [NSMutableDictionary dictionary]; + objc_setAssociatedObject(self, &imageURLStorageKey, storage, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + + return storage; +} + +@end + + +@implementation UIButton (WebCacheDeprecated) + +- (NSURL *)currentImageURL { + return [self sd_currentImageURL]; +} + +- (NSURL *)imageURLForState:(UIControlState)state { + return [self sd_imageURLForState:state]; +} + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state { + [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil]; +} + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil]; +} + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; +} + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil]; +} + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil]; +} + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; +} + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)cancelCurrentImageLoad { + // in a backwards compatible manner, cancel for current state + [self sd_cancelImageLoadForState:self.state]; +} + +- (void)cancelBackgroundImageLoadForState:(UIControlState)state { + [self sd_cancelBackgroundImageLoadForState:state]; +} + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/UIImage+GIF.h b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImage+GIF.h new file mode 100755 index 0000000..084f424 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImage+GIF.h @@ -0,0 +1,19 @@ +// +// UIImage+GIF.h +// LBGIFImage +// +// Created by Laurin Brandner on 06.01.12. +// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// + +#import + +@interface UIImage (GIF) + ++ (UIImage *)sd_animatedGIFNamed:(NSString *)name; + ++ (UIImage *)sd_animatedGIFWithData:(NSData *)data; + +- (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size; + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/UIImage+GIF.m b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImage+GIF.m new file mode 100755 index 0000000..a703637 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImage+GIF.m @@ -0,0 +1,158 @@ +// +// UIImage+GIF.m +// LBGIFImage +// +// Created by Laurin Brandner on 06.01.12. +// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// + +#import "UIImage+GIF.h" +#import + +@implementation UIImage (GIF) + ++ (UIImage *)sd_animatedGIFWithData:(NSData *)data { + if (!data) { + return nil; + } + + CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL); + + size_t count = CGImageSourceGetCount(source); + + UIImage *animatedImage; + + if (count <= 1) { + animatedImage = [[UIImage alloc] initWithData:data]; + } + else { + NSMutableArray *images = [NSMutableArray array]; + + NSTimeInterval duration = 0.0f; + + for (size_t i = 0; i < count; i++) { + CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL); + + duration += [self sd_frameDurationAtIndex:i source:source]; + + [images addObject:[UIImage imageWithCGImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]]; + + CGImageRelease(image); + } + + if (!duration) { + duration = (1.0f / 10.0f) * count; + } + + animatedImage = [UIImage animatedImageWithImages:images duration:duration]; + } + + CFRelease(source); + + return animatedImage; +} + ++ (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source { + float frameDuration = 0.1f; + CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil); + NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties; + NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary]; + + NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime]; + if (delayTimeUnclampedProp) { + frameDuration = [delayTimeUnclampedProp floatValue]; + } + else { + + NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime]; + if (delayTimeProp) { + frameDuration = [delayTimeProp floatValue]; + } + } + + // Many annoying ads specify a 0 duration to make an image flash as quickly as possible. + // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify + // a duration of <= 10 ms. See and + // for more information. + + if (frameDuration < 0.011f) { + frameDuration = 0.100f; + } + + CFRelease(cfFrameProperties); + return frameDuration; +} + ++ (UIImage *)sd_animatedGIFNamed:(NSString *)name { + CGFloat scale = [UIScreen mainScreen].scale; + + if (scale > 1.0f) { + NSString *retinaPath = [[NSBundle mainBundle] pathForResource:[name stringByAppendingString:@"@2x"] ofType:@"gif"]; + + NSData *data = [NSData dataWithContentsOfFile:retinaPath]; + + if (data) { + return [UIImage sd_animatedGIFWithData:data]; + } + + NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"]; + + data = [NSData dataWithContentsOfFile:path]; + + if (data) { + return [UIImage sd_animatedGIFWithData:data]; + } + + return [UIImage imageNamed:name]; + } + else { + NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"]; + + NSData *data = [NSData dataWithContentsOfFile:path]; + + if (data) { + return [UIImage sd_animatedGIFWithData:data]; + } + + return [UIImage imageNamed:name]; + } +} + +- (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size { + if (CGSizeEqualToSize(self.size, size) || CGSizeEqualToSize(size, CGSizeZero)) { + return self; + } + + CGSize scaledSize = size; + CGPoint thumbnailPoint = CGPointZero; + + CGFloat widthFactor = size.width / self.size.width; + CGFloat heightFactor = size.height / self.size.height; + CGFloat scaleFactor = (widthFactor > heightFactor) ? widthFactor : heightFactor; + scaledSize.width = self.size.width * scaleFactor; + scaledSize.height = self.size.height * scaleFactor; + + if (widthFactor > heightFactor) { + thumbnailPoint.y = (size.height - scaledSize.height) * 0.5; + } + else if (widthFactor < heightFactor) { + thumbnailPoint.x = (size.width - scaledSize.width) * 0.5; + } + + NSMutableArray *scaledImages = [NSMutableArray array]; + + UIGraphicsBeginImageContextWithOptions(size, NO, 0.0); + + for (UIImage *image in self.images) { + [image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)]; + UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); + + [scaledImages addObject:newImage]; + } + + UIGraphicsEndImageContext(); + + return [UIImage animatedImageWithImages:scaledImages duration:self.duration]; +} + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h new file mode 100644 index 0000000..186ebc0 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h @@ -0,0 +1,15 @@ +// +// UIImage+MultiFormat.h +// SDWebImage +// +// Created by Olivier Poitrey on 07/06/13. +// Copyright (c) 2013 Dailymotion. All rights reserved. +// + +#import + +@interface UIImage (MultiFormat) + ++ (UIImage *)sd_imageWithData:(NSData *)data; + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m new file mode 100644 index 0000000..a830754 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m @@ -0,0 +1,118 @@ +// +// UIImage+MultiFormat.m +// SDWebImage +// +// Created by Olivier Poitrey on 07/06/13. +// Copyright (c) 2013 Dailymotion. All rights reserved. +// + +#import "UIImage+MultiFormat.h" +#import "UIImage+GIF.h" +#import "NSData+ImageContentType.h" +#import + +#ifdef SD_WEBP +#import "UIImage+WebP.h" +#endif + +@implementation UIImage (MultiFormat) + ++ (UIImage *)sd_imageWithData:(NSData *)data { + if (!data) { + return nil; + } + + UIImage *image; + NSString *imageContentType = [NSData sd_contentTypeForImageData:data]; + if ([imageContentType isEqualToString:@"image/gif"]) { + image = [UIImage sd_animatedGIFWithData:data]; + } +#ifdef SD_WEBP + else if ([imageContentType isEqualToString:@"image/webp"]) + { + image = [UIImage sd_imageWithWebPData:data]; + } +#endif + else { + image = [[UIImage alloc] initWithData:data]; + UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data]; + if (orientation != UIImageOrientationUp) { + image = [UIImage imageWithCGImage:image.CGImage + scale:image.scale + orientation:orientation]; + } + } + + + return image; +} + + ++(UIImageOrientation)sd_imageOrientationFromImageData:(NSData *)imageData { + UIImageOrientation result = UIImageOrientationUp; + CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL); + if (imageSource) { + CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); + if (properties) { + CFTypeRef val; + int exifOrientation; + val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); + if (val) { + CFNumberGetValue(val, kCFNumberIntType, &exifOrientation); + result = [self sd_exifOrientationToiOSOrientation:exifOrientation]; + } // else - if it's not set it remains at up + CFRelease((CFTypeRef) properties); + } else { + //NSLog(@"NO PROPERTIES, FAIL"); + } + CFRelease(imageSource); + } + return result; +} + +#pragma mark EXIF orientation tag converter +// Convert an EXIF image orientation to an iOS one. +// reference see here: http://sylvana.net/jpegcrop/exif_orientation.html ++ (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation { + UIImageOrientation orientation = UIImageOrientationUp; + switch (exifOrientation) { + case 1: + orientation = UIImageOrientationUp; + break; + + case 3: + orientation = UIImageOrientationDown; + break; + + case 8: + orientation = UIImageOrientationLeft; + break; + + case 6: + orientation = UIImageOrientationRight; + break; + + case 2: + orientation = UIImageOrientationUpMirrored; + break; + + case 4: + orientation = UIImageOrientationDownMirrored; + break; + + case 5: + orientation = UIImageOrientationLeftMirrored; + break; + + case 7: + orientation = UIImageOrientationRightMirrored; + break; + default: + break; + } + return orientation; +} + + + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h new file mode 100644 index 0000000..57f708f --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h @@ -0,0 +1,100 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageCompat.h" +#import "SDWebImageManager.h" + +/** + * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. + */ +@interface UIImageView (HighlightedWebCache) + +/** + * Set the imageView `highlightedImage` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + */ +- (void)sd_setHighlightedImageWithURL:(NSURL *)url; + +/** + * Set the imageView `highlightedImage` with an `url` and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + */ +- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options; + +/** + * Set the imageView `highlightedImage` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrived from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `highlightedImage` with an `url` and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrived from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `highlightedImage` with an `url` and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param progressBlock A block called while image is downloading + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrived from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Cancel the current download + */ +- (void)sd_cancelCurrentHighlightedImageLoad; + +@end + + +@interface UIImageView (HighlightedWebCacheDeprecated) + +- (void)setHighlightedImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:`"); +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:`"); +- (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:completed:`"); +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:completed:`"); +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:progress:completed:`"); + +- (void)cancelCurrentHighlightedImageLoad __deprecated_msg("Use `sd_cancelCurrentHighlightedImageLoad`"); + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m new file mode 100644 index 0000000..eed798f --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m @@ -0,0 +1,107 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIImageView+HighlightedWebCache.h" +#import "UIView+WebCacheOperation.h" + +#define UIImageViewHighlightedWebCacheOperationKey @"highlightedImage" + +@implementation UIImageView (HighlightedWebCache) + +- (void)sd_setHighlightedImageWithURL:(NSURL *)url { + [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; +} + +- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { + [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; +} + +- (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; +} + +- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; +} + +- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_cancelCurrentHighlightedImageLoad]; + + if (url) { + __weak __typeof(self)wself = self; + id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (!wself) return; + dispatch_main_sync_safe (^ + { + if (!wself) return; + if (image) { + wself.highlightedImage = image; + [wself setNeedsLayout]; + } + if (completedBlock && finished) { + completedBlock(image, error, cacheType, url); + } + }); + }]; + [self sd_setImageLoadOperation:operation forKey:UIImageViewHighlightedWebCacheOperationKey]; + } else { + dispatch_main_async_safe(^{ + NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; + if (completedBlock) { + completedBlock(nil, error, SDImageCacheTypeNone, url); + } + }); + } +} + +- (void)sd_cancelCurrentHighlightedImageLoad { + [self sd_cancelImageLoadOperationWithKey:UIImageViewHighlightedWebCacheOperationKey]; +} + +@end + + +@implementation UIImageView (HighlightedWebCacheDeprecated) + +- (void)setHighlightedImageWithURL:(NSURL *)url { + [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; +} + +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { + [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; +} + +- (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setHighlightedImageWithURL:url options:0 progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)cancelCurrentHighlightedImageLoad { + [self sd_cancelCurrentHighlightedImageLoad]; +} + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.h b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.h new file mode 100644 index 0000000..e7489f4 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.h @@ -0,0 +1,201 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" +#import "SDWebImageManager.h" + +/** + * Integrates SDWebImage async downloading and caching of remote images with UIImageView. + * + * Usage with a UITableViewCell sub-class: + * + * @code + +#import + +... + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *MyIdentifier = @"MyIdentifier"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; + + if (cell == nil) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier] + autorelease]; + } + + // Here we use the provided sd_setImageWithURL: method to load the web image + // Ensure you use a placeholder image otherwise cells will be initialized with no image + [cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://example.com/image.jpg"] + placeholderImage:[UIImage imageNamed:@"placeholder"]]; + + cell.textLabel.text = @"My Text"; + return cell; +} + + * @endcode + */ +@interface UIImageView (WebCache) + +/** + * Get the current image URL. + * + * Note that because of the limitations of categories this property can get out of sync + * if you use sd_setImage: directly. + */ +- (NSURL *)sd_imageURL; + +/** + * Set the imageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + */ +- (void)sd_setImageWithURL:(NSURL *)url; + +/** + * Set the imageView `image` with an `url` and a placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @see sd_setImageWithURL:placeholderImage:options: + */ +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + */ +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options; + +/** + * Set the imageView `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrived from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url`, placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrived from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrived from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param progressBlock A block called while image is downloading + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrived from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Set the imageView `image` with an `url` and a optionaly placeholder image. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param progressBlock A block called while image is downloading + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrived from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithPreviousCachedImageWithURL:(NSURL *)url andPlaceholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; + +/** + * Download an array of images and starts them in an animation loop + * + * @param arrayOfURLs An array of NSURL + */ +- (void)sd_setAnimationImagesWithURLs:(NSArray *)arrayOfURLs; + +/** + * Cancel the current download + */ +- (void)sd_cancelCurrentImageLoad; + +- (void)sd_cancelCurrentAnimationImagesLoad; + +@end + + +@interface UIImageView (WebCacheDeprecated) + +- (NSURL *)imageURL __deprecated_msg("Use `sd_imageURL`"); + +- (void)setImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:`"); +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:`"); +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options`"); + +- (void)setImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:completed:`"); +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:completed:`"); +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options:completed:`"); +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options:progress:completed:`"); + +- (void)setAnimationImagesWithURLs:(NSArray *)arrayOfURLs __deprecated_msg("Use `sd_setAnimationImagesWithURLs:`"); + +- (void)cancelCurrentArrayLoad __deprecated_msg("Use `sd_cancelCurrentAnimationImagesLoad`"); + +- (void)cancelCurrentImageLoad __deprecated_msg("Use `sd_cancelCurrentImageLoad`"); + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m new file mode 100644 index 0000000..162c49a --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m @@ -0,0 +1,202 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIImageView+WebCache.h" +#import "objc/runtime.h" +#import "UIView+WebCacheOperation.h" + +static char imageURLKey; + +@implementation UIImageView (WebCache) + +- (void)sd_setImageWithURL:(NSURL *)url { + [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:nil]; +} + +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder { + [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:nil]; +} + +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:nil]; +} + +- (void)sd_setImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; +} + +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { + [self sd_cancelCurrentImageLoad]; + objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + + if (!(options & SDWebImageDelayPlaceholder)) { + dispatch_main_async_safe(^{ + self.image = placeholder; + }); + } + + if (url) { + __weak __typeof(self)wself = self; + id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (!wself) return; + dispatch_main_sync_safe(^{ + if (!wself) return; + if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock) + { + completedBlock(image, error, cacheType, url); + return; + } + else if (image) { + wself.image = image; + [wself setNeedsLayout]; + } else { + if ((options & SDWebImageDelayPlaceholder)) { + wself.image = placeholder; + [wself setNeedsLayout]; + } + } + if (completedBlock && finished) { + completedBlock(image, error, cacheType, url); + } + }); + }]; + [self sd_setImageLoadOperation:operation forKey:@"UIImageViewImageLoad"]; + } else { + dispatch_main_async_safe(^{ + NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; + if (completedBlock) { + completedBlock(nil, error, SDImageCacheTypeNone, url); + } + }); + } +} + +- (void)sd_setImageWithPreviousCachedImageWithURL:(NSURL *)url andPlaceholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { + NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:url]; + UIImage *lastPreviousCachedImage = [[SDImageCache sharedImageCache] imageFromDiskCacheForKey:key]; + + [self sd_setImageWithURL:url placeholderImage:lastPreviousCachedImage ?: placeholder options:options progress:progressBlock completed:completedBlock]; +} + +- (NSURL *)sd_imageURL { + return objc_getAssociatedObject(self, &imageURLKey); +} + +- (void)sd_setAnimationImagesWithURLs:(NSArray *)arrayOfURLs { + [self sd_cancelCurrentAnimationImagesLoad]; + __weak __typeof(self)wself = self; + + NSMutableArray *operationsArray = [[NSMutableArray alloc] init]; + + for (NSURL *logoImageURL in arrayOfURLs) { + id operation = [SDWebImageManager.sharedManager downloadImageWithURL:logoImageURL options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { + if (!wself) return; + dispatch_main_sync_safe(^{ + __strong UIImageView *sself = wself; + [sself stopAnimating]; + if (sself && image) { + NSMutableArray *currentImages = [[sself animationImages] mutableCopy]; + if (!currentImages) { + currentImages = [[NSMutableArray alloc] init]; + } + [currentImages addObject:image]; + + sself.animationImages = currentImages; + [sself setNeedsLayout]; + } + [sself startAnimating]; + }); + }]; + [operationsArray addObject:operation]; + } + + [self sd_setImageLoadOperation:[NSArray arrayWithArray:operationsArray] forKey:@"UIImageViewAnimationImages"]; +} + +- (void)sd_cancelCurrentImageLoad { + [self sd_cancelImageLoadOperationWithKey:@"UIImageViewImageLoad"]; +} + +- (void)sd_cancelCurrentAnimationImagesLoad { + [self sd_cancelImageLoadOperationWithKey:@"UIImageViewAnimationImages"]; +} + +@end + + +@implementation UIImageView (WebCacheDeprecated) + +- (NSURL *)imageURL { + return [self sd_imageURL]; +} + +- (void)setImageWithURL:(NSURL *)url { + [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:nil]; +} + +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder { + [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:nil]; +} + +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:nil]; +} + +- (void)setImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock { + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { + if (completedBlock) { + completedBlock(image, error, cacheType); + } + }]; +} + +- (void)cancelCurrentArrayLoad { + [self sd_cancelCurrentAnimationImagesLoad]; +} + +- (void)cancelCurrentImageLoad { + [self sd_cancelCurrentImageLoad]; +} + +- (void)setAnimationImagesWithURLs:(NSArray *)arrayOfURLs { + [self sd_setAnimationImagesWithURLs:arrayOfURLs]; +} + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h b/dayPhoto/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h new file mode 100644 index 0000000..6719036 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h @@ -0,0 +1,36 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import +#import "SDWebImageManager.h" + +@interface UIView (WebCacheOperation) + +/** + * Set the image load operation (storage in a UIView based dictionary) + * + * @param operation the operation + * @param key key for storing the operation + */ +- (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key; + +/** + * Cancel all operations for the current UIView and key + * + * @param key key for identifying the operations + */ +- (void)sd_cancelImageLoadOperationWithKey:(NSString *)key; + +/** + * Just remove the operations corresponding to the current UIView and key without cancelling them + * + * @param key key for identifying the operations + */ +- (void)sd_removeImageLoadOperationWithKey:(NSString *)key; + +@end diff --git a/dayPhoto/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m b/dayPhoto/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m new file mode 100644 index 0000000..9219478 --- /dev/null +++ b/dayPhoto/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m @@ -0,0 +1,55 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIView+WebCacheOperation.h" +#import "objc/runtime.h" + +static char loadOperationKey; + +@implementation UIView (WebCacheOperation) + +- (NSMutableDictionary *)operationDictionary { + NSMutableDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); + if (operations) { + return operations; + } + operations = [NSMutableDictionary dictionary]; + objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + return operations; +} + +- (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key { + [self sd_cancelImageLoadOperationWithKey:key]; + NSMutableDictionary *operationDictionary = [self operationDictionary]; + [operationDictionary setObject:operation forKey:key]; +} + +- (void)sd_cancelImageLoadOperationWithKey:(NSString *)key { + // Cancel in progress downloader from queue + NSMutableDictionary *operationDictionary = [self operationDictionary]; + id operations = [operationDictionary objectForKey:key]; + if (operations) { + if ([operations isKindOfClass:[NSArray class]]) { + for (id operation in operations) { + if (operation) { + [operation cancel]; + } + } + } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){ + [(id) operations cancel]; + } + [operationDictionary removeObjectForKey:key]; + } +} + +- (void)sd_removeImageLoadOperationWithKey:(NSString *)key { + NSMutableDictionary *operationDictionary = [self operationDictionary]; + [operationDictionary removeObjectForKey:key]; +} + +@end diff --git a/dayPhoto/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m b/dayPhoto/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m new file mode 100644 index 0000000..6a29cf8 --- /dev/null +++ b/dayPhoto/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/dayPhoto/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch b/dayPhoto/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch new file mode 100644 index 0000000..1e116a3 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch @@ -0,0 +1,11 @@ +#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 diff --git a/dayPhoto/Pods/Target Support Files/AFNetworking/AFNetworking-umbrella.h b/dayPhoto/Pods/Target Support Files/AFNetworking/AFNetworking-umbrella.h new file mode 100644 index 0000000..82a3f9d --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/AFNetworking/AFNetworking-umbrella.h @@ -0,0 +1,26 @@ +#import + +#import "AFNetworking.h" +#import "AFURLConnectionOperation.h" +#import "AFHTTPRequestOperation.h" +#import "AFHTTPRequestOperationManager.h" +#import "AFHTTPSessionManager.h" +#import "AFURLSessionManager.h" +#import "AFNetworkReachabilityManager.h" +#import "AFSecurityPolicy.h" +#import "AFURLRequestSerialization.h" +#import "AFURLResponseSerialization.h" +#import "AFNetworkActivityIndicatorManager.h" +#import "UIActivityIndicatorView+AFNetworking.h" +#import "UIAlertView+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/dayPhoto/Pods/Target Support Files/AFNetworking/AFNetworking.modulemap b/dayPhoto/Pods/Target Support Files/AFNetworking/AFNetworking.modulemap new file mode 100644 index 0000000..5892cd3 --- /dev/null +++ b/dayPhoto/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/dayPhoto/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig b/dayPhoto/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig new file mode 100644 index 0000000..95fce75 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/dayPhoto/Pods/Target Support Files/AFNetworking/Info.plist b/dayPhoto/Pods/Target Support Files/AFNetworking/Info.plist new file mode 100644 index 0000000..bd2d24d --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/AFNetworking/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 2.6.3 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift-dummy.m b/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift-dummy.m new file mode 100644 index 0000000..2e6982b --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_FSHelpers_Swift : NSObject +@end +@implementation PodsDummy_FSHelpers_Swift +@end diff --git a/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift-prefix.pch b/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift-umbrella.h b/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift-umbrella.h new file mode 100644 index 0000000..acdd8f5 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift-umbrella.h @@ -0,0 +1,6 @@ +#import + + +FOUNDATION_EXPORT double FSHelpers_SwiftVersionNumber; +FOUNDATION_EXPORT const unsigned char FSHelpers_SwiftVersionString[]; + diff --git a/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift.modulemap b/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift.modulemap new file mode 100644 index 0000000..57ce426 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift.modulemap @@ -0,0 +1,6 @@ +framework module FSHelpers_Swift { + umbrella header "FSHelpers+Swift-umbrella.h" + + export * + module * { export * } +} diff --git a/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift.xcconfig b/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift.xcconfig new file mode 100644 index 0000000..4090307 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/FSHelpers+Swift.xcconfig @@ -0,0 +1,6 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FSHelpers+Swift" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "Foundation" -framework "QuartzCore" -framework "UIKit" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/Info.plist b/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/Info.plist new file mode 100644 index 0000000..a60e6a4 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/FSHelpers+Swift/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 2.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/dayPhoto/Pods/Target Support Files/MagicalRecord/Info.plist b/dayPhoto/Pods/Target Support Files/MagicalRecord/Info.plist new file mode 100644 index 0000000..ad1d34e --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/MagicalRecord/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 2.3.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord-dummy.m b/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord-dummy.m new file mode 100644 index 0000000..54d1458 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_MagicalRecord : NSObject +@end +@implementation PodsDummy_MagicalRecord +@end diff --git a/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord-prefix.pch b/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord-prefix.pch new file mode 100644 index 0000000..90bdf4c --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord-prefix.pch @@ -0,0 +1,6 @@ +#ifdef __OBJC__ +#import +#endif + +#import +#import diff --git a/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord-umbrella.h b/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord-umbrella.h new file mode 100644 index 0000000..0e488f9 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord-umbrella.h @@ -0,0 +1,37 @@ +#import + +#import "MagicalImportFunctions.h" +#import "NSAttributeDescription+MagicalDataImport.h" +#import "NSEntityDescription+MagicalDataImport.h" +#import "NSNumber+MagicalDataImport.h" +#import "NSObject+MagicalDataImport.h" +#import "NSRelationshipDescription+MagicalDataImport.h" +#import "NSString+MagicalDataImport.h" +#import "NSManagedObject+MagicalAggregation.h" +#import "NSManagedObject+MagicalDataImport.h" +#import "NSManagedObject+MagicalFinders.h" +#import "NSManagedObject+MagicalRecord.h" +#import "NSManagedObject+MagicalRequests.h" +#import "NSManagedObjectContext+MagicalChainSave.h" +#import "NSManagedObjectContext+MagicalObserving.h" +#import "NSManagedObjectContext+MagicalRecord.h" +#import "NSManagedObjectContext+MagicalSaves.h" +#import "NSManagedObjectContext+MagicalThreading.h" +#import "NSManagedObjectModel+MagicalRecord.h" +#import "NSPersistentStore+MagicalRecord.h" +#import "NSPersistentStoreCoordinator+MagicalRecord.h" +#import "MagicalRecord+Actions.h" +#import "MagicalRecord+ErrorHandling.h" +#import "MagicalRecord+iCloud.h" +#import "MagicalRecord+Options.h" +#import "MagicalRecord+Setup.h" +#import "MagicalRecord+ShorthandMethods.h" +#import "MagicalRecordDeprecationMacros.h" +#import "MagicalRecordInternal.h" +#import "MagicalRecordLogging.h" +#import "MagicalRecordShorthandMethodAliases.h" +#import "MagicalRecord.h" + +FOUNDATION_EXPORT double MagicalRecordVersionNumber; +FOUNDATION_EXPORT const unsigned char MagicalRecordVersionString[]; + diff --git a/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord.modulemap b/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord.modulemap new file mode 100644 index 0000000..0d561ba --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord.modulemap @@ -0,0 +1,6 @@ +framework module MagicalRecord { + umbrella header "MagicalRecord-umbrella.h" + + export * + module * { export * } +} diff --git a/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord.xcconfig b/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord.xcconfig new file mode 100644 index 0000000..dc5f92c --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/MagicalRecord/MagicalRecord.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MagicalRecord" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "CoreData" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/dayPhoto/Pods/Target Support Files/Pods/Info.plist b/dayPhoto/Pods/Target Support Files/Pods/Info.plist new file mode 100644 index 0000000..6974542 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown b/dayPhoto/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown new file mode 100644 index 0000000..9468d0a --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown @@ -0,0 +1,128 @@ +# 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. + + +## FSHelpers+Swift + +The MIT License (MIT) + +Copyright (c) 2015 FSHelper + +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. + + +## MagicalRecord + + Copyright (c) 2010-2015, Magical Panda Software, LLC + + 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: + + * Link to the MagicalRecord Repository at http:/github.com/magicalpanda/magicalrecord in the credits section of your application + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + This software license is in accordance with the standard MIT License. + + 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. + + +## SDWebImage + +Copyright (c) 2009 Olivier Poitrey + +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. + + + +## VK-ios-sdk + +The MIT License (MIT) + +Copyright (c) 2015 VK.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. + +Generated by CocoaPods - http://cocoapods.org diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods-acknowledgements.plist b/dayPhoto/Pods/Target Support Files/Pods/Pods-acknowledgements.plist new file mode 100644 index 0000000..4669746 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods-acknowledgements.plist @@ -0,0 +1,174 @@ + + + + + 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 + The MIT License (MIT) + +Copyright (c) 2015 FSHelper + +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 + FSHelpers+Swift + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2010-2015, Magical Panda Software, LLC + + 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: + + * Link to the MagicalRecord Repository at http:/github.com/magicalpanda/magicalrecord in the credits section of your application + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + This software license is in accordance with the standard MIT License. + + 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 + MagicalRecord + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2009 Olivier Poitrey <rs@dailymotion.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 + SDWebImage + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2015 VK.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 + VK-ios-sdk + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - http://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods-dummy.m b/dayPhoto/Pods/Target Support Files/Pods/Pods-dummy.m new file mode 100644 index 0000000..ade64bd --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods : NSObject +@end +@implementation PodsDummy_Pods +@end diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods-frameworks.sh b/dayPhoto/Pods/Target Support Files/Pods/Pods-frameworks.sh new file mode 100755 index 0000000..ff7efd6 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods-frameworks.sh @@ -0,0 +1,141 @@ +#!/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/AFNetworking.framework" + install_framework "Pods/FSHelpers_Swift.framework" + install_framework "Pods/MagicalRecord.framework" + install_framework "Pods/SDWebImage.framework" + install_framework "Pods/VK_ios_sdk.framework" +fi +if [[ "$CONFIGURATION" == "AppStore Debug" ]]; then + install_framework "Pods/AFNetworking.framework" + install_framework "Pods/FSHelpers_Swift.framework" + install_framework "Pods/MagicalRecord.framework" + install_framework "Pods/SDWebImage.framework" + install_framework "Pods/VK_ios_sdk.framework" +fi +if [[ "$CONFIGURATION" == "Debug Staging" ]]; then + install_framework "Pods/AFNetworking.framework" + install_framework "Pods/FSHelpers_Swift.framework" + install_framework "Pods/MagicalRecord.framework" + install_framework "Pods/SDWebImage.framework" + install_framework "Pods/VK_ios_sdk.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "Pods/AFNetworking.framework" + install_framework "Pods/FSHelpers_Swift.framework" + install_framework "Pods/MagicalRecord.framework" + install_framework "Pods/SDWebImage.framework" + install_framework "Pods/VK_ios_sdk.framework" +fi +if [[ "$CONFIGURATION" == "Test" ]]; then + install_framework "Pods/AFNetworking.framework" + install_framework "Pods/FSHelpers_Swift.framework" + install_framework "Pods/MagicalRecord.framework" + install_framework "Pods/SDWebImage.framework" + install_framework "Pods/VK_ios_sdk.framework" +fi +if [[ "$CONFIGURATION" == "AppStore" ]]; then + install_framework "Pods/AFNetworking.framework" + install_framework "Pods/FSHelpers_Swift.framework" + install_framework "Pods/MagicalRecord.framework" + install_framework "Pods/SDWebImage.framework" + install_framework "Pods/VK_ios_sdk.framework" +fi +if [[ "$CONFIGURATION" == "Release Staging" ]]; then + install_framework "Pods/AFNetworking.framework" + install_framework "Pods/FSHelpers_Swift.framework" + install_framework "Pods/MagicalRecord.framework" + install_framework "Pods/SDWebImage.framework" + install_framework "Pods/VK_ios_sdk.framework" +fi +if [[ "$CONFIGURATION" == "Test Staging" ]]; then + install_framework "Pods/AFNetworking.framework" + install_framework "Pods/FSHelpers_Swift.framework" + install_framework "Pods/MagicalRecord.framework" + install_framework "Pods/SDWebImage.framework" + install_framework "Pods/VK_ios_sdk.framework" +fi diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods-resources.sh b/dayPhoto/Pods/Target Support Files/Pods/Pods-resources.sh new file mode 100755 index 0000000..16774fb --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods-resources.sh @@ -0,0 +1,95 @@ +#!/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() +{ + case $1 in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.framework) + echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" + xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + /*) + echo "$1" + echo "$1" >> "$RESOURCES_TO_COPY" + ;; + *) + echo "${PODS_ROOT}/$1" + echo "${PODS_ROOT}/$1" >> "$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 "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods-umbrella.h b/dayPhoto/Pods/Target Support Files/Pods/Pods-umbrella.h new file mode 100644 index 0000000..21dcfd2 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods-umbrella.h @@ -0,0 +1,6 @@ +#import + + +FOUNDATION_EXPORT double PodsVersionNumber; +FOUNDATION_EXPORT const unsigned char PodsVersionString[]; + diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods.appstore debug.xcconfig b/dayPhoto/Pods/Target Support Files/Pods/Pods.appstore debug.xcconfig new file mode 100644 index 0000000..a4f769e --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods.appstore 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/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FSHelpers_Swift.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MagicalRecord.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SDWebImage.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/VK_ios_sdk.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "FSHelpers_Swift" -framework "MagicalRecord" -framework "SDWebImage" -framework "VK_ios_sdk" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods.appstore.xcconfig b/dayPhoto/Pods/Target Support Files/Pods/Pods.appstore.xcconfig new file mode 100644 index 0000000..a4f769e --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods.appstore.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/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FSHelpers_Swift.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MagicalRecord.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SDWebImage.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/VK_ios_sdk.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "FSHelpers_Swift" -framework "MagicalRecord" -framework "SDWebImage" -framework "VK_ios_sdk" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods.debug staging.xcconfig b/dayPhoto/Pods/Target Support Files/Pods/Pods.debug staging.xcconfig new file mode 100644 index 0000000..a4f769e --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods.debug staging.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/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FSHelpers_Swift.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MagicalRecord.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SDWebImage.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/VK_ios_sdk.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "FSHelpers_Swift" -framework "MagicalRecord" -framework "SDWebImage" -framework "VK_ios_sdk" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods.debug.xcconfig b/dayPhoto/Pods/Target Support Files/Pods/Pods.debug.xcconfig new file mode 100644 index 0000000..a4f769e --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods.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/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FSHelpers_Swift.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MagicalRecord.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SDWebImage.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/VK_ios_sdk.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "FSHelpers_Swift" -framework "MagicalRecord" -framework "SDWebImage" -framework "VK_ios_sdk" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods.modulemap b/dayPhoto/Pods/Target Support Files/Pods/Pods.modulemap new file mode 100644 index 0000000..8413413 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods.modulemap @@ -0,0 +1,6 @@ +framework module Pods { + umbrella header "Pods-umbrella.h" + + export * + module * { export * } +} diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods.release staging.xcconfig b/dayPhoto/Pods/Target Support Files/Pods/Pods.release staging.xcconfig new file mode 100644 index 0000000..a4f769e --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods.release staging.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/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FSHelpers_Swift.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MagicalRecord.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SDWebImage.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/VK_ios_sdk.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "FSHelpers_Swift" -framework "MagicalRecord" -framework "SDWebImage" -framework "VK_ios_sdk" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods.release.xcconfig b/dayPhoto/Pods/Target Support Files/Pods/Pods.release.xcconfig new file mode 100644 index 0000000..a4f769e --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods.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/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FSHelpers_Swift.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MagicalRecord.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SDWebImage.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/VK_ios_sdk.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "FSHelpers_Swift" -framework "MagicalRecord" -framework "SDWebImage" -framework "VK_ios_sdk" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods.test staging.xcconfig b/dayPhoto/Pods/Target Support Files/Pods/Pods.test staging.xcconfig new file mode 100644 index 0000000..a4f769e --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods.test staging.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/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FSHelpers_Swift.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MagicalRecord.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SDWebImage.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/VK_ios_sdk.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "FSHelpers_Swift" -framework "MagicalRecord" -framework "SDWebImage" -framework "VK_ios_sdk" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/dayPhoto/Pods/Target Support Files/Pods/Pods.test.xcconfig b/dayPhoto/Pods/Target Support Files/Pods/Pods.test.xcconfig new file mode 100644 index 0000000..a4f769e --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/Pods/Pods.test.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/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FSHelpers_Swift.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MagicalRecord.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SDWebImage.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/VK_ios_sdk.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "FSHelpers_Swift" -framework "MagicalRecord" -framework "SDWebImage" -framework "VK_ios_sdk" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/dayPhoto/Pods/Target Support Files/SDWebImage/Info.plist b/dayPhoto/Pods/Target Support Files/SDWebImage/Info.plist new file mode 100644 index 0000000..1672e4c --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/SDWebImage/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 3.7.3 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m b/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m new file mode 100644 index 0000000..86d2b5f --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_SDWebImage : NSObject +@end +@implementation PodsDummy_SDWebImage +@end diff --git a/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch b/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h b/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h new file mode 100644 index 0000000..5a051dd --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h @@ -0,0 +1,21 @@ +#import + +#import "NSData+ImageContentType.h" +#import "SDImageCache.h" +#import "SDWebImageCompat.h" +#import "SDWebImageDecoder.h" +#import "SDWebImageDownloader.h" +#import "SDWebImageDownloaderOperation.h" +#import "SDWebImageManager.h" +#import "SDWebImageOperation.h" +#import "SDWebImagePrefetcher.h" +#import "UIButton+WebCache.h" +#import "UIImage+GIF.h" +#import "UIImage+MultiFormat.h" +#import "UIImageView+HighlightedWebCache.h" +#import "UIImageView+WebCache.h" +#import "UIView+WebCacheOperation.h" + +FOUNDATION_EXPORT double SDWebImageVersionNumber; +FOUNDATION_EXPORT const unsigned char SDWebImageVersionString[]; + diff --git a/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap b/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap new file mode 100644 index 0000000..91545be --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap @@ -0,0 +1,6 @@ +framework module SDWebImage { + umbrella header "SDWebImage-umbrella.h" + + export * + module * { export * } +} diff --git a/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig b/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig new file mode 100644 index 0000000..5e7aea2 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDWebImage" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "ImageIO" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/dayPhoto/Pods/Target Support Files/VK-ios-sdk/Info.plist b/dayPhoto/Pods/Target Support Files/VK-ios-sdk/Info.plist new file mode 100644 index 0000000..45e7f7a --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/VK-ios-sdk/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.3.8 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk-dummy.m b/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk-dummy.m new file mode 100644 index 0000000..dd01415 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_VK_ios_sdk : NSObject +@end +@implementation PodsDummy_VK_ios_sdk +@end diff --git a/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk-prefix.pch b/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk-umbrella.h b/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk-umbrella.h new file mode 100644 index 0000000..049fd69 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk-umbrella.h @@ -0,0 +1,61 @@ +#import + +#import "VKApiBase.h" +#import "VKApiCaptcha.h" +#import "VKApiConst.h" +#import "VKApiFriends.h" +#import "VKApiGroups.h" +#import "VKApiModels.h" +#import "VKApiPhotos.h" +#import "VKApiUsers.h" +#import "VKApiWall.h" +#import "VKApiObject.h" +#import "VKApiObjectArray.h" +#import "VKAudio.h" +#import "VKCounters.h" +#import "VKGroup.h" +#import "VKLikes.h" +#import "VKPhoto.h" +#import "VKPhotoSize.h" +#import "VKRelative.h" +#import "VKSchool.h" +#import "VKUniversity.h" +#import "VKUser.h" +#import "VKUploadMessagesPhotoRequest.h" +#import "VKUploadPhotoBase.h" +#import "VKUploadPhotoRequest.h" +#import "VKUploadWallPhotoRequest.h" +#import "VKApi.h" +#import "NSError+VKError.h" +#import "VKError.h" +#import "VKHTTPClient.h" +#import "VKHTTPOperation.h" +#import "VKJSONOperation.h" +#import "VKObject.h" +#import "VKOperation.h" +#import "VKRequest.h" +#import "VKRequestsScheduler.h" +#import "VKResponse.h" +#import "VKImageParameters.h" +#import "VKUploadImage.h" +#import "NSData+MD5.h" +#import "NSString+MD5.h" +#import "OrderedDictionary.h" +#import "VKUtil.h" +#import "VKActivity.h" +#import "VKAuthorizeController.h" +#import "VKCaptchaView.h" +#import "VKCaptchaViewController.h" +#import "VKShareDialogController.h" +#import "VKSharedTransitioningObject.h" +#import "VKAccessToken.h" +#import "VKAuthorizationResult.h" +#import "VKBatchRequest.h" +#import "VKBundle.h" +#import "VKPermissions.h" +#import "VKSdk.h" +#import "VKSdkVersion.h" + +FOUNDATION_EXPORT double VK_ios_sdkVersionNumber; +FOUNDATION_EXPORT const unsigned char VK_ios_sdkVersionString[]; + diff --git a/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk.modulemap b/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk.modulemap new file mode 100644 index 0000000..b582497 --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk.modulemap @@ -0,0 +1,6 @@ +framework module VK_ios_sdk { + umbrella header "VK-ios-sdk-umbrella.h" + + export * + module * { export * } +} diff --git a/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk.xcconfig b/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk.xcconfig new file mode 100644 index 0000000..b5ba92d --- /dev/null +++ b/dayPhoto/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/VK-ios-sdk" "${PODS_ROOT}/Headers/Public" +OTHER_LDFLAGS = -framework "CoreGraphics" -framework "Foundation" -framework "SafariServices" -framework "Security" -framework "UIKit" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/LICENSE b/dayPhoto/Pods/VK-ios-sdk/LICENSE new file mode 100644 index 0000000..014af4d --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2015 VK.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. diff --git a/dayPhoto/Pods/VK-ios-sdk/README.md b/dayPhoto/Pods/VK-ios-sdk/README.md new file mode 100644 index 0000000..159a4a0 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/README.md @@ -0,0 +1,297 @@ +vk-ios-sdk +========== + +Library for working with VK API, authorization through VK app, using VK functions. Supported iOS from 6.0 +Prepare for Using VK SDK +---------- + +To use VK SDK primarily you need to create a new VK application [here](https://vk.com/editapp?act=create) by choosing the Standalone application type. Choose a title and confirm the action via SMS and you will be redirected to the application settings page. +You will require your Application ID (referenced as API_ID in the documentation). Fill in the App Bundle for iOS field. + +Setup URL-schema of Your Application +---------- + +To use authorization via VK App you need to setup a url-schema of your application, which looks like vk+APP_ID (e.g. **vk1234567**). + +[Read how to implement your own URL Scheme here] (https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html#//apple_ref/doc/uid/TP40007072-CH6-SW10), Also there is [nice Twitter tutorial] (https://dev.twitter.com/cards/mobile/url-schemes) + + +Configuring application for iOS 9 +---------- +iOS 9 changes the way of applications security and way of using unsecured connections. Basically, you don't have to change anything in transport security settings. But, if you're planing to use VK API with "nohttps" scope, you have to change security settings that way (in your Info.plist file): +``` +NSAppTransportSecurity + + NSExceptionDomains + + vk.com + + NSExceptionRequiresForwardSecrecy + + NSIncludesSubdomains + + NSExceptionAllowsInsecureHTTPLoads + + + + +``` + +We're don't recommend you to use "nohttps" scope. + +Also, for iOS 9 you have to enumerate app schemas which you app using (and checking for canOpenURL:) to have ability to open that apps. For VK SDK you should change your Info.plist in that way: +``` +LSApplicationQueriesSchemes + + vk + vk-share + vkauthorize + +``` + +Adding VK iOS SDK to your iOS application +========== + +Installation with CocoaPods +---------- + +CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like VK SDK in your projects. See the "[Getting Started](http://cocoapods.org/)" guide for more information. + +Podfile + + platform :ios, '6.0' + pod "VK-ios-sdk" + +Then import the main header. + + #import + +Installation with source code +---------- + +Add `VKSdk.framework` and `VKSdkResources.bundle` files into your project. In the Application settings open **Build phases**, then the **Link Binary with Libraries** section, add `VKSdk.framework` there. Add `VKSdkResources.bundle` into **Copy bundle resources** section. Import the main header: + + #import + + +Installation with framework project +---------- + +If you targeting an application only to iOS 8 and above, you can use the SDK framework target. Add `VK-ios-sdk.xcodeproj` as sub-project of your project. Open your project in Xcode, and on the "General" tab find the "Embedded Binaries" section. Press plus sign, and select "VKSdkFramework.framework" from the VK-ios-sdk project. Import the main header: +``` +#import +``` + +Using SDK +========== + +SDK Initialization +---------- +1) Put this code to the application delegate method +``` +//iOS 9 workflow +- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { + [VKSdk processOpenURL:url fromApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]]; + return YES; +} +//iOS 8 and lower +-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation +{ + [VKSdk processOpenURL:url fromApplication:sourceApplication]; + return YES; +} +``` +2) Initialize SDK with your APP_ID for any delegate. +``` +VKSdk *sdkInstance = [VKSdk initializeWithAppId:YOUR_APP_ID]; +``` + +Starting from version 1.3 there are two types of delegates available: common delegate and UI delegate. You can register as much common delegates, as you need, but an UI delegate may be only one. After the SDK initialization you should register delegates separately: +``` +[sdkInstance registerDelegate:delegate]; +[sdkInstance setUiDelegate:uiDelegate]; +``` + +See full description of `VKSdkDelegate` and `VKSdkUIDelegate` protocol here: http://cocoadocs.org/docsets/VK-ios-sdk + + +3) You need to check, if there is previous session available, so call asynchronous method `wakeUpSession:completeBlock:`: +``` +[VKSdk wakeUpSession:SCOPE completeBlock:^(VKAuthorizationState state, NSError *error) { + if (state == VKAuthorizationAuthorized) { + // Authorized and ready to go + } else if (error) { + // Some error happend, but you may try later + } +}]; +``` + +Check out the VKAuthorizationState parameter. You can get several states: +* VKAuthorizationInitialized – means the SDK is ready to work, and you can authorize user with `+authorize:` method. Probably, an old session has expired, and we wiped it out. *This is not an error.* +* VKAuthorizationAuthorized - means a previous session is okay, and you can continue working with user data. +* VKAuthorizationError - means some error happened when we tried to check the authorization. Probably, the internet connection has a bad quality. You have to try again later. + + +User Authorization +---------- + +If you don't have a session yet, you have to authorize user with a next method: +``` +[VKSdk authorize:scope]; +``` + +After authorization, all common delegates will be called with a next method: +``` +- (void)vkSdkAccessAuthorizationFinishedWithResult:(VKAuthorizationResult *)result; +``` + +`VKAuthorizationResult` contains some initial information: new access token object, basic user information, and error (if authorization failed). + + +API Requests +========== + +Requests Syntax +---------- +Below we have listed the examples for several request types. +1) Plain request. + + VKRequest * audioReq = [[VKApi users] get]; + +2) Request with parameters. + + VKRequest * audioReq = [[VKApi audio] get:@{VK_API_OWNER_ID : @"896232"}]; + +3) Request with predetermined maximum number of attempts. + + VKRequest * postReq = [[VKApi wall] post:@{VK_API_MESSAGE : @"Test"}]; + postReq.attempts = 10; + //or infinite + //postReq.attempts = 0; + +It will take 10 attempts until succeeds or an API error occurs. + +4) Request that calls any method of VK API. + + VKRequest * getWall = [VKRequest requestWithMethod:@"wall.get" andParameters:@{VK_API_OWNER_ID : @"-1"}]; + +5) Request for uploading photos on user wall. + + VKRequest * request = [VKApi uploadWallPhotoRequest:[UIImage imageNamed:@"my_photo"] parameters:[VKImageParameters pngImage] userId:0 groupId:0 ]; + +Requests Sending +---------- + + [audioReq executeWithResultBlock:^(VKResponse * response) { + NSLog(@"Json result: %@", response.json); + } errorBlock:^(NSError * error) { + if (error.code != VK_API_ERROR) { + [error.vkError.request repeat]; + } else { + NSLog(@"VK error: %@", error); + } + }]; + +Error Handling +---------- +Every request can return `NSError` with domain equal to `VKSdkErrorDomain`. SDK can return networking error or internal SDK error (e.g. request was canceled). Category `NSError+VKError` provides vkError property that describes error event. Compare error code with the global constant `VK_API_ERROR`. If they equal that means you process vkError property as API error. Otherwise you should handle an http error. + +Some errors (e.g., captcha error, validation error) can be proccessed by the SDK. Appropriate ui delegate method will be called for this purpose. +Below is an example of captcha error processing: + + -(void) vkSdkNeedCaptchaEnter:(VKError*) captchaError + { + VKCaptchaViewController * vc = [VKCaptchaViewController captchaControllerWithError:captchaError]; + [vc presentIn:self]; + } + +Batch Processing Requests +---------- +SDK gives a feature to execute several unrelated requests at the one call. + +1) Prepare requests +``` +VKRequest * request1 = [[VKApi audio] get]; +request1.completeBlock = ^(VKResponse*) { ... }; + +VKRequest * request2 = [[VKApi users] get:@{VK_USER_IDS : @[@(1), @(6492), @(1708231)]}]; +request2.completeBlock = ^(VKResponse*) { ... }; +``` +2) Combine created requests into one. + + VKBatchRequest * batch = [[VKBatchRequest alloc] initWithRequests:request1, request2, nil]; + +3) Load the obtained request. + + [batch executeWithResultBlock:^(NSArray *responses) { + NSLog(@"Responses: %@", responses); + } errorBlock:^(NSError *error) { + NSLog(@"Error: %@", error); + }]; + +4) The result of each method returns to a corresponding completeBlock. The responses array contains responses of the requests in order they have been passed. + + +Working with Share dialog +========== +Share dialog allows you to create a user friendly dialog for sharing text and photos from your application directly to VK. See the Share dialog usage example: +``` +VKShareDialogController * shareDialog = [VKShareDialogController new]; //1 +shareDialog.text = @"This post created using #vksdk #ios"; //2 +shareDialog.vkImages = @[@"-10889156_348122347",@"7840938_319411365",@"-60479154_333497085"]; //3 +shareDialog.shareLink = [[VKShareLink alloc] initWithTitle:@"Super puper link, but nobody knows" link:[NSURL URLWithString:@"https://vk.com/dev/ios_sdk"]]; //4 +[shareDialog setCompletionHandler:^(VKShareDialogControllerResult result) { + [self dismissViewControllerAnimated:YES completion:nil]; +}]; //5 +[self presentViewController:shareDialog animated:YES completion:nil]; //6 +``` +1) create an instance of the dialog controller as usual. + +2) attach some text information to a dialog. Notice that users can change this information. + +3) attach images uploaded to VK earlier. If you want user to upload a new image, use the `uploadImages` property. + +4) attach link at your pages + +5) set the dialog completion handler + +6) present the dialog viewcontroller in your view controller + + +Working with share activity +========== + +VK SDK provides a special class for working with `UIActivityViewController` - `VKActivity`. + +Pay attention to the fact, that a VK app has it own Share extension starting from version 2.4. Starting from version 2.5 it will support special URL scheme to check, if Share extension is available. You should call `[VKActivity vkShareExtensionEnabled]` method to remove VKActivity from activities list, if a VK share extension available. + +See example below for understand how it works: + +``` +NSArray *items = @[[UIImage imageNamed:@"apple"], @"Check out information about VK SDK" , [NSURL URLWithString:@"https://vk.com/dev/ios_sdk"]]; //1 +UIActivityViewController *activityViewController = [[UIActivityViewController alloc] + initWithActivityItems:items + applicationActivities:@[[VKActivity new]]]; //2 +[activityViewController setValue:@"VK SDK" forKey:@"subject"]; //3 +[activityViewController setCompletionHandler:nil]; //4 +if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) { + UIPopoverPresentationController *popover = activityViewController.popoverPresentationController; + popover.sourceView = self.view; + popover.sourceRect = [tableView rectForRowAtIndexPath:indexPath]; +} //5 +[self presentViewController:activityViewController animated:YES completion:nil]; //6 +``` + +Lets see steps of the example: + +1) Prepare your share information - `UIImage`, `NSString` and `NSURL`. That kind of information may be shared throught VK. + +2) Prepare `UIActivityViewController` with new application `VKActivity`. + +3) Set additional properties for `activityViewController`. + +4) Set completion handler for `activityViewController` + +5) Check if you're running above iOS 8. If user working with iPad, you must present the activity controller in popover, otherwise you'll get system error. + +6) Present the activity controller as usual. diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn.png new file mode 100644 index 0000000..4af673f Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn@2x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn@2x.png new file mode 100644 index 0000000..04e8328 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn@2x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn@3x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn@3x.png new file mode 100644 index 0000000..26aa5f6 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn@3x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn_pressed.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn_pressed.png new file mode 100644 index 0000000..b287e68 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn_pressed.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn_pressed@2x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn_pressed@2x.png new file mode 100644 index 0000000..4fdaf75 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn_pressed@2x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn_pressed@3x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn_pressed@3x.png new file mode 100644 index 0000000..19525ce Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/BlueBtn_pressed@3x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/Disclosure.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/Disclosure.png new file mode 100644 index 0000000..e7f5e4d Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/Disclosure.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/Disclosure@2x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/Disclosure@2x.png new file mode 100644 index 0000000..b863a75 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/Disclosure@2x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/Disclosure@3x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/Disclosure@3x.png new file mode 100644 index 0000000..a55a406 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/Disclosure@3x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/Info.plist b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/Info.plist new file mode 100644 index 0000000..cf4435e Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/Info.plist differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/en.lproj/InfoPlist.strings b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..3967e06 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/en.lproj/InfoPlist.strings differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/en.lproj/Localizable.strings b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/en.lproj/Localizable.strings new file mode 100644 index 0000000..4bbec45 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/en.lproj/Localizable.strings differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_deleteattach.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_deleteattach.png new file mode 100644 index 0000000..f767176 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_deleteattach.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_deleteattach@2x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_deleteattach@2x.png new file mode 100644 index 0000000..57bad4e Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_deleteattach@2x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_deletephoto.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_deletephoto.png new file mode 100644 index 0000000..8826930 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_deletephoto.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_deletephoto@2x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_deletephoto@2x.png new file mode 100644 index 0000000..ac64888 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_deletephoto@2x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo.png new file mode 100644 index 0000000..cbc1818 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo@2x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo@2x.png new file mode 100644 index 0000000..e6a282f Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo@2x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo@2x~ipad.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo@2x~ipad.png new file mode 100644 index 0000000..ba3ce28 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo@2x~ipad.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo@3x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo@3x.png new file mode 100644 index 0000000..7badbae Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo@3x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo~ipad.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo~ipad.png new file mode 100644 index 0000000..c7101b1 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_activity_logo~ipad.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo.png new file mode 100644 index 0000000..40b7ae9 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo@2x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo@2x.png new file mode 100644 index 0000000..4d70b28 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo@2x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo@2x~ipad.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo@2x~ipad.png new file mode 100644 index 0000000..2734de3 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo@2x~ipad.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo@3x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo@3x.png new file mode 100644 index 0000000..06600c7 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo@3x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo~ipad.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo~ipad.png new file mode 100644 index 0000000..51d1529 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_ios7_activity_logo~ipad.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_logo_nb.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_logo_nb.png new file mode 100644 index 0000000..a540131 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_logo_nb.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_logo_nb@2x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_logo_nb@2x.png new file mode 100644 index 0000000..6dda58f Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_logo_nb@2x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_logo_nb@3x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_logo_nb@3x.png new file mode 100644 index 0000000..cbbadbd Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ic_vk_logo_nb@3x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/img_newpostattachlink.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/img_newpostattachlink.png new file mode 100644 index 0000000..230cb58 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/img_newpostattachlink.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/img_newpostattachlink@2x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/img_newpostattachlink@2x.png new file mode 100644 index 0000000..a23ccf8 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/img_newpostattachlink@2x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ru.lproj/Localizable.strings b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ru.lproj/Localizable.strings new file mode 100644 index 0000000..af5200b Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/ru.lproj/Localizable.strings differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/vk_settings.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/vk_settings.png new file mode 100644 index 0000000..e4eb9f8 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/vk_settings.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/vk_settings@2x.png b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/vk_settings@2x.png new file mode 100644 index 0000000..71a1340 Binary files /dev/null and b/dayPhoto/Pods/VK-ios-sdk/VKSdkResources.bundle/vk_settings@2x.png differ diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/VKApi.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/VKApi.h new file mode 100644 index 0000000..5c5dca0 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/VKApi.h @@ -0,0 +1,124 @@ +// +// VKApi.h +// +// Copyright (c) 2014 VK.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 "VKRequest.h" +#import "VKApiUsers.h" +#import "VKApiFriends.h" +#import "VKApiPhotos.h" +#import "VKApiWall.h" +#import "VKApiConst.h" +#import "VKApiCaptcha.h" +#import "VKApiGroups.h" +#import "VKImageParameters.h" +#import "VKApiModels.h" + +/** +Provides access for API parts. +*/ +@interface VKApi : NSObject +/** +https://vk.com/dev/users +Returns object for preparing requests to users part of API +*/ ++ (VKApiUsers *)users; + +/** +https://vk.com/dev/wall +Returns object for preparing requests to wall part of API +*/ ++ (VKApiWall *)wall; + +/** +https://vk.com/dev/photos +Returns object for preparing requests to photos part of API +*/ ++ (VKApiPhotos *)photos; + +/** +https://vk.com/dev/friends +Returns object for preparing requests to friends part of API +*/ ++ (VKApiFriends *)friends; + +/** +https://vk.com/dev/friends +Returns object for preparing requests to groups part of API +*/ ++ (VKApiGroups *)groups; + +/** +Create new request with parameters. See documentation for methods here https://vk.com/dev/methods +@param method API-method name, e.g. audio.get +@param parameters method parameters +@param httpMethod HTTP method for execution, e.g. GET, POST +@return Complete request class for execute or configure method +*/ ++ (VKRequest *)requestWithMethod:(NSString *)method + andParameters:(NSDictionary *)parameters + andHttpMethod:(NSString *)httpMethod __deprecated; + +/** + Create new request with parameters. See documentation for methods here https://vk.com/dev/methods + @param method API-method name, e.g. audio.get + @param parameters method parameters + @return Complete request class for execute or configure method + */ ++ (VKRequest *)requestWithMethod:(NSString *)method + andParameters:(NSDictionary *)parameters; + +/** +Uploads photo for wall post +@param image image used for saving to post +@param parameters parameters for image to be uploaded +@param userId ID of user on which wall image should be posted (or nil) +@param groupId ID of group (without minus sign) on which wall image should be posted (or nil) +*/ ++ (VKRequest *)uploadWallPhotoRequest:(UIImage *)image + parameters:(VKImageParameters *)parameters + userId:(NSInteger)userId + groupId:(NSInteger)groupId; + +/** +Uploads photo in user or group album +@param image image used for saving to post +@param parameters parameters for image to be uploaded +@param albumId target album ID. Required +@param groupId target group ID (positive). May be nil +*/ ++ (VKRequest *)uploadAlbumPhotoRequest:(UIImage *)image + parameters:(VKImageParameters *)parameters + albumId:(NSInteger)albumId + groupId:(NSInteger)groupId; + +/** +Uploads photo for messaging +@param image image used for saving to post +@param parameters parameters for image to be uploaded +@param albumId target album ID. Required +@param groupId target group ID (positive). May be nil +*/ ++ (VKRequest *)uploadMessagePhotoRequest:(UIImage *)image + parameters:(VKImageParameters *)parameters; + + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/VKApi.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/VKApi.m new file mode 100644 index 0000000..b0e79e7 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/VKApi.m @@ -0,0 +1,78 @@ +// +// VKApi.m +// +// Copyright (c) 2014 VK.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 "VKApi.h" +#import "VKUploadWallPhotoRequest.h" +#import "VKUploadPhotoRequest.h" +#import "VKUploadMessagesPhotoRequest.h" + +@implementation VKApi ++ (VKApiUsers *)users { + return [VKApiUsers new]; +} + ++ (VKApiWall *)wall { + return [VKApiWall new]; +} + ++ (VKApiPhotos *)photos { + return [VKApiPhotos new]; +} + ++ (VKApiFriends *)friends { + return [VKApiFriends new]; +} + ++ (VKApiGroups *)groups { + return [VKApiGroups new]; +} + ++ (VKRequest *)requestWithMethod:(NSString *)method + andParameters:(NSDictionary *)parameters { + return [VKRequest requestWithMethod:method andParameters:parameters]; +} + ++ (VKRequest *)requestWithMethod:(NSString *)method + andParameters:(NSDictionary *)parameters + andHttpMethod:(NSString *)httpMethod { + return [VKRequest requestWithMethod:method andParameters:parameters]; +} + ++ (VKRequest *)uploadWallPhotoRequest:(UIImage *)image + parameters:(VKImageParameters *)parameters + userId:(NSInteger)userId + groupId:(NSInteger)groupId { + return [[VKUploadWallPhotoRequest alloc] initWithImage:image parameters:parameters userId:userId groupId:groupId]; +} + ++ (VKRequest *)uploadAlbumPhotoRequest:(UIImage *)image + parameters:(VKImageParameters *)parameters + albumId:(NSInteger)albumId + groupId:(NSInteger)groupId { + return [[VKUploadPhotoRequest alloc] initWithImage:image parameters:parameters albumId:albumId groupId:groupId]; +} + ++ (VKRequest *)uploadMessagePhotoRequest:(UIImage *)image parameters:(VKImageParameters *)parameters { + return [[VKUploadMessagesPhotoRequest alloc] initWithImage:image parameters:parameters]; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiBase.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiBase.h new file mode 100644 index 0000000..94bc354 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiBase.h @@ -0,0 +1,73 @@ +// +// VKApiBase.h +// +// Copyright (c) 2014 VK.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 "VKRequest.h" +#import "VKApiConst.h" +#import "VKObject.h" + +/** +* Basic class for all API-requests builders (parts) +*/ +@interface VKApiBase : VKObject { +@private + NSString *_methodGroup; ///< Selected methods group +} +/** +Return group name for current methods builder +@return name of methods group, e.g. users, wall, etc. +*/ +- (NSString *)getMethodGroup; + +/** +Builds request and return it for configure and loading +@param methodName Selected method name +@param methodParameters Selected method parameters +@return request to configure and load +*/ +- (VKRequest *)prepareRequestWithMethodName:(NSString *)methodName + andParameters:(NSDictionary *)methodParameters; + +/** +Builds request and return it for configure and loading +@param methodName Selected method name +@param methodParameters Selected method parameters +@param httpMethod HTTP method for loading request. E.g. GET or POST +@return request to configure and load +*/ +- (VKRequest *)prepareRequestWithMethodName:(NSString *)methodName + andParameters:(NSDictionary *)methodParameters + andHttpMethod:(NSString *)httpMethod; + +/** +Builds request and return it for configure and loading +@param methodName Selected method name +@param methodParameters Selected method parameters +@param httpMethod HTTP method for loading request. E.g. GET or POST +@param modelClass Class of model, based on VKApiObject, for model parsing +@return request to configure and load +*/ +- (VKRequest *)prepareRequestWithMethodName:(NSString *)methodName + andParameters:(NSDictionary *)methodParameters + andHttpMethod:(NSString *)httpMethod + andClassOfModel:(Class)modelClass; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiBase.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiBase.m new file mode 100644 index 0000000..4246d25 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiBase.m @@ -0,0 +1,58 @@ +// +// VKApiBase.m +// +// Copyright (c) 2014 VK.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 "VKApiBase.h" + +@implementation VKApiBase +- (id)init { + self = [super init]; + if (self) { + NSString *methodsGroup = [[NSStringFromClass(self.class) substringFromIndex:@"VKApi".length] lowercaseString]; + [self setMethodGroup:methodsGroup]; + } + return self; +} + +- (NSString *)getMethodGroup { + return _methodGroup; +} + +- (void)setMethodGroup:(NSString *)methodGroup { + _methodGroup = methodGroup; +} + +- (VKRequest *)prepareRequestWithMethodName:(NSString *)methodName andParameters:(NSDictionary *)methodParameters { + return [self prepareRequestWithMethodName:methodName andParameters:methodParameters andHttpMethod:@"POST"]; +} + +- (VKRequest *)prepareRequestWithMethodName:(NSString *)methodName andParameters:(NSDictionary *)methodParameters andHttpMethod:(NSString *)httpMethod { + return [VKRequest requestWithMethod:[NSString stringWithFormat:@"%@.%@", _methodGroup, methodName] + andParameters:methodParameters]; +} + +- (VKRequest *)prepareRequestWithMethodName:(NSString *)methodName andParameters:(NSDictionary *)methodParameters andHttpMethod:(NSString *)httpMethod andClassOfModel:(Class)modelClass { + return [VKRequest requestWithMethod:[NSString stringWithFormat:@"%@.%@", _methodGroup, methodName] + andParameters:methodParameters + modelClass:modelClass]; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiCaptcha.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiCaptcha.h new file mode 100644 index 0000000..1a1b241 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiCaptcha.h @@ -0,0 +1,34 @@ +// +// VKApiCaptcha.h +// +// Copyright (c) 2014 VK.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 "VKApiBase.h" + +/** +Methods for captcha work. Currently, it is 1 method for forcing captcha response +*/ +@interface VKApiCaptcha : VKApiBase +/** +Returns error for captcha debugging +@return Request to load +*/ +- (VKRequest *)force; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiCaptcha.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiCaptcha.m new file mode 100644 index 0000000..d4d0026 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiCaptcha.m @@ -0,0 +1,30 @@ +// +// VKApiCaptcha.m +// +// Copyright (c) 2014 VK.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 "VKApiCaptcha.h" + +@implementation VKApiCaptcha +- (VKRequest *)force { + return [self prepareRequestWithMethodName:@"force" andParameters:nil]; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiConst.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiConst.h new file mode 100644 index 0000000..d5fc6b4 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiConst.h @@ -0,0 +1,116 @@ +// +// VKApiConst.h +// +// Copyright (c) 2014 VK.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. + +typedef NSString *VKDisplayType; +extern VKDisplayType const VK_DISPLAY_IOS; +extern VKDisplayType const VK_DISPLAY_MOBILE; +//Commons +extern NSString *const VK_ORIGINAL_CLIENT_BUNDLE; +extern NSString *const VK_ORIGINAL_HD_CLIENT_BUNDLE; +extern NSString *const VK_DEBUG_CLIENT_BUNDLE; +extern NSString *const VK_API_USER_ID; +extern NSString *const VK_API_USER_IDS; +extern NSString *const VK_API_FIELDS; +extern NSString *const VK_API_SORT; +extern NSString *const VK_API_OFFSET; +extern NSString *const VK_API_COUNT; +extern NSString *const VK_API_OWNER_ID; + +//auth +extern NSString *const VK_API_LANG; +extern NSString *const VK_API_ACCESS_TOKEN; +extern NSString *const VK_API_SIG; + +//get users +extern NSString *const VK_API_NAME_CASE; +extern NSString *const VK_API_ORDER; + +//Get subscriptions +extern NSString *const VK_API_EXTENDED; + +//Search +extern NSString *const VK_API_Q; +extern NSString *const VK_API_CITY; +extern NSString *const VK_API_COUNTRY; +extern NSString *const VK_API_HOMETOWN; +extern NSString *const VK_API_UNIVERSITY_COUNTRY; +extern NSString *const VK_API_UNIVERSITY; +extern NSString *const VK_API_UNIVERSITY_YEAR; +extern NSString *const VK_API_SEX; +extern NSString *const VK_API_STATUS; +extern NSString *const VK_API_AGE_FROM; +extern NSString *const VK_API_AGE_TO; +extern NSString *const VK_API_BIRTH_DAY; +extern NSString *const VK_API_BIRTH_MONTH; +extern NSString *const VK_API_BIRTH_YEAR; +extern NSString *const VK_API_ONLINE; +extern NSString *const VK_API_HAS_PHOTO; +extern NSString *const VK_API_SCHOOL_COUNTRY; +extern NSString *const VK_API_SCHOOL_CITY; +extern NSString *const VK_API_SCHOOL; +extern NSString *const VK_API_SCHOOL_YEAR; +extern NSString *const VK_API_RELIGION; +extern NSString *const VK_API_INTERESTS; +extern NSString *const VK_API_COMPANY; +extern NSString *const VK_API_POSITION; +extern NSString *const VK_API_GROUP_ID; +extern NSString *const VK_API_GROUP_IDS; + +extern NSString *const VK_API_FRIENDS_ONLY; +extern NSString *const VK_API_FROM_GROUP; +extern NSString *const VK_API_MESSAGE; +extern NSString *const VK_API_ATTACHMENT; +extern NSString *const VK_API_ATTACHMENTS; +extern NSString *const VK_API_SERVICES; +extern NSString *const VK_API_SIGNED; +extern NSString *const VK_API_PUBLISH_DATE; +extern NSString *const VK_API_LAT; +extern NSString *const VK_API_LONG; +extern NSString *const VK_API_PLACE_ID; +extern NSString *const VK_API_POST_ID; + +//Errors +extern NSString *const VK_API_ERROR_CODE; +extern NSString *const VK_API_ERROR_MSG; +extern NSString *const VK_API_ERROR_TEXT; +extern NSString *const VK_API_REQUEST_PARAMS; + +//Captcha +extern NSString *const VK_API_CAPTCHA_IMG; +extern NSString *const VK_API_CAPTCHA_SID; +extern NSString *const VK_API_CAPTCHA_KEY; +extern NSString *const VK_API_REDIRECT_URI; + + +//Photos +extern NSString *const VK_API_PHOTO; +extern NSString *const VK_API_ALBUM_ID; + +//Events +extern NSString *const VKCaptchaAnsweredEvent; + +//Enums +typedef NS_ENUM(NSInteger, VKProgressType) { + VKProgressTypeUpload, + VKProgressTypeDownload +}; + diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiConst.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiConst.m new file mode 100644 index 0000000..bb2bd1d --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiConst.m @@ -0,0 +1,97 @@ +// +// VKApiConst.m +// VKSdk +// +// Created by Roman Truba on 27.04.15. +// Copyright (c) 2015 VK. All rights reserved. +// + +#import +#import "VKApiConst.h" + +VKDisplayType const VK_DISPLAY_IOS = @"ios"; +VKDisplayType const VK_DISPLAY_MOBILE = @"mobile"; + +NSString *const VK_ORIGINAL_CLIENT_BUNDLE = @"com.vk.vkclient"; +NSString *const VK_ORIGINAL_HD_CLIENT_BUNDLE = @"com.vk.vkhd"; +NSString *const VK_DEBUG_CLIENT_BUNDLE = @"com.vk.odnoletkov.client"; +NSString *const VK_API_USER_ID = @"user_id"; +NSString *const VK_API_USER_IDS = @"user_ids"; +NSString *const VK_API_FIELDS = @"fields"; +NSString *const VK_API_SORT = @"sort"; +NSString *const VK_API_OFFSET = @"offset"; +NSString *const VK_API_COUNT = @"count"; +NSString *const VK_API_OWNER_ID = @"owner_id"; + +//auth +NSString *const VK_API_LANG = @"lang"; +NSString *const VK_API_ACCESS_TOKEN = @"access_token"; +NSString *const VK_API_SIG = @"sig"; + +//get users +NSString *const VK_API_NAME_CASE = @"name_case"; +NSString *const VK_API_ORDER = @"order"; + +//Get subscriptions +NSString *const VK_API_EXTENDED = @"extended"; + +//Search +NSString *const VK_API_Q = @"q"; +NSString *const VK_API_CITY = @"city"; +NSString *const VK_API_COUNTRY = @"country"; +NSString *const VK_API_HOMETOWN = @"hometown"; +NSString *const VK_API_UNIVERSITY_COUNTRY = @"university_country"; +NSString *const VK_API_UNIVERSITY = @"university"; +NSString *const VK_API_UNIVERSITY_YEAR = @"university_year"; +NSString *const VK_API_SEX = @"sex"; +NSString *const VK_API_STATUS = @"status"; +NSString *const VK_API_AGE_FROM = @"age_from"; +NSString *const VK_API_AGE_TO = @"age_to"; +NSString *const VK_API_BIRTH_DAY = @"birth_day"; +NSString *const VK_API_BIRTH_MONTH = @"birth_month"; +NSString *const VK_API_BIRTH_YEAR = @"birth_year"; +NSString *const VK_API_ONLINE = @"online"; +NSString *const VK_API_HAS_PHOTO = @"has_photo"; +NSString *const VK_API_SCHOOL_COUNTRY = @"school_country"; +NSString *const VK_API_SCHOOL_CITY = @"school_city"; +NSString *const VK_API_SCHOOL = @"school"; +NSString *const VK_API_SCHOOL_YEAR = @"school_year"; +NSString *const VK_API_RELIGION = @"religion"; +NSString *const VK_API_INTERESTS = @"interests"; +NSString *const VK_API_COMPANY = @"company"; +NSString *const VK_API_POSITION = @"position"; +NSString *const VK_API_GROUP_ID = @"group_id"; +NSString *const VK_API_GROUP_IDS = @"group_ids"; + +NSString *const VK_API_FRIENDS_ONLY = @"friends_only"; +NSString *const VK_API_FROM_GROUP = @"from_group"; +NSString *const VK_API_MESSAGE = @"message"; +NSString *const VK_API_ATTACHMENT = @"attachment"; +NSString *const VK_API_ATTACHMENTS = @"attachments"; +NSString *const VK_API_SERVICES = @"services"; +NSString *const VK_API_SIGNED = @"signed"; +NSString *const VK_API_PUBLISH_DATE = @"publish_date"; +NSString *const VK_API_LAT = @"lat"; +NSString *const VK_API_LONG = @"long"; +NSString *const VK_API_PLACE_ID = @"place_id"; +NSString *const VK_API_POST_ID = @"post_id"; + +//Errors +NSString *const VK_API_ERROR_CODE = @"error_code"; +NSString *const VK_API_ERROR_MSG = @"error_msg"; +NSString *const VK_API_ERROR_TEXT = @"error_text"; +NSString *const VK_API_REQUEST_PARAMS = @"request_params"; + +//Captcha +NSString *const VK_API_CAPTCHA_IMG = @"captcha_img"; +NSString *const VK_API_CAPTCHA_SID = @"captcha_sid"; +NSString *const VK_API_CAPTCHA_KEY = @"captcha_key"; +NSString *const VK_API_REDIRECT_URI = @"redirect_uri"; + + +//Photos +NSString *const VK_API_PHOTO = @"photo"; +NSString *const VK_API_ALBUM_ID = @"album_id"; + +//Events +NSString *const VKCaptchaAnsweredEvent = @"VKCaptchaAnsweredEvent"; \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiFriends.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiFriends.h new file mode 100644 index 0000000..ff74dcf --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiFriends.h @@ -0,0 +1,32 @@ +// +// VKApiFriends.h +// +// Copyright (c) 2014 VK.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 "VKApiBase.h" + +/** +Builds requests for API.users part +*/ +@interface VKApiFriends : VKApiBase +- (VKRequest *)get; + +- (VKRequest *)get:(NSDictionary *)params; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiFriends.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiFriends.m new file mode 100644 index 0000000..69121a4 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiFriends.m @@ -0,0 +1,35 @@ +// +// VKApiFriends.m +// +// Copyright (c) 2014 VK.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 "VKApiFriends.h" +#import "VKUser.h" + +@implementation VKApiFriends +- (VKRequest *)get { + return [self prepareRequestWithMethodName:@"get" andParameters:nil andHttpMethod:@"GET" andClassOfModel:[VKUsersArray class]]; +} + +- (VKRequest *)get:(NSDictionary *)params { + return [self prepareRequestWithMethodName:@"get" andParameters:params andHttpMethod:@"GET" andClassOfModel:[VKUsersArray class]]; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiGroups.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiGroups.h new file mode 100644 index 0000000..76dca97 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiGroups.h @@ -0,0 +1,18 @@ +// +// VKApiGroups.h +// sdk +// +// Created by Roman Truba on 16.07.14. +// Copyright (c) 2014 VK. All rights reserved. +// + +#import "VKApiBase.h" + +@interface VKApiGroups : VKApiBase +/** +https://vk.com/dev/groups.get +@param params use parameters from description with VK_API prefix, e.g. VK_API_GROUP_ID, VK_API_FIELDS +@return Request for load +*/ +- (VKRequest *)getById:(NSDictionary *)params; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiGroups.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiGroups.m new file mode 100644 index 0000000..e518545 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiGroups.m @@ -0,0 +1,16 @@ +// +// VKApiGroups.m +// sdk +// +// Created by Roman Truba on 16.07.14. +// Copyright (c) 2014 VK. All rights reserved. +// + +#import "VKApiGroups.h" +#import "VKGroup.h" + +@implementation VKApiGroups +- (VKRequest *)getById:(NSDictionary *)params { + return [self prepareRequestWithMethodName:@"getById" andParameters:params andHttpMethod:@"GET" andClassOfModel:[VKGroups class]]; +} +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiModels.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiModels.h new file mode 100644 index 0000000..4118e53 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiModels.h @@ -0,0 +1,33 @@ +// +// VKApiModels.h +// +// Copyright (c) 2014 VK.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 suabstantial 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 "VKApiObjectArray.h" +#import "VKAudio.h" +#import "VKPhoto.h" +#import "VKLikes.h" +#import "VKUser.h" +#import "VKRelative.h" +#import "VKCounters.h" +#import "VKLikes.h" +#import "VKSchool.h" +#import "VKUniversity.h" +#import "VKGroup.h" \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiPhotos.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiPhotos.h new file mode 100644 index 0000000..bb1af13 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiPhotos.h @@ -0,0 +1,72 @@ +// +// VKApiPhotos.h +// +// Copyright (c) 2014 VK.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 "VKApiBase.h" + +/** +Builds requests for API.photos part +*/ +@interface VKApiPhotos : VKApiBase +/** +https://vk.com/dev/photos.getUploadServer +@param albumId album identifier (positive integer) +@return Request for load +*/ +- (VKRequest *)getUploadServer:(NSInteger)albumId; + +/** +https://vk.com/dev/photos.getUploadServer +@param albumId album identifier (positive integer) +@param groupId group identifier (positive integer) +@return Request for load +*/ +- (VKRequest *)getUploadServer:(NSInteger)albumId andGroupId:(NSInteger)groupId; + +/** +https://vk.com/dev/photos.getWallUploadServer +@return Request for load +*/ +- (VKRequest *)getWallUploadServer; + +/** +https://vk.com/dev/photos.getWallUploadServer +@param groupId group identifier (positive integer) +@return Request for load +*/ +- (VKRequest *)getWallUploadServer:(NSInteger)groupId; + + +/** +https://vk.com/dev/photos.save +@param params params received after photo upload, with user id or group id +@return Request for load +*/ +- (VKRequest *)save:(NSDictionary *)params; + +/** +https://vk.com/dev/photos.saveWallPhoto +@param params params received after photo upload, with user id or group id +@return Request for load +*/ +- (VKRequest *)saveWallPhoto:(NSDictionary *)params; + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiPhotos.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiPhotos.m new file mode 100644 index 0000000..3a99f83 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiPhotos.m @@ -0,0 +1,51 @@ +// +// VKApiPhotos.m +// +// Copyright (c) 2014 VK.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 "VKApiPhotos.h" +#import "VKPhoto.h" + +@implementation VKApiPhotos +- (VKRequest *)getUploadServer:(NSInteger)albumId { + return [self prepareRequestWithMethodName:@"getUploadServer" andParameters:@{VK_API_ALBUM_ID : @(albumId)}]; +} + +- (VKRequest *)getUploadServer:(NSInteger)albumId andGroupId:(NSInteger)groupId { + return [self prepareRequestWithMethodName:@"getUploadServer" andParameters:@{VK_API_ALBUM_ID : @(albumId), VK_API_GROUP_ID : @(groupId)}]; +} + +- (VKRequest *)getWallUploadServer { + return [self prepareRequestWithMethodName:@"getWallUploadServer" andParameters:nil]; +} + +- (VKRequest *)getWallUploadServer:(NSInteger)groupId { + return [self prepareRequestWithMethodName:@"getWallUploadServer" andParameters:@{VK_API_GROUP_ID : @(groupId)}]; +} + +- (VKRequest *)saveWallPhoto:(NSDictionary *)params { + return [self prepareRequestWithMethodName:@"saveWallPhoto" andParameters:params andHttpMethod:@"POST" andClassOfModel:[VKPhotoArray class]]; +} + +- (VKRequest *)save:(NSDictionary *)params { + return [self prepareRequestWithMethodName:@"save" andParameters:params andHttpMethod:@"POST" andClassOfModel:[VKPhotoArray class]]; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiUsers.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiUsers.h new file mode 100644 index 0000000..2b4fa60 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiUsers.h @@ -0,0 +1,87 @@ +// +// VKApiUsers.h +// +// Copyright (c) 2014 VK.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 "VKApiBase.h" + +/** +Builds requests for API.users part +*/ +@interface VKApiUsers : VKApiBase +/** +Returns basic information about current user +@return Request for load +*/ +- (VKRequest *)get; + +/** +https://vk.com/dev/users.get +@param params use parameters from description with VK_API prefix, e.g. VK_API_USER_IDS, VK_API_FIELDS, VK_API_NAME_CASE +@return Request for load +*/ +- (VKRequest *)get:(NSDictionary *)params; + +/** +https://vk.com/dev/users.search +@param params use parameters from description with VK_API prefix, e.g. VK_API_Q, VK_API_CITY, VK_API_COUNTRY, etc. +@return Request for load +*/ +- (VKRequest *)search:(NSDictionary *)params; + +/** +https://vk.com/dev/users.isAppUser +@return Request for load +*/ +- (VKRequest *)isAppUser; + +/** +https://vk.com/dev/users.isAppUser +@param userID ID of user to check +@return Request for load +*/ +- (VKRequest *)isAppUser:(NSInteger)userID; + +/** +https://vk.com/dev/users.getSubscriptions +@return Request for load +*/ +- (VKRequest *)getSubscriptions; + +/** +https://vk.com/dev/users.getSubscriptions +@param params use parameters from description with VK_API prefix, e.g. VK_API_USER_ID, VK_API_EXTENDED, etc. +@return Request for load +*/ +- (VKRequest *)getSubscriptions:(NSDictionary *)params; + +/** +https://vk.com/dev/users.getFollowers +@return Request for load +*/ +- (VKRequest *)getFollowers; + +/** +https://vk.com/dev/users.getFollowers +@param params use parameters from description with VK_API prefix, e.g. VK_API_USER_ID, VK_API_OFFSET, etc. +@return Request for load +*/ +- (VKRequest *)getFollowers:(NSDictionary *)params; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiUsers.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiUsers.m new file mode 100644 index 0000000..29da8d9 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiUsers.m @@ -0,0 +1,73 @@ +// +// VKApiUsers.m +// +// Copyright (c) 2014 VK.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 "VKApiUsers.h" +#import "VKUser.h" + +@implementation VKApiUsers +#pragma mark get + +- (VKRequest *)get { + return [self get:nil]; +} + +- (VKRequest *)get:(NSDictionary *)params { + return [self prepareRequestWithMethodName:@"get" andParameters:params andHttpMethod:@"POST" andClassOfModel:[VKUsersArray class]]; +} + +#pragma mark search + +- (VKRequest *)search:(NSDictionary *)params { + return [self prepareRequestWithMethodName:@"search" andParameters:params andHttpMethod:@"POST" andClassOfModel:[VKUsersArray class]]; +} + +#pragma mark isAppUser + +- (VKRequest *)isAppUser { + return [self prepareRequestWithMethodName:@"isAppUser" andParameters:nil]; +} + +- (VKRequest *)isAppUser:(NSInteger)userID { + return [self prepareRequestWithMethodName:@"isAppUser" andParameters:@{VK_API_USER_ID : @(userID)}]; +} + +#pragma mark subscriptions + +- (VKRequest *)getSubscriptions { + return [self getSubscriptions:nil]; +} + +- (VKRequest *)getSubscriptions:(NSDictionary *)params { + return [self prepareRequestWithMethodName:@"getSubscriptions" andParameters:params]; +} + +#pragma mark followers + +- (VKRequest *)getFollowers { + return [self getFollowers:nil]; +} + +- (VKRequest *)getFollowers:(NSDictionary *)params { + return [self prepareRequestWithMethodName:@"getFollowers" andParameters:params andHttpMethod:@"GET" andClassOfModel:[VKUsersArray class]]; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiWall.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiWall.h new file mode 100644 index 0000000..621a815 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiWall.h @@ -0,0 +1,35 @@ +// +// VKApiWall.h +// +// Copyright (c) 2014 VK.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 "VKApiBase.h" + +/** +Builds requests for API.wall part +*/ +@interface VKApiWall : VKApiBase +/** +https://vk.com/dev/wall.post +@param params Use parameters from description with VK_API prefix +@return Request for execution +*/ +- (VKRequest *)post:(NSDictionary *)params; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiWall.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiWall.m new file mode 100644 index 0000000..118a5bf --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/methods/VKApiWall.m @@ -0,0 +1,30 @@ +// +// VKApiWall.m +// +// Copyright (c) 2014 VK.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 "VKApiWall.h" + +@implementation VKApiWall +- (VKRequest *)post:(NSDictionary *)params { + return [self prepareRequestWithMethodName:@"post" andParameters:params andHttpMethod:@"POST"]; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKApiObject.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKApiObject.h new file mode 100644 index 0000000..02aa4de --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKApiObject.h @@ -0,0 +1,65 @@ +// +// VKApiObject.h +// +// Copyright (c) 2014 VK.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 "VKObject.h" + +/** +Helps in objects parsing +*/ +@interface VKPropertyHelper : VKObject +@property(nonatomic, readonly) NSString *propertyName; +@property(nonatomic, readonly) NSString *propertyClassName; +@property(nonatomic, readonly) Class propertyClass; +@property(nonatomic, readonly) BOOL isPrimitive; +@property(nonatomic, readonly) BOOL isModelsArray; +@property(nonatomic, readonly) BOOL isModel; + +- (instancetype)initWith:(objc_property_t)prop; +@end + +@protocol VKApiObject ++ (instancetype)createWithDictionary:(NSDictionary *)dict; + ++ (instancetype)createWithArray:(NSArray *)array; +@end + +/** +Basic class for API objects +*/ +@interface VKApiObject : VKObject +/// If it possible, contains object fields from JSON as it is +@property(nonatomic, strong) NSDictionary *fields; + +/** +Initialize object with API json dictionary. This method tries to set all known properties of current class from dictionare +@param dict API json dictionary +@return Initialized object +*/ +- (instancetype)initWithDictionary:(NSDictionary *)dict; + +/** +Serialize current object into dictionary +@return Key-value dictionary, contains current object +*/ +- (NSDictionary *)serialize; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKApiObject.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKApiObject.m new file mode 100644 index 0000000..19bb49e --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKApiObject.m @@ -0,0 +1,277 @@ +// +// VKApiObject.m +// +// Copyright (c) 2014 VK.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 "VKApiObject.h" +#import "VKApiObjectArray.h" +#import "VKUtil.h" + +#ifdef DEBUG +#define PRINT_PARSE_DEBUG_INFO YES +#else +#define PRINT_PARSE_DEBUG_INFO NO +#endif + +static NSString *const INT_NAME = @"int"; +static NSString *const DOUBLE_NAME = @"double"; +static NSString *const BOOL_NAME = @"bool"; +static NSString *const ID_NAME = @"id"; + +static NSMutableDictionary *classesProperties = nil; + +static NSString *getPropertyType(objc_property_t property) { + const char *type = property_getAttributes(property); + NSString *typeString = [NSString stringWithUTF8String:type]; + NSArray *attributes = [typeString componentsSeparatedByString:@","]; + NSString *typeAttribute = attributes[0]; + NSString *propertyType = [typeAttribute substringFromIndex:1]; + const char *rawPropertyType = [propertyType UTF8String]; + + if (strcmp(rawPropertyType, @encode(float)) == 0 + || strcmp(rawPropertyType, @encode(double)) == 0) { + return DOUBLE_NAME; + } + else if (strcmp(rawPropertyType, @encode(char)) == 0 + || strcmp(rawPropertyType, @encode(short)) == 0 + || strcmp(rawPropertyType, @encode(int)) == 0 + || strcmp(rawPropertyType, @encode(long)) == 0 + || strcmp(rawPropertyType, @encode(long long)) == 0 + || strcmp(rawPropertyType, @encode(unsigned char)) == 0 + || strcmp(rawPropertyType, @encode(unsigned short)) == 0 + || strcmp(rawPropertyType, @encode(unsigned int)) == 0 + || strcmp(rawPropertyType, @encode(unsigned long)) == 0 + || strcmp(rawPropertyType, @encode(unsigned long long)) == 0) { + return INT_NAME; + } + else if (strcmp(rawPropertyType, @encode(BOOL)) == 0) { + return BOOL_NAME; + } + else if (strcmp(rawPropertyType, @encode(id)) == 0) { + return ID_NAME; + } + + if ([typeAttribute hasPrefix:@"T@"] && [typeAttribute length] > 1) { + NSString *typeClassName = [typeAttribute substringWithRange:NSMakeRange(3, [typeAttribute length] - 4)]; //turns @"NSDate" into NSDate + if (typeClassName != nil) { + return typeClassName; + } + } + + return nil; +} + +static NSString *getPropertyName(objc_property_t prop) { + const char *propName = property_getName(prop); + return [NSString stringWithCString:propName encoding:[NSString defaultCStringEncoding]]; +} + +@interface VKPropertyHelper () +@property(nonatomic, assign) objc_property_t property; +@property(nonatomic, readwrite, strong) NSString *propertyName; +@property(nonatomic, readwrite, strong) NSString *propertyClassName; +@property(nonatomic, readwrite, strong) Class propertyClass; + +@property(nonatomic, readwrite, assign) BOOL isPrimitive; +@property(nonatomic, readwrite, assign) BOOL isModelsArray; +@property(nonatomic, readwrite, assign) BOOL isModel; + +- (instancetype)initWith:(objc_property_t)prop; +@end + +@implementation VKPropertyHelper + +- (instancetype)initWith:(objc_property_t)prop { + if (self = [super init]) { + _property = prop; + _propertyName = getPropertyName(prop); + _propertyClassName = getPropertyType(self.property); + _isPrimitive = [@[DOUBLE_NAME, INT_NAME, BOOL_NAME] containsObject:_propertyClassName]; + + if (!_isPrimitive) { + _propertyClass = NSClassFromString(_propertyClassName); + if (!(_isModelsArray = [_propertyClass isSubclassOfClass:[VKApiObjectArray class]])) { + _isModel = [_propertyClass isSubclassOfClass:[VKApiObject class]]; + } + } + } + return self; +} + + +@end + +@implementation VKApiObject + +- (instancetype)initWithDictionary:(NSDictionary *)dict { + dict = VK_ENSURE_DICT(dict); + if (!dict) { + return nil; + } + if ((self = [super init])) { + + [self parse:dict]; + self.fields = dict; + } + return self; +} + +- (void)parse:(NSDictionary *)dict { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + classesProperties = [NSMutableDictionary dictionary]; + }); + NSString *className = NSStringFromClass(self.class); + __block NSMutableDictionary *propDict = nil; + @synchronized (classesProperties) { + propDict = [classesProperties objectForKey:className]; + } + if (!propDict) { + [self enumPropertiesWithBlock:^(VKPropertyHelper *helper, int totalProps) { + if (!propDict) + propDict = [NSMutableDictionary dictionaryWithCapacity:totalProps]; + propDict[helper.propertyName] = helper; + }]; + if (!propDict) { + propDict = [NSMutableDictionary new]; + } + @synchronized (classesProperties) { + classesProperties[className] = propDict; + } + } + NSMutableArray *warnings = PRINT_PARSE_DEBUG_INFO ? [NSMutableArray new] : nil; + for (NSString *key in dict) { + VKPropertyHelper *propHelper = propDict[key]; + if (!propHelper) continue; + id resultObject = nil; + id parseObject = dict[key]; + NSString *propertyName = propHelper.propertyName; + Class propertyClass = propHelper.propertyClass; + if (propHelper.isModelsArray) { + if ([parseObject isKindOfClass:[NSDictionary class]]) { + resultObject = [propertyClass createWithDictionary:parseObject]; + } + else if ([parseObject isKindOfClass:[NSArray class]]) { + resultObject = [propertyClass createWithArray:parseObject]; + } + else { + if (PRINT_PARSE_DEBUG_INFO) { + [warnings addObject:[NSString stringWithFormat:@"property %@ is parcelable, but data is not", propertyName]]; + } + } + } + else if (propHelper.isModel) { + if ([parseObject isKindOfClass:[NSDictionary class]]) { + resultObject = [propertyClass createWithDictionary:parseObject]; + } else if ([parseObject isKindOfClass:[NSArray class]]) { + resultObject = [propertyClass createWithArray:parseObject]; + } + else { + if (PRINT_PARSE_DEBUG_INFO) { + [warnings addObject:[NSString stringWithFormat:@"property %@ is parcelable, but data is not", propertyName]]; + } + } + } + else { + resultObject = parseObject; + if (propertyClass && ![resultObject isKindOfClass:propertyClass]) { + if ([(Class) propertyClass isSubclassOfClass:[NSString class]]) { + resultObject = [resultObject respondsToSelector:@selector(stringValue)] ? [resultObject stringValue] : nil; + } else { + resultObject = nil; + } + if (PRINT_PARSE_DEBUG_INFO) { + [warnings addObject:[NSString stringWithFormat:@"property with name %@ expected class %@, result class %@", propertyName, propertyClass, [resultObject class]]]; + } + } else if (propHelper.isPrimitive) { + resultObject = [resultObject isKindOfClass:[NSNumber class]] ? resultObject : nil; + } + } + [self setValue:resultObject forKey:propertyName]; + } + + if (PRINT_PARSE_DEBUG_INFO && warnings.count) { + NSLog(@"Parsing %@ complete. Warnings: %@", self, warnings); + } +} + +- (void)enumPropertiesWithBlock:(void (^)(VKPropertyHelper *helper, int totalProps))processBlock { + unsigned int propertiesCount; + //Get all properties of current class + Class searchClass = [self class]; + Class lastViewedClass = Nil; + NSArray *ignoredProperties = [self ignoredProperties]; + while (lastViewedClass != [VKApiObject class]) { + objc_property_t *properties = class_copyPropertyList(searchClass, &propertiesCount); + + for (int i = 0; i < propertiesCount; i++) { + objc_property_t property = properties[i]; + VKPropertyHelper *helper = [[VKPropertyHelper alloc] initWith:property]; + if ([ignoredProperties containsObject:helper.propertyName]) + continue; + if (processBlock) + processBlock(helper, propertiesCount); + } + free(properties); + lastViewedClass = searchClass; + searchClass = [searchClass superclass]; + } +} + +- (NSArray *)ignoredProperties { + return @[@"objectClass", @"fields"]; +} + +- (NSMutableDictionary *)serialize { + NSMutableDictionary *result = [NSMutableDictionary new]; + + [self enumPropertiesWithBlock:^(VKPropertyHelper *helper, int total) { + if (![self valueForKey:helper.propertyName]) + return; + Class propertyClass = NSClassFromString(helper.propertyClassName); + if ([propertyClass isSubclassOfClass:[VKApiObjectArray class]]) { + [[self valueForKey:helper.propertyName] serializeTo:result withName:helper.propertyName]; + } + else if ([propertyClass isSubclassOfClass:[VKApiObject class]]) { + result[helper.propertyName] = [[self valueForKey:helper.propertyName] serialize]; + } + else { + result[helper.propertyName] = [self valueForKey:helper.propertyName]; + } + }]; + return result; +} + ++ (instancetype)createWithDictionary:(NSDictionary *)dict { + return [[self alloc] initWithDictionary:dict]; +} + ++ (instancetype)createWithArray:(NSArray *)array { + return nil; +} + +- (void)setValue:(id)value forUndefinedKey:(NSString *)key { + if (PRINT_PARSE_DEBUG_INFO) { + NSLog(@"Parser tried to set value (%@) for undefined key (%@)", value, key); + } +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKApiObjectArray.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKApiObjectArray.h new file mode 100644 index 0000000..c24034a --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKApiObjectArray.h @@ -0,0 +1,80 @@ +// +// VKApiObjectArray.h +// +// Copyright (c) 2014 VK.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 suabstantial 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 "VKApiObject.h" + +/** +Base class for VK API arrays +*/ +@interface VKApiObjectArray : VKApiObject +/// Count of items in array +@property(nonatomic, readonly) NSUInteger count; +/// Parsed array items +@property(nonatomic, strong) NSMutableArray *items; + +/** +Initialize object with API json dictionary. This method tries to set all known properties of current class from dictionary +@param dict API json dictionary +@param objectClass class of items inside of array +@return Initialized object +*/ +- (instancetype)initWithDictionary:(NSDictionary *)dict objectClass:(Class)objectClass; + +/** +Initialize object with API json array. This method tries to set all known properties of current class from array +@param array API json array +@param objectClass class of items inside of array +@return Initialized object +*/ +- (instancetype)initWithArray:(NSArray *)array objectClass:(Class)objectClass; + +/** +Initialize object with any array. items property is sets as passed array, count is a count of items in passed array +@param array API json array +@return Initialized object +*/ +- (instancetype)initWithArray:(NSArray *)array; + +/// Array funtions + +- (id)objectAtIndex:(NSInteger)idx; + +- (id)objectAtIndexedSubscript:(NSUInteger)idx NS_AVAILABLE(10_8, 6_0); + +- (NSEnumerator *)objectEnumerator; + +- (NSEnumerator *)reverseObjectEnumerator; + +- (void)addObject:(id)object; + +- (void)removeObject:(id)object; + +- (void)insertObject:(id)object atIndex:(NSUInteger)index; + +- (id)firstObject; + +- (id)lastObject; + +- (void)serializeTo:(NSMutableDictionary *)dict withName:(NSString *)name; + +- (Class)objectClass; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKApiObjectArray.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKApiObjectArray.m new file mode 100644 index 0000000..1d3f39c --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKApiObjectArray.m @@ -0,0 +1,143 @@ +// +// VKApiObjectArray.m +// +// Copyright (c) 2014 VK.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 "VKApiObjectArray.h" + + +@interface VKApiObjectArray () +@property(nonatomic, readwrite) NSUInteger count; +@end + +@implementation VKApiObjectArray +- (instancetype)initWithDictionary:(NSDictionary *)dict { + return [self initWithDictionary:dict objectClass:self.objectClass]; +} + +- (instancetype)initWithDictionary:(NSDictionary *)dict objectClass:(Class)objectClass { + id response = dict[@"response"]; + if (response && [response isKindOfClass:[NSArray class]]) { + self = [self initWithArray:response objectClass:objectClass]; + } + else { + self = [super initWithDictionary:response ? response : dict]; + self.items = [self parseItems:self.items asClass:objectClass]; + } + + return self; +} + +- (instancetype)initWithArray:(NSArray *)array objectClass:(Class)objectClass { + + self = [super init]; + self.items = [self parseItems:array asClass:objectClass]; + self.count = self.items.count; + return self; +} + +- (instancetype)initWithArray:(NSArray *)array { + return [self initWithArray:array objectClass:self.objectClass]; +} + +- (NSMutableArray *)parseItems:(NSArray *)toParse asClass:(Class)objectClass { + NSMutableArray *listOfParsedObjects = [NSMutableArray new]; + for (id userDictionary in toParse) { + if ([userDictionary isKindOfClass:objectClass]) + [listOfParsedObjects addObject:userDictionary]; + else if ([userDictionary isKindOfClass:[NSDictionary class]]) + [listOfParsedObjects addObject:[(VKApiObject *) [objectClass alloc] initWithDictionary:userDictionary]]; + else + [listOfParsedObjects addObject:userDictionary]; + } + return listOfParsedObjects; + +} + +- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id __unsafe_unretained[])buffer count:(NSUInteger)len { + return [self.items countByEnumeratingWithState:state objects:buffer count:len]; +} + +- (id)objectAtIndex:(NSInteger)idx { + return self.items[idx]; +} + +- (id)objectAtIndexedSubscript:(NSUInteger)idx { + return self.items[idx]; +} + +- (NSEnumerator *)objectEnumerator { + return self.items.objectEnumerator; +} + +- (NSEnumerator *)reverseObjectEnumerator { + return self.items.reverseObjectEnumerator; +} + +- (void)addObject:(id)object { + [self.items addObject:object]; + self.count = self.items.count; +} + +- (void)removeObject:(id)object { + [self.items removeObject:object]; + self.count = self.items.count; +} + +- (void)insertObject:(id)object atIndex:(NSUInteger)index { + [self.items insertObject:object atIndex:index]; + self.count = self.items.count; +} + +- (id)firstObject { + return [self.items firstObject]; +} + +- (id)lastObject { + return [self.items lastObject]; +} + +- (NSDictionary *)serialize { + return nil; +} + +- (void)serializeTo:(NSMutableDictionary *)dict withName:(NSString *)name { + NSMutableArray *result = [NSMutableArray arrayWithCapacity:self.items.count]; + for (id object in self.items) { + if ([object respondsToSelector:@selector(serialize)]) + [result addObject:[object serialize]]; + else + [result addObject:object]; + } + dict[name] = result; +} + +- (Class)objectClass { + return [VKApiObject class]; +} + ++ (instancetype)createWithDictionary:(NSDictionary *)dict { + return [[self alloc] initWithDictionary:dict]; +} + ++ (instancetype)createWithArray:(NSArray *)array { + return [[self alloc] initWithArray:array]; +} +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKAudio.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKAudio.h new file mode 100644 index 0000000..484e8a6 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKAudio.h @@ -0,0 +1,46 @@ +// +// VKAudio.h +// +// Copyright (c) 2014 VK.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 suabstantial 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 "VKApiObjectArray.h" + +@class VKUser; + +@interface VKAudio : VKApiObject + +@property(nonatomic, strong) NSNumber *id; +@property(nonatomic, strong) NSNumber *owner_id; +@property(nonatomic, strong) NSString *artist; +@property(nonatomic, strong) NSString *title; +@property(nonatomic, strong) NSNumber *duration; +@property(nonatomic, strong) NSString *url; +@property(nonatomic, strong) NSNumber *lyrics_id; +@property(nonatomic, strong) NSNumber *album_id; +@property(nonatomic, strong) NSNumber *genre_id; + +@property(nonatomic, assign) BOOL fromCache; +@property(nonatomic, assign) BOOL ignoreCache; + +@end + +@interface VKAudios : VKApiObjectArray +@property(nonatomic, strong) VKUser *user; +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKAudio.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKAudio.m new file mode 100644 index 0000000..1ca267a --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKAudio.m @@ -0,0 +1,52 @@ +// +// VKAudio.m +// +// Copyright (c) 2014 VK.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 suabstantial 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 "VKAudio.h" +#import "VKUser.h" + +@implementation VKAudio +@end + +@implementation VKAudios +- (Class)objectClass { + return [VKAudio class]; +} + +//Parse first user in array (in some cases) +- (NSMutableArray *)parseItems:(NSArray *)toParse asClass:(Class)objectClass { + NSMutableArray *listOfParsedObjects = [NSMutableArray new]; + for (id objectDict in toParse) { + if ([objectDict isKindOfClass:objectClass]) + [listOfParsedObjects addObject:objectDict]; + else if ([objectDict isKindOfClass:[NSDictionary class]]) { + if ([toParse firstObject] == objectDict && objectDict[@"name"]) { + self.user = [[VKUser alloc] initWithDictionary:objectDict]; + } else { + [listOfParsedObjects addObject:[(VKApiObject *) [objectClass alloc] initWithDictionary:objectDict]]; + } + } + else + [listOfParsedObjects addObject:objectDict]; + } + return listOfParsedObjects; +} +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKCounters.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKCounters.h new file mode 100644 index 0000000..591cfaa --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKCounters.h @@ -0,0 +1,47 @@ +// +// VKCounters.h +// +// Copyright (c) 2014 VK.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 suabstantial 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 "VKApiObject.h" + +@interface VKCounters : VKApiObject +@property(nonatomic, strong) NSNumber *friends; +@property(nonatomic, strong) NSNumber *messages; +@property(nonatomic, strong) NSNumber *photos; +@property(nonatomic, strong) NSNumber *videos; +@property(nonatomic, strong) NSNumber *notifications; +@property(nonatomic, strong) NSNumber *groups; +@property(nonatomic, strong) NSNumber *gifts; +@property(nonatomic, strong) NSNumber *events; + +@property(nonatomic, strong) NSNumber *albums; +@property(nonatomic, strong) NSNumber *audios; +@property(nonatomic, strong) NSNumber *online_friends; +@property(nonatomic, strong) NSNumber *mutual_friends; +@property(nonatomic, strong) NSNumber *user_videos; +@property(nonatomic, strong) NSNumber *followers; +@property(nonatomic, strong) NSNumber *user_photos; +@property(nonatomic, strong) NSNumber *subscriptions; +@property(nonatomic, strong) NSNumber *documents; +@property(nonatomic, strong) NSNumber *topics; +@property(nonatomic, strong) NSNumber *pages; + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKCounters.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKCounters.m new file mode 100644 index 0000000..b4cf883 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKCounters.m @@ -0,0 +1,27 @@ +// +// VKCounters.m +// +// Copyright (c) 2014 VK.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 suabstantial 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 "VKCounters.h" + +@implementation VKCounters + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKGroup.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKGroup.h new file mode 100644 index 0000000..7522d12 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKGroup.h @@ -0,0 +1,123 @@ +// +// VKGroup.h +// sdk +// +// Created by Roman Truba on 16.07.14. +// Copyright (c) 2014 VK. All rights reserved. +// + +#import "VKApiObjectArray.h" +#import "VKUser.h" + +@interface VKGeoPlace : VKApiObject + +@property(nonatomic, strong) NSNumber *id; +@property(nonatomic, strong) NSString *title; +@property(nonatomic, strong) NSNumber *latitude; +@property(nonatomic, strong) NSNumber *longitude; +@property(nonatomic, strong) NSNumber *created; +@property(nonatomic, strong) NSString *icon; +@property(nonatomic, strong) NSNumber *group_id; +@property(nonatomic, strong) NSNumber *group_photo; +@property(nonatomic, strong) NSNumber *checkins; +@property(nonatomic, strong) NSNumber *updated; +@property(nonatomic, strong) NSNumber *type; +@property(nonatomic, strong) NSNumber *country; +@property(nonatomic, strong) NSString *city; +@property(nonatomic, strong) NSString *address; +@property(nonatomic, strong) NSNumber *showmap; +@end + +@interface VKGroupContact : VKApiObject + +@property(nonatomic, strong) NSNumber *user_id; +@property(nonatomic, strong) NSString *desc; +@property(nonatomic, strong) NSString *email; + +@end + +@interface VKGroupContacts : VKApiObjectArray + +@end + +@interface VKGroupLink : VKApiObject + +@property(nonatomic, strong) NSString *url; +@property(nonatomic, strong) NSString *name; +@property(nonatomic, strong) NSString *desc; +@property(nonatomic, strong) NSString *photo_50; +@property(nonatomic, strong) NSString *photo_100; + +@end + +@interface VKGroupLinks : VKApiObjectArray + +@end + +@interface VKGroup : VKApiObject +@property(nonatomic, strong) NSNumber *id; +@property(nonatomic, strong) NSString *name; +@property(nonatomic, strong) NSString *screen_name; +/** +* является ли сообщество закрытым. Возможные значения: +* 0 — открытое; +* 1 — закрытое; +* 2 — частное. +*/ +@property(nonatomic, strong) NSNumber *is_closed; +/** +* тип сообщества: +* group — группа; +* page — публичная страница; +* event — мероприятие. +*/ +@property(nonatomic, strong) NSString *type; +@property(nonatomic, strong) NSNumber *is_admin; +/** +* полномочия текущего пользователя (если is_admin=1): +* 1 — модератор; +* 2 — редактор; +* 3 — администратор. +*/ +@property(nonatomic, strong) NSNumber *admin_level; +@property(nonatomic, strong) NSNumber *is_member; +@property(nonatomic, strong) VKCity *city; +@property(nonatomic, strong) VKCountry *country; +@property(nonatomic, strong) VKGeoPlace *place; +@property(nonatomic, strong) NSString *description; +@property(nonatomic, strong) NSString *wiki_page; +@property(nonatomic, strong) NSNumber *members_count; +@property(nonatomic, strong) VKCounters *counters; +@property(nonatomic, strong) NSNumber *start_date; +@property(nonatomic, strong) NSNumber *end_date; +@property(nonatomic, strong) NSNumber *finish_date; +@property(nonatomic, strong) NSNumber *can_post; +@property(nonatomic, strong) NSNumber *can_see_all_posts; +@property(nonatomic, strong) NSNumber *can_create_topic; +@property(nonatomic, strong) NSNumber *can_upload_doc; +@property(nonatomic, strong) NSString *activity; +@property(nonatomic, strong) NSString *status; +@property(nonatomic, strong) VKAudio *status_audio; +@property(nonatomic, strong) VKGroupContacts *contacts; +@property(nonatomic, strong) VKGroupLinks *links; +@property(nonatomic, strong) NSNumber *fixed_post; +@property(nonatomic, strong) NSNumber *verified; +@property(nonatomic, strong) NSString *site; +@property(nonatomic, strong) NSString *photo_50; +@property(nonatomic, strong) NSString *photo_100; +@property(nonatomic, strong) NSString *photo_200; +@property(nonatomic, strong) NSString *photo_max_orig; +@property(nonatomic, strong) NSNumber *is_request; +@property(nonatomic, strong) NSNumber *is_invite; +@property(nonatomic, strong) VKPhotoArray *photos; +@property(nonatomic, strong) NSNumber *photos_count; +@property(nonatomic, strong) NSNumber *invited_by; +@property(nonatomic, assign) NSInteger invite_state; +@property(nonatomic, strong) NSString *deactivated; +@property(nonatomic, strong) NSNumber *blacklisted; + +@end + +@interface VKGroups : VKApiObjectArray + +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKGroup.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKGroup.m new file mode 100644 index 0000000..451112a --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKGroup.m @@ -0,0 +1,42 @@ +// +// VKGroup.m +// sdk +// +// Created by Roman Truba on 16.07.14. +// Copyright (c) 2014 VK. All rights reserved. +// + +#import "VKGroup.h" + +@implementation VKGeoPlace +@end + +@implementation VKGroupContact +@end + +@implementation VKGroupContacts +- (instancetype)initWithDictionary:(NSDictionary *)dict { + return [super initWithDictionary:dict objectClass:[VKGroupContact class]]; +} +@end + +@implementation VKGroupLink +@end + +@implementation VKGroupLinks +- (instancetype)initWithDictionary:(NSDictionary *)dict { + return [super initWithDictionary:dict objectClass:[VKGroupLink class]]; +} +@end + +@implementation VKGroup + +@synthesize description = _description; + +@end + +@implementation VKGroups +- (instancetype)initWithDictionary:(NSDictionary *)dict { + return [super initWithDictionary:dict objectClass:[VKGroup class]]; +} +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKLikes.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKLikes.h new file mode 100644 index 0000000..704fc80 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKLikes.h @@ -0,0 +1,36 @@ +// +// VKLikes.h +// +// Copyright (c) 2014 VK.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 "VKApiObject.h" + +/** +Likes type of VK API +*/ +@interface VKLikes : VKApiObject +#ifndef DOXYGEN_SHOULD_SKIP_THIS +@property(nonatomic, strong) NSNumber *count; +@property(nonatomic, strong) NSNumber *user_likes; +@property(nonatomic, strong) NSNumber *can_like; +@property(nonatomic, strong) NSNumber *can_publish; +#endif +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKLikes.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKLikes.m new file mode 100644 index 0000000..ff8525f --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKLikes.m @@ -0,0 +1,27 @@ +// +// VKLikes.m +// +// Copyright (c) 2014 VK.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 "VKLikes.h" + +@implementation VKLikes + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKPhoto.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKPhoto.h new file mode 100644 index 0000000..73957ff --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKPhoto.h @@ -0,0 +1,55 @@ +// +// VKPhoto.h +// +// Copyright (c) 2014 VK.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 "VKApiObject.h" +#import "VKApiObjectArray.h" +#import "VKPhotoSize.h" + +@class VKLikes; + +/** +Photo type of VK API. See descriptions here https://vk.com/dev/photo +*/ +@interface VKPhoto : VKApiObject +@property(nonatomic, strong) NSNumber *id; +@property(nonatomic, strong) NSNumber *album_id; +@property(nonatomic, strong) NSNumber *owner_id; +@property(nonatomic, strong) NSString *photo_75; +@property(nonatomic, strong) NSString *photo_130; +@property(nonatomic, strong) NSString *photo_604; +@property(nonatomic, strong) NSString *photo_807; +@property(nonatomic, strong) NSString *photo_1280; +@property(nonatomic, strong) NSString *photo_2560; +@property(nonatomic, strong) NSNumber *width; +@property(nonatomic, strong) NSNumber *height; +@property(nonatomic, strong) NSString *text; +@property(nonatomic, strong) NSNumber *date; +@property(nonatomic, strong) VKPhotoSizes *sizes; +@property(nonatomic, readonly) NSString *attachmentString; +@end + + +/** +Array of API photos objects +*/ +@interface VKPhotoArray : VKApiObjectArray +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKPhoto.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKPhoto.m new file mode 100644 index 0000000..75b1175 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKPhoto.m @@ -0,0 +1,35 @@ +// +// VKPhoto.m +// +// Copyright (c) 2014 VK.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 "VKPhoto.h" + +@implementation VKPhoto +- (NSString *)attachmentString { + return [NSString stringWithFormat:@"photo%@_%@", _owner_id, _id]; +} +@end + +@implementation VKPhotoArray +- (instancetype)initWithDictionary:(NSDictionary *)dict { + return [super initWithDictionary:dict objectClass:[VKPhoto class]]; +} +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKPhotoSize.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKPhotoSize.h new file mode 100644 index 0000000..e8b4e0a --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKPhotoSize.h @@ -0,0 +1,20 @@ +// +// VKPhotoSize.h +// sdk +// +// Created by Roman Truba on 11.08.14. +// Copyright (c) 2014 VK. All rights reserved. +// + +#import "VKApiObjectArray.h" + +@interface VKPhotoSize : VKApiObject +@property(nonatomic, readwrite, copy) NSString *src; +@property(nonatomic, readwrite, copy) NSNumber *width; +@property(nonatomic, readwrite, copy) NSNumber *height; +@property(nonatomic, readwrite, copy) NSString *type; +@end + +@interface VKPhotoSizes : VKApiObjectArray +- (VKPhotoSize *)photoSizeWithType:(NSString *)type; +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKPhotoSize.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKPhotoSize.m new file mode 100644 index 0000000..8915f73 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKPhotoSize.m @@ -0,0 +1,35 @@ +// +// VKPhotoSize.m +// sdk +// +// Created by Roman Truba on 11.08.14. +// Copyright (c) 2014 VK. All rights reserved. +// + +#import "VKPhotoSize.h" + +@implementation VKPhotoSize +@end + +@implementation VKPhotoSizes { + NSDictionary *sizesDictionary; +} +- (Class)objectClass { + return [VKPhotoSize class]; +} + +- (instancetype)initWithArray:(NSArray *)array { + self = [super initWithArray:array]; + NSMutableDictionary *sizes = [NSMutableDictionary new]; + for (VKPhotoSize *size in self.items) { + if (!size.type) continue; + sizes[size.type] = size; + } + sizesDictionary = sizes; + return self; +} + +- (VKPhotoSize *)photoSizeWithType:(NSString *)type { + return sizesDictionary[type]; +} +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKRelative.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKRelative.h new file mode 100644 index 0000000..00d4f4b --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKRelative.h @@ -0,0 +1,34 @@ +// +// VKRelative.h +// +// Copyright (c) 2014 VK.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 suabstantial 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 "VKApiObjectArray.h" + +@interface VKRelative : VKApiObject + +@property(nonatomic, strong) NSNumber *id; +@property(nonatomic, strong) NSString *type; + +@end + +@interface VKRelativities : VKApiObjectArray + +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKRelative.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKRelative.m new file mode 100644 index 0000000..1ce82d2 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKRelative.m @@ -0,0 +1,33 @@ +// +// VKRelative.m +// +// Copyright (c) 2014 VK.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 suabstantial 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 "VKRelative.h" + +@implementation VKRelative + +@end + +@implementation VKRelativities +- (instancetype)initWithDictionary:(NSDictionary *)dict { + return [super initWithDictionary:dict objectClass:[VKRelative class]]; +} +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKSchool.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKSchool.h new file mode 100644 index 0000000..1da4c5f --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKSchool.h @@ -0,0 +1,43 @@ +// +// VKSchool.h +// +// Copyright (c) 2014 VK.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 suabstantial 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 "VKApiObjectArray.h" + +@interface VKSchool : VKApiObject + +@property(nonatomic, strong) NSNumber *id; +@property(nonatomic, strong) NSNumber *country; +@property(nonatomic, strong) NSNumber *city; +@property(nonatomic, strong) NSString *name; +@property(nonatomic, strong) NSNumber *year_from; +@property(nonatomic, strong) NSNumber *year_to; +@property(nonatomic, strong) NSNumber *year_graduated; +@property(nonatomic, strong) NSString *Mclass; +@property(nonatomic, strong) NSString *speciality; +@property(nonatomic, strong) NSNumber *type; +@property(nonatomic, strong) NSString *type_str; + +@end + +@interface VKSchools : VKApiObjectArray + +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKSchool.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKSchool.m new file mode 100644 index 0000000..660d7ec --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKSchool.m @@ -0,0 +1,44 @@ +// +// VKSchool.m +// +// Copyright (c) 2014 VK.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 suabstantial 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 "VKSchool.h" +#import "VKUtil.h" + +@implementation VKSchool + +- (instancetype)initWithDictionary:(NSDictionary *)dict { + NSMutableDictionary *newDict = [NSMutableDictionary dictionaryWithDictionary:dict]; + id schoolId = newDict[@"id"]; + if ([schoolId isKindOfClass:[NSString class]]) { + schoolId = [VKUtil parseNumberString:schoolId]; + newDict[@"id"] = schoolId; + } + return [super initWithDictionary:newDict]; +} + +@end + +@implementation VKSchools +- (instancetype)initWithDictionary:(NSDictionary *)dict { + return [super initWithDictionary:dict objectClass:[VKSchool class]]; +} +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKUniversity.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKUniversity.h new file mode 100644 index 0000000..c73a9b2 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKUniversity.h @@ -0,0 +1,42 @@ +// +// VKUniversity.h +// +// Copyright (c) 2014 VK.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 suabstantial 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 "VKApiObjectArray.h" + +@interface VKUniversity : VKApiObject + +@property(nonatomic, strong) NSNumber *id; +@property(nonatomic, strong) NSNumber *country; +@property(nonatomic, strong) NSNumber *city; +@property(nonatomic, strong) NSString *name; +@property(nonatomic, strong) NSNumber *faculty; +@property(nonatomic, strong) NSString *faculty_name; +@property(nonatomic, strong) NSNumber *chair; +@property(nonatomic, strong) NSString *chair_name; +@property(nonatomic, strong) NSNumber *graduation; +@property(nonatomic, strong) NSString *education_form; +@property(nonatomic, strong) NSString *education_status; + +@end + +@interface VKUniversities : VKApiObjectArray +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKUniversity.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKUniversity.m new file mode 100644 index 0000000..e13fc26 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKUniversity.m @@ -0,0 +1,33 @@ +// +// VKUniversity.m +// +// Copyright (c) 2014 VK.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 suabstantial 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 "VKUniversity.h" + +@implementation VKUniversity +@end + +@implementation VKUniversities + +- (instancetype)initWithDictionary:(NSDictionary *)dict { + return [super initWithDictionary:dict objectClass:[VKUniversity class]]; +} +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKUser.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKUser.h new file mode 100644 index 0000000..7db0eda --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKUser.h @@ -0,0 +1,183 @@ +// +// VKUser.h +// +// Copyright (c) 2014 VK.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 "VKApiObject.h" +#import "VKApiObjectArray.h" +#import "VKAudio.h" +#import "VKCounters.h" +#import "VKPhoto.h" +#import "VKSchool.h" +#import "VKUniversity.h" +#import "VKRelative.h" + +@interface VKGeoObject : VKApiObject +@property(nonatomic, strong) NSNumber *id; +@property(nonatomic, strong) NSString *title; +@end + +@interface VKCity : VKGeoObject +@end + +@interface VKCountry : VKGeoObject +@end + +@interface VKPersonal : VKObject +@property(nonatomic, strong) NSArray *langs; +@property(nonatomic, strong) NSNumber *political; +@property(nonatomic, strong) NSString *religion; +@property(nonatomic, strong) NSNumber *life_main; +@property(nonatomic, strong) NSNumber *people_main; +@property(nonatomic, strong) NSString *inspired_by; +@property(nonatomic, strong) NSNumber *smoking; +@property(nonatomic, strong) NSNumber *alcohol; +@end + +/** +User type of VK API. See descriptions here https://vk.com/dev/fields +*/ +@interface VKBanInfo : VKApiObject +/// идентификатор администратора, который добавил пользователя в черный список; +@property(nonatomic, strong) NSNumber *admin_id; +/// дата добавления пользователя в черный список; +@property(nonatomic, strong) NSNumber *date; +/// причина добавления пользователя в черный список; +@property(nonatomic, strong) NSNumber *reason; +/// текст комментария +@property(nonatomic, strong) NSString *comment; +/// дата, когда пользователь будет разбанен. +@property(nonatomic, strong) NSNumber *end_date; +@end + +@interface VKLastSeen : VKApiObject +@property(nonatomic, strong) NSNumber *time; +@property(nonatomic, strong) NSNumber *platform; +@end + +@interface VKExports : VKApiObject +@property(nonatomic, strong) NSNumber *twitter; +@property(nonatomic, strong) NSNumber *facebook; +@property(nonatomic, strong) NSNumber *livejournal; +@property(nonatomic, strong) NSNumber *instagram; +@end + +@interface VKUser : VKApiObject +@property(nonatomic, strong) NSNumber *id; +@property(nonatomic, strong) NSString *first_name; +@property(nonatomic, strong) NSString *last_name; +@property(nonatomic, strong) NSString *first_name_acc; +@property(nonatomic, strong) NSString *last_name_acc; +@property(nonatomic, strong) NSString *first_name_gen; +@property(nonatomic, strong) NSString *last_name_gen; +@property(nonatomic, strong) NSString *first_name_dat; +@property(nonatomic, strong) NSString *last_name_dat; +@property(nonatomic, strong) NSString *first_name_ins; +@property(nonatomic, strong) NSString *last_name_ins; +@property(nonatomic, strong) VKPersonal *personal; +@property(nonatomic, strong) NSNumber *sex; +@property(nonatomic, strong) NSNumber *invited_by; +@property(nonatomic, strong) NSNumber *online; +@property(nonatomic, strong) NSString *bdate; +@property(nonatomic, strong) VKCity *city; +@property(nonatomic, strong) VKCountry *country; +@property(nonatomic, strong) NSMutableArray *lists; +@property(nonatomic, strong) NSString *screen_name; +@property(nonatomic, strong) NSNumber *has_mobile; +@property(nonatomic, strong) NSNumber *rate; +@property(nonatomic, strong) NSString *mobile_phone; +@property(nonatomic, strong) NSString *home_phone; +@property(nonatomic, assign) BOOL can_post; +@property(nonatomic, assign) BOOL can_see_all_posts; +@property(nonatomic, strong) NSString *status; +@property(nonatomic, strong) VKAudio *status_audio; +@property(nonatomic, assign) bool status_loaded; +@property(nonatomic, strong) VKLastSeen *last_seen; +@property(nonatomic, strong) NSNumber *relation; +@property(nonatomic, strong) VKUser *relation_partner; +@property(nonatomic, strong) VKCounters *counters; +@property(nonatomic, strong) NSString *nickname; +@property(nonatomic, strong) VKExports *exports; +@property(nonatomic, strong) NSNumber *wall_comments; +@property(nonatomic, assign) BOOL can_write_private_message; +@property(nonatomic, strong) NSString *phone; +@property(nonatomic, strong) NSNumber *online_mobile; +@property(nonatomic, strong) NSNumber *faculty; +@property(nonatomic, strong) NSNumber *university; +@property(nonatomic, strong) VKUniversities *universities; +@property(nonatomic, strong) VKSchools *schools; +@property(nonatomic, strong) NSNumber *graduation; +@property(nonatomic, strong) NSNumber *friendState; +@property(nonatomic, strong) NSString *faculty_name; +@property(nonatomic, strong) NSString *university_name; +@property(nonatomic, strong) NSString *books; +@property(nonatomic, strong) NSString *games; +@property(nonatomic, strong) NSString *interests; +@property(nonatomic, strong) NSString *movies; +@property(nonatomic, strong) NSString *tv; +@property(nonatomic, strong) NSString *about; +@property(nonatomic, strong) NSString *music; +@property(nonatomic, strong) NSString *quoutes; +@property(nonatomic, strong) NSString *activities; +@property(nonatomic, strong) NSString *photo_max; +@property(nonatomic, strong) NSString *photo_50; +@property(nonatomic, strong) NSString *photo_100; +@property(nonatomic, strong) NSString *photo_200; +@property(nonatomic, strong) NSString *photo_200_orig; +@property(nonatomic, strong) NSString *photo_400_orig; +@property(nonatomic, strong) NSString *photo_max_orig; +@property(nonatomic, strong) VKPhotoArray *photos; +@property(nonatomic, strong) NSNumber *photos_count; +@property(nonatomic, strong) VKRelativities *relatives; +@property(nonatomic, assign) NSTimeInterval bdateIntervalSort; +@property(nonatomic, strong) NSNumber *verified; +@property(nonatomic, strong) NSString *deactivated; +@property(nonatomic, strong) NSString *site; +@property(nonatomic, strong) NSString *home_town; +@property(nonatomic, strong) NSNumber *blacklisted; +@property(nonatomic, strong) NSNumber *blacklisted_by_me; +@property(nonatomic, strong) NSString *twitter; +@property(nonatomic, strong) NSString *skype; +@property(nonatomic, strong) NSString *facebook; +@property(nonatomic, strong) NSString *livejournal; +@property(nonatomic, strong) NSString *wall_default; +/// Для метода account.lookupContacts + +@property(nonatomic, strong) NSString *contact; +@property(nonatomic, strong) NSNumber *request_sent; +@property(nonatomic, strong) NSNumber *common_count; + +/// Для метода groups.getBanned +@property(nonatomic, strong) VKBanInfo *ban_info; + +/// audio.get +@property(nonatomic, strong) NSString *name; +@property(nonatomic, strong) NSString *name_gen; + +// getSubscriptions +@property(nonatomic, strong) NSNumber *followers_count; +@end + +/** +Array of API users +*/ +@interface VKUsersArray : VKApiObjectArray +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKUser.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKUser.m new file mode 100644 index 0000000..06317db --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/models/VKUser.m @@ -0,0 +1,50 @@ +// +// VKUser.m +// +// Copyright (c) 2014 VK.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 "VKUser.h" + +@implementation VKBanInfo +@end + +@implementation VKLastSeen +@end + +@implementation VKUser +@end + +@implementation VKGeoObject +@end + +@implementation VKCity +@end + +@implementation VKCountry +@end + +@implementation VKExports +@end + +@implementation VKUsersArray +- (instancetype)initWithDictionary:(NSDictionary *)dict { + return [super initWithDictionary:dict objectClass:[VKUser class]]; +} +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadMessagesPhotoRequest.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadMessagesPhotoRequest.h new file mode 100644 index 0000000..c547564 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadMessagesPhotoRequest.h @@ -0,0 +1,28 @@ +// +// VKUploadMessagesPhotoRequest.h +// +// Copyright (c) 2014 VK.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 "VKUploadPhotoBase.h" + +@interface VKUploadMessagesPhotoRequest : VKUploadPhotoBase + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadMessagesPhotoRequest.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadMessagesPhotoRequest.m new file mode 100644 index 0000000..2cdca14 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadMessagesPhotoRequest.m @@ -0,0 +1,36 @@ +// +// VKUploadMessagesPhotoRequest.m +// +// Copyright (c) 2014 VK.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 "VKUploadMessagesPhotoRequest.h" +#import "VKPhoto.h" + +@implementation VKUploadMessagesPhotoRequest +- (VKRequest *)getServerRequest { + return [VKRequest requestWithMethod:@"photos.getMessagesUploadServer" andParameters:nil]; +} + +- (VKRequest *)getSaveRequest:(VKResponse *)response { + return [VKRequest requestWithMethod:@"photos.saveMessagesPhoto" andParameters:response.json modelClass:[VKPhotoArray class]]; + +} +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadPhotoBase.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadPhotoBase.h new file mode 100644 index 0000000..c0c6d67 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadPhotoBase.h @@ -0,0 +1,52 @@ +// +// VKPhotoUploadBase.h +// +// Copyright (c) 2014 VK.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 "VKRequest.h" +#import "VKImageParameters.h" +#import "VKOperation.h" + +/** +Provides common part of photo upload process +*/ +@interface VKUploadPhotoBase : VKRequest +/// ID of album to upload +@property(nonatomic, assign) NSInteger albumId; +/// ID of group to upload +@property(nonatomic, assign) NSInteger groupId; +/// ID of user wall to upload +@property(nonatomic, assign) NSInteger userId; + +/// Passed image parameters +@property(nonatomic, strong) VKImageParameters *imageParameters; +/// Image to upload +@property(nonatomic, strong) UIImage *image; + +- (instancetype)initWithImage:(UIImage *)image parameters:(VKImageParameters *)parameters; +@end + +/** +Special operation for execute upload +*/ +@interface VKUploadImageOperation : VKOperation + ++ (instancetype)operationWithUploadRequest:(VKUploadPhotoBase *)request; +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadPhotoBase.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadPhotoBase.m new file mode 100644 index 0000000..3c111f0 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadPhotoBase.m @@ -0,0 +1,141 @@ +// +// VKPhotoUploadBase.m +// +// Copyright (c) 2014 VK.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 "VKUploadPhotoBase.h" +#import "VKUploadImage.h" + +extern inline NSString *VKKeyPathFromOperationState(VKOperationState state); + +extern inline BOOL VKStateTransitionIsValid(VKOperationState fromState, VKOperationState toState, BOOL isCancelled); + +@interface VKUploadPhotoBase () +@property(nonatomic, readwrite, strong) NSOperation *executionOperation; +@end + +@implementation VKUploadPhotoBase +@dynamic executionOperation; + +- (instancetype)initWithImage:(UIImage *)image parameters:(VKImageParameters *)parameters { + self = [super init]; + self.image = image; + self.imageParameters = parameters; + return self; +} + +- (NSOperation *)createExecutionOperation { + VKOperation *op = [VKUploadImageOperation operationWithUploadRequest:self]; + [op setResponseQueue:self.responseQueue]; + self.executionOperation = op; + return op; +} + +- (VKRequest *)getServerRequest { + @throw [NSException exceptionWithName:@"Abstract function" reason:@"getServerRequest should be overriden" userInfo:nil]; +} + +- (VKRequest *)getSaveRequest:(VKResponse *)response { + @throw [NSException exceptionWithName:@"Abstract function" reason:@"getSaveRequest should be overriden" userInfo:nil]; +} + +- (NSString *)methodName { + return NSStringFromClass([self class]); +} + +@end + +@interface VKUploadImageOperation () +@property(nonatomic, strong) VKUploadPhotoBase *uploadRequest; +@property(readwrite, nonatomic, assign) VKOperationState state; +@property(nonatomic, strong) VKRequest *lastLoadingRequest; +@end + +@implementation VKUploadImageOperation +@dynamic state; + ++ (instancetype)operationWithUploadRequest:(VKUploadPhotoBase *)uploadRequest { + VKUploadImageOperation *operation = [VKUploadImageOperation new]; + operation.uploadRequest = uploadRequest; + return operation; +} + + +- (void)start { + void (^originalErrorBlock)(NSError *) = [_uploadRequest.errorBlock copy]; + __weak VKUploadImageOperation *weakSelf = self; + _uploadRequest.errorBlock = ^(NSError *error) { + [weakSelf finish]; + if (originalErrorBlock) + originalErrorBlock(error); + }; + self.state = VKOperationExecutingState; + + VKRequest *serverRequest = [_uploadRequest getServerRequest]; + serverRequest.responseQueue = self.responseQueue; + serverRequest.completeBlock = ^(VKResponse *response) { + NSData *imageData = nil; + switch (_uploadRequest.imageParameters.imageType) { + case VKImageTypeJpg: + imageData = UIImageJPEGRepresentation(_uploadRequest.image, _uploadRequest.imageParameters.jpegQuality); + break; + + case VKImageTypePng: + imageData = UIImagePNGRepresentation(_uploadRequest.image); + break; + + default: + break; + } + _uploadRequest.image = nil; + VKRequest *postFileRequest = [VKRequest photoRequestWithPostUrl:response.json[@"upload_url"] + withPhotos:@[[VKUploadImage uploadImageWithData:imageData andParams:_uploadRequest.imageParameters]]]; + postFileRequest.progressBlock = _uploadRequest.progressBlock; + postFileRequest.responseQueue = self.responseQueue; + self.lastLoadingRequest = postFileRequest; + [postFileRequest executeWithResultBlock:^(VKResponse *response) { + VKRequest *saveRequest = [_uploadRequest getSaveRequest:response]; + saveRequest.responseQueue = self.responseQueue; + self.lastLoadingRequest = saveRequest; + [saveRequest executeWithResultBlock:^(VKResponse *response) { + response.request = _uploadRequest; + + if (_uploadRequest.completeBlock) _uploadRequest.completeBlock(response); + [weakSelf finish]; + } errorBlock:_uploadRequest.errorBlock]; + } errorBlock:_uploadRequest.errorBlock]; + }; + serverRequest.errorBlock = _uploadRequest.errorBlock; + self.lastLoadingRequest = serverRequest; + [serverRequest start]; +} + +- (void)finish { + self.state = VKOperationFinishedState; + self.uploadRequest = nil; + self.lastLoadingRequest = nil; +} + +- (void)cancel { + [super cancel]; + [self.lastLoadingRequest cancel]; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadPhotoRequest.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadPhotoRequest.h new file mode 100644 index 0000000..669dce2 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadPhotoRequest.h @@ -0,0 +1,39 @@ +// +// VKUploadPhotoRequest.h +// +// Copyright (c) 2014 VK.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 "VKUploadPhotoBase.h" + +/** +Special request for upload photos to specified album +*/ +@interface VKUploadPhotoRequest : VKUploadPhotoBase + +/** +Initializes photo upload request with parameters +@param image Image to upload +@param parameters image parameters for upload +@param albumId ID of album for photo +@param groupId ID of group (without minus sign) on which wall image should be posted (or nil) +@return Completed request for executing +*/ +- (instancetype)initWithImage:(UIImage *)image parameters:(VKImageParameters *)parameters albumId:(NSInteger)albumId groupId:(NSInteger)groupId; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadPhotoRequest.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadPhotoRequest.m new file mode 100644 index 0000000..d492ab8 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadPhotoRequest.m @@ -0,0 +1,50 @@ +// +// VKUploadPhotoRequest.m +// +// Copyright (c) 2014 VK.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 "VKUploadPhotoRequest.h" +#import "VKApi.h" + +@implementation VKUploadPhotoRequest +- (instancetype)initWithImage:(UIImage *)image parameters:(VKImageParameters *)parameters albumId:(NSInteger)albumId groupId:(NSInteger)groupId { + self = [super initWithImage:image parameters:parameters]; + self.albumId = albumId; + self.groupId = groupId; + return self; +} + +- (VKRequest *)getServerRequest { + if (self.albumId && self.groupId) + return [[VKApi photos] getUploadServer:self.albumId andGroupId:self.groupId]; + else + return [[VKApi photos] getUploadServer:self.albumId]; +} + +- (VKRequest *)getSaveRequest:(VKResponse *)response { + VKRequest *saveRequest = [[VKApi photos] save:response.json]; + if (self.albumId) + [saveRequest addExtraParameters:@{VK_API_ALBUM_ID : @(self.albumId)}]; + if (self.groupId) + [saveRequest addExtraParameters:@{VK_API_GROUP_ID : @(self.groupId)}]; + return saveRequest; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadWallPhotoRequest.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadWallPhotoRequest.h new file mode 100644 index 0000000..9f3670c --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadWallPhotoRequest.h @@ -0,0 +1,38 @@ +// +// VKUploadWallPhotoRequest.h +// +// Copyright (c) 2014 VK.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 "VKUploadPhotoBase.h" + +/** +Special request for upload single photo to user wall +*/ +@interface VKUploadWallPhotoRequest : VKUploadPhotoBase +/** +Initializes photo upload request with parameters +@param image Image to upload +@param parameters image parameters for upload +@param userId ID of user on which wall image should be posted (or nil) +@param groupId ID of group (without minus sign) on which wall image should be posted (or nil) +@return Completed request for executing +*/ +- (instancetype)initWithImage:(UIImage *)image parameters:(VKImageParameters *)parameters userId:(NSInteger)userId groupId:(NSInteger)groupId; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadWallPhotoRequest.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadWallPhotoRequest.m new file mode 100644 index 0000000..c019b85 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/API/upload/VKUploadWallPhotoRequest.m @@ -0,0 +1,50 @@ +// +// VKUploadWallPhotoRequest.m +// +// Copyright (c) 2014 VK.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 "VKUploadWallPhotoRequest.h" +#import "VKApi.h" + +@implementation VKUploadWallPhotoRequest +- (instancetype)initWithImage:(UIImage *)image parameters:(VKImageParameters *)parameters userId:(NSInteger)userId groupId:(NSInteger)groupId { + self = [super initWithImage:image parameters:parameters]; + self.userId = userId; + self.groupId = groupId; + return self; +} + +- (VKRequest *)getServerRequest { + if (self.groupId != 0) + return [[VKApi photos] getWallUploadServer:self.groupId]; + else + return [[VKApi photos] getWallUploadServer]; +} + +- (VKRequest *)getSaveRequest:(VKResponse *)response { + VKRequest *saveRequest = [[VKApi photos] saveWallPhoto:response.json]; + if (self.userId) + [saveRequest addExtraParameters:@{VK_API_USER_ID : @(self.userId)}]; + if (self.groupId) + [saveRequest addExtraParameters:@{VK_API_GROUP_ID : @(self.groupId)}]; + return saveRequest; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/NSError+VKError.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/NSError+VKError.h new file mode 100644 index 0000000..b2b2c34 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/NSError+VKError.h @@ -0,0 +1,51 @@ +// +// NSError+VKError.h +// +// Copyright (c) 2014 VK.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 "VKError.h" + +extern NSString *const VKSdkErrorDomain; +extern NSString *const VkErrorDescriptionKey; + +/** +* Category with implementation of VK error +*/ +@interface NSError (VKError) + +/// Returns vk error associated with that NSError +@property(nonatomic, readonly) VKError *vkError; + +/** +Create new NSError with VKError +@param vkError Source error +@return New error with VKSdkErrorDomain domain +*/ ++ (NSError *)errorWithVkError:(VKError *)vkError; + +/** +Copies user info from this NSError into new error, with adding VKError +@param vkError Source error +@return New error with this error domain, code and user info +*/ +- (NSError *)copyWithVkError:(VKError *)vkError; + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/NSError+VKError.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/NSError+VKError.m new file mode 100644 index 0000000..a038eb5 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/NSError+VKError.m @@ -0,0 +1,56 @@ +// +// NSError+VKError.m +// +// Copyright (c) 2014 VK.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 "NSError+VKError.h" + +NSString *const VKSdkErrorDomain = @"VKSdkErrorDomain"; +NSString *const VkErrorDescriptionKey = @"VkErrorDescriptionKey"; + +@implementation NSError (VKError) + ++ (NSError *)errorWithVkError:(VKError *)vkError { + NSMutableDictionary *userInfo = [NSMutableDictionary new]; + NSInteger originalCode = vkError.errorCode; + if (vkError.apiError) { + vkError = vkError.apiError; + } + if (originalCode == VK_API_CANCELED) { + originalCode = NSURLErrorCancelled; + } + userInfo[NSLocalizedDescriptionKey] = vkError.errorMessage ? vkError.errorMessage : NSLocalizedStringFromTable(@"Something went wrong", nil, @""); + userInfo[VkErrorDescriptionKey] = vkError; + + return [[NSError alloc] initWithDomain:VKSdkErrorDomain code:originalCode userInfo:userInfo]; +} + +- (NSError *)copyWithVkError:(VKError *)vkError { + NSMutableDictionary *userInfo = [self.userInfo mutableCopy]; + userInfo[VkErrorDescriptionKey] = vkError; + + return [[NSError alloc] initWithDomain:self.domain code:self.code userInfo:userInfo]; +} + +- (VKError *)vkError { + return (VKError *) self.userInfo[VkErrorDescriptionKey]; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKError.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKError.h new file mode 100644 index 0000000..ac7ce92 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKError.h @@ -0,0 +1,88 @@ +// +// VKError.h +// +// Copyright (c) 2014 VK.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 "VKObject.h" +#import "VKApiConst.h" + +static int const VK_API_ERROR = -101; +static int const VK_API_CANCELED = -102; +static int const VK_API_REQUEST_NOT_PREPARED = -103; +static int const VK_RESPONSE_STRING_PARSING_ERROR = -104; +static int const VK_AUTHORIZE_CONTROLLER_CANCEL = -105; + +@class VKRequest; + +/** +Class for presenting VK SDK and VK API errors +*/ +@interface VKError : VKObject +/// Contains system HTTP error +@property(nonatomic, strong) NSError *httpError; +/// Describes API error +@property(nonatomic, strong) VKError *apiError; +/// Request which caused error +@property(nonatomic, strong) VKRequest *request; + +/// May contains such errors:\n HTTP status code if HTTP error occured;\n VK_API_ERROR if API error occured;\n VK_API_CANCELED if request was canceled;\n VK_API_REQUEST_NOT_PREPARED if error occured while preparing request; +@property(nonatomic, assign) NSInteger errorCode; +/// API error message +@property(nonatomic, strong) NSString *errorMessage; +/// Reason for authorization fail +@property(nonatomic, strong) NSString *errorReason; +// Localized error text from server if there is one +@property(nonatomic, strong) NSString *errorText; +/// API parameters passed to request +@property(nonatomic, strong) NSDictionary *requestParams; +/// Captcha identifier for captcha-check +@property(nonatomic, strong) NSString *captchaSid; +/// Image for captcha-check +@property(nonatomic, strong) NSString *captchaImg; +/// Redirection address if validation check required +@property(nonatomic, strong) NSString *redirectUri; + +@property(nonatomic, strong) id json; + +/** +Generate new error with code +@param errorCode positive if it's an HTTP error. Negative if it's API or SDK error +*/ ++ (instancetype)errorWithCode:(NSInteger)errorCode; + +/** +Generate API error from JSON +@param JSON Json description of VK API error +*/ ++ (instancetype)errorWithJson:(id)JSON; + +/** +Generate API error from HTTP-query +@param queryParams key-value parameters +*/ ++ (instancetype)errorWithQuery:(NSDictionary *)queryParams; + +/** +Repeats failed captcha request with user entered answer to captcha +@param userEnteredCode answer for captcha +*/ +- (void)answerCaptcha:(NSString *)userEnteredCode; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKError.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKError.m new file mode 100644 index 0000000..814c602 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKError.m @@ -0,0 +1,84 @@ +// +// VKError.m +// +// Copyright (c) 2014 VK.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 "VKError.h" +#import "VKRequest.h" + +@implementation VKError ++ (instancetype)errorWithCode:(NSInteger)errorCode { + VKError *error = [VKError new]; + error.errorCode = errorCode; + return error; +} + ++ (instancetype)errorWithJson:(id)JSON { + VKError *internalError = [VKError new]; + internalError.errorCode = [JSON[VK_API_ERROR_CODE] intValue]; + internalError.errorMessage = JSON[VK_API_ERROR_MSG]; + internalError.errorText = JSON[VK_API_ERROR_TEXT]; + internalError.requestParams = JSON[VK_API_REQUEST_PARAMS]; + internalError.json = JSON; + if (internalError.errorCode == 14) { + internalError.captchaImg = JSON[VK_API_CAPTCHA_IMG]; + internalError.captchaSid = JSON[VK_API_CAPTCHA_SID]; + } + if (internalError.errorCode == 17) { + internalError.redirectUri = JSON[VK_API_REDIRECT_URI]; + } + + VKError *mainError = [VKError errorWithCode:VK_API_ERROR]; + mainError.apiError = internalError; + mainError.json = JSON; + return mainError; +} + ++ (instancetype)errorWithQuery:(NSDictionary *)queryParams { + VKError *error = [VKError new]; + error.errorCode = VK_API_ERROR; + error.errorReason = queryParams[@"error_reason"]; + error.errorMessage = [queryParams[@"error_description"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + return error; +} + +- (void)answerCaptcha:(NSString *)userEnteredCode { + [self.request addExtraParameters:@{VK_API_CAPTCHA_SID : self.captchaSid, VK_API_CAPTCHA_KEY : userEnteredCode}]; + [self.request repeat]; +} + +- (NSString *)description { + if (self.httpError) { + return [NSString stringWithFormat:@"", self, self.httpError]; + } + else { + if (self.errorCode == VK_API_ERROR) + return [NSString stringWithFormat:@"", + self, self.apiError, self.errorReason, self.errorMessage]; + else if (self.errorCode == VK_API_CANCELED) + return [NSString stringWithFormat:@"", self]; + else if (self.errorCode == VK_API_REQUEST_NOT_PREPARED) + return [NSString stringWithFormat:@"", self]; + return [NSString stringWithFormat:@"", self, (long) self.errorCode, self.errorMessage]; + } +// return [NSString stringWithFormat:@"", self]; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKHTTPClient.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKHTTPClient.h new file mode 100644 index 0000000..c9b59a5 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKHTTPClient.h @@ -0,0 +1,132 @@ +// +// VKHttpClient.h +// +// Based on AFNetworking library. +// https://github.com/AFNetworking/AFNetworking +// +// Copyright (c) 2014 VK.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 "VKObject.h" + +@class VKHTTPOperation; + +/** +Class for NSURLRequests generation, made for VK API. +Based on AFNetworking library ( https://github.com/AFNetworking/AFNetworking ) +*/ +@interface VKHTTPClient : VKObject + +///------------------------------- +/// @name Initialization +///------------------------------- + +/** +Creates and initializes an `VKHTTPClient` object with the specified base URL. + +@return The newly-initialized HTTP client +*/ ++ (instancetype)getClient; + +/** +The operation queue which manages operations enqueued by the HTTP client. +*/ +@property(readonly, nonatomic, strong) NSOperationQueue *operationQueue; + +///------------------------------- +/// @name Operations with default headers +///------------------------------- + +/** +Returns the value for the HTTP headers set in request objects created by the HTTP client. + +@param header The HTTP header to return the default value for + +@return The default value for the HTTP header, or `nil` if unspecified +*/ +- (NSString *)defaultValueForHeader:(NSString *)header; + +/** +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 header The HTTP header to set a default value for +@param value The value set as default for the specified header, or `nil +*/ +- (void)setDefaultHeader:(NSString *)header + value:(NSString *)value; + +///------------------------------- +/// @name Preparing requests +///------------------------------- + +/** +Creates an `NSMutableURLRequest` object with the specified HTTP method and path. + +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 path The path to be appended to the HTTP client's base URL and used as the request URL. If `nil`, no path will be appended to the base URL. +@param parameters The parameters to be either set as a query string for `GET` requests, or the request HTTP body. +@param secure Use HTTPS or not + +@return An `NSMutableURLRequest` object +*/ +- (NSMutableURLRequest *)requestWithMethod:(NSString *)method + path:(NSString *)path + parameters:(NSDictionary *)parameters + secure:(BOOL)secure; + +/** +Creates an `NSMutableURLRequest` object with the specified HTTP method and path, 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 path The path to be appended to the HTTP client's base URL and used as the request URL. +@param images Upload images objects to append + +@return An `NSMutableURLRequest` object +*/ +- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method + path:(NSString *)path + images:(NSArray *)images; + +///------------------------------- +/// @name Enqueuing operations +///------------------------------- + +/** +Enqueues an `AFHTTPRequestOperation` to the HTTP client's operation queue. + +@param operation The HTTP request operation to be enqueued. +*/ +- (void)enqueueOperation:(NSOperation *)operation; + +/** +Enqueues the specified request operations into a batch. When each request operation finishes, the specified progress block is executed, until all of the request operations have finished, at which point the completion block also executes. + +@param operations The request operations used to be batched and enqueued. +@param progressBlock A block object to be executed upon the completion of each request operation in the batch. This block has no return value and takes two arguments: the number of operations that have already finished execution, and the total number of operations. +@param completionBlock A block object to be executed upon the completion of all of the request operations in the batch. This block has no return value and takes a single argument: the batched request operations. +*/ +- (void)enqueueBatchOfHTTPRequestOperations:(NSArray *)operations + progressBlock:(void (^)(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations))progressBlock + completionBlock:(void (^)(NSArray *operations))completionBlock; + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKHTTPClient.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKHTTPClient.m new file mode 100644 index 0000000..8e52401 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKHTTPClient.m @@ -0,0 +1,213 @@ +// +// VKHttpClient.m +// +// Based on AFNetworking library. +// https://github.com/AFNetworking/AFNetworking +// +// Copyright (c) 2014 VK.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 "VKHTTPClient.h" +#import "VKSdkVersion.h" +#import "VKImageParameters.h" +#import "VKUploadImage.h" +#import "VKUtil.h" + +static VKHTTPClient *__clientInstance = nil; +static NSString const *VK_API_URI = @"api.vk.com/method/"; +static NSString *const kVKMultipartFormBoundary = @"Boundary(======VK_SDK======)"; + +@interface VKHTTPClient () +@property(readwrite, nonatomic, strong) NSMutableDictionary *defaultHeaders; +@property(readwrite, nonatomic, strong) NSOperationQueue *operationQueue; +@end + +@implementation VKHTTPClient ++ (instancetype)getClient { + if (!__clientInstance) + __clientInstance = [[VKHTTPClient alloc] init]; + return __clientInstance; +} + +- (id)init { + self = [super init]; + if (!self) { + return nil; + } + + self.defaultHeaders = [NSMutableDictionary dictionary]; + + NSString *userAgent = nil; + + userAgent = [NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f; VK SDK %@; %@)", + [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *) kCFBundleExecutableKey] ?: + [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *) kCFBundleIdentifierKey], + (__bridge id) CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), kCFBundleVersionKey) ?: + [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *) kCFBundleVersionKey], + [[UIDevice currentDevice] model], + [[UIDevice currentDevice] systemVersion], + ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] ? [[UIScreen mainScreen] scale] : 1.0f), + VK_SDK_VERSION, + [[NSBundle mainBundle] bundleIdentifier]]; + + if (userAgent) { + if (![userAgent canBeConvertedToEncoding:NSASCIIStringEncoding]) { + NSMutableString *mutableUserAgent = [userAgent mutableCopy]; + CFStringTransform((__bridge CFMutableStringRef) (mutableUserAgent), NULL, kCFStringTransformToLatin, false); + userAgent = mutableUserAgent; + } + [self setDefaultHeader:@"User-Agent" value:userAgent]; + } + + self.operationQueue = [[NSOperationQueue alloc] init]; + [self.operationQueue setMaxConcurrentOperationCount:NSOperationQueueDefaultMaxConcurrentOperationCount]; + return self; +} + +- (NSString *)defaultValueForHeader:(NSString *)header { + return [self.defaultHeaders valueForKey:header]; +} + +- (void)setDefaultHeader:(NSString *)header + value:(NSString *)value { + [self.defaultHeaders setValue:value forKey:header]; +} + +- (NSMutableURLRequest *)requestWithMethod:(NSString *)method + path:(NSString *)path + parameters:(NSDictionary *)parameters + secure:(BOOL)secure { + NSParameterAssert(method); + + if (!path) { + path = @""; + } + NSURL *apiUrl = [NSURL URLWithString:[NSString stringWithFormat:@"http%@://%@", secure ? @"s" : @"", VK_API_URI]]; + NSURL *url = nil; + if ([path hasPrefix:@"http"]) + url = [NSURL URLWithString:path]; + else + url = [NSURL URLWithString:path relativeToURL:apiUrl]; + NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url]; + [request setHTTPMethod:method]; + [request setAllHTTPHeaderFields:self.defaultHeaders]; + + if (parameters) { + if ([method isEqualToString:@"GET"] || [method isEqualToString:@"HEAD"] || [method isEqualToString:@"DELETE"]) { + url = [NSURL URLWithString:[[url absoluteString] stringByAppendingFormat:[path rangeOfString:@"?"].location == NSNotFound ? @"?%@" : @"&%@", [VKUtil queryStringFromParams:parameters]]]; + [request setURL:url]; + } + else { + NSString *charset = (__bridge NSString *) CFStringConvertEncodingToIANACharSetName(CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding)); + [request setValue:[NSString stringWithFormat:@"application/x-www-form-urlencoded; charset=%@", charset] forHTTPHeaderField:@"Content-Type"]; + [request setHTTPBody:[[VKUtil queryStringFromParams:parameters] dataUsingEncoding:NSUTF8StringEncoding]]; + } + } + + return request; +} + +- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method + path:(NSString *)path + images:(NSArray *)images { + NSParameterAssert(method); + NSParameterAssert(![method isEqualToString:@"GET"] && ![method isEqualToString:@"HEAD"]); + + NSMutableURLRequest *request = [self requestWithMethod:method path:path parameters:nil secure:YES]; + NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", kVKMultipartFormBoundary]; + [request addValue:contentType forHTTPHeaderField:@"Content-Type"]; + + NSMutableData *postbody = [NSMutableData data]; + for (NSUInteger i = 0; i < images.count; i++) { + VKUploadImage *uploadImageObject = images[i]; + NSString *fileName = [NSString stringWithFormat:@"file%d", (int) (i + 1)]; + [postbody appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", kVKMultipartFormBoundary] dataUsingEncoding:NSUTF8StringEncoding]]; + [postbody appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"; filename=\"%@.%@\"\r\n", fileName, fileName, [uploadImageObject.parameters fileExtension]] dataUsingEncoding:NSUTF8StringEncoding]]; + [postbody appendData:[[NSString stringWithFormat:@"Content-Type: %@\r\n\r\n", [uploadImageObject.parameters mimeType]] dataUsingEncoding:NSUTF8StringEncoding]]; + [postbody appendData:uploadImageObject.imageData]; + } + [postbody appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n", kVKMultipartFormBoundary] dataUsingEncoding:NSUTF8StringEncoding]]; + [request setHTTPBody:postbody]; + return request; +} + +- (void)enqueueOperation:(NSOperation *)operation { + if (!operation) { + return; + } + [self.operationQueue addOperation:operation]; +} + +- (void)enqueueBatchOfHTTPRequestOperations:(NSArray *)operations + progressBlock:(void (^)(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations))progressBlock + completionBlock:(void (^)(NSArray *operations))completionBlock { + __block dispatch_group_t dispatchGroup = dispatch_group_create(); + NSBlockOperation *batchedOperation = [NSBlockOperation blockOperationWithBlock:^{ + dispatch_group_notify(dispatchGroup, dispatch_get_main_queue(), ^{ + if (completionBlock) { + completionBlock(operations); + } + }); +#if !OS_OBJECT_USE_OBJC + dispatch_release(dispatchGroup); +#endif + }]; + + for (NSOperation *operation in operations) { + void (^originalCompletionBlock)(void) = [operation.completionBlock copy]; + operation.completionBlock = ^{ + dispatch_queue_t queue = dispatch_get_main_queue(); + dispatch_group_async(dispatchGroup, queue, ^{ + if (originalCompletionBlock) { + originalCompletionBlock(); + } + + NSUInteger numberOfFinishedOperations = [[operations indexesOfObjectsPassingTest:^BOOL(id op, NSUInteger __unused idx, BOOL __unused *stop) { + return [op isFinished]; + }] count]; + + if (progressBlock) { + progressBlock(numberOfFinishedOperations, [operations count]); + } + + dispatch_group_leave(dispatchGroup); + }); + }; + + dispatch_group_enter(dispatchGroup); + [batchedOperation addDependency:operation]; + } + [self.operationQueue addOperations:operations waitUntilFinished:NO]; + [self.operationQueue addOperation:batchedOperation]; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + [aCoder encodeObject:self.defaultHeaders forKey:@"defaultHeaders"]; +} + +- (id)initWithCoder:(NSCoder *)aDecoder { + self = [self init]; + if (!self) { + return nil; + } + self.defaultHeaders = [aDecoder decodeObjectForKey:@"defaultHeaders"]; + return self; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKHTTPOperation.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKHTTPOperation.h new file mode 100644 index 0000000..bf20fbf --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKHTTPOperation.h @@ -0,0 +1,172 @@ +// +// VKHTTPOperation.h +// +// Based on AFNetworking library. +// https://github.com/AFNetworking/AFNetworking +// +// Copyright (c) 2014 VK.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 "VKOperation.h" + +extern NSString *const VKNetworkingOperationDidStart; + +@class VKRequest; + +/** +VK URL operation subclassing NSOperation. +Based on AFNetworking library ( https://github.com/AFNetworking/AFNetworking ) +*/ +@interface VKHTTPOperation : VKOperation +@property(nonatomic, strong) VKRequest *loadingRequest; + +/** +Creates new operation with prepared request. +@param request Prepared VK request to API +@return Initialized operation +*/ ++ (instancetype)operationWithRequest:(VKRequest *)request; + +///------------------------------- +/// @name Accessing Run Loop Modes +///------------------------------- + +/** +The run loop modes in which the operation will run on the network thread. By default, this is a single-member set containing `NSRunLoopCommonModes`. +*/ +@property(nonatomic, strong) NSSet *runLoopModes; + +///----------------------------------------- +/// @name Getting URL Connection Information +///----------------------------------------- + +/** +The vk request initialized that operation +*/ +@property(readonly, nonatomic, weak) VKRequest *vkRequest; +/** +The request used by the operation's connection. +*/ +@property(readonly, nonatomic, strong) NSURLRequest *request; + +/** +The error, if any, that occurred in the lifecycle of the request. +*/ +@property(readonly, nonatomic, strong) NSError *error; + +///---------------------------- +/// @name Getting Response Data +///---------------------------- + +/** +The data received during the request. +*/ +@property(readonly, nonatomic, strong) NSData *responseData; + +/** +The string representation of the response data. +*/ +@property(readonly, nonatomic, copy) NSString *responseString; + +/** +The json representation of the response data. +*/ +@property(readonly, nonatomic, copy) id responseJson; + +/** +The last HTTP response received by the operation's connection. +*/ +@property(readonly, nonatomic, strong) NSHTTPURLResponse *response; + +/** +The callback dispatch queue on success. If `NULL` (default), the main queue is used. +*/ +@property(nonatomic, assign) dispatch_queue_t successCallbackQueue; + +/** +The callback dispatch queue on failure. If `NULL` (default), the main queue is used. +*/ +@property(nonatomic, assign) dispatch_queue_t failureCallbackQueue; + +/** +Init this operation with URL request +@param urlRequest request to load +@return initialized operation +*/ +- (instancetype)initWithURLRequest:(NSURLRequest *)urlRequest; + +/** +Pauses the execution of the request operation. + +A paused operation returns `NO` for `-isReady`, `-isExecuting`, and `-isFinished`. As such, it will remain in an `NSOperationQueue` until it is either cancelled or resumed. Pausing a finished, cancelled, or paused operation has no effect. +*/ +- (void)pause; + +/** +Whether the request operation is currently paused. + +@return `YES` if the operation is currently paused, otherwise `NO`. +*/ +- (BOOL)isPaused; + +/** +Resumes the execution of the paused request operation. + +Pause/Resume behavior varies depending on the underlying implementation for the operation class. In its base implementation, resuming a paused requests restarts the original request. However, since HTTP defines a specification for how to request a specific content range, `AFHTTPRequestOperation` will resume downloading the request from where it left off, instead of restarting the original request. +*/ +- (void)resume; + +///---------------------------------------------- +/// @name Configuring Backgrounding Task Behavior +///---------------------------------------------- + +/** +Specifies that the operation should continue execution after the app has entered the background, and the expiration handler for that background task. + +@param handler A handler to be called shortly before the application’s remaining background time reaches 0. The handler is wrapped in a block that cancels the operation, and cleans up and marks the end of execution, unlike the `handler` parameter in `UIApplication -beginBackgroundTaskWithExpirationHandler:`, which expects this to be done in the handler itself. The handler is called synchronously on the main thread, thus blocking the application’s suspension momentarily while the application is notified. +*/ +- (void)setShouldExecuteAsBackgroundTaskWithExpirationHandler:(void (^)(void))handler; + +/** +Sets a callback to be called when an undetermined number of bytes have been uploaded to the server. + +@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 three arguments: 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)setUploadProgressBlock:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))block; + +/** +Sets a callback to be called when an undetermined number of bytes have been downloaded from the server. + +@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 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 main thread. +*/ +- (void)setDownloadProgressBlock:(void (^)(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead))block; + +/** +Sets the `completionBlock` property with a block that executes either the specified success or failure block, depending on the state of the request on completion. If `error` returns a value, which can be caused by an unacceptable status code or content type, then `failure` is executed. Otherwise, `success` is executed. + +This method should be overridden in subclasses in order to specify the response object passed into the success block. + +@param success The block to be executed on the completion of a successful request. This block has no return value and takes two arguments: the receiver operation and the object constructed from the response data of the request. +@param failure The block to be executed on the completion of an unsuccessful request. This block has no return value and takes two arguments: the receiver operation and the error that occurred during the request. +*/ +- (void)setCompletionBlockWithSuccess:(void (^)(VKHTTPOperation *operation, id responseObject))success + failure:(void (^)(VKHTTPOperation *operation, NSError *error))failure; +@end + diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKHTTPOperation.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKHTTPOperation.m new file mode 100644 index 0000000..aa9757d --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKHTTPOperation.m @@ -0,0 +1,601 @@ +// +// VKHTTPOperation.m +// +// Based on AFNetworking library. +// https://github.com/AFNetworking/AFNetworking +// +// Copyright (c) 2014 VK.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 "VKHTTPOperation.h" +#import "VKRequest.h" +#import "NSError+VKError.h" + +NSString *const VKNetworkingOperationFailingURLRequestErrorKey = @"VKNetworkingOperationFailingURLRequestErrorKey"; +NSString *const VKNetworkingOperationFailingURLResponseErrorKey = @"VKNetworkingOperationFailingURLResponseErrorKey"; +NSString *const VKNetworkingOperationDidStart = @"VKNetworkingOperationDidStart"; + +typedef void (^VKURLConnectionOperationProgressBlock)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected); + +@interface VKHTTPOperation () +@property(readwrite, nonatomic, assign, getter = isCancelled) BOOL wasCanceled; +@property(readwrite, nonatomic, strong) NSRecursiveLock *lock; +@property(readwrite, nonatomic, strong) NSURLConnection *connection; +@property(readwrite, nonatomic, strong) NSURLRequest *request; +@property(readwrite, nonatomic, strong) NSHTTPURLResponse *response; +@property(readwrite, nonatomic, strong) NSError *error; +@property(readwrite, nonatomic, strong) NSData *responseData; +@property(readwrite, nonatomic, copy) NSString *responseString; +@property(readwrite, nonatomic, copy) id responseJson; +@property(readwrite, nonatomic, assign) NSStringEncoding responseStringEncoding; +@property(readwrite, nonatomic, assign) long long totalBytesRead; +@property(readwrite, nonatomic, assign) UIBackgroundTaskIdentifier backgroundTaskIdentifier; +@property(readwrite, nonatomic, copy) VKURLConnectionOperationProgressBlock uploadProgress; +@property(readwrite, nonatomic, copy) VKURLConnectionOperationProgressBlock downloadProgress; +@property(readwrite, nonatomic, strong) NSError *HTTPError; +@property(nonatomic, strong) NSOutputStream *outputStream; +@property(readwrite, nonatomic, strong) NSError *JSONError; +@property(readwrite, nonatomic, weak) VKRequest *vkRequest; +@end + +static void VKGetMediaTypeAndSubtypeWithString(NSString *string, NSString **type, NSString **subtype) { + if (!string) { + return; + } + + NSScanner *scanner = [NSScanner scannerWithString:string]; + [scanner setCharactersToBeSkipped:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + [scanner scanUpToString:@"/" intoString:type]; + [scanner scanString:@"/" intoString:nil]; + [scanner scanUpToString:@";" intoString:subtype]; +} + +@implementation VKHTTPOperation +@dynamic lock; + ++ (instancetype)operationWithRequest:(VKRequest *)request { + NSURLRequest *urlRequest = [request getPreparedRequest]; + + if (!urlRequest) + return nil; + VKHTTPOperation *operation = [[[self class] alloc] initWithURLRequest:urlRequest]; + operation.vkRequest = request; + return operation; +} + ++ (void)networkRequestThreadEntryPoint:(id __unused)object { + @autoreleasepool { + [[NSThread currentThread] setName:@"VKSdkNetworking"]; + + NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; + [runLoop addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode]; + [runLoop run]; + } +} + ++ (NSThread *)networkRequestThread { + static NSThread *_networkRequestThread = nil; + static dispatch_once_t oncePredicate; + dispatch_once(&oncePredicate, ^{ + _networkRequestThread = [[NSThread alloc] initWithTarget:self selector:@selector(networkRequestThreadEntryPoint:) object:nil]; + [_networkRequestThread start]; + }); + + return _networkRequestThread; +} + +- (id)initWithURLRequest:(NSURLRequest *)urlRequest { + NSParameterAssert(urlRequest); + + self = [super init]; + if (!self) { + return nil; + } + + self.lock = [[NSRecursiveLock alloc] init]; + self.lock.name = @"com.vk.networking.operation.lock"; + + self.runLoopModes = [NSSet setWithObject:NSRunLoopCommonModes]; + + self.request = urlRequest; + + self.state = VKOperationReadyState; + + return self; +} + +- (void)dealloc { + if (_backgroundTaskIdentifier) { + [[UIApplication sharedApplication] endBackgroundTask:_backgroundTaskIdentifier]; + _backgroundTaskIdentifier = UIBackgroundTaskInvalid; + } + if (_successCallbackQueue) { +#if !OS_OBJECT_USE_OBJC + dispatch_release(_successCallbackQueue); +#endif + _successCallbackQueue = NULL; + } + + if (_failureCallbackQueue) { +#if !OS_OBJECT_USE_OBJC + dispatch_release(_failureCallbackQueue); +#endif + _failureCallbackQueue = NULL; + } +} + +//- (NSString *)description { +// return [NSString stringWithFormat:@"<%@: %p, state: %@, cancelled: %@ request: %@, response: %@>", NSStringFromClass([self class]), self, AFKeyPathFromOperationState(self.state), ([self isCancelled] ? @"YES" : @"NO"), self.request, self.response]; +//} +- (NSOutputStream *)outputStream { + if (!_outputStream) { + self.outputStream = [NSOutputStream outputStreamToMemory]; + } + + return _outputStream; +} + +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + +- (void)setShouldExecuteAsBackgroundTaskWithExpirationHandler:(void (^)(void))handler { + [self.lock lock]; + if (!self.backgroundTaskIdentifier) { + UIApplication *application = [UIApplication sharedApplication]; + __weak __typeof(&*self) weakSelf = self; + + self.backgroundTaskIdentifier = [application beginBackgroundTaskWithExpirationHandler:^{ + __strong __typeof(&*weakSelf) strongSelf = weakSelf; + + if (handler) { + handler(); + } + + if (strongSelf) { + [strongSelf cancel]; + + [application endBackgroundTask:strongSelf.backgroundTaskIdentifier]; + strongSelf.backgroundTaskIdentifier = UIBackgroundTaskInvalid; + } + }]; + } + [self.lock unlock]; +} + +#endif + +- (void)setUploadProgressBlock:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))block { + self.uploadProgress = block; +} + +- (void)setDownloadProgressBlock:(void (^)(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead))block { + self.downloadProgress = block; +} + +- (NSString *)responseString { + [self.lock lock]; + if (!_responseString && self.response && self.responseData) { + _responseString = [[NSString alloc] initWithData:self.responseData encoding:self.responseStringEncoding]; + if (!_responseString) { + VKError *vkError = [VKError errorWithCode:VK_RESPONSE_STRING_PARSING_ERROR]; + vkError.request = self.vkRequest; + + self.error = [NSError errorWithVkError:vkError]; + } + } + [self.lock unlock]; + + return _responseString; +} + +- (id)responseJson { + [self.lock lock]; + if (!_responseJson && [self.responseData length] > 0 && [self isFinished] && !self.JSONError) { + NSError *error = 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 + if (self.responseString && ![self.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 + NSData *data = [self.responseString dataUsingEncoding:NSUTF8StringEncoding]; + + if (data) { + self.responseJson = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error]; + } + else { + NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; + [userInfo setValue:@"Operation responseData failed decoding as a UTF-8 string" forKey:NSLocalizedDescriptionKey]; + [userInfo setValue:[NSString stringWithFormat:@"Could not decode string: %@", self.responseString] forKey:NSLocalizedFailureReasonErrorKey]; + error = [[NSError alloc] initWithDomain:VKSdkErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:userInfo]; + } + } + + self.JSONError = error; + } + [self.lock unlock]; + + return _responseJson; +} + +- (NSStringEncoding)responseStringEncoding { + // When no explicit charset parameter is provided by the sender, media subtypes of the "text" type are defined to have a default charset value of "ISO-8859-1" when received via HTTP. Data in character sets other than "ISO-8859-1" or its subsets MUST be labeled with an appropriate charset value. + // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.4.1 + if (self.response && !self.response.textEncodingName && self.responseData && [self.response respondsToSelector:@selector(allHeaderFields)]) { + NSString *type = nil; + VKGetMediaTypeAndSubtypeWithString([[self.response allHeaderFields] valueForKey:@"Content-Type"], &type, nil); + + if ([type isEqualToString:@"text"]) { + return NSISOLatin1StringEncoding; + } + } + + [self.lock lock]; + if (!_responseStringEncoding && self.response) { + NSStringEncoding stringEncoding = NSUTF8StringEncoding; + if (self.response.textEncodingName) { + CFStringEncoding IANAEncoding = CFStringConvertIANACharSetNameToEncoding((__bridge CFStringRef) self.response.textEncodingName); + if (IANAEncoding != kCFStringEncodingInvalidId) { + stringEncoding = CFStringConvertEncodingToNSStringEncoding(IANAEncoding); + } + } + + self.responseStringEncoding = stringEncoding; + } + [self.lock unlock]; + + return _responseStringEncoding; +} + +- (void)pause { + unsigned long long offset = 0; + if ([self.outputStream propertyForKey:NSStreamFileCurrentOffsetKey]) { + offset = [[self.outputStream propertyForKey:NSStreamFileCurrentOffsetKey] unsignedLongLongValue]; + } + else { + offset = [[self.outputStream propertyForKey:NSStreamDataWrittenToMemoryStreamKey] length]; + } + + NSMutableURLRequest *mutableURLRequest = [self.request mutableCopy]; + if ([self.response respondsToSelector:@selector(allHeaderFields)] && [[self.response allHeaderFields] valueForKey:@"ETag"]) { + [mutableURLRequest setValue:[[self.response allHeaderFields] valueForKey:@"ETag"] forHTTPHeaderField:@"If-Range"]; + } + [mutableURLRequest setValue:[NSString stringWithFormat:@"bytes=%llu-", offset] forHTTPHeaderField:@"Range"]; + self.request = mutableURLRequest; + + if ([self isPaused] || [self isFinished] || [self isCancelled]) { + return; + } + + [self.lock lock]; + + if ([self isExecuting]) { + [self.connection performSelector:@selector(cancel) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]]; + } + + self.state = VKOperationPausedState; + + [self.lock unlock]; +} + +- (BOOL)isPaused { + return self.state == VKOperationPausedState; +} + +- (void)resume { + if (![self isPaused]) { + return; + } + + [self.lock lock]; + self.state = VKOperationReadyState; + + [self start]; + [self.lock unlock]; +} + +#pragma mark - NSOperation + + +- (void)start { + [self.lock lock]; + if ([self isReady]) { + self.state = VKOperationExecutingState; + + [self performSelector:@selector(operationDidStart) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]]; + } + [self.lock unlock]; +} + +- (void)operationDidStart { + [self.lock lock]; + [[NSNotificationCenter defaultCenter] postNotificationName:VKNetworkingOperationDidStart object:self]; + if (![self isCancelled]) { + self.connection = [[NSURLConnection alloc] initWithRequest:self.request delegate:self startImmediately:NO]; + + NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; + for (NSString *runLoopMode in self.runLoopModes) { + [self.connection scheduleInRunLoop:runLoop forMode:runLoopMode]; + } + + [self.connection start]; + } + [self.lock unlock]; + + if ([self isCancelled]) { + NSDictionary *userInfo = nil; + if ([self.request URL]) { + userInfo = [NSDictionary dictionaryWithObject:[self.request URL] forKey:NSURLErrorFailingURLErrorKey]; + } + self.error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:userInfo]; + + [self finish]; + } +} + +- (void)finish { + self.state = VKOperationFinishedState; +} + +- (void)cancel { + [self.lock lock]; + if (![self isFinished] && ![self isCancelled]) { + [super cancel]; + + // Cancel the connection on the thread it runs on to prevent race conditions + [self performSelector:@selector(cancelConnection) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]]; + } + [self.lock unlock]; +} + +- (void)cancelConnection { + NSDictionary *userInfo = nil; + if ([self.request URL]) { + userInfo = [NSDictionary dictionaryWithObject:[self.request URL] forKey:NSURLErrorFailingURLErrorKey]; + } + NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:userInfo]; + + if (![self isFinished] && self.connection) { + [self.connection cancel]; + [self performSelector:@selector(connection:didFailWithError:) withObject:self.connection withObject:error]; + } +} + +#pragma mark - NSURLConnectionDelegate + +- (void) connection:(NSURLConnection __unused *)connection + didSendBodyData:(NSInteger)bytesWritten + totalBytesWritten:(NSInteger)totalBytesWritten +totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite { + if (self.uploadProgress) { + dispatch_async(dispatch_get_main_queue(), ^{ + self.uploadProgress((NSUInteger) bytesWritten, totalBytesWritten, totalBytesExpectedToWrite); + }); + } +} + +- (void)connection:(NSURLConnection __unused *)connection didReceiveResponse:(NSURLResponse *)response { + self.response = (NSHTTPURLResponse *) response; + + [self.outputStream open]; +} + +- (void)connection:(NSURLConnection __unused *)connection + didReceiveData:(NSData *)data { + NSUInteger length = [data length]; + while (YES) { + NSUInteger totalNumberOfBytesWritten = 0; + if ([self.outputStream hasSpaceAvailable]) { + const uint8_t *dataBuffer = (uint8_t *) [data bytes]; + + NSInteger numberOfBytesWritten = 0; + while (totalNumberOfBytesWritten < length) { + numberOfBytesWritten = [self.outputStream write:&dataBuffer[0] maxLength:length]; + if (numberOfBytesWritten == -1) { + [self.connection cancel]; + [self performSelector:@selector(connection:didFailWithError:) withObject:self.connection withObject:self.outputStream.streamError]; + return; + } + else { + totalNumberOfBytesWritten += numberOfBytesWritten; + } + } + + break; + } + } + + dispatch_async(dispatch_get_main_queue(), ^{ + self.totalBytesRead += length; + + if (self.downloadProgress) { + self.downloadProgress(length, self.totalBytesRead, self.response.expectedContentLength); + } + }); +} + +- (void)connectionDidFinishLoading:(NSURLConnection __unused *)connection { + self.responseData = [self.outputStream propertyForKey:NSStreamDataWrittenToMemoryStreamKey]; + + [self.outputStream close]; + + [self finish]; + + self.connection = nil; +} + +- (void)connection:(NSURLConnection __unused *)connection + didFailWithError:(NSError *)error { + self.error = error; + + [self.outputStream close]; + + [self finish]; + + self.connection = nil; +} + +#pragma mark - NSCoding + +- (id)initWithCoder:(NSCoder *)aDecoder { + NSURLRequest *request = [aDecoder decodeObjectForKey:@"request"]; + + self = [self initWithURLRequest:request]; + if (!self) { + return nil; + } + + self.state = (VKOperationState) [aDecoder decodeIntegerForKey:@"state"]; + self.wasCanceled = [aDecoder decodeBoolForKey:@"isCancelled"]; + self.response = [aDecoder decodeObjectForKey:@"response"]; + self.error = [aDecoder decodeObjectForKey:@"error"]; + self.responseData = [aDecoder decodeObjectForKey:@"responseData"]; + self.totalBytesRead = [[aDecoder decodeObjectForKey:@"totalBytesRead"] longLongValue]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + [self pause]; + + [aCoder encodeObject:self.request forKey:@"request"]; + + switch (self.state) { + case VKOperationExecutingState: + case VKOperationPausedState: + [aCoder encodeInteger:VKOperationReadyState forKey:@"state"]; + break; + + default: + [aCoder encodeInteger:self.state forKey:@"state"]; + break; + } + + [aCoder encodeBool:[self isCancelled] forKey:@"isCancelled"]; + [aCoder encodeObject:self.response forKey:@"response"]; + [aCoder encodeObject:self.error forKey:@"error"]; + [aCoder encodeObject:self.responseData forKey:@"responseData"]; + [aCoder encodeObject:[NSNumber numberWithLongLong:self.totalBytesRead] forKey:@"totalBytesRead"]; +} + +#pragma mark - NSCopying + +- (id)copyWithZone:(NSZone *)zone { + VKHTTPOperation *operation = [(VKHTTPOperation *) [[self class] allocWithZone:zone] initWithURLRequest:self.request]; + + operation.uploadProgress = self.uploadProgress; + operation.downloadProgress = self.downloadProgress; + + return operation; +} + +- (BOOL)hasAcceptableStatusCode { + if (!self.response) { + return NO; + } + + NSUInteger statusCode = ([self.response isKindOfClass:[NSHTTPURLResponse class]]) ? (NSUInteger) [self.response statusCode] : 200; + return statusCode == 200; +} + +- (NSError *)error { + [self.lock lock]; + if (!self.HTTPError && self.response) { + if (![self hasAcceptableStatusCode]) { + NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; + [userInfo setValue:self.responseString forKey:NSLocalizedRecoverySuggestionErrorKey]; + [userInfo setValue:[self.request URL] forKey:NSURLErrorFailingURLErrorKey]; + [userInfo setValue:self.request forKey:VKNetworkingOperationFailingURLRequestErrorKey]; + [userInfo setValue:self.response forKey:VKNetworkingOperationFailingURLResponseErrorKey]; + + if (![self hasAcceptableStatusCode]) { + NSUInteger statusCode = ([self.response isKindOfClass:[NSHTTPURLResponse class]]) ? (NSUInteger) [self.response statusCode] : 200; + [userInfo setValue:[NSString stringWithFormat:NSLocalizedStringFromTable(@"Expected status code 200, got %d", @"AFNetworking", nil), statusCode] forKey:NSLocalizedDescriptionKey]; + self.HTTPError = [[NSError alloc] initWithDomain:VKSdkErrorDomain code:NSURLErrorBadServerResponse userInfo:userInfo]; + } + } + } + [self.lock unlock]; + + if (self.HTTPError) { + return self.HTTPError; + } + return _error; +} + +- (void)setSuccessCallbackQueue:(dispatch_queue_t)successCallbackQueue { + if (successCallbackQueue != _successCallbackQueue) { + if (_successCallbackQueue) { +#if !OS_OBJECT_USE_OBJC + dispatch_release(_successCallbackQueue); +#endif + _successCallbackQueue = NULL; + } + + if (successCallbackQueue) { +#if !OS_OBJECT_USE_OBJC + dispatch_retain(successCallbackQueue); +#endif + _successCallbackQueue = successCallbackQueue; + } + } +} + +- (void)setFailureCallbackQueue:(dispatch_queue_t)failureCallbackQueue { + if (failureCallbackQueue != _failureCallbackQueue) { + if (_failureCallbackQueue) { +#if !OS_OBJECT_USE_OBJC + dispatch_release(_failureCallbackQueue); +#endif + _failureCallbackQueue = NULL; + } + + if (failureCallbackQueue) { +#if !OS_OBJECT_USE_OBJC + dispatch_retain(failureCallbackQueue); +#endif + _failureCallbackQueue = failureCallbackQueue; + } + } +} + +- (void)setCompletionBlockWithSuccess:(void (^)(VKHTTPOperation *operation, id responseObject))success + failure:(void (^)(VKHTTPOperation *operation, NSError *error))failure { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-retain-cycles" +#pragma clang diagnostic ignored "-Wgnu" + self.completionBlock = ^{ + if (self.error) { + if (failure) { + dispatch_async(self.failureCallbackQueue ?: dispatch_get_main_queue(), ^{ + failure(self, self.error); + }); + } + } + else { + if (success) { + dispatch_async(self.successCallbackQueue ?: dispatch_get_main_queue(), ^{ + success(self, self.responseData); + }); + } + } + }; +#pragma clang diagnostic pop +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKJSONOperation.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKJSONOperation.h new file mode 100644 index 0000000..8228d48 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKJSONOperation.h @@ -0,0 +1,13 @@ +// +// VKJSONOperation.h +// VKSdk +// +// Created by Roman Truba on 26.06.15. +// Copyright (c) 2015 VK. All rights reserved. +// + +#import "VKHTTPOperation.h" + +@interface VKJSONOperation : VKHTTPOperation + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKJSONOperation.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKJSONOperation.m new file mode 100644 index 0000000..2126d9f --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKJSONOperation.m @@ -0,0 +1,36 @@ +// +// VKJSONOperation.m +// VKSdk +// +// Created by Roman Truba on 26.06.15. +// Copyright (c) 2015 VK. All rights reserved. +// + +#import "VKJSONOperation.h" + +@implementation VKJSONOperation +- (void)setCompletionBlockWithSuccess:(void (^)(VKHTTPOperation *operation, id responseObject))success + failure:(void (^)(VKHTTPOperation *operation, NSError *error))failure { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-retain-cycles" +#pragma clang diagnostic ignored "-Wgnu" + self.completionBlock = ^{ + id response = [self responseJson]; + if (self.error) { + if (failure) { + dispatch_async(self.failureCallbackQueue ?: dispatch_get_main_queue(), ^{ + failure(self, self.error); + }); + } + } + else { + if (success) { + dispatch_async(self.successCallbackQueue ?: dispatch_get_main_queue(), ^{ + success(self, response); + }); + } + } + }; +#pragma clang diagnostic pop +} +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKObject.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKObject.h new file mode 100644 index 0000000..ec2fe82 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKObject.h @@ -0,0 +1,28 @@ +// +// VKObject.h +// +// Copyright (c) 2014 VK.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 + +@interface VKObject : NSObject + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKObject.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKObject.m new file mode 100644 index 0000000..4b04776 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKObject.m @@ -0,0 +1,27 @@ +// +// VKObject.m +// +// Copyright (c) 2014 VK.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 "VKObject.h" + +@implementation VKObject + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKOperation.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKOperation.h new file mode 100644 index 0000000..9dfacdc --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKOperation.h @@ -0,0 +1,42 @@ +// +// VKOperation.h +// +// Copyright (c) 2014 VK.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 + +typedef enum { + VKOperationPausedState = -1, + VKOperationReadyState = 1, + VKOperationExecutingState = 2, + VKOperationFinishedState = 3, +} VKOperationState; + +/** +Basic class for operations +*/ +@interface VKOperation : NSOperation +/// This operation state. Value from VKOperationState enum +@property(readwrite, nonatomic, assign) VKOperationState state; +/// Operation working lock +@property(readwrite, nonatomic, strong) NSRecursiveLock *lock; +/// Sets dispatch queue for returning result +@property(nonatomic, assign) dispatch_queue_t responseQueue; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKOperation.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKOperation.m new file mode 100644 index 0000000..210ae29 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKOperation.m @@ -0,0 +1,149 @@ +// +// VKOperation.m +// +// Copyright (c) 2014 VK.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 "VKOperation.h" + +static inline NSString *VKKeyPathFromOperationState(VKOperationState state) { + switch (state) { + case VKOperationReadyState: + return @"isReady"; + + case VKOperationExecutingState: + return @"isExecuting"; + + case VKOperationFinishedState: + return @"isFinished"; + + case VKOperationPausedState: + return @"isPaused"; + + default: + return @"state"; + } +} + +static inline BOOL VKStateTransitionIsValid(VKOperationState fromState, VKOperationState toState, BOOL isCancelled) { + switch (fromState) { + case VKOperationReadyState: + switch (toState) { + case VKOperationPausedState: + case VKOperationExecutingState: + return YES; + + case VKOperationFinishedState: + return isCancelled; + + default: + return NO; + } + + case VKOperationExecutingState: + switch (toState) { + case VKOperationPausedState: + case VKOperationFinishedState: + return YES; + + default: + return NO; + } + + case VKOperationFinishedState: + return NO; + + case VKOperationPausedState: + return toState == VKOperationReadyState; + + default: + return YES; + } +} + +@interface VKOperation () + +@property(readwrite, nonatomic, assign, getter = isCancelled) BOOL wasCancelled; +@end + +@implementation VKOperation +- (id)init { + self = [super init]; + self.state = VKOperationReadyState; + return self; +} + +- (void)setState:(VKOperationState)state { + if (!VKStateTransitionIsValid(self.state, state, [self isCancelled])) { + return; + } + + [self.lock lock]; + NSString *oldStateKey = VKKeyPathFromOperationState(self.state); + NSString *newStateKey = VKKeyPathFromOperationState(state); + + [self willChangeValueForKey:newStateKey]; + [self willChangeValueForKey:oldStateKey]; + _state = state; + [self didChangeValueForKey:oldStateKey]; + [self didChangeValueForKey:newStateKey]; + [self.lock unlock]; +} + +- (BOOL)isReady { + return self.state == VKOperationReadyState && [super isReady]; +} + +- (BOOL)isExecuting { + return self.state == VKOperationExecutingState; +} + +- (BOOL)isFinished { + return self.state == VKOperationFinishedState; +} + +- (BOOL)isConcurrent { + return YES; +} + +- (void)cancel { + [self willChangeValueForKey:@"isCancelled"]; + _wasCancelled = YES; + [super cancel]; + [self didChangeValueForKey:@"isCancelled"]; +} + +- (void)setCompletionBlock:(void (^)(void))block { + [self.lock lock]; + if (!block) { + [super setCompletionBlock:nil]; + } + else { + __weak __typeof(&*self) weakSelf = self; + + [super setCompletionBlock:^{ + __strong __typeof(&*weakSelf) strongSelf = weakSelf; + + block(); + [strongSelf setCompletionBlock:nil]; + }]; + } + [self.lock unlock]; +} +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKRequest.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKRequest.h new file mode 100644 index 0000000..fb71350 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKRequest.h @@ -0,0 +1,205 @@ +// +// VKRequest.h +// +// Copyright (c) 2014 VK.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 "VKResponse.h" +#import "VKApiConst.h" +#import "VKObject.h" + + +/** +Creates and debug timings for VKRequest +*/ +@interface VKRequestTiming : VKObject +/// Date of request start +@property(nonatomic, strong) NSDate *startTime; +/// Date of request finished (after all operations) +@property(nonatomic, strong) NSDate *finishTime; +/// Interval of networking load time +@property(nonatomic, assign) NSTimeInterval loadTime; +/// Interval of model parsing time +@property(nonatomic, assign) NSTimeInterval parseTime; +/// Total time, as difference (finishTime - startTime) +@property(nonatomic, readonly) NSTimeInterval totalTime; +@end + +/** +Class for execution API-requests +*/ +@interface VKRequest : VKObject +/// Specify progress for uploading or downloading. Useless for text requests (because gzip encoding bytesTotal will always return -1) + +@property(nonatomic, copy) void (^progressBlock)(VKProgressType progressType, long long bytesLoaded, long long bytesTotal); +/// Specify completion block for request +@property(nonatomic, copy) void (^completeBlock)(VKResponse *response); +/// Specity error (HTTP or API) block for request. +@property(nonatomic, copy) void (^errorBlock)(NSError *error); +/// Specify attempts for request loading if caused HTTP-error. 0 for infinite +@property(nonatomic, assign) int attempts; +/// Use HTTPS requests (by default is YES). If http-request is impossible (user denied no https access), SDK will load https version +@property(nonatomic, assign) BOOL secure; +/// Sets current system language as default for API data +@property(nonatomic, assign) BOOL useSystemLanguage; +/// Set to NO if you don't need automatic model parsing +@property(nonatomic, assign) BOOL parseModel; +/// Set to YES if you need info about request timing +@property(nonatomic, assign) BOOL debugTiming; +/// Timeout for this request +@property(nonatomic, assign) NSInteger requestTimeout; +/// Sets dispatch queue for returning result +@property(nonatomic, assign) dispatch_queue_t responseQueue; +/// Set to YES if you need to freeze current thread for response +@property(nonatomic, assign) BOOL waitUntilDone; +/// Returns method for current request, e.g. users.get +@property(nonatomic, readonly) NSString *methodName; +/// Returns HTTP-method for current request +@property(nonatomic, readonly) NSString *httpMethod; +/// Returns list of method parameters (without common parameters) +@property(nonatomic, readonly) NSDictionary *methodParameters; +/// Returns http operation that can be enqueued +@property(nonatomic, readonly) NSOperation *executionOperation; +/// Returns info about request timings +@property(nonatomic, readonly) VKRequestTiming *requestTiming; +/// Return YES if current request was started +@property(nonatomic, readonly) BOOL isExecuting; +/// Return YES if current request was started +@property(nonatomic, copy) NSArray *preventThisErrorsHandling; + +///------------------------------- +/// @name Preparing requests +///------------------------------- +/** + Creates new request with parameters. See documentation for methods here https://vk.com/dev/methods + @param method API-method name, e.g. audio.get + @param parameters method parameters + @param httpMethod HTTP method for execution, e.g. GET, POST + @return Complete request object for execute or configure method + @deprecated Use requestWithMethod:andParameters: instead +*/ ++ (instancetype)requestWithMethod:(NSString *)method + andParameters:(NSDictionary *)parameters + andHttpMethod:(NSString *)httpMethod __deprecated; + +/** + Creates new request with parameters. See documentation for methods here https://vk.com/dev/methods + @param method API-method name, e.g. audio.get + @param parameters method parameters + @return Complete request object for execute or configure method +*/ ++ (instancetype)requestWithMethod:(NSString *)method + andParameters:(NSDictionary *)parameters; + +/** + Creates new request with parameters. See documentation for methods here https://vk.com/dev/methods + @param method API-method name, e.g. audio.get + @param parameters method parameters + @param httpMethod HTTP method for execution, e.g. GET, POST + @param modelClass class for automatic parse + @return Complete request object for execute or configure method + @deprecated Use requestWithMethod:andParameters:modelClass: instead +*/ ++ (instancetype)requestWithMethod:(NSString *)method + andParameters:(NSDictionary *)parameters + andHttpMethod:(NSString *)httpMethod + classOfModel:(Class)modelClass __deprecated; + +/** +Creates new request with parameters. See documentation for methods here https://vk.com/dev/methods +@param method API-method name, e.g. audio.get +@param parameters method parameters +@param modelClass class for automatic parse +@return Complete request object for execute or configure method +*/ ++ (instancetype)requestWithMethod:(NSString *)method + andParameters:(NSDictionary *)parameters + modelClass:(Class)modelClass; + +/** +Creates new request for upload image to url +@param url url for upload, which was received from special methods +@param photoObjects VKPhoto object describes photos +@return Complete request object for execute +*/ ++ (instancetype)photoRequestWithPostUrl:(NSString *)url + withPhotos:(NSArray *)photoObjects; + +/** +Prepares NSURLRequest and returns prepared url request for current vkrequest +@return Prepared request used for loading +*/ +- (NSURLRequest *)getPreparedRequest; + +///------------------------------- +/// @name Execution +///------------------------------- +/** +Executes that request, and returns result to blocks +@param completeBlock called if there were no HTTP or API errors, returns execution result. +@param errorBlock called immediately if there was API error, or after attempts tries if there was an HTTP error +*/ +- (void)executeWithResultBlock:(void (^)(VKResponse *response))completeBlock + errorBlock:(void (^)(NSError *error))errorBlock; + +/** +Register current request for execute after passed request, if passed request is successful. If it's not, errorBlock will be called. +@param request after which request must be called that request +@param completeBlock called if there were no HTTP or API errors, returns execution result. +@param errorBlock called immediately if there was API error, or after attempts tries if there was an HTTP error +*/ +- (void)executeAfter:(VKRequest *)request + withResultBlock:(void (^)(VKResponse *response))completeBlock + errorBlock:(void (^)(NSError *error))errorBlock; + +/** +Starts loading of prepared request. You can use it instead of executeWithResultBlock +*/ +- (void)start; + +/** + Creates loading operation for this request + */ +- (NSOperation *)createExecutionOperation; + +/** +Repeats this request with initial parameters and blocks. +Used attempts will be set to 0. +*/ +- (void)repeat; + +/** +Cancel current request. Result will be not passed. errorBlock will be called with error code +*/ +- (void)cancel; + +///------------------------------- +/// @name Operating with parameters +///------------------------------- +/** +Adds additional parameters to that request +@param extraParameters parameters supposed to be added +*/ +- (void)addExtraParameters:(NSDictionary *)extraParameters; + +/// Specify language for API request +- (void)setPreferredLang:(NSString *)lang; + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKRequest.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKRequest.m new file mode 100644 index 0000000..b16b4dc --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKRequest.m @@ -0,0 +1,561 @@ +// +// VKRequest.m +// +// Copyright (c) 2014 VK.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 "VKSdk.h" +#import "OrderedDictionary.h" +#import "VKAuthorizeController.h" +#import "VKHTTPClient.h" +#import "VKJSONOperation.h" +#import "VKRequestsScheduler.h" + +#define SUPPORTED_LANGS_ARRAY @[@"ru", @"en", @"uk", @"es", @"fi", @"de", @"it"] + +void vksdk_dispatch_on_main_queue_now(void(^block)(void)) { + if (!block) { + return; + } + if ([NSThread isMainThread]) { + block(); + } else { + dispatch_sync(dispatch_get_main_queue(), block); + } +} + +@interface VKRequestTiming () { + NSDate *_parseStartTime; +} +@end + +@implementation VKRequestTiming + +- (NSString *)description { + return [NSString stringWithFormat:@"", + self, _loadTime, _parseTime, self.totalTime]; +} + +- (void)started { + _startTime = [NSDate new]; +} + +- (void)loaded { + _loadTime = [[NSDate new] timeIntervalSinceDate:_startTime]; +} + +- (void)parseStarted { + _parseStartTime = [NSDate new]; +} + +- (void)parseFinished { + _parseTime = [[NSDate new] timeIntervalSinceDate:_parseStartTime]; +} + +- (void)finished { + _finishTime = [NSDate new]; +} + +- (NSTimeInterval)totalTime { + return [_finishTime timeIntervalSinceDate:_startTime]; +} +@end + +@interface VKRequest () { + /// Semaphore for blocking current thread + dispatch_semaphore_t _waitUntilDoneSemaphore; + CGFloat _waitMultiplier; +} +@property(nonatomic, readwrite, strong) VKRequestTiming *requestTiming; +/// Selected method name +@property(nonatomic, strong) NSString *methodName; +/// HTTP method for loading +@property(nonatomic, strong) NSString *httpMethod; +/// Passed parameters for method +@property(nonatomic, strong) NSDictionary *methodParameters; +/// Method parametes with common parameters +@property(nonatomic, strong) OrderedDictionary *preparedParameters; +/// Url for uploading files +@property(nonatomic, strong) NSString *uploadUrl; +/// Requests that should be called after current request. +@property(nonatomic, strong) NSMutableArray *postRequestsQueue; +/// Class for model parsing +@property(nonatomic, strong) Class modelClass; +/// Paths to photos +@property(nonatomic, strong) NSArray *photoObjects; +/// How much times request was loaded +@property(readwrite, assign) int attemptsUsed; +/// This request response +@property(nonatomic, strong) VKResponse *response; +/// This request error +@property(nonatomic, strong) NSError *error; +/// Language specified by user +@property(nonatomic, copy) NSString *requestLang; +/// Returns http operation that can be enqueued +@property(nonatomic, readwrite, strong) NSOperation *executionOperation; + +@property(nonatomic, readwrite, strong) VKAccessToken *specialToken; + +@end + +@implementation VKRequest + + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + self.responseQueue = nil; +} + ++ (dispatch_queue_t)processingQueue { + return dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0); +} + +#pragma mark Init + ++ (instancetype)requestWithMethod:(NSString *)method andParameters:(NSDictionary *)parameters andHttpMethod:(NSString *)httpMethod { + return [self requestWithMethod:method andParameters:parameters]; +} + ++ (instancetype)requestWithMethod:(NSString *)method + andParameters:(NSDictionary *)parameters { + return [self requestWithMethod:method andParameters:parameters modelClass:nil]; +} + ++ (instancetype)requestWithMethod:(NSString *)method andParameters:(NSDictionary *)parameters andHttpMethod:(NSString *)httpMethod classOfModel:(Class)modelClass { + return [self requestWithMethod:method andParameters:parameters modelClass:modelClass]; +} + ++ (instancetype)requestWithMethod:(NSString *)method andParameters:(NSDictionary *)parameters modelClass:(Class)modelClass { + VKRequest *newRequest = [self new]; + //Common parameters + newRequest.parseModel = modelClass != nil; + newRequest.requestTimeout = 25; + + newRequest.methodName = method; + newRequest.methodParameters = parameters; + newRequest.httpMethod = @"POST"; + newRequest.modelClass = modelClass; + return newRequest; +} + ++ (instancetype)photoRequestWithPostUrl:(NSString *)url withPhotos:(NSArray *)photoObjects; { + VKRequest *newRequest = [self new]; + newRequest.attempts = 10; + newRequest.httpMethod = @"POST"; + newRequest.uploadUrl = url; + newRequest.photoObjects = photoObjects; + return newRequest; +} + +- (id)init { + if (self = [super init]) { + self.attemptsUsed = 0; + //If system language is not supported, we use english + self.requestLang = @"en"; + //By default there is 1 attempt for loading. + self.attempts = 1; + //By default we use system language. + self.useSystemLanguage = YES; + self.secure = YES; + + _waitMultiplier = 1.f; + } + return self; +} + +- (NSString *)debugDescription { + return [NSString stringWithFormat:@"", self, self.methodName, self.httpMethod]; +} + +#pragma mark Execution + +- (void)executeWithResultBlock:(void (^)(VKResponse *))completeBlock + errorBlock:(void (^)(NSError *))errorBlock { + self.completeBlock = completeBlock; + self.errorBlock = errorBlock; + + if (!self.waitUntilDone) { + [[VKRequestsScheduler instance] scheduleRequest:self]; + } else { + [self start]; + } +} + +- (void)executeAfter:(VKRequest *)request + withResultBlock:(void (^)(VKResponse *response))completeBlock + errorBlock:(void (^)(NSError *error))errorBlock { + self.completeBlock = completeBlock; + self.errorBlock = errorBlock; + [request addPostRequest:self]; +} + +- (void)addPostRequest:(VKRequest *)postRequest { + if (!_postRequestsQueue) + _postRequestsQueue = [NSMutableArray new]; + [_postRequestsQueue addObject:postRequest]; +} + +- (NSURLRequest *)getPreparedRequest { + //Add common parameters to parameters list + if (!_preparedParameters && !_uploadUrl) { + _preparedParameters = [[OrderedDictionary alloc] initWithCapacity:self.methodParameters.count * 2]; + for (NSString *key in self.methodParameters) { + id value = self.methodParameters[key]; + if ([value isKindOfClass:NSArray.class]) { + value = [value componentsJoinedByString:@","]; + } + [_preparedParameters setObject:value forKey:key]; + } + VKAccessToken *token = [VKSdk accessToken] ?: self.specialToken; + if (token != nil) { + if (token.accessToken != nil) { + [_preparedParameters setObject:token.accessToken forKey:VK_API_ACCESS_TOKEN]; + } + if (!(self.secure || token.secret) || token.httpsRequired) + self.secure = YES; + } + if (self.specialToken) { + self.secure = YES; + } + + //Set actual version of API + [_preparedParameters setObject:[VKSdk instance].apiVersion forKey:@"v"]; + //Set preferred language for request + [_preparedParameters setObject:[self language] forKey:VK_API_LANG]; + //Set current access token from SDK object + + if (self.secure) { + //If request is secure, we need all urls as https + [_preparedParameters setObject:@"1" forKey:@"https"]; + } + if (token && token.secret) { + //If it not, generate signature of request + NSString *sig = [self generateSig:_preparedParameters token:token]; + [_preparedParameters setObject:sig forKey:VK_API_SIG]; + } + //From that moment you cannot modify parameters. + //Specially for http loading + } + + NSMutableURLRequest *request = nil; + if (!_uploadUrl) { + request = [[VKHTTPClient getClient] requestWithMethod:self.httpMethod path:self.methodName parameters:_preparedParameters secure:self.secure]; + } + else { + request = [[VKHTTPClient getClient] multipartFormRequestWithMethod:@"POST" path:_uploadUrl images:_photoObjects]; + } + [request setTimeoutInterval:self.requestTimeout]; + [request setValue:_preparedParameters[VK_API_LANG] forHTTPHeaderField:@"Accept-Language"]; + return request; +} + +- (NSOperation *)createExecutionOperation { + VKJSONOperation *operation = [VKJSONOperation operationWithRequest:self]; + if (!operation) + return nil; + if (_debugTiming) { + _requestTiming = [VKRequestTiming new]; + } + + [operation setCompletionBlockWithSuccess:^(VKHTTPOperation *completedOperation, id JSON) { + [_requestTiming loaded]; + if (_executionOperation.isCancelled) { + return; + } + if ([JSON objectForKey:@"error"]) { + VKError *error = [VKError errorWithJson:[JSON objectForKey:@"error"]]; + if ([self processCommonError:error]) { + return; + } + [self provideError:[NSError errorWithVkError:error]]; + return; + } + [self provideResponse:JSON responseString:completedOperation.responseString]; + } failure:^(VKHTTPOperation *completedOperation, NSError *error) { + [_requestTiming loaded]; + if (_executionOperation.isCancelled) { + return; + } + if (completedOperation.response.statusCode == 200) { + [self provideResponse:completedOperation.responseJson responseString:completedOperation.responseString]; + return; + } + if (self.attempts == 0 || ++self.attemptsUsed < self.attempts) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (300 * NSEC_PER_MSEC)), self.responseQueue, + ^(void) { + [self executeWithResultBlock:_completeBlock errorBlock:_errorBlock]; + }); + return; + } + + VKError *vkErr = [VKError errorWithCode:completedOperation.response ? completedOperation.response.statusCode : error.code]; + [self provideError:[error copyWithVkError:vkErr]]; + [_requestTiming finished]; + + }]; + operation.successCallbackQueue = operation.failureCallbackQueue = [VKRequest processingQueue]; + [self setupProgress:operation]; + return operation; +} + +- (void)start { + self.response = nil; + self.error = nil; + + self.executionOperation = [self createExecutionOperation]; + if (_executionOperation == nil) + return; + + if (self.debugTiming) { + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(operationDidStart:) name:VKNetworkingOperationDidStart object:nil]; + } + if (!self.waitUntilDone) { + [[VKHTTPClient getClient] enqueueOperation:_executionOperation]; + } else { + VKHTTPOperation *op = (VKHTTPOperation *) _executionOperation; + op.successCallbackQueue = op.failureCallbackQueue = [VKRequest processingQueue]; + [[VKHTTPClient getClient] enqueueOperation:_executionOperation]; + if (!_waitUntilDoneSemaphore) { + _waitUntilDoneSemaphore = dispatch_semaphore_create(0); + dispatch_semaphore_wait(_waitUntilDoneSemaphore, DISPATCH_TIME_FOREVER); + if (self.error || self.response) { + [self finishRequest]; + } + } + } +} + +- (void)operationDidStart:(NSNotification *)notification { + if (notification.object == _executionOperation) { + [self.requestTiming started]; + } +} + +- (void)provideResponse:(id)JSON responseString:(NSString *)response { + VKResponse *vkResp = [VKResponse new]; + vkResp.responseString = response; + vkResp.request = self; + if (JSON[@"response"]) { + vkResp.json = JSON[@"response"]; + + if (self.parseModel && _modelClass) { + [_requestTiming parseStarted]; + id object = [_modelClass alloc]; + if ([object respondsToSelector:@selector(initWithDictionary:)]) { + vkResp.parsedModel = [object initWithDictionary:JSON]; + } + [_requestTiming parseFinished]; + } + } + else { + vkResp.json = JSON; + } + + for (VKRequest *postRequest in _postRequestsQueue) { + [[VKRequestsScheduler instance] scheduleRequest:postRequest]; + } + [_requestTiming finished]; + self.response = vkResp; + if (_executionOperation.isCancelled) { + return; + } + if (self.waitUntilDone) { + dispatch_semaphore_signal(_waitUntilDoneSemaphore); + } else { + [self finishRequest]; + } +} + +- (void)provideError:(NSError *)error { + error.vkError.request = self; + self.error = error; + if (self.waitUntilDone) { + dispatch_semaphore_signal(_waitUntilDoneSemaphore); + } + else { + [self finishRequest]; + } +} + +- (void)finishRequest { + void (^block)(void) = NULL; + if (self.error) { + block = ^{ + if (self.errorBlock) { + self.errorBlock(self.error); + } + for (VKRequest *postRequest in _postRequestsQueue) { + if (postRequest.errorBlock) { + postRequest.errorBlock(self.error); + } + } + }; + } else { + block = ^{ + if (self.completeBlock) { + self.completeBlock(self.response); + } + }; + } + if (self.waitUntilDone) { + block(); + } else { + dispatch_async(self.responseQueue, block); + } +} + +- (void)repeat { + _attemptsUsed = 0; + _preparedParameters = nil; + [self executeWithResultBlock:_completeBlock errorBlock:_errorBlock]; +} + +- (void)cancel { + self.executionOperation.completionBlock = nil; + [self.executionOperation cancel]; + self.executionOperation = nil; + [NSObject cancelPreviousPerformRequestsWithTarget:self]; + self.error = [NSError errorWithVkError:[VKError errorWithCode:VK_API_CANCELED]]; + [self finishRequest]; + +} + +- (void)setupProgress:(VKHTTPOperation *)operation { + if (self.progressBlock) { + [operation setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) { + if (self.progressBlock) { + self.progressBlock(VKProgressTypeUpload, totalBytesWritten, totalBytesExpectedToWrite); + } + }]; + [operation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) { + if (self.progressBlock) { + self.progressBlock(VKProgressTypeDownload, totalBytesRead, totalBytesExpectedToRead); + } + }]; + } +} + +- (void)addExtraParameters:(NSDictionary *)extraParameters { + if (!_methodParameters) + _methodParameters = [extraParameters mutableCopy]; + else { + NSMutableDictionary *params = [_methodParameters mutableCopy]; + [params addEntriesFromDictionary:extraParameters]; + _methodParameters = params; + } +} + +#pragma mark Sevice + +- (NSString *)generateSig:(OrderedDictionary *)params token:(VKAccessToken *)token { + //Read description here https://vk.com/dev/api_nohttps + //First of all, we need key-value pairs in order of request + NSMutableArray *paramsArray = [NSMutableArray arrayWithCapacity:params.count]; + for (NSString *key in params) { + [paramsArray addObject:[key stringByAppendingFormat:@"=%@", params[key]]]; + } + //Then we generate "request string" /method/{METHOD_NAME}?{GET_PARAMS}{POST_PARAMS} + NSString *requestString = [NSString stringWithFormat:@"/method/%@?%@", _methodName, [paramsArray componentsJoinedByString:@"&"]]; + requestString = [requestString stringByAppendingString:token.secret]; + return [requestString MD5]; +} + +- (BOOL)processCommonError:(VKError *)error { + if (error.errorCode == VK_API_ERROR) { + error.apiError.request = self; + if ([self.preventThisErrorsHandling containsObject:@(error.apiError.errorCode)]) { + return NO; + } + if (error.apiError.errorCode == 5) { + vksdk_dispatch_on_main_queue_now(^{ + [error.apiError notiftAuthorizationFailed]; + }); + return NO; + } + if (error.apiError.errorCode == 6) { + //Too many requests per second + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (_waitMultiplier * NSEC_PER_SEC)), [[self class] processingQueue], ^{ + _waitMultiplier *= ((arc4random() % 10) + 10) / 10.f; + [self repeat]; + }); + return YES; + } + if (error.apiError.errorCode == 14) { + //Captcha + vksdk_dispatch_on_main_queue_now(^{ + [error.apiError notifyCaptchaRequired]; + }); + return YES; + } + else if (error.apiError.errorCode == 16) { + //Https required + [[VKSdk accessToken] setAccessTokenRequiredHTTPS]; + [self repeat]; + return YES; + } + else if (error.apiError.errorCode == 17) { + //Validation needed + vksdk_dispatch_on_main_queue_now(^{ + [VKAuthorizeController presentForValidation:error.apiError]; + }); + + return YES; + } + } + + return NO; +} + +#pragma mark Properties + +- (NSString *)language { + NSString *lang = self.requestLang; + if (self.useSystemLanguage) { + static NSString *sysLang = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sysLang = [[[[[NSLocale preferredLanguages] firstObject] componentsSeparatedByCharactersInSet:[NSCharacterSet punctuationCharacterSet]] firstObject] lowercaseString]; + }); + if ([SUPPORTED_LANGS_ARRAY containsObject:sysLang]) { + lang = sysLang; + } + } + return lang; +} + +- (dispatch_queue_t)responseQueue { + if (!_responseQueue) { + return dispatch_get_main_queue(); + } + return _responseQueue; +} + +- (void)setPreferredLang:(NSString *)preferredLang { + self.requestLang = preferredLang; + self.useSystemLanguage = NO; +} + +- (BOOL)isExecuting { + return _executionOperation.isExecuting; +} + + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKRequestsScheduler.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKRequestsScheduler.h new file mode 100644 index 0000000..f8816ca --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKRequestsScheduler.h @@ -0,0 +1,42 @@ +// +// VKRequestsScheduler.h +// +// Copyright (c) 2015 VK.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 "VKObject.h" + +@class VKRequest; + +/** +* A singletone class for simple schedule requests. It used for preventing "Too many requests per second" error. +*/ +@interface VKRequestsScheduler : VKObject +/// Returns an instance of scheduler ++ (instancetype)instance; + +/// Used for enabling or disabling scheduler. If scheduler disabled, all next added requests will be sent immediately +- (void)setEnabled:(BOOL)enabled; + +/// Adds requests to queue. If scheduler disabled, request starts immediately +- (void)scheduleRequest:(VKRequest *)req; + +- (NSTimeInterval)currentAvailableInterval; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKRequestsScheduler.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKRequestsScheduler.m new file mode 100644 index 0000000..1600ca0 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKRequestsScheduler.m @@ -0,0 +1,118 @@ +// +// VKRequestsScheduler.m +// +// Copyright (c) 2015 VK.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 "VKRequestsScheduler.h" +#import "VKRequest.h" +#import "VKSdk.h" + +@implementation VKRequestsScheduler { + dispatch_queue_t _schedulerQueue; + NSInteger _currentLimitPerSecond; + NSMutableDictionary *_scheduleDict; + BOOL _enabled; +} +//+ (NSDictionary *)limits { +// static NSDictionary *limitsDictionary; +// static dispatch_once_t onceToken; +// dispatch_once(&onceToken, ^{ +// limitsDictionary = @{@5000 : @3, @10000 : @5, @100000 : @8, @1000000 : @20, @(INT_MAX) : @35}; +// }); +// return limitsDictionary; +//} + ++ (instancetype)instance { + static id sInstance; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sInstance = [[self alloc] init]; + }); + + return sInstance; +} + +- (instancetype)init { + if (self = [super init]) { + _currentLimitPerSecond = 3; + _schedulerQueue = dispatch_queue_create("com.vk.requests-scheduler", DISPATCH_QUEUE_SERIAL); + } + return self; +} + +- (void)setEnabled:(BOOL)enabled { + _enabled = enabled; +// if ([VKSdk instance].currentAppId) { +// [[VKRequest requestWithMethod:@"apps.get" andParameters:@{@"app_id" : [VKSdk instance].currentAppId} andHttpMethod:@"GET"] executeWithResultBlock:^(VKResponse *response) { +// NSInteger members = [response.json[@"members_count"] integerValue]; +// NSDictionary *limitsDict = [[self class] limits]; +// NSArray *limits = [[limitsDict allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { +// return [obj1 compare:obj2]; +// }]; +// +// for (NSNumber *curLimit in limits) { +// if (members < curLimit.integerValue) { +// _currentLimitPerSecond = [limitsDict[curLimit] integerValue]; +// break; +// } +// } +// +// } errorBlock:nil]; +// } +} + +- (NSTimeInterval)currentAvailableInterval { + return 1.f / _currentLimitPerSecond; +} + +- (void)scheduleRequest:(VKRequest *)req { + if (!_enabled) { + [req start]; + return; + } + dispatch_async(_schedulerQueue, ^{ + NSTimeInterval now = [[NSDate new] timeIntervalSince1970]; + NSInteger thisSecond = (NSInteger) now; + if (!_scheduleDict) { + _scheduleDict = [NSMutableDictionary new]; + } + NSArray *keysToRemove = [[_scheduleDict allKeys] filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF < %d", thisSecond]]; + [_scheduleDict removeObjectsForKeys:keysToRemove]; + NSInteger countForSecond = [_scheduleDict[@(thisSecond)] integerValue]; + if (countForSecond < _currentLimitPerSecond) { + _scheduleDict[@(thisSecond)] = @(++countForSecond); + [req start]; + } else { + CGFloat delay = [self currentAvailableInterval], step = delay; + while ([_scheduleDict[@(thisSecond)] integerValue] >= _currentLimitPerSecond) { + delay += step; + thisSecond = (NSInteger) (now + delay); + } + NSInteger nextSecCount = [_scheduleDict[@(thisSecond)] integerValue]; + delay += step * nextSecCount; + _scheduleDict[@(thisSecond)] = @(++nextSecCount); + dispatch_sync(dispatch_get_main_queue(), ^{ + [req performSelector:@selector(start) withObject:nil afterDelay:delay inModes:@[NSRunLoopCommonModes]]; + }); + } + }); +} +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKResponse.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKResponse.h new file mode 100644 index 0000000..1a7d299 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKResponse.h @@ -0,0 +1,41 @@ +// +// VKResponse.h +// +// Copyright (c) 2014 VK.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 "VKObject.h" + +@class VKRequest; + +/** +Class presenting answer from API +*/ +@interface VKResponse : VKObject + +/// Request which caused response +@property(nonatomic, weak) VKRequest *request; +/// Json content of response. Can be array or object. +@property(nonatomic, strong) id json; +/// Model parsed from response +@property(nonatomic, strong) id parsedModel; +/// Original response string from server +@property(nonatomic, copy) NSString *responseString; + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKResponse.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKResponse.m new file mode 100644 index 0000000..2e12ad9 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Core/VKResponse.m @@ -0,0 +1,31 @@ +// +// VKResponse.m +// +// Copyright (c) 2014 VK.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 "VKResponse.h" + +@implementation VKResponse + +- (NSString *)description { + return [NSString stringWithFormat:@"", self, self.json]; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Image/VKImageParameters.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Image/VKImageParameters.h new file mode 100644 index 0000000..a37f8dc --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Image/VKImageParameters.h @@ -0,0 +1,71 @@ +// +// VKImageParameters.h +// +// Copyright (c) 2014 VK.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 "VKObject.h" + +/** +Describes image representation type +*/ +typedef enum VKImageType { + /// Sets jpeg representation of image + VKImageTypeJpg, + /// Sets png representation of image + VKImageTypePng +} VKImageType; + +/** +Parameters used for uploading image into VK servers +*/ +@interface VKImageParameters : VKObject + +/// Type of image compression. Can be VKImageTypeJpg or VKImageTypePng. +@property(nonatomic, assign) VKImageType imageType; +/// Quality used for jpg compression. From 0.0 to 1.0 +@property(nonatomic, assign) CGFloat jpegQuality; + +/** +Creates new parameters instance for png image. +@return New instance of parameters +*/ ++ (instancetype)pngImage; + +/** +Creates new parameters instance for jpeg image. +@param quality Used only for VKImageTypeJpg representation. From 0.0 to 1.0 +@return New instance with passed parameters +*/ ++ (instancetype)jpegImageWithQuality:(float)quality; + +/** +Return file extension for selected type +@return png for VKImageTypePng image type, jpg for VKImageTypeJpg image type +*/ +- (NSString *)fileExtension; + +/** +Return mime type +@return parameters mime type +*/ +- (NSString *)mimeType; +@end + + diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Image/VKImageParameters.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Image/VKImageParameters.m new file mode 100644 index 0000000..4018a16 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Image/VKImageParameters.m @@ -0,0 +1,66 @@ +// +// VKImageParameters.m +// +// Copyright (c) 2014 VK.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 "VKImageParameters.h" + +@implementation VKImageParameters ++ (instancetype)pngImage { + VKImageParameters *params = [VKImageParameters new]; + params.imageType = VKImageTypePng; + return params; +} + ++ (instancetype)jpegImageWithQuality:(float)quality { + VKImageParameters *params = [VKImageParameters new]; + params.imageType = VKImageTypeJpg; + params.jpegQuality = quality; + return params; +} + +- (NSString *)fileExtension { + switch (self.imageType) { + case VKImageTypeJpg: + return @"jpg"; + + case VKImageTypePng: + return @"png"; + + default: + return nil; + } +} + +- (NSString *)mimeType { + switch (self.imageType) { + case VKImageTypeJpg: + return @"image/jpeg"; + + case VKImageTypePng: + return @"image/png"; + + default: + return nil; + } +} + +@end + diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Image/VKUploadImage.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Image/VKUploadImage.h new file mode 100644 index 0000000..7c16557 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Image/VKUploadImage.h @@ -0,0 +1,52 @@ +// +// VKUploadImage.h +// +// Copyright (c) 2014 VK.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 "VKImageParameters.h" + +/** +Contains image data with image description +*/ +@interface VKUploadImage : VKObject + +/// Bytes of image +@property(nonatomic, strong) NSData *imageData; +/// Source image +@property(nonatomic, strong) UIImage *sourceImage; +/// Image basic info +@property(nonatomic, strong) VKImageParameters *parameters; + +/** +Create new image data representation used for upload +@param data Bytes of image +@param params Image basic info +@return Prepared object for using in upload +*/ ++ (instancetype)uploadImageWithData:(NSData *)data andParams:(VKImageParameters *)params; + +/** +Create new image representation used for upload +@param image Source image +@param params Image basic info +@return Prepared object for using in upload +*/ ++ (instancetype)uploadImageWithImage:(UIImage *)image andParams:(VKImageParameters *)params; +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Image/VKUploadImage.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Image/VKUploadImage.m new file mode 100644 index 0000000..6289725 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Image/VKUploadImage.m @@ -0,0 +1,40 @@ +// +// VKUploadImage.m +// +// Copyright (c) 2014 VK.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 "VKUploadImage.h" + +@implementation VKUploadImage ++ (instancetype)uploadImageWithData:(NSData *)data andParams:(VKImageParameters *)params { + VKUploadImage *image = [VKUploadImage new]; + image.imageData = data; + image.parameters = params ?: [VKImageParameters jpegImageWithQuality:0.9]; + return image; +} + ++ (instancetype)uploadImageWithImage:(UIImage *)image andParams:(VKImageParameters *)params { + VKUploadImage *upload = [VKUploadImage new]; + upload.sourceImage = image; + upload.parameters = params ?: [VKImageParameters jpegImageWithQuality:0.9]; + return upload; +} +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/NSData+MD5.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/NSData+MD5.h new file mode 100644 index 0000000..177ac28 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/NSData+MD5.h @@ -0,0 +1,29 @@ +// +// NSData+MD5.h +// +// Copyright (c) 2014 +// +// 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 "NSData+MD5.h" + +@interface NSData (MD5) + +- (NSString *)MD5; + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/NSData+MD5.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/NSData+MD5.m new file mode 100644 index 0000000..9d19340 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/NSData+MD5.m @@ -0,0 +1,43 @@ +// +// NSData+MD5.m +// +// Copyright (c) 2014 +// +// 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 + +@implementation NSData (MD5) + +- (NSString *)MD5 { + // Create byte array of unsigned chars + unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH]; + + // Create 16 byte MD5 hash value, store in buffer + CC_MD5(self.bytes, (uint) self.length, md5Buffer); + + // Convert unsigned char buffer to NSString of hex values + NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2]; + for (int i = 0; i < CC_MD5_DIGEST_LENGTH; i++) + [output appendFormat:@"%02x", md5Buffer[i]]; + + return output; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/NSString+MD5.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/NSString+MD5.h new file mode 100644 index 0000000..3acca51 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/NSString+MD5.h @@ -0,0 +1,29 @@ +// +// NSString+MD5.m +// +// Copyright (c) 2014 +// +// 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 NSString (MD5) + +- (NSString *)MD5; + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/NSString+MD5.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/NSString+MD5.m new file mode 100644 index 0000000..b3a0ee3 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/NSString+MD5.m @@ -0,0 +1,47 @@ +// +// NSString+MD5.m +// +// Copyright (c) 2014 +// +// 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 "NSString+MD5.h" + +@implementation NSString (MD5) + +- (NSString *)MD5 { + // Create pointer to the string as UTF8 + const char *ptr = [self UTF8String]; + + // Create byte array of unsigned chars + unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH]; + + // Create 16 bytes MD5 hash value, store in buffer + CC_MD5(ptr, (uint) strlen(ptr), md5Buffer); + + // Convert unsigned char buffer to NSString of hex values + NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2]; + for (int i = 0; i < CC_MD5_DIGEST_LENGTH; i++) + [output appendFormat:@"%02x", md5Buffer[i]]; + + return output; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/OrderedDictionary.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/OrderedDictionary.h new file mode 100644 index 0000000..d3ff7a0 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/OrderedDictionary.h @@ -0,0 +1,37 @@ +// +// OrderedDictionary.h +// OrderedDictionary +// +// Created by Matt Gallagher on 19/12/08. +// Copyright 2008 Matt Gallagher. All rights reserved. +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. Permission is granted to anyone to +// use this software for any purpose, including commercial applications, and to +// alter it and redistribute it freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source +// distribution. +// + +#import + +@interface OrderedDictionary : NSMutableDictionary { + NSMutableDictionary *dictionary; + NSMutableArray *array; +} + +- (void)insertObject:(id)anObject forKey:(id)aKey atIndex:(NSUInteger)anIndex; + +- (id)keyAtIndex:(NSUInteger)anIndex; + +- (NSEnumerator *)reverseKeyEnumerator; + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/OrderedDictionary.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/OrderedDictionary.m new file mode 100644 index 0000000..9999437 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/OrderedDictionary.m @@ -0,0 +1,126 @@ +// +// OrderedDictionary.m +// OrderedDictionary +// +// Created by Matt Gallagher on 19/12/08. +// Copyright 2008 Matt Gallagher. All rights reserved. +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. Permission is granted to anyone to +// use this software for any purpose, including commercial applications, and to +// alter it and redistribute it freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source +// distribution. +// + +#import "OrderedDictionary.h" + +NSString *VKDescriptionForObject(NSObject *object, id locale, NSUInteger indent) { + NSString *objectString; + if ([object isKindOfClass:[NSString class]]) { + objectString = (NSString *) object; + } + else if ([object respondsToSelector:@selector(descriptionWithLocale:indent:)]) { + objectString = [(NSDictionary *) object descriptionWithLocale:locale indent:indent]; + } + else if ([object respondsToSelector:@selector(descriptionWithLocale:)]) { + objectString = [(NSSet *) object descriptionWithLocale:locale]; + } + else { + objectString = [object description]; + } + return objectString; +} + +@implementation OrderedDictionary + +- (id)init { + self = [super init]; + if (self) { + dictionary = [[NSMutableDictionary alloc] initWithCapacity:0]; + array = [[NSMutableArray alloc] initWithCapacity:0]; + } + return self; +} + +- (id)initWithCapacity:(NSUInteger)capacity { + self = [super init]; + if (self != nil) { + dictionary = [[NSMutableDictionary alloc] initWithCapacity:capacity]; + array = [[NSMutableArray alloc] initWithCapacity:capacity]; + } + return self; +} + +- (id)copy { + return [self mutableCopy]; +} + +- (void)setObject:(id)anObject forKey:(id)aKey { + if (![dictionary objectForKey:aKey]) { + [array addObject:aKey]; + } + [dictionary setObject:anObject forKey:aKey]; +} + +- (void)removeObjectForKey:(id)aKey { + [dictionary removeObjectForKey:aKey]; + [array removeObject:aKey]; +} + +- (NSUInteger)count { + return [dictionary count]; +} + +- (id)objectForKey:(id)aKey { + return [dictionary objectForKey:aKey]; +} + +- (NSEnumerator *)keyEnumerator { + return [array objectEnumerator]; +} + +- (NSEnumerator *)reverseKeyEnumerator { + return [array reverseObjectEnumerator]; +} + +- (void)insertObject:(id)anObject forKey:(id)aKey atIndex:(NSUInteger)anIndex { + if ([dictionary objectForKey:aKey]) { + [self removeObjectForKey:aKey]; + } + [array insertObject:aKey atIndex:anIndex]; + [dictionary setObject:anObject forKey:aKey]; +} + +- (id)keyAtIndex:(NSUInteger)anIndex { + return [array objectAtIndex:anIndex]; +} + +- (NSString *)descriptionWithLocale:(id)locale indent:(NSUInteger)level { + NSMutableString *indentString = [NSMutableString string]; + NSUInteger i, count = level; + for (i = 0; i < count; i++) { + [indentString appendFormat:@" "]; + } + + NSMutableString *description = [NSMutableString string]; + [description appendFormat:@"%@{\n", indentString]; + for (NSObject *key in self) { + [description appendFormat:@"%@ %@ = %@;\n", + indentString, + VKDescriptionForObject(key, locale, level), + VKDescriptionForObject([self objectForKey:key], locale, level)]; + } + [description appendFormat:@"%@}\n", indentString]; + return description; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/VKUtil.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/VKUtil.h new file mode 100644 index 0000000..9750e48 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/VKUtil.h @@ -0,0 +1,68 @@ +// +// VKUtil.h +// +// Copyright (c) 2014 VK.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. + +#define VK_SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) +#define VK_SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) +#define VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) +#define VK_SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) +#define VK_SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) +#define VK_COLOR [UIColor colorWithRed:85.0f / 255 green:133.0f / 255 blue:188.0f / 255 alpha:1.0f] +#define VK_IS_DEVICE_IPAD (UIUserInterfaceIdiomPad == [[UIDevice currentDevice] userInterfaceIdiom]) + +#import + +/** +Various functions +*/ +@interface VKUtil : NSObject +/** +Breaks key=value string to dictionary +@param queryString string with key=value pairs joined by & symbol +@return Dictionary of parameters +*/ ++ (NSDictionary *)explodeQueryString:(NSString *)queryString; + ++ (NSString *)generateGUID; + ++ (NSNumber *)parseNumberString:(id)number; + ++ (UIColor *)colorWithRGB:(NSInteger)rgb; + ++ (NSString *)queryStringFromParams:(NSDictionary *)params; +@end + + +@interface UIImage (RoundedImage) +- (UIImage *)vks_roundCornersImage:(CGFloat)cornerRadius resultSize:(CGSize)imageSize; +@end + +static inline NSNumber *VK_ENSURE_NUM(id obj) { + return [obj isKindOfClass:[NSNumber class]] ? obj : nil; +} + +static inline NSDictionary *VK_ENSURE_DICT(id data) { + return [data isKindOfClass:NSDictionary.class] ? data : nil; +} + +static inline NSArray *VK_ENSURE_ARRAY(id data) { + return [data isKindOfClass:NSArray.class] ? data : nil; +} \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/VKUtil.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/VKUtil.m new file mode 100644 index 0000000..db02bdf --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Utils/VKUtil.m @@ -0,0 +1,165 @@ +// +// VKUtil.m +// +// Copyright (c) 2014 VK.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 "VKUtil.h" + +@implementation VKUtil + ++ (NSDictionary *)explodeQueryString:(NSString *)queryString { + NSArray *keyValuePairs = [queryString componentsSeparatedByString:@"&"]; + NSMutableDictionary *parameters = [NSMutableDictionary new]; + for (NSString *keyValueString in keyValuePairs) { + NSArray *keyValueArray = [keyValueString componentsSeparatedByString:@"="]; + parameters[keyValueArray[0]] = keyValueArray[1]; + } + return parameters; +} + ++ (NSString *)generateGUID { + CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault); + CFStringRef str = CFUUIDCreateString(kCFAllocatorDefault, uuid); + NSString *uuidString = [NSString stringWithFormat:@"%@", (__bridge NSString *) str]; + CFRelease(uuid); + CFRelease(str); + return uuidString; +} + ++ (NSNumber *)parseNumberString:(id)number { + if ([number isKindOfClass:[NSNumber class]]) + return (NSNumber *) number; + static dispatch_once_t onceToken; + static NSNumberFormatter *formatter; + dispatch_once(&onceToken, ^{ + formatter = [[NSNumberFormatter alloc] init]; + }); + return [formatter numberFromString:number]; +} + ++ (UIColor *)colorWithRGB:(NSInteger)rgb { + return [UIColor colorWithRed:((CGFloat) ((rgb & 0xFF0000) >> 16)) / 255.f green:((CGFloat) ((rgb & 0xFF00) >> 8)) / 255.f blue:((CGFloat) (rgb & 0xFF)) / 255.f alpha:1.0f]; +} + +static NSString *const kCharactersToBeEscapedInQueryString = @":/?&=;+!@#$()',*"; + ++ (NSString *)escapeString:(NSString *)value { + return (__bridge_transfer NSString *) CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef) value, NULL, (__bridge CFStringRef) kCharactersToBeEscapedInQueryString, CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding)); +} + ++ (NSString *)queryStringFromParams:(NSDictionary *)params { + NSMutableArray *array = [NSMutableArray arrayWithCapacity:params.count]; + for (NSString *key in params) { + if ([params[key] isKindOfClass:[NSString class]]) + [array addObject:[NSString stringWithFormat:@"%@=%@", key, [self escapeString:params[key]]]]; + else + [array addObject:[NSString stringWithFormat:@"%@=%@", key, params[key]]]; + } + return [array componentsJoinedByString:@"&"]; +} +@end + +///---------------------------- +/// @name Processing preview images +///---------------------------- + +typedef enum CornerFlag { + CornerFlagTopLeft = 0x01, + CornerFlagTopRight = 0x02, + CornerFlagBottomLeft = 0x04, + CornerFlagBottomRight = 0x08, + CornerFlagAll = CornerFlagTopLeft | CornerFlagTopRight | CornerFlagBottomLeft | CornerFlagBottomRight +} CornerFlag; + + +@implementation UIImage (RoundedImage) +- (void)vks_addRoundedRectToPath:(CGContextRef)context rect:(CGRect)rect width:(float)ovalWidth height:(float)ovalHeight toCorners:(CornerFlag)corners { + if (ovalWidth == 0 || ovalHeight == 0) { + CGContextAddRect(context, rect); + return; + } + CGContextSaveGState(context); + CGContextTranslateCTM(context, CGRectGetMinX(rect), CGRectGetMinY(rect)); + CGContextScaleCTM(context, ovalWidth, ovalHeight); + float fw = CGRectGetWidth(rect) / ovalWidth; + float fh = CGRectGetHeight(rect) / ovalHeight; + CGContextMoveToPoint(context, fw, fh / 2); + if (corners & CornerFlagTopRight) { + CGContextAddArcToPoint(context, fw, fh, fw / 2, fh, 1); + } else { + CGContextAddLineToPoint(context, fw, fh); + } + if (corners & CornerFlagTopLeft) { + CGContextAddArcToPoint(context, 0, fh, 0, fh / 2, 1); + } else { + CGContextAddLineToPoint(context, 0, fh); + } + if (corners & CornerFlagBottomLeft) { + CGContextAddArcToPoint(context, 0, 0, fw / 2, 0, 1); + } else { + CGContextAddLineToPoint(context, 0, 0); + } + if (corners & CornerFlagBottomRight) { + CGContextAddArcToPoint(context, fw, 0, fw, fh / 2, 1); + } else { + CGContextAddLineToPoint(context, fw, 0); + } + CGContextClosePath(context); + CGContextRestoreGState(context); +} + +- (UIImage *)vks_roundCornersImage:(CGFloat)cornerRadius resultSize:(CGSize)imageSize { + CGImageRef imageRef = self.CGImage; + float imageWidth = CGImageGetWidth(imageRef); + float imageHeight = CGImageGetHeight(imageRef); + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGRect drawRect = (CGRect) {CGPointZero, imageWidth, imageHeight}; + size_t w = (size_t) (imageSize.width * [UIScreen mainScreen].scale); + size_t h = (size_t) (imageSize.height * [UIScreen mainScreen].scale); + cornerRadius *= [UIScreen mainScreen].scale; + + CGContextRef context = CGBitmapContextCreate(NULL, w, h, 8, w * 4, colorSpace, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little); + if (!context) { + CGColorSpaceRelease(colorSpace); + return nil; + } + CGContextClearRect(context, CGRectMake(0, 0, w, h)); + CGColorSpaceRelease(colorSpace); + CGRect clipRect = CGRectMake(0, 0, w, h); + float widthScale = w / imageWidth; + float heightScale = h / imageHeight; + float scale = MAX(widthScale, heightScale); + drawRect.size.width = imageWidth * scale; + drawRect.size.height = imageHeight * scale; + drawRect.origin.x = (w - drawRect.size.width) / 2.0f; + drawRect.origin.y = (h - drawRect.size.height) / 2.0f; + [self vks_addRoundedRectToPath:context rect:clipRect width:cornerRadius height:cornerRadius toCorners:CornerFlagAll]; + CGContextClip(context); + + CGContextSaveGState(context); + CGContextDrawImage(context, drawRect, imageRef); + CGContextRestoreGState(context); + CGImageRef decompressedImageRef = CGBitmapContextCreateImage(context); + CGContextRelease(context); + UIImage *decompressedImage = [[UIImage alloc] initWithCGImage:decompressedImageRef]; + CGImageRelease(decompressedImageRef); + return decompressedImage; +} +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/VKAccessToken.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKAccessToken.h new file mode 100644 index 0000000..694c36d --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKAccessToken.h @@ -0,0 +1,110 @@ +// +// VKAccessToken.h +// +// Copyright (c) 2014 VK.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. +// +// -------------------------------------------------------------------------------- +// +// Modified by Ruslan Kavetsky + +#import +#import "VKObject.h" +#import "VKUser.h" + +/** +Presents VK API access token that used for loading API methods and other stuff. +*/ +@interface VKAccessToken : VKObject + +/// String token for use in request parameters +@property(nonatomic, readonly, copy) NSString *accessToken; + +/// Current user id for this token +@property(nonatomic, readonly, copy) NSString *userId; + +/// User secret to sign requests (if nohttps used) +@property(nonatomic, readonly, copy) NSString *secret; + +// Permisiions assosiated with token +@property(nonatomic, readonly, copy) NSArray *permissions; + +// User email (if passed) +@property(nonatomic, readonly, copy) NSString *email; + +/// Time when token expires +@property(nonatomic, readonly, assign) NSInteger expiresIn; + +/// If user sets "Always use HTTPS" setting in his profile, it will be true +@property(nonatomic, readonly, assign) BOOL httpsRequired; + +/// Indicates time of token creation +@property(nonatomic, readonly, assign) NSTimeInterval created; + +/// Indicates time of token creation +@property(nonatomic, readonly, strong) VKUser *localUser; + +/** +Retrieve token from key-value query string +@param urlString string that contains URL-query part with token. E.g. access_token=ffffff&expires_in=0... +@return parsed token +*/ ++ (instancetype)tokenFromUrlString:(NSString *)urlString; + +/** +Create token with existing properties +@param accessToken token string +@param secret secret +@param userId user id +@return new token +*/ ++ (instancetype)tokenWithToken:(NSString *)accessToken secret:(NSString *)secret userId:(NSString *)userId; + +/** +Retrieve token from user defaults. Token must be saved to defaults with saveTokenToDefaults method +@param defaultsKey path to file with saved token +@return parsed token +*/ ++ (instancetype)savedToken:(NSString *)defaultsKey; + +/** +Save token into user defaults by specified key +@param defaultsKey key for defaults +*/ +- (void)saveTokenToDefaults:(NSString *)defaultsKey; + +/// Return YES if token has expired +- (BOOL)isExpired; + +/** + Remove token from storage + */ ++ (void)delete:(NSString *)service; + +@end + +@interface VKAccessTokenMutable : VKAccessToken +@property(nonatomic, readwrite, copy) NSString *accessToken; +@property(nonatomic, readwrite, copy) NSString *userId; +@property(nonatomic, readwrite, copy) NSString *secret; +@property(nonatomic, readwrite, copy) NSArray *permissions; +@property(nonatomic, readwrite, assign) BOOL httpsRequired; +@property(nonatomic, readwrite, assign) NSInteger expiresIn; +@property(nonatomic, readwrite, strong) VKUser *localUser; +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/VKAccessToken.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKAccessToken.m new file mode 100644 index 0000000..7a2d41e --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKAccessToken.m @@ -0,0 +1,296 @@ +// +// VKAccessToken.m +// +// Copyright (c) 2014 VK.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. +// +// -------------------------------------------------------------------------------- +// +// Modified by Ruslan Kavetsky + +#import "VKAccessToken.h" +#import "VKSdk.h" + +static NSString *const ACCESS_TOKEN = @"access_token"; +static NSString *const EXPIRES_IN = @"expires_in"; +static NSString *const USER_ID = @"user_id"; +static NSString *const SECRET = @"secret"; +static NSString *const EMAIL = @"email"; +static NSString *const HTTPS_REQUIRED = @"https_required"; +static NSString *const CREATED = @"created"; +static NSString *const PERMISSIONS = @"permissions"; + +@interface VKAccessToken () { +@protected + NSString *_accessToken; + NSString *_userId; + NSString *_secret; + NSArray *_permissions; + BOOL _httpsRequired; + NSInteger _expiresIn; + VKUser *_localUser; + +} +@property(nonatomic, readwrite, copy) NSString *accessToken; +@end + +@implementation VKAccessToken + +#pragma mark - Creating + ++ (instancetype)tokenWithToken:(NSString *)accessToken + secret:(NSString *)secret + userId:(NSString *)userId { + + return [[self alloc] initWithToken:accessToken secret:secret userId:userId]; +} + ++ (instancetype)tokenFromUrlString:(NSString *)urlString { + return [[self alloc] initWithUrlString:urlString]; +} + +- (instancetype)initWithToken:(NSString *)accessToken + secret:(NSString *)secret + userId:(NSString *)userId { + self = [super init]; + if (self) { + _accessToken = [accessToken copy]; + _secret = secret; + _userId = userId; + } + return self; +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + if (self = [super init]) { + _accessToken = [aDecoder decodeObjectForKey:ACCESS_TOKEN]; + _userId = [aDecoder decodeObjectForKey:USER_ID]; + _secret = [aDecoder decodeObjectForKey:SECRET]; + _email = [aDecoder decodeObjectForKey:EMAIL]; + _permissions = [self restorePermissions:[aDecoder decodeObjectForKey:PERMISSIONS]]; + + _httpsRequired = [aDecoder decodeBoolForKey:HTTPS_REQUIRED]; + _expiresIn = [aDecoder decodeIntegerForKey:EXPIRES_IN]; + _created = [aDecoder decodeDoubleForKey:CREATED]; + } + return self; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + if (self.accessToken) { + [aCoder encodeObject:self.accessToken forKey:ACCESS_TOKEN]; + } + if (self.userId) { + [aCoder encodeObject:self.userId forKey:USER_ID]; + } + if (self.secret) { + [aCoder encodeObject:self.secret forKey:SECRET]; + } + if (self.email) { + [aCoder encodeObject:self.email forKey:EMAIL]; + } + + NSString *permissions = [self.permissions componentsJoinedByString:@","]; + if (permissions.length > 0) { + [aCoder encodeObject:permissions forKey:PERMISSIONS]; + } + + [aCoder encodeBool:self.httpsRequired forKey:HTTPS_REQUIRED]; + [aCoder encodeInteger:self.expiresIn forKey:EXPIRES_IN]; + [aCoder encodeDouble:self.created forKey:CREATED]; +} + +- (NSArray *)restorePermissions:(NSString *)permissionsString { + permissionsString = [permissionsString stringByReplacingOccurrencesOfString:@"(" withString:@""]; + permissionsString = [permissionsString stringByReplacingOccurrencesOfString:@")" withString:@""]; + NSMutableArray *array = [NSMutableArray array]; + for (NSString *comp in [permissionsString componentsSeparatedByString:@","]) { + [array addObject:[comp stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]]; + } + return array; +} + +- (instancetype)initWithUrlString:(NSString *)urlString { + + self = [super init]; + if (self) { + + NSDictionary *parameters = [VKUtil explodeQueryString:urlString]; + _accessToken = [parameters[ACCESS_TOKEN] copy]; + _expiresIn = [parameters[EXPIRES_IN] integerValue]; + _userId = [parameters[USER_ID] copy]; + _secret = [parameters[SECRET] copy]; + _email = [parameters[EMAIL] copy]; + _httpsRequired = NO; + + _permissions = [self restorePermissions:parameters[PERMISSIONS]]; + + if (parameters[HTTPS_REQUIRED]) { + _httpsRequired = [parameters[HTTPS_REQUIRED] intValue] == 1; + } + + _created = parameters[CREATED] ? [parameters[CREATED] floatValue] : [[NSDate new] timeIntervalSince1970]; + [self checkIfExpired]; + } + + return self; +} + +- (instancetype)initWithVKAccessToken:(VKAccessToken *)token { + if (self = [super init]) { + _accessToken = [token.accessToken copy]; + _expiresIn = token.expiresIn; + _userId = [token.userId copy]; + _secret = [token.secret copy]; + _httpsRequired = token.httpsRequired; + _created = token.created; + _permissions = [token.permissions copy]; + _email = [token.email copy]; + _localUser = token.localUser; + } + return self; +} + ++ (instancetype)savedToken:(NSString *)defaultsKey { + NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:defaultsKey]; + if (data) { + VKAccessToken *token = [self tokenFromUrlString:[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]]; + [[NSUserDefaults standardUserDefaults] removeObjectForKey:defaultsKey]; + [[NSUserDefaults standardUserDefaults] synchronize]; + [self save:defaultsKey data:token]; + return token; + } + return [self load:defaultsKey]; +} + +#pragma mark - Expire + +- (BOOL)isExpired { + return self.expiresIn > 0 && self.expiresIn + self.created < [[NSDate new] timeIntervalSince1970]; +} + +- (void)checkIfExpired { + if (self.accessToken && self.isExpired) { + [self notifyTokenExpired]; + } +} + +#pragma mark - + +- (NSString *)accessToken { + if (_accessToken && self.isExpired) { + [self notifyTokenExpired]; + } + return _accessToken; +} + +#pragma mark - Save / Load + +- (void)saveTokenToDefaults:(NSString *)defaultsKey { + [[self class] save:defaultsKey data:[self copy]]; +} + +- (id)copy { + return [[VKAccessToken alloc] initWithVKAccessToken:self]; +} + +- (id)mutableCopy { + return [[VKAccessTokenMutable alloc] initWithVKAccessToken:self]; +} + +/** + Simple keychain requests + Source: http://stackoverflow.com/a/5251820/1271424 + */ + ++ (NSMutableDictionary *)getKeychainQuery:(NSString *)service { + return [@{(__bridge id) kSecClass : (__bridge id) kSecClassGenericPassword, + (__bridge id) kSecAttrService : service, + (__bridge id) kSecAttrAccount : service, + (__bridge id) kSecAttrAccessible : (__bridge id) kSecAttrAccessibleAfterFirstUnlock} mutableCopy]; +} + ++ (void)save:(NSString *)service data:(VKAccessToken *)token { + NSMutableDictionary *keychainQuery = [self getKeychainQuery:service]; + SecItemDelete((__bridge CFDictionaryRef) keychainQuery); + keychainQuery[(__bridge id) kSecValueData] = [NSKeyedArchiver archivedDataWithRootObject:token]; + SecItemAdd((__bridge CFDictionaryRef) keychainQuery, NULL); +} + ++ (VKAccessToken *)load:(NSString *)service { + id ret = nil; + NSMutableDictionary *keychainQuery = [self getKeychainQuery:service]; + keychainQuery[(__bridge id) kSecReturnData] = (id) kCFBooleanTrue; + keychainQuery[(__bridge id) kSecMatchLimit] = (__bridge id) kSecMatchLimitOne; + CFDataRef keyData = NULL; + if (SecItemCopyMatching((__bridge CFDictionaryRef) keychainQuery, (CFTypeRef *) &keyData) == noErr) { + @try { + ret = [NSKeyedUnarchiver unarchiveObjectWithData:(__bridge NSData *) keyData]; + } + @catch (NSException *e) { + NSLog(@"Unarchive of %@ failed: %@", service, e); + } + @finally {} + } + if (keyData) { + CFRelease(keyData); + } + return ret; +} + ++ (void)delete:(NSString *)service { + NSMutableDictionary *keychainQuery = [self getKeychainQuery:service]; + SecItemDelete((__bridge CFDictionaryRef) keychainQuery); +} + +@end + + +@implementation VKAccessTokenMutable +@dynamic accessToken, expiresIn, userId, secret, permissions, httpsRequired, localUser; + +- (void)setAccessToken:(NSString *)accessToken { + _accessToken = [accessToken copy]; +} + +- (void)setExpiresIn:(NSInteger)expiresIn { + _expiresIn = expiresIn; +} + +- (void)setUserId:(NSString *)userId { + _userId = [userId copy]; +} + +- (void)setSecret:(NSString *)secret { + _secret = [secret copy]; +} + +- (void)setPermissions:(NSArray *)permissions { + _permissions = [permissions copy]; +} + +- (void)setHttpsRequired:(BOOL)httpsRequired { + _httpsRequired = httpsRequired; +} + +- (void)setLocalUser:(VKUser *)localUser { + _localUser = localUser; +} + +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/VKAuthorizationResult.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKAuthorizationResult.h new file mode 100644 index 0000000..f4456ed --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKAuthorizationResult.h @@ -0,0 +1,30 @@ +// +// VKAuthorizationResult.h +// +// Copyright (c) 2015 VK.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 "VKAccessToken.h" +#import "VKError.h" + +@interface VKAuthorizationResult : VKObject +@property(nonatomic, strong) VKAccessToken *token; +@property(nonatomic, strong) VKUser *user; +@property(nonatomic, strong) NSError *error; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/VKAuthorizationResult.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKAuthorizationResult.m new file mode 100644 index 0000000..1895415 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKAuthorizationResult.m @@ -0,0 +1,27 @@ +// +// VKAuthorizationResult.m +// +// Copyright (c) 2015 VK.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 "VKAuthorizationResult.h" + +@implementation VKAuthorizationResult + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/VKBatchRequest.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKBatchRequest.h new file mode 100644 index 0000000..bb856e8 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKBatchRequest.h @@ -0,0 +1,66 @@ +// +// VKBatchRequest.h +// +// Copyright (c) 2014 VK.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 "VKObject.h" +#import "VKRequest.h" + +/** +Used for execution bunch of methods at time, and receive results of that methods in array +*/ +@interface VKBatchRequest : VKObject { +@private + + NSMutableArray *_requests; + NSMutableArray *_responses; + BOOL _canceled; +} +/// Specify completion block for request +@property(nonatomic, copy) void (^completeBlock)(NSArray *responses); +/// Specity error (HTTP or API) block for request. +@property(nonatomic, copy) void (^errorBlock)(NSError *error); + +/** +Initializes batch processing with requests +@param firstRequest ,... A comma-separated list of requests should be loaded, ending with nil. +@return Prepared request +*/ +- (instancetype)initWithRequests:(VKRequest *)firstRequest, ...NS_REQUIRES_NIL_TERMINATION; + +/** +Initializes batch processing with requests array +@param requests Array of requests should be loaded. +@return Prepared request +*/ +- (instancetype)initWithRequestsArray:(NSArray *)requests; + +/** +Executes batch request +@param completeBlock will receive result of passed requests +@param errorBlock called if any request did fail +*/ +- (void)executeWithResultBlock:(void (^)(NSArray *responses))completeBlock errorBlock:(void (^)(NSError *))errorBlock; + +/** +Cancel current batch operation +*/ +- (void)cancel; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/VKBatchRequest.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKBatchRequest.m new file mode 100644 index 0000000..5cbe6b2 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKBatchRequest.m @@ -0,0 +1,100 @@ +// +// VKBatchRequest.m +// +// Copyright (c) 2014 VK.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 "VKBatchRequest.h" +#import "VKHTTPClient.h" +#import "NSError+VKError.h" + +@implementation VKBatchRequest +- (instancetype)initWithRequests:(VKRequest *)firstRequest, ... { + self = [super init]; + _requests = [NSMutableArray new]; + va_list args; + va_start(args, firstRequest); + for (VKRequest *arg = firstRequest; arg != nil; arg = va_arg(args, VKRequest *)) { + [_requests addObject:arg]; + } + va_end(args); + return self; +} + +- (instancetype)initWithRequestsArray:(NSArray *)requests { + self = [super init]; + if (self) { + _requests = [NSMutableArray arrayWithArray:requests]; + } + return self; +} + +- (void)executeWithResultBlock:(void (^)(NSArray *responses))completeBlock errorBlock:(void (^)(NSError *))errorBlock { + self.completeBlock = completeBlock; + self.errorBlock = errorBlock; + _responses = [NSMutableArray arrayWithCapacity:_requests.count]; + for (int i = 0; i < _requests.count; i++) { + [_responses addObject:[NSNull null]]; + } + + NSMutableArray *batchOperations = [NSMutableArray arrayWithCapacity:_requests.count]; + for (VKRequest *request in _requests) { + void (^originalComplete)(VKResponse *) = [request.completeBlock copy]; + request.completeBlock = ^(VKResponse *response) { + [self provideResponse:response]; + if (originalComplete) originalComplete(response); + }; + + void (^originalErrorBlock)(NSError *) = [request.errorBlock copy]; + request.errorBlock = ^(NSError *error) { + [self provideError:error]; + if (originalErrorBlock) originalErrorBlock(error); + }; + + [batchOperations addObject:[request createExecutionOperation]]; + } + [[VKHTTPClient getClient] enqueueBatchOfHTTPRequestOperations:batchOperations + progressBlock:nil + completionBlock:nil]; +} + +- (void)cancel { + if (_canceled) return; + _canceled = YES; + for (VKRequest *request in _requests) + [request cancel]; + [self provideError:[NSError errorWithVkError:[VKError errorWithCode:VK_API_CANCELED]]]; + +} + +- (void)provideResponse:(VKResponse *)response { + _responses[[_requests indexOfObject:response.request]] = response; + for (id response in _responses) + if (response == [NSNull null]) return; + + if (self.completeBlock) + self.completeBlock(_responses); +} + +- (void)provideError:(NSError *)error { + if (self.errorBlock) + self.errorBlock(error); +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/VKBundle.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKBundle.h new file mode 100644 index 0000000..5de3bb6 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKBundle.h @@ -0,0 +1,49 @@ +// +// VKBundle.h +// +// Copyright (c) 2014 VK.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 "VKObject.h" + +#define VKLocalizedString(s) [VKBundle localizedString:s] +#define VKImageNamed(s) [VKBundle vkLibraryImageNamed:s] + +/** +Class for providing resources from VK SDK Bundle +*/ +@interface VKBundle : VKObject +/** +Returns bundle for VK SDK (by default VKSdkResources) +@return Bundle object or nil +*/ ++ (NSBundle *)vkLibraryResourcesBundle; + +/** +Searches for image in main application bundle, then VK SDK bundle +@param name Name for image to find +@return Founded image object or nil, if file not found +*/ ++ (UIImage *)vkLibraryImageNamed:(NSString *)name; + +/** +* Returns localized string from VK bundle +*/ ++ (NSString *)localizedString:(NSString *)string; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/VKBundle.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKBundle.m new file mode 100644 index 0000000..ec9d09a --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKBundle.m @@ -0,0 +1,58 @@ +// +// VKBundle.m +// +// Copyright (c) 2014 VK.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 "VKBundle.h" + +@implementation VKBundle ++ (NSBundle *)vkLibraryResourcesBundle { + static dispatch_once_t onceToken; + static NSBundle *myLibraryResourcesBundle = nil; + dispatch_once(&onceToken, ^{ + NSString *fileName = @"VKSdkResources"; + NSString *ext = @"bundle"; + NSURL *url = [[NSBundle mainBundle] URLForResource:fileName withExtension:ext]; + if (!url) { + url = [[NSBundle bundleForClass:[self class]] URLForResource:fileName withExtension:ext]; + } + if (url) { + myLibraryResourcesBundle = [NSBundle bundleWithURL:url]; + } + }); + return myLibraryResourcesBundle; +} + ++ (UIImage *)vkLibraryImageNamed:(NSString *)name { + @autoreleasepool { + UIImage *imageFromMainBundle = [UIImage imageNamed:name]; + if (imageFromMainBundle) { + return imageFromMainBundle; + } + + UIImage *imageFromMyLibraryBundle = [UIImage imageWithContentsOfFile:[[self vkLibraryResourcesBundle] pathForResource:name ofType:@"png"]]; + return imageFromMyLibraryBundle; + } +} + ++ (NSString *)localizedString:(NSString *)string { + return [[self vkLibraryResourcesBundle] localizedStringForKey:string value:string table:nil]; +} +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/VKPermissions.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKPermissions.h new file mode 100644 index 0000000..241e726 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKPermissions.h @@ -0,0 +1,44 @@ +// +// VKPermissions.h +// +// Copyright (c) 2014 VK.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 + +extern NSString *const VK_PER_NOTIFY; +extern NSString *const VK_PER_FRIENDS; +extern NSString *const VK_PER_PHOTOS; +extern NSString *const VK_PER_AUDIO; +extern NSString *const VK_PER_VIDEO; +extern NSString *const VK_PER_DOCS; +extern NSString *const VK_PER_NOTES; +extern NSString *const VK_PER_PAGES; +extern NSString *const VK_PER_STATUS; +extern NSString *const VK_PER_WALL; +extern NSString *const VK_PER_GROUPS; +extern NSString *const VK_PER_MESSAGES; +extern NSString *const VK_PER_NOTIFICATIONS; +extern NSString *const VK_PER_STATS; +extern NSString *const VK_PER_ADS; +extern NSString *const VK_PER_OFFLINE; +extern NSString *const VK_PER_NOHTTPS; +extern NSString *const VK_PER_EMAIL; + +extern NSArray *VKParseVkPermissionsFromInteger(NSInteger permissionsValue); diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/VKPermissions.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKPermissions.m new file mode 100644 index 0000000..2b56bf4 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKPermissions.m @@ -0,0 +1,63 @@ +// +// VKPermissions.c +// +// Copyright (c) 2014 VK.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 "VKPermissions.h" + +NSString *const VK_PER_NOTIFY = @"notify"; +NSString *const VK_PER_FRIENDS = @"friends"; +NSString *const VK_PER_PHOTOS = @"photos"; +NSString *const VK_PER_AUDIO = @"audio"; +NSString *const VK_PER_VIDEO = @"video"; +NSString *const VK_PER_DOCS = @"docs"; +NSString *const VK_PER_NOTES = @"notes"; +NSString *const VK_PER_PAGES = @"pages"; +NSString *const VK_PER_STATUS = @"status"; +NSString *const VK_PER_WALL = @"wall"; +NSString *const VK_PER_GROUPS = @"groups"; +NSString *const VK_PER_MESSAGES = @"messages"; +NSString *const VK_PER_NOTIFICATIONS = @"notifications"; +NSString *const VK_PER_STATS = @"stats"; +NSString *const VK_PER_ADS = @"ads"; +NSString *const VK_PER_OFFLINE = @"offline"; +NSString *const VK_PER_NOHTTPS = @"nohttps"; +NSString *const VK_PER_EMAIL = @"email"; + +NSArray *VKParseVkPermissionsFromInteger(NSInteger permissionsValue) { + NSMutableArray *res = [NSMutableArray new]; + if (permissionsValue & 1) [res addObject:VK_PER_NOTIFY]; + if (permissionsValue & 2) [res addObject:VK_PER_FRIENDS]; + if (permissionsValue & 4) [res addObject:VK_PER_PHOTOS]; + if (permissionsValue & 8) [res addObject:VK_PER_AUDIO]; + if (permissionsValue & 16) [res addObject:VK_PER_VIDEO]; + if (permissionsValue & 128) [res addObject:VK_PER_PAGES]; + if (permissionsValue & 1024) [res addObject:VK_PER_STATUS]; + if (permissionsValue & 2048) [res addObject:VK_PER_NOTES]; + if (permissionsValue & 4096) [res addObject:VK_PER_MESSAGES]; + if (permissionsValue & 8192) [res addObject:VK_PER_WALL]; + if (permissionsValue & 32768) [res addObject:VK_PER_ADS]; + if (permissionsValue & 65536) [res addObject:VK_PER_OFFLINE]; + if (permissionsValue & 131072) [res addObject:VK_PER_DOCS]; + if (permissionsValue & 262144) [res addObject:VK_PER_GROUPS]; + if (permissionsValue & 524288) [res addObject:VK_PER_NOTIFICATIONS]; + if (permissionsValue & 1048576) [res addObject:VK_PER_STATS]; + return res; +} diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/VKSdk.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKSdk.h new file mode 100644 index 0000000..520a7e9 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKSdk.h @@ -0,0 +1,276 @@ +// +// VKSdk.h +// +// Copyright (c) 2014 VK.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. +// +// -------------------------------------------------------------------------------- +// +// Modified by Ruslan Kavetsky + +#import +#import "VKAccessToken.h" +#import "VKPermissions.h" +#import "VKUtil.h" +#import "VKApi.h" +#import "VKApiConst.h" +#import "VKSdkVersion.h" +#import "VKCaptchaViewController.h" +#import "VKRequest.h" +#import "VKBatchRequest.h" +#import "NSError+VKError.h" +#import "VKApiModels.h" +#import "VKUploadImage.h" +#import "VKShareDialogController.h" +#import "VKActivity.h" +#import "VKAuthorizationResult.h" + +typedef NS_OPTIONS(NSUInteger, VKAuthorizationOptions) { + VKAuthorizationOptionsUnlimitedToken = 1 << 0, + VKAuthorizationOptionsDisableSafariController = 1 << 1, +}; + +typedef NS_ENUM(NSUInteger, VKAuthorizationState) { + VKAuthorizationUnknown, // Authorization state unknown, probably something went wrong + VKAuthorizationInitialized, // SDK initialized and ready to authorize + VKAuthorizationPending, // Authorization state pending, probably we're trying to load auth information + VKAuthorizationExternal, // Started external authorization process + VKAuthorizationSafariInApp, // Started in app authorization process, using SafariViewController + VKAuthorizationWebview, // Started in app authorization process, using webview + VKAuthorizationAuthorized, // User authorized + VKAuthorizationError, // An error occured, try to wake up session later +}; + +/** + SDK events delegate protocol. + You should implement it, typically as main view controller or as application delegate. +*/ +@protocol VKSdkDelegate +@required + +/** + Notifies delegate about authorization was completed, and returns authorization result which presents new token or error. + @param result contains new token or error, retrieved after VK authorization + */ +- (void)vkSdkAccessAuthorizationFinishedWithResult:(VKAuthorizationResult *)result; + +/** + Notifies delegate about access error, mostly connected with user deauthorized application + */ +- (void)vkSdkUserAuthorizationFailed; + +@optional + +/** + Notifies delegate about access token changed + @param newToken new token for API requests + @param oldToken previous used token + */ +- (void)vkSdkAccessTokenUpdated:(VKAccessToken *)newToken oldToken:(VKAccessToken *)oldToken; + +/** + Notifies delegate about existing token has expired + @param expiredToken old token that has expired + */ +- (void)vkSdkTokenHasExpired:(VKAccessToken *)expiredToken; + +@end + + +@protocol VKSdkUIDelegate +/** + Pass view controller that should be presented to user. Usually, it's an authorization window + @param controller view controller that must be shown to user + */ +- (void)vkSdkShouldPresentViewController:(UIViewController *)controller; + +/** + Calls when user must perform captcha-check + @param captchaError error returned from API. You can load captcha image from captchaImg property. + After user answered current captcha, call answerCaptcha: method with user entered answer. + */ +- (void)vkSdkNeedCaptchaEnter:(VKError *)captchaError; + +@optional +/** + * Called when a controller presented by SDK will be dismissed + */ +- (void)vkSdkWillDismissViewController:(UIViewController *)controller; + +/** + * Called when a controller presented by SDK did dismiss + */ +- (void)vkSdkDidDismissViewController:(UIViewController *)controller; + + + +@end + + +/** +Entry point for using VK sdk. Should be initialized at application start +*/ +@interface VKSdk : NSObject + +///------------------------------- +/// @name Delegate +///------------------------------- +@property(nonatomic, readwrite, weak) id uiDelegate; + +/// Returns a last app_id used for initializing the SDK +@property(nonatomic, readonly, copy) NSString *currentAppId; + +/// API version for making requests +@property(nonatomic, readonly, copy) NSString *apiVersion; +///------------------------------- +/// @name Initialization +///------------------------------- +/** +Returns instance of VK sdk. You should never use that directly +*/ ++ (instancetype)instance; + +/** +Initialize SDK with responder for global SDK events with default api version from VK_SDK_API_VERSION +@param appId your application id (if you haven't, you can create standalone application here https://vk.com/editapp?act=create ) +*/ ++ (instancetype)initializeWithAppId:(NSString *)appId; + +/** +Initialize SDK with responder for global SDK events +@param appId your application id (if you haven't, you can create standalone application here https://vk.com/editapp?act=create ) +@param apiVersion if you want to use latest API version, pass required version here +*/ ++ (instancetype)initializeWithAppId:(NSString *)appId + apiVersion:(NSString *)version; + +/** + Adds a weak object reference to an object implementing the VKSdkDelegate protocol + */ +- (void)registerDelegate:(id )delegate; + +/** + Removes an object reference SDK delegate + */ +- (void)unregisterDelegate:(id )delegate; + +///------------------------------- +/// @name Authentication in VK +///------------------------------- + +/** +Starts authorization process to retrieve unlimited token. If VKapp is available in system, it will opens and requests access from user. +Otherwise Mobile Safari will be opened for access request. +@param permissions array of permissions for your applications. All permissions you can +*/ ++ (void)authorize:(NSArray *)permissions; + +/** + Starts authorization process. If VKapp is available in system, it will opens and requests access from user. + Otherwise Mobile Safari will be opened for access request. + @param permissions array of permissions for your applications. All permissions you can + @param options special options + */ ++ (void)authorize:(NSArray *)permissions withOptions:(VKAuthorizationOptions)options; + +///------------------------------- +/// @name Access token methods +///------------------------------- + +/** +Returns token for API requests +@return Received access token or nil, if user not yet authorized +*/ ++ (VKAccessToken *)accessToken; + +///------------------------------- +/// @name Other methods +///------------------------------- + +/** +Checks passed URL for access token +@param passedUrl url from external application +@param sourceApplication source application +@return YES if parsed successfully +*/ ++ (BOOL)processOpenURL:(NSURL *)passedUrl fromApplication:(NSString *)sourceApplication; + + +/** + Checks if somebody logged in with SDK (call after wakeUpSession) + */ ++ (BOOL)isLoggedIn; + +/** + This method is trying to retrieve token from storage, and check application still permitted to use user access token + */ ++ (void)wakeUpSession:(NSArray *)permissions completeBlock:(void (^)(VKAuthorizationState, NSError *))wakeUpBlock; + +/** +Forces logout using OAuth (with VKAuthorizeController). Removes all cookies for *.vk.com. +Has no effect for logout in VK app +*/ ++ (void)forceLogout; + +/** +* Checks if there is some application, which may process authorize url +*/ ++ (BOOL)vkAppMayExists; + +/** +Check existing permissions +@param permissions array of permissions you want to check +*/ +- (BOOL)hasPermissions:(NSArray *)permissions; + +/** +Enables or disables scheduling for requests +*/ ++ (void)setSchedulerEnabled:(BOOL)enabled; + +// Deny allocating more SDK ++ (instancetype)alloc NS_UNAVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; + ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface VKAccessToken (HttpsRequired) +- (void)setAccessTokenRequiredHTTPS; + +- (void)notifyTokenExpired; +@end + +@interface VKError (CaptchaRequest) +- (void)notifyCaptchaRequired; + +- (void)notiftAuthorizationFailed; +@end + +@interface UIViewController (VKController) + +- (void)vks_presentViewControllerThroughDelegate; + +- (void)vks_viewControllerWillDismiss; + +- (void)vks_viewControllerDidDismiss; + +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/VKSdk.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKSdk.m new file mode 100644 index 0000000..a6dd610 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKSdk.m @@ -0,0 +1,598 @@ +// +// VKSdk.m +// +// Copyright (c) 2014 VK.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. +// +// -------------------------------------------------------------------------------- +// +// Modified by Ruslan Kavetsky + +#ifdef DEBUG + +#define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__] + +#else + +#define ALog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__]) + +#endif + +#define ZAssert(condition, ...) do { if (!(condition)) { ALog(__VA_ARGS__); }} while(0) + +#import +#import "VKSdk.h" +#import "VKAuthorizeController.h" +#import "VKRequestsScheduler.h" + +@interface VKWeakDelegate : NSProxy +@property(nonatomic, weak) id weakTarget; + ++ (instancetype)with:(id )delegate; + +- (BOOL)isEqualTarget:(id )delegate; + +@end + +@interface VKSdk () + +@property(nonatomic, readonly, strong) NSMutableArray *sdkDelegates; + +@property(nonatomic, assign) VKAuthorizationState authState; +@property(nonatomic, assign) VKAuthorizationOptions lastKnownOptions; + +@property(nonatomic, readwrite, copy) NSString *currentAppId; +@property(nonatomic, readwrite, copy) NSString *apiVersion; +@property(nonatomic, readwrite, strong) VKAccessToken *accessToken; +@property(nonatomic, weak) UIViewController *presentedSafariViewController; + +@property(nonatomic, strong) NSSet *permissions; +@end + +@interface VKRequest () +@property(nonatomic, readwrite, strong) VKAccessToken *specialToken; +@end + + +@implementation VKSdk + +static VKSdk *vkSdkInstance = nil; +static NSArray *kSpecialPermissions = nil; +static NSString *VK_ACCESS_TOKEN_DEFAULTS_KEY = @"VK_ACCESS_TOKEN_DEFAULTS_KEY_DONT_TOUCH_THIS_PLEASE"; +static NSString *VK_AUTHORIZE_URL_STRING = @"vkauthorize://authorize"; + +#pragma mark Initialization + ++ (void)initialize { + ZAssert([VKSdk class] == self, @"Subclassing is not welcome"); +} + ++ (instancetype)instance { + ZAssert(vkSdkInstance, @"VKSdk should be initialized. Use [VKSdk initialize:delegate] method"); + return vkSdkInstance; +} + ++ (instancetype)initializeWithAppId:(NSString *)appId { + return [self initializeWithAppId:appId apiVersion:VK_SDK_API_VERSION]; +} + ++ (instancetype)initializeWithAppId:(NSString *)appId apiVersion:(NSString *)version { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + vkSdkInstance = [(VKSdk *) [super alloc] initUniqueInstance]; + kSpecialPermissions = @[VK_PER_OFFLINE, VK_PER_NOHTTPS, VK_PER_NOTIFY, VK_PER_EMAIL]; + }); + + vkSdkInstance.currentAppId = appId; + vkSdkInstance.apiVersion = version; + + [[VKRequestsScheduler instance] setEnabled:YES]; + return vkSdkInstance; +} + +- (void)registerDelegate:(id )delegate { + for (VKWeakDelegate *d in self.sdkDelegates) { + if ([d isEqualTarget:delegate]) { + return; + } + } + [self.sdkDelegates addObject:[VKWeakDelegate with:delegate]]; +} + +- (void)unregisterDelegate:(id )delegate { + for (VKWeakDelegate *d in [self.sdkDelegates copy]) { + if ([d isEqualTarget:delegate]) { + [self.sdkDelegates removeObject:d]; + } + if (d.weakTarget == nil) { + [self.sdkDelegates removeObject:d]; + } + } +} + +#pragma mark Authorization + ++ (void)authorize:(NSArray *)permissions { + [self authorize:permissions withOptions:VKAuthorizationOptionsUnlimitedToken]; +} + ++ (void)authorize:(NSArray *)permissions withOptions:(VKAuthorizationOptions)options { + permissions = permissions ?: @[]; + NSMutableSet *permissionsSet = [NSMutableSet setWithArray:permissions ?: @[]]; + + if (options & VKAuthorizationOptionsUnlimitedToken) { + [permissionsSet addObject:VK_PER_OFFLINE]; + } + VKSdk *instance = [VKSdk instance]; + instance.lastKnownOptions = options; + + if ([self accessToken] && [instance.permissions isEqualToSet:permissionsSet]) { + instance.accessToken = [self accessToken]; + return; + } + if (instance.authState == VKAuthorizationAuthorized) { + instance.authState = VKAuthorizationInitialized; + } + + instance.permissions = [permissionsSet copy]; + permissions = [permissionsSet allObjects]; + + BOOL vkApp = [self vkAppMayExists] + && instance.authState == VKAuthorizationInitialized; + + BOOL safariEnabled = !(options & VKAuthorizationOptionsDisableSafariController); + + NSString *clientId = instance.currentAppId; + NSURL *urlToOpen = [VKAuthorizeController buildAuthorizationURL:vkApp ? VK_AUTHORIZE_URL_STRING : nil + redirectUri:[NSString stringWithFormat:@"vk%@://authorize", clientId] + clientId:clientId + scope:[permissions componentsJoinedByString:@","] + revoke:YES + display:VK_DISPLAY_IOS]; + + if (vkApp) { + [[UIApplication sharedApplication] openURL:urlToOpen]; + instance.authState = VKAuthorizationExternal; + } else if (safariEnabled && [SFSafariViewController class] && instance.authState < VKAuthorizationSafariInApp) { + SFSafariViewController *viewController = [[SFSafariViewController alloc] initWithURL:urlToOpen]; + viewController.delegate = instance; + [viewController vks_presentViewControllerThroughDelegate]; + instance.presentedSafariViewController = viewController; + + instance.authState = VKAuthorizationSafariInApp; + } else { + //Authorization through popup webview + [VKAuthorizeController presentForAuthorizeWithAppId:clientId + andPermissions:permissions + revokeAccess:YES + displayType:VK_DISPLAY_IOS]; + instance.authState = VKAuthorizationWebview; + } +} + ++ (BOOL)vkAppMayExists { + return [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:VK_AUTHORIZE_URL_STRING]] && [UIDevice currentDevice].userInterfaceIdiom != UIUserInterfaceIdiomPad /*Temporary workaround, because iPad app authorization is buggy*/; +} + +#pragma mark Access token + ++ (void)setAccessToken:(VKAccessToken *)token { + [token saveTokenToDefaults:VK_ACCESS_TOKEN_DEFAULTS_KEY]; + + id oldToken = vkSdkInstance.accessToken; + if (!token && oldToken) { + [VKAccessToken delete:VK_ACCESS_TOKEN_DEFAULTS_KEY]; + } + + vkSdkInstance.authState = token ? VKAuthorizationAuthorized : VKAuthorizationInitialized; + vkSdkInstance.accessToken = token; +} + ++ (VKAccessToken *)accessToken { + return vkSdkInstance.accessToken; +} + ++ (BOOL)processOpenURL:(NSURL *)passedUrl validation:(BOOL)validation { + NSString *urlString = [passedUrl absoluteString]; + NSRange rangeOfHash = [urlString rangeOfString:@"#"]; + if (rangeOfHash.location == NSNotFound) { + return NO; + } + + VKSdk *instance = [self instance]; + + void (^notifyAuthorization)(VKAccessToken *, VKError *) = ^(VKAccessToken *token, VKError *error) { + VKAuthorizationResult *res = [VKAuthorizationResult new]; + res.error = error ? [NSError errorWithVkError:error] : nil; + res.token = token; + if (token) { + [instance requestSdkState:^(VKUser *visitor, NSInteger per, NSError *err) { + if (visitor) { + + VKAccessTokenMutable *mToken = (VKAccessTokenMutable *) [token mutableCopy]; + mToken.permissions = [instance updatePermissions:per]; + instance.permissions = [NSSet setWithArray:mToken.permissions ?: @[]]; + mToken.localUser = visitor; + + [self setAccessToken:mToken]; + res.user = visitor; + res.token = mToken; + } else if (err) { + res.error = err; + } + [instance notifyDelegate:@selector(vkSdkAccessAuthorizationFinishedWithResult:) obj:res]; + } trackVisitor:YES token:token]; + } else { + [instance notifyDelegate:@selector(vkSdkAccessAuthorizationFinishedWithResult:) obj:res]; + } + + }; + + NSString *parametersString = [urlString substringFromIndex:rangeOfHash.location + 1]; + if (parametersString.length == 0) { + VKError *error = [VKError errorWithCode:VK_API_CANCELED]; + if (!validation) { + notifyAuthorization(nil, error); + [instance resetSdkState]; + } + return NO; + } + NSDictionary *parametersDict = [VKUtil explodeQueryString:parametersString]; + BOOL inAppCheck = [[passedUrl host] isEqual:@"oauth.vk.com"]; + + void (^hideViews)() = ^{ + if (instance.presentedSafariViewController) { + [instance.presentedSafariViewController dismissViewControllerAnimated:YES completion:nil]; + instance.presentedSafariViewController = nil; + } + }; + + void (^throwError)() = ^{ + VKError *error = [VKError errorWithQuery:parametersDict]; + if (!validation) { + notifyAuthorization(nil, error); + [instance resetSdkState]; + } + }; + + BOOL result = YES; + if (!inAppCheck && parametersDict[@"error"]) { + if ([parametersDict[@"error_reason"] isEqual:@"sdk_error"] && instance.authState == VKAuthorizationExternal) { + //Try internal authorize + [self authorize:[instance.permissions allObjects]]; + } else { + throwError(); + } + result = NO; + } else if (inAppCheck && (parametersDict[@"cancel"] || parametersDict[@"error"] || parametersDict[@"fail"])) { + throwError(); + result = NO; + } else if (inAppCheck && parametersDict[@"success"]) { + if (parametersDict[@"access_token"]) { + VKAccessToken *prevToken = [VKSdk accessToken]; + VKAccessTokenMutable *token = [VKAccessTokenMutable tokenWithToken:parametersDict[@"access_token"] ?: prevToken.accessToken + secret:parametersDict[@"secret"] ?: prevToken.secret + userId:parametersDict[@"user_id"] ?: prevToken.userId]; + token.expiresIn = prevToken.expiresIn; + token.permissions = prevToken.permissions; + token.httpsRequired = prevToken.httpsRequired; + + if (!validation) { + notifyAuthorization(token, nil); + } else { + [self setAccessToken:token]; + } + } + } else { + + NSMutableString *newParametersString = [parametersString mutableCopy]; + [newParametersString appendFormat:@"&permissions=%@", [[instance.permissions allObjects] componentsJoinedByString:@","]]; + + VKAccessToken *token = [VKAccessToken tokenFromUrlString:newParametersString]; + if (!token.accessToken) { + result = NO; + } else { + notifyAuthorization(token, nil); + } + } + hideViews(); + return result; +} + ++ (BOOL)processOpenURL:(NSURL *)passedUrl fromApplication:(NSString *)sourceApplication { + if ([sourceApplication isEqualToString:VK_DEBUG_CLIENT_BUNDLE] + || [sourceApplication isEqualToString:VK_ORIGINAL_CLIENT_BUNDLE] + || [sourceApplication isEqualToString:VK_ORIGINAL_HD_CLIENT_BUNDLE] + || [passedUrl.scheme isEqualToString:[NSString stringWithFormat:@"vk%@", vkSdkInstance.currentAppId]]) { + return [self processOpenURL:passedUrl validation:NO]; + } + return NO; +} + ++ (BOOL)processOpenInternalURL:(NSURL *)passedUrl validation:(BOOL)validation { + return [self processOpenURL:passedUrl validation:validation]; +} + ++ (void)forceLogout { + NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]; + + for (NSHTTPCookie *cookie in cookies) + if (NSNotFound != [cookie.domain rangeOfString:@"vk.com"].location) { + [[NSHTTPCookieStorage sharedHTTPCookieStorage] + deleteCookie:cookie]; + } + [VKAccessToken delete:VK_ACCESS_TOKEN_DEFAULTS_KEY]; + + if (vkSdkInstance) { + vkSdkInstance.accessToken = nil; + vkSdkInstance.permissions = nil; + vkSdkInstance.authState = VKAuthorizationInitialized; + } +} + ++ (BOOL)isLoggedIn { + if (vkSdkInstance.accessToken && ![vkSdkInstance.accessToken isExpired]) return true; + return false; +} + ++ (void)wakeUpSession:(NSArray *)permissions completeBlock:(void (^)(VKAuthorizationState, NSError *error))wakeUpBlock { + VKAccessToken *token = [self accessToken] ?: [VKAccessToken savedToken:VK_ACCESS_TOKEN_DEFAULTS_KEY]; + VKSdk *instance = [self instance]; + if (!token || token.isExpired) { + [instance resetSdkState]; + wakeUpBlock(instance.authState, nil); + } else { + + BOOL firstCall = instance.accessToken == nil; + instance.accessToken = token; + instance.authState = VKAuthorizationPending; + + [[VKSdk instance] requestSdkState:^(VKUser *visitor, NSInteger per, NSError *error) { + + instance.authState = VKAuthorizationUnknown; + if (visitor) { + VKAccessTokenMutable *mToken = (VKAccessTokenMutable *) [token mutableCopy]; + mToken.permissions = [instance updatePermissions:per]; + instance.permissions = [NSSet setWithArray:mToken.permissions ?: @[]]; + mToken.localUser = visitor; + instance.accessToken = mToken; + + if ([instance hasPermissions:permissions]) { + instance.authState = VKAuthorizationAuthorized; + } else { + [instance resetSdkState]; + } + } else if (error) { + instance.authState = VKAuthorizationError; + instance.accessToken = nil; + + VKError *vkError = error.vkError; + if (vkError.errorCode == 5) { + //Remove token from storage + [self setAccessToken:nil]; + instance.authState = VKAuthorizationInitialized; + } + } + wakeUpBlock(instance.authState, error); + + } trackVisitor:firstCall token:token]; + + } + +} + +- (BOOL)hasPermissions:(NSArray *)permissions { + NSMutableArray *mutablePermissions = permissions ? [permissions mutableCopy] : [NSMutableArray new]; + [mutablePermissions removeObjectsInArray:kSpecialPermissions]; + + BOOL allExisted = YES; + NSSet *tokenPermission = [NSSet setWithArray:self.accessToken.permissions]; + for (NSString *p in mutablePermissions) { + if (![tokenPermission containsObject:p]) { + allExisted = NO; + break; + } + } + return allExisted; +} + + +- (NSArray *)updatePermissions:(NSInteger)appPermissions { + NSMutableSet *permissions = [NSMutableSet setWithArray:VKParseVkPermissionsFromInteger(appPermissions)]; + for (NSString *sPermission in kSpecialPermissions) { + if ([self.permissions containsObject:sPermission]) { + [permissions addObject:sPermission]; + } + } + return [permissions allObjects]; +} + ++ (void)setSchedulerEnabled:(BOOL)enabled { + [[VKRequestsScheduler instance] setEnabled:enabled]; +} + + +#pragma mark - Instance methods + +- (instancetype)initUniqueInstance { + self = [super init]; + [self resetSdkState]; + _sdkDelegates = [NSMutableArray new]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleDidBecomeActive) name:UIApplicationDidBecomeActiveNotification object:nil]; + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +- (void)handleDidBecomeActive { + if (self.authState == VKAuthorizationExternal) { + [VKSdk authorize:[vkSdkInstance.permissions allObjects] withOptions:vkSdkInstance.lastKnownOptions]; + } +} + +- (NSString *)currentAppId { + return _currentAppId; +} + +- (void)requestSdkState:(void (^)(VKUser *visitor, NSInteger permissions, NSError *error))infoCallback trackVisitor:(BOOL)trackVisitor token:(VKAccessToken *)token { + NSString *code = [NSString stringWithFormat:@"return {permissions:API.account.getAppPermissions(),user:API.users.get({fields : \"photo_50,photo_100,photo_200\"})[0],%1$@};", trackVisitor ? @"stats:API.stats.trackVisitor()," : @""]; + VKRequest *req = [VKRequest requestWithMethod:@"execute" andParameters:@{@"code" : code}]; + req.specialToken = token; + req.preventThisErrorsHandling = @[@5]; + [req executeWithResultBlock:^(VKResponse *response) { + VKUser *user = [[VKUser alloc] initWithDictionary:response.json[@"user"]]; + if (infoCallback) { + infoCallback(user, [VK_ENSURE_NUM(response.json[@"permissions"]) integerValue], nil); + } + } errorBlock:^(NSError *error) { + if (infoCallback) { + infoCallback(nil, 0, error); + } + }]; +} + +- (void)notifyUserAuthorizationFailed:(VKError *)error { + [self notifyDelegate:@selector(vkSdkUserAuthorizationFailed) obj:nil]; + [[self class] setAccessToken:nil]; + [self resetSdkState]; +} + +- (void)resetSdkState { + self.permissions = nil; + self.authState = VKAuthorizationInitialized; + self.lastKnownOptions = 0; + self.accessToken = nil; +} + +- (void)notifyDelegate:(SEL)sel obj:(id)obj { + for (VKWeakDelegate *del in self.sdkDelegates) { + if ([del respondsToSelector:sel]) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + [del performSelector:sel withObject:obj]; +#pragma clang diagnostic pop + } + } +} + +- (void)setAccessToken:(VKAccessToken *)accessToken { + VKAccessToken *old = _accessToken; + _accessToken = accessToken; + + for (VKWeakDelegate *del in self.sdkDelegates) { + if ([del respondsToSelector:@selector(vkSdkAccessTokenUpdated:oldToken:)]) { + [del performSelector:@selector(vkSdkAccessTokenUpdated:oldToken:) withObject:self.accessToken withObject:old]; + } + } +} + +#pragma mark - SFSafariViewController delegate + +- (void)safariViewControllerDidFinish:(SFSafariViewController *)controller { + [[self class] processOpenURL:[NSURL URLWithString:@"#"] validation:NO]; +} + +@end + +@implementation VKWeakDelegate { + Class objectClass; +} + ++ (instancetype)with:(id )delegate { + VKWeakDelegate *res = [[self alloc] initWithObject:delegate]; + return res; +} + +- (instancetype)initWithObject:(id )object { + self.weakTarget = object; + objectClass = [object class]; + return self; +} + +- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel { + NSObject *targ = (id) self.weakTarget; + if (targ) { + return [targ methodSignatureForSelector:sel]; + } else { + return [objectClass instanceMethodSignatureForSelector:sel]; + } +} + +- (void)forwardInvocation:(NSInvocation *)invocation { + if (self.weakTarget) { + [invocation invokeWithTarget:self.weakTarget]; + } +} + +- (BOOL)isEqualTarget:(id )delegate { + return _weakTarget == delegate; +} + +@end + + +@implementation VKAccessToken (HttpsRequired) + +- (void)setAccessTokenRequiredHTTPS { + VKAccessTokenMutable *token = (VKAccessTokenMutable *) [[VKSdk accessToken] mutableCopy]; + token.httpsRequired = YES; + [VKSdk setAccessToken:token]; +} + +- (void)notifyTokenExpired { + [[VKSdk instance] notifyDelegate:@selector(vkSdkTokenHasExpired:) obj:self]; +} + +@end + + +@implementation VKError (CaptchaRequest) + +- (void)notifyCaptchaRequired { + [[VKSdk instance].uiDelegate vkSdkNeedCaptchaEnter:self]; +} + +- (void)notiftAuthorizationFailed { + [[VKSdk instance] notifyUserAuthorizationFailed:self]; +} + +@end + + +@implementation UIViewController (VKController) + +- (void)vks_presentViewControllerThroughDelegate { + [[VKSdk instance].uiDelegate vkSdkShouldPresentViewController:self]; +} + +- (void)vks_viewControllerWillDismiss { + if ([[VKSdk instance].uiDelegate respondsToSelector:@selector(vkSdkWillDismissViewController:)]) { + [[VKSdk instance].uiDelegate vkSdkWillDismissViewController:self]; + } +} + +- (void)vks_viewControllerDidDismiss { + if ([[VKSdk instance].uiDelegate respondsToSelector:@selector(vkSdkDidDismissViewController:)]) { + [[VKSdk instance].uiDelegate vkSdkDidDismissViewController:self]; + } +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/VKSdkVersion.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKSdkVersion.h new file mode 100644 index 0000000..d1b9fbf --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/VKSdkVersion.h @@ -0,0 +1,24 @@ +// +// VKSdkVersion.h +// +// Copyright (c) 2014 VK.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. + +#define VK_SDK_VERSION @"1.3.8" +#define VK_SDK_API_VERSION @"5.40" diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKActivity.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKActivity.h new file mode 100644 index 0000000..d8fa60e --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKActivity.h @@ -0,0 +1,39 @@ +// +// VKActivity.h +// +// Copyright (c) 2014 VK.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 + +extern NSString *const VKActivityTypePost; + +/** +* Class for sharing in VK throught UIActivityController +*/ +@interface VKActivity : UIActivity + +/** + * You should call this method to checks if VK app can show share extension (available from version 2.4, but flag supported in 2.5). + * + * @return YES, if VK Share extension available, and you don't have use VKActivity class + */ ++ (BOOL)vkShareExtensionEnabled; + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKActivity.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKActivity.m new file mode 100644 index 0000000..547077c --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKActivity.m @@ -0,0 +1,93 @@ +// +// VKActivity.m +// +// Copyright (c) 2014 VK.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 "VKActivity.h" +#import "VKBundle.h" +#import "VKShareDialogController.h" +#import "VKUtil.h" + +NSString *const VKActivityTypePost = @"VKActivityTypePost"; + +@interface VKActivity () +@property(nonatomic, strong) VKShareDialogController *shareDialog; +@end + +@implementation VKActivity ++ (UIActivityCategory)activityCategory { + return UIActivityCategoryShare; +} + ++ (BOOL)vkShareExtensionEnabled { + return NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1 && [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"vk-share://extension"]]; +} + +- (NSString *)activityType { + return VKActivityTypePost; +} + +- (UIImage *)activityImage { + if (VK_SYSTEM_VERSION_LESS_THAN(@"8.0")) + return VKImageNamed(@"ic_vk_ios7_activity_logo"); + + return VKImageNamed(@"ic_vk_activity_logo"); +} + +- (NSString *)activityTitle { + return VKLocalizedString(@"VK"); +} + +- (BOOL)canPerformWithActivityItems:(NSArray *)activityItems { + for (id item in activityItems) { + if ([item isKindOfClass:[UIImage class]]) return YES; + else if ([item isKindOfClass:[NSString class]]) return YES; + else if ([item isKindOfClass:[NSURL class]]) return YES; + } + return NO; +} + +- (void)prepareWithActivityItems:(NSArray *)activityItems { + self.shareDialog = [VKShareDialogController new]; + NSMutableArray *uploadImages = [NSMutableArray new]; + for (id item in activityItems) { + if ([item isKindOfClass:[NSString class]]) { + self.shareDialog.text = item; + } else if ([item isKindOfClass:[NSAttributedString class]]) { + self.shareDialog.text = [(NSAttributedString *) item string]; + } else if ([item isKindOfClass:[UIImage class]]) { + [uploadImages addObject:[VKUploadImage uploadImageWithImage:item andParams:[VKImageParameters jpegImageWithQuality:0.95]]]; + } else if ([item isKindOfClass:[NSURL class]]) { + self.shareDialog.shareLink = [[VKShareLink alloc] initWithTitle:nil link:item]; + } + } + self.shareDialog.uploadImages = uploadImages; + __weak __typeof(self) wself = self; + [self.shareDialog setCompletionHandler:^(VKShareDialogController *dialog, VKShareDialogControllerResult result) { + __strong __typeof(wself) sself = wself; + [sself activityDidFinish:result == VKShareDialogControllerResultDone]; + sself.shareDialog = nil; + }]; +} + +- (UIViewController *)activityViewController { + return self.shareDialog; +} +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKAuthorizeController.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKAuthorizeController.h new file mode 100644 index 0000000..7cd45c3 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKAuthorizeController.h @@ -0,0 +1,65 @@ +// +// VKAuthorizeController.h +// +// Copyright (c) 2014 VK.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 "VKSdk.h" + +/** +Controller for authorization through webview (if VK app not available) +*/ +@interface VKAuthorizeController : UIViewController + +/** +Causes UIWebView in standard UINavigationController be presented in SDK delegate +@param appId Identifier of VK application +@param permissions Permissions that user specified for application +@param revoke If YES, user will see permissions list and allow to logout (if logged in already) +@param displayType Defines view of authorization screen +*/ ++ (void)presentForAuthorizeWithAppId:(NSString *)appId + andPermissions:(NSArray *)permissions + revokeAccess:(BOOL)revoke + displayType:(VKDisplayType)displayType; + +/** +Causes UIWebView in standard UINavigationController be presented for user validation +@param validationError validation error returned by API +*/ ++ (void)presentForValidation:(VKError *)validationError; + +/** + Builds url for oauth authorization + @param prefix url prefix for authorization url + @param redirectUri uri for redirect + @param clientId id of your application + @param scope requested scope for application + @param revoke If YES, user will see permissions list and allow to logout (if logged in already) + @param display select display type + @return Complete url-string for grant authorization +*/ ++ (NSURL *)buildAuthorizationURL:(NSString *)prefix + redirectUri:(NSString *)redirectUri + clientId:(NSString *)clientId + scope:(NSString *)scope + revoke:(BOOL)revoke + display:(NSString *)display; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKAuthorizeController.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKAuthorizeController.m new file mode 100644 index 0000000..6ea27e6 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKAuthorizeController.m @@ -0,0 +1,300 @@ +// +// VKAuthorizeController.m +// +// Copyright (c) 2014 VK.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 "VKAuthorizeController.h" +#import "VKBundle.h" + +@implementation UINavigationController (LastControllerBar) + +- (UIStatusBarStyle)preferredStatusBarStyle { + if (self.viewControllers.count) + return [[self.viewControllers lastObject] preferredStatusBarStyle]; + return UIStatusBarStyleDefault; +} +@end + +@interface VKSdk () ++ (BOOL)processOpenInternalURL:(NSURL *)passedUrl validation:(BOOL)validation; +@end + +@interface VKAuthorizeController () +@property(nonatomic, strong) UIWebView *webView; +@property(nonatomic, strong) NSString *appId; +@property(nonatomic, strong) NSString *scope; +@property(nonatomic, strong) NSURL *redirectUri; +@property(nonatomic, strong) UIActivityIndicatorView *activityMark; +@property(nonatomic, strong) UILabel *warningLabel; +@property(nonatomic, strong) UILabel *statusBar; +@property(nonatomic, strong) VKError *validationError; +@property(nonatomic, strong) NSURLRequest *lastRequest; +@property(nonatomic, weak) UINavigationController *internalNavigationController; +@property(nonatomic, assign) BOOL finished; + +@end + +@implementation VKAuthorizeController + ++ (void)presentForAuthorizeWithAppId:(NSString *)appId + andPermissions:(NSArray *)permissions + revokeAccess:(BOOL)revoke + displayType:(VKDisplayType)type { + VKAuthorizeController *controller = [[VKAuthorizeController alloc] initWith:appId andPermissions:permissions revokeAccess:revoke displayType:type]; + [self presentThisController:controller]; +} + ++ (void)presentForValidation:(VKError *)validationError { + VKAuthorizeController *controller = [[VKAuthorizeController alloc] init]; + controller.validationError = validationError; + [self presentThisController:controller]; +} + ++ (void)presentThisController:(VKAuthorizeController *)controller { + UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:controller]; + + if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) { + navigation.navigationBar.barTintColor = VK_COLOR; + navigation.navigationBar.tintColor = [UIColor whiteColor]; + navigation.navigationBar.translucent = YES; + } + if (VK_IS_DEVICE_IPAD) { + navigation.modalPresentationStyle = UIModalPresentationFormSheet; + navigation.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; + } + + UIImage *image = [VKBundle vkLibraryImageNamed:@"ic_vk_logo_nb"]; + controller.navigationItem.titleView = [[UIImageView alloc] initWithImage:image]; + [navigation vks_presentViewControllerThroughDelegate]; + + controller.internalNavigationController = navigation; +} + ++ (NSURL *)buildAuthorizationURL:(NSString *)prefix + redirectUri:(NSString *)redirectUri + clientId:(NSString *)clientId + scope:(NSString *)scope + revoke:(BOOL)revoke + display:(NSString *)display { + NSDictionary *params = @{ + @"v" : [[VKSdk instance] apiVersion], + @"scope" : scope ?: @"", + @"revoke" : @(revoke), + @"display" : display ?: VK_DISPLAY_MOBILE, + @"client_id" : clientId ?: @"", + @"sdk_version" : VK_SDK_VERSION, + @"redirect_uri" : redirectUri ?: @"", + @"response_type" : @"token" + }; + return [NSURL URLWithString:[NSString stringWithFormat:@"%@?%@", prefix ?: @"https://oauth.vk.com/authorize", [VKUtil queryStringFromParams:params]]]; +} + +#pragma mark View prepare + +- (void)loadView { + [super loadView]; + if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) { + self.edgesForExtendedLayout = UIRectEdgeNone; + } + UIView *view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; + view.backgroundColor = [UIColor colorWithRed:240.0f / 255 green:242.0f / 255 blue:245.0f / 255 alpha:1.0f]; + self.view = view; + _activityMark = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; + [_activityMark startAnimating]; + _activityMark.center = CGPointMake(view.frame.size.width / 2, view.frame.size.height / 2); + _activityMark.autoresizingMask = + UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | + UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin; + [view addSubview:_activityMark]; + + _warningLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, _activityMark.frame.origin.y + _activityMark.frame.size.height + 20, + self.view.frame.size.width - 20, 30)]; + _warningLabel.autoresizingMask = + UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | + UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin; + _warningLabel.numberOfLines = 3; + _warningLabel.hidden = YES; + _warningLabel.textColor = VK_COLOR; + _warningLabel.textAlignment = NSTextAlignmentCenter; + _warningLabel.font = [UIFont boldSystemFontOfSize:15]; + _warningLabel.text = VKLocalizedString(@"Please check your internet connection"); + [view addSubview:_warningLabel]; + + _webView = [[UIWebView alloc] initWithFrame:view.bounds]; + _webView.delegate = self; + _webView.hidden = YES; + _webView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + _webView.scalesPageToFit = YES; + _webView.scrollView.bounces = NO; + _webView.scrollView.clipsToBounds = NO; + [view addSubview:_webView]; + if (self.internalNavigationController) { +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0 + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:[VKBundle localizedString:@"Cancel"] style:UIBarButtonItemStylePlain target:self action:@selector(cancelAuthorization:)]; +#else + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:[VKBundle localizedString:@"Cancel"] style:UIBarButtonItemStyleBordered target:self action:@selector(cancelAuthorization:)]; +#endif + } +} + +- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { + [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; + [self makeViewport]; +} + +- (instancetype)initWith:(NSString *)appId andPermissions:(NSArray *)permissions revokeAccess:(BOOL)revoke displayType:(VKDisplayType)display { + self = [super init]; + _appId = appId; + _scope = [permissions componentsJoinedByString:@","]; + _redirectUri = [[self class] buildAuthorizationURL:nil redirectUri:nil clientId:_appId scope:_scope revoke:revoke display:display]; + return self; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + [self startLoading]; +} + +- (void)startLoading { + if (!self.redirectUri) { + self.redirectUri = [NSURL URLWithString:self.validationError.redirectUri]; + + } + NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:self.redirectUri]; + + [_webView loadRequest:request]; +} + +#pragma mark Web view work + +- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { + self.lastRequest = request; + NSString *urlString = [[request URL] absoluteString]; + self.statusBar.text = urlString; + if (!webView.hidden && !self.navigationItem.rightBarButtonItem) { + [self setRightBarButtonActivity]; + } + if ([[[request URL] path] isEqual:@"/blank.html"]) { + [self dismissWithCompletion:^{ + if ([VKSdk processOpenInternalURL:[request URL] validation:self.validationError != nil] && self.validationError) { + [self.validationError.request repeat]; + } else if (self.validationError) { + [self.validationError.request cancel]; + } + }]; + return NO; + } + return YES; +} + +- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { + if (self.finished) return; + if ([error code] != NSURLErrorCancelled) { + self.warningLabel.hidden = NO; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (500 * NSEC_PER_MSEC)), dispatch_get_main_queue(), ^(void) { + [webView loadRequest:_lastRequest]; + if (!self.navigationItem.rightBarButtonItem) + [self setRightBarButtonActivity]; + }); + } +} + +- (void)setRightBarButtonActivity { + UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; + [activityView sizeToFit]; + [activityView setAutoresizingMask:(UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin)]; + [activityView startAnimating]; + [self.navigationItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithCustomView:activityView] animated:YES]; +} + +- (void)webViewDidFinishLoad:(UIWebView *)webView { + [self makeViewport]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (300 * NSEC_PER_MSEC)), dispatch_get_main_queue(), ^(void) { + _warningLabel.hidden = YES; + webView.hidden = NO; + self.navigationItem.rightBarButtonItem = nil; + }); +} + +- (void)makeViewport { + NSString *javaScript = [NSString stringWithFormat:@"viewport = document.querySelector('meta[name=viewport]'); viewport.setAttribute('content', 'width = %d, height = %d, initial-scale = 1.0, maximum-scale = 1.0, minimum-scale = 1.0, user-scalable=yes');", (int) self.webView.frame.size.width, (int) self.webView.frame.size.height]; + [_webView stringByEvaluatingJavaScriptFromString:javaScript]; +} + +#pragma mark Cancelation and dismiss + +- (void)cancelAuthorization:(id)sender { + [self dismissWithCompletion:^{ + if (!_validationError) { + //Silent cancel + [VKSdk processOpenInternalURL:[NSURL URLWithString:@"#"] validation:NO]; + } else { + [_validationError.request cancel]; + } + }]; + if (_validationError) { + NSError *error = [NSError errorWithVkError:[VKError errorWithCode:VK_AUTHORIZE_CONTROLLER_CANCEL]]; + if (_validationError.request.errorBlock) { + _validationError.request.errorBlock(error); + } + } +} + +- (void)dismissWithCompletion:(void (^)())completion { + _finished = YES; + + if (_internalNavigationController.isBeingDismissed) { + if (completion) { + completion(); + } + + return; + } + + if (!_internalNavigationController) { + if (self.navigationController) { + [self vks_viewControllerWillDismiss]; + [self.navigationController popViewControllerAnimated:YES]; + if (completion) { + completion(); + } + } else if (self.presentingViewController) { + [self vks_viewControllerWillDismiss]; + [self.presentingViewController dismissViewControllerAnimated:YES completion:^{ + [self vks_viewControllerDidDismiss]; + if (completion) { + completion(); + } + }]; + } + } else { + [self vks_viewControllerWillDismiss]; + [_internalNavigationController.presentingViewController dismissViewControllerAnimated:YES completion:^{ + [self vks_viewControllerDidDismiss]; + completion(); + }]; + } +} + +- (UIStatusBarStyle)preferredStatusBarStyle { + return UIStatusBarStyleLightContent; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKCaptchaView.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKCaptchaView.h new file mode 100644 index 0000000..bf32325 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKCaptchaView.h @@ -0,0 +1,41 @@ +// +// VKCaptchaView.h +// +// Copyright (c) 2014 VK.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 "VKError.h" + +extern CGFloat kCaptchaImageWidth; +extern CGFloat kCaptchaImageHeight; +extern CGFloat kCaptchaViewHeight; + +/** +View for displaying captcha. Don't use it dirrectly. Use VKCaptchaViewController +*/ +@interface VKCaptchaView : UIView +/** +Initializes view with captcha error +@param frame bounds of window where view will be displayed +@param captchaError error for request that causes captcha-check +*/ +- (id)initWithFrame:(CGRect)frame andError:(VKError *)captchaError; + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKCaptchaView.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKCaptchaView.m new file mode 100644 index 0000000..01a8e52 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKCaptchaView.m @@ -0,0 +1,116 @@ +// +// VKCaptchaView.m +// +// Copyright (c) 2014 VK.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 "VKCaptchaView.h" +#import "VKUtil.h" +#import "VKHTTPClient.h" +#import "VKHTTPOperation.h" + +@interface VKCaptchaView () { + VKError *_error; + UIImageView *_captchaImage; + UILabel *_infoLabel; + UITextField *_captchaTextField; + UIButton *_doneButton; + UIActivityIndicatorView *_imageLoadingActivity; +} +@end + +CGFloat kCaptchaImageWidth = 240; +CGFloat kCaptchaImageHeight = 96; +CGFloat kCaptchaViewHeight = 138; + +@implementation VKCaptchaView +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +- (id)initWithFrame:(CGRect)frame andError:(VKError *)captchaError { + if ((self = [super initWithFrame:frame])) { + self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + [self setBackgroundColor:VK_COLOR]; + + _error = captchaError; + + _imageLoadingActivity = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake((self.bounds.size.width - 30) / 2, 40, 30, 30)]; + _imageLoadingActivity.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge; + _imageLoadingActivity.hidesWhenStopped = YES; + _imageLoadingActivity.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin; + [self addSubview:_imageLoadingActivity]; + [_imageLoadingActivity startAnimating]; + + _captchaImage = [[UIImageView alloc] init]; + _captchaImage.contentMode = UIViewContentModeScaleAspectFit; + _captchaImage.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin; + [self addSubview:_captchaImage]; + + _captchaTextField = [[UITextField alloc] init]; + _captchaTextField.delegate = self; + _captchaTextField.borderStyle = UITextBorderStyleNone; + _captchaTextField.textAlignment = NSTextAlignmentCenter; + _captchaTextField.returnKeyType = UIReturnKeyDone; + _captchaTextField.backgroundColor = [UIColor whiteColor]; + _captchaTextField.autocorrectionType = UITextAutocorrectionTypeNo; + _captchaTextField.placeholder = NSLocalizedString(@"Enter captcha text", @""); + _captchaTextField.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin; + [self addSubview:_captchaTextField]; + VKHTTPOperation *operation = [[VKHTTPOperation alloc] initWithURLRequest:[[VKHTTPClient getClient] requestWithMethod:@"GET" path:_error.captchaImg parameters:nil secure:NO]]; + [operation setCompletionBlockWithSuccess:^(VKHTTPOperation *operation, id responseObject) { + [_captchaImage setImage:[UIImage imageWithData:operation.responseData]]; + } failure:^(VKHTTPOperation *operation, NSError *error) { + }]; + [[VKHTTPClient getClient] enqueueOperation:operation]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceDidRotate:) name:UIDeviceOrientationDidChangeNotification object:nil]; + [self deviceDidRotate:nil]; + } + return self; +} + +- (void)deviceDidRotate:(NSNotification *)notification { + [UIView animateWithDuration:notification ? 0.3 : 0 animations:^{ + _captchaImage.frame = CGRectMake((self.bounds.size.width - kCaptchaImageWidth) / 2, 5, kCaptchaImageWidth, kCaptchaImageHeight); + _captchaTextField.frame = CGRectMake(_captchaImage.frame.origin.x, _captchaImage.frame.origin.y + kCaptchaImageHeight + 10, kCaptchaImageWidth, kCaptchaViewHeight - kCaptchaImageHeight - 10); + }]; +} + +- (void)doneButtonPressed:(UIButton *)sender { + [_error answerCaptcha:_captchaTextField.text]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [[NSNotificationCenter defaultCenter] postNotificationName:VKCaptchaAnsweredEvent object:nil]; +} + +- (void)didMoveToSuperview { + [_captchaTextField becomeFirstResponder]; +} + +#pragma mark - UITextField delegate + +- (BOOL)textFieldShouldReturn:(UITextField *)textField { + if (textField == _captchaTextField) { + [self doneButtonPressed:_doneButton]; + [textField endEditing:YES]; + return NO; + } + return YES; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKCaptchaViewController.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKCaptchaViewController.h new file mode 100644 index 0000000..ec9d0f0 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKCaptchaViewController.h @@ -0,0 +1,45 @@ +// +// VKCaptchaViewController.h +// +// Copyright (c) 2014 VK.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 "VKError.h" + +/** +Controller fo displaying captcha. +*/ +@interface VKCaptchaViewController : UIViewController { +@private + VKError *_captchaError; +} +/** +Initializes controller with captcha url +@param error error for request that causes captcha-check +@returns Prepared controller. Best way to use it - use presentIn: method +*/ ++ (instancetype)captchaControllerWithError:(VKError *)error; + +/** +Presents current view controller in another. Automatically hides when captcha was answered properly +@param viewController Parent view controller +*/ +- (void)presentIn:(UIViewController *)viewController; +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKCaptchaViewController.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKCaptchaViewController.m new file mode 100644 index 0000000..45616c5 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKCaptchaViewController.m @@ -0,0 +1,127 @@ +// +// VKCaptchaViewController.m +// +// Copyright (c) 2014 VK.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 "VKCaptchaViewController.h" +#import "VKCaptchaView.h" +#import "VKUtil.h" +#import "VKSharedTransitioningObject.h" + +@interface VKCaptchaViewController () +@property(nonatomic, strong) VKCaptchaView *captchaView; +@end + +@implementation VKCaptchaViewController { + VKSharedTransitioningObject *_transitionDelegate; +} + ++ (instancetype)captchaControllerWithError:(VKError *)error { + VKCaptchaViewController *controller = [VKCaptchaViewController new]; + controller->_captchaError = error; + [[NSNotificationCenter defaultCenter] addObserver:controller selector:@selector(captchaDidAnswered) name:VKCaptchaAnsweredEvent object:nil]; + return controller; +} + +- (void)loadView { + + CGRect captchaFrame = CGRectMake(0, 0, kCaptchaImageWidth + 10, kCaptchaViewHeight + 10); + if (VK_IS_DEVICE_IPAD) { + self.view = [[UIView alloc] initWithFrame:captchaFrame]; + } else { + self.view = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds]; + captchaFrame = [self captchaFrameForScreenSize:self.view.frame.size]; + } + self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:.3f]; + self.view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + self.captchaView = [[VKCaptchaView alloc] initWithFrame:captchaFrame andError:_captchaError]; + self.captchaView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin; + [self.view addSubview:self.captchaView]; +} + +- (void)captchaDidAnswered { + [self.presentingViewController dismissViewControllerAnimated:YES completion:nil]; +} + +- (CGRect)captchaFrameForScreenSize:(CGSize)screenSize { + CGRect captchaFrame = CGRectMake(0, 0, kCaptchaImageWidth + 10, kCaptchaViewHeight + 10); + captchaFrame.origin = CGPointMake( + roundf((screenSize.width - captchaFrame.size.width) / 2.f), + roundf((screenSize.height / 2 - captchaFrame.size.height) / 2.f)); + return captchaFrame; +} + +- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { + [super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; + CGSize screenSize = [UIScreen mainScreen].bounds.size; + if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation)) { + screenSize = CGSizeMake(MAX(screenSize.width, screenSize.height), MIN(screenSize.width, screenSize.height)); + } else { + screenSize = CGSizeMake(MIN(screenSize.width, screenSize.height), MAX(screenSize.width, screenSize.height)); + } + + + self.captchaView.frame = [self captchaFrameForScreenSize:screenSize]; +} + +- (void)presentIn:(UIViewController *)controller { + UIViewController *presenting = controller.presentedViewController; + if (presenting && (presenting.isBeingDismissed || presenting.isBeingPresented)) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (300 * NSEC_PER_MSEC)), dispatch_get_main_queue(), ^(void) { + [self presentIn:controller]; + }); + return; + } + UIModalPresentationStyle oldStyle = controller.navigationController ? controller.navigationController.modalPresentationStyle : controller.modalPresentationStyle; + if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) { + self.modalPresentationStyle = UIModalPresentationFormSheet; + } else if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) { + _transitionDelegate = [VKSharedTransitioningObject new]; + self.transitioningDelegate = _transitionDelegate; + self.modalPresentationStyle = UIModalPresentationCustom; + } else { + if (controller.navigationController) { + controller.navigationController.modalPresentationStyle = UIModalPresentationCurrentContext; + } else { + controller.modalPresentationStyle = UIModalPresentationCurrentContext; + } + } + self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; + [controller presentViewController:self animated:YES completion:nil]; + if (controller.navigationController) { + controller.navigationController.modalPresentationStyle = oldStyle; + } else { + controller.modalPresentationStyle = oldStyle; + } +} + +- (UIStatusBarStyle)preferredStatusBarStyle { + return UIStatusBarStyleLightContent; +} + +- (CGSize)preferredContentSize { + return CGSizeMake(kCaptchaImageWidth + 10, kCaptchaViewHeight + 10); +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKShareDialogController.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKShareDialogController.h new file mode 100644 index 0000000..7d2b355 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKShareDialogController.h @@ -0,0 +1,74 @@ +// +// VKShareDialogController.h +// +// Copyright (c) 2014 VK.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 "VKObject.h" +#import "VKUploadImage.h" + + +typedef NS_ENUM(NSInteger, VKShareDialogControllerResult) { + VKShareDialogControllerResultCancelled, + VKShareDialogControllerResultDone +}; + +/* + * Link representation for share dialog + */ +@interface VKShareLink : VKObject +/// Use that field for present link description in share dialog interface +@property(nonatomic, copy) NSString *title; +/// Use that field for pass real link to VK. Host of the link will be displayed in share dialog +@property(nonatomic, copy) NSURL *link; + +- (instancetype)initWithTitle:(NSString *)title link:(NSURL *)link; +@end + + +/** +* Creates dialog for sharing some information from your app to user wall in VK +*/ +@interface VKShareDialogController : UIViewController +/// Array of prepared VKUploadImage objects for upload and share. User can remove any attachment +@property(nonatomic, strong) NSArray *uploadImages; + +/// Photos already uploaded to VK. That is array of photos ids: @[ownerid_photoid, ...]; +@property(nonatomic, strong) NSArray *vkImages; + +/// Links attachment for new post +@property(nonatomic, strong) VKShareLink *shareLink; + +/// Text to share. User can change it +@property(nonatomic, copy) NSString *text; + +/// Put only needed scopes into that array. By default equals @[VK_PER_WALL,VK_PER_PHOTOS] +@property(nonatomic, strong) NSArray *requestedScope; + +/// You can receive information about sharing state +@property(nonatomic, copy) void (^completionHandler)(VKShareDialogController *dialog, VKShareDialogControllerResult result); + +/// Flag meaning the share viewcontroller manage it's presentation state by itself +@property(nonatomic, assign) BOOL dismissAutomatically; + +/// Contains post id created via share dialog. Example string: 123_4567890 +@property(nonatomic, readonly, copy) NSString *postId; + +@end diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKShareDialogController.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKShareDialogController.m new file mode 100644 index 0000000..88562ed --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKShareDialogController.m @@ -0,0 +1,1307 @@ +// +// VKShareDialogController.m +// +// Copyright (c) 2014 VK.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 "VKShareDialogController.h" +#import "VKBundle.h" +#import "VKUtil.h" +#import "VKApi.h" +#import "VKSdk.h" +#import "VKHTTPClient.h" +#import "VKHTTPOperation.h" +#import "VKSharedTransitioningObject.h" + + +///---------------------------- +/// @name Attachment cells +///---------------------------- + +@interface VKPhotoAttachmentCell : UICollectionViewCell +@property(nonatomic, strong) UIProgressView *progressView; +@property(nonatomic, strong) UIActivityIndicatorView *activity; +@property(nonatomic, strong) UIImageView *attachImageView; +@end + +@implementation VKPhotoAttachmentCell + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + + self.attachImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(frame), CGRectGetHeight(frame))]; + self.attachImageView.contentMode = UIViewContentModeScaleAspectFill; + [self.contentView addSubview:self.attachImageView]; + + self.progressView = [[UIProgressView alloc] initWithFrame:CGRectMake(5, CGRectGetHeight(frame) - 20, CGRectGetWidth(frame) - 10, 10)]; + self.progressView.hidden = YES; + [self.contentView addSubview:self.progressView]; + + self.activity = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; + self.activity.frame = CGRectMake(roundf((frame.size.width - self.activity.frame.size.width) / 2), + roundf((frame.size.height - self.activity.frame.size.height) / 2), + self.activity.frame.size.width, + self.activity.frame.size.height); + self.activity.hidesWhenStopped = YES; + [self addSubview:self.activity]; + + return self; +} + +- (void)setProgress:(CGFloat)progress { + if (progress > 0) { + self.activity.hidden = YES; + self.progressView.hidden = NO; + self.progressView.progress = progress; + } else { + self.activity.hidden = NO; + [self.activity startAnimating]; + } +} + +- (void)hideProgress { + self.progressView.hidden = YES; + [self.activity stopAnimating]; +} + +@end + +@interface VKUploadingAttachment : VKObject +@property(nonatomic, assign) BOOL isDownloading; +@property(nonatomic, assign) CGSize attachSize; +@property(nonatomic, strong) NSString *attachmentString; +@property(nonatomic, strong) UIImage *preview; +@property(nonatomic, weak) VKRequest *uploadingRequest; +@end + + +@implementation VKUploadingAttachment +@end + +///---------------------------- +/// @name Privacy settings class +///---------------------------- +@interface VKPostSettings : VKObject +@property(nonatomic, strong) NSNumber *friendsOnly; +@property(nonatomic, strong) NSNumber *exportTwitter; +@property(nonatomic, strong) NSNumber *exportFacebook; +@property(nonatomic, strong) NSNumber *exportLivejournal; +@end + +@implementation VKPostSettings +@end + +@interface VKShareSettingsController : UITableViewController +@property(nonatomic, strong) VKPostSettings *currentSettings; +@property(nonatomic, strong) NSArray *rows; + +- (instancetype)initWithPostSettings:(VKPostSettings *)settings; +@end + +@interface VKShareDialogControllerInternal : UIViewController +@property(nonatomic, weak) VKShareDialogController *parent; +@property(nonatomic, readonly) UICollectionView *attachmentsScrollView; +@property(nonatomic, strong) UIBarButtonItem *sendButton; +@property(nonatomic, strong) NSMutableArray *attachmentsArray; +@property(nonatomic, strong) VKPostSettings *postSettings; +@property(nonatomic, assign) BOOL prepared; + +@property(nonatomic, weak) id oldDelegate; +@end + +@interface VKHelperNavigationController : UINavigationController +@end + +@class VKPlaceholderTextView; +@class VKLinkAttachView; + +@interface VKShareDialogView : UIView +@property(nonatomic, strong) UIView *notAuthorizedView; +@property(nonatomic, strong) UILabel *notAuthorizedLabel; +@property(nonatomic, strong) UIButton *notAuthorizedButton; +@property(nonatomic, strong) UIScrollView *contentScrollView; +@property(nonatomic, strong) UIButton *privacyButton; +@property(nonatomic, strong) UICollectionView *attachmentsCollection; +@property(nonatomic, strong) VKPlaceholderTextView *textView; +@property(nonatomic, strong) VKLinkAttachView *linkAttachView; +@property(nonatomic, strong) UIActivityIndicatorView *activityIndicator; +@end + +///------------------------------- +/// @name Presentation view controller for dialog +///------------------------------- + +static const CGFloat ipadWidth = 500.f; +static const CGFloat ipadHeight = 500.f; + +@interface VKShareDialogController () +@property(nonatomic, strong, readonly) UINavigationController *internalNavigation; +@property(nonatomic, strong, readonly) VKSharedTransitioningObject *transitionDelegate; +@property(nonatomic, strong, readonly) VKShareDialogControllerInternal *targetShareDialog; +@property(nonatomic, copy, readwrite) NSString *postId; +@end + +@implementation VKShareDialogController { + + UIBarStyle defaultBarStyle; +} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + ++ (void)initialize { + if ([self class] == [VKShareDialogController class]) { + UINavigationBar *appearance = [UINavigationBar appearanceWhenContainedIn:[VKHelperNavigationController class], nil]; + appearance.barStyle = UIBarStyleDefault; + + [appearance setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault]; + [appearance setShadowImage:nil]; + [appearance setTitleTextAttributes:nil]; + + [[UIBarButtonItem appearanceWhenContainedIn:[VKHelperNavigationController class], nil] setTitleTextAttributes:nil forState:UIControlStateNormal]; + [[UIBarButtonItem appearanceWhenContainedIn:[VKHelperNavigationController class], nil] setTitleTextAttributes:nil forState:UIControlStateHighlighted]; + + [[UIActivityIndicatorView appearanceWhenContainedIn:[VKHelperNavigationController class], nil] setColor:nil]; + } +} + +#pragma clang diagnostic pop + +- (instancetype)init { + if (self = [super init]) { + _internalNavigation = [[VKHelperNavigationController alloc] initWithRootViewController:_targetShareDialog = [VKShareDialogControllerInternal new]]; + + _targetShareDialog.parent = self; + + [self addChildViewController:self.internalNavigation]; + + _requestedScope = @[VK_PER_WALL, VK_PER_PHOTOS]; +#pragma clang diagnostic push +#pragma ide diagnostic ignored "UnavailableInDeploymentTarget" + if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) { + _transitionDelegate = [VKSharedTransitioningObject new]; + self.modalPresentationStyle = UIModalPresentationCustom; + self.transitioningDelegate = _transitionDelegate; + self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; + } +#pragma clang diagnostic pop + if (VK_IS_DEVICE_IPAD) { + self.modalPresentationStyle = UIModalPresentationFormSheet; + } + } + return self; +} + +- (void)loadView { + self.view = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds]; + self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.4f]; + self.view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + self.view.autoresizesSubviews = NO; + + if (VK_IS_DEVICE_IPAD) { + self.view.backgroundColor = [UIColor clearColor]; + } else { + self.internalNavigation.view.layer.cornerRadius = 10; + self.internalNavigation.view.layer.masksToBounds = YES; + } + [self.internalNavigation beginAppearanceTransition:YES animated:NO]; + [self.view addSubview:self.internalNavigation.view]; + [self.internalNavigation endAppearanceTransition]; +} + +- (void)viewWillLayoutSubviews { + [super viewWillLayoutSubviews]; + if (VK_IS_DEVICE_IPAD) { + self.view.superview.layer.cornerRadius = 10.0; + self.view.superview.layer.masksToBounds = YES; + } +} + +#pragma clang diagnostic push +#pragma ide diagnostic ignored "UnavailableInDeploymentTarget" + +- (CGSize)preferredContentSize { + if (UIUserInterfaceIdiomPad == [[UIDevice currentDevice] userInterfaceIdiom]) { + return CGSizeMake(ipadWidth, ipadHeight); + } + return [super preferredContentSize]; +} + +#pragma clang diagnostic pop + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + [self rotateToInterfaceOrientation:orientation appear:YES]; +} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { + [super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; + + [self rotateToInterfaceOrientation:toInterfaceOrientation appear:NO]; +} + +#pragma clang diagnostic pop + +- (void)rotateToInterfaceOrientation:(UIInterfaceOrientation)orientation appear:(BOOL)onAppear { + if (VK_IS_DEVICE_IPAD) { + CGSize viewSize = self.view.frame.size; + if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) { + viewSize.width = ipadWidth; + viewSize.height = ipadHeight; + } + self.internalNavigation.view.frame = CGRectMake(0, 0, viewSize.width, viewSize.height); + return; + } + + + static const CGFloat landscapeWidthCoef = 0.8f; + static const CGFloat landscapeHeightCoef = 0.8f; + static const CGFloat portraitWidthCoef = 0.9f; + static const CGFloat portraitHeightCoef = 0.7f; + + + CGSize selfSize = self.view.frame.size; + CGSize viewSize; + if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) { + viewSize = CGSizeMake(ipadWidth, ipadHeight); + } else { + if (VK_SYSTEM_VERSION_LESS_THAN(@"8.0")) { + if (!onAppear && !UIInterfaceOrientationIsPortrait(orientation)) { + CGFloat w = selfSize.width; + selfSize.width = selfSize.height; + selfSize.height = w; + } + if (VK_SYSTEM_VERSION_LESS_THAN(@"7.0")) { + viewSize = selfSize; + } else { + if (UIInterfaceOrientationIsLandscape(orientation)) { + viewSize = CGSizeMake(roundf(selfSize.width * landscapeWidthCoef), roundf(selfSize.height * landscapeHeightCoef)); + } else { + viewSize = CGSizeMake(roundf(selfSize.width * portraitWidthCoef), roundf(selfSize.height * portraitHeightCoef)); + } + } + } else { + if (UIInterfaceOrientationIsLandscape(orientation)) { + viewSize = CGSizeMake(roundf(selfSize.width * landscapeWidthCoef), roundf(selfSize.height * landscapeHeightCoef)); + } else { + viewSize = CGSizeMake(roundf(selfSize.width * portraitWidthCoef), roundf(selfSize.height * portraitHeightCoef)); + } + } + } + if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0") || onAppear || UIInterfaceOrientationIsPortrait(orientation)) { + self.internalNavigation.view.frame = CGRectMake(roundf((CGRectGetWidth(self.view.frame) - viewSize.width) / 2), + roundf((CGRectGetHeight(self.view.frame) - viewSize.height) / 2), + viewSize.width, viewSize.height); + } else if (UIInterfaceOrientationIsLandscape(orientation)) { + self.internalNavigation.view.frame = CGRectMake(roundf((CGRectGetHeight(self.view.frame) - viewSize.width) / 2), + roundf((CGRectGetWidth(self.view.frame) - viewSize.height) / 2), + viewSize.width, viewSize.height); + } + if (VK_SYSTEM_VERSION_LESS_THAN(@"7.0")) { + if (self.presentingViewController.modalPresentationStyle != UIModalPresentationCurrentContext) { + CGRect frame; + frame.origin = CGPointZero; + frame.size = selfSize; + self.internalNavigation.view.frame = frame; + self.internalNavigation.view.layer.cornerRadius = 3; + } + } +} + +- (BOOL)shouldAutorotate { + return YES; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { + return YES; +} + +- (UIStatusBarStyle)preferredStatusBarStyle { + return UIStatusBarStyleDefault; +} + +- (UIInterfaceOrientationMask)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskAll; +} + +#pragma clang diagnostic push +#pragma ide diagnostic ignored "UnavailableInDeploymentTarget" + +- (void)viewDidLoad { + [super viewDidLoad]; + if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) { + self.internalNavigation.navigationBar.barTintColor = VK_COLOR; + self.internalNavigation.navigationBar.tintColor = [UIColor whiteColor]; + self.internalNavigation.automaticallyAdjustsScrollViewInsets = NO; + } + +} + +#pragma clang diagnostic pop + +- (void)setUploadImages:(NSArray *)uploadImages { + _uploadImages = [uploadImages filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) { + BOOL result = [evaluatedObject isKindOfClass:[VKUploadImage class]]; + if (!result) { + NSLog(@"Object %@ not accepted, because it must subclass VKUploadImage", evaluatedObject); + } + return result; + }]]; +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + [UINavigationBar appearance].barStyle = defaultBarStyle; +} +@end + + +///---------------------------- +/// @name Placeholder textview for comment field +///---------------------------- +/** +* Author: Jason George; +* Source: http://stackoverflow.com/a/1704469/1271424 +*/ +@interface VKPlaceholderTextView : UITextView + +@property(nonatomic, strong) NSString *placeholder; +@property(nonatomic, strong) UIColor *placeholderColor; +@property(nonatomic, strong) UILabel *placeholderLabel; + +- (void)textChanged:(NSNotification *)notification; + +@end + +@implementation VKPlaceholderTextView + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +- (void)awakeFromNib { + [super awakeFromNib]; + if (!self.placeholder) { + [self setPlaceholder:@""]; + } + + if (!self.placeholderColor) { + [self setPlaceholderColor:[UIColor lightGrayColor]]; + } + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textChanged:) name:UITextViewTextDidChangeNotification object:nil]; +} + +- (id)initWithFrame:(CGRect)frame { + if ((self = [super initWithFrame:frame])) { + [self setPlaceholder:@""]; + [self setPlaceholderColor:[UIColor lightGrayColor]]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textChanged:) name:UITextViewTextDidChangeNotification object:nil]; + } + return self; +} + +- (void)textChanged:(NSNotification *)notification { + if (notification.object != self) return; + if (!self.placeholder.length) { + return; + } + [self.self.placeholderLabel setHidden:self.text.length != 0]; +} + +- (void)setText:(NSString *)text { + [super setText:text]; + [self.placeholderLabel setHidden:self.text.length != 0]; +} + +- (void)setPlaceholder:(NSString *)placeholder { + _placeholder = placeholder; + if (placeholder.length) { + if (self.placeholderLabel == nil) { + UIEdgeInsets inset = self.contentInset; +#pragma clang diagnostic push +#pragma ide diagnostic ignored "UnavailableInDeploymentTarget" + if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) { + inset = self.textContainerInset; + } +#pragma clang diagnostic pop + self.placeholderLabel = [[UILabel alloc] initWithFrame:CGRectMake(inset.left + 4, inset.top, self.bounds.size.width - inset.left - inset.right, 0)]; + self.placeholderLabel.font = self.font; + self.placeholderLabel.hidden = YES; + self.placeholderLabel.textColor = self.placeholderColor; + self.placeholderLabel.lineBreakMode = NSLineBreakByWordWrapping; + self.placeholderLabel.numberOfLines = 0; + self.placeholderLabel.backgroundColor = [UIColor clearColor]; + [self addSubview:self.placeholderLabel]; + } + + self.placeholderLabel.text = placeholder; + [self.placeholderLabel sizeToFit]; + [self sendSubviewToBack:self.placeholderLabel]; + } + + if (self.text.length == 0 && placeholder.length) { + [self.placeholderLabel setHidden:NO]; + } +} + +/** +* iOS 7 text view measurement. +* Author: tarmes; +* Source: http://stackoverflow.com/a/19047464/1271424 +*/ +- (CGFloat)measureHeightOfUITextView { + UITextView *textView = self; +#pragma clang diagnostic push +#pragma ide diagnostic ignored "UnavailableInDeploymentTarget" + if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) { + CGRect frame = textView.bounds; + + // Take account of the padding added around the text. + + UIEdgeInsets textContainerInsets = textView.textContainerInset; + UIEdgeInsets contentInsets = textView.contentInset; + + CGFloat leftRightPadding = textContainerInsets.left + textContainerInsets.right + textView.textContainer.lineFragmentPadding * 2 + contentInsets.left + contentInsets.right; + CGFloat topBottomPadding = textContainerInsets.top + textContainerInsets.bottom + contentInsets.top + contentInsets.bottom; + + frame.size.width -= leftRightPadding; + frame.size.height -= topBottomPadding; + + NSString *textToMeasure = textView.text.length ? textView.text : _placeholder; + if ([textToMeasure hasSuffix:@"\n"]) { + textToMeasure = [NSString stringWithFormat:@"%@-", textView.text]; + } + + // NSString class method: boundingRectWithSize:options:attributes:context is + // available only on ios7.0 sdk. + + NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; + [paragraphStyle setLineBreakMode:NSLineBreakByWordWrapping]; + + NSDictionary *attributes = @{NSFontAttributeName : textView.font, NSParagraphStyleAttributeName : paragraphStyle}; + + CGRect size = [textToMeasure boundingRectWithSize:CGSizeMake(CGRectGetWidth(frame), MAXFLOAT) + options:NSStringDrawingUsesLineFragmentOrigin + attributes:attributes + context:nil]; + + CGFloat measuredHeight = ceilf(CGRectGetHeight(size) + topBottomPadding); + return measuredHeight; + } +#pragma clang diagnostic pop + else { +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0 + if (self.text.length && textView.contentSize.height > 0) { + return MAX(textView.contentSize.height + self.contentInset.top + self.contentInset.bottom, 36.0f); + } + return [self.placeholder sizeWithFont:self.font constrainedToSize:CGSizeMake(self.frame.size.width, CGFLOAT_MAX) lineBreakMode:NSLineBreakByWordWrapping].height + self.contentInset.top + self.contentInset.bottom; +#endif + } + return 0; +} + +- (void)layoutSubviews { + [super layoutSubviews]; + + if (VK_SYSTEM_VERSION_LESS_THAN(@"7.0")) { + CGSize size = self.contentSize; + size.width = size.width - self.contentInset.left - self.contentInset.right; + [self setContentSize:size]; + } + +} +@end + +///---------------------------- +/// @name Special kind of button for privacy settings +///---------------------------- + +@interface VKPrivacyButton : UIButton +@end + +@implementation VKPrivacyButton +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + CGFloat separatorHeight = 1 / [UIScreen mainScreen].scale; + UIView *topSeparatorView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, separatorHeight)]; + topSeparatorView.autoresizingMask = UIViewAutoresizingFlexibleWidth; + [topSeparatorView setBackgroundColor:[VKUtil colorWithRGB:0xc8cacc]]; + [self addSubview:topSeparatorView]; + [self setImage:VKImageNamed(@"Disclosure") forState:UIControlStateNormal]; + [self setBackgroundColor:[VKUtil colorWithRGB:0xfafbfc]]; + return self; +} + +- (void)setHighlighted:(BOOL)highlighted { + [super setHighlighted:highlighted]; + + if (highlighted) { + self.backgroundColor = [VKUtil colorWithRGB:0xd9d9d9]; + } + else { + self.backgroundColor = [VKUtil colorWithRGB:0xfafbfc]; + } +} + +- (CGRect)imageRectForContentRect:(CGRect)contentRect { + CGRect frame = [super imageRectForContentRect:contentRect]; + frame.origin.x = CGRectGetMaxX(contentRect) - CGRectGetWidth(frame) - self.imageEdgeInsets.right + self.imageEdgeInsets.left; + return frame; +} + +- (CGRect)titleRectForContentRect:(CGRect)contentRect { + CGRect frame = [super titleRectForContentRect:contentRect]; + frame.origin.x = CGRectGetMinX(frame) - CGRectGetWidth([self imageRectForContentRect:contentRect]); + return frame; +} +@end + +@interface VKLinkAttachView : UIView +@property(nonatomic, strong) UILabel *linkTitle; +@property(nonatomic, strong) UILabel *linkHost; +@end + +@implementation VKLinkAttachView + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + + _linkTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 21)]; + _linkTitle.font = [UIFont systemFontOfSize:16]; + _linkTitle.textColor = [VKUtil colorWithRGB:0x4978ad]; + _linkTitle.backgroundColor = [UIColor clearColor]; + _linkTitle.numberOfLines = 1; + [self addSubview:_linkTitle]; + + _linkHost = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 21)]; + _linkHost.font = [UIFont systemFontOfSize:16]; + _linkHost.textColor = [VKUtil colorWithRGB:0x999999]; + _linkHost.backgroundColor = [UIColor clearColor]; + _linkHost.numberOfLines = 1; + [self addSubview:_linkHost]; + + self.backgroundColor = [UIColor clearColor]; + + return self; +} + +- (void)sizeToFit { + [self.linkTitle sizeToFit]; + self.linkTitle.frame = CGRectMake(0, 0, self.frame.size.width, self.linkHost.frame.size.height); + [self.linkHost sizeToFit]; + self.linkHost.frame = CGRectMake(0, CGRectGetMaxY(self.linkTitle.frame) + 2, self.frame.size.width, self.linkHost.frame.size.height); + self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, self.frame.size.width, CGRectGetMaxY(self.linkHost.frame)); +} + +- (void)setTargetLink:(VKShareLink *)targetLink { + self.linkTitle.text = [targetLink.title stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + self.linkHost.text = [targetLink.link.host stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + [self sizeToFit]; +} +@end + +///------------------------------- +/// @name View for internal share dialog controller +///------------------------------- +static const CGFloat kAttachmentsViewSize = 100.0f; + +@implementation VKShareDialogView { + CGFloat lastTextViewHeight; +} + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + self.backgroundColor = [VKUtil colorWithRGB:0xfafbfc]; + { + //View for authorizing, adds only when user is not authorized + _notAuthorizedView = [[UIView alloc] initWithFrame:self.bounds]; + _notAuthorizedView.backgroundColor = [UIColor clearColor]; + _notAuthorizedView.backgroundColor = [VKUtil colorWithRGB:0xf2f2f5]; + _notAuthorizedView.autoresizingMask = UIViewAutoresizingNone; + _notAuthorizedView.autoresizesSubviews = NO; + + _notAuthorizedLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, CGRectGetWidth(_notAuthorizedView.frame) - 20, 0)]; + _notAuthorizedLabel.text = VKLocalizedString(@"UserNotAuthorized"); + _notAuthorizedLabel.font = [UIFont systemFontOfSize:15]; + _notAuthorizedLabel.textColor = [VKUtil colorWithRGB:0x737980]; + _notAuthorizedLabel.textAlignment = NSTextAlignmentCenter; + _notAuthorizedLabel.numberOfLines = 0; + _notAuthorizedLabel.backgroundColor = [UIColor clearColor]; + [_notAuthorizedView addSubview:_notAuthorizedLabel]; + + _notAuthorizedButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 0, 34)]; + [_notAuthorizedButton setTitle:VKLocalizedString(@"Enter") forState:UIControlStateNormal]; + [_notAuthorizedButton setContentEdgeInsets:UIEdgeInsetsMake(4, 15, 4, 15)]; + _notAuthorizedButton.titleLabel.font = [UIFont systemFontOfSize:15]; + [_notAuthorizedView addSubview:_notAuthorizedButton]; + + UIImage *buttonBg = VKImageNamed(@"BlueBtn"); + buttonBg = [buttonBg stretchableImageWithLeftCapWidth:(NSInteger) floorf(buttonBg.size.width / 2) topCapHeight:(NSInteger) floorf(buttonBg.size.height / 2)]; + [_notAuthorizedButton setBackgroundImage:buttonBg forState:UIControlStateNormal]; + + buttonBg = VKImageNamed(@"BlueBtn_pressed"); + buttonBg = [buttonBg stretchableImageWithLeftCapWidth:(NSInteger) floorf(buttonBg.size.width / 2) topCapHeight:(NSInteger) floorf(buttonBg.size.height / 2)]; + [_notAuthorizedButton setBackgroundImage:buttonBg forState:UIControlStateHighlighted]; + + _activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; + _activityIndicator.center = self.center; + _activityIndicator.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin; + _activityIndicator.hidesWhenStopped = YES; + [self addSubview:_activityIndicator]; + } + + _contentScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)]; + _contentScrollView.contentInset = UIEdgeInsetsMake(0, 0, 44, 0); + _contentScrollView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + _contentScrollView.scrollIndicatorInsets = _contentScrollView.contentInset; + [self addSubview:_contentScrollView]; + + _privacyButton = [[VKPrivacyButton alloc] initWithFrame:CGRectMake(0, frame.size.height - 44, frame.size.width, 44)]; + _privacyButton.titleLabel.font = [UIFont systemFontOfSize:16]; + _privacyButton.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin; + _privacyButton.contentEdgeInsets = UIEdgeInsetsMake(0, 14, 0, 14); + _privacyButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; + [_privacyButton setTitle:VKLocalizedString(@"PostSettings") forState:UIControlStateNormal]; + [_privacyButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; + [self addSubview:_privacyButton]; + + _textView = [[VKPlaceholderTextView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 36)]; + + _textView.backgroundColor = [UIColor clearColor]; + _textView.autoresizingMask = UIViewAutoresizingFlexibleWidth; +#pragma clang diagnostic push +#pragma ide diagnostic ignored "UnavailableInDeploymentTarget" + if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) { + _textView.textContainerInset = UIEdgeInsetsMake(12, 10, 12, 10); + _textView.textContainer.lineBreakMode = NSLineBreakByWordWrapping; + } else { + _textView.frame = CGRectMake(0, 0, frame.size.width - 20, 36); + _textView.contentInset = UIEdgeInsetsMake(12, 10, 12, 0); + } +#pragma clang diagnostic pop + _textView.font = [UIFont systemFontOfSize:16.0f]; + _textView.delegate = self; + _textView.textAlignment = NSTextAlignmentLeft; + _textView.returnKeyType = UIReturnKeyDone; + _textView.placeholder = VKLocalizedString(@"NewMessageText"); + [_contentScrollView addSubview:_textView]; + + UICollectionViewFlowLayout *layout = [UICollectionViewFlowLayout new]; + layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; + layout.minimumInteritemSpacing = 12; + + _attachmentsCollection = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, kAttachmentsViewSize) collectionViewLayout:layout]; + _attachmentsCollection.contentInset = UIEdgeInsetsMake(0, 16, 0, 16); + _attachmentsCollection.backgroundColor = [UIColor clearColor]; + _attachmentsCollection.showsHorizontalScrollIndicator = NO; + [_attachmentsCollection registerClass:[VKPhotoAttachmentCell class] forCellWithReuseIdentifier:@"VKPhotoAttachmentCell"]; + [_contentScrollView addSubview:_attachmentsCollection]; + return self; +} + +- (void)layoutSubviews { + [super layoutSubviews]; + + if (self.notAuthorizedView.superview) { + self.notAuthorizedView.frame = CGRectMake(0, 0, CGRectGetWidth(self.frame), CGRectGetHeight(self.frame)); + CGSize notAuthorizedTextBoundingSize = CGSizeMake(CGRectGetWidth(self.notAuthorizedView.frame) - 20, CGFLOAT_MAX); + CGSize notAuthorizedTextSize; +#pragma clang diagnostic push +#pragma ide diagnostic ignored "UnavailableInDeploymentTarget" + if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) { + NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; + paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping; + paragraphStyle.alignment = NSTextAlignmentLeft; + + NSDictionary *attributes = @{NSFontAttributeName : self.notAuthorizedLabel.font, + NSParagraphStyleAttributeName : paragraphStyle}; + + + notAuthorizedTextSize = [self.notAuthorizedLabel.text boundingRectWithSize:notAuthorizedTextBoundingSize + options:(NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) + attributes:attributes + context:nil].size; + + } else { +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0 + notAuthorizedTextSize = [_notAuthorizedLabel.text sizeWithFont:_notAuthorizedLabel.font + constrainedToSize:notAuthorizedTextBoundingSize + lineBreakMode:NSLineBreakByWordWrapping]; +#endif + } +#pragma clang diagnostic pop + + [self.notAuthorizedButton sizeToFit]; + + self.notAuthorizedLabel.frame = CGRectMake( + 10, + roundf((CGRectGetHeight(self.notAuthorizedView.frame) - notAuthorizedTextSize.height - CGRectGetHeight(self.notAuthorizedButton.frame)) / 2), + notAuthorizedTextBoundingSize.width, + roundf(notAuthorizedTextSize.height)); + + self.notAuthorizedButton.frame = CGRectMake( + roundf(self.notAuthorizedLabel.center.x) - roundf(CGRectGetWidth(self.notAuthorizedButton.frame) / 2), + CGRectGetMaxY(self.notAuthorizedLabel.frame) + roundf(CGRectGetHeight(self.notAuthorizedButton.frame) / 2), + CGRectGetWidth(self.notAuthorizedButton.frame), + CGRectGetHeight(self.notAuthorizedButton.frame)); + } + //Workaround for iOS 6 - ignoring contentInset.right + self.textView.frame = CGRectMake(0, 0, self.frame.size.width - (VK_SYSTEM_VERSION_LESS_THAN(@"7.0") ? 20 : 0), [self.textView measureHeightOfUITextView]); + [self positionSubviews]; +} + +- (void)positionSubviews { + lastTextViewHeight = self.textView.frame.size.height; + self.attachmentsCollection.frame = CGRectMake(0, lastTextViewHeight, self.frame.size.width, [self.attachmentsCollection numberOfItemsInSection:0] ? kAttachmentsViewSize : 0); + if (self.linkAttachView) { + self.linkAttachView.frame = CGRectMake(14, CGRectGetMaxY(self.attachmentsCollection.frame) + 5, self.frame.size.width - 20, 0); + [self.linkAttachView sizeToFit]; + } + + self.contentScrollView.contentSize = CGSizeMake(self.frame.size.width, self.linkAttachView ? CGRectGetMaxY(self.linkAttachView.frame) : CGRectGetMaxY(self.attachmentsCollection.frame)); +} + +- (void)textViewDidChange:(UITextView *)textView { + CGFloat newHeight = [self.textView measureHeightOfUITextView]; + if (fabs(newHeight - lastTextViewHeight) > 1) { + textView.frame = CGRectMake(0, 0, self.frame.size.width - (VK_SYSTEM_VERSION_LESS_THAN(@"7.0") ? 20 : 0), newHeight); + [textView layoutIfNeeded]; + [UIView animateWithDuration:0.2 animations:^{ + [self positionSubviews]; + }]; + } +} + +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { + if ([text isEqualToString:@"\n"]) { + [textView endEditing:YES]; + } + return YES; +} + +- (void)setShareLink:(VKShareLink *)link { + self.linkAttachView = [[VKLinkAttachView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 0)]; + self.linkAttachView.targetLink = link; + [self.contentScrollView addSubview:self.linkAttachView]; + [self setNeedsLayout]; +} + +@end + +///------------------------------- +/// @name Internal view controller, root for share dialog navigation controller +///------------------------------- + +@implementation VKShareDialogControllerInternal { + dispatch_queue_t imageProcessingQueue; +} + +- (void)dealloc { + [[VKSdk instance] unregisterDelegate:self]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +#pragma clang diagnostic push +#pragma ide diagnostic ignored "UnavailableInDeploymentTarget" + +- (instancetype)init { + self = [super init]; + if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) { + self.edgesForExtendedLayout = UIRectEdgeNone; + } + imageProcessingQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0); + return self; +} + +#pragma clang diagnostic pop + +- (void)loadView { + VKShareDialogView *view = [[VKShareDialogView alloc] initWithFrame:CGRectMake(0, 0, ipadWidth, ipadHeight)]; + view.attachmentsCollection.delegate = self; + view.attachmentsCollection.dataSource = self; + [view.notAuthorizedButton addTarget:self action:@selector(authorize:) forControlEvents:UIControlEventTouchUpInside]; + [view.privacyButton addTarget:self action:@selector(openSettings:) forControlEvents:UIControlEventTouchUpInside]; + + self.view = view; +} + +- (UICollectionView *)attachmentsScrollView { + VKShareDialogView *view = (VKShareDialogView *) self.view; + return view.attachmentsCollection; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + UIImage *image = [VKBundle vkLibraryImageNamed:@"ic_vk_logo_nb"]; + self.navigationItem.titleView = [[UIImageView alloc] initWithImage:image]; +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0 + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:VKLocalizedString(@"Cancel") style:UIBarButtonItemStylePlain target:self action:@selector(close:)]; +#else + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:VKLocalizedString(@"Cancel") style:UIBarButtonItemStyleBordered target:self action:@selector(close:)]; +#endif + [[VKSdk instance] registerDelegate:self]; +} + +- (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + + if (self.oldDelegate) { + [VKSdk instance].uiDelegate = self.oldDelegate; + } +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + if (self.prepared) return; + VKShareDialogView *view = (VKShareDialogView *) self.view; + view.textView.hidden = YES; + [view.activityIndicator startAnimating]; + [VKSdk wakeUpSession:self.parent.requestedScope completeBlock:^(VKAuthorizationState state, NSError *error) { + [view.activityIndicator stopAnimating]; + if (state == VKAuthorizationAuthorized) { + [view.notAuthorizedView removeFromSuperview]; + view.textView.hidden = NO; + view.textView.text = self.parent.text; + [self prepare]; + [view textViewDidChange:view.textView]; + } else { + [self setNotAuthorized]; + } + }]; +} + +- (void)setNotAuthorized { + VKShareDialogView *view = (VKShareDialogView *) self.view; + [view addSubview:view.notAuthorizedView]; + if ([VKSdk accessToken]) { + view.notAuthorizedLabel.text = VKLocalizedString(@"UserHasNoRequiredPermissions"); + view.textView.hidden = YES; + } + [view layoutSubviews]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(viewWillAppear:) + name:UIApplicationDidBecomeActiveNotification + object:nil]; +} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { + [super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; +} + +#pragma clang diagnostic pop + +- (void)prepare { + + self.postSettings = [VKPostSettings new]; + [self createAttachments]; + [[[VKApi users] get:@{VK_API_FIELDS : @"first_name_acc,can_post,sex,exports"}] executeWithResultBlock:^(VKResponse *response) { + VKUser *user = [response.parsedModel firstObject]; + //Set this flags as @0 to show in the interface + self.postSettings.friendsOnly = @0; + if (user.exports.twitter) { + self.postSettings.exportTwitter = @0; + } + if (user.exports.facebook) { + self.postSettings.exportFacebook = @0; + } + if (user.exports.livejournal) { + self.postSettings.exportLivejournal = @0; + } + } errorBlock:nil]; + self.prepared = YES; + +} + +- (NSArray *)rightBarButtonItems { + if (!self.sendButton) { + self.sendButton = [[UIBarButtonItem alloc] initWithTitle:VKLocalizedString(@"Done") style:UIBarButtonItemStyleDone target:self action:@selector(sendMessage:)]; + } + return @[self.sendButton]; +} + +- (void)close:(id)sender { + if (self.parent.completionHandler != NULL) { + self.parent.completionHandler(self.parent, VKShareDialogControllerResultCancelled); + } + if (self.parent.dismissAutomatically) { + [self.navigationController.presentingViewController dismissViewControllerAnimated:YES completion:nil]; + } +} + +- (void)sendMessage:(id)sender { + UITextView *textView = ((VKShareDialogView *) self.view).textView; + textView.editable = NO; + [textView endEditing:YES]; + self.navigationItem.rightBarButtonItems = nil; + UIActivityIndicatorView *activity = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:activity]; + [activity startAnimating]; + + NSMutableArray *attachStrings = [NSMutableArray arrayWithCapacity:_attachmentsArray.count]; + for (VKUploadingAttachment *attach in _attachmentsArray) { + if (!attach.attachmentString) { + [self performSelector:@selector(sendMessage:) withObject:sender afterDelay:1.0f]; + return; + } + [attachStrings addObject:attach.attachmentString]; + } + if (self.parent.shareLink) { + [attachStrings addObject:[self.parent.shareLink.link absoluteString]]; + } + + VKRequest *post = [[VKApi wall] post:@{VK_API_MESSAGE : textView.text ?: @"", + VK_API_ATTACHMENTS : [attachStrings componentsJoinedByString:@","]}]; + NSMutableArray *exports = [NSMutableArray new]; + if (self.postSettings.friendsOnly.boolValue) [post addExtraParameters:@{VK_API_FRIENDS_ONLY : @1}]; + if (self.postSettings.exportTwitter.boolValue) [exports addObject:@"twitter"]; + if (self.postSettings.exportFacebook.boolValue) [exports addObject:@"facebook"]; + if (self.postSettings.exportLivejournal.boolValue) [exports addObject:@"livejournal"]; + if (exports.count) [post addExtraParameters:@{VK_API_SERVICES : [exports componentsJoinedByString:@","]}]; + + [post executeWithResultBlock:^(VKResponse *response) { + NSNumber *post_id = VK_ENSURE_NUM(response.json[@"post_id"]); + if (post_id) { + self.parent.postId = [NSString stringWithFormat:@"%@_%@", [VKSdk accessToken].userId, post_id]; + } + if (self.parent.completionHandler != NULL) { + self.parent.completionHandler(self.parent, VKShareDialogControllerResultDone); + } + if (self.parent.dismissAutomatically) { + [self.navigationController.presentingViewController dismissViewControllerAnimated:YES completion:nil]; + } + } errorBlock:^(NSError *error) { + self.navigationItem.rightBarButtonItem = nil; + self.navigationItem.rightBarButtonItems = [self rightBarButtonItems]; + textView.editable = YES; + [textView becomeFirstResponder]; + [[[UIAlertView alloc] initWithTitle:nil message:VKLocalizedString(@"ErrorWhilePosting") delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; + }]; +} + +- (void)openSettings:(id)sender { + VKShareSettingsController *vc = [[VKShareSettingsController alloc] initWithPostSettings:self.postSettings]; + [self.navigationController pushViewController:vc animated:YES]; +} + +- (void)authorize:(id)sender { + self.oldDelegate = [VKSdk instance].uiDelegate; + + [VKSdk instance].uiDelegate = self; + [VKSdk authorize:self.parent.requestedScope]; +} + +#pragma mark - VK SDK Delegate + +- (void)vkSdkNeedCaptchaEnter:(VKError *)captchaError { + VKCaptchaViewController *captcha = [VKCaptchaViewController captchaControllerWithError:captchaError]; + [self.navigationController presentViewController:captcha animated:YES completion:nil]; +} + +- (void)vkSdkShouldPresentViewController:(UIViewController *)controller { + if ([SFSafariViewController class] && [controller isKindOfClass:[SFSafariViewController class]]) { + [self.navigationController presentViewController:controller animated:YES completion:nil]; + } else if ([controller isKindOfClass:[UINavigationController class]]) { + UINavigationController *nav = (UINavigationController *) controller; + UIViewController *target = nav.viewControllers[0]; + nav.viewControllers = @[]; + [self.navigationController pushViewController:target animated:YES]; + } else { + [self.navigationController pushViewController:controller animated:YES]; + } +} + +- (void)vkSdkAccessAuthorizationFinishedWithResult:(VKAuthorizationResult *)result { + if (result.error) { + [self setNotAuthorized]; + } +} + +- (void)vkSdkUserAuthorizationFailed { + [self setNotAuthorized]; +} + +#pragma mark -Attachments + +- (void)createAttachments { + self.navigationItem.rightBarButtonItems = [self rightBarButtonItems]; + + CGFloat maxHeight = kAttachmentsViewSize; + self.attachmentsArray = [NSMutableArray new]; + VKShareDialogView *shareDialogView = (VKShareDialogView *) self.view; + //Attach and upload images + for (VKUploadImage *img in self.parent.uploadImages) { + if (!(img.imageData || img.sourceImage)) continue; + CGSize size = img.sourceImage.size; + size = CGSizeMake(MAX(floorf(size.width * maxHeight / size.height), 50.f), maxHeight); + VKUploadingAttachment *attach = [VKUploadingAttachment new]; + attach.attachSize = size; + attach.preview = [img.sourceImage vks_roundCornersImage:0.0f resultSize:size]; + [self.attachmentsArray addObject:attach]; + + VKRequest *uploadRequest = [VKApi uploadWallPhotoRequest:img.sourceImage parameters:img.parameters userId:0 groupId:0]; + + [uploadRequest setCompleteBlock:^(VKResponse *res) { + VKPhoto *photo = [res.parsedModel firstObject]; + attach.attachmentString = photo.attachmentString; + attach.uploadingRequest = nil; + [self.attachmentsScrollView reloadData]; + }]; + [uploadRequest setErrorBlock:^(NSError *error) { + NSLog(@"Error: %@", error.vkError); + [self removeAttachIfExists:attach]; + attach.uploadingRequest = nil; + [self.attachmentsScrollView reloadData]; + [shareDialogView setNeedsLayout]; + }]; + [uploadRequest start]; + attach.uploadingRequest = uploadRequest; + } + + if (self.parent.vkImages.count) { + NSMutableDictionary *attachById = [NSMutableDictionary new]; + for (NSString *photo in self.parent.vkImages) { + NSAssert([photo isKindOfClass:[NSString class]], @"vkImages must contains only string photo ids"); + if (attachById[photo]) continue; + VKUploadingAttachment *attach = [VKUploadingAttachment new]; + attach.attachSize = CGSizeMake(kAttachmentsViewSize, kAttachmentsViewSize); + attach.attachmentString = [@"photo" stringByAppendingString:photo]; + attach.isDownloading = YES; + [self.attachmentsArray addObject:attach]; + attachById[photo] = attach; + } + + VKRequest *req = [VKRequest requestWithMethod:@"photos.getById" andParameters:@{@"photos" : [self.parent.vkImages componentsJoinedByString:@","], @"photo_sizes" : @1} modelClass:[VKPhotoArray class]]; + [req setCompleteBlock:^(VKResponse *res) { + VKPhotoArray *photos = res.parsedModel; + NSArray *requiredSizes = @[@"p", @"q", @"m"]; + for (VKPhoto *photo in photos) { + NSString *photoSrc = nil; + for (NSString *type in requiredSizes) { + photoSrc = [photo.sizes photoSizeWithType:type].src; + if (photoSrc) break; + } + if (!photoSrc) { + continue; + } + + NSString *photoId = [NSString stringWithFormat:@"%@_%@", photo.owner_id, photo.id]; + VKUploadingAttachment *attach = attachById[photoId]; + + [attachById removeObjectForKey:photoId]; + + VKHTTPOperation *imageLoad = [[VKHTTPOperation alloc] initWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:photoSrc]]]; + [imageLoad setCompletionBlockWithSuccess:^(VKHTTPOperation *operation, id responseObject) { + UIImage *result = [UIImage imageWithData:operation.responseData]; + result = [result vks_roundCornersImage:0 resultSize:CGSizeMake(kAttachmentsViewSize, kAttachmentsViewSize)]; + dispatch_sync(dispatch_get_main_queue(), ^{ + attach.preview = result; + attach.isDownloading = NO; + NSInteger index = [self.attachmentsArray indexOfObject:attach]; + [self.attachmentsScrollView performBatchUpdates:^{ + [self.attachmentsScrollView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForItem:index inSection:0]]]; + } completion:nil]; + + }); + + } failure:^(VKHTTPOperation *operation, NSError *error) { + [self removeAttachIfExists:attach]; + [self.attachmentsScrollView reloadData]; + }]; + imageLoad.successCallbackQueue = imageProcessingQueue; + [[VKHTTPClient getClient] enqueueOperation:imageLoad]; + } + [self.attachmentsScrollView performBatchUpdates:^{ + for (VKUploadingAttachment *attach in attachById.allValues) { + NSUInteger index = [self.attachmentsArray indexOfObject:attach]; + if (index != NSNotFound) { + [self.attachmentsArray removeObjectAtIndex:index]; + [self.attachmentsScrollView deleteItemsAtIndexPaths:@[[NSIndexPath indexPathForItem:index inSection:0]]]; + } + } + } completion:nil]; + [self.attachmentsScrollView reloadData]; + }]; + [req start]; + } + [self.attachmentsScrollView reloadData]; + + if (self.parent.shareLink) { + [shareDialogView setShareLink:self.parent.shareLink]; + } +} + +#pragma mark - UICollectionView work + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + return self.attachmentsArray.count; +} + +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { + VKUploadingAttachment *object = self.attachmentsArray[(NSUInteger) indexPath.item]; + return object.attachSize; +} + +- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + VKUploadingAttachment *attach = self.attachmentsArray[(NSUInteger) indexPath.item]; + VKPhotoAttachmentCell *cell = (VKPhotoAttachmentCell *) [collectionView dequeueReusableCellWithReuseIdentifier:@"VKPhotoAttachmentCell" forIndexPath:indexPath]; + + cell.attachImageView.image = attach.preview; + VKRequest *request = attach.uploadingRequest; + + __weak VKPhotoAttachmentCell *weakCell = cell; + [request setProgressBlock:^(VKProgressType progressType, long long bytesLoaded, long long bytesTotal) { + if (bytesTotal < 0) { + return; + } + weakCell.progress = bytesLoaded * 1.0f / bytesTotal; + }]; + if (attach.isDownloading) { + cell.progress = -1; + } + if (!attach.isDownloading && !request) { + [cell hideProgress]; + } + + return cell; +} + +- (void)removeAttachIfExists:(VKUploadingAttachment *)attach { + NSInteger index = [self.attachmentsArray indexOfObject:attach]; + if (index != NSNotFound) { + [self.attachmentsArray removeObjectAtIndex:(NSUInteger) index]; + [self.attachmentsScrollView reloadData]; + } +} + +- (void)textViewDidChange:(UITextView *)textView { + self.sendButton.enabled = YES; + if (!textView.text.length && !self.attachmentsArray.count) { + self.sendButton.enabled = NO; + } +} +@end + +static NSString *const SETTINGS_FRIENDS_ONLY = @"FriendsOnly"; +static NSString *const SETTINGS_TWITTER = @"ExportTwitter"; +static NSString *const SETTINGS_FACEBOOK = @"ExportFacebook"; +static NSString *const SETTINGS_LIVEJOURNAL = @"ExportLivejournal"; + +@implementation VKShareSettingsController + +- (instancetype)initWithPostSettings:(VKPostSettings *)settings { + self = [super init]; + self.currentSettings = settings; + NSMutableArray *newRows = [NSMutableArray new]; + if (self.currentSettings.friendsOnly) + [newRows addObject:SETTINGS_FRIENDS_ONLY]; + if (self.currentSettings.exportTwitter) + [newRows addObject:SETTINGS_TWITTER]; + if (self.currentSettings.exportFacebook) + [newRows addObject:SETTINGS_FACEBOOK]; + if (self.currentSettings.exportLivejournal) + [newRows addObject:SETTINGS_LIVEJOURNAL]; + self.rows = newRows; + return self; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + self.tableView.tableFooterView = [UIView new]; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.rows.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SwitchCell"]; + UISwitch *switchView; + if (cell == nil) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SwitchCell"]; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + switchView = [[UISwitch alloc] initWithFrame:CGRectZero]; + switchView.tintColor = VK_COLOR; + switchView.onTintColor = VK_COLOR; + + cell.accessoryView = switchView; + + [switchView addTarget:self action:@selector(switchChanged:) forControlEvents:UIControlEventValueChanged]; + } else { + switchView = (UISwitch *) cell.accessoryView; + } + NSString *currentRow = self.rows[(NSUInteger) indexPath.row]; + if ([currentRow isEqual:SETTINGS_FRIENDS_ONLY]) { + switchView.on = self.currentSettings.friendsOnly.boolValue; + } else { + if ([currentRow isEqual:SETTINGS_TWITTER]) { + switchView.on = self.currentSettings.exportTwitter.boolValue; + } else if ([currentRow isEqual:SETTINGS_FACEBOOK]) { + switchView.on = self.currentSettings.exportFacebook.boolValue; + } else if ([currentRow isEqual:SETTINGS_LIVEJOURNAL]) { + switchView.on = self.currentSettings.exportLivejournal.boolValue; + } + switchView.enabled = !self.currentSettings.friendsOnly.boolValue; + } + cell.textLabel.text = VKLocalizedString(currentRow); + switchView.tag = 100 + indexPath.row; + + return cell; +} + +- (void)switchChanged:(UISwitch *)sender { + NSString *currentRow = self.rows[(NSUInteger) (sender.tag - 100)]; + if ([currentRow isEqual:SETTINGS_FRIENDS_ONLY]) { + self.currentSettings.friendsOnly = @(sender.on); + [self.tableView performSelector:@selector(reloadData) withObject:nil afterDelay:0.3]; + } else if ([currentRow isEqual:SETTINGS_TWITTER]) { + self.currentSettings.exportTwitter = @(sender.on); + } else if ([currentRow isEqual:SETTINGS_FACEBOOK]) { + self.currentSettings.exportFacebook = @(sender.on); + } else if ([currentRow isEqual:SETTINGS_LIVEJOURNAL]) { + self.currentSettings.exportLivejournal = @(sender.on); + } +} + +@end + + +@implementation VKShareLink + +- (instancetype)initWithTitle:(NSString *)title link:(NSURL *)link { + self = [super init]; + self.title = title ?: VKLocalizedString(@"Link"); + self.link = link; + return self; +} + +@end + +@implementation VKHelperNavigationController +@end + diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKSharedTransitioningObject.h b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKSharedTransitioningObject.h new file mode 100644 index 0000000..5584ef0 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKSharedTransitioningObject.h @@ -0,0 +1,11 @@ +// +// Created by Roman Truba on 24.02.15. +// Copyright (c) 2015 VK. All rights reserved. +// + +#import +#import + + +@interface VKSharedTransitioningObject : NSObject +@end \ No newline at end of file diff --git a/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKSharedTransitioningObject.m b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKSharedTransitioningObject.m new file mode 100644 index 0000000..c1bdc22 --- /dev/null +++ b/dayPhoto/Pods/VK-ios-sdk/library/Source/Views/VKSharedTransitioningObject.m @@ -0,0 +1,84 @@ +// +// Created by Roman Truba on 24.02.15. +// Copyright (c) 2015 VK. All rights reserved. +// + +#import "VKSharedTransitioningObject.h" +#import "VKUtil.h" + +@interface AnimatedTransitioning : NSObject +@property(nonatomic, assign) BOOL isPresenting; +@end + + +@implementation VKSharedTransitioningObject +- (id )animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source { + if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0") || VK_IS_DEVICE_IPAD) return nil; + AnimatedTransitioning *controller = [[AnimatedTransitioning alloc] init]; + controller.isPresenting = YES; + return controller; +} + +- (id )animationControllerForDismissedController:(UIViewController *)dismissed { + if (VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0") || VK_IS_DEVICE_IPAD) return nil; + AnimatedTransitioning *controller = [[AnimatedTransitioning alloc] init]; + return controller; +} + +- (id )interactionControllerForPresentation:(id )animator { + return nil; +} + +- (id )interactionControllerForDismissal:(id )animator { + return nil; +} +@end + +///------------------------------- +/// @name Animated transition for iOS 7 semi-transparent view +///------------------------------- +@implementation AnimatedTransitioning + +- (NSTimeInterval)transitionDuration:(id )transitionContext { + return 0.25f; +} + +- (void)animateTransition:(id )transitionContext { + + UIView *inView = [transitionContext containerView]; + UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; + UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; + + [inView addSubview:toVC.view]; + if (!self.isPresenting) { + [inView addSubview:fromVC.view]; + } + + CGRect finalFrame = [transitionContext finalFrameForViewController:toVC]; + if (!finalFrame.size.width || !finalFrame.size.height) { + finalFrame = fromVC.view.frame; + finalFrame.origin = CGPointMake(0, 0); + } + [toVC.view setFrame:finalFrame]; + if (self.isPresenting) { + toVC.view.alpha = 0; + } + + [UIView animateWithDuration:[self transitionDuration:transitionContext] + animations:^{ + [toVC.view setFrame:CGRectMake(0, 0, fromVC.view.frame.size.width, fromVC.view.frame.size.height)]; + if (self.isPresenting) { + toVC.view.alpha = 1; + } else { + fromVC.view.alpha = 0; + } + } + completion:^(BOOL finished) { + [transitionContext completeTransition:YES]; + if (!self.isPresenting) { + [fromVC.view removeFromSuperview]; + } + }]; +} + +@end \ No newline at end of file diff --git a/dayPhoto/README.md b/dayPhoto/README.md new file mode 100755 index 0000000..ce3e4ae --- /dev/null +++ b/dayPhoto/README.md @@ -0,0 +1,17 @@ +### In this project was released: + +- Using UIVisualEffectView (was added blur effect for imageView and UIButton). + - [UIVisualEffectView tutorail](http://www.raywenderlich.com/84043/ios-8-visual-effects-tutorial) +- Custom view controller presentation transitions (custom transition from UICollectionViewCell to PhotoViewController and back) + - [Custom presentation transitions tutorail](http://www.raywenderlich.com/113845/ios-animation-tutorial-custom-view-controller-presentation-transitions) +- Custom UICollectionView Layout (layout height was calculated by image orientation) + - [Custom UICollectionView Layout tutorail](http://www.raywenderlich.com/107439/uicollectionview-custom-layout-tutorial-pinterest) +- Introduce to multitasking + - [iOS 9 multitasking tutorail](http://www.raywenderlich.com/115700/ios-9-multitasking-tutorial) + + + + + + +[![Flatstack](https://avatars0.githubusercontent.com/u/15136?v=2&s=200)](http://www.flatstack.com) diff --git a/dayPhoto/TwitterCore.framework/Headers/TWTRAPIErrorCode.h b/dayPhoto/TwitterCore.framework/Headers/TWTRAPIErrorCode.h new file mode 100644 index 0000000..c6128fb --- /dev/null +++ b/dayPhoto/TwitterCore.framework/Headers/TWTRAPIErrorCode.h @@ -0,0 +1,149 @@ +// +// TWTRAPIErrorCode.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import + +/** + * The NSError domain of errors surfaced by the Twitter API. + */ +FOUNDATION_EXPORT NSString * const TWTRAPIErrorDomain; + +/** + * Error codes surfaced by the Twitter API. + * @see https://dev.twitter.com/docs/error-codes-responses + */ +typedef NS_ENUM(NSUInteger, TWTRAPIErrorCode) { + /** + * Your call could not be completed as dialed. + */ + TWTRAPIErrorCodeCouldNotAuthenticate = 32, + + /** + * Corresponds with an HTTP 404 - the specified resource was not found. + */ + TWTRAPIErrorCodePageNotExist = 34, + + /** + * Not authorized to use this endpoint. + */ + TWTRAPIErrorCodeNotAuthorizedForEndpoint = 37, + + /** + * Corresponds with an HTTP 403 — the access token being used belongs to a suspended user and they can't complete the action you're trying to take + */ + TWTRAPIErrorCodeAccountSuspended = 64, + + /** + * Corresponds to a HTTP request to a retired v1-era URL. + */ + TWTRAPIErrorCodeAPIVersionRetired = 68, + + /** + * The request limit for this resource has been reached for the current rate limit window. + */ + TWTRAPIErrorCodeRateLimitExceeded = 88, + + /** + * The access token used in the request is incorrect or has expired. Used in API v1.1. + */ + TWTRAPIErrorCodeInvalidOrExpiredToken = 89, + + /** + * Only SSL connections are allowed in the API, you should update your request to a secure connection. See [how to connect using SSL](https://dev.twitter.com/docs/security/using-ssl). + */ + TWTRAPIErrorCodeSSLInvalid = 92, + + /** + * Corresponds with an HTTP 503 - Twitter is temporarily over capacity. + */ + TWTRAPIErrorCodeOverCapacity = 130, + + /** + * Corresponds with an HTTP 500 - An unknown internal error occurred. + */ + TWTRAPIErrorCodeInternalError = 131, + + /** + * Corresponds with a HTTP 401 - it means that your oauth_timestamp is either ahead or behind our acceptable range. + */ + TWTRAPIErrorCodeCouldNotAuthenticateTimestampOutOfRange = 135, + + /** + * You have already favorited this status. + */ + TWTRAPIErrorCodeAlreadyFavorited = 139, + + /** + * Corresponds with HTTP 403 — returned when a user cannot follow another user due to some kind of limit. + */ + TWTRAPIErrorCodeCannotFollowOverLimit = 161, + + /** + * Corresponds with HTTP 403 — returned when a Tweet cannot be viewed by the authenticating user, usually due to the Tweet's author having protected their Tweets. + */ + TWTRAPIErrorCodeNotAuthorizedToSeeStatus = 179, + + /** + * Corresponds with HTTP 403 — returned when a Tweet cannot be posted due to the user having no allowance remaining to post. Despite the text in the error message indicating that this error is only returned when a daily limit is reached, this error will be returned whenever a posting limitation has been reached. Posting allowances have roaming windows of time of unspecified duration. + */ + TWTRAPIErrorCodeOverDailyStatusUpdateLimit = 185, + + /** + * The status text has been Tweeted already by the authenticated account. + */ + TWTRAPIErrorCodeStatusIsDuplicate = 187, + + /** + * Typically sent with 1.1 responses with HTTP code 400. The method requires authentication but it was not presented or was wholly invalid. + */ + TWTRAPIErrorCodeBadAuthenticationData = 215, + + /** + * We constantly monitor and adjust our filters to block spam and malicious activity on the Twitter platform. These systems are tuned in real-time. If you get this response our systems have flagged the Tweet or DM as possibly fitting this profile. If you feel that the Tweet or DM you attempted to create was flagged in error, please report the details around that to us by filing a ticket at https://support.twitter.com/forms/platform + */ + TWTRAPIErrorCodeRequestIsAutomated = 226, + + /** + * Returned as a challenge in xAuth when the user has login verification enabled on their account and needs to be directed to twitter.com to [generate a temporary password](https://twitter.com/settings/applications). + */ + TWTRAPIErrorCodeUserMustVerifyLogin = 231, + + /** + * "Bad guest token." The token has probably expired. Try calling `-[Twitter logInGuestWithCompletion:]` again later. + */ + TWTRAPIErrorCodeBadGuestToken = 239, + + /** + * Corresponds to a HTTP request to a retired URL. + */ + TWTRAPIErrorCodeEndpointRetired = 251, + + /** + * Corresponds with HTTP 403 — returned when the application is restricted from POST, PUT, or DELETE actions. See [How to appeal application suspension and other disciplinary actions](https://support.twitter.com/articles/72585). + */ + TWTRAPIErrorCodeApplicationCannotPerformWriteAction = 261, + + /** + * Corresponds with HTTP 403. The authenticated user account cannot mute itself. + */ + TWTRAPIErrorCodeCannotMuteSelf = 271, + + /** + * Corresponds with HTTP 403. The authenticated user account is not muting the account a call is attempting to unmute. + */ + TWTRAPIErrorCodeCannotMuteSpecifiedUser = 272, + + /** + * You have already retweeted this tweet. + */ + TWTRAPIErrorCodeAlreadyRetweeted = 327, + + /** + * Returned in API v1.1 when a request cannot be served due to the application's rate limit having been exhausted for the resource. See [Rate Limiting in API v1.1](https://dev.twitter.com/docs/rate-limiting/1.1). + */ + TWTRAPIErrorCodeTooManyRequests = 429 +}; + diff --git a/dayPhoto/TwitterCore.framework/Headers/TWTRAuthConfig.h b/dayPhoto/TwitterCore.framework/Headers/TWTRAuthConfig.h new file mode 100644 index 0000000..8dcdd61 --- /dev/null +++ b/dayPhoto/TwitterCore.framework/Headers/TWTRAuthConfig.h @@ -0,0 +1,37 @@ +// +// TWTRAuthConfig.h +// TwitterKit +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import + +/** + * Authentication configuration details. Encapsulates credentials required to authenticate a Twitter application. You can obtain your credentials at https://apps.twitter.com/. + */ +@interface TWTRAuthConfig : NSObject + +/** + * The consumer key of the Twitter application. + */ +@property (nonatomic, copy, readonly) NSString *consumerKey; +/** + * The consumer secret of the Twitter application. + */ +@property (nonatomic, copy, readonly) NSString *consumerSecret; + +/** + * Returns an `TWTRAuthConfig` object initialized by copying the values from the consumer key and consumer secret. + * + * @param consumerKey The consumer key. + * @param consumerSecret The consumer secret. + */ +- (instancetype)initWithConsumerKey:(NSString *)consumerKey consumerSecret:(NSString *)consumerSecret; + +/** + * Unavailable. Use `initWithConsumerKey:consumerSecret:` instead. + */ +- (instancetype)init __attribute__((unavailable("Use -initWithConsumerKey:consumerSecret: instead."))); + +@end diff --git a/dayPhoto/TwitterCore.framework/Headers/TWTRAuthSession.h b/dayPhoto/TwitterCore.framework/Headers/TWTRAuthSession.h new file mode 100644 index 0000000..bfa6a9c --- /dev/null +++ b/dayPhoto/TwitterCore.framework/Headers/TWTRAuthSession.h @@ -0,0 +1,24 @@ +// +// TWTRAuthSession.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import + +/** + * The base session which all sessions must conform to. + */ +@protocol TWTRBaseSession +@end + +/** + * Encapsulates the authorization details of an OAuth Session. + */ +@protocol TWTRAuthSession + +@property (nonatomic, readonly, copy) NSString *authToken; +@property (nonatomic, readonly, copy) NSString *authTokenSecret; +@property (nonatomic, readonly, copy) NSString *userID; + +@end diff --git a/dayPhoto/TwitterCore.framework/Headers/TWTRConstants.h b/dayPhoto/TwitterCore.framework/Headers/TWTRConstants.h new file mode 100644 index 0000000..9bfe604 --- /dev/null +++ b/dayPhoto/TwitterCore.framework/Headers/TWTRConstants.h @@ -0,0 +1,117 @@ +// +// TWTRConstants.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import + +#pragma mark - Error messages + +/** + * The NSError domain of errors surfaced by the Twitter SDK. + */ +FOUNDATION_EXPORT NSString * const TWTRErrorDomain; + +/** + * Error codes surfaced by the Twitter SDK. + */ +typedef NS_ENUM(NSInteger, TWTRErrorCode) { + /** + * Unknown error. + */ + TWTRErrorCodeUnknown = -1, + /** + * Authentication has not been set up yet. You must call -[Twitter logInWithCompletion:] or -[Twitter logInGuestWithCompletion:] + */ + TWTRErrorCodeNoAuthentication = 0, + /** + * Twitter has not been initialized yet. Call +[Fabric with:@[TwitterKit]] or -[Twitter startWithConsumerKey:consumerSecret:]. + */ + TWTRErrorCodeNotInitialized = 1, + /** + * User has declined to grant permission to information such as their email address. + */ + TWTRErrorCodeUserDeclinedPermission = 2, + /** + * User has granted permission to their email address but no address is associated with their account. + */ + TWTRErrorCodeUserHasNoEmailAddress = 3, + /** + * A resource has been requested by ID, but that ID was not found. + */ + TWTRErrorCodeInvalidResourceID = 4, + /** + * A request has been issued for an invalid URL. + */ + TWTRErrorCodeInvalidURL = 5, + /** + * Type mismatch in parsing JSON from the Twitter API. + */ + TWTRErrorCodeMismatchedJSONType = 6, + /** + * Fail to save to keychain. + */ + TWTRErrorCodeKeychainSerializationFailure = 7, + /** + * Fail to save to disk. + */ + TWTRErrorCodeDiskSerializationError = 8, + /** + * Error authenticating with the webview. + */ + TWTRErrorCodeWebViewError = 9, + /** + * A required parameter is missing. + */ + TWTRErrorCodeMissingParameter = 10 +}; + +/** + * The NSError domain of errors surfaced by the Twitter SDK during the login operation. + */ +FOUNDATION_EXPORT NSString * const TWTRLogInErrorDomain; + +/** + * Error codes surfaced by the Twitter SDK with the `TWTRLogInErrorDomain` error domain. + */ +typedef NS_ENUM(NSInteger, TWTRLogInErrorCode) { + /** + * Unknown error. + */ + TWTRLogInErrorCodeUnknown = -1, + /** + * User denied login. + */ + TWTRLogInErrorCodeDenied = 0, + /** + * User canceled login. + */ + TWTRLogInErrorCodeCanceled = 1, + /** + * No Twitter account found. + */ + TWTRLogInErrorCodeNoAccounts = 2, + /** + * Reverse auth with linked account failed. + */ + TWTRLogInErrorCodeReverseAuthFailed = 3, + /** + * Refreshing session tokens failed. + */ + TWTRLogInErrorCodeCannotRefreshSession = 4, + /** + * No such session or session is not tracked + * in the associated session store. + */ + TWTRLogInErrorCodeSessionNotFound = 5, + /** + * The login request failed. + */ + TWTRLogInErrorCodeFailed = 6, + /** + * The system account credentials are no longer valid and the + * user will need to update their credentials in the Settings app. + */ + TWTRLogInErrorCodeSystemAccountCredentialsInvalid = 7 +}; diff --git a/dayPhoto/TwitterCore.framework/Headers/TWTRCoreOAuthSigning.h b/dayPhoto/TwitterCore.framework/Headers/TWTRCoreOAuthSigning.h new file mode 100644 index 0000000..e4ae5dd --- /dev/null +++ b/dayPhoto/TwitterCore.framework/Headers/TWTRCoreOAuthSigning.h @@ -0,0 +1,46 @@ +// +// TWTRCoreOAuthSigning.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import + +FOUNDATION_EXPORT NSString * const TWTROAuthEchoRequestURLStringKey; +FOUNDATION_EXPORT NSString * const TWTROAuthEchoAuthorizationHeaderKey; + +@protocol TWTRCoreOAuthSigning + +/** + * @name OAuth Echo + */ + +/** + * OAuth Echo is a means to securely delegate OAuth authorization to a third party while interacting with an API. + * For example, you may wish to verify a user's credentials from your app's server (the third party) rather than your app. + * This method provides you with the OAuth signature to add to the third party's request to `URLString`, as well as the formed + * URL with the query string to send that request to. + * This is equivalent to calling `-URLRequestWithMethod:URL:parameters:error:` and getting the URL and the `Authorization` HTTP header out of the request. + * + * @param method Request method, GET, POST, PUT, DELETE, etc. + * @param URLString The full URL of the Twitter endpoint you plan to send a request to. E.g. https://api.twitter.com/1.1/account/verify_credentials.json + * @param parameters Request parameters. + * @param error Error in the `TWTRErrorDomain` domain. The code will be `TWTRErrorCodeInvalidURL` if the `URLString`'s host is not api.twitter.com + * + * @return `nil` if there's an error or a missing required parameter, or a dictionary with the fully formed request URL under `TWTROAuthEchoRequestURLStringKey` (`NSString`), and the `Authorization` header in `TWTROAuthEchoAuthorizationHeaderKey` (`NSString`), to be used to sign the request. + * + * @see More information about OAuth Echo: https://dev.twitter.com/oauth/echo + */ +- (NSDictionary *)OAuthEchoHeadersForRequestMethod:(NSString *)method URLString:(NSString *)URLString parameters:(NSDictionary *)parameters error:(NSError **)error __attribute__((nonnull(1, 2))); + +/** + * This method provides you with the OAuth signature, as well as the formed URL with the query string, to send a request to `verify_credentials`. + * + * @return A dictionary with the fully formed Request URL under `TWTROAuthEchoRequestURLStringKey` (`NSString`), and the `Authorization` header in `TWTROAuthEchoAuthorizationHeaderKey` (`NSString`), to be used to sign the request. + * + * @see More information about OAuth Echo: https://dev.twitter.com/oauth/echo + * @see More information about Verify Credentials: https://dev.twitter.com/rest/reference/get/account/verify_credentials + */ +- (NSDictionary *)OAuthEchoHeadersToVerifyCredentials; + +@end diff --git a/dayPhoto/TwitterCore.framework/Headers/TWTRDefines.h b/dayPhoto/TwitterCore.framework/Headers/TWTRDefines.h new file mode 100644 index 0000000..95dde9a --- /dev/null +++ b/dayPhoto/TwitterCore.framework/Headers/TWTRDefines.h @@ -0,0 +1,39 @@ +// +// TWTRDefines.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#pragma once + +#if __has_feature(nullability) + #define twtr_nullable nullable + #define twtr_nonnull nonnull + #define twtr_null_unspecified null_unspecified + #define twtr_null_resettable null_resettable + #define __twtr_nullable __nullable + #define __twtr_nonnull __nonnull + #define __twtr_null_unspecified __null_unspecified +#else + #define twtr_nullable + #define twtr_nonnull + #define twtr_null_unspecified + #define twtr_null_resettable + #define __twtr_nullable + #define __twtr_nonnull + #define __twtr_null_unspecified +#endif + +#define TWC_STR_HELPER(x) #x +#define TWC_STR(x) TWC_STR_HELPER(x) + +#ifndef NS_ASSUME_NONNULL_BEGIN + #define NS_ASSUME_NONNULL_BEGIN +#endif + +#ifndef NS_ASSUME_NONNULL_END + #define NS_ASSUME_NONNULL_END +#endif + +#define IS_UIKIT_AVAILABLE (TARGET_OS_IOS || TARGET_OS_TV) +#define IS_SOCIAL_ACCOUNTS_AVAILABLE (TARGET_OS_MAC && !TARGET_OS_WATCH && !TARGET_OS_TV) diff --git a/dayPhoto/TwitterCore.framework/Headers/TWTRGuestSession.h b/dayPhoto/TwitterCore.framework/Headers/TWTRGuestSession.h new file mode 100644 index 0000000..d1a3ebf --- /dev/null +++ b/dayPhoto/TwitterCore.framework/Headers/TWTRGuestSession.h @@ -0,0 +1,60 @@ +// +// TWTRGuestSession.h +// TwitterKit +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import +#import "TWTRAuthSession.h" + +@class TWTRGuestSession; + +NS_ASSUME_NONNULL_BEGIN + +/** + * Completion block called when guest login succeeds or fails. + * + * @param guestSession A `TWTRGuestSession` containing the OAuth tokens or nil. + * @param error Error that will be non nil if the authentication request failed. + */ +typedef void (^TWTRGuestLogInCompletion)(TWTRGuestSession * __twtr_nullable guestSession, NSError * __twtr_nullable error); + +/** + * `TWTRGuestSession` represents a guest session authenticated with the Twitter API. See `TWTRSession` for user sessions. + */ +@interface TWTRGuestSession : NSObject + +/** + * The bearer access token for guest auth. + */ +@property (nonatomic, copy, readonly) NSString *accessToken; + +/** + * The guest access token. + */ +@property (nonatomic, copy, readonly) NSString *guestToken; + +/** + * Returns an `TWTRGuestSession` object initialized by copying the values from the dictionary or nil if the dictionary is missing. + * + * @param sessionDictionary (required) The dictionary received after successfull authentication from Twitter guest-only authentication. + */ +- (instancetype)initWithSessionDictionary:(NSDictionary *)sessionDictionary; + +/** + * Returns a `TWTRGuestSession` object + * + * @param accessToken the access token + * @param guestToken the guest access token + */ +- (instancetype)initWithAccessToken:(NSString *)accessToken guestToken:(twtr_nullable NSString *)guestToken NS_DESIGNATED_INITIALIZER; + +/** + * Unavailable. Use `-initWithSessionDictionary:` instead. + */ +- (instancetype)init __attribute__((unavailable("Use -initWithSessionDictionary: or initWithAccessToken:guestToken: instead."))); + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterCore.framework/Headers/TWTRSession.h b/dayPhoto/TwitterCore.framework/Headers/TWTRSession.h new file mode 100644 index 0000000..e3d6423 --- /dev/null +++ b/dayPhoto/TwitterCore.framework/Headers/TWTRSession.h @@ -0,0 +1,71 @@ +// +// TWTRSession.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import "TWTRAuthConfig.h" +#import "TWTRAuthSession.h" +#import "TWTRGuestSession.h" + +@class TWTRSession; + +NS_ASSUME_NONNULL_BEGIN + +/** + * Completion block called when user login succeeds or fails. + * + * @param session Contains the OAuth tokens and minimal information associated with the logged in user or nil. + * @param error Error that will be non nil if the authentication request failed. + */ +typedef void (^TWTRLogInCompletion)(TWTRSession * __twtr_nullable session, NSError * __twtr_nullable error); + +/** + * TWTRSession represents a user's session authenticated with the Twitter API. + */ +@interface TWTRSession : NSObject + +/** + * The authorization token. + */ +@property (nonatomic, copy, readonly) NSString *authToken; +/** + * The authorization token secret. + */ +@property (nonatomic, copy, readonly) NSString *authTokenSecret; +/** + * The username associated with the access token. + */ +@property (nonatomic, copy, readonly) NSString *userName; +/** + * The user ID associated with the access token. + */ +@property (nonatomic, copy, readonly) NSString *userID; + +/** + * Returns an `TWTRSession` object initialized by copying the values from the dictionary or nil if the dictionary is missing. + * + * @param sessionDictionary (required) The dictionary received after successfull authentication from Twitter OAuth. + */ +- (instancetype)initWithSessionDictionary:(NSDictionary *)sessionDictionary; + +/** + * Returns an `TWTRSession` object initialized by copying the given tokens and user info. + * + * @param authToken (required) The authorization token for the session + * @param authTokenSecret (required) The authorization token secret for the session + * @param userName (required) The username for the user associated with the session. + * @param userID (required) The unique ID for the user associated with the session. + * + * @return A `TWTRSession` object initialized with the provided parameters. + */ +- (instancetype)initWithAuthToken:(NSString *)authToken authTokenSecret:(NSString *)authTokenSecret userName:(NSString *)userName userID:(NSString *)userID NS_DESIGNATED_INITIALIZER; + +/** + * Unavailable. Use -initWithSessionDictionary: instead. + */ +- (instancetype)init __attribute__((unavailable("Use -initWithSessionDictionary: instead."))); + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterCore.framework/Headers/TWTRSessionStore.h b/dayPhoto/TwitterCore.framework/Headers/TWTRSessionStore.h new file mode 100644 index 0000000..6de44b5 --- /dev/null +++ b/dayPhoto/TwitterCore.framework/Headers/TWTRSessionStore.h @@ -0,0 +1,214 @@ +// +// TWTRSessionStore.h +// TwitterCore +// +// Copyright (c) 2015 Twitter Inc. All rights reserved. +// + +@class TWTRAuthConfig; +@class TWTRGuestSession; +@class TWTRSession; +@protocol TWTRAuthSession; +@protocol TWTRAPIServiceConfig; +@protocol TWTRErrorLogger; + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - TWTRSessionRefreshingStore Protocol + +/** + * Completion block called when a session refresh succeeds or fails. + * + * @param refreshedSession The refreshed session + * @param error Error that will be non nil if the refresh request failed + */ +typedef void (^TWTRSessionStoreRefreshCompletion)(id __twtr_nullable refreshedSession, NSError * __twtr_nullable error); + +/** + * Protocol for session stores that can refresh expired sessions. + */ +@protocol TWTRSessionRefreshingStore + +/** + * Refresh an expired session. + * + * @param sessionClass The class of the session + * @param sessionID ID of the session wherever applicable e.g. `userID` if it's a user session. + * @param completion The completion block to call when the refresh request succeeds or fails. + */ +- (void)refreshSessionClass:(Class)sessionClass sessionID:(twtr_nullable NSString *)sessionID completion:(TWTRSessionStoreRefreshCompletion)completion; + +/** + * Determines whether the given session has expired. + * + * @param session The session to check for expiration + * @param response API request response to check for expiration + * + * @return Whether the session has expired. + */ +- (BOOL)isExpiredSession:(id)session response:(NSHTTPURLResponse *)response; + +/** + * Determines whether the given session has expired based on a given error. + * + * @param session The session to check for expiration + * @param error API request error to check for expiration + * + * @return Whether the session has expired. + */ +- (BOOL)isExpiredSession:(id)session error:(NSError *)error; + +@end + +#pragma mark - TWTRUserSessionStore Protocol + +/** + * Completion block called when a user session saved to the session store or fails. + * + * @param session The saved session + * @param error Error that will be non nil if the save request fails. + */ +typedef void (^TWTRSessionStoreSaveCompletion)(id __twtr_nullable session, NSError * __twtr_nullable error); + +/** + * Completion block called when fetching all stored user sessions completes or fails. + * + * @param sessions All stored user sessions or empty array if there are no user sessions found. + */ +typedef void (^TWTRSessionStoreBatchFetchCompletion)(NSArray *sessions); + +/** + * Completion block to call when the session is deleted or fails. + * + * @param session The deleted session or nil if none was found for the user. + */ +typedef void (^TWTRSessionStoreDeleteCompletion)(id __twtr_nullable session); + +/** + * Protocol for session store that manages user sessions. + */ +@protocol TWTRUserSessionStore + +/** + * Saves the existing session to the store after validations. + * + * @param session The user session to save + * @param completion Completion block to call when the save request succeeds or fails + */ +- (void)saveSession:(id)session completion:(TWTRSessionStoreSaveCompletion)completion; + +/** + * Fetches the user session for for the given auth tokens and saves it to the store after validations. + * + * @param authToken The existing authToken to use for authentication. + * @param authTokenSecret The existing authTokenSecret to use for authentication. + * @param completion Completion block to call when the save request succeeds or fails + */ +- (void)saveSessionWithAuthToken:(NSString *)authToken authTokenSecret:(NSString *)authTokenSecret completion:(TWTRSessionStoreSaveCompletion)completion; + +/** + * Checks to see if the user is logged in and has a saved session. + * + * @param userID The user ID to fetch session for. + */ +- (twtr_nullable id)sessionForUserID:(NSString *)userID; + +/** + * Retrieve all logged in user sessions in ascending order of last saved date + * + * @note This is a blocking call. + */ +- (NSArray *)existingUserSessions; + +/** + * Retrieves the last logged in user session. + * + * @return The last logged in user session. + */ +- (twtr_nullable id)session; + +/** + * Deletes the local Twitter user session from this app. This will not remove the system Twitter account nor make a network request to invalidate the session. + * + * @param userID ID of the user to log out + */ +- (void)logOutUserID:(NSString *)userID; + +@end + +#pragma mark - TWTRGuestSessionStore Protocol + +/** + * Completion block called when retrieving a guest session succeeds or fails. + * + * @param guestSession The retrieved guest session + * @param error Error that will be non nil if the save request fails. + */ +typedef void (^TWTRSessionGuestLogInCompletion)(TWTRGuestSession * __twtr_nullable guestSession, NSError * __twtr_nullable error); + +/** + * Protocol for session stores that can manage guest sessions. + */ +@protocol TWTRGuestSessionStore + +/** + * Log in as a guest user and return the guest session. This can be used when the user is not a Twitter user. + * + * @param completion Completion block to call when the authentication succeeds or fails. + * + * @warning This method assumes your application, as indicated by the `consumerKey` and `consumerSecret` in the `authConfig`, has been whitelisted for guest authentication. + */ +- (void)fetchGuestSessionWithCompletion:(TWTRSessionGuestLogInCompletion)completion; + +@end + +#pragma mark - Composite TWTRSessionStore Protocol + +/** + * Convenience composite protocol of a store that handles user, guest, and refreshable sessions. + */ +@protocol TWTRSessionStore + +/** + * Returns the store's auth config. + */ +@property (nonatomic, readonly) TWTRAuthConfig *authConfig; + +@end + + +#pragma mark - Concrete Session Store Class + +/** + * Concrete implementation of . This session store supports fetching and storage of + * user and guest sessions. In addition, the session store also supports refreshing of such sessions when they expire. + * + * @warning Instances of the session manager at the same path are not synchronized. The session store + * will simply choose the latest version in the case of conflicts. + */ +@interface TWTRSessionStore : NSObject + +- (instancetype)init __unavailable; + +/** + * Provides a mechanism for reloading the session store. This method will force the session store + * to find any sessions that may have been saved by another session store or application that is + * using the same keychain access groups. + * + * Most applications will not need to call this method. You may need to call this method if you are + * using multiple stores within your application and you need to synchronize when one writes to the + * store. The more likely case for needing to call this method is if you are sharing credentials + * between applications. In this situation you will want to call this method when the application + * comes back to the foreground. + * + * This method does not need to be called when the store is created because this process happens + * by default at time of instantiation. + * + * You should avoid calling this method if you do not have a specific reason to do so, like the reasons + * mentioned above as this method does cause disk I/O and multiple calls can cause performance problems. + */ +- (void)reloadSessionStore; + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterCore.framework/Headers/TwitterCore.h b/dayPhoto/TwitterCore.framework/Headers/TwitterCore.h new file mode 100644 index 0000000..f50b352 --- /dev/null +++ b/dayPhoto/TwitterCore.framework/Headers/TwitterCore.h @@ -0,0 +1,30 @@ +// +// TwitterCore.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import +#if !TARGET_OS_TV +#import +#endif +#import +#if !TARGET_OS_TV +#import +#endif +#import "TWTRDefines.h" + +#if IS_UIKIT_AVAILABLE +#import +#else +#import +#endif + +#import "TWTRAPIErrorCode.h" +#import "TWTRAuthConfig.h" +#import "TWTRAuthSession.h" +#import "TWTRConstants.h" +#import "TWTRCoreOAuthSigning.h" +#import "TWTRGuestSession.h" +#import "TWTRSession.h" +#import "TWTRSessionStore.h" diff --git a/dayPhoto/TwitterCore.framework/Info.plist b/dayPhoto/TwitterCore.framework/Info.plist new file mode 100644 index 0000000..cc77eb8 --- /dev/null +++ b/dayPhoto/TwitterCore.framework/Info.plist @@ -0,0 +1,52 @@ + + + + + BuildMachineOSBuild + 14F1021 + CFBundleDevelopmentRegion + English + CFBundleGetInfoString + TwitterCore Framework + CFBundleIdentifier + com.twittercore.sdk.ios + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + TwitterCore + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.14.6 + CFBundleSupportedPlatforms + + iPhoneOS + + CFBundleVersion + 1.14.6 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 13B137 + DTPlatformName + iphoneos + DTPlatformVersion + 9.1 + DTSDKBuild + 13B137 + DTSDKName + iphoneos9.1 + DTXcode + 0711 + DTXcodeBuild + 7B1005 + MinimumOSVersion + 7.0 + NSHumanReadableCopyright + Copyright 2015 Twitter Inc. + UIDeviceFamily + + 1 + + + diff --git a/dayPhoto/TwitterCore.framework/Modules/module.modulemap b/dayPhoto/TwitterCore.framework/Modules/module.modulemap new file mode 100644 index 0000000..bee81d2 --- /dev/null +++ b/dayPhoto/TwitterCore.framework/Modules/module.modulemap @@ -0,0 +1,21 @@ +framework module TwitterCore { + umbrella header "TwitterCore.h" + + export * + module * { export * } + + link framework "Accounts" + link framework "CoreData" + link framework "Social" + + header "TwitterCore.h" + header "TWTRAPIErrorCode.h" + header "TWTRAuthConfig.h" + header "TWTRAuthSession.h" + header "TWTRConstants.h" + header "TWTRCoreOAuthSigning.h" + header "TWTRDefines.h" + header "TWTRGuestSession.h" + header "TWTRSession.h" + header "TWTRSessionStore.h" +} diff --git a/dayPhoto/TwitterCore.framework/TwitterCore b/dayPhoto/TwitterCore.framework/TwitterCore new file mode 100755 index 0000000..0b1583b Binary files /dev/null and b/dayPhoto/TwitterCore.framework/TwitterCore differ diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRAPIClient.h b/dayPhoto/TwitterKit.framework/Headers/TWTRAPIClient.h new file mode 100644 index 0000000..ffe83a1 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRAPIClient.h @@ -0,0 +1,156 @@ +// +// TWTRAPIClient.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +@class TWTRUser; +@class TWTRTweet; +@class TWTRAuthConfig; +@class TWTRGuestSession; +@protocol TWTRAuthSession; +@protocol TWTRSessionStore; + +NS_ASSUME_NONNULL_BEGIN + +FOUNDATION_EXPORT NSString * const TWTRTweetsNotLoadedKey; + +/** + * @name Completion Block Types + */ + +/** + * Completion block called when the load user request succeeds or fails. + * + * @param user The Twitter User. + * @param error Error that will be set if the API request failed. + */ +typedef void (^TWTRLoadUserCompletion)(TWTRUser * __twtr_nullable user, NSError * __twtr_nullable error); + +/** + * Completion block called when the load Tweet request succeeds or fails. + * + * @param tweet The Twitter Tweet. + * @param error Error that will be set if the API request failed. + */ +typedef void (^TWTRLoadTweetCompletion)(TWTRTweet * __twtr_nullable tweet, NSError * __twtr_nullable error); + +/** + * Completion block called when the load Tweets request succeeds or fails. + * + * @param tweets Tweets that were successfully retrieved. + * @param error Error that will be set if the API request failed. + */ +typedef void (^TWTRLoadTweetsCompletion)(NSArray * __twtr_nullable tweets, NSError * __twtr_nullable error); + +/** + * Completion block called when the network request succeeds or fails. + * + * @param response Metadata associated with the response to a URL load request. + * @param data Content data of the response. + * @param connectionError Error object describing the network error that occurred. + */ +typedef void (^TWTRNetworkCompletion)(NSURLResponse * __twtr_nullable response, NSData * __twtr_nullable data, NSError * __twtr_nullable connectionError); + +/** + * Completion block called when a JSON request to the Twitter API succeeds or fails. + * + * @param response Metadata associated with the response to a URL load request. + * @param responseObject Content data of the response. + * @param error Error object describing the network error that occurred. + */ +typedef void (^TWTRJSONRequestCompletion)(NSURLResponse * __twtr_nullable response, id __twtr_nullable responseObject, NSError * __twtr_nullable error); + +/** + * Completion block called when a Tweet action (favorite/retweet) is performed. + * + * @param response Metadata associated with the response to a URL load request. + * @param tweet The Tweet object representing the new state of this Tweet from + * the perspective of the currently-logged in user. + * @param error Error object describing the error that occurred. This will be either a + * network error or an NSError with an errorCode corresponding to + * TWTRAPIErrorCodeAlreadyFavorited or TWTRAPIErrorCodeAlreadyRetweeted + * for an attempted action that has already been taken from the servers + * point of view for this logged-in user. + */ +typedef void (^TWTRTweetActionCompletion)(TWTRTweet * __twtr_nullable tweet, NSError * __twtr_nullable error); + +/** + * Client for consuming the Twitter REST API. Provides methods for common API requests, as well as the ability to create and send custom requests. + */ +@interface TWTRAPIClient : NSObject + +/** + * The Twitter user ID this client is making API requests on behalf of or + * nil if it is a guest user. + */ +@property (nonatomic, copy, readonly, twtr_nullable) NSString *userID; + + +/** + * Constructs a `TWTRAPIClient` object to perform authenticated API requests with user authentication. + * + * @param userID (optional) ID of the user to make requests on behalf of. If the ID is nil requests will be made using guest authentication. + * + * @return Fully initialized API client to make authenticated requests against the Twitter REST API. + */ +- (instancetype)initWithUserID:(twtr_nullable NSString *)userID; + +/** + * @name Making Requests + */ + +/** + * Returns a signed URL request. + * + * @param method Request method, GET, POST, PUT, DELETE, etc. + * @param URL Request URL. This is the full Twitter API URL. E.g. https://api.twitter.com/1.1/statuses/user_timeline.json + * @param parameters Request parameters. + * @param error Error that will be set if there was an error signing the request. + * + * @note If the request is not sent with the -[TWTRAPIClient sendTwitterRequest:completion:] method it is the developers responsibility to ensure that there is a valid guest session before this method is called. + */ +- (NSURLRequest *)URLRequestWithMethod:(NSString *)method URL:(NSString *)URLString parameters:(twtr_nullable NSDictionary *)parameters error:(NSError **)error; + +/** + * Sends a Twitter request. + * + * @param request The request that will be sent asynchronously. + * @param completion Completion block to be called on response. Called on main queue. + */ +- (void)sendTwitterRequest:(NSURLRequest *)request completion:(TWTRNetworkCompletion)completion; + +/** + * @name Common API Actions + */ + +/** + * Loads a Twitter User. + * + * @param userID (required) The Twitter user ID of the desired user. + * @param completion Completion block to be called on response. Called on main queue. + */ +- (void)loadUserWithID:(NSString *)userID completion:(TWTRLoadUserCompletion)completion; + +/** + * Loads a single Tweet from the network or cache. + * + * @param tweetID (required) The ID of the desired Tweet. + * @param completion Completion bock to be called on response. Called on main queue. + */ +- (void)loadTweetWithID:(NSString *)tweetID completion:(TWTRLoadTweetCompletion)completion; + +/** + * Loads a series of Tweets in a batch. The completion block will be passed an array of zero or more + * Tweets that loaded successfully. If some Tweets fail to load the array will contain less Tweets than + * number of requested IDs. If any Tweets fail to load, the IDs of the Tweets that did not load will + * be provided in the userInfo dictionary property of the error parameter under `TWTRTweetsNotLoadedKey`. + * + * @param tweetIDStrings (required) An array of Tweet IDs. + * @param completion Completion block to be called on response. Called on main queue. + */ +- (void)loadTweetsWithIDs:(NSArray *)tweetIDStrings completion:(TWTRLoadTweetsCompletion)completion; + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRCardConfiguration.h b/dayPhoto/TwitterKit.framework/Headers/TWTRCardConfiguration.h new file mode 100644 index 0000000..a19ac32 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRCardConfiguration.h @@ -0,0 +1,72 @@ +// +// TWTRCardConfiguration.h +// TwitterKit +// +// Copyright © 2015 Twitter. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Enum of the possible Twitter Card types. + */ +typedef NS_ENUM(NSUInteger, TWTRCardType){ + /** + * A Twitter App Card that includes a promotional image. + */ + TWTRCardTypePromoImageApp, + + /** + * An unknown or unsupported Twitter Card type. + */ + TWTRCardTypeUnknown +}; + +/** + * `TWTRCardConfiguration` is the representation of configurations for constructing a Twitter Card. + * + * @see https://dev.twitter.com/cards/overview + */ +@interface TWTRCardConfiguration : NSObject + +/** + * Type of Twitter Card configuration. + */ +@property (nonatomic, readonly) TWTRCardType cardType; + +/** + * Title of the Card. + */ +@property (nonatomic, readonly, copy, twtr_nullable) NSString *cardTitle; + +/** + * Description of the Card. + */ +@property (nonatomic, readonly, copy, twtr_nullable) NSString *cardDescription; + +/** + * Unique image representing the content. Size of the image cannot exceed 1MB. + * The minimum dimensions can vary depending on the Card type. See https://dev.twitter.com/cards/types + * for more detailed requirements. + */ +@property (nonatomic, readonly, twtr_nullable) UIImage *image; + +- (instancetype)init NS_UNAVAILABLE; + +/** + * Creates a new instance of configuration for a Twitter App Promo Card. + * + * @param promoImage (Required) Unique image of the user generated content to be promoted. + * @param iPhoneAppID (Optional) String representation of your app ID in the App Store (.i.e. "307234931"). Either the `iPhoneAppID` or `iPadAppID` has to be provided. + * @param iPadAppID (Optional) String representation of your app ID in the App Store (.i.e. "307234931"). Either the `iPhoneAppID` or `iPadAppID` has to be provided. + * @param googlePlayAppID (Optional) String representation of your app ID in Google Play (.i.e. "com.android.app") + * + * @return A new instance of `TWTRCardConfiguration` for a Twitter App Card. + */ ++ (TWTRCardConfiguration *)appCardConfigurationWithPromoImage:(UIImage *)promoImage iPhoneAppID:(twtr_nullable NSString *)iPhoneAppID iPadAppID:(twtr_nullable NSString *)iPadAppID googlePlayAppID:(twtr_nullable NSString *)googlePlayAppID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRCollectionTimelineDataSource.h b/dayPhoto/TwitterKit.framework/Headers/TWTRCollectionTimelineDataSource.h new file mode 100644 index 0000000..b7e5f8b --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRCollectionTimelineDataSource.h @@ -0,0 +1,52 @@ +// +// TWTRCollectionTimelineDataSource.h +// TwitterKit +// +// Created by Steven Hepting on 2/10/15. +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import +#import "TWTRTimelineDataSource.h" + +@class TWTRAPIClient; + +NS_ASSUME_NONNULL_BEGIN + +@interface TWTRCollectionTimelineDataSource : NSObject + +/** + * The number of Tweets to request in each query to the Twitter Timeline API when fetching the next batch of Tweets. + */ +@property (nonatomic, assign, readonly) NSInteger maxTweetsPerRequest; + +/** + * ID of the collection. + */ +@property (nonatomic, copy, readonly) NSString *collectionID; + +/** + * Convenience initializer. + * + * @param collectionID (required) The ID of this collection. For example, the ID of this collection: https://twitter.com/TwitterMusic/timelines/393773266801659904 is @"393773266801659904" + * + * @return An instance of TWTRCollectionTimelineDataSource or nil if any of the required parameters is missing. + */ +- (instancetype)initWithCollectionID:(NSString *)collectionID APIClient:(TWTRAPIClient *)client; + +/** + * Designated initializer setting all supported values for Collection Timeline Data Source. + * + * @param collectionID (required) The Collection ID value. e.g. @"393773266801659904" + * @param apiClient (required) The API client to use for all network requests. + * @param maxTweetsPerRequest (optional) Number of Tweets to request per batch. A value of 0 uses the server default. + * + * @return An instance of TWTRCollectionTimelineDataSource or nil if any of the required parameters are missing. + */ +- (instancetype)initWithCollectionID:(NSString *)collectionID APIClient:(TWTRAPIClient *)client maxTweetsPerRequest:(NSUInteger)maxTweetsPerRequest NS_DESIGNATED_INITIALIZER; + +- (instancetype)init __unavailable; + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRComposer.h b/dayPhoto/TwitterKit.framework/Headers/TWTRComposer.h new file mode 100644 index 0000000..f80ff55 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRComposer.h @@ -0,0 +1,86 @@ +// +// TWTRComposer.h +// TwitterKit +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Possible values for the result parameter of the completionHandler property. + */ +typedef NS_ENUM(NSInteger, TWTRComposerResult) { + /** + * The composer is dismissed without sending the Tweet (i.e. the user selects Cancel, or the account is unavailable). + */ + TWTRComposerResultCancelled, + + /** + * The composer is dismissed and the message is being sent in the background, after the user selects Done. + */ + TWTRComposerResultDone +}; + +/** + * Completion block called when the user finishes composing a Tweet. + */ +typedef void (^TWTRComposerCompletion)(TWTRComposerResult result); + +/** + * The TWTRComposer class presents a view to the user to compose a Tweet. + */ +@interface TWTRComposer : NSObject + +/** + * Sets the initial text for the Tweet composition prior to showing it. + * + * @param text The text to tweet. + * + * @return This will return NO if the receiver has already been presented (and therefore cannot be changed). + */ +- (BOOL)setText:(twtr_nullable NSString *)text; + +/** + * Sets an image attachment. + * + * @param image The image to attach. + * + * @return This will return NO if the receiver has already been presented (and therefore cannot be changed). + */ +- (BOOL)setImage:(twtr_nullable UIImage *)image; + +/** + * Adds a URL to the contents of the Tweet message. + * + * @param url The URL. + * + * @return This will return NO if the receiver has already been presented (and therefore cannot be changed). + */ +- (BOOL)setURL:(twtr_nullable NSURL *)url; + +/** + * Presents the composer, with an optional completion handler from the specified view controller. + * @param fromController The controller in which to present the composer from. + * @param completion completion The completion handler, which has a single parameter indicating whether the user finished or cancelled the Tweet composition. + */ +- (void)showFromViewController:(UIViewController *)fromController completion:(TWTRComposerCompletion)completion; + +@end + +@interface TWTRComposer (TWTRDeprecated) + +/** + * Presents the composer, with an optional completion handler. + * + * @param completion The completion handler, which has a single parameter indicating whether the user finished or cancelled the Tweet composition. + * + * @warning This method is deprecated. Use `-showFromViewController:completion:` instead. + */ +- (void)showWithCompletion:(TWTRComposerCompletion)completion; + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRComposerTheme.h b/dayPhoto/TwitterKit.framework/Headers/TWTRComposerTheme.h new file mode 100644 index 0000000..c4d52fd --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRComposerTheme.h @@ -0,0 +1,22 @@ +// +// TWTRComposerTheme.h +// TwitterKit +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import + +typedef NS_ENUM(NSInteger, TWTRComposerThemeType) { + TWTRComposerThemeTypeLight, + TWTRComposerThemeTypeDark, +}; + +@interface TWTRComposerTheme : NSObject + +/** + * Returns an instance of the theme object with the given type. + */ +- (instancetype)initWithThemeType:(TWTRComposerThemeType)type NS_DESIGNATED_INITIALIZER; + +@end diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRComposerViewController.h b/dayPhoto/TwitterKit.framework/Headers/TWTRComposerViewController.h new file mode 100644 index 0000000..59fc6cf --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRComposerViewController.h @@ -0,0 +1,69 @@ +// +// TWTRComposerViewController.h +// TwitterKit +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import +@class TWTRCardConfiguration; +@class TWTRComposerTheme; +@class TWTRTweet; +@protocol TWTRComposerViewControllerDelegate; + +NS_ASSUME_NONNULL_BEGIN + +@interface TWTRComposerViewController : UIViewController + +@property (nonatomic, weak, twtr_nullable) id delegate; + +/** + * A theme to use for the composer. If nil will default to the light theme. + */ +@property (nonatomic, twtr_null_resettable) TWTRComposerTheme *theme; + +/** + * Use initWithUserID: instead. + */ +- (instancetype)init NS_UNAVAILABLE; + +/** + * Returns a fully initialized version of the composer. + * + * @param userID The ID of the user that is tweeting + */ +- (instancetype)initWithUserID:(NSString *)userID; + +/** + * Returns a fully initialized version of the composer which will tweet with a card. + * + * @param userID The ID of the user that is tweeting the card + * @param cardConfig The card configuration that will be associated with this Tweet + */ +- (instancetype)initWithUserID:(NSString *)userID cardConfiguration:(twtr_nullable TWTRCardConfiguration *)cardConfig; + +@end + +@protocol TWTRComposerViewControllerDelegate + +@optional +/** + * Called when the user taps the cancel button. This method will be called after the view controller is dismissed. + */ +- (void)composerDidCancel:(TWTRComposerViewController *)controller; + +/** + * Called when the user successfully sends a Tweet. The resulting Tweet object is returned. + * This method is called after the view controller is dimsissed. + */ +- (void)composerDidSucceed:(TWTRComposerViewController *)controller withTweet:(TWTRTweet *)tweet; + +/** + * This method is called if the composer is not able to send the Tweet. + * The view controller will not be dismissed automatically if this method is called. + */ +- (void)composerDidFail:(TWTRComposerViewController *)controller withError:(NSError *)error; + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRListTimelineDataSource.h b/dayPhoto/TwitterKit.framework/Headers/TWTRListTimelineDataSource.h new file mode 100644 index 0000000..fb87808 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRListTimelineDataSource.h @@ -0,0 +1,88 @@ +// +// TWTRListTimelineDataSource.h +// TwitterKit +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import +#import "TWTRTimelineDataSource.h" + +@class TWTRAPIClient; + +NS_ASSUME_NONNULL_BEGIN + +/** + * Data source representing a list of Tweets. These Tweets are ordered chronologically with the most recent first. + * + * @see https://dev.twitter.com/rest/reference/get/lists/statuses + */ +@interface TWTRListTimelineDataSource : NSObject + +/** + * The ID of the list to show Tweets for. Either the `listID` or the `listSlug` and `listOwnerScreenName` are required. + */ +@property (nonatomic, copy, readonly) NSString *listID; + +/** + * The slug of the list to show Tweets for. Either the `listID` or the `listSlug` and `listOwnerScreenName` are required. + */ +@property (nonatomic, copy, readonly) NSString *listSlug; + +/** + * Screen name of the owner of the list as specified by the `listSlug`. Either the `listID` or the `listSlug` and `listOwnerScreenName` are required. + */ +@property (nonatomic, copy, readonly) NSString *listOwnerScreenName; + +/** + * The number of Tweets to request in each query to the Twitter Timeline API when fetching the next batch of Tweets. Will request 30 Tweets by default. Setting this value to 0 will use the server default. + */ +@property (nonatomic, assign, readonly) NSUInteger maxTweetsPerRequest; + +/** + * Whether to request retweets in the set of Tweets from the server. + * + * Defaults to YES. + */ +@property (nonatomic, assign, readonly) BOOL includeRetweets; + +/** + * Convenience initializer. Uses default values for `maxTweetsPerRequest` and `includeRetweets`. + * + * @param listID (required) The ID of the list. + * @param client (required) The API client to use for making network requests. + * + * @return A full initialized list timeline datasource. + */ +- (instancetype)initWithListID:(NSString *)listID APIClient:(TWTRAPIClient *)client; + +/** + * Convenience initializer. Uses default values for `maxTweetsPerRequest` and `includeRetweets`. + * + * @param listSlug (required) The slug of the list. + * @param listOwnerScreenName (required) The list owner's screen name. + * @param client (required) The API client to use for making network requests. + * + * @return A full initialized list timeline datasource. + */ +- (instancetype)initWithListSlug:(NSString *)listSlug listOwnerScreenName:(NSString *)listOwnerScreenName APIClient:(TWTRAPIClient *)client; + +/** + * Designated initializer for creating list timeline data sources taking all parameters. + * + * @param listID (optional) The ID of the list. Provide either the `listID` or `listSlug` and `listOwnerScreenName`. + * @param listSlug (optional) The slug of the list. Provide either the `listID` or `listSlug` and `listOwnerScreenName`. + * @param listOwnerScreenName (optional) The list owner's screen name. Provide either the `listID` or `listSlug` and `listOwnerScreenName`. + * @param client (required) The API client to use for making networking requests + * @param maxTweetsPerRequest (optional) The number of Tweets per batch to request. A value of 0 will use the server default. + * @param includeRetweets (optional) Whether retweets should be requested. + * + * @return A fully initialized list timeline datasource. + */ +- (instancetype)initWithListID:(NSString * __twtr_nullable)listID listSlug:(NSString * __twtr_nullable)listSlug listOwnerScreenName:(NSString * __twtr_nullable)listOwnerScreenName APIClient:(TWTRAPIClient *)client maxTweetsPerRequest:(NSUInteger)maxTweetsPerRequest includeRetweets:(BOOL)includeRetweets NS_DESIGNATED_INITIALIZER; + +- (instancetype)init __unavailable; + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRLogInButton.h b/dayPhoto/TwitterKit.framework/Headers/TWTRLogInButton.h new file mode 100644 index 0000000..379ddf2 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRLogInButton.h @@ -0,0 +1,34 @@ +// +// TWTRLogInButton.h +// TwitterKit +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import +#import + +/** + * A Button which launches the sign in to Twitter flow when tapped. + */ +@interface TWTRLogInButton : UIButton + +/** + * The completion block to be called with a `TWTRSession` if successful, + * and a `NSError` if logging in failed or was canceled. + */ +@property (nonatomic, copy) TWTRLogInCompletion logInCompletion; + +/** + * Returns a new log in button which launches Twitter log in when tapped and + * calls `completion` when logging in succeeds or fails. + * + * Internally, this button simply calls `-[Twitter logInWithCompletion:]`. + * + * @param completion The completion to be called with a `TWTRSession` if successful, + * and a `NSError` if logging in failed or was canceled. + * @return An initialized `TWTRLogInButton`. + */ ++ (instancetype)buttonWithLogInCompletion:(TWTRLogInCompletion)completion; + +@end diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTROAuthSigning.h b/dayPhoto/TwitterKit.framework/Headers/TWTROAuthSigning.h new file mode 100644 index 0000000..31454ef --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTROAuthSigning.h @@ -0,0 +1,41 @@ +// +// TWTROAuthSigning.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import + +@class TWTRAuthConfig; +@class TWTRSession; + +/** + * This class provides tools to generate OAuth signatures. + */ +@interface TWTROAuthSigning : NSObject + +/** + * @name Initialization + */ + +/** + * Instantiate a `TWTROAuthSigning` object with the parameters it needs to generate the OAuth signatures. + * + * @param authConfig (required) Encapsulates credentials required to authenticate a Twitter application. + * @param authSession (required) Encapsulated credentials associated with a user session. + * + * @return An initialized `TWTROAuthSigning` object or nil if any of the parameters are missing. + * + * @note If you want to generate OAuth Echo headers to verify Digits' credentials, see `DGTOAuthSigning`. + * + * @see TWTRAuthConfig + * @see TWTRSession + */ +- (instancetype)initWithAuthConfig:(TWTRAuthConfig *)authConfig authSession:(TWTRSession *)authSession NS_DESIGNATED_INITIALIZER; + +/** + * Unavailable. Use `-initWithAuthConfig:authSession:` instead. + */ +- (instancetype)init __attribute__((unavailable("Use -initWithAuthConfig:authSession: instead."))); + +@end diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRSearchTimelineDataSource.h b/dayPhoto/TwitterKit.framework/Headers/TWTRSearchTimelineDataSource.h new file mode 100644 index 0000000..6eece1c --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRSearchTimelineDataSource.h @@ -0,0 +1,85 @@ +// +// TWTRSearchTimelineDataSource.h +// TwitterKit +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import +#import "TWTRTimelineDataSource.h" + +@class TWTRAPIClient; + +NS_ASSUME_NONNULL_BEGIN + +/** +Data source representing a Search Timeline. Provides TWTRTweet objects to a TWTRTimelineViewController in pages determined by the TWTRTimelineCursor object passed in to the `loadNext:` and `loadPrevious:` methods. + +## Search Queries: + + * `watching now` containing both “watching” and “now”. Default. + * `“happy hour”` containing the exact phrase “happy hour”. + * `love OR hate` containing either “love” or “hate” (or both). + * `beer -root` containing “beer” but not “root”. + * `#haiku` containing the hashtag “haiku”. + * `from:alexiskold`sent from person “alexiskold”. + * `to:techcrunch` sent to person “techcrunch”. + * `@mashable` referencing person “mashable”. + * `flight :(` containing “flight” and with a negative attitude. + * `traffic ?` containing “traffic” and asking a question. + * `movie -scary :)`containing “movie”, but not “scary”, and with a positive attitude. + * `hilarious filter:links` containing “hilarious” and linking to URL. + * `news source:twitterfeed`containing “news” and entered via TwitterFeed + * `superhero since:2010-12-27` containing “superhero” and sent since date “2010-12-27” (year-month-day). + * `ftw until:2010-12-27` containing “ftw” and sent before the date “2010-12-27”. + + @see https://dev.twitter.com/rest/public/search + Not implemented: `geocode`, `result_type` + */ +@interface TWTRSearchTimelineDataSource : NSObject + +/** + * The search query. This matches what you would type into https://twitter.com/search + */ +@property (nonatomic, copy, readonly) NSString *searchQuery; + +/** + * Restricts tweets returned to a given language, specified by its ISO 639-1 code (for example: en, es). Language detection is best-effort. The server defaults to returning Tweets in all languages. + * + * @see http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes + */ +@property (nonatomic, copy, readonly, twtr_nullable) NSString *languageCode; + +/** + * The number of Tweets to request in each network request for more Tweets. By default requests 30 tweets. If set to `0` the parameter will not be set on the request and the Twitter API will use the default size for the endpoint. + */ +@property (nonatomic, assign, readonly) NSUInteger maxTweetsPerRequest; + +/** + * Convenience initializer. Uses default values for `languageCode` and `maxTweetsPerRequest`. + * + * @param searchQuery (required) The query string that you would type into https://twitter.com/search + * @param client (required) An instance of `TWTRAPIClient` with which API calls will be made. + * + * @return A fully initialized search timeline datasource or `nil` if any of the required parameters are missing. + */ + +- (instancetype)initWithSearchQuery:(NSString *)searchQuery APIClient:(TWTRAPIClient *)client; + +/** + * Designated initializer for creating search timeline data sources taking all parameters. + * + * @param searchQuery (required) The query string that you would type into https://twitter.com/search + * @param client (required) An instance of `TWTRAPIClient` with which API calls will be made. + * @param languageCode (optional) The ISO 639-1 language code to restrict Tweets to. A `nil` value will not add the parameter to the server request and so use the server default. + * @param maxTweetsPerRequest (optional) The number of tweets to request in each query to the Twitter API. A value of 0 will not add to the parameters and thus use the server default. + * + * @return A fully initialized search timeline datasource or `nil` if any of the required parameters are missing. + */ +- (instancetype)initWithSearchQuery:(NSString *)searchQuery APIClient:(TWTRAPIClient *)client languageCode:(twtr_nullable NSString *)languageCode maxTweetsPerRequest:(NSUInteger)maxTweetsPerRequest NS_DESIGNATED_INITIALIZER; + +- (instancetype)init __unavailable; + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRShareEmailViewController.h b/dayPhoto/TwitterKit.framework/Headers/TWTRShareEmailViewController.h new file mode 100644 index 0000000..a7cf570 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRShareEmailViewController.h @@ -0,0 +1,49 @@ +// +// TWTRShareEmailViewController.h +// TwitterKit +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * A completion block to be called when the user accepts or denies access to their email address. + * + * @param email The user's email address. This will be nil if the user does not grant access to their email address or your application is not allowed to request email addresses. + * @param error An error that details why a user's email address could not be provided. + */ +typedef void (^TWTRShareEmailCompletion)(NSString * __twtr_nullable email, NSError * __twtr_nullable error); + +/** + * The `TWTRShareEmailViewController` class presents a view to the user to request their email address. This is a subclass of `UINavigationController` and must be presented modally. + * + * @note Using `TWTRShareEmailViewController` requires your application to be whitelisted by Twitter. To request access, please visit https://support.twitter.com/forms/platform. + */ +@interface TWTRShareEmailViewController : UINavigationController + +/** + * Completion block called when the user accepts or denies access to their email address. + */ +@property (nonatomic, copy) TWTRShareEmailCompletion completion; + +/** + * Initializer for `TWTRShareEmailViewController`. + * + * @param completion The completion block called when the user either accepts or denies access to their email address. Called on the main thread. + */ +- (instancetype)initWithCompletion:(twtr_nullable TWTRShareEmailCompletion)completion; + +/** + * Initializer for `TWTRShareEmailViewController`. + * + * @param userID the ID of the user you are requesting the email on behalf of, if nil the last signed in account will be used. + * @param completion The completion block called when the user either accepts or denies access to their email address. Called on the main thread. + */ +- (instancetype)initWithUserID:(twtr_nullable NSString *)userID completion:(twtr_nullable TWTRShareEmailCompletion)completion; + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRTimelineDataSource.h b/dayPhoto/TwitterKit.framework/Headers/TWTRTimelineDataSource.h new file mode 100644 index 0000000..8aee910 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRTimelineDataSource.h @@ -0,0 +1,48 @@ +// +// TWTRTimelineDataSource.h +// TwitterKit +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import "TWTRTimelineType.h" +@class TWTRAPIClient; +@class TWTRTimelineCursor; + +NS_ASSUME_NONNULL_BEGIN + +typedef void (^TWTRLoadTimelineCompletion)(NSArray * __twtr_nullable tweets, TWTRTimelineCursor * __twtr_nullable cursor, NSError * __twtr_nullable error); + +/** + * Responsible for building network parameters for requesting a timeline of Tweets. + * + * Implementations of this protocol don't need to be thread-safe. All the methods will be invoked on the main thread. + */ +@protocol TWTRTimelineDataSource + +/** + * Load Tweets before a given position. For time-based timelines this generally + * corresponds to Tweets older than a position. + * + * @param position (optional) The position or Tweet ID before the page + * of Tweets to be loaded. + * @param completion (required) Invoked with the Tweets and the cursor in case of success, or nil + * and an error in case of error. This must be called on the main thread. + */ +- (void)loadPreviousTweetsBeforePosition:(NSString * __twtr_nullable)position completion:(TWTRLoadTimelineCompletion)completion; + +/* + * The type of the timeline that this data source represents. + */ +@property (nonatomic, readonly) TWTRTimelineType timelineType; + +/** + * The API client to use with this data source. + * You will, likely, not need to alter this value unless you are implementing your + * own timeline view controller. + */ +@property (nonatomic) TWTRAPIClient *APIClient; + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRTimelineType.h b/dayPhoto/TwitterKit.framework/Headers/TWTRTimelineType.h new file mode 100644 index 0000000..a1bafb1 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRTimelineType.h @@ -0,0 +1,29 @@ +// +// TWTRTimelineType.h +// TwitterKit +// +// Created by Steven Hepting on 3/30/15. +// Copyright (c) 2015 Twitter. All rights reserved. +// + +/* + * Type of timelines that may be loaded and shown to the user. + */ +typedef NS_ENUM(NSUInteger, TWTRTimelineType) { + /* + * User Timeline + */ + TWTRTimelineTypeUser = 1, + /* + * Search Timeline + */ + TWTRTimelineTypeSearch, + /** + * Collection Timeline + */ + TWTRTimelineTypeCollection, + /** + * List Timeline + */ + TWTRTimelineTypeList, +}; diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRTimelineViewController.h b/dayPhoto/TwitterKit.framework/Headers/TWTRTimelineViewController.h new file mode 100644 index 0000000..9e55ad9 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRTimelineViewController.h @@ -0,0 +1,63 @@ +// +// TWTRTimelineViewController.h +// TwitterKit +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import +#import "TWTRTimelineDataSource.h" + +/** + This class is a `UITableViewController` subclass that displays `TWTRTweetTableViewCell` cells. It handles cell-reuse, cell-configuration, and loading more tweets from the given timeline once the last cell is reached. + + ## Usage + + Initialize this class with any object that conforms to the `TWTRTimelineDataSource` protocol. We provide two such classes, `TWTRUserTimelineDataSource` and `TWTRSearchTimelineDataSource`. These provide `TWTRTweet` objects to this table view which then configures the instances of `TWTRTweetTableViewCell`. + + // Create the data source + TWTRAPIClient *client = [Twitter sharedInstance].APIClient; + TWTRUserTimelineDataSource *dataSource = [[TWTRUserTimelineDataSource alloc] initWithScreenName:@"jack" APIClient:client]; + + // Create the timeline view controller + TWTRTimelineViewController *timeline = [[TWTRTimelineViewController alloc] initWithDataSource:dataSource]; + + ## Loading More + + This class loads the first batch of `TWTRTweet` objects from the Twitter API when `viewWillAppear:` is received. It also handles loading more tweets automatically once the last cell has been shown. + + */ +@interface TWTRTimelineViewController : UITableViewController + +/** + Initializes a timeline view controller. Does not start loading tweets until + `viewWillAppear:` is called. + + This method must be used to initialize this class. The `init` method is unavailable. + + @param dataSource Required. A timeline data source object that conforms to the `TWTRTimelineDataSource` protocol. + + @return A fully initialized `TWTRTimelineViewController` or nil if the data source is missing. + */ +- (instancetype)initWithDataSource:(id)dataSource; + +/** + The source of `TWTRTweet` objects for this `TWTRTimelineViewController`. + + May be set to update the Tweets being shown by this table view. Must be set on the main thread. + */ +@property (nonatomic, strong) id dataSource; + +/** + * Whether action buttons (favorite, share) should be shown on the TWTRTweetTableViewCells inside the tableview. + */ +@property (nonatomic, assign) BOOL showTweetActions; + +- (instancetype)initWithStyle:(UITableViewStyle)style __attribute__((unavailable("Use -initWithDataSource: instead"))); + +/** + * Asynchronously refresh and replace all the data in the table view with the latest `TWTRTweets`. + */ +- (void)refresh; + +@end diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRTweet.h b/dayPhoto/TwitterKit.framework/Headers/TWTRTweet.h new file mode 100644 index 0000000..33833ba --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRTweet.h @@ -0,0 +1,150 @@ +// +// TWTRTweet.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import + +@class TWTRTweet; +@class TWTRUser; + +/** + * `TWTRTweet` is an immutable representation of a Tweet. + */ +@interface TWTRTweet : NSObject + +# pragma mark - Properties + +/** + * The ID of the Twitter Tweet. + * @warning This represents the id_str field, which could differ from the value of the id field. + */ +@property (nonatomic, copy, readonly) NSString *tweetID; + +/** + * The date when this Tweet was created. + */ +@property (nonatomic, copy, readonly) NSDate *createdAt; + +/** + * The text of the Tweet. + */ +@property (nonatomic, copy, readonly) NSString *text; + +/** + * The Author of the Tweet. + */ +@property (nonatomic, strong, readonly) TWTRUser *author; + +/** + * The number of times this Tweet was favorited. + */ +@property (nonatomic, assign, readonly) long long favoriteCount __attribute__((deprecated("Use `likeCount`."))); + +/** + * The number of times this Tweet was liked. + */ +@property (nonatomic, assign, readonly) long long likeCount; + +/** + * The number of times this Tweet was retweeted. + */ +@property (nonatomic, assign, readonly) long long retweetCount; + +/** + * The Tweet this Tweet was a reply to. + */ +@property (nonatomic, copy, readonly) NSString *inReplyToTweetID; + +/** + * The User ID this Tweet was a reply to. + */ +@property (nonatomic, copy, readonly) NSString *inReplyToUserID; + +/** + * The screen name of the user this Tweet was a reply to. + * @note This doesn't contain the `@` sign before the screen name. + */ +@property (nonatomic, copy, readonly) NSString *inReplyToScreenName; + +/** + * The permalink URL for this Tweet. + * + * Suitable for loading in a `UIWebView`, `WKWebView` or passing to Safari: + * + * `[[UIApplication sharedApplication] openURL:tweet.permalink];` + */ +@property (nonatomic, copy, readonly) NSURL *permalink; + +/** + * Whether this Tweet was favorited by the authenticated user. + * + * @warning The value of this property depends on the authenticated user. + */ +@property (nonatomic, assign, readonly) BOOL isFavorited __attribute__((deprecated("Use `isLiked`."))); + +/** + * Whether this Tweet was liked by the authenticated user. + * + * @warning The value of this property depends on the authenticated user. + */ +@property (nonatomic, assign, readonly) BOOL isLiked; + +/** + * Whether this Tweet was retweeted by the authenticated user. + * + * @warning The value of this property depends on the authenticated user. + */ +@property (nonatomic, assign, readonly) BOOL isRetweeted; + +/** + * The Tweet ID of the authenticated user's retweet of this Tweet. This will be `nil` if there is no + * authenticated user or the user has not retweeted this Tweet. + * + * @warning The value of this property depends on the authenticated user. + */ +@property (nonatomic, copy, readonly) NSString *retweetID; + +/** + * The original, fully-hydrated Tweet that was retweeted. This corresponds to the `retweeted_status` API field. + * This is `nil` unless `self.isRetweet == YES`. + */ +@property (nonatomic, strong, readonly) TWTRTweet *retweetedTweet; + +/** + * Indicates whether this Tweet is a retweet of another Tweet. + */ +@property (nonatomic, assign, readonly) BOOL isRetweet; + +# pragma mark - Init + +/** + * Creates a TWTRTweet instance from the dictionary of Twitter API JSON response. + * + * @param dictionary A parsed dictionary of a single Twitter Tweet API JSON response. + * @return TWTRTweet instance. + */ +- (instancetype)initWithJSONDictionary:(NSDictionary *)dictionary; + +/** + * Creates an array of TWTRTweet instances from the array of Twitter API JSON response. + * + * @param array A parsed array of Tweet API JSON responses. + * @return An array of TWTRTweet instances. + */ ++ (NSArray *)tweetsWithJSONArray:(NSArray *)array; + +/** + * Creates a new Tweet instance with a new value for the `isFavorited` boolean + * value which is the opposite of the current value. + */ +- (TWTRTweet *)tweetWithFavoriteToggled __attribute__((deprecated("Use `tweetWithLikeToggled`."))); + +/** + * Creates a new Tweet instance with a new value for the `isLiked` boolean + * value which is the opposite of the current value. + */ +- (TWTRTweet *)tweetWithLikeToggled; + +@end diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRTweetTableViewCell.h b/dayPhoto/TwitterKit.framework/Headers/TWTRTweetTableViewCell.h new file mode 100644 index 0000000..478e713 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRTweetTableViewCell.h @@ -0,0 +1,80 @@ +// +// TWTRTweetTableViewCell.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import + +@class TWTRTweet; +@class TWTRTweetView; + +/** + * A table view cell subclass which displays a Tweet. + */ +@interface TWTRTweetTableViewCell : UITableViewCell + +/** + * The Tweet view inside this cell. Holds all relevant text and images. + */ +@property (nonatomic, strong, readonly) TWTRTweetView *tweetView; + +/** + * Configures the existing Tweet view with a Tweet. Updates labels, images, and thumbnails. + * + * @param tweet The `TWTRTweet` model object for the Tweet to display. + */ +- (void)configureWithTweet:(TWTRTweet *)tweet; + +/** + * Returns the height calculated using a given width. Usable from a background thread. This is the preferred approach to calculating height for tableview cells. + + - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + TWTRTweet *tweet = self.tweets[indexPath.row]; + + // Grab the height for this cell + CGFloat height = [TWTRTweetTableViewCell heightForTweet:tweet width:CGRectGetWidth(self.view.bounds)]; + return height; + } + + * @param width The table view cell width. + */ ++ (CGFloat)heightForTweet:(TWTRTweet *)tweet width:(CGFloat)width showingActions:(BOOL)actionsAreVisible; + +/** + * Calculates the height for this Tweet assuming that actions are being shown (the default). + * + * @param tweet The Tweet object desiring to be shown. + * @param width The width of the tableview. + * + * @return The calculated height for this Tweet. + * + * @note If this method is returning the incorrect height and .showActionButtons + * has been set to NO on your TWTRTweetView you will need to use + * heightForTweet:width:showingActions: instead. + */ ++ (CGFloat)heightForTweet:(TWTRTweet *)tweet width:(CGFloat)width; + +#pragma mark - Deprecated Methods + +/** + DEPRECATED + + Returns the height calculated using a given width. Generally just for use with prototype + cells. Calls `sizeThatFits:` internally to find height (which can be slow). + + - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + TWTRTweet *tweet = self.tweets[indexPath.row]; + + // Grab the height for this cell + CGFloat height = [TWTRTweetTableViewCell heightForTweet:tweet width:CGRectGetWidth(self.view.bounds)]; + return height; + } + + @deprecated Use +heightForTweet:width:showingActions: instead. Deprecated in version 1.3.0 + + @param width The table view cell width. + */ +- (CGFloat)calculatedHeightForWidth:(CGFloat)width __attribute__((deprecated("Use +heightForTweet:width: instead."))); + +@end diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRTweetView.h b/dayPhoto/TwitterKit.framework/Headers/TWTRTweetView.h new file mode 100644 index 0000000..7af4b35 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRTweetView.h @@ -0,0 +1,192 @@ +// +// TWTRTweetView.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import +#import "TWTRTweetViewDelegate.h" + +@class TWTRTweet; + +/** + * The style for Tweet views. + */ +typedef NS_ENUM(NSUInteger, TWTRTweetViewStyle) { + /** + * A full-size Tweet view. Displays images if present. + */ + TWTRTweetViewStyleRegular, + /** + * A small Tweet view, primarily designed to be used in table views. + */ + TWTRTweetViewStyleCompact +}; + +/** + * A default combination of colors for Tweet views. + */ +typedef NS_ENUM(NSUInteger, TWTRTweetViewTheme) { + /** + * Official light theme. + */ + TWTRTweetViewThemeLight, + /** + * Official dark theme. + */ + TWTRTweetViewThemeDark, +}; + +/** + `TWTRTweetView` displays a single Tweet to the user. It handles background taps and other actions displayed to the user. + + [[[Twitter sharedInstance] APIClient] loadTweetWithID:@"20" completion:^(TWTRTweet *tweet, NSError *error) { + if (tweet) { + TWTRTweetView *tweetView = [[TWTRTweetView alloc] initWithTweet:tweet]; + [self.view addSubview:tweetView]; + } else { + NSLog(@"Error loading Tweet: %@", [error localizedDescription]); + } + }]; + + ## Interaction + + The `TWTRTweetViewDelegate` is notified: + + - When the background is tapped. + - When a link is selected. + - When the share button is tapped. + - When the share action completes. + - When the favorite action completes. + + ## Usage in UITableView + + To allow for usage in a `UITableView`, the `configureWithTweet:` method allows configuration of an existing `TWTRTweetView` without having to create a new instance. + + ## Sizing + + When using Auto Layout, feel free to set a width or margin on the Tweet view. The height will be calculated automatically. For old-fashioned frame based layout you may use the standard `sizeThatFits:` method to calculate the appropriate height for a given width: + + // Find the height for a given width (20pts on either side) + CGFloat desiredHeight = [tweetView sizeThatFits:CGSizeMake(self.view.frame.size.width - 40, CGFLOAT_MAX)].height; + + ## UIAppearance + + You may use UIAppearance proxy objects to style certain aspects of Tweet views before those views are added to the view hierarchy. + + // Using UIAppearance Proxy + [TWTRTweetView appearance].theme = TWTRTweetViewThemeDark; + + // Setting colors directly + [TWTRTweetView appearance].primaryTextColor = [UIColor yellowColor]; + [TWTRTweetView appearance].backgroundColor = [UIColor blueColor]; + + // Setting action button visibility + [TWTRTweetView appearance].showActionButtons = NO; + + _Note:_ You can't change the theme through an appearance proxy after the view has already been added to the view hierarchy. Direct `theme` property access will work though. + */ +@interface TWTRTweetView : UIView + +/** + * Background color of the Tweet view and all text labels (fullname, username, Tweet text, timestamp). + */ +@property (nonatomic, strong) UIColor *backgroundColor UI_APPEARANCE_SELECTOR; + +/** + * Color of Tweet text and full name. + */ +@property (nonatomic, strong) UIColor *primaryTextColor UI_APPEARANCE_SELECTOR; + +/** + * Color of links in Tweet text. + */ +@property (nonatomic, strong) UIColor *linkTextColor UI_APPEARANCE_SELECTOR; + +/** + * Set whether the border should be shown. + * Defaults to YES. + */ +@property (nonatomic, assign) BOOL showBorder UI_APPEARANCE_SELECTOR; + +/** + * Set whether the action buttons (Favorite, Share) should be shown. When toggled, + * both the visibility of the action buttons and the internal constraints are + * updated immediately. The layout will be updated the next layout pass that occurs. + * + * Defaults to NO. + */ +@property (nonatomic, assign) BOOL showActionButtons; + +/** + * Setting the theme of the Tweet view will change the color properties accordingly. + * + * Set to `TWTRTweetViewThemeLight` by default. + */ +@property (nonatomic, assign) TWTRTweetViewTheme theme UI_APPEARANCE_SELECTOR; + +/** + * The style of the Tweet. i.e. `TWTRTweetViewStyleRegular` or `TWTRTweetViewStyleCompact`. + */ +@property (nonatomic, assign, readonly) TWTRTweetViewStyle style; + +/** + * Optional delegate to receive notifications when certain actions happen + */ +@property (nonatomic, weak) IBOutlet id delegate; + +/** + * Optional property to set a UIViewController from which to present various new UI + * e.g. when presenting a Share sheet, presenting a login view controller for actions, etc + */ +@property (nonatomic, weak) UIViewController *presenterViewController; + +/** + * Convenience initializer to configure a compact style Tweet view. + * + * @param tweet The Tweet to display. + * + * @return The fully-configured Tweet view. + */ +- (instancetype)initWithTweet:(TWTRTweet *)tweet; + +/** + * Designated initializer. Initializes view with both Tweet and style. + * + * @param tweet The Tweet to display. + * @param style The style of the Tweet view (regular or compact). + * + * @return The fully configured Tweet view. + */ +- (instancetype)initWithTweet:(TWTRTweet *)tweet style:(TWTRTweetViewStyle)style; + +/** + * Initialization with a frame parameter is not supported. + */ +- (instancetype)initWithFrame:(CGRect)frame __attribute__((unavailable("Use -initWithTweet: instead"))); + +/** + Find the size that fits into a desired space. This is a system method on UIView but implemented on `TWTRTweetView` + + TWTRTweetView *tweetView = [[TWTRTweetView alloc] initWithTweet:tweet]; + + // Make it 280 points wide + CGSize desiredSize = [tweetView sizeThatFits:CGSizeMake(280, CGFLOAT_MAX)]; + tweetView.frame = CGRectMake(PADDING_X, PADDING_Y, 280, desiredSize.height); + + [self.view addSubview:tweetView]; + + @param size The space available. Should generally leave one orientation unconstrained, and the minimum width supported is 200pts. + + @return The size that will fit into the space available. + */ +- (CGSize)sizeThatFits:(CGSize)size; + +/** + * Update all images and label text to fully represent the given Tweet. + * + * @param tweet The Tweet to display. + */ +- (void)configureWithTweet:(TWTRTweet *)tweet; + +@end diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRTweetViewDelegate.h b/dayPhoto/TwitterKit.framework/Headers/TWTRTweetViewDelegate.h new file mode 100644 index 0000000..2c09b46 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRTweetViewDelegate.h @@ -0,0 +1,149 @@ +// +// TWTRTweetViewDelegate.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import + +@class TWTRSession; +@class TWTRTweetView; +@class TWTRTweet; +@class TWTRUser; +@protocol TWTRSessionStore; + +NS_ASSUME_NONNULL_BEGIN + +typedef void (^TWTRAuthenticationCompletionHandler)(id sessionStore, NSString *userID); + +/** + Delegate for `TWTRTweetView` to receive updates on the user interacting with this particular Tweet view. + + // Create the tweet view + TWTRTweetView *tweetView = [[TWTRTweetView alloc] initWithTweet:tweet]; + // Set the delegate + tweetView.delegate = self; + */ +@protocol TWTRTweetViewDelegate + +@optional + +/** + * The tweet view was tapped. Implement to show your own webview if desired using the `permalinkURL` property on the `TWTRTweet` object passed in. + * If this method is not implemented and the device is running on iOS 9+ we will deep link into the Twitter application. + * + * @param tweetView The Tweet view that was tapped. + * @param tweet The Tweet model object being shown. + */ +- (void)tweetView:(TWTRTweetView *)tweetView didSelectTweet:(TWTRTweet *)tweet; + +/** + * The tweet view image was tapped. + * + * @param tweetView The Tweet view that was tapped. + * @param image The exact UIImage data shown by the Tweet view. + * @param imageURL The full URL of the image being shown. + */ +- (void)tweetView:(TWTRTweetView *)tweetView didTapImage:(UIImage *)image withURL:(NSURL *)imageURL; + +/** + * The Tweet view video was tapped. + * If this method is not implemented a video player will be presented. + * + * @param tweetView The Tweet view that was tapped. + * @param videoURL The full URL of the video being shown. + */ +- (void)tweetView:(TWTRTweetView *)tweetView didTapVideoWithURL:(NSURL *)videoURL; + +/** + * A URL in the text of a tweet was tapped. Implement to show your own webview rather than opening Safari. + * + * @param tweetView The Tweet view that was tapped. + * @param url The URL that was tapped. + */ +- (void)tweetView:(TWTRTweetView *)tweetView didTapURL:(NSURL *)url; + +/** + * Called when the user's profile image is tapped. + * If this method is not implemented and the device is running on iOS 9+ we will deep link into the Twitter application. + * + * @param tweetView The Tweet view that was tapped. + * @param user The Twitter user. + */ +- (void)tweetView:(TWTRTweetView *)tweetView didTapProfileImageForUser:(TWTRUser *)user; + +/** + * The Tweet view "Share" button was tapped and the `UIActivityViewController` was shown. + * + * @param tweetView The Tweet view that was tapped. + * @param tweet The Tweet model object being shown. + */ +- (void)tweetView:(TWTRTweetView *)tweetView willShareTweet:(TWTRTweet *)tweet; + +/** + * The share action for a Tweet was completed. + * + * @param tweetView The Tweet view that was tapped. + * @param tweet The Tweet model object being shown. + * @param shareType The share action that was completed. (e.g. `UIActivityTypePostToFacebook`, `UIActivityTypePostToTwitter`, or `UIActivityTypeMail`) + */ +- (void)tweetView:(TWTRTweetView *)tweetView didShareTweet:(TWTRTweet *)tweet withType:(NSString *)shareType; + +/** + * The share action for a Tweet was cancelled. + * + * @param tweetView The Tweet view handling the share action. + * @param tweet The Tweet model object represented. + */ +- (void)tweetView:(TWTRTweetView *)tweetView cancelledShareTweet:(TWTRTweet *)tweet; + +/** + * The Tweet view favorite button was tapped and the action was completed with + * the Twitter API. + * + * @param tweetView The Tweet view showing this Tweet object. + * @param tweet The Tweet model that was just liked. + */ +- (void)tweetView:(TWTRTweetView *)tweetView didLikeTweet:(TWTRTweet *)tweet; + +/** + * The Tweet view unfavorite button was tapped and the action was completed with + * the Twitter API. + * + * @param tweetView The Tweet view showing this Tweet object. + * @param tweet The Tweet model object that was just unliked. + */ +- (void)tweetView:(TWTRTweetView *)tweetView didUnlikeTweet:(TWTRTweet *)tweet; + +/** + * Requests authentication from the delegate to use for a network request that requires user context. + * + * @param tweetView The Tweet view showing this Tweet object. + * @param authenticationCompletionHandler The completion block that your delegate method must call to provide the necessary + * user context e.g. user session. + */ +- (void)tweetView:(TWTRTweetView *)tweetView willRequireAuthenticationCompletionHandler:(TWTRAuthenticationCompletionHandler)authenticationCompletionHandler; + +#pragma mark - Deprecated + +/** + * The Tweet view favorite button was tapped and the action was completed with + * the Twitter API. + * + * @param tweetView The Tweet view showing this Tweet object. + * @param tweet The Tweet model that was just favorited. + */ +- (void)tweetView:(TWTRTweetView *)tweetView didFavoriteTweet:(TWTRTweet *)tweet __attribute__((deprecated("Use `tweetView:didLikeTweet:`."))); + +/** + * The Tweet view unfavorite button was tapped and the action was completed with + * the Twitter API. + * + * @param tweetView The Tweet view showing this Tweet object. + * @param tweet The Tweet model object that was just unfavorited. + */ +- (void)tweetView:(TWTRTweetView *)tweetView didUnfavoriteTweet:(TWTRTweet *)tweet __attribute__((deprecated("Use `tweetView:didUnlikeTweet:`."))); + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRUser.h b/dayPhoto/TwitterKit.framework/Headers/TWTRUser.h new file mode 100644 index 0000000..b71621e --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRUser.h @@ -0,0 +1,90 @@ +// +// TWTRUser.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import + +/** + * Represents a user on Twitter. + */ +@interface TWTRUser : NSObject + +# pragma mark - Properties + +/** + * The ID of the Twitter User. + */ +@property (nonatomic, copy, readonly) NSString *userID; + +/** + * The user's name as it appears on their profile. + * + * @warning This can be modified by the user at any time. + */ +@property (nonatomic, copy, readonly) NSString *name; + +/** + * The user's username on Twitter. + * + * @warning This can be modified by the user at any time. + */ +@property (nonatomic, copy, readonly) NSString *screenName; + +/** + * Whether the user has been verified by Twitter. + */ +@property (nonatomic, assign, readonly) BOOL isVerified; + +/** + * Whether the user is protected. + */ +@property (nonatomic, assign, readonly) BOOL isProtected; + +/** + * The HTTPS URL of the user's profile image. + */ +@property (nonatomic, copy, readonly) NSString *profileImageURL; + +/** + * The URL of a smaller version of the user's profile image. + */ +@property (nonatomic, copy, readonly) NSString *profileImageMiniURL; + +/** + * The URL of a larger version of the user's profile image. + */ +@property (nonatomic, copy, readonly) NSString *profileImageLargeURL; + +/** + * The formatted version of the user's `screenName` with the `@` sign for display purposes. + */ +@property (nonatomic, copy, readonly) NSString *formattedScreenName; + +/** + * Returns the URL for deeplinking to the the user's profile. + */ +@property (nonatomic, copy, readonly) NSURL *profileURL; + +# pragma mark - Init + +/** + * Creates a Twitter user object from the dictionary of Twitter API JSON response. + * + * @param dictionary A parsed dictionary of a single Twitter Tweet API JSON response. + * + * @return An initialized TWTRUser instance. + */ +- (instancetype)initWithJSONDictionary:(NSDictionary *)dictionary; + +/** + * Creates an array of Twitter User instances from the array of Twitter API JSON response. + * + * @param array A parsed array of Twitter User API JSON responses. + * + * @return An array of initialized TWTRTweet instances. + */ ++ (NSArray *)usersWithJSONArray:(NSArray *)array; + +@end diff --git a/dayPhoto/TwitterKit.framework/Headers/TWTRUserTimelineDataSource.h b/dayPhoto/TwitterKit.framework/Headers/TWTRUserTimelineDataSource.h new file mode 100644 index 0000000..1d58036 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TWTRUserTimelineDataSource.h @@ -0,0 +1,79 @@ +// +// TWTRUserTimelineDataSource.h +// TwitterKit +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import +#import "TWTRTimelineDataSource.h" + +@class TWTRAPIClient; + +NS_ASSUME_NONNULL_BEGIN + +/** + * This Timeline Data Source provides a list of Tweets roughly consistent with the list on a Users profile page. The difference is that this data source will filter out Tweets that are direct replies to other users by default. + * + * These Tweets are ordered chronologically with the most recent first. + */ +@interface TWTRUserTimelineDataSource : NSObject + +/** + * The screen name of the User whose Tweets are being shown. Either the `screenName` or the `userID` are required. + */ +@property (nonatomic, copy, readonly) NSString *screenName; + +/** + * The userID of the User whose Tweets are being shown. Either the `screenName` or the `userID` are required. + */ +@property (nonatomic, copy, readonly) NSString *userID; + +/** + * The number of Tweets to request in each query to the Twitter Timeline API when fetching the next batch of Tweets. Will request 30 Tweets by default. Setting this value to 0 will use the server default. + */ +@property (nonatomic, assign, readonly) NSUInteger maxTweetsPerRequest; + +/** + * Whether to request replies in the set of Tweets from the server. + * + * Defaults to NO. + */ +@property (nonatomic, assign, readonly) BOOL includeReplies; + +/** + * Whether to request retweets in the set of Tweets from the server. + * + * Defaults to YES. + */ +@property (nonatomic, assign, readonly) BOOL includeRetweets; + +/** + * Convenience initializer. Uses default values for `maxTweetsPerRequest`, `includeReplies` and `includeRetweets`. + * + * @param screenName The screen name of a Twitter User + * @param client The API client to use for making network requests. + * + * @return A fully initialized user timeline datasource or nil. + */ +- (instancetype)initWithScreenName:(NSString *)screenName APIClient:(TWTRAPIClient *)client; + +/** + * The designated initialzer accepted values for properties. + * + * @param userID The user ID of the Twitter User + * @param screenName The screen name of the Twitter User + * @param APIClient The API client to use for making network requests. + * @param maxTweetsPerRequest The number of Tweets per batch to request. A value of 0 will use the server default. + * @param includeReplies Whether replies should be requested + * @param includeRetweets Whether retweets should be requested + * + * @return A fully initialized user timeline datasource or nil. + */ +- (instancetype)initWithScreenName:(twtr_nullable NSString *)screenName userID:(twtr_nullable NSString *)userID APIClient:(TWTRAPIClient *)client maxTweetsPerRequest:(NSUInteger)maxTweetsPerRequest includeReplies:(BOOL)includeReplies includeRetweets:(BOOL)includeRetweets NS_DESIGNATED_INITIALIZER; + +- (instancetype)init __unavailable; + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterKit.framework/Headers/Twitter.h b/dayPhoto/TwitterKit.framework/Headers/Twitter.h new file mode 100644 index 0000000..88e2627 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/Twitter.h @@ -0,0 +1,184 @@ +// +// Twitter.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#import +#import +#import "TWTRAPIClient.h" + +@class TWTRSessionStore; + +NS_ASSUME_NONNULL_BEGIN + +/** + * A notification which is posted when a user logs out of Twitter. + * The notification will contain a user dictionary which contains + * the user id which is being logged out. Note, this notification may + * be posted as a result of starting the Twitter object. + */ +extern NSString * const TWTRUserDidLogOutNotification; +extern NSString * const TWTRLoggedOutUserIDKey; + +/** + * The central class of the Twitter Kit. + * @note This class can only be used from the main thread. + */ +@interface Twitter : NSObject + +/** + * Returns the Twitter singleton. + * + * @return The Twitter singleton. + */ ++ (Twitter *)sharedInstance; + +/** + * Start Twitter with your consumer key and secret. These will override any credentials + * present in your applications Info.plist. + * + * You do not need to call this method unless you wish to provide credentials other than those + * in your Info.plist. + * + * @param consumerKey Your Twitter application's consumer key. + * @param consumerSecret Your Twitter application's consumer secret. + */ +- (void)startWithConsumerKey:(NSString *)consumerKey consumerSecret:(NSString *)consumerSecret; + +/** + * Start Twitter with a consumer key, secret, and keychain access group. See -[Twitter startWithConsumerKey:consumerSecret:] + * + * @param consumerKey Your Twitter application's consumer key. + * @param consumerSecret Your Twitter application's consumer secret. + * @param accessGroup An optional keychain access group to apply to session objects stored in the keychain. + * + * @note In the majority of situations applications will not need to specify an access group to use with Twitter sessions. + * This value is only needed if you plan to share credentials with another application that you control or if you are + * using TwitterKit with an app extension. + */ +- (void)startWithConsumerKey:(NSString *)consumerKey consumerSecret:(NSString *)consumerSecret accessGroup:(twtr_nullable NSString *)accessGroup; + +/** + * The current version of this kit. + */ +@property (nonatomic, copy, readonly) NSString *version; + +/** + * Authentication configuration details. Encapsulates the `consumerKey` and `consumerSecret` credentials required to authenticate a Twitter application. + */ +@property (nonatomic, strong, readonly) TWTRAuthConfig *authConfig; + +/** + * Session store exposing methods to fetch and manage active sessions. Applications that need to manage + * multiple users should use the session store to authenticate and log out users. + */ +@property (nonatomic, strong, readonly) TWTRSessionStore *sessionStore; + +/** + * Triggers user authentication with Twitter. + * + * This method will present UI to allow the user to log in if there are no saved Twitter login credentials. + * + * @param completion The completion block will be called after authentication is successful or if there is an error. + * @warning This method requires that you have set up your `consumerKey` and `consumerSecret`. + */ +- (void)logInWithCompletion:(TWTRLogInCompletion)completion; + +/** + * Triggers user authentication with Twitter. Allows the developer to specify the presenting view controller. + * + * This method will present UI to allow the user to log in if there are no saved Twitter login credentials. + * + * @param viewController The view controller that will be used to present the authentication view. + * @param completion The completion block will be called after authentication is successful or if there is an error. + * @warning This method requires that you have set up your `consumerKey` and `consumerSecret`. + */ +- (void)logInWithViewController:(twtr_nullable UIViewController *)viewController completion:(TWTRLogInCompletion)completion; + +@end + +@interface Twitter (TWTRDeprecated) + +/** + * The Twitter application consumer key. + * @deprecated This property is deprecated and will be removed in a later release. Please use `authConfig`. + */ +@property (nonatomic, copy, readonly) NSString *consumerKey __attribute__((deprecated("Use `authConfig`. This property will be removed in a later release."))); + +/** + * The Twitter application consumer secret. + * @deprecated This property is deprecated and will be removed in a later release. Please use `authConfig`. + */ +@property (nonatomic, copy, readonly) NSString *consumerSecret __attribute__((deprecated("Use `authConfig`. This property will be removed in a later release."))); + +/** + * Log in a guest user. This can be used when the user is not a Twitter user. + * + * This method will not present any UI to the user. + * + * @param completion The completion block will be called after authentication is successful or if there is an error. + * @warning This method requires that you have set up your `consumerKey` and `consumerSecret`. + * @warning This method will soon be deprecated; it is no longer needed. Users can use the -[Twitter guestAPIClient] directly without needing to call this method. + */ +- (void)logInGuestWithCompletion:(TWTRGuestLogInCompletion)completion; + +/** + * Triggers user authentication with Twitter given an existing session. + * + * Use this method if you have already authenticated with Twitter and are migrating to TwitterKit. This + * method will verify that the `authToken` and `authTokenSecret` are still valid and log the user in with + * the existing credentials. + * + * @param authToken The existing authToken to use for authentication. + * @param authTokenSecret The existing authTokenSecret to use for authentication. + * @param completion The completion block will be called after authentication is successful or if there is an error. + * @warning This method requires that you have set up your `consumerKey` and `consumerSecret`. + * @warning This method will soon be deprecated; for a simpler approach see -[TWTRSessionStore saveSession:completion:]. + */ +- (void)logInWithExistingAuthToken:(NSString *)authToken authTokenSecret:(NSString *)authTokenSecret completion:(TWTRLogInCompletion)completion; + +/** + * Client for consuming the Twitter REST API. + * + * This API client is configured with your consumer key and secret if they are available to the Twitter + * object (either via initialization of the Twitter instance or your application's Info.plist). + * + * @warning To make authenticated requests, you need to call `loginWithCompletion:` + * @warning This method will soon be deprecated. Using this method does not + * give you control over which user you are making request on the behalf of. + * It is recommended that users migrate to using -[TWTRAPIClient initWithUserID:] to have more explicit control. + */ +@property (nonatomic, strong, readonly) TWTRAPIClient *APIClient; + +/** + * Returns the current user session or nil if there is no logged in user. + * + * @return Returns the current user session or nil if there is no logged in user. + * @warning This method will soon be deprecated; it is recommended to use -[TWTRSessionStore session] or -[TWTRSessionStore sessionForUserID:] if they are managing multiple users + */ +- (twtr_nullable TWTRSession *)session; + +/** + * Returns the current guest session or nil if there is no logged in guest. + * + * @return Returns the current guest session or nil if there is no logged in guest. + * @warning This method will soon be deprecated; all network requests will fall back to using a guest session if no user session is provided. + */ +- (twtr_nullable TWTRGuestSession *)guestSession; + +/** + * Deletes the local Twitter user session from this app. This will not remove the system Twitter account nor make a network request to invalidate the session. + * @warning This method will soon be deprecated; users are encouraged to call -[TWTRSessionStore logOutUserID:] instead of calling this method on the Twitter instance directly + */ +- (void)logOut; + +/** + * Deletes the local guest session. Does not make a network request to invalidate the session. + * @warning This method will soon be deprecated; it is no longer needed as the guest authentication is managed by the session store. + */ +- (void)logOutGuest; + +@end + +NS_ASSUME_NONNULL_END diff --git a/dayPhoto/TwitterKit.framework/Headers/TwitterKit.h b/dayPhoto/TwitterKit.framework/Headers/TwitterKit.h new file mode 100644 index 0000000..56ee1ae --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Headers/TwitterKit.h @@ -0,0 +1,58 @@ +// +// TwitterKit.h +// +// Copyright (c) 2015 Twitter. All rights reserved. +// + +#if __has_feature(modules) +@import Accounts; +@import Foundation; +@import Social; +@import UIKit; +@import TwitterCore; +#if __has_include() +@import DigitsKit; +#endif +#else +#import +#import +#import +#import +#import +#import + +#if __has_include() +#import +#endif +#endif + +#if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 +#error "TwitterKit doesn't support iOS 6.x and lower. Please, change your minimum deployment target to iOS 7.0" +#endif + +#import "Twitter.h" +#import "TWTRAPIClient.h" +#import "TWTRCardConfiguration.h" +#import "TWTRComposerViewController.h" +#import "TWTRCollectionTimelineDataSource.h" +#import "TWTRComposer.h" +#import "TWTRComposerTheme.h" +#import "TWTRListTimelineDataSource.h" +#import "TWTRLogInButton.h" +#import "TWTROAuthSigning.h" +#import "TWTRSearchTimelineDataSource.h" +#import "TWTRShareEmailViewController.h" +#import "TWTRTimelineDataSource.h" +#import "TWTRTimelineType.h" +#import "TWTRTimelineViewController.h" +#import "TWTRTweet.h" +#import "TWTRTweetTableViewCell.h" +#import "TWTRTweetView.h" +#import "TWTRTweetViewDelegate.h" +#import "TWTRUser.h" +#import "TWTRUserTimelineDataSource.h" + +/** + * `TwitterKit` can be used as an element in the array passed to the `+[Fabric with:]`. + */ +#define TwitterKit [Twitter sharedInstance] diff --git a/dayPhoto/TwitterKit.framework/Info.plist b/dayPhoto/TwitterKit.framework/Info.plist new file mode 100644 index 0000000..4fb9b2f --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Info.plist @@ -0,0 +1,53 @@ + + + + + BuildMachineOSBuild + 14F1021 + CFBundleDevelopmentRegion + English + CFBundleGetInfoString + Twitter Kit Framework + CFBundleIdentifier + com.twitter.sdk.ios + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + TwitterKit + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.14.6 + CFBundleSupportedPlatforms + + iPhoneOS + + CFBundleVersion + 1.14.6 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 13B137 + DTPlatformName + iphoneos + DTPlatformVersion + 9.1 + DTSDKBuild + 13B137 + DTSDKName + iphoneos9.1 + DTXcode + 0711 + DTXcodeBuild + 7B1005 + MinimumOSVersion + 7.0 + NSHumanReadableCopyright + Copyright 2014 Twitter Inc. + UIDeviceFamily + + 1 + 2 + + + diff --git a/dayPhoto/TwitterKit.framework/Modules/module.modulemap b/dayPhoto/TwitterKit.framework/Modules/module.modulemap new file mode 100644 index 0000000..a087a47 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Modules/module.modulemap @@ -0,0 +1,31 @@ +framework module TwitterKit { + umbrella header "TwitterKit.h" + + export * + module * { export * } + + link framework "MediaPlayer" + + header "TWTRAPIClient.h" + header "TWTRCardConfiguration.h" + header "TWTRCollectionTimelineDataSource.h" + header "TWTRComposer.h" + header "TWTRComposerTheme.h" + header "TWTRComposerViewController.h" + header "TWTRListTimelineDataSource.h" + header "TWTRLogInButton.h" + header "TWTROAuthSigning.h" + header "TWTRSearchTimelineDataSource.h" + header "TWTRShareEmailViewController.h" + header "TWTRTimelineDataSource.h" + header "TWTRTimelineType.h" + header "TWTRTimelineViewController.h" + header "TWTRTweet.h" + header "TWTRTweetTableViewCell.h" + header "TWTRTweetView.h" + header "TWTRTweetViewDelegate.h" + header "TWTRUser.h" + header "TWTRUserTimelineDataSource.h" + header "Twitter.h" + header "TwitterKit.h" +} diff --git a/dayPhoto/TwitterKit.framework/Resources b/dayPhoto/TwitterKit.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/dayPhoto/TwitterKit.framework/TwitterKit b/dayPhoto/TwitterKit.framework/TwitterKit new file mode 100755 index 0000000..a991848 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/TwitterKit differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/TFSScribe.momd/TFSScribe.mom b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/TFSScribe.momd/TFSScribe.mom new file mode 100644 index 0000000..a9a786b Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/TFSScribe.momd/TFSScribe.mom differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/TFSScribe.momd/VersionInfo.plist b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/TFSScribe.momd/VersionInfo.plist new file mode 100644 index 0000000..45677dc Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/TFSScribe.momd/VersionInfo.plist differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ar.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ar.lproj/Localizable.strings new file mode 100644 index 0000000..d6c1ba6 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ar.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/bn.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/bn.lproj/Localizable.strings new file mode 100644 index 0000000..4b3e526 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/bn.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/cs.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/cs.lproj/Localizable.strings new file mode 100644 index 0000000..271d6b2 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/cs.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/da.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/da.lproj/Localizable.strings new file mode 100644 index 0000000..d909555 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/da.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/de.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/de.lproj/Localizable.strings new file mode 100644 index 0000000..774fabc Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/de.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/emailshare.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/emailshare.png new file mode 100644 index 0000000..ebaa1eb Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/emailshare.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/emailshare@2x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/emailshare@2x.png new file mode 100644 index 0000000..2546629 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/emailshare@2x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/emailshare@3x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/emailshare@3x.png new file mode 100644 index 0000000..18defd7 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/emailshare@3x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/en-gb.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/en-gb.lproj/Localizable.strings new file mode 100644 index 0000000..79050cf Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/en-gb.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/en.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/en.lproj/Localizable.strings new file mode 100644 index 0000000..a85c62b --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/en.lproj/Localizable.strings @@ -0,0 +1,86 @@ +/* Label for button to bring up share dialog to share this Tweet in a single Tweet view */ +"tw__share_tweet" = "Share Tweet"; +/* Subject format used to prefill certain sharing options such as Email includes full name (%1$@) and screenname (%2$@) */ +"tw__share_tweet_subject_format" = "Tweet from %1$@ (@%2$@)"; +/* Generic share text format used in all sharing options includes screenname (%1$@) and URL to the Tweet (%2$@) */ +"tw__share_tweet_generic_template_format" = "Check out @%1$@\'s Tweet: %2$@"; +/* Label for Sign in with Twitter button */ +"tw__sign_in_with_twitter_button" = "Log in with Twitter"; +/* Label Email Share Screen negative button */ +"tw__email_share_negative_button" = "Not now"; +/* Label Email Share Screen affirmative button */ +"tw__email_share_affirmative_button" = "Allow"; +/* Heading that appears above the detail message on the share your email screen */ +"tw__email_share_heading" = "Share your email address"; +/* Detail message that includes the app name and username on the share your email screen */ +"tw__email_share_detail_message_format" = "Get updates and other information from %@ when you allow them access to your email on your Twitter account @%@."; +/* Fallback string for detail message in case the app name is not available */ +"tw__email_share_detail_message_this_app" = "this app"; +/* Fallback string for detail message in case the user is not signed in */ +"tw__email_share_detail_message_not_signed_in" = "(not signed in)"; +/* Label for attributing this Tweet was retweeted by the user %@ */ +"tw__tweet_retweeted_by_user" = "Retweeted by %@"; +/* Label for the Install button within the app promo card preview of the Tweet composer */ +"tw__card_composer_install_button" = "Install"; +/* Label for the post tweet button in the compose view */ +"tw__card_composer_tweet" = "Tweet"; +/* Label for the App Store subtitle on the card install preview */ +"tw__card_composer_app_store" = "App Store"; +/* Placeholder text for the composer */ +"tw__composer_placeholder_text" = "What's Happening?"; + + +/* Timestamps */ + +/* Really short abbreviation for days (plural). 5 days would be '5d' */ +"TIME_SHORT_DAYS_FORMAT" = "%dd"; +/* Really short abbreviation for day (singular). 1 day would be '1d' */ +"TIME_SHORT_DAY_FORMAT" = "%dd"; +/* Really short abbreviation for hours (plural). 5 hours would be '5h' */ +"TIME_SHORT_HOURS_FORMAT" = "%dh"; +/* Really short abbreviation for hour (singular). 1 hour would be '1h' */ +"TIME_SHORT_HOUR_FORMAT" = "%dh"; +/* Really short abbreviation for minutes (plural). 5 minutes would be '5m' */ +"TIME_SHORT_MINUTES_FORMAT" = "%dm"; +/* Really short abbreviation for minute (singular). 1 minute would be '1m' */ +"TIME_SHORT_MINUTE_FORMAT" = "%dm"; +/* Really short abbreviation for seconds (plural). 5 seconds would be '5s' */ +"TIME_SHORT_SECONDS_FORMAT" = "%ds"; +/* Really short abbreviation for second (singular). '1s' */ +"TIME_SHORT_SECOND_FORMAT" = "%ds"; + +/* Accessibility Labels */ + +/* Text spoken out with VoiceOver when a tweet has an image thumbnail showing */ +"tw__single_image" = "Image Attachment"; +/* Text spoken out with VoiceOver when a tweet has a video thumbnail showing */ +"tw__video_thumbnail" = "Video Attachment"; +/* Text spoken out with VoiceOver for selecting the profile image on a regular tweet view */ +"tw__tweet_profile_accessibility" = "Profile"; +/* Text spoken out with VoiceOver for selecting the attached image on a regular tweet view */ +"tw__tweet_image_accessibility" = "Attachment"; +/* Text spoken out with VoiceOver for the content image of the card composer preview */ +"tw__user_content_image" = "App Preview"; +/* Text spoken out with VoiceOver for the Install button preview in card composer previews */ +"tw__card_compose_install_preview" = "Preview of install button for %@"; +/* Text spoken as VoiceOver hint for Tweet button in the card composer bottom bar */ +"tw__card_compose_tweet_hint" = "Double-tap to post this Tweet"; +/* Text spoken out with VoiceOver for the remaining character count in composer bottom bar */ +"tw__card_compose_character_count" = "%td characters remaining"; +/* Text spoken out with VoiceOver for the profile image in the composer top bar */ +"tw__card_compose_profile_image" = "%@'s profile"; +/* Text spoken out with VoiceOver for the close button in the card composer top bar */ +"tw__card_compose_close_button" = "Close"; +/* Text spoken out as VoiceOver hint for the close button in the card composer top bar */ +"tw__card_compose_close_hint" = "Double-tap to dismiss the composer."; +/* VoiceOver label for Done button on image viewer */ +"tw__image_viewer_done_button" = "Done"; +/* VoiceOver label for Like button */ +"tw__tweet_like_button" = "Like"; +/* VoiceOver value for Like button on Tweet that has been liked */ +"tw__tweet_liked_state" = "Liked"; +/* VoiceOver value for Like button on Tweet that has not yet been liked */ +"tw__tweet_not_liked_state" = "Not Liked"; + +/* Test String (just for unit tests) */ +"tw__test_string" = "Test"; diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/es.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/es.lproj/Localizable.strings new file mode 100644 index 0000000..867a6e9 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/es.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/fa.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/fa.lproj/Localizable.strings new file mode 100644 index 0000000..6476867 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/fa.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/fi.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/fi.lproj/Localizable.strings new file mode 100644 index 0000000..2f1f199 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/fi.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/fr.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/fr.lproj/Localizable.strings new file mode 100644 index 0000000..9cb4335 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/fr.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/he.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/he.lproj/Localizable.strings new file mode 100644 index 0000000..0588dcf Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/he.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/hi.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/hi.lproj/Localizable.strings new file mode 100644 index 0000000..14d825f Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/hi.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/hu.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/hu.lproj/Localizable.strings new file mode 100644 index 0000000..242f735 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/hu.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/icn_close.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/icn_close.png new file mode 100644 index 0000000..93943d9 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/icn_close.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/icn_close@2x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/icn_close@2x.png new file mode 100644 index 0000000..8fd4fa2 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/icn_close@2x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/icn_close@3x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/icn_close@3x.png new file mode 100644 index 0000000..c3dfde3 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/icn_close@3x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/id.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/id.lproj/Localizable.strings new file mode 100644 index 0000000..30f088d Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/id.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/it.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/it.lproj/Localizable.strings new file mode 100644 index 0000000..aaaa592 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/it.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ja.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ja.lproj/Localizable.strings new file mode 100644 index 0000000..5115e9a Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ja.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ko.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ko.lproj/Localizable.strings new file mode 100644 index 0000000..4f6481f Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ko.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ms.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ms.lproj/Localizable.strings new file mode 100644 index 0000000..3e133b6 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ms.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/nb.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/nb.lproj/Localizable.strings new file mode 100644 index 0000000..974c461 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/nb.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/nl.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/nl.lproj/Localizable.strings new file mode 100644 index 0000000..0a2e394 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/nl.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/pl.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/pl.lproj/Localizable.strings new file mode 100644 index 0000000..fc9834c Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/pl.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/pt.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/pt.lproj/Localizable.strings new file mode 100644 index 0000000..5b74e03 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/pt.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ro.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ro.lproj/Localizable.strings new file mode 100644 index 0000000..c1f1e83 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ro.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ru.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ru.lproj/Localizable.strings new file mode 100644 index 0000000..9a9c8fb Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ru.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/sv.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/sv.lproj/Localizable.strings new file mode 100644 index 0000000..4d5e817 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/sv.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/th.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/th.lproj/Localizable.strings new file mode 100644 index 0000000..02796c7 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/th.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/tl.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/tl.lproj/Localizable.strings new file mode 100644 index 0000000..5afa42b Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/tl.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/tr.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/tr.lproj/Localizable.strings new file mode 100644 index 0000000..0663081 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/tr.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-heart-animation-sheet.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-heart-animation-sheet.png new file mode 100644 index 0000000..427f633 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-heart-animation-sheet.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-heart-animation-sheet@2x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-heart-animation-sheet@2x.png new file mode 100644 index 0000000..abbd12a Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-heart-animation-sheet@2x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-heart-animation-sheet@3x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-heart-animation-sheet@3x.png new file mode 100644 index 0000000..fbd1f5f Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-heart-animation-sheet@3x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-off.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-off.png new file mode 100644 index 0000000..b816ff8 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-off.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-off@2x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-off@2x.png new file mode 100644 index 0000000..2f74a4d Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-off@2x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-off@3x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-off@3x.png new file mode 100644 index 0000000..63621d7 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-off@3x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-on.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-on.png new file mode 100644 index 0000000..b0fc506 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-on.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-on@2x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-on@2x.png new file mode 100644 index 0000000..cd2bb37 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-on@2x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-on@3x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-on@3x.png new file mode 100644 index 0000000..8f04b2d Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-heart-on@3x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo-white.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo-white.png new file mode 100644 index 0000000..b7e4f7c Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo-white.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo-white@2x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo-white@2x.png new file mode 100644 index 0000000..bbfbee7 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo-white@2x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo-white@3x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo-white@3x.png new file mode 100644 index 0000000..3074978 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo-white@3x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo.png new file mode 100644 index 0000000..ea6f7cd Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo@2x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo@2x.png new file mode 100644 index 0000000..2c17c4d Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo@2x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo@3x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo@3x.png new file mode 100644 index 0000000..b969d88 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-logo@3x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-dark.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-dark.png new file mode 100644 index 0000000..2f2d32e Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-dark.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-dark@2x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-dark@2x.png new file mode 100644 index 0000000..61692b4 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-dark@2x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-dark@3x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-dark@3x.png new file mode 100644 index 0000000..4dda258 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-dark@3x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-light.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-light.png new file mode 100644 index 0000000..745d9b6 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-light.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-light@2x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-light@2x.png new file mode 100644 index 0000000..6033368 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-light@2x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-light@3x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-light@3x.png new file mode 100644 index 0000000..0707a13 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-retweeted-by-light@3x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-verified.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-verified.png new file mode 100644 index 0000000..74d94a2 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-verified.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-verified@2x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-verified@2x.png new file mode 100644 index 0000000..f783dbe Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-verified@2x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-verified@3x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-verified@3x.png new file mode 100644 index 0000000..31a34ee Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-icn-tweet-verified@3x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-play.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-play.png new file mode 100644 index 0000000..721f542 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-play.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-play@2x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-play@2x.png new file mode 100644 index 0000000..7ad4813 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-play@2x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-play@3x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-play@3x.png new file mode 100644 index 0000000..355c57f Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-play@3x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-share.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-share.png new file mode 100644 index 0000000..c60931d Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-share.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-share@2x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-share@2x.png new file mode 100644 index 0000000..7c31f92 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-share@2x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-share@3x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-share@3x.png new file mode 100644 index 0000000..d3942ca Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twtr-share@3x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo-error.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo-error.png new file mode 100644 index 0000000..40d6a35 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo-error.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo-error@2x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo-error@2x.png new file mode 100644 index 0000000..0bfc026 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo-error@2x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo-error@3x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo-error@3x.png new file mode 100644 index 0000000..8dc8747 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo-error@3x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo.png new file mode 100644 index 0000000..ad4c4b4 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo@2x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo@2x.png new file mode 100644 index 0000000..47ea38b Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo@2x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo@3x.png b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo@3x.png new file mode 100644 index 0000000..db471c6 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/twttr-icn-tweet-place-holder-photo@3x.png differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/uk.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/uk.lproj/Localizable.strings new file mode 100644 index 0000000..e058d29 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/uk.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ur.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ur.lproj/Localizable.strings new file mode 100644 index 0000000..72a09f6 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/ur.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/vi.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/vi.lproj/Localizable.strings new file mode 100644 index 0000000..22ec6a3 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/vi.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/zh-Hans.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/zh-Hans.lproj/Localizable.strings new file mode 100644 index 0000000..6bf42cc Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/zh-Hans.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/zh-Hant.lproj/Localizable.strings b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/zh-Hant.lproj/Localizable.strings new file mode 100644 index 0000000..83ade67 Binary files /dev/null and b/dayPhoto/TwitterKit.framework/Versions/A/Resources/TwitterKitResources.bundle/zh-Hant.lproj/Localizable.strings differ diff --git a/dayPhoto/TwitterKit.framework/Versions/Current b/dayPhoto/TwitterKit.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/dayPhoto/TwitterKit.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file