├── .gitignore ├── LICENSE ├── Podfile ├── Podfile.lock ├── Pods ├── Alamofire │ ├── LICENSE │ ├── README.md │ └── Source │ │ ├── AFError.swift │ │ ├── Alamofire.swift │ │ ├── DispatchQueue+Alamofire.swift │ │ ├── MultipartFormData.swift │ │ ├── NetworkReachabilityManager.swift │ │ ├── Notifications.swift │ │ ├── ParameterEncoding.swift │ │ ├── Request.swift │ │ ├── Response.swift │ │ ├── ResponseSerialization.swift │ │ ├── Result.swift │ │ ├── ServerTrustPolicy.swift │ │ ├── SessionDelegate.swift │ │ ├── SessionManager.swift │ │ ├── TaskDelegate.swift │ │ ├── Timeline.swift │ │ └── Validation.swift ├── BRYXBanner │ ├── LICENSE │ ├── Pod │ │ └── Classes │ │ │ └── Banner.swift │ └── README.md ├── FLAnimatedImage │ ├── FLAnimatedImage │ │ ├── FLAnimatedImage.h │ │ ├── FLAnimatedImage.m │ │ ├── FLAnimatedImageView.h │ │ └── FLAnimatedImageView.m │ ├── LICENSE │ └── README.md ├── Locksmith │ ├── LICENSE │ ├── README.md │ └── Source │ │ ├── Dictionary_Initializers.swift │ │ ├── Locksmith.h │ │ ├── Locksmith.swift │ │ ├── LocksmithAccessibleOption.swift │ │ ├── LocksmithError.swift │ │ ├── LocksmithInternetAuthenticationType.swift │ │ ├── LocksmithInternetProtocol.swift │ │ └── LocksmithSecurityClass.swift ├── Manifest.lock ├── PINCache │ ├── LICENSE.txt │ ├── PINCache │ │ ├── Nullability.h │ │ ├── PINCache.h │ │ ├── PINCache.m │ │ ├── PINCacheObjectSubscripting.h │ │ ├── PINDiskCache.h │ │ ├── PINDiskCache.m │ │ ├── PINMemoryCache.h │ │ └── PINMemoryCache.m │ └── README.md ├── PINRemoteImage │ ├── LICENSE │ ├── Pod │ │ └── Classes │ │ │ ├── Categories │ │ │ ├── NSData+ImageDetectors.h │ │ │ ├── NSData+ImageDetectors.m │ │ │ ├── PINImage+DecodedImage.h │ │ │ ├── PINImage+DecodedImage.m │ │ │ ├── PINImage+WebP.h │ │ │ └── PINImage+WebP.m │ │ │ ├── Image Categories │ │ │ ├── FLAnimatedImageView+PINRemoteImage.h │ │ │ ├── FLAnimatedImageView+PINRemoteImage.m │ │ │ ├── PINButton+PINRemoteImage.h │ │ │ ├── PINButton+PINRemoteImage.m │ │ │ ├── PINImageView+PINRemoteImage.h │ │ │ └── PINImageView+PINRemoteImage.m │ │ │ ├── PINDataTaskOperation.h │ │ │ ├── PINDataTaskOperation.m │ │ │ ├── PINProgressiveImage.h │ │ │ ├── PINProgressiveImage.m │ │ │ ├── PINRemoteImage.h │ │ │ ├── PINRemoteImageCallbacks.h │ │ │ ├── PINRemoteImageCallbacks.m │ │ │ ├── PINRemoteImageCategoryManager.h │ │ │ ├── PINRemoteImageCategoryManager.m │ │ │ ├── PINRemoteImageDownloadTask.h │ │ │ ├── PINRemoteImageDownloadTask.m │ │ │ ├── PINRemoteImageMacros.h │ │ │ ├── PINRemoteImageManager.h │ │ │ ├── PINRemoteImageManager.m │ │ │ ├── PINRemoteImageManagerResult.h │ │ │ ├── PINRemoteImageManagerResult.m │ │ │ ├── PINRemoteImageProcessorTask.h │ │ │ ├── PINRemoteImageProcessorTask.m │ │ │ ├── PINRemoteImageTask.h │ │ │ ├── PINRemoteImageTask.m │ │ │ ├── PINRemoteLock.h │ │ │ ├── PINRemoteLock.m │ │ │ ├── PINURLSessionManager.h │ │ │ └── PINURLSessionManager.m │ └── README.md ├── Pods.xcodeproj │ └── project.pbxproj ├── Target Support Files │ ├── Alamofire │ │ ├── Alamofire-dummy.m │ │ ├── Alamofire-prefix.pch │ │ ├── Alamofire-umbrella.h │ │ ├── Alamofire.modulemap │ │ ├── Alamofire.xcconfig │ │ └── Info.plist │ ├── BRYXBanner │ │ ├── BRYXBanner-dummy.m │ │ ├── BRYXBanner-prefix.pch │ │ ├── BRYXBanner-umbrella.h │ │ ├── BRYXBanner.modulemap │ │ ├── BRYXBanner.xcconfig │ │ └── Info.plist │ ├── FLAnimatedImage │ │ ├── FLAnimatedImage-dummy.m │ │ ├── FLAnimatedImage-prefix.pch │ │ ├── FLAnimatedImage-umbrella.h │ │ ├── FLAnimatedImage.modulemap │ │ ├── FLAnimatedImage.xcconfig │ │ └── Info.plist │ ├── Locksmith │ │ ├── Info.plist │ │ ├── Locksmith-dummy.m │ │ ├── Locksmith-prefix.pch │ │ ├── Locksmith-umbrella.h │ │ ├── Locksmith.modulemap │ │ └── Locksmith.xcconfig │ ├── PINCache │ │ ├── Info.plist │ │ ├── PINCache-dummy.m │ │ ├── PINCache-prefix.pch │ │ ├── PINCache-umbrella.h │ │ ├── PINCache.modulemap │ │ └── PINCache.xcconfig │ ├── PINRemoteImage │ │ ├── Info.plist │ │ ├── PINRemoteImage-dummy.m │ │ ├── PINRemoteImage-prefix.pch │ │ ├── PINRemoteImage-umbrella.h │ │ ├── PINRemoteImage.modulemap │ │ └── PINRemoteImage.xcconfig │ ├── Pods-grokSwiftREST │ │ ├── Info.plist │ │ ├── Pods-grokSwiftREST-acknowledgements.markdown │ │ ├── Pods-grokSwiftREST-acknowledgements.plist │ │ ├── Pods-grokSwiftREST-dummy.m │ │ ├── Pods-grokSwiftREST-frameworks.sh │ │ ├── Pods-grokSwiftREST-resources.sh │ │ ├── Pods-grokSwiftREST-umbrella.h │ │ ├── Pods-grokSwiftREST.debug.xcconfig │ │ ├── Pods-grokSwiftREST.modulemap │ │ └── Pods-grokSwiftREST.release.xcconfig │ └── XLForm │ │ ├── Info.plist │ │ ├── XLForm-dummy.m │ │ ├── XLForm-prefix.pch │ │ ├── XLForm-umbrella.h │ │ ├── XLForm.modulemap │ │ └── XLForm.xcconfig └── XLForm │ ├── LICENSE │ ├── README.md │ └── XLForm │ ├── XL │ ├── Cell │ │ ├── XLFormBaseCell.h │ │ ├── XLFormBaseCell.m │ │ ├── XLFormButtonCell.h │ │ ├── XLFormButtonCell.m │ │ ├── XLFormCheckCell.h │ │ ├── XLFormCheckCell.m │ │ ├── XLFormDateCell.h │ │ ├── XLFormDateCell.m │ │ ├── XLFormDatePickerCell.h │ │ ├── XLFormDatePickerCell.m │ │ ├── XLFormDescriptorCell.h │ │ ├── XLFormImageCell.h │ │ ├── XLFormImageCell.m │ │ ├── XLFormInlineRowDescriptorCell.h │ │ ├── XLFormInlineSelectorCell.h │ │ ├── XLFormInlineSelectorCell.m │ │ ├── XLFormLeftRightSelectorCell.h │ │ ├── XLFormLeftRightSelectorCell.m │ │ ├── XLFormPickerCell.h │ │ ├── XLFormPickerCell.m │ │ ├── XLFormSegmentedCell.h │ │ ├── XLFormSegmentedCell.m │ │ ├── XLFormSelectorCell.h │ │ ├── XLFormSelectorCell.m │ │ ├── XLFormSliderCell.h │ │ ├── XLFormSliderCell.m │ │ ├── XLFormStepCounterCell.h │ │ ├── XLFormStepCounterCell.m │ │ ├── XLFormSwitchCell.h │ │ ├── XLFormSwitchCell.m │ │ ├── XLFormTextFieldCell.h │ │ ├── XLFormTextFieldCell.m │ │ ├── XLFormTextViewCell.h │ │ └── XLFormTextViewCell.m │ ├── Controllers │ │ ├── XLFormOptionsObject.h │ │ ├── XLFormOptionsObject.m │ │ ├── XLFormOptionsViewController.h │ │ ├── XLFormOptionsViewController.m │ │ ├── XLFormRowDescriptorViewController.h │ │ ├── XLFormViewController.h │ │ └── XLFormViewController.m │ ├── Descriptors │ │ ├── XLFormDescriptor.h │ │ ├── XLFormDescriptor.m │ │ ├── XLFormDescriptorDelegate.h │ │ ├── XLFormRowDescriptor.h │ │ ├── XLFormRowDescriptor.m │ │ ├── XLFormSectionDescriptor.h │ │ └── XLFormSectionDescriptor.m │ ├── Helpers │ │ ├── NSArray+XLFormAdditions.h │ │ ├── NSArray+XLFormAdditions.m │ │ ├── NSExpression+XLFormAdditions.h │ │ ├── NSExpression+XLFormAdditions.m │ │ ├── NSObject+XLFormAdditions.h │ │ ├── NSObject+XLFormAdditions.m │ │ ├── NSPredicate+XLFormAdditions.h │ │ ├── NSPredicate+XLFormAdditions.m │ │ ├── NSString+XLFormAdditions.h │ │ ├── NSString+XLFormAdditions.m │ │ ├── UIView+XLFormAdditions.h │ │ ├── UIView+XLFormAdditions.m │ │ └── Views │ │ │ ├── XLFormRightDetailCell.h │ │ │ ├── XLFormRightDetailCell.m │ │ │ ├── XLFormRightImageButton.h │ │ │ ├── XLFormRightImageButton.m │ │ │ ├── XLFormRowNavigationAccessoryView.h │ │ │ ├── XLFormRowNavigationAccessoryView.m │ │ │ ├── XLFormTextView.h │ │ │ └── XLFormTextView.m │ ├── Validation │ │ ├── XLFormRegexValidator.h │ │ ├── XLFormRegexValidator.m │ │ ├── XLFormValidationStatus.h │ │ ├── XLFormValidationStatus.m │ │ ├── XLFormValidator.h │ │ ├── XLFormValidator.m │ │ └── XLFormValidatorProtocol.h │ ├── XLForm.h │ └── XLForm.m │ └── XLForm.bundle │ └── forwardarrow@2x.png ├── README.md ├── grokSwiftREST.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ └── christina.xcuserdatad │ └── UserInterfaceState.xcuserstate ├── grokSwiftREST.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist └── grokSwiftREST ├── AppDelegate.swift ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json ├── Contents.json └── placeholder.imageset │ ├── Contents.json │ └── placeholder.png ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist ├── Models ├── File.swift └── Gist.swift ├── Networking ├── BackendError.swift ├── GistRouter.swift ├── GitHubAPIManager.swift └── JSONEncoder+EncodeResponse.swift ├── PersistenceManager.swift └── View Controllers ├── CreateGistViewControlle.swift ├── DetailViewController.swift ├── LoginViewController.swift └── MasterViewController.swift /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | */xcuserdata/* 20 | 21 | ## Other 22 | *.moved-aside 23 | *.xccheckout 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | *.dSYM.zip 30 | *.dSYM 31 | 32 | ## Playgrounds 33 | timeline.xctimeline 34 | playground.xcworkspace 35 | 36 | # Swift Package Manager 37 | # 38 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 39 | # Packages/ 40 | # Package.pins 41 | .build/ 42 | 43 | # CocoaPods 44 | # 45 | # We recommend against adding the Pods directory to your .gitignore. However 46 | # you should judge for yourself, the pros and cons are mentioned at: 47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 48 | # 49 | # Pods/ 50 | 51 | # Carthage 52 | # 53 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 54 | # Carthage/Checkouts 55 | 56 | Carthage/Build 57 | 58 | # fastlane 59 | # 60 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 61 | # screenshots whenever they are needed. 62 | # For more information about the recommended setup visit: 63 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 64 | 65 | fastlane/report.xml 66 | fastlane/Preview.html 67 | fastlane/screenshots 68 | fastlane/test_output 69 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Christina Moulton, iOS Dev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '10.0' 2 | 3 | target 'grokSwiftREST' do 4 | use_frameworks! 5 | 6 | # Pods for grokSwiftREST 7 | pod 'Alamofire', '~> 4.7' 8 | pod 'PINRemoteImage', '~> 2.1' 9 | pod 'Locksmith', '~> 4.0' 10 | pod 'XLForm', '~> 4.0' 11 | pod 'BRYXBanner', '~> 0.8' 12 | end 13 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (4.7.0) 3 | - BRYXBanner (0.8.0) 4 | - FLAnimatedImage (1.0.12) 5 | - Locksmith (4.0.0) 6 | - PINCache (2.3) 7 | - PINRemoteImage (2.1.4): 8 | - PINRemoteImage/FLAnimatedImage (= 2.1.4) 9 | - PINRemoteImage/Core (2.1.4): 10 | - PINCache (>= 2.1) 11 | - PINRemoteImage/FLAnimatedImage (2.1.4): 12 | - FLAnimatedImage (>= 1.0) 13 | - PINRemoteImage/Core 14 | - XLForm (4.0.0) 15 | 16 | DEPENDENCIES: 17 | - Alamofire (~> 4.7) 18 | - BRYXBanner (~> 0.8) 19 | - Locksmith (~> 4.0) 20 | - PINRemoteImage (~> 2.1) 21 | - XLForm (~> 4.0) 22 | 23 | SPEC REPOS: 24 | https://github.com/cocoapods/specs.git: 25 | - Alamofire 26 | - BRYXBanner 27 | - FLAnimatedImage 28 | - Locksmith 29 | - PINCache 30 | - PINRemoteImage 31 | - XLForm 32 | 33 | SPEC CHECKSUMS: 34 | Alamofire: 907e0a98eb68cdb7f9d1f541a563d6ac5dc77b25 35 | BRYXBanner: 406c3775789136531da6f3c98058be2f16e08a34 36 | FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31 37 | Locksmith: e9bebbaaa4cee3c511bc358a44f843c3fe00e21f 38 | PINCache: ce36ed282031b92fc7733ffe831f474ff80fddc2 39 | PINRemoteImage: 4ac4011c5caefd6befd99758e09becede05d3226 40 | XLForm: 04110197c12187dd28a6c7295d3d8b95f4fdb4de 41 | 42 | PODFILE CHECKSUM: cb13e47c4a78bbaa49b6c10d36a67e78c264eaae 43 | 44 | COCOAPODS: 1.5.3 45 | -------------------------------------------------------------------------------- /Pods/Alamofire/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/DispatchQueue+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DispatchQueue+Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Dispatch 26 | import Foundation 27 | 28 | extension DispatchQueue { 29 | static var userInteractive: DispatchQueue { return DispatchQueue.global(qos: .userInteractive) } 30 | static var userInitiated: DispatchQueue { return DispatchQueue.global(qos: .userInitiated) } 31 | static var utility: DispatchQueue { return DispatchQueue.global(qos: .utility) } 32 | static var background: DispatchQueue { return DispatchQueue.global(qos: .background) } 33 | 34 | func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { 35 | asyncAfter(deadline: .now() + delay, execute: closure) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/Notifications.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Notifications.swift 3 | // 4 | // Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | extension Notification.Name { 28 | /// Used as a namespace for all `URLSessionTask` related notifications. 29 | public struct Task { 30 | /// Posted when a `URLSessionTask` is resumed. The notification `object` contains the resumed `URLSessionTask`. 31 | public static let DidResume = Notification.Name(rawValue: "org.alamofire.notification.name.task.didResume") 32 | 33 | /// Posted when a `URLSessionTask` is suspended. The notification `object` contains the suspended `URLSessionTask`. 34 | public static let DidSuspend = Notification.Name(rawValue: "org.alamofire.notification.name.task.didSuspend") 35 | 36 | /// Posted when a `URLSessionTask` is cancelled. The notification `object` contains the cancelled `URLSessionTask`. 37 | public static let DidCancel = Notification.Name(rawValue: "org.alamofire.notification.name.task.didCancel") 38 | 39 | /// Posted when a `URLSessionTask` is completed. The notification `object` contains the completed `URLSessionTask`. 40 | public static let DidComplete = Notification.Name(rawValue: "org.alamofire.notification.name.task.didComplete") 41 | } 42 | } 43 | 44 | // MARK: - 45 | 46 | extension Notification { 47 | /// Used as a namespace for all `Notification` user info dictionary keys. 48 | public struct Key { 49 | /// User info dictionary key representing the `URLSessionTask` associated with the notification. 50 | public static let Task = "org.alamofire.notification.key.task" 51 | 52 | /// User info dictionary key representing the responseData associated with the notification. 53 | public static let ResponseData = "org.alamofire.notification.key.responseData" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Pods/BRYXBanner/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Harlan Haskins 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/BRYXBanner/README.md: -------------------------------------------------------------------------------- 1 | # BRYXBanner 2 | 3 | [![Version](https://img.shields.io/cocoapods/v/BRYXBanner.svg?style=flat)](http://cocoapods.org/pods/BRYXBanner) 4 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 5 | [![License](https://img.shields.io/cocoapods/l/BRYXBanner.svg?style=flat)](http://cocoapods.org/pods/BRYXBanner) 6 | [![Platform](https://img.shields.io/cocoapods/p/BRYXBanner.svg?style=flat)](http://cocoapods.org/pods/BRYXBanner) 7 | 8 | A lightweight dropdown banner for iOS 7+. 9 | 10 | ![Example](https://raw.githubusercontent.com/bryx-inc/BRYXBanner/master/Example/Demo.gif) 11 | 12 | ## Usage 13 | 14 | Import `BRYXBanner` 15 | 16 | ```rust 17 | import BRYXBanner 18 | ``` 19 | 20 | Create a banner using the designated initializer. 21 | 22 | ```rust 23 | let banner = Banner(title: "Image Notification", subtitle: "Here's a great image notification.", image: UIImage(named: "Icon"), backgroundColor: UIColor(red:48.00/255.0, green:174.0/255.0, blue:51.5/255.0, alpha:1.000)) 24 | banner.dismissesOnTap = true 25 | banner.show(duration: 3.0) 26 | ``` 27 | 28 | If you want the banner to persist until you call `.dismiss()`, leave the argument out of the call to `.show()` 29 | 30 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 31 | 32 | ## Requirements 33 | 34 | Demo project requires iOS 8, though BRYXBanner works on iOS 7+. 35 | 36 | ## Installation 37 | 38 | BRYXBanner is available through [CocoaPods](http://cocoapods.org) and [Carthage](https://github.com/Carthage/Carthage). 39 | 40 | #### Using CocoaPods 41 | 42 | To install it, simply add the following line to your Podfile: 43 | 44 | ```ruby 45 | pod 'BRYXBanner' 46 | ``` 47 | 48 | If you need to support iOS 7, just copy `Banner.swift` into your Xcode project. 49 | 50 | #### Using Carthage 51 | 52 | Create a Cartfile in your project directory and add the following line. 53 | 54 | ```ruby 55 | github "bryx-inc/BRYXBanner" 56 | ``` 57 | Run `carthage update` from the command line. This will build the framework. The framework will be within `Carthage/build/BRYXBanner.framework`. 58 | 59 | Add the framework to your project by going to your app's targets and selecting the General tab. Drag the built framework onto `Linked Frameworks and Libraries` 60 | 61 | Go to the Build Phases tab, click the `+` sign and add a new run script phase. Then add the following: 62 | 63 | ``` 64 | /usr/local/bin/carthage copy-frameworks 65 | ``` 66 | to the box under Shell. Finally click `+` to add a new input file. Replace the default with: 67 | 68 | ``` 69 | $(SRCROOT)/Carthage/Build/iOS/BRYXBanner.framework 70 | ``` 71 | 72 | Now build and run. You're all set! More information on Carthage is available [here](https://github.com/Carthage/Carthage). 73 | 74 | 75 | ## Documentation 76 | 77 | Docs are automatically generated and available [right here](http://cocoadocs.org/docsets/BRYXBanner/). 78 | 79 | ## Authors 80 | 81 | Harlan Haskins ([@harlanhaskins](https://github.com/harlanhaskins)) 82 | Adam Binsz ([@adambinsz](https://github.com/adambinsz)) 83 | 84 | ## License 85 | 86 | BRYXBanner is available under the MIT license. See the LICENSE file for more info. 87 | -------------------------------------------------------------------------------- /Pods/FLAnimatedImage/FLAnimatedImage/FLAnimatedImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FLAnimatedImageView.h 3 | // Flipboard 4 | // 5 | // Created by Raphael Schaad on 7/8/13. 6 | // Copyright (c) 2013-2015 Flipboard. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | @class FLAnimatedImage; 13 | @protocol FLAnimatedImageViewDebugDelegate; 14 | 15 | 16 | // 17 | // An `FLAnimatedImageView` can take an `FLAnimatedImage` and plays it automatically when in view hierarchy and stops when removed. 18 | // The animation can also be controlled with the `UIImageView` methods `-start/stop/isAnimating`. 19 | // It is a fully compatible `UIImageView` subclass and can be used as a drop-in component to work with existing code paths expecting to display a `UIImage`. 20 | // Under the hood it uses a `CADisplayLink` for playback, which can be inspected with `currentFrame` & `currentFrameIndex`. 21 | // 22 | @interface FLAnimatedImageView : UIImageView 23 | 24 | // Setting `[UIImageView.image]` to a non-`nil` value clears out existing `animatedImage`. 25 | // And vice versa, setting `animatedImage` will initially populate the `[UIImageView.image]` to its `posterImage` and then start animating and hold `currentFrame`. 26 | @property (nonatomic, strong) FLAnimatedImage *animatedImage; 27 | @property (nonatomic, copy) void(^loopCompletionBlock)(NSUInteger loopCountRemaining); 28 | 29 | @property (nonatomic, strong, readonly) UIImage *currentFrame; 30 | @property (nonatomic, assign, readonly) NSUInteger currentFrameIndex; 31 | 32 | // The animation runloop mode. Enables playback during scrolling by allowing timer events (i.e. animation) with NSRunLoopCommonModes. 33 | // To keep scrolling smooth on single-core devices such as iPhone 3GS/4 and iPod Touch 4th gen, the default run loop mode is NSDefaultRunLoopMode. Otherwise, the default is NSDefaultRunLoopMode. 34 | @property (nonatomic, copy) NSString *runLoopMode; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/FLAnimatedImage/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2016 Flipboard 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Pods/Locksmith/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 matthewpalmer 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/Locksmith/Source/Dictionary_Initializers.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public extension Dictionary { 4 | init(withoutOptionalValues initial: Dictionary) { 5 | self = [Key: Value]() 6 | for pair in initial { 7 | if pair.1 != nil { 8 | self[pair.0] = pair.1! 9 | } 10 | } 11 | } 12 | 13 | init(pairs: [(Key, Value)]) { 14 | self = [Key: Value]() 15 | pairs.forEach { (k, v) -> () in 16 | self[k] = v 17 | } 18 | } 19 | 20 | init(initial: Dictionary, toMerge: Dictionary) { 21 | self = Dictionary() 22 | 23 | for pair in initial { 24 | self[pair.0] = pair.1 25 | } 26 | 27 | for pair in toMerge { 28 | self[pair.0] = pair.1 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Pods/Locksmith/Source/Locksmith.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | FOUNDATION_EXPORT double LocksmithVersionNumber; 4 | FOUNDATION_EXPORT const unsigned char LocksmithVersionString[]; -------------------------------------------------------------------------------- /Pods/Locksmith/Source/LocksmithAccessibleOption.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // MARK: Accessible 4 | public enum LocksmithAccessibleOption: RawRepresentable { 5 | case whenUnlocked, afterFirstUnlock, always, whenUnlockedThisDeviceOnly, afterFirstUnlockThisDeviceOnly, alwaysThisDeviceOnly, whenPasscodeSetThisDeviceOnly 6 | 7 | public init?(rawValue: String) { 8 | switch rawValue { 9 | case String(kSecAttrAccessibleWhenUnlocked): 10 | self = .whenUnlocked 11 | case String(kSecAttrAccessibleAfterFirstUnlock): 12 | self = .afterFirstUnlock 13 | case String(kSecAttrAccessibleAlways): 14 | self = .always 15 | case String(kSecAttrAccessibleWhenUnlockedThisDeviceOnly): 16 | self = .whenUnlockedThisDeviceOnly 17 | case String(kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly): 18 | self = .afterFirstUnlockThisDeviceOnly 19 | case String(kSecAttrAccessibleAlwaysThisDeviceOnly): 20 | self = .alwaysThisDeviceOnly 21 | case String(kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly): 22 | self = .whenPasscodeSetThisDeviceOnly 23 | default: 24 | self = .whenUnlocked 25 | } 26 | } 27 | 28 | public var rawValue: String { 29 | switch self { 30 | case .whenUnlocked: 31 | return String(kSecAttrAccessibleWhenUnlocked) 32 | case .afterFirstUnlock: 33 | return String(kSecAttrAccessibleAfterFirstUnlock) 34 | case .always: 35 | return String(kSecAttrAccessibleAlways) 36 | case .whenPasscodeSetThisDeviceOnly: 37 | return String(kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly) 38 | case .whenUnlockedThisDeviceOnly: 39 | return String(kSecAttrAccessibleWhenUnlockedThisDeviceOnly) 40 | case .afterFirstUnlockThisDeviceOnly: 41 | return String(kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly) 42 | case .alwaysThisDeviceOnly: 43 | return String(kSecAttrAccessibleAlwaysThisDeviceOnly) 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Pods/Locksmith/Source/LocksmithError.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // MARK: Locksmith Error 4 | public enum LocksmithError: String, Error { 5 | case allocate = "Failed to allocate memory." 6 | case authFailed = "Authorization/Authentication failed." 7 | case decode = "Unable to decode the provided data." 8 | case duplicate = "The item already exists." 9 | case interactionNotAllowed = "Interaction with the Security Server is not allowed." 10 | case noError = "No error." 11 | case notAvailable = "No trust results are available." 12 | case notFound = "The item cannot be found." 13 | case param = "One or more parameters passed to the function were not valid." 14 | case requestNotSet = "The request was not set" 15 | case typeNotFound = "The type was not found" 16 | case unableToClear = "Unable to clear the keychain" 17 | case undefined = "An undefined error occurred" 18 | case unimplemented = "Function or operation not implemented." 19 | 20 | init?(fromStatusCode code: Int) { 21 | switch code { 22 | case Int(errSecAllocate): 23 | self = .allocate 24 | case Int(errSecAuthFailed): 25 | self = .authFailed 26 | case Int(errSecDecode): 27 | self = .decode 28 | case Int(errSecDuplicateItem): 29 | self = .duplicate 30 | case Int(errSecInteractionNotAllowed): 31 | self = .interactionNotAllowed 32 | case Int(errSecItemNotFound): 33 | self = .notFound 34 | case Int(errSecNotAvailable): 35 | self = .notAvailable 36 | case Int(errSecParam): 37 | self = .param 38 | case Int(errSecUnimplemented): 39 | self = .unimplemented 40 | default: 41 | return nil 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Pods/Locksmith/Source/LocksmithInternetAuthenticationType.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum LocksmithInternetAuthenticationType: RawRepresentable { 4 | case ntlm, msn, dpa, rpa, httpBasic, httpDigest, htmlForm, `default` 5 | 6 | public init?(rawValue: String) { 7 | switch rawValue { 8 | case String(kSecAttrAuthenticationTypeNTLM): 9 | self = .ntlm 10 | case String(kSecAttrAuthenticationTypeMSN): 11 | self = .msn 12 | case String(kSecAttrAuthenticationTypeDPA): 13 | self = .dpa 14 | case String(kSecAttrAuthenticationTypeRPA): 15 | self = .rpa 16 | case String(kSecAttrAuthenticationTypeHTTPBasic): 17 | self = .httpBasic 18 | case String(kSecAttrAuthenticationTypeHTTPDigest): 19 | self = .httpDigest 20 | case String(kSecAttrAuthenticationTypeHTMLForm): 21 | self = .htmlForm 22 | case String(kSecAttrAuthenticationTypeDefault): 23 | self = .default 24 | default: 25 | self = .default 26 | } 27 | } 28 | 29 | public var rawValue: String { 30 | switch self { 31 | case .ntlm: 32 | return String(kSecAttrAuthenticationTypeNTLM) 33 | case .msn: 34 | return String(kSecAttrAuthenticationTypeMSN) 35 | case .dpa: 36 | return String(kSecAttrAuthenticationTypeDPA) 37 | case .rpa: 38 | return String(kSecAttrAuthenticationTypeRPA) 39 | case .httpBasic: 40 | return String(kSecAttrAuthenticationTypeHTTPBasic) 41 | case .httpDigest: 42 | return String(kSecAttrAuthenticationTypeHTTPDigest) 43 | case .htmlForm: 44 | return String(kSecAttrAuthenticationTypeHTMLForm) 45 | case .default: 46 | return String(kSecAttrAuthenticationTypeDefault) 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Pods/Locksmith/Source/LocksmithSecurityClass.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // With thanks to http://iosdeveloperzone.com/2014/10/22/taming-foundation-constants-into-swift-enums/ 4 | // MARK: Security Class 5 | public enum LocksmithSecurityClass: RawRepresentable { 6 | case genericPassword, internetPassword, certificate, key, identity 7 | 8 | public init?(rawValue: String) { 9 | switch rawValue { 10 | case String(kSecClassGenericPassword): 11 | self = .genericPassword 12 | case String(kSecClassInternetPassword): 13 | self = .internetPassword 14 | case String(kSecClassCertificate): 15 | self = .certificate 16 | case String(kSecClassKey): 17 | self = .key 18 | case String(kSecClassIdentity): 19 | self = .identity 20 | default: 21 | self = .genericPassword 22 | } 23 | } 24 | 25 | public var rawValue: String { 26 | switch self { 27 | case .genericPassword: 28 | return String(kSecClassGenericPassword) 29 | case .internetPassword: 30 | return String(kSecClassInternetPassword) 31 | case .certificate: 32 | return String(kSecClassCertificate) 33 | case .key: 34 | return String(kSecClassKey) 35 | case .identity: 36 | return String(kSecClassIdentity) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (4.7.0) 3 | - BRYXBanner (0.8.0) 4 | - FLAnimatedImage (1.0.12) 5 | - Locksmith (4.0.0) 6 | - PINCache (2.3) 7 | - PINRemoteImage (2.1.4): 8 | - PINRemoteImage/FLAnimatedImage (= 2.1.4) 9 | - PINRemoteImage/Core (2.1.4): 10 | - PINCache (>= 2.1) 11 | - PINRemoteImage/FLAnimatedImage (2.1.4): 12 | - FLAnimatedImage (>= 1.0) 13 | - PINRemoteImage/Core 14 | - XLForm (4.0.0) 15 | 16 | DEPENDENCIES: 17 | - Alamofire (~> 4.7) 18 | - BRYXBanner (~> 0.8) 19 | - Locksmith (~> 4.0) 20 | - PINRemoteImage (~> 2.1) 21 | - XLForm (~> 4.0) 22 | 23 | SPEC REPOS: 24 | https://github.com/cocoapods/specs.git: 25 | - Alamofire 26 | - BRYXBanner 27 | - FLAnimatedImage 28 | - Locksmith 29 | - PINCache 30 | - PINRemoteImage 31 | - XLForm 32 | 33 | SPEC CHECKSUMS: 34 | Alamofire: 907e0a98eb68cdb7f9d1f541a563d6ac5dc77b25 35 | BRYXBanner: 406c3775789136531da6f3c98058be2f16e08a34 36 | FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31 37 | Locksmith: e9bebbaaa4cee3c511bc358a44f843c3fe00e21f 38 | PINCache: ce36ed282031b92fc7733ffe831f474ff80fddc2 39 | PINRemoteImage: 4ac4011c5caefd6befd99758e09becede05d3226 40 | XLForm: 04110197c12187dd28a6c7295d3d8b95f4fdb4de 41 | 42 | PODFILE CHECKSUM: cb13e47c4a78bbaa49b6c10d36a67e78c264eaae 43 | 44 | COCOAPODS: 1.5.3 45 | -------------------------------------------------------------------------------- /Pods/PINCache/PINCache/Nullability.h: -------------------------------------------------------------------------------- 1 | // PINCache is a modified version of TMCache 2 | // Modifications by Garrett Moon 3 | // Copyright (c) 2015 Pinterest. All rights reserved. 4 | 5 | #ifndef PINCache_nullability_h 6 | #define PINCache_nullability_h 7 | 8 | #if !__has_feature(nullability) 9 | #define NS_ASSUME_NONNULL_BEGIN 10 | #define NS_ASSUME_NONNULL_END 11 | #define nullable 12 | #define nonnull 13 | #define null_unspecified 14 | #define null_resettable 15 | #define __nullable 16 | #define __nonnull 17 | #define __null_unspecified 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Pods/PINCache/PINCache/PINCacheObjectSubscripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // PINCacheObjectSubscripting.h 3 | // PINCache 4 | // 5 | // Created by Rocir Marcos Leite Santiago on 4/2/16. 6 | // Copyright © 2016 Pinterest. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol PINCacheObjectSubscripting 12 | 13 | @required 14 | 15 | /** 16 | This method enables using literals on the receiving object, such as `id object = cache[@"key"];`. 17 | 18 | @param key The key associated with the object. 19 | @result The object for the specified key. 20 | */ 21 | - (id)objectForKeyedSubscript:(NSString *)key; 22 | 23 | /** 24 | This method enables using literals on the receiving object, such as `cache[@"key"] = object;`. 25 | 26 | @param object An object to be assigned for the key. 27 | @param key A key to associate with the object. This string will be copied. 28 | */ 29 | - (void)setObject:(id)obj forKeyedSubscript:(NSString *)key; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-2016 Pinterest, Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/Categories/NSData+ImageDetectors.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+ImageDetectors.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 11/19/14. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface NSData (PINImageDetectors) 12 | 13 | - (BOOL)pin_isGIF; 14 | #ifdef PIN_WEBP 15 | - (BOOL)pin_isWebP; 16 | #endif 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/Categories/NSData+ImageDetectors.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+ImageDetectors.m 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 11/19/14. 6 | // 7 | // 8 | 9 | #import "NSData+ImageDetectors.h" 10 | 11 | @implementation NSData (PINImageDetectors) 12 | 13 | - (BOOL)pin_isGIF 14 | { 15 | const NSInteger length = 3; 16 | Byte firstBytes[length]; 17 | if ([self length] >= length) { 18 | [self getBytes:&firstBytes length:length]; 19 | //G, I, F 20 | if (firstBytes[0] == 0x47 && firstBytes[1] == 0x49 && firstBytes[2] == 0x46) { 21 | return YES; 22 | } 23 | } 24 | return NO; 25 | } 26 | 27 | #ifdef PIN_WEBP 28 | - (BOOL)pin_isWebP 29 | { 30 | const NSInteger length = 12; 31 | Byte firstBytes[length]; 32 | if ([self length] >= length) { 33 | [self getBytes:&firstBytes length:length]; 34 | //R, I, F, F, -, -, -, -, W, E, B, P 35 | if (firstBytes[0] == 0x52 && firstBytes[1] == 0x49 && firstBytes[2] == 0x46 && firstBytes[3] == 0x46 && firstBytes[8] == 0x57 && firstBytes[9] == 0x45 && firstBytes[10] == 0x42 && firstBytes[11] == 0x50) { 36 | return YES; 37 | } 38 | } 39 | return NO; 40 | } 41 | #endif 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/Categories/PINImage+DecodedImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+DecodedImage.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 11/19/14. 6 | // 7 | // 8 | 9 | #import 10 | 11 | #if PIN_TARGET_IOS 12 | #import 13 | #elif PIN_TARGET_MAC 14 | #import 15 | #endif 16 | 17 | #import "PINRemoteImageMacros.h" 18 | 19 | #if !PIN_TARGET_IOS 20 | @interface NSImage (PINiOSMapping) 21 | 22 | @property(nonatomic, readonly, nullable) CGImageRef CGImage; 23 | 24 | + (nullable NSImage *)imageWithData:(nonnull NSData *)imageData; 25 | + (nullable NSImage *)imageWithContentsOfFile:(nonnull NSString *)path; 26 | + (nonnull NSImage *)imageWithCGImage:(nonnull CGImageRef)imageRef; 27 | 28 | @end 29 | #endif 30 | 31 | NSData * __nullable PINImageJPEGRepresentation(PINImage * __nonnull image, CGFloat compressionQuality); 32 | NSData * __nullable PINImagePNGRepresentation(PINImage * __nonnull image); 33 | 34 | @interface PINImage (PINDecodedImage) 35 | 36 | + (nullable PINImage *)pin_decodedImageWithData:(nonnull NSData *)data; 37 | + (nullable PINImage *)pin_decodedImageWithData:(nonnull NSData *)data skipDecodeIfPossible:(BOOL)skipDecodeIfPossible; 38 | + (nullable PINImage *)pin_decodedImageWithCGImageRef:(nonnull CGImageRef)imageRef; 39 | #if PIN_TARGET_IOS 40 | + (nullable PINImage *)pin_decodedImageWithCGImageRef:(nonnull CGImageRef)imageRef orientation:(UIImageOrientation) orientation; 41 | #endif 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/Categories/PINImage+WebP.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+WebP.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 11/18/14. 6 | // 7 | // 8 | 9 | #ifdef PIN_WEBP 10 | 11 | #if PIN_TARGET_IOS 12 | #import 13 | #elif PIN_TARGET_MAC 14 | #import 15 | #endif 16 | 17 | #import "PINRemoteImageMacros.h" 18 | 19 | @interface PINImage (PINWebP) 20 | 21 | + (PINImage *)pin_imageWithWebPData:(NSData *)webPData; 22 | 23 | @end 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/Categories/PINImage+WebP.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+WebP.m 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 11/18/14. 6 | // 7 | // 8 | 9 | #import "PINImage+WebP.h" 10 | 11 | #ifdef PIN_WEBP 12 | #if !COCOAPODS 13 | #import "webp/decode.h" 14 | #else 15 | #import "libwebp/webp/decode.h" 16 | #endif 17 | 18 | static void releaseData(void *info, const void *data, size_t size) 19 | { 20 | free((void *)data); 21 | } 22 | 23 | @implementation PINImage (PINWebP) 24 | 25 | + (PINImage *)pin_imageWithWebPData:(NSData *)webPData 26 | { 27 | WebPBitstreamFeatures features; 28 | if (WebPGetFeatures([webPData bytes], [webPData length], &features) == VP8_STATUS_OK) { 29 | // Decode the WebP image data into a RGBA value array 30 | int height, width; 31 | uint8_t *data = NULL; 32 | int pixelLength = 0; 33 | 34 | if (features.has_alpha) { 35 | data = WebPDecodeRGBA([webPData bytes], [webPData length], &width, &height); 36 | pixelLength = 4; 37 | } else { 38 | data = WebPDecodeRGB([webPData bytes], [webPData length], &width, &height); 39 | pixelLength = 3; 40 | } 41 | 42 | if (data) { 43 | CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, data, width * height * pixelLength, releaseData); 44 | 45 | CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB(); 46 | CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault; 47 | 48 | if (features.has_alpha) { 49 | bitmapInfo |= kCGImageAlphaLast; 50 | } else { 51 | bitmapInfo |= kCGImageAlphaNone; 52 | } 53 | 54 | CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault; 55 | CGImageRef imageRef = CGImageCreate(width, 56 | height, 57 | 8, 58 | 8 * pixelLength, 59 | pixelLength * width, 60 | colorSpaceRef, 61 | bitmapInfo, 62 | provider, 63 | NULL, 64 | NO, 65 | renderingIntent); 66 | 67 | PINImage *image = nil; 68 | #if PIN_TARGET_IOS 69 | image = [UIImage imageWithCGImage:imageRef]; 70 | #elif PIN_TARGET_MAC 71 | image = [[self alloc] initWithCGImage:imageRef size:CGSizeZero]; 72 | #endif 73 | 74 | CGImageRelease(imageRef); 75 | CGColorSpaceRelease(colorSpaceRef); 76 | CGDataProviderRelease(provider); 77 | 78 | return image; 79 | } 80 | } 81 | return nil; 82 | } 83 | 84 | @end 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/Image Categories/FLAnimatedImageView+PINRemoteImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // FLAnimatedImageView+PINRemoteImage.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 8/17/14. 6 | // 7 | // 8 | 9 | #import "PINRemoteImageMacros.h" 10 | #if USE_FLANIMATED_IMAGE 11 | #import 12 | 13 | #import "PINRemoteImageCategoryManager.h" 14 | 15 | @interface FLAnimatedImageView (PINRemoteImage) 16 | 17 | @end 18 | 19 | #endif -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/Image Categories/PINButton+PINRemoteImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+PINRemoteImage.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 8/18/14. 6 | // 7 | // 8 | 9 | #if PIN_TARGET_IOS 10 | #import 11 | #elif PIN_TARGET_MAC 12 | #import 13 | #endif 14 | 15 | #import "PINRemoteImageManager.h" 16 | #import "PINRemoteImageCategoryManager.h" 17 | 18 | @interface PINButton (PINRemoteImage) 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/Image Categories/PINImageView+PINRemoteImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+PINRemoteImage.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 8/17/14. 6 | // 7 | // 8 | 9 | #if PIN_TARGET_IOS 10 | #import 11 | #elif PIN_TARGET_MAC 12 | #import 13 | #endif 14 | 15 | #import "PINRemoteImageManager.h" 16 | #import "PINRemoteImageCategoryManager.h" 17 | 18 | @interface PINImageView (PINRemoteImage) 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/PINDataTaskOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // PINDataTaskOperation.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 3/12/15. 6 | // 7 | // 8 | 9 | #import 10 | 11 | #import "PINURLSessionManager.h" 12 | 13 | @interface PINDataTaskOperation : NSOperation 14 | 15 | @property (nonatomic, readonly, nullable) NSURLSessionDataTask *dataTask; 16 | 17 | + (nonnull instancetype)dataTaskOperationWithSessionManager:(nonnull PINURLSessionManager *)sessionManager 18 | request:(nonnull NSURLRequest *)request 19 | completionHandler:(nonnull void (^)(NSURLResponse * _Nonnull response, NSError * _Nullable error))completionHandler; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/PINProgressiveImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // PINProgressiveImage.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 2/9/15. 6 | // 7 | // 8 | 9 | #import 10 | 11 | #if PIN_TARGET_IOS 12 | #import 13 | #elif PIN_TARGET_MAC 14 | #import 15 | #endif 16 | 17 | #import "PINRemoteImageMacros.h" 18 | 19 | /** An object which store the data of a downloading image and vends progressive scans **/ 20 | @interface PINProgressiveImage : NSObject 21 | 22 | @property (atomic, copy, nonnull) NSArray *progressThresholds; 23 | @property (atomic, assign) CFTimeInterval estimatedRemainingTimeThreshold; 24 | @property (atomic, assign) CFTimeInterval startTime; 25 | 26 | - (void)updateProgressiveImageWithData:(nonnull NSData *)data expectedNumberOfBytes:(int64_t)expectedNumberOfBytes; 27 | 28 | /** 29 | Returns the latest image based on thresholds, returns nil if no new image is generated 30 | 31 | @param blurred A boolean to indicate if the image should be blurred 32 | @param maxProgressiveRenderSize the maximum dimensions at which to apply a blur. If an image exceeds either the height 33 | or width of this dimension, the image will *not* be blurred regardless of the blurred parameter. 34 | @param renderedImageQuality Value between 0 and 1. Computed by dividing the received number of bytes by the expected number of bytes 35 | @return PINImage a progressive scan of the image or nil if a new one has not been generated 36 | */ 37 | - (nullable PINImage *)currentImageBlurred:(BOOL)blurred maxProgressiveRenderSize:(CGSize)maxProgressiveRenderSize renderedImageQuality:(nonnull out CGFloat *)renderedImageQuality; 38 | 39 | /** 40 | Returns the current data for the image. 41 | 42 | @return NSData the current data for the image 43 | */ 44 | - (nullable NSData *)data; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/PINRemoteImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // PINRemoteImage.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 8/17/14. 6 | // 7 | // 8 | 9 | #ifndef Pods_PINRemoteImage_h 10 | #define Pods_PINRemoteImage_h 11 | 12 | #import "PINRemoteImageMacros.h" 13 | 14 | #import "PINRemoteImageManager.h" 15 | #import "PINRemoteImageCategoryManager.h" 16 | #import "PINRemoteImageManagerResult.h" 17 | #import "PINProgressiveImage.h" 18 | #import "PINURLSessionManager.h" 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/PINRemoteImageCallbacks.h: -------------------------------------------------------------------------------- 1 | // 2 | // PINRemoteImageCallbacks.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 3/9/15. 6 | // 7 | // 8 | 9 | #import 10 | 11 | #import "PINRemoteImageManager.h" 12 | 13 | @interface PINRemoteImageCallbacks : NSObject 14 | 15 | @property (nonatomic, strong, nullable) PINRemoteImageManagerImageCompletion completionBlock; 16 | @property (nonatomic, strong, nullable) PINRemoteImageManagerImageCompletion progressImageBlock; 17 | @property (nonatomic, strong, nullable) PINRemoteImageManagerProgressDownload progressDownloadBlock; 18 | @property (nonatomic, assign) CFTimeInterval requestTime; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/PINRemoteImageCallbacks.m: -------------------------------------------------------------------------------- 1 | // 2 | // PINRemoteImageCallbacks.m 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 3/9/15. 6 | // 7 | // 8 | 9 | #import "PINRemoteImageCallbacks.h" 10 | 11 | @implementation PINRemoteImageCallbacks 12 | 13 | - (void)setCompletionBlock:(PINRemoteImageManagerImageCompletion)completionBlock 14 | { 15 | _completionBlock = [completionBlock copy]; 16 | self.requestTime = CACurrentMediaTime(); 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/PINRemoteImageDownloadTask.h: -------------------------------------------------------------------------------- 1 | // 2 | // PINRemoteImageDownloadTask.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 3/9/15. 6 | // 7 | // 8 | 9 | #import "PINRemoteImageTask.h" 10 | #import "PINProgressiveImage.h" 11 | #import "PINDataTaskOperation.h" 12 | 13 | @interface PINRemoteImageDownloadTask : PINRemoteImageTask 14 | 15 | @property (nonatomic, strong, nullable) PINDataTaskOperation *urlSessionTaskOperation; 16 | @property (nonatomic, assign) CFTimeInterval sessionTaskStartTime; 17 | @property (nonatomic, assign) CFTimeInterval sessionTaskEndTime; 18 | @property (nonatomic, assign) BOOL hasProgressBlocks; 19 | @property (nonatomic, strong, nullable) PINProgressiveImage *progressImage; 20 | 21 | - (void)callProgressDownloadWithQueue:(nonnull dispatch_queue_t)queue completedBytes:(int64_t)completedBytes totalBytes:(int64_t)totalBytes; 22 | - (void)callProgressImageWithQueue:(nonnull dispatch_queue_t)queue withImage:(nonnull PINImage *)image renderedImageQuality:(CGFloat)renderedImageQuality; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/PINRemoteImageMacros.h: -------------------------------------------------------------------------------- 1 | // 2 | // PINRemoteImageMacros.h 3 | // PINRemoteImage 4 | // 5 | 6 | #import 7 | 8 | #ifndef PINRemoteImageMacros_h 9 | #define PINRemoteImageMacros_h 10 | 11 | #define PIN_TARGET_IOS (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR || TARGET_OS_TV) 12 | #define PIN_TARGET_MAC (TARGET_OS_MAC) 13 | 14 | #define PINRemoteImageLogging 0 15 | #if PINRemoteImageLogging 16 | #define PINLog(args...) NSLog(args) 17 | #else 18 | #define PINLog(args...) 19 | #endif 20 | 21 | #if __has_include() 22 | #define USE_FLANIMATED_IMAGE 1 23 | #else 24 | #define USE_FLANIMATED_IMAGE 0 25 | #define FLAnimatedImage NSObject 26 | #endif 27 | 28 | #if PIN_TARGET_IOS 29 | #define PINImage UIImage 30 | #define PINImageView UIImageView 31 | #define PINButton UIButton 32 | #elif PIN_TARGET_MAC 33 | #define PINImage NSImage 34 | #define PINImageView NSImageView 35 | #define PINButton NSButton 36 | #endif 37 | 38 | #define BlockAssert(condition, desc, ...) \ 39 | do { \ 40 | __PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \ 41 | if (!(condition)) { \ 42 | [[NSAssertionHandler currentHandler] handleFailureInMethod:_cmd \ 43 | object:strongSelf file:[NSString stringWithUTF8String:__FILE__] \ 44 | lineNumber:__LINE__ description:(desc), ##__VA_ARGS__]; \ 45 | } \ 46 | __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS \ 47 | } while(0); 48 | 49 | #endif /* PINRemoteImageMacros_h */ 50 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/PINRemoteImageManagerResult.h: -------------------------------------------------------------------------------- 1 | // 2 | // PINRemoteImageManagerResult.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 3/9/15. 6 | // 7 | // 8 | 9 | #import 10 | 11 | #if PIN_TARGET_IOS 12 | #import 13 | #elif PIN_TARGET_MAC 14 | #import 15 | #endif 16 | 17 | #import "PINRemoteImageMacros.h" 18 | #if USE_FLANIMATED_IMAGE 19 | #import 20 | #endif 21 | 22 | /** How the image was fetched. */ 23 | typedef NS_ENUM(NSUInteger, PINRemoteImageResultType) { 24 | /** Returned if no image is returned */ 25 | PINRemoteImageResultTypeNone = 0, 26 | /** Image was fetched from the memory cache */ 27 | PINRemoteImageResultTypeMemoryCache, 28 | /** Image was fetched from the disk cache */ 29 | PINRemoteImageResultTypeCache, 30 | /** Image was downloaded */ 31 | PINRemoteImageResultTypeDownload, 32 | /** Image is progress */ 33 | PINRemoteImageResultTypeProgress, 34 | }; 35 | 36 | @interface PINRemoteImageManagerResult : NSObject 37 | 38 | @property (nonatomic, readonly, strong, nullable) PINImage *image; 39 | @property (nonatomic, readonly, strong, nullable) FLAnimatedImage *animatedImage; 40 | @property (nonatomic, readonly, assign) NSTimeInterval requestDuration; 41 | @property (nonatomic, readonly, strong, nullable) NSError *error; 42 | @property (nonatomic, readonly, assign) PINRemoteImageResultType resultType; 43 | @property (nonatomic, readonly, strong, nullable) NSUUID *UUID; 44 | @property (nonatomic, readonly, assign) CGFloat renderedImageQuality; 45 | 46 | + (nonnull instancetype)imageResultWithImage:(nullable PINImage *)image 47 | animatedImage:(nullable FLAnimatedImage *)animatedImage 48 | requestLength:(NSTimeInterval)requestLength 49 | error:(nullable NSError *)error 50 | resultType:(PINRemoteImageResultType)resultType 51 | UUID:(nullable NSUUID *)uuid; 52 | 53 | + (nonnull instancetype)imageResultWithImage:(nullable PINImage *)image 54 | animatedImage:(nullable FLAnimatedImage *)animatedImage 55 | requestLength:(NSTimeInterval)requestLength 56 | error:(nullable NSError *)error 57 | resultType:(PINRemoteImageResultType)resultType 58 | UUID:(nullable NSUUID *)uuid 59 | renderedImageQuality:(CGFloat)renderedImageQuality; 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/PINRemoteImageProcessorTask.h: -------------------------------------------------------------------------------- 1 | // 2 | // PINRemoteImageProcessorTask.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 3/9/15. 6 | // 7 | // 8 | 9 | #import "PINRemoteImageTask.h" 10 | 11 | @interface PINRemoteImageProcessorTask : PINRemoteImageTask 12 | 13 | @property (nonatomic, strong, nullable) NSUUID *downloadTaskUUID; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/PINRemoteImageProcessorTask.m: -------------------------------------------------------------------------------- 1 | // 2 | // PINRemoteImageProcessorTask.m 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 3/9/15. 6 | // 7 | // 8 | 9 | #import "PINRemoteImageProcessorTask.h" 10 | 11 | @implementation PINRemoteImageProcessorTask 12 | 13 | - (BOOL)cancelWithUUID:(NSUUID *)UUID manager:(PINRemoteImageManager *)manager 14 | { 15 | BOOL noMoreCompletions = [super cancelWithUUID:UUID manager:manager]; 16 | if (noMoreCompletions && self.downloadTaskUUID) { 17 | [manager cancelTaskWithUUID:self.downloadTaskUUID]; 18 | _downloadTaskUUID = nil; 19 | } 20 | return noMoreCompletions; 21 | } 22 | 23 | - (void)setDownloadTaskUUID:(NSUUID *)downloadTaskUUID 24 | { 25 | NSAssert(_downloadTaskUUID == nil, @"downloadTaskUUID should be nil"); 26 | _downloadTaskUUID = downloadTaskUUID; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/PINRemoteImageTask.h: -------------------------------------------------------------------------------- 1 | // 2 | // PINRemoteImageTask.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 3/9/15. 6 | // 7 | // 8 | 9 | #import 10 | 11 | #import "PINRemoteImageManager.h" 12 | #import "PINRemoteImageMacros.h" 13 | 14 | @interface PINRemoteImageTask : NSObject 15 | 16 | @property (nonatomic, strong, nonnull) NSMutableDictionary *callbackBlocks; 17 | #if PINRemoteImageLogging 18 | @property (nonatomic, copy, nullable) NSString *key; 19 | #endif 20 | 21 | - (void)addCallbacksWithCompletionBlock:(nonnull PINRemoteImageManagerImageCompletion)completionBlock 22 | progressImageBlock:(nullable PINRemoteImageManagerImageCompletion)progressImageBlock 23 | progressDownloadBlock:(nullable PINRemoteImageManagerProgressDownload)progressDownloadBlock 24 | withUUID:(nonnull NSUUID *)UUID; 25 | - (void)removeCallbackWithUUID:(nonnull NSUUID *)UUID; 26 | - (void)callCompletionsWithQueue:(nonnull dispatch_queue_t)queue remove:(BOOL)remove withImage:(nullable PINImage *)image animatedImage:(nullable FLAnimatedImage *)animatedImage cached:(BOOL)cached error:(nullable NSError *)error; 27 | //returns YES if no more attached completionBlocks 28 | - (BOOL)cancelWithUUID:(nonnull NSUUID *)UUID manager:(nullable PINRemoteImageManager *)manager; 29 | - (void)setPriority:(PINRemoteImageManagerPriority)priority; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/PINRemoteLock.h: -------------------------------------------------------------------------------- 1 | // 2 | // PINRemoteLock.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 3/17/16. 6 | // 7 | // 8 | 9 | #import 10 | 11 | /** The type of lock, either recursive or non-recursive */ 12 | typedef NS_ENUM(NSUInteger, PINRemoteLockType) { 13 | /** A non-recursive version of the lock. The default. */ 14 | PINRemoteLockTypeNonRecursive = 0, 15 | /** A recursive version of the lock. More expensive. */ 16 | PINRemoteLockTypeRecursive, 17 | }; 18 | 19 | @interface PINRemoteLock : NSObject 20 | 21 | - (instancetype)initWithName:(NSString *)lockName lockType:(PINRemoteLockType)lockType NS_DESIGNATED_INITIALIZER; 22 | - (instancetype)initWithName:(NSString *)lockName; 23 | - (void)lockWithBlock:(dispatch_block_t)block; 24 | 25 | - (void)lock; 26 | - (void)unlock; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/PINRemoteLock.m: -------------------------------------------------------------------------------- 1 | // 2 | // PINRemoteLock.m 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 3/17/16. 6 | // 7 | // 8 | 9 | #import "PINRemoteLock.h" 10 | 11 | #import 12 | 13 | #if !defined(PINREMOTELOCK_DEBUG) && defined(DEBUG) 14 | #define PINREMOTELOCK_DEBUG DEBUG 15 | #endif 16 | 17 | @interface PINRemoteLock () 18 | { 19 | #if PINREMOTELOCK_DEBUG 20 | NSLock *_lock; 21 | NSRecursiveLock *_recursiveLock; 22 | #else 23 | pthread_mutex_t _lock; 24 | #endif 25 | } 26 | 27 | @end 28 | 29 | @implementation PINRemoteLock 30 | 31 | - (instancetype)init 32 | { 33 | return [self initWithName:nil]; 34 | } 35 | 36 | - (instancetype)initWithName:(NSString *)lockName lockType:(PINRemoteLockType)lockType 37 | { 38 | if (self = [super init]) { 39 | #if PINREMOTELOCK_DEBUG 40 | if (lockType == PINRemoteLockTypeNonRecursive) { 41 | _lock = [[NSLock alloc] init]; 42 | } else { 43 | _recursiveLock = [[NSRecursiveLock alloc] init]; 44 | } 45 | 46 | if (lockName) { 47 | [_lock setName:lockName]; 48 | [_recursiveLock setName:lockName]; 49 | } 50 | #else 51 | pthread_mutexattr_t attr; 52 | 53 | pthread_mutexattr_init(&attr); 54 | if (lockType == PINRemoteLockTypeRecursive) { 55 | pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); 56 | } 57 | pthread_mutex_init(&_lock, &attr); 58 | #endif 59 | } 60 | return self; 61 | } 62 | 63 | - (instancetype)initWithName:(NSString *)lockName 64 | { 65 | return [self initWithName:lockName lockType:PINRemoteLockTypeNonRecursive]; 66 | } 67 | 68 | #if ! PINREMOTELOCK_DEBUG 69 | - (void)dealloc 70 | { 71 | pthread_mutex_destroy(&_lock); 72 | } 73 | #endif 74 | 75 | - (void)lockWithBlock:(dispatch_block_t)block 76 | { 77 | #if PINREMOTELOCK_DEBUG 78 | [_lock lock]; 79 | [_recursiveLock lock]; 80 | #else 81 | pthread_mutex_lock(&_lock); 82 | #endif 83 | block(); 84 | #if PINREMOTELOCK_DEBUG 85 | [_lock unlock]; 86 | [_recursiveLock unlock]; 87 | #else 88 | pthread_mutex_unlock(&_lock); 89 | #endif 90 | } 91 | 92 | - (void)lock 93 | { 94 | #if PINREMOTELOCK_DEBUG 95 | [_lock lock]; 96 | [_recursiveLock lock]; 97 | #else 98 | pthread_mutex_lock(&_lock); 99 | #endif 100 | } 101 | 102 | - (void)unlock 103 | { 104 | #if PINREMOTELOCK_DEBUG 105 | [_lock unlock]; 106 | [_recursiveLock unlock]; 107 | #else 108 | pthread_mutex_unlock(&_lock); 109 | #endif 110 | } 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /Pods/PINRemoteImage/Pod/Classes/PINURLSessionManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // PINURLSessionManager.h 3 | // Pods 4 | // 5 | // Created by Garrett Moon on 6/26/15. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @protocol PINURLSessionManagerDelegate 12 | 13 | @required 14 | - (void)didReceiveData:(nonnull NSData *)data forTask:(nonnull NSURLSessionTask *)task; 15 | - (void)didCompleteTask:(nonnull NSURLSessionTask *)task withError:(nullable NSError *)error; 16 | 17 | @optional 18 | - (void)didReceiveAuthenticationChallenge:(nonnull NSURLAuthenticationChallenge *)challenge forTask:(nullable NSURLSessionTask *)task completionHandler:(nonnull void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler; 19 | 20 | 21 | @end 22 | 23 | @interface PINURLSessionManager : NSObject 24 | 25 | - (nonnull instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)configuration; 26 | 27 | - (nonnull NSURLSessionDataTask *)dataTaskWithRequest:(nonnull NSURLRequest *)request completionHandler:(nullable void (^)(NSURLResponse * _Nonnull response, NSError * _Nullable error))completionHandler; 28 | 29 | - (void)invalidateSessionAndCancelTasks; 30 | 31 | @property (atomic, weak, nullable) id delegate; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Alamofire : NSObject 3 | @end 4 | @implementation PodsDummy_Alamofire 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double AlamofireVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.modulemap: -------------------------------------------------------------------------------- 1 | framework module Alamofire { 2 | umbrella header "Alamofire-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Alamofire 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.7.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/BRYXBanner/BRYXBanner-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_BRYXBanner : NSObject 3 | @end 4 | @implementation PodsDummy_BRYXBanner 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/BRYXBanner/BRYXBanner-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/BRYXBanner/BRYXBanner-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double BRYXBannerVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char BRYXBannerVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/BRYXBanner/BRYXBanner.modulemap: -------------------------------------------------------------------------------- 1 | framework module BRYXBanner { 2 | umbrella header "BRYXBanner-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/BRYXBanner/BRYXBanner.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/BRYXBanner 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/BRYXBanner 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/BRYXBanner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.8.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/FLAnimatedImage/FLAnimatedImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_FLAnimatedImage : NSObject 3 | @end 4 | @implementation PodsDummy_FLAnimatedImage 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/FLAnimatedImage/FLAnimatedImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/FLAnimatedImage/FLAnimatedImage-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "FLAnimatedImage.h" 14 | #import "FLAnimatedImageView.h" 15 | 16 | FOUNDATION_EXPORT double FLAnimatedImageVersionNumber; 17 | FOUNDATION_EXPORT const unsigned char FLAnimatedImageVersionString[]; 18 | 19 | -------------------------------------------------------------------------------- /Pods/Target Support Files/FLAnimatedImage/FLAnimatedImage.modulemap: -------------------------------------------------------------------------------- 1 | framework module FLAnimatedImage { 2 | umbrella header "FLAnimatedImage-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/FLAnimatedImage/FLAnimatedImage.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FLAnimatedImage 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "ImageIO" -framework "MobileCoreServices" -framework "QuartzCore" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/FLAnimatedImage 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/FLAnimatedImage/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.12 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Locksmith/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Locksmith/Locksmith-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Locksmith : NSObject 3 | @end 4 | @implementation PodsDummy_Locksmith 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Locksmith/Locksmith-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Locksmith/Locksmith-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "Locksmith.h" 14 | 15 | FOUNDATION_EXPORT double LocksmithVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char LocksmithVersionString[]; 17 | 18 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Locksmith/Locksmith.modulemap: -------------------------------------------------------------------------------- 1 | framework module Locksmith { 2 | umbrella header "Locksmith-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Locksmith/Locksmith.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Locksmith 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = -framework "Foundation" -framework "Security" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Locksmith 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/PINCache/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.3.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/PINCache/PINCache-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_PINCache : NSObject 3 | @end 4 | @implementation PodsDummy_PINCache 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/PINCache/PINCache-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #ifndef TARGET_OS_WATCH 14 | #define TARGET_OS_WATCH 0 15 | #endif 16 | -------------------------------------------------------------------------------- /Pods/Target Support Files/PINCache/PINCache-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "Nullability.h" 14 | #import "PINCache.h" 15 | #import "PINCacheObjectSubscripting.h" 16 | #import "PINDiskCache.h" 17 | #import "PINMemoryCache.h" 18 | 19 | FOUNDATION_EXPORT double PINCacheVersionNumber; 20 | FOUNDATION_EXPORT const unsigned char PINCacheVersionString[]; 21 | 22 | -------------------------------------------------------------------------------- /Pods/Target Support Files/PINCache/PINCache.modulemap: -------------------------------------------------------------------------------- 1 | framework module PINCache { 2 | umbrella header "PINCache-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/PINCache/PINCache.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/PINCache 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = -framework "Foundation" -weak_framework "UIKit" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/PINCache 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/PINRemoteImage/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.1.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/PINRemoteImage/PINRemoteImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_PINRemoteImage : NSObject 3 | @end 4 | @implementation PodsDummy_PINRemoteImage 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/PINRemoteImage/PINRemoteImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/PINRemoteImage/PINRemoteImage-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "NSData+ImageDetectors.h" 14 | #import "PINImage+DecodedImage.h" 15 | #import "PINImage+WebP.h" 16 | #import "PINButton+PINRemoteImage.h" 17 | #import "PINImageView+PINRemoteImage.h" 18 | #import "PINDataTaskOperation.h" 19 | #import "PINProgressiveImage.h" 20 | #import "PINRemoteImage.h" 21 | #import "PINRemoteImageCallbacks.h" 22 | #import "PINRemoteImageCategoryManager.h" 23 | #import "PINRemoteImageDownloadTask.h" 24 | #import "PINRemoteImageMacros.h" 25 | #import "PINRemoteImageManager.h" 26 | #import "PINRemoteImageManagerResult.h" 27 | #import "PINRemoteImageProcessorTask.h" 28 | #import "PINRemoteImageTask.h" 29 | #import "PINRemoteLock.h" 30 | #import "PINURLSessionManager.h" 31 | #import "FLAnimatedImageView+PINRemoteImage.h" 32 | 33 | FOUNDATION_EXPORT double PINRemoteImageVersionNumber; 34 | FOUNDATION_EXPORT const unsigned char PINRemoteImageVersionString[]; 35 | 36 | -------------------------------------------------------------------------------- /Pods/Target Support Files/PINRemoteImage/PINRemoteImage.modulemap: -------------------------------------------------------------------------------- 1 | framework module PINRemoteImage { 2 | umbrella header "PINRemoteImage-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/PINRemoteImage/PINRemoteImage.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/PINRemoteImage 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FLAnimatedImage" "${PODS_CONFIGURATION_BUILD_DIR}/PINCache" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = -framework "Accelerate" -framework "ImageIO" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/PINRemoteImage 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-grokSwiftREST/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-grokSwiftREST/Pods-grokSwiftREST-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_grokSwiftREST : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_grokSwiftREST 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-grokSwiftREST/Pods-grokSwiftREST-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_grokSwiftRESTVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_grokSwiftRESTVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-grokSwiftREST/Pods-grokSwiftREST.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/BRYXBanner" "${PODS_CONFIGURATION_BUILD_DIR}/FLAnimatedImage" "${PODS_CONFIGURATION_BUILD_DIR}/Locksmith" "${PODS_CONFIGURATION_BUILD_DIR}/PINCache" "${PODS_CONFIGURATION_BUILD_DIR}/PINRemoteImage" "${PODS_CONFIGURATION_BUILD_DIR}/XLForm" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/BRYXBanner/BRYXBanner.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FLAnimatedImage/FLAnimatedImage.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Locksmith/Locksmith.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PINCache/PINCache.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PINRemoteImage/PINRemoteImage.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/XLForm/XLForm.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "BRYXBanner" -framework "FLAnimatedImage" -framework "Locksmith" -framework "PINCache" -framework "PINRemoteImage" -framework "XLForm" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-grokSwiftREST/Pods-grokSwiftREST.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_grokSwiftREST { 2 | umbrella header "Pods-grokSwiftREST-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-grokSwiftREST/Pods-grokSwiftREST.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/BRYXBanner" "${PODS_CONFIGURATION_BUILD_DIR}/FLAnimatedImage" "${PODS_CONFIGURATION_BUILD_DIR}/Locksmith" "${PODS_CONFIGURATION_BUILD_DIR}/PINCache" "${PODS_CONFIGURATION_BUILD_DIR}/PINRemoteImage" "${PODS_CONFIGURATION_BUILD_DIR}/XLForm" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/BRYXBanner/BRYXBanner.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FLAnimatedImage/FLAnimatedImage.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Locksmith/Locksmith.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PINCache/PINCache.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PINRemoteImage/PINRemoteImage.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/XLForm/XLForm.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "BRYXBanner" -framework "FLAnimatedImage" -framework "Locksmith" -framework "PINCache" -framework "PINRemoteImage" -framework "XLForm" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/XLForm/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/XLForm/XLForm-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_XLForm : NSObject 3 | @end 4 | @implementation PodsDummy_XLForm 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/XLForm/XLForm-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/XLForm/XLForm-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "XLFormBaseCell.h" 14 | #import "XLFormButtonCell.h" 15 | #import "XLFormCheckCell.h" 16 | #import "XLFormDateCell.h" 17 | #import "XLFormDatePickerCell.h" 18 | #import "XLFormDescriptorCell.h" 19 | #import "XLFormImageCell.h" 20 | #import "XLFormInlineRowDescriptorCell.h" 21 | #import "XLFormInlineSelectorCell.h" 22 | #import "XLFormLeftRightSelectorCell.h" 23 | #import "XLFormPickerCell.h" 24 | #import "XLFormSegmentedCell.h" 25 | #import "XLFormSelectorCell.h" 26 | #import "XLFormSliderCell.h" 27 | #import "XLFormStepCounterCell.h" 28 | #import "XLFormSwitchCell.h" 29 | #import "XLFormTextFieldCell.h" 30 | #import "XLFormTextViewCell.h" 31 | #import "XLFormOptionsObject.h" 32 | #import "XLFormOptionsViewController.h" 33 | #import "XLFormRowDescriptorViewController.h" 34 | #import "XLFormViewController.h" 35 | #import "XLFormDescriptor.h" 36 | #import "XLFormDescriptorDelegate.h" 37 | #import "XLFormRowDescriptor.h" 38 | #import "XLFormSectionDescriptor.h" 39 | #import "NSArray+XLFormAdditions.h" 40 | #import "NSExpression+XLFormAdditions.h" 41 | #import "NSObject+XLFormAdditions.h" 42 | #import "NSPredicate+XLFormAdditions.h" 43 | #import "NSString+XLFormAdditions.h" 44 | #import "UIView+XLFormAdditions.h" 45 | #import "XLFormRightDetailCell.h" 46 | #import "XLFormRightImageButton.h" 47 | #import "XLFormRowNavigationAccessoryView.h" 48 | #import "XLFormTextView.h" 49 | #import "XLFormRegexValidator.h" 50 | #import "XLFormValidationStatus.h" 51 | #import "XLFormValidator.h" 52 | #import "XLFormValidatorProtocol.h" 53 | #import "XLForm.h" 54 | 55 | FOUNDATION_EXPORT double XLFormVersionNumber; 56 | FOUNDATION_EXPORT const unsigned char XLFormVersionString[]; 57 | 58 | -------------------------------------------------------------------------------- /Pods/Target Support Files/XLForm/XLForm.modulemap: -------------------------------------------------------------------------------- 1 | framework module XLForm { 2 | umbrella header "XLForm-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/XLForm/XLForm.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/XLForm 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "Foundation" -framework "UIKit" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/XLForm 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/XLForm/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormBaseCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormBaseCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormDescriptorCell.h" 27 | #import "XLFormViewController.h" 28 | #import 29 | 30 | @class XLFormViewController; 31 | @class XLFormRowDescriptor; 32 | 33 | 34 | @interface XLFormBaseCell : UITableViewCell 35 | 36 | @property (nonatomic, weak) XLFormRowDescriptor * rowDescriptor; 37 | 38 | -(XLFormViewController *)formViewController; 39 | 40 | @end 41 | 42 | 43 | @protocol XLFormReturnKeyProtocol 44 | 45 | @property UIReturnKeyType returnKeyType; 46 | @property UIReturnKeyType nextReturnKeyType; 47 | 48 | @end 49 | 50 | 51 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormBaseCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormBaseCell.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormBaseCell.h" 27 | 28 | @implementation XLFormBaseCell 29 | 30 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 31 | { 32 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 33 | if (self) { 34 | [self configure]; 35 | } 36 | return self; 37 | } 38 | 39 | - (void)awakeFromNib 40 | { 41 | [super awakeFromNib]; 42 | [self configure]; 43 | } 44 | 45 | - (void)configure 46 | { 47 | } 48 | 49 | - (void)update 50 | { 51 | self.textLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; 52 | self.detailTextLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; 53 | self.textLabel.textColor = self.rowDescriptor.isDisabled ? [UIColor grayColor] : [UIColor blackColor]; 54 | } 55 | 56 | -(void)highlight 57 | { 58 | } 59 | 60 | -(void)unhighlight 61 | { 62 | } 63 | 64 | -(XLFormViewController *)formViewController 65 | { 66 | id responder = self; 67 | while (responder){ 68 | if ([responder isKindOfClass:[XLFormViewController class]]){ 69 | return responder; 70 | } 71 | responder = [responder nextResponder]; 72 | } 73 | return nil; 74 | } 75 | 76 | #pragma mark - Navigation Between Fields 77 | 78 | -(UIView *)inputAccessoryView 79 | { 80 | UIView * inputAccessoryView = [self.formViewController inputAccessoryViewForRowDescriptor:self.rowDescriptor]; 81 | if (inputAccessoryView){ 82 | return inputAccessoryView; 83 | } 84 | return [super inputAccessoryView]; 85 | } 86 | 87 | -(BOOL)formDescriptorCellCanBecomeFirstResponder 88 | { 89 | return NO; 90 | } 91 | 92 | #pragma mark - 93 | 94 | -(BOOL)becomeFirstResponder 95 | { 96 | BOOL result = [super becomeFirstResponder]; 97 | if (result){ 98 | [self.formViewController beginEditing:self.rowDescriptor]; 99 | } 100 | return result; 101 | } 102 | 103 | -(BOOL)resignFirstResponder 104 | { 105 | BOOL result = [super resignFirstResponder]; 106 | if (result){ 107 | [self.formViewController endEditing:self.rowDescriptor]; 108 | } 109 | return result; 110 | } 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormButtonCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormButtonCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormBaseCell.h" 27 | #import 28 | 29 | @interface XLFormButtonCell : XLFormBaseCell 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormCheckCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormCheckCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormBaseCell.h" 27 | 28 | @interface XLFormCheckCell : XLFormBaseCell 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormCheckCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormCheckCell.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormCheckCell.h" 27 | 28 | @implementation XLFormCheckCell 29 | 30 | #pragma mark - XLFormDescriptorCell 31 | 32 | - (void)configure 33 | { 34 | [super configure]; 35 | self.accessoryType = UITableViewCellAccessoryCheckmark; 36 | self.editingAccessoryType = self.accessoryType; 37 | } 38 | 39 | - (void)update 40 | { 41 | [super update]; 42 | self.textLabel.text = self.rowDescriptor.title; 43 | self.accessoryType = [self.rowDescriptor.value boolValue] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; 44 | self.editingAccessoryType = self.accessoryType; 45 | CGFloat red, green, blue, alpha; 46 | [self.tintColor getRed:&red green:&green blue:&blue alpha:&alpha]; 47 | self.selectionStyle = UITableViewCellSelectionStyleDefault; 48 | if (self.rowDescriptor.isDisabled){ 49 | [self setTintColor:[UIColor colorWithRed:red green:green blue:blue alpha:0.3]]; 50 | self.selectionStyle = UITableViewCellSelectionStyleNone; 51 | } 52 | else{ 53 | [self setTintColor:[UIColor colorWithRed:red green:green blue:blue alpha:1]]; 54 | } 55 | } 56 | // 57 | 58 | -(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller 59 | { 60 | self.rowDescriptor.value = [NSNumber numberWithBool:![self.rowDescriptor.value boolValue]]; 61 | [self.formViewController updateFormRow:self.rowDescriptor]; 62 | [controller.tableView deselectRowAtIndexPath:[controller.form indexPathOfFormRow:self.rowDescriptor] animated:YES]; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormDateCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormDateCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormBaseCell.h" 27 | 28 | typedef NS_ENUM(NSUInteger, XLFormDateDatePickerMode) { 29 | XLFormDateDatePickerModeGetFromRowDescriptor, 30 | XLFormDateDatePickerModeDate, 31 | XLFormDateDatePickerModeDateTime, 32 | XLFormDateDatePickerModeTime 33 | }; 34 | 35 | @interface XLFormDateCell : XLFormBaseCell 36 | 37 | @property (nonatomic) XLFormDateDatePickerMode formDatePickerMode; 38 | @property (nonatomic) NSDate *minimumDate; 39 | @property (nonatomic) NSDate *maximumDate; 40 | @property (nonatomic) NSInteger minuteInterval; 41 | @property (nonatomic) NSLocale *locale; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormDatePickerCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormDatePickerCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLForm.h" 27 | #import "XLFormBaseCell.h" 28 | 29 | #import 30 | 31 | @interface XLFormDatePickerCell : XLFormBaseCell 32 | 33 | @property (nonatomic, readonly) UIDatePicker * datePicker; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormDatePickerCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormDatePickerCell.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "UIView+XLFormAdditions.h" 27 | 28 | #import "XLFormDatePickerCell.h" 29 | 30 | @implementation XLFormDatePickerCell 31 | 32 | @synthesize datePicker = _datePicker; 33 | @synthesize inlineRowDescriptor = _inlineRowDescriptor; 34 | 35 | -(BOOL)canResignFirstResponder 36 | { 37 | return YES; 38 | } 39 | 40 | #pragma mark - Properties 41 | 42 | -(UIDatePicker *)datePicker 43 | { 44 | if (_datePicker) return _datePicker; 45 | _datePicker = [UIDatePicker autolayoutView]; 46 | [_datePicker addTarget:self action:@selector(datePickerValueChanged:) forControlEvents:UIControlEventValueChanged]; 47 | return _datePicker; 48 | } 49 | 50 | #pragma mark- Target Action 51 | 52 | - (void)datePickerValueChanged:(UIDatePicker *)sender 53 | { 54 | if (self.inlineRowDescriptor){ 55 | self.inlineRowDescriptor.value = sender.date; 56 | [self.formViewController updateFormRow:self.inlineRowDescriptor]; 57 | } 58 | else{ 59 | [self becomeFirstResponder]; 60 | self.rowDescriptor.value = sender.date; 61 | } 62 | } 63 | 64 | #pragma mark - XLFormDescriptorCell 65 | 66 | -(void)configure 67 | { 68 | [super configure]; 69 | [self.contentView addSubview:self.datePicker]; 70 | [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.datePicker attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1 constant:0]]; 71 | [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[datePicker]-0-|" options:0 metrics:0 views:@{@"datePicker" : self.datePicker}]]; 72 | } 73 | 74 | -(void)update 75 | { 76 | [super update]; 77 | [self.datePicker setUserInteractionEnabled:![self.rowDescriptor isDisabled]]; 78 | } 79 | 80 | 81 | +(CGFloat)formDescriptorCellHeightForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor 82 | { 83 | return 216.0f; 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormDescriptorCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormDescriptorCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | 29 | @class XLFormRowDescriptor; 30 | @class XLFormViewController; 31 | 32 | @protocol XLFormDescriptorCell 33 | 34 | @required 35 | 36 | @property (nonatomic, weak) XLFormRowDescriptor * rowDescriptor; 37 | -(void)configure; 38 | -(void)update; 39 | 40 | @optional 41 | 42 | +(CGFloat)formDescriptorCellHeightForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor; 43 | -(BOOL)formDescriptorCellCanBecomeFirstResponder; 44 | -(BOOL)formDescriptorCellBecomeFirstResponder; 45 | -(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller; 46 | -(NSString *)formDescriptorHttpParameterName; 47 | 48 | 49 | -(void)highlight; 50 | -(void)unhighlight; 51 | 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormImageCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormBaseCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormBaseCell.h" 27 | 28 | @interface XLFormImageCell : XLFormBaseCell 29 | 30 | @end 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormInlineRowDescriptorCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormInlineRowDescriptorCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @protocol XLFormInlineRowDescriptorCell 29 | 30 | @property (nonatomic, weak) XLFormRowDescriptor * inlineRowDescriptor; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormInlineSelectorCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormInlineSelectorCell.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormBaseCell.h" 27 | 28 | @interface XLFormInlineSelectorCell : XLFormBaseCell 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormLeftRightSelectorCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormLeftRightSelectorCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLForm.h" 27 | #import 28 | 29 | 30 | @interface XLFormLeftRightSelectorCell : XLFormBaseCell 31 | 32 | @property (nonatomic, readonly) UIButton * leftButton; 33 | @property (nonatomic, readonly) UILabel * rightLabel; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormPickerCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormPickerCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLForm.h" 27 | #import "XLFormBaseCell.h" 28 | 29 | @interface XLFormPickerCell : XLFormBaseCell 30 | 31 | @property (nonatomic) UIPickerView * pickerView; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormSegmentedCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormSegmentedCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormBaseCell.h" 27 | 28 | @interface XLFormSegmentedCell : XLFormBaseCell 29 | 30 | @property (nonatomic, readonly) UILabel * textLabel; 31 | @property (nonatomic, readonly) UISegmentedControl *segmentedControl; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormSelectorCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormSelectorCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormBaseCell.h" 27 | #import 28 | 29 | @interface XLFormSelectorCell : XLFormBaseCell 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormSliderCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormSliderCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLForm.h" 27 | 28 | @interface XLFormSliderCell : XLFormBaseCell 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormStepCounterCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormStepCounterCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormBaseCell.h" 27 | #import 28 | 29 | @interface XLFormStepCounterCell : XLFormBaseCell 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormSwitchCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormSwitchCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormBaseCell.h" 27 | 28 | @interface XLFormSwitchCell : XLFormBaseCell 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormSwitchCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormSwitchCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormRowDescriptor.h" 27 | 28 | #import "XLFormSwitchCell.h" 29 | 30 | @implementation XLFormSwitchCell 31 | 32 | #pragma mark - XLFormDescriptorCell 33 | 34 | - (void)configure 35 | { 36 | [super configure]; 37 | self.selectionStyle = UITableViewCellSelectionStyleNone; 38 | self.accessoryView = [[UISwitch alloc] init]; 39 | self.editingAccessoryView = self.accessoryView; 40 | [self.switchControl addTarget:self action:@selector(valueChanged) forControlEvents:UIControlEventValueChanged]; 41 | } 42 | 43 | - (void)update 44 | { 45 | [super update]; 46 | self.textLabel.text = self.rowDescriptor.title; 47 | self.switchControl.on = [self.rowDescriptor.value boolValue]; 48 | self.switchControl.enabled = !self.rowDescriptor.isDisabled; 49 | } 50 | 51 | - (UISwitch *)switchControl 52 | { 53 | return (UISwitch *)self.accessoryView; 54 | } 55 | 56 | - (void)valueChanged 57 | { 58 | self.rowDescriptor.value = @(self.switchControl.on); 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormTextFieldCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormTextFieldCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormBaseCell.h" 27 | #import 28 | 29 | extern NSString *const XLFormTextFieldLengthPercentage; 30 | extern NSString *const XLFormTextFieldMaxNumberOfCharacters; 31 | 32 | @interface XLFormTextFieldCell : XLFormBaseCell 33 | 34 | @property (nonatomic, readonly) UILabel * textLabel; 35 | @property (nonatomic, readonly) UITextField * textField; 36 | 37 | @property (nonatomic) NSNumber *textFieldLengthPercentage; 38 | @property (nonatomic) NSNumber *textFieldMaxNumberOfCharacters; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Cell/XLFormTextViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormTextViewCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormTextView.h" 27 | #import "XLFormBaseCell.h" 28 | #import 29 | 30 | extern NSString *const XLFormTextViewLengthPercentage; 31 | extern NSString *const XLFormTextViewMaxNumberOfCharacters; 32 | 33 | @interface XLFormTextViewCell : XLFormBaseCell 34 | 35 | @property (nonatomic, readonly) UILabel * label DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use textLabel instead"); 36 | @property (nonatomic, readonly) UILabel * textLabel; 37 | @property (nonatomic, readonly) XLFormTextView * textView; 38 | 39 | @property (nonatomic) NSNumber *textViewLengthPercentage; 40 | @property (nonatomic) NSNumber *textViewMaxNumberOfCharacters; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Controllers/XLFormOptionsObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormOptionsObject.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormRowDescriptor.h" 27 | #import 28 | 29 | @interface XLFormOptionsObject : NSObject 30 | 31 | @property (nonatomic) NSString * formDisplaytext; 32 | @property (nonatomic) id formValue; 33 | 34 | +(XLFormOptionsObject *)formOptionsObjectWithValue:(id)value displayText:(NSString *)displayText; 35 | +(XLFormOptionsObject *)formOptionsOptionForValue:(id)value fromOptions:(NSArray *)options; 36 | +(XLFormOptionsObject *)formOptionsOptionForDisplayText:(NSString *)displayText fromOptions:(NSArray *)options; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Controllers/XLFormOptionsObject.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormOptionsObject.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormOptionsObject.h" 27 | 28 | @implementation XLFormOptionsObject 29 | 30 | +(XLFormOptionsObject *)formOptionsObjectWithValue:(id)value displayText:(NSString *)displayText 31 | { 32 | return [[XLFormOptionsObject alloc] initWithValue:value displayText:displayText]; 33 | } 34 | 35 | -(instancetype)initWithValue:(id)value displayText:(NSString *)displayText 36 | { 37 | self = [super init]; 38 | if (self){ 39 | _formValue = value; 40 | _formDisplaytext = displayText; 41 | } 42 | return self; 43 | } 44 | 45 | +(XLFormOptionsObject *)formOptionsOptionForValue:(id)value fromOptions:(NSArray *)options 46 | { 47 | for (XLFormOptionsObject * option in options) { 48 | if ([option.formValue isEqual:value]){ 49 | return option; 50 | } 51 | } 52 | return nil; 53 | } 54 | 55 | +(XLFormOptionsObject *)formOptionsOptionForDisplayText:(NSString *)displayText fromOptions:(NSArray *)options 56 | { 57 | for (XLFormOptionsObject * option in options) { 58 | if ([option.formDisplayText isEqualToString:displayText]){ 59 | return option; 60 | } 61 | } 62 | return nil; 63 | } 64 | 65 | -(BOOL)isEqual:(id)object 66 | { 67 | if (![[self class] isEqual:[object class]]){ 68 | return NO; 69 | } 70 | return [self.formValue isEqual:((XLFormOptionsObject *)object).formValue]; 71 | } 72 | 73 | #pragma mark - XLFormOptionObject 74 | 75 | -(NSString *)formDisplayText 76 | { 77 | return _formDisplaytext; 78 | } 79 | 80 | -(id)formValue 81 | { 82 | return _formValue; 83 | } 84 | 85 | #pragma mark - NSCoding 86 | -(void)encodeWithCoder:(NSCoder *)encoder 87 | { 88 | 89 | [encoder encodeObject:self.formValue 90 | forKey:@"formValue"]; 91 | [encoder encodeObject:self.formDisplayText 92 | forKey:@"formDisplayText"]; 93 | } 94 | 95 | -(instancetype)initWithCoder:(NSCoder *)decoder 96 | { 97 | if ((self=[super init])) { 98 | 99 | [self setValue:[decoder decodeObjectForKey:@"formValue"] 100 | forKey:@"formValue"]; 101 | [self setValue:[decoder decodeObjectForKey:@"formDisplayText"] 102 | forKey:@"formDisplaytext"]; 103 | 104 | } 105 | 106 | return self; 107 | 108 | } 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Controllers/XLFormOptionsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormOptionsViewController.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | 28 | #import "XLFormRowDescriptorViewController.h" 29 | #import "XLFormRowDescriptor.h" 30 | 31 | @interface XLFormOptionsViewController : UITableViewController 32 | 33 | - (instancetype)initWithStyle:(UITableViewStyle)style; 34 | 35 | 36 | - (instancetype)initWithStyle:(UITableViewStyle)style 37 | titleHeaderSection:(NSString *)titleHeaderSection 38 | titleFooterSection:(NSString *)titleFooterSection; 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Controllers/XLFormRowDescriptorViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRowDescriptorViewController.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "XLFormRowDescriptor.h" 28 | #import 29 | 30 | @protocol XLFormRowDescriptorViewController 31 | 32 | @required 33 | @property (nonatomic) XLFormRowDescriptor * rowDescriptor; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Descriptors/XLFormDescriptorDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormDescriptorDelegate.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormDescriptor.h" 27 | #import 28 | 29 | @class XLFormSectionDescriptor; 30 | 31 | typedef NS_ENUM(NSUInteger, XLPredicateType) { 32 | XLPredicateTypeDisabled = 0, 33 | XLPredicateTypeHidden 34 | }; 35 | 36 | 37 | @protocol XLFormDescriptorDelegate 38 | 39 | @required 40 | 41 | -(void)formSectionHasBeenRemoved:(XLFormSectionDescriptor *)formSection atIndex:(NSUInteger)index; 42 | -(void)formSectionHasBeenAdded:(XLFormSectionDescriptor *)formSection atIndex:(NSUInteger)index; 43 | -(void)formRowHasBeenAdded:(XLFormRowDescriptor *)formRow atIndexPath:(NSIndexPath *)indexPath; 44 | -(void)formRowHasBeenRemoved:(XLFormRowDescriptor *)formRow atIndexPath:(NSIndexPath *)indexPath; 45 | -(void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)formRow oldValue:(id)oldValue newValue:(id)newValue; 46 | -(void)formRowDescriptorPredicateHasChanged:(XLFormRowDescriptor *)formRow 47 | oldValue:(id)oldValue 48 | newValue:(id)newValue 49 | predicateType:(XLPredicateType)predicateType; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Descriptors/XLFormSectionDescriptor.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormSectionDescriptor.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormRowDescriptor.h" 27 | #import 28 | 29 | typedef NS_OPTIONS(NSUInteger, XLFormSectionOptions) { 30 | XLFormSectionOptionNone = 0, 31 | XLFormSectionOptionCanInsert = 1 << 0, 32 | XLFormSectionOptionCanDelete = 1 << 1, 33 | XLFormSectionOptionCanReorder = 1 << 2 34 | }; 35 | 36 | typedef NS_ENUM(NSUInteger, XLFormSectionInsertMode) { 37 | XLFormSectionInsertModeLastRow = 0, 38 | XLFormSectionInsertModeButton = 2 39 | }; 40 | 41 | @class XLFormDescriptor; 42 | 43 | @interface XLFormSectionDescriptor : NSObject 44 | 45 | @property (nonatomic, nullable) NSString * title; 46 | @property (nonatomic, nullable) NSString * footerTitle; 47 | @property (readonly, nonnull) NSMutableArray * formRows; 48 | 49 | @property (readonly) XLFormSectionInsertMode sectionInsertMode; 50 | @property (readonly) XLFormSectionOptions sectionOptions; 51 | @property (nullable) XLFormRowDescriptor * multivaluedRowTemplate; 52 | @property (readonly, nullable) XLFormRowDescriptor * multivaluedAddButton; 53 | @property (nonatomic, nullable) NSString * multivaluedTag; 54 | 55 | @property (weak, null_unspecified) XLFormDescriptor * formDescriptor; 56 | 57 | @property (nonnull) id hidden; 58 | -(BOOL)isHidden; 59 | 60 | +(nonnull instancetype)formSection; 61 | +(nonnull instancetype)formSectionWithTitle:(nullable NSString *)title; 62 | +(nonnull instancetype)formSectionWithTitle:(nullable NSString *)title multivaluedSection:(BOOL)multivaluedSection DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use formSectionWithTitle:sectionType: instead"); 63 | +(nonnull instancetype)formSectionWithTitle:(nullable NSString *)title sectionOptions:(XLFormSectionOptions)sectionOptions; 64 | +(nonnull instancetype)formSectionWithTitle:(nullable NSString *)title sectionOptions:(XLFormSectionOptions)sectionOptions sectionInsertMode:(XLFormSectionInsertMode)sectionInsertMode; 65 | 66 | -(BOOL)isMultivaluedSection; 67 | -(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow; 68 | -(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow afterRow:(nonnull XLFormRowDescriptor *)afterRow; 69 | -(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow beforeRow:(nonnull XLFormRowDescriptor *)beforeRow; 70 | -(void)removeFormRowAtIndex:(NSUInteger)index; 71 | -(void)removeFormRow:(nonnull XLFormRowDescriptor *)formRow; 72 | -(void)moveRowAtIndexPath:(nonnull NSIndexPath *)sourceIndex toIndexPath:(nonnull NSIndexPath *)destinationIndex; 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/NSArray+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+XLFormAdditions.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface NSArray (XLFormAdditions) 29 | 30 | -(NSInteger)formIndexForItem:(id)item; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/NSArray+XLFormAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+XLFormAdditions.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "NSArray+XLFormAdditions.h" 27 | #import "NSObject+XLFormAdditions.h" 28 | 29 | @implementation NSArray (XLFormAdditions) 30 | 31 | -(NSInteger)formIndexForItem:(id)item 32 | { 33 | for (id selectedValueItem in self) { 34 | if ([[selectedValueItem valueData] isEqual:[item valueData]]){ 35 | return [self indexOfObject:selectedValueItem]; 36 | } 37 | } 38 | return NSNotFound; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/NSExpression+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSExpression+XLFormAdditions.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import 28 | 29 | @interface NSExpression (XLFormAdditions) 30 | 31 | -(NSMutableArray*) getExpressionVars; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/NSExpression+XLFormAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSExpression+XLFormAdditions.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "NSExpression+XLFormAdditions.h" 28 | 29 | @implementation NSExpression (XLFormAdditions) 30 | 31 | 32 | -(NSMutableArray*) getExpressionVars{ 33 | switch (self.expressionType) { 34 | case NSFunctionExpressionType:{ 35 | NSString* str = [NSString stringWithFormat:@"%@", self]; 36 | if ([str rangeOfString:@"."].location != NSNotFound) 37 | str = [str substringWithRange:NSMakeRange(1, [str rangeOfString:@"."].location - 1)]; 38 | else 39 | str = [str substringFromIndex:1]; 40 | return [[NSMutableArray alloc] initWithObjects: str, nil]; 41 | break; 42 | } 43 | default: 44 | return nil; 45 | break; 46 | } 47 | } 48 | 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/NSObject+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+XLFormAdditions.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface NSObject (XLFormAdditions) 29 | 30 | -(NSString *)displayText; 31 | -(id)valueData; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/NSObject+XLFormAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+XLFormAdditions.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormRowDescriptor.h" 27 | 28 | #import "NSObject+XLFormAdditions.h" 29 | 30 | @implementation NSObject (XLFormAdditions) 31 | 32 | -(NSString *)displayText 33 | { 34 | if ([self conformsToProtocol:@protocol(XLFormOptionObject)]){ 35 | return [(id)self formDisplayText]; 36 | } 37 | if ([self isKindOfClass:[NSString class]] || [self isKindOfClass:[NSNumber class]]){ 38 | return [self description]; 39 | } 40 | return nil; 41 | } 42 | 43 | -(id)valueData 44 | { 45 | if ([self isKindOfClass:[NSString class]] || [self isKindOfClass:[NSNumber class]] || [self isKindOfClass:[NSDate class]]){ 46 | return self; 47 | } 48 | if ([self isKindOfClass:[NSArray class]]) { 49 | NSMutableArray * result = [NSMutableArray array]; 50 | [(NSArray *)self enumerateObjectsUsingBlock:^(id obj, NSUInteger __unused idx, BOOL __unused *stop) { 51 | [result addObject:[obj valueData]]; 52 | }]; 53 | return result; 54 | } 55 | if ([self conformsToProtocol:@protocol(XLFormOptionObject)]){ 56 | return [(id)self formValue]; 57 | } 58 | return nil; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/NSPredicate+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSPredicate+XLFormAdditions.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface NSPredicate (XLFormAdditions) 29 | 30 | -(NSMutableArray*) getPredicateVars; 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/NSPredicate+XLFormAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSPredicate+XLFormAdditions.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | #import "NSPredicate+XLFormAdditions.h" 26 | #import "NSExpression+XLFormAdditions.h" 27 | 28 | @implementation NSPredicate (XLFormAdditions) 29 | 30 | 31 | -(NSMutableArray*) getPredicateVars{ 32 | NSMutableArray* ret = [[NSMutableArray alloc] init]; 33 | if ([self isKindOfClass:([NSCompoundPredicate class])]) { 34 | for (id object in ((NSCompoundPredicate*) self).subpredicates ) { 35 | [ret addObjectsFromArray:[object getPredicateVars]]; 36 | } 37 | } 38 | else if ([self isKindOfClass:([NSComparisonPredicate class])]){ 39 | [ret addObjectsFromArray:[((NSComparisonPredicate*) self).leftExpression getExpressionVars]]; 40 | [ret addObjectsFromArray:[((NSComparisonPredicate*) self).rightExpression getExpressionVars]]; 41 | } 42 | return ret; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/NSString+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+XLFormAdditions.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | #import "XLFormDescriptor.h" 28 | 29 | @interface NSString (XLFormAdditions) 30 | 31 | -(NSPredicate *)formPredicate; 32 | 33 | -(NSString *)formKeyForPredicateType:(XLPredicateType)predicateType; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/NSString+XLFormAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+XLFormAdditions.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "NSString+XLFormAdditions.h" 27 | 28 | @implementation NSString (XLFormAdditions) 29 | 30 | -(NSPredicate *)formPredicate 31 | { 32 | // returns an array of strings where the first one is the new string with the correct replacements 33 | // and the rest are all the tags that appear in the string 34 | NSString* separator = @"$"; 35 | 36 | NSArray* tokens = [self componentsSeparatedByString:separator]; 37 | NSMutableString* new_string = [[NSMutableString alloc] initWithString:tokens[0]]; 38 | NSRange range; 39 | for (int i = 1; i < tokens.count; i++) { 40 | [new_string appendString:separator]; 41 | NSArray* subtokens = [[tokens[i] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@" <>!=+-&|()"]][0] 42 | componentsSeparatedByString:@"."]; 43 | NSString* tag = subtokens[0]; 44 | NSString* attribute; 45 | if ([subtokens count] >= 2) { 46 | attribute = subtokens[1]; 47 | } 48 | [new_string appendString:tag]; 49 | range = [tokens[i] rangeOfString:[NSString stringWithFormat:@"%@", tag]]; 50 | if (!attribute || (![attribute isEqualToString:@"value"] && ![attribute isEqualToString:@"isHidden"] && ![attribute isEqualToString:@"isDisabled"])){ 51 | [new_string appendString:@".value"]; 52 | } 53 | [new_string appendString:[tokens[i] substringFromIndex:range.location + range.length]]; 54 | } 55 | return [NSPredicate predicateWithFormat:new_string]; 56 | 57 | } 58 | 59 | 60 | -(NSString *)formKeyForPredicateType:(XLPredicateType)predicateType 61 | { 62 | return [NSString stringWithFormat:@"%@-%@", self, (predicateType == XLPredicateTypeHidden ? @"hidden" : @"disabled") ]; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/UIView+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+XLFormAdditions.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormDescriptorCell.h" 27 | #import 28 | 29 | @interface UIView (XLFormAdditions) 30 | 31 | +(id)autolayoutView; 32 | -(NSLayoutConstraint *)layoutConstraintSameHeightOf:(UIView *)view; 33 | -(UIView *)findFirstResponder; 34 | -(UITableViewCell *)formDescriptorCell; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/UIView+XLFormAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+XLFormAdditions.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "UIView+XLFormAdditions.h" 27 | 28 | @implementation UIView (XLFormAdditions) 29 | 30 | + (id)autolayoutView 31 | { 32 | UIView *view = [self new]; 33 | view.translatesAutoresizingMaskIntoConstraints = NO; 34 | return view; 35 | } 36 | 37 | -(NSLayoutConstraint *)layoutConstraintSameHeightOf:(UIView *)view 38 | { 39 | return [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeHeight multiplier:1.0f constant:0.0f]; 40 | } 41 | 42 | - (UIView *)findFirstResponder 43 | { 44 | if (self.isFirstResponder) { 45 | return self; 46 | } 47 | for (UIView *subView in self.subviews) { 48 | UIView *firstResponder = [subView findFirstResponder]; 49 | if (firstResponder != nil) { 50 | return firstResponder; 51 | } 52 | } 53 | return nil; 54 | } 55 | 56 | - (UITableViewCell *)formDescriptorCell 57 | { 58 | if ([self isKindOfClass:[UITableViewCell class]]) { 59 | if ([self conformsToProtocol:@protocol(XLFormDescriptorCell)]){ 60 | return (UITableViewCell *)self; 61 | } 62 | return nil; 63 | } 64 | if (self.superview) { 65 | UITableViewCell * tableViewCell = [self.superview formDescriptorCell]; 66 | if (tableViewCell != nil) { 67 | return tableViewCell; 68 | } 69 | } 70 | return nil; 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/Views/XLFormRightDetailCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRightDetailCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface XLFormRightDetailCell : UITableViewCell 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/Views/XLFormRightDetailCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRightDetailCell.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormRightDetailCell.h" 27 | 28 | @implementation XLFormRightDetailCell 29 | 30 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 31 | { 32 | return [super initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/Views/XLFormRightImageButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRightImageButton.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface XLFormRightImageButton : UIButton 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/Views/XLFormRightImageButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRightImageButton.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormRightImageButton.h" 27 | 28 | @implementation XLFormRightImageButton 29 | 30 | 31 | - (CGSize)intrinsicContentSize 32 | { 33 | CGSize s = [super intrinsicContentSize]; 34 | return CGSizeMake(s.width + self.titleEdgeInsets.left + self.titleEdgeInsets.right, 35 | s.height + self.titleEdgeInsets.top + self.titleEdgeInsets.bottom); 36 | 37 | } 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/Views/XLFormRowNavigationAccessoryView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRowNavigationAccessoryView.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface XLFormRowNavigationAccessoryView : UIToolbar 29 | 30 | @property (nonatomic) UIBarButtonItem *previousButton; 31 | @property (nonatomic) UIBarButtonItem *nextButton; 32 | @property (nonatomic) UIBarButtonItem *doneButton; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/Views/XLFormTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormTextView.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import 28 | 29 | @interface XLFormTextView : UITextView 30 | 31 | 32 | @property (nonatomic) NSString *placeholder; 33 | @property (nonatomic) UIColor *placeholderColor; 34 | 35 | @property (readonly) UILabel *placeHolderLabel; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Helpers/Views/XLFormTextView.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormTextView.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "XLFormTextView.h" 28 | 29 | @implementation XLFormTextView 30 | 31 | - (void)dealloc 32 | { 33 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 34 | } 35 | 36 | - (instancetype)initWithFrame:(CGRect)frame 37 | { 38 | if((self = [super initWithFrame:frame])){ 39 | self.scrollsToTop = NO; 40 | self.contentInset = UIEdgeInsetsMake(0, -4, 0, 0); 41 | [self setPlaceholder:@""]; 42 | [self setPlaceholderColor:[UIColor colorWithRed:.78 green:.78 blue:.80 alpha:1.0]]; 43 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textChanged:) name:UITextViewTextDidChangeNotification object:nil]; 44 | } 45 | return self; 46 | } 47 | 48 | - (void)textChanged:(NSNotification *)notification 49 | { 50 | if([[self placeholder] length] == 0){ 51 | return; 52 | } 53 | if([[self text] length] == 0){ 54 | [[self viewWithTag:999] setAlpha:1]; 55 | } 56 | else{ 57 | [[self viewWithTag:999] setAlpha:0]; 58 | } 59 | } 60 | 61 | - (void)setText:(NSString *)text { 62 | [super setText:text]; 63 | [self textChanged:nil]; 64 | } 65 | 66 | - (void)drawRect:(CGRect)rect 67 | { 68 | if([[self placeholder] length] > 0){ 69 | if (_placeHolderLabel == nil ){ 70 | _placeHolderLabel = [[UILabel alloc] initWithFrame:CGRectMake(4,8,self.bounds.size.width - 16,0)]; 71 | _placeHolderLabel.lineBreakMode = NSLineBreakByWordWrapping; 72 | _placeHolderLabel.numberOfLines = 0; 73 | _placeHolderLabel.backgroundColor = [UIColor clearColor]; 74 | _placeHolderLabel.textColor = self.placeholderColor; 75 | _placeHolderLabel.alpha = 0; 76 | _placeHolderLabel.tag = 999; 77 | [self addSubview:_placeHolderLabel]; 78 | } 79 | _placeHolderLabel.text = self.placeholder; 80 | _placeHolderLabel.font = self.font; 81 | [_placeHolderLabel sizeToFit]; 82 | [self sendSubviewToBack:_placeHolderLabel]; 83 | } 84 | if( [[self text] length] == 0 && [[self placeholder] length] > 0 ){ 85 | [[self viewWithTag:999] setAlpha:1]; 86 | } 87 | [super drawRect:rect]; 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Validation/XLFormRegexValidator.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRegexValidator.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormValidatorProtocol.h" 27 | #import "XLFormValidationStatus.h" 28 | #import "XLFormValidator.h" 29 | 30 | @interface XLFormRegexValidator : XLFormValidator 31 | 32 | @property NSString *msg; 33 | @property NSString *regex; 34 | 35 | - (instancetype)initWithMsg:(NSString*)msg andRegexString:(NSString*)regex; 36 | + (XLFormRegexValidator *)formRegexValidatorWithMsg:(NSString *)msg regex:(NSString *)regex; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Validation/XLFormRegexValidator.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRegexValidator.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormRegexValidator.h" 27 | 28 | @implementation XLFormRegexValidator 29 | 30 | -(instancetype)initWithMsg:(NSString*)msg andRegexString:(NSString*)regex { 31 | self = [super init]; 32 | if (self) { 33 | self.msg = msg; 34 | self.regex = regex; 35 | } 36 | 37 | return self; 38 | } 39 | 40 | -(XLFormValidationStatus *)isValid: (XLFormRowDescriptor *)row { 41 | if (row != nil && row.value != nil) { 42 | // we only validate if there is a value 43 | // assumption: required validation is already triggered 44 | // if this field is optional, we only validate if there is a value 45 | id value = row.value; 46 | if ([value isKindOfClass:[NSNumber class]]){ 47 | value = [value stringValue]; 48 | } 49 | if ([value isKindOfClass:[NSString class]] && [value length] > 0) { 50 | BOOL isValid = [[NSPredicate predicateWithFormat:@"SELF MATCHES %@", self.regex] evaluateWithObject:[value stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]]; 51 | return [XLFormValidationStatus formValidationStatusWithMsg:self.msg status:isValid rowDescriptor:row]; 52 | } 53 | } 54 | return nil; 55 | }; 56 | 57 | +(XLFormRegexValidator *)formRegexValidatorWithMsg:(NSString *)msg regex:(NSString *)regex { 58 | return [[XLFormRegexValidator alloc] initWithMsg:msg andRegexString:regex]; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Validation/XLFormValidationStatus.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormValidationStatus.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | #import "XLFormRowDescriptor.h" 29 | 30 | @interface XLFormValidationStatus : NSObject 31 | 32 | @property NSString *msg; 33 | @property BOOL isValid; 34 | @property (nonatomic, weak) XLFormRowDescriptor *rowDescriptor; 35 | 36 | //-(instancetype)initWithMsg:(NSString*)msg andStatus:(BOOL)isValid; 37 | -(instancetype)initWithMsg:(NSString*)msg status:(BOOL)isValid rowDescriptor:(XLFormRowDescriptor *)row; 38 | 39 | //+(XLFormValidationStatus *)formValidationStatusWithMsg:(NSString *)msg status:(BOOL)status; 40 | +(XLFormValidationStatus *)formValidationStatusWithMsg:(NSString *)msg status:(BOOL)status rowDescriptor:(XLFormRowDescriptor *)row; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Validation/XLFormValidationStatus.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormValidationStatus.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormValidationStatus.h" 27 | 28 | @implementation XLFormValidationStatus 29 | 30 | -(instancetype)initWithMsg:(NSString*)msg andStatus:(BOOL)isValid { 31 | return [self initWithMsg:msg status:isValid rowDescriptor:nil]; 32 | } 33 | 34 | -(instancetype)initWithMsg:(NSString*)msg status:(BOOL)isValid rowDescriptor:(XLFormRowDescriptor *)row { 35 | self = [super init]; 36 | if (self) { 37 | self.msg = msg; 38 | self.isValid = isValid; 39 | self.rowDescriptor = row; 40 | } 41 | 42 | return self; 43 | } 44 | 45 | +(XLFormValidationStatus *)formValidationStatusWithMsg:(NSString *)msg status:(BOOL)status { 46 | return [self formValidationStatusWithMsg:msg status:status rowDescriptor:nil]; 47 | } 48 | 49 | +(XLFormValidationStatus *)formValidationStatusWithMsg:(NSString *)msg status:(BOOL)status rowDescriptor:(XLFormRowDescriptor *)row { 50 | return [[XLFormValidationStatus alloc] initWithMsg:msg status:status rowDescriptor:row]; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Validation/XLFormValidator.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormValidator.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "XLFormValidatorProtocol.h" 28 | 29 | @interface XLFormValidator : NSObject 30 | 31 | +(XLFormValidator *)emailValidator; 32 | +(XLFormValidator *)emailValidatorLong; 33 | @end 34 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Validation/XLFormValidator.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormValidator.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormValidationStatus.h" 27 | #import "XLFormRegexValidator.h" 28 | 29 | #import "XLFormValidator.h" 30 | 31 | @implementation XLFormValidator 32 | 33 | -(XLFormValidationStatus *)isValid:(XLFormRowDescriptor *)row 34 | { 35 | return [XLFormValidationStatus formValidationStatusWithMsg:nil status:YES rowDescriptor:row]; 36 | } 37 | 38 | #pragma mark - Validators 39 | 40 | 41 | +(XLFormValidator *)emailValidator 42 | { 43 | return [XLFormRegexValidator formRegexValidatorWithMsg:NSLocalizedString(@"Invalid email address", nil) regex:@"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"]; 44 | } 45 | +(XLFormValidator *)emailValidatorLong 46 | { 47 | return [XLFormRegexValidator formRegexValidatorWithMsg:NSLocalizedString(@"Invalid email address", nil) regex:@"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,11}"]; 48 | } 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XL/Validation/XLFormValidatorProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormValidatorProtocol.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "XLFormRowDescriptor.h" 27 | 28 | @class XLFormValidationStatus; 29 | 30 | @protocol XLFormValidatorProtocol 31 | 32 | @required 33 | 34 | -(XLFormValidationStatus *)isValid:(XLFormRowDescriptor *)row; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/XLForm/XLForm/XLForm.bundle/forwardarrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmoulton/grokSwiftREST_v1.4/f17990c7d900ffc6a6beff25f0e34fbe2b3da726/Pods/XLForm/XLForm/XLForm.bundle/forwardarrow@2x.png -------------------------------------------------------------------------------- /grokSwiftREST.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /grokSwiftREST.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /grokSwiftREST.xcodeproj/project.xcworkspace/xcuserdata/christina.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmoulton/grokSwiftREST_v1.4/f17990c7d900ffc6a6beff25f0e34fbe2b3da726/grokSwiftREST.xcodeproj/project.xcworkspace/xcuserdata/christina.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /grokSwiftREST.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /grokSwiftREST.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /grokSwiftREST/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // grokSwiftREST 4 | // 5 | // Created by Christina Moulton on 2018-03-22. 6 | // Copyright © 2018 Christina Moulton. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate { 13 | var window: UIWindow? 14 | 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 16 | // Override point for customization after application launch. 17 | let splitViewController = window!.rootViewController as! UISplitViewController 18 | let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController 19 | navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem 20 | splitViewController.delegate = self 21 | return true 22 | } 23 | 24 | func application(_ application: UIApplication, handleOpen url: URL) -> Bool { 25 | if let mainVC = self.window?.rootViewController as? MasterViewController, 26 | let webVC = mainVC.safariViewController { 27 | webVC.dismiss(animated: true) 28 | } 29 | GitHubAPIManager.shared.processOAuthStep1Response(url) 30 | return true 31 | } 32 | 33 | // MARK: - Split view 34 | 35 | func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController) -> Bool { 36 | guard let secondaryAsNavController = secondaryViewController as? UINavigationController else { return false } 37 | guard let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController else { return false } 38 | if topAsDetailController.gist == nil { 39 | // Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded. 40 | return true 41 | } 42 | return false 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /grokSwiftREST/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /grokSwiftREST/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /grokSwiftREST/Assets.xcassets/placeholder.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "placeholder.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /grokSwiftREST/Assets.xcassets/placeholder.imageset/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmoulton/grokSwiftREST_v1.4/f17990c7d900ffc6a6beff25f0e34fbe2b3da726/grokSwiftREST/Assets.xcassets/placeholder.imageset/placeholder.png -------------------------------------------------------------------------------- /grokSwiftREST/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /grokSwiftREST/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UIStatusBarTintParameters 32 | 33 | UINavigationBar 34 | 35 | Style 36 | UIBarStyleDefault 37 | Translucent 38 | 39 | 40 | 41 | UISupportedInterfaceOrientations 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationLandscapeLeft 45 | UIInterfaceOrientationLandscapeRight 46 | 47 | CFBundleURLTypes 48 | 49 | 50 | CFBundleURLName 51 | com.grokswift.grokSwiftREST 52 | CFBundleURLSchemes 53 | 54 | grokGitHubOAuth 55 | 56 | 57 | 58 | UISupportedInterfaceOrientations~ipad 59 | 60 | UIInterfaceOrientationPortrait 61 | UIInterfaceOrientationPortraitUpsideDown 62 | UIInterfaceOrientationLandscapeLeft 63 | UIInterfaceOrientationLandscapeRight 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /grokSwiftREST/Models/File.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // grokSwiftREST 4 | // 5 | // Created by Christina Moulton on 2018-03-26. 6 | // Copyright © 2018 Christina Moulton. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct File: Codable { 12 | enum CodingKeys: String, CodingKey { 13 | case url = "raw_url" 14 | case content 15 | } 16 | 17 | let url: URL? 18 | let content: String? 19 | } 20 | -------------------------------------------------------------------------------- /grokSwiftREST/Models/Gist.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Gist.swift 3 | // grokSwiftREST 4 | // 5 | // Created by Christina Moulton on 2018-03-22. 6 | // Copyright © 2018 Christina Moulton. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct Gist: Codable { 12 | struct Owner: Codable { 13 | var login: String 14 | var avatarURL: URL? 15 | 16 | enum CodingKeys: String, CodingKey { 17 | case login 18 | case avatarURL = "avatar_url" 19 | } 20 | } 21 | 22 | init(gistDescription: String, files: [String: File], isPublic: Bool) { 23 | self.gistDescription = gistDescription 24 | self.files = files 25 | self.isPublic = isPublic 26 | 27 | self.id = nil 28 | self.url = nil 29 | self.owner = nil 30 | self.createdAt = nil 31 | self.updatedAt = nil 32 | } 33 | 34 | var id: String? 35 | var gistDescription: String? 36 | var url: URL? 37 | var owner: Owner? 38 | let createdAt: Date? 39 | let updatedAt: Date? 40 | let files: [String: File] // JSON does filename: { file data } 41 | let isPublic: Bool 42 | lazy var orderedFiles: [(name: String, details: File)] = { 43 | var orderedFiles: [(name: String, details: File)] = [] 44 | for (key, value) in files { 45 | let item = (name: key, details: value) 46 | orderedFiles.append(item) 47 | } 48 | return orderedFiles 49 | }() 50 | 51 | enum CodingKeys: String, CodingKey { 52 | case id 53 | case gistDescription = "description" 54 | case url 55 | case owner 56 | case createdAt = "created_at" 57 | case updatedAt = "updated_at" 58 | case files 59 | case isPublic = "public" 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /grokSwiftREST/Networking/BackendError.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BackendError.swift 3 | // grokSwiftREST 4 | // 5 | // Created by Christina Moulton on 2018-03-22. 6 | // Copyright © 2018 Christina Moulton. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | enum BackendError: Error { 12 | case network(error: Error) 13 | case unexpectedResponse(reason: String) 14 | case parsing(error: Error) 15 | case apiProvidedError(reason: String) 16 | case authCouldNot(reason: String) 17 | case authLost(reason: String) 18 | case missingRequiredInput(reason: String) 19 | } 20 | 21 | struct APIProvidedError: Codable { 22 | let message: String 23 | } 24 | -------------------------------------------------------------------------------- /grokSwiftREST/Networking/GistRouter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GistRouter.swift 3 | // grokSwiftREST 4 | // 5 | // Created by Christina Moulton on 2018-03-22. 6 | // Copyright © 2018 Christina Moulton. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Alamofire 11 | 12 | enum GistRouter: URLRequestConvertible { 13 | static let baseURLString = "https://api.github.com/" 14 | 15 | case getPublic() 16 | case getMyStarred() 17 | case getAtPath(String) 18 | case getMine() 19 | case isStarred(String) 20 | case star(String) 21 | case unstar(String) 22 | case delete(String) 23 | case create(Data) 24 | 25 | func asURLRequest() throws -> URLRequest { 26 | var method: HTTPMethod { 27 | switch self { 28 | case .getAtPath, .getPublic, .getMyStarred, .getMine, .isStarred: 29 | return .get 30 | case .star: 31 | return .put 32 | case .unstar, .delete: 33 | return .delete 34 | case .create: 35 | return .post 36 | } 37 | } 38 | 39 | let url: URL = { 40 | let relativePath: String 41 | switch self { 42 | case .getAtPath(let path): 43 | // already have the full URL, so just return it 44 | return URL(string: path)! 45 | case .getPublic(): 46 | relativePath = "gists/public" 47 | case .getMyStarred: 48 | relativePath = "gists/starred" 49 | case .getMine(): 50 | relativePath = "gists" 51 | case .isStarred(let id): 52 | relativePath = "gists/\(id)/star" 53 | case .star(let id): 54 | relativePath = "gists/\(id)/star" 55 | case .unstar(let id): 56 | relativePath = "gists/\(id)/star" 57 | case .delete(let id): 58 | relativePath = "gists/\(id)" 59 | case .create: 60 | relativePath = "gists" 61 | } 62 | 63 | var url = URL(string: GistRouter.baseURLString)! 64 | url.appendPathComponent(relativePath) 65 | return url 66 | }() 67 | 68 | let body: Data? = { 69 | switch self { 70 | case .create(let jsonAsData): 71 | return jsonAsData 72 | default: 73 | return nil 74 | } 75 | }() 76 | 77 | // for now, ignore params 78 | 79 | var urlRequest = URLRequest(url: url) 80 | urlRequest.httpMethod = method.rawValue 81 | 82 | // Set OAuth token if we have one 83 | if let token = GitHubAPIManager.shared.OAuthToken { 84 | urlRequest.setValue("token \(token)", forHTTPHeaderField: "Authorization") 85 | } 86 | 87 | urlRequest.httpBody = body 88 | 89 | return urlRequest 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /grokSwiftREST/Networking/JSONEncoder+EncodeResponse.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JSONEncoder+EncodeResponse.swift 3 | // grokSwiftREST 4 | // 5 | // Created by Christina Moulton on 2018-03-22. 6 | // Copyright © 2018 Christina Moulton. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Alamofire 11 | 12 | extension JSONDecoder { 13 | func decodeResponse(from response: DataResponse) -> Result { 14 | guard response.error == nil else { 15 | // got an error in getting the data, need to handle it 16 | print(response.error!) 17 | return .failure(BackendError.network(error: response.error!)) 18 | } 19 | 20 | // make sure we got JSON and it's a dictionary 21 | guard let responseData = response.data else { 22 | print("didn't get any data from API") 23 | return .failure(BackendError.unexpectedResponse(reason: 24 | "Did not get data in response")) 25 | } 26 | 27 | // check for "message" errors in the JSON because this API does that 28 | if let apiProvidedError = try? self.decode(APIProvidedError.self, from: responseData) { 29 | return .failure(BackendError.apiProvidedError(reason: apiProvidedError.message)) 30 | } 31 | 32 | // turn data into expected type 33 | do { 34 | let item = try self.decode(T.self, from: responseData) 35 | return .success(item) 36 | } catch { 37 | print("error trying to convert data to JSON") 38 | print(error) 39 | return .failure(BackendError.parsing(error: error)) 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /grokSwiftREST/PersistenceManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PersistenceManager.swift 3 | // grokSwiftREST 4 | // 5 | // Created by Christina Moulton on 2018-03-27. 6 | // Copyright © 2018 Christina Moulton. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | class PersistenceManager { 13 | enum Path: String { 14 | case Public = "Public" 15 | case Starred = "Starred" 16 | case MyGists = "MyGists" 17 | } 18 | 19 | class private func cachesDirectory() -> URL? { 20 | return FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first 21 | } 22 | 23 | class func save(_ itemToSave: T, path: Path) -> Bool { 24 | guard let directory = cachesDirectory() else { 25 | print("could not save - no caches directory") 26 | return false 27 | } 28 | let file = directory.appendingPathComponent(path.rawValue) 29 | let encoder = JSONEncoder() 30 | encoder.dateEncodingStrategy = .iso8601 31 | do { 32 | let itemAsData = try encoder.encode(itemToSave) 33 | // check for existing file 34 | if FileManager.default.fileExists(atPath: file.path) { 35 | try FileManager.default.removeItem(at: file) 36 | } 37 | // add the file 38 | FileManager.default.createFile(atPath: file.path, contents: itemAsData, attributes: nil) 39 | } catch { 40 | print(error) 41 | return false 42 | } 43 | return true 44 | } 45 | 46 | class func load(path: Path) -> T? { 47 | guard let directory = cachesDirectory() else { 48 | print("could not load - no caches directory") 49 | return nil 50 | } 51 | 52 | let file = directory.appendingPathComponent(path.rawValue) 53 | if !FileManager.default.fileExists(atPath: file.path) { 54 | print("could not load - no file at expected path") 55 | return nil 56 | } 57 | guard let itemAsData = FileManager.default.contents(atPath: directory.path) else { 58 | print("could not load - no data in file at expected path") 59 | return nil 60 | } 61 | 62 | let decoder = JSONDecoder() 63 | decoder.dateDecodingStrategy = .iso8601 64 | do { 65 | let item = try decoder.decode(T.self, from: itemAsData) 66 | return item 67 | } catch { 68 | print(error) 69 | return nil 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /grokSwiftREST/View Controllers/LoginViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoginViewController.swift 3 | // grokSwiftREST 4 | // 5 | // Created by Christina Moulton on 2018-03-26. 6 | // Copyright © 2018 Christina Moulton. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol LoginViewDelegate: class { 12 | func didTapLoginButton() 13 | } 14 | 15 | class LoginViewController: UIViewController { 16 | weak var delegate: LoginViewDelegate? 17 | 18 | @IBAction func tappedLoginButton() { 19 | delegate?.didTapLoginButton() 20 | } 21 | } 22 | --------------------------------------------------------------------------------