├── .gitignore ├── .swiftlint.yml ├── 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 ├── Kingfisher │ ├── LICENSE │ ├── README.md │ └── Sources │ │ ├── AnimatedImageView.swift │ │ ├── Box.swift │ │ ├── CacheSerializer.swift │ │ ├── Filter.swift │ │ ├── Image.swift │ │ ├── ImageCache.swift │ │ ├── ImageDownloader.swift │ │ ├── ImagePrefetcher.swift │ │ ├── ImageProcessor.swift │ │ ├── ImageTransition.swift │ │ ├── ImageView+Kingfisher.swift │ │ ├── Indicator.swift │ │ ├── Kingfisher.h │ │ ├── Kingfisher.swift │ │ ├── KingfisherManager.swift │ │ ├── KingfisherOptionsInfo.swift │ │ ├── RequrstModifier.swift │ │ ├── Resource.swift │ │ ├── String+MD5.swift │ │ ├── ThreadHelper.swift │ │ └── UIButton+Kingfisher.swift ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj ├── SwiftGen │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── bin │ │ └── swiftgen │ ├── file.zip │ ├── lib │ │ ├── Commander.framework │ │ │ ├── Commander │ │ │ ├── Headers │ │ │ │ ├── Commander-Swift.h │ │ │ │ └── Commander-umbrella.h │ │ │ ├── Modules │ │ │ │ ├── Commander.swiftmodule │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ └── x86_64.swiftmodule │ │ │ │ └── module.modulemap │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ └── Versions │ │ │ │ ├── A │ │ │ │ ├── Commander │ │ │ │ ├── Headers │ │ │ │ │ ├── Commander-Swift.h │ │ │ │ │ └── Commander-umbrella.h │ │ │ │ ├── Modules │ │ │ │ │ ├── Commander.swiftmodule │ │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ │ └── x86_64.swiftmodule │ │ │ │ │ └── module.modulemap │ │ │ │ ├── Resources │ │ │ │ │ └── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ │ └── CodeResources │ │ │ │ └── Current │ │ │ │ ├── Commander │ │ │ │ ├── Headers │ │ │ │ ├── Commander-Swift.h │ │ │ │ └── Commander-umbrella.h │ │ │ │ ├── Modules │ │ │ │ ├── Commander.swiftmodule │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ └── x86_64.swiftmodule │ │ │ │ └── module.modulemap │ │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ ├── GenumKit.framework │ │ │ ├── GenumKit │ │ │ ├── Headers │ │ │ │ ├── GenumKit-Swift.h │ │ │ │ └── GenumKit-umbrella.h │ │ │ ├── Modules │ │ │ │ ├── GenumKit.swiftmodule │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ └── x86_64.swiftmodule │ │ │ │ └── module.modulemap │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ └── Versions │ │ │ │ ├── A │ │ │ │ ├── GenumKit │ │ │ │ ├── Headers │ │ │ │ │ ├── GenumKit-Swift.h │ │ │ │ │ └── GenumKit-umbrella.h │ │ │ │ ├── Modules │ │ │ │ │ ├── GenumKit.swiftmodule │ │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ │ └── x86_64.swiftmodule │ │ │ │ │ └── module.modulemap │ │ │ │ ├── Resources │ │ │ │ │ └── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ │ └── CodeResources │ │ │ │ └── Current │ │ │ │ ├── GenumKit │ │ │ │ ├── Headers │ │ │ │ ├── GenumKit-Swift.h │ │ │ │ └── GenumKit-umbrella.h │ │ │ │ ├── Modules │ │ │ │ ├── GenumKit.swiftmodule │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ └── x86_64.swiftmodule │ │ │ │ └── module.modulemap │ │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ ├── PathKit.framework │ │ │ ├── Headers │ │ │ │ ├── PathKit-Swift.h │ │ │ │ └── PathKit-umbrella.h │ │ │ ├── Modules │ │ │ │ ├── PathKit.swiftmodule │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ └── x86_64.swiftmodule │ │ │ │ └── module.modulemap │ │ │ ├── PathKit │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ └── Versions │ │ │ │ ├── A │ │ │ │ ├── Headers │ │ │ │ │ ├── PathKit-Swift.h │ │ │ │ │ └── PathKit-umbrella.h │ │ │ │ ├── Modules │ │ │ │ │ ├── PathKit.swiftmodule │ │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ │ └── x86_64.swiftmodule │ │ │ │ │ └── module.modulemap │ │ │ │ ├── PathKit │ │ │ │ ├── Resources │ │ │ │ │ └── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ │ └── CodeResources │ │ │ │ └── Current │ │ │ │ ├── Headers │ │ │ │ ├── PathKit-Swift.h │ │ │ │ └── PathKit-umbrella.h │ │ │ │ ├── Modules │ │ │ │ ├── PathKit.swiftmodule │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ └── x86_64.swiftmodule │ │ │ │ └── module.modulemap │ │ │ │ ├── PathKit │ │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ ├── Stencil.framework │ │ │ ├── Headers │ │ │ │ ├── Stencil-Swift.h │ │ │ │ └── Stencil-umbrella.h │ │ │ ├── Modules │ │ │ │ ├── Stencil.swiftmodule │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ └── x86_64.swiftmodule │ │ │ │ └── module.modulemap │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ ├── Stencil │ │ │ └── Versions │ │ │ │ ├── A │ │ │ │ ├── Headers │ │ │ │ │ ├── Stencil-Swift.h │ │ │ │ │ └── Stencil-umbrella.h │ │ │ │ ├── Modules │ │ │ │ │ ├── Stencil.swiftmodule │ │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ │ └── x86_64.swiftmodule │ │ │ │ │ └── module.modulemap │ │ │ │ ├── Resources │ │ │ │ │ └── Info.plist │ │ │ │ ├── Stencil │ │ │ │ └── _CodeSignature │ │ │ │ │ └── CodeResources │ │ │ │ └── Current │ │ │ │ ├── Headers │ │ │ │ ├── Stencil-Swift.h │ │ │ │ └── Stencil-umbrella.h │ │ │ │ ├── Modules │ │ │ │ ├── Stencil.swiftmodule │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ └── x86_64.swiftmodule │ │ │ │ └── module.modulemap │ │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ │ ├── Stencil │ │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ ├── libswiftAppKit.dylib │ │ ├── libswiftCore.dylib │ │ ├── libswiftCoreData.dylib │ │ ├── libswiftCoreGraphics.dylib │ │ ├── libswiftCoreImage.dylib │ │ ├── libswiftDarwin.dylib │ │ ├── libswiftDispatch.dylib │ │ ├── libswiftFoundation.dylib │ │ ├── libswiftIOKit.dylib │ │ └── libswiftObjectiveC.dylib │ └── templates │ │ ├── colors-default.stencil │ │ ├── colors-rawValue.stencil │ │ ├── colors-swift3.stencil │ │ ├── fonts-default.stencil │ │ ├── fonts-swift3.stencil │ │ ├── images-allvalues.stencil │ │ ├── images-default.stencil │ │ ├── images-swift3.stencil │ │ ├── storyboards-default.stencil │ │ ├── storyboards-lowercase.stencil │ │ ├── storyboards-osx-default.stencil │ │ ├── storyboards-osx-lowercase.stencil │ │ ├── storyboards-swift3.stencil │ │ ├── storyboards-uppercase.stencil │ │ ├── strings-default.stencil │ │ ├── strings-dot-syntax-swift3.stencil │ │ ├── strings-dot-syntax.stencil │ │ ├── strings-genstrings.stencil │ │ ├── strings-structured.stencil │ │ └── strings-swift3.stencil ├── Swinject │ ├── LICENSE.txt │ ├── README.md │ └── Sources │ │ ├── Assembler.swift │ │ ├── AssemblyType.swift │ │ ├── Container.Arguments.swift │ │ ├── Container.swift │ │ ├── FunctionType.swift │ │ ├── ObjectScope.swift │ │ ├── ResolutionPool.swift │ │ ├── ResolverType.swift │ │ ├── ServiceEntry.swift │ │ ├── ServiceKey.swift │ │ ├── SpinLock.swift │ │ ├── Swinject.h │ │ ├── SynchronizedResolver.Arguments.swift │ │ ├── SynchronizedResolver.swift │ │ └── _ResolverType.swift ├── SwinjectStoryboard │ ├── LICENSE.txt │ ├── README.md │ └── Sources │ │ ├── Box.swift │ │ ├── Container+SwinjectStoryboard.swift │ │ ├── RegistrationNameAssociatable.swift │ │ ├── Storyboard+Swizzling.swift │ │ ├── SwinjectStoryboard+StoryboardReference.swift │ │ ├── SwinjectStoryboard.h │ │ ├── SwinjectStoryboard.swift │ │ ├── SwinjectStoryboardOption.swift │ │ ├── SwinjectStoryboardType.swift │ │ ├── ViewController+Swinject.swift │ │ └── iOS-tvOS │ │ ├── _SwinjectStoryboardBase.h │ │ └── _SwinjectStoryboardBase.m └── Target Support Files │ ├── Alamofire │ ├── Alamofire-dummy.m │ ├── Alamofire-prefix.pch │ ├── Alamofire-umbrella.h │ ├── Alamofire.modulemap │ ├── Alamofire.xcconfig │ └── Info.plist │ ├── Kingfisher │ ├── Info.plist │ ├── Kingfisher-dummy.m │ ├── Kingfisher-prefix.pch │ ├── Kingfisher-umbrella.h │ ├── Kingfisher.modulemap │ └── Kingfisher.xcconfig │ ├── Pods-SwiftIntro │ ├── Info.plist │ ├── Pods-SwiftIntro-acknowledgements.markdown │ ├── Pods-SwiftIntro-acknowledgements.plist │ ├── Pods-SwiftIntro-dummy.m │ ├── Pods-SwiftIntro-frameworks.sh │ ├── Pods-SwiftIntro-resources.sh │ ├── Pods-SwiftIntro-umbrella.h │ ├── Pods-SwiftIntro.debug.xcconfig │ ├── Pods-SwiftIntro.modulemap │ └── Pods-SwiftIntro.release.xcconfig │ ├── Swinject │ ├── Info.plist │ ├── Swinject-dummy.m │ ├── Swinject-prefix.pch │ ├── Swinject-umbrella.h │ ├── Swinject.modulemap │ └── Swinject.xcconfig │ └── SwinjectStoryboard │ ├── Info.plist │ ├── SwinjectStoryboard-dummy.m │ ├── SwinjectStoryboard-prefix.pch │ ├── SwinjectStoryboard-umbrella.h │ ├── SwinjectStoryboard.modulemap │ └── SwinjectStoryboard.xcconfig ├── README.md ├── SwiftIntro.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── SwiftIntro.xcworkspace └── contents.xcworkspacedata └── SwiftIntro ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json ├── first.imageset │ ├── Contents.json │ └── first.pdf └── second.imageset │ ├── Contents.json │ └── second.pdf ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── DataSourceAndDelegates └── MemoryDataSourceAndDelegate.swift ├── Enums ├── Error.swift ├── Generated │ └── Strings.swift └── Level.swift ├── Extensions ├── Array_Extension.swift ├── NSObject_Extension.swift ├── UIButton_Extension.swift ├── UILabel_Extension.swift └── UIView_Extension.swift ├── HTTP ├── APIClient.swift ├── HTTPClient.swift ├── ImagePrefetcher.swift ├── Request_Extension.swift └── Router.swift ├── Models ├── DTO │ ├── GameConfiguration.swift │ └── GameResult.swift └── FromJSON │ ├── Card.swift │ ├── Cards.swift │ └── Result.swift ├── Protocols ├── APIClientProtocol.swift ├── CellProtocol.swift ├── Configurable.swift ├── HTTPClientProtocol.swift └── Model.swift ├── SupportingFiles ├── AppDelegate.swift ├── DependencyInjectionConfigurator.swift ├── Info.plist ├── Macros.swift ├── en.lproj │ └── Localizable.strings └── sv.lproj │ └── Localizable.strings ├── ViewControllers ├── GameOverVC.swift ├── GameVC.swift ├── LoadingDataVC.swift └── SettingsVC.swift └── Views └── Cells └── CollectionViewCells └── CardCVCell ├── CardCVCell.swift └── CardCVCell.xib /.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 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/screenshots 64 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: 2 | - trailing_newline 3 | - trailing_whitespace 4 | - todo 5 | included: 6 | - SwiftIntro 7 | excluded: 8 | - Carthage 9 | - Pods 10 | - SwiftIntro/Enums/Generated 11 | - SwiftIntro/HTTP/Request_Extension.swift 12 | line_length: 200 13 | type_name: 14 | min_length: 4 15 | max_length: 16 | warning: 80 17 | error: 120 18 | type_body_length: 19 | warning: 300 20 | error: 400 21 | 22 | function_parameter_count: 23 | warning: 4 24 | error: 5 25 | 26 | function_body_length: 27 | warning: 15 28 | error: 20 -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '9.0' 3 | use_frameworks! 4 | 5 | target 'SwiftIntro' do 6 | pod 'Alamofire', '~> 4.0.1' 7 | pod 'Kingfisher', '~> 3.1' 8 | pod 'Swinject', '2.0.0-beta.2' 9 | pod 'SwinjectStoryboard', '1.0.0-beta.2' 10 | pod 'SwiftGen', '~> 3.0' 11 | end 12 | 13 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (4.0.1) 3 | - Kingfisher (3.1.0) 4 | - SwiftGen (3.0.0) 5 | - Swinject (2.0.0-beta.2) 6 | - SwinjectStoryboard (1.0.0-beta.2): 7 | - Swinject (= 2.0.0-beta.2) 8 | 9 | DEPENDENCIES: 10 | - Alamofire (~> 4.0.1) 11 | - Kingfisher (~> 3.1) 12 | - SwiftGen (~> 3.0) 13 | - Swinject (= 2.0.0-beta.2) 14 | - SwinjectStoryboard (= 1.0.0-beta.2) 15 | 16 | SPEC CHECKSUMS: 17 | Alamofire: 7682d43245de14874acd142ec137b144aa1dd335 18 | Kingfisher: 7779f22e977393e9533a89a9685beb8f679d3767 19 | SwiftGen: f679cd0ed4173a5da3b01efd0da23542bf82f6ab 20 | Swinject: 69a893192efa9f2cc44be79ef423d04d571b6af9 21 | SwinjectStoryboard: b52b45821a50386ef604c3cd098f8029a50a268d 22 | 23 | PODFILE CHECKSUM: 79be467363f6960f36ff5bb9b1e1fc1100c3ae26 24 | 25 | COCOAPODS: 1.1.1 26 | -------------------------------------------------------------------------------- /Pods/Alamofire/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2016 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-2016 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 | func syncResult(_ closure: () -> T) -> T { 39 | var result: T! 40 | sync { result = closure() } 41 | return result 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/Notifications.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Notifications.swift 3 | // 4 | // Copyright (c) 2014-2016 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 | } 53 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/Result.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Result.swift 3 | // 4 | // Copyright (c) 2014-2016 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 | /// Used to represent whether a request was successful or encountered an error. 28 | /// 29 | /// - success: The request and all post processing operations were successful resulting in the serialization of the 30 | /// provided associated value. 31 | /// 32 | /// - failure: The request encountered an error resulting in a failure. The associated values are the original data 33 | /// provided by the server as well as the error that caused the failure. 34 | public enum Result { 35 | case success(Value) 36 | case failure(Error) 37 | 38 | /// Returns `true` if the result is a success, `false` otherwise. 39 | public var isSuccess: Bool { 40 | switch self { 41 | case .success: 42 | return true 43 | case .failure: 44 | return false 45 | } 46 | } 47 | 48 | /// Returns `true` if the result is a failure, `false` otherwise. 49 | public var isFailure: Bool { 50 | return !isSuccess 51 | } 52 | 53 | /// Returns the associated value if the result is a success, `nil` otherwise. 54 | public var value: Value? { 55 | switch self { 56 | case .success(let value): 57 | return value 58 | case .failure: 59 | return nil 60 | } 61 | } 62 | 63 | /// Returns the associated error value if the result is a failure, `nil` otherwise. 64 | public var error: Error? { 65 | switch self { 66 | case .success: 67 | return nil 68 | case .failure(let error): 69 | return error 70 | } 71 | } 72 | } 73 | 74 | // MARK: - CustomStringConvertible 75 | 76 | extension Result: CustomStringConvertible { 77 | /// The textual representation used when written to an output stream, which includes whether the result was a 78 | /// success or failure. 79 | public var description: String { 80 | switch self { 81 | case .success: 82 | return "SUCCESS" 83 | case .failure: 84 | return "FAILURE" 85 | } 86 | } 87 | } 88 | 89 | // MARK: - CustomDebugStringConvertible 90 | 91 | extension Result: CustomDebugStringConvertible { 92 | /// The debug textual representation used when written to an output stream, which includes whether the result was a 93 | /// success or failure in addition to the value or error. 94 | public var debugDescription: String { 95 | switch self { 96 | case .success(let value): 97 | return "SUCCESS: \(value)" 98 | case .failure(let error): 99 | return "FAILURE: \(error)" 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /Pods/Kingfisher/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Wei Wang 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 | 23 | -------------------------------------------------------------------------------- /Pods/Kingfisher/Sources/Box.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Box.swift 3 | // Kingfisher 4 | // 5 | // Created by WANG WEI on 2016/09/12. 6 | // Copyright © 2016年 Wei Wang. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class Box { 12 | let value: T 13 | init(value: T) { 14 | self.value = value 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Pods/Kingfisher/Sources/CacheSerializer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CacheSerializer.swift 3 | // Kingfisher 4 | // 5 | // Created by Wei Wang on 2016/09/02. 6 | // 7 | // Copyright (c) 2016 Wei Wang 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | 29 | /// An `CacheSerializer` would be used to convert some data to an image object for 30 | /// retrieving from disk cache and vice versa for storing to disk cache. 31 | public protocol CacheSerializer { 32 | 33 | /// Get the serialized data from a provided image 34 | /// and optional original data for caching to disk. 35 | /// 36 | /// 37 | /// - parameter image: The image needed to be serialized. 38 | /// - parameter original: The original data which is just downloaded. 39 | /// If the image is retrieved from cache instead of 40 | /// downloaded, it will be `nil`. 41 | /// 42 | /// - returns: A data which will be stored to cache, or `nil` when no valid 43 | /// data could be serialized. 44 | func data(with image: Image, original: Data?) -> Data? 45 | 46 | /// Get an image deserialized from provided data. 47 | /// 48 | /// - parameter data: The data from which an image should be deserialized. 49 | /// - parameter options: Options for deserialization. 50 | /// 51 | /// - returns: An image deserialized or `nil` when no valid image 52 | /// could be deserialized. 53 | func image(with data: Data, options: KingfisherOptionsInfo?) -> Image? 54 | } 55 | 56 | 57 | /// `DefaultCacheSerializer` is a basic `CacheSerializer` used in default cache of 58 | /// Kingfisher. It could serialize and deserialize PNG, JEPG and GIF images. For 59 | /// image other than these formats, a normalized `pngRepresentation` will be used. 60 | public struct DefaultCacheSerializer: CacheSerializer { 61 | 62 | public static let `default` = DefaultCacheSerializer() 63 | private init() {} 64 | 65 | public func data(with image: Image, original: Data?) -> Data? { 66 | let imageFormat = original?.kf.imageFormat ?? .unknown 67 | 68 | let data: Data? 69 | switch imageFormat { 70 | case .PNG: data = image.kf.pngRepresentation() 71 | case .JPEG: data = image.kf.jpegRepresentation(compressionQuality: 1.0) 72 | case .GIF: data = image.kf.gifRepresentation() 73 | case .unknown: data = original ?? image.kf.normalized.kf.pngRepresentation() 74 | } 75 | 76 | return data 77 | } 78 | 79 | public func image(with data: Data, options: KingfisherOptionsInfo?) -> Image? { 80 | let scale = (options ?? KingfisherEmptyOptionsInfo).scaleFactor 81 | let preloadAllGIFData = (options ?? KingfisherEmptyOptionsInfo).preloadAllGIFData 82 | 83 | return Kingfisher.image(data: data, scale: scale, preloadAllGIFData: preloadAllGIFData) 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Pods/Kingfisher/Sources/Kingfisher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Kingfisher.h 3 | // Kingfisher 4 | // 5 | // Created by Wei Wang on 15/4/6. 6 | // 7 | // Copyright (c) 2016 Wei Wang 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | #import 28 | 29 | //! Project version number for Kingfisher. 30 | FOUNDATION_EXPORT double KingfisherVersionNumber; 31 | 32 | //! Project version string for Kingfisher. 33 | FOUNDATION_EXPORT const unsigned char KingfisherVersionString[]; 34 | 35 | // In this header, you should import all the public headers of your framework using statements like #import 36 | 37 | 38 | -------------------------------------------------------------------------------- /Pods/Kingfisher/Sources/Kingfisher.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Kingfisher.swift 3 | // Kingfisher 4 | // 5 | // Created by Wei Wang on 16/9/14. 6 | // 7 | // Copyright (c) 2016 Wei Wang 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | import ImageIO 29 | 30 | #if os(macOS) 31 | import AppKit 32 | public typealias Image = NSImage 33 | public typealias Color = NSColor 34 | public typealias ImageView = NSImageView 35 | typealias Button = NSButton 36 | #else 37 | import UIKit 38 | public typealias Image = UIImage 39 | public typealias Color = UIColor 40 | #if !os(watchOS) 41 | public typealias ImageView = UIImageView 42 | typealias Button = UIButton 43 | #endif 44 | #endif 45 | 46 | public struct Kingfisher { 47 | public let base: Base 48 | public init(_ base: Base) { 49 | self.base = base 50 | } 51 | } 52 | 53 | /** 54 | A type that has Kingfisher extensions. 55 | */ 56 | public protocol KingfisherCompatible { 57 | associatedtype CompatibleType 58 | var kf: CompatibleType { get } 59 | } 60 | 61 | public extension KingfisherCompatible { 62 | public var kf: Kingfisher { 63 | get { return Kingfisher(self) } 64 | set { } 65 | } 66 | } 67 | 68 | extension Image: KingfisherCompatible { } 69 | #if !os(watchOS) 70 | extension ImageView: KingfisherCompatible { } 71 | extension Button: KingfisherCompatible { } 72 | #endif 73 | -------------------------------------------------------------------------------- /Pods/Kingfisher/Sources/RequrstModifier.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RequrstModifier.swift 3 | // Kingfisher 4 | // 5 | // Created by Wei Wang on 2016/09/05. 6 | // 7 | // Copyright (c) 2016 Wei Wang 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | 29 | /// Request modifier of image downloader. 30 | public protocol ImageDownloadRequestModifier { 31 | func modified(for request: URLRequest) -> URLRequest? 32 | } 33 | 34 | struct NoModifier: ImageDownloadRequestModifier { 35 | static let `default` = NoModifier() 36 | private init() {} 37 | func modified(for request: URLRequest) -> URLRequest? { 38 | return request 39 | } 40 | } 41 | 42 | public struct AnyModifier: ImageDownloadRequestModifier { 43 | 44 | let block: (URLRequest) -> URLRequest? 45 | 46 | public func modified(for request: URLRequest) -> URLRequest? { 47 | return block(request) 48 | } 49 | 50 | public init(modify: @escaping (URLRequest) -> URLRequest? ) { 51 | block = modify 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Pods/Kingfisher/Sources/Resource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Resource.swift 3 | // Kingfisher 4 | // 5 | // Created by Wei Wang on 15/4/6. 6 | // 7 | // Copyright (c) 2016 Wei Wang 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | 29 | 30 | /// `Resource` protocol defines how to download and cache a resource from network. 31 | public protocol Resource { 32 | /// The key used in cache. 33 | var cacheKey: String { get } 34 | 35 | /// The target image URL. 36 | var downloadURL: URL { get } 37 | } 38 | 39 | /** 40 | ImageResource is a simple combination of `downloadURL` and `cacheKey`. 41 | 42 | When passed to image view set methods, Kingfisher will try to download the target 43 | image from the `downloadURL`, and then store it with the `cacheKey` as the key in cache. 44 | */ 45 | public struct ImageResource: Resource { 46 | /// The key used in cache. 47 | public let cacheKey: String 48 | 49 | /// The target image URL. 50 | public let downloadURL: URL 51 | 52 | /** 53 | Create a resource. 54 | 55 | - parameter downloadURL: The target image URL. 56 | - parameter cacheKey: The cache key. If `nil`, Kingfisher will use the `absoluteString` of `downloadURL` as the key. 57 | 58 | - returns: A resource. 59 | */ 60 | public init(downloadURL: URL, cacheKey: String? = nil) { 61 | self.downloadURL = downloadURL 62 | self.cacheKey = cacheKey ?? downloadURL.absoluteString 63 | } 64 | } 65 | 66 | /** 67 | URL conforms to `Resource` in Kingfisher. 68 | The `absoluteString` of this URL is used as `cacheKey`. And the URL itself will be used as `downloadURL`. 69 | If you need customize the url and/or cache key, use `ImageResource` instead. 70 | */ 71 | extension URL: Resource { 72 | public var cacheKey: String { return absoluteString } 73 | public var downloadURL: URL { return self } 74 | } 75 | -------------------------------------------------------------------------------- /Pods/Kingfisher/Sources/ThreadHelper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ThreadHelper.swift 3 | // Kingfisher 4 | // 5 | // Created by Wei Wang on 15/10/9. 6 | // 7 | // Copyright (c) 2016 Wei Wang 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | 29 | extension DispatchQueue { 30 | // This method will dispatch the `block` to self. 31 | // If `self` is the main queue, and current thread is main thread, the block 32 | // will be invoked immediately instead of being dispatched. 33 | func safeAsync(_ block: @escaping ()->()) { 34 | if self === DispatchQueue.main && Thread.isMainThread { 35 | block() 36 | } else { 37 | async { block() } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (4.0.1) 3 | - Kingfisher (3.1.0) 4 | - SwiftGen (3.0.0) 5 | - Swinject (2.0.0-beta.2) 6 | - SwinjectStoryboard (1.0.0-beta.2): 7 | - Swinject (= 2.0.0-beta.2) 8 | 9 | DEPENDENCIES: 10 | - Alamofire (~> 4.0.1) 11 | - Kingfisher (~> 3.1) 12 | - SwiftGen (~> 3.0) 13 | - Swinject (= 2.0.0-beta.2) 14 | - SwinjectStoryboard (= 1.0.0-beta.2) 15 | 16 | SPEC CHECKSUMS: 17 | Alamofire: 7682d43245de14874acd142ec137b144aa1dd335 18 | Kingfisher: 7779f22e977393e9533a89a9685beb8f679d3767 19 | SwiftGen: f679cd0ed4173a5da3b01efd0da23542bf82f6ab 20 | Swinject: 69a893192efa9f2cc44be79ef423d04d571b6af9 21 | SwinjectStoryboard: b52b45821a50386ef604c3cd098f8029a50a268d 22 | 23 | PODFILE CHECKSUM: 79be467363f6960f36ff5bb9b1e1fc1100c3ae26 24 | 25 | COCOAPODS: 1.1.1 26 | -------------------------------------------------------------------------------- /Pods/SwiftGen/LICENSE: -------------------------------------------------------------------------------- 1 | - MIT LICENSE - 2 | 3 | Copyright (c) 2015 Olivier Halligon 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /Pods/SwiftGen/bin/swiftgen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/bin/swiftgen -------------------------------------------------------------------------------- /Pods/SwiftGen/file.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/file.zip -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Commander: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Commander.framework/Commander -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Headers/Commander-Swift.h: -------------------------------------------------------------------------------- 1 | // Generated by Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31) 2 | #pragma clang diagnostic push 3 | 4 | #if defined(__has_include) && __has_include() 5 | # include 6 | #endif 7 | 8 | #pragma clang diagnostic ignored "-Wauto-import" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #if !defined(SWIFT_TYPEDEFS) 15 | # define SWIFT_TYPEDEFS 1 16 | # if defined(__has_include) && __has_include() 17 | # include 18 | # elif !defined(__cplusplus) || __cplusplus < 201103L 19 | typedef uint_least16_t char16_t; 20 | typedef uint_least32_t char32_t; 21 | # endif 22 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 23 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 24 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 25 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 26 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 27 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 28 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 29 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 30 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 31 | #endif 32 | 33 | #if !defined(SWIFT_PASTE) 34 | # define SWIFT_PASTE_HELPER(x, y) x##y 35 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 36 | #endif 37 | #if !defined(SWIFT_METATYPE) 38 | # define SWIFT_METATYPE(X) Class 39 | #endif 40 | 41 | #if defined(__has_attribute) && __has_attribute(objc_runtime_name) 42 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 43 | #else 44 | # define SWIFT_RUNTIME_NAME(X) 45 | #endif 46 | #if defined(__has_attribute) && __has_attribute(swift_name) 47 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 48 | #else 49 | # define SWIFT_COMPILE_NAME(X) 50 | #endif 51 | #if !defined(SWIFT_CLASS_EXTRA) 52 | # define SWIFT_CLASS_EXTRA 53 | #endif 54 | #if !defined(SWIFT_PROTOCOL_EXTRA) 55 | # define SWIFT_PROTOCOL_EXTRA 56 | #endif 57 | #if !defined(SWIFT_ENUM_EXTRA) 58 | # define SWIFT_ENUM_EXTRA 59 | #endif 60 | #if !defined(SWIFT_CLASS) 61 | # if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) 62 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 63 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 64 | # else 65 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 66 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 67 | # endif 68 | #endif 69 | 70 | #if !defined(SWIFT_PROTOCOL) 71 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 72 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 73 | #endif 74 | 75 | #if !defined(SWIFT_EXTENSION) 76 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 77 | #endif 78 | 79 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 80 | # if defined(__has_attribute) && __has_attribute(objc_designated_initializer) 81 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 82 | # else 83 | # define OBJC_DESIGNATED_INITIALIZER 84 | # endif 85 | #endif 86 | #if !defined(SWIFT_ENUM) 87 | # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type 88 | # if defined(__has_feature) && __has_feature(generalized_swift_name) 89 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type 90 | # else 91 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) 92 | # endif 93 | #endif 94 | #if defined(__has_feature) && __has_feature(modules) 95 | #endif 96 | 97 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 98 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 99 | #pragma clang diagnostic pop 100 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Headers/Commander-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double CommanderVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char CommanderVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Modules/Commander.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Commander.framework/Modules/Commander.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Modules/Commander.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Commander.framework/Modules/Commander.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Commander { 2 | umbrella header "Commander-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module Commander.Swift { 9 | header "Commander-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 15G1004 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Commander 11 | CFBundleIdentifier 12 | org.cocoapods.Commander 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Commander 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.4.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 7D1014 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 15E60 37 | DTSDKName 38 | macosx10.11 39 | DTXcode 40 | 0731 41 | DTXcodeBuild 42 | 7D1014 43 | 44 | 45 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Versions/A/Commander: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Commander.framework/Versions/A/Commander -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Versions/A/Headers/Commander-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double CommanderVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char CommanderVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Versions/A/Modules/Commander.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Commander.framework/Versions/A/Modules/Commander.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Versions/A/Modules/Commander.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Commander.framework/Versions/A/Modules/Commander.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Commander { 2 | umbrella header "Commander-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module Commander.Swift { 9 | header "Commander-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 15G1004 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Commander 11 | CFBundleIdentifier 12 | org.cocoapods.Commander 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Commander 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.4.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 7D1014 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 15E60 37 | DTSDKName 38 | macosx10.11 39 | DTXcode 40 | 0731 41 | DTXcodeBuild 42 | 7D1014 43 | 44 | 45 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Versions/Current/Commander: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Commander.framework/Versions/Current/Commander -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Versions/Current/Headers/Commander-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double CommanderVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char CommanderVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Versions/Current/Modules/Commander.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Commander.framework/Versions/Current/Modules/Commander.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Versions/Current/Modules/Commander.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Commander.framework/Versions/Current/Modules/Commander.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Versions/Current/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Commander { 2 | umbrella header "Commander-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module Commander.Swift { 9 | header "Commander-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Commander.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 15G1004 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Commander 11 | CFBundleIdentifier 12 | org.cocoapods.Commander 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Commander 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.4.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 7D1014 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 15E60 37 | DTSDKName 38 | macosx10.11 39 | DTXcode 40 | 0731 41 | DTXcodeBuild 42 | 7D1014 43 | 44 | 45 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/GenumKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/GenumKit.framework/GenumKit -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Headers/GenumKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double GenumKitVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char GenumKitVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Modules/GenumKit.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/GenumKit.framework/Modules/GenumKit.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Modules/GenumKit.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/GenumKit.framework/Modules/GenumKit.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module GenumKit { 2 | umbrella header "GenumKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module GenumKit.Swift { 9 | header "GenumKit-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 15G1004 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | GenumKit 11 | CFBundleIdentifier 12 | org.cocoapods.GenumKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | GenumKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 3.0.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 7D1014 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 15E60 37 | DTSDKName 38 | macosx10.11 39 | DTXcode 40 | 0731 41 | DTXcodeBuild 42 | 7D1014 43 | 44 | 45 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Versions/A/GenumKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/GenumKit.framework/Versions/A/GenumKit -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Versions/A/Headers/GenumKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double GenumKitVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char GenumKitVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Versions/A/Modules/GenumKit.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/GenumKit.framework/Versions/A/Modules/GenumKit.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Versions/A/Modules/GenumKit.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/GenumKit.framework/Versions/A/Modules/GenumKit.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module GenumKit { 2 | umbrella header "GenumKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module GenumKit.Swift { 9 | header "GenumKit-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 15G1004 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | GenumKit 11 | CFBundleIdentifier 12 | org.cocoapods.GenumKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | GenumKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 3.0.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 7D1014 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 15E60 37 | DTSDKName 38 | macosx10.11 39 | DTXcode 40 | 0731 41 | DTXcodeBuild 42 | 7D1014 43 | 44 | 45 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Versions/Current/GenumKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/GenumKit.framework/Versions/Current/GenumKit -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Versions/Current/Headers/GenumKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double GenumKitVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char GenumKitVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Versions/Current/Modules/GenumKit.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/GenumKit.framework/Versions/Current/Modules/GenumKit.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Versions/Current/Modules/GenumKit.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/GenumKit.framework/Versions/Current/Modules/GenumKit.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Versions/Current/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module GenumKit { 2 | umbrella header "GenumKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module GenumKit.Swift { 9 | header "GenumKit-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/GenumKit.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 15G1004 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | GenumKit 11 | CFBundleIdentifier 12 | org.cocoapods.GenumKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | GenumKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 3.0.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 7D1014 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 15E60 37 | DTSDKName 38 | macosx10.11 39 | DTXcode 40 | 0731 41 | DTXcodeBuild 42 | 7D1014 43 | 44 | 45 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Headers/PathKit-Swift.h: -------------------------------------------------------------------------------- 1 | // Generated by Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31) 2 | #pragma clang diagnostic push 3 | 4 | #if defined(__has_include) && __has_include() 5 | # include 6 | #endif 7 | 8 | #pragma clang diagnostic ignored "-Wauto-import" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #if !defined(SWIFT_TYPEDEFS) 15 | # define SWIFT_TYPEDEFS 1 16 | # if defined(__has_include) && __has_include() 17 | # include 18 | # elif !defined(__cplusplus) || __cplusplus < 201103L 19 | typedef uint_least16_t char16_t; 20 | typedef uint_least32_t char32_t; 21 | # endif 22 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 23 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 24 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 25 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 26 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 27 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 28 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 29 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 30 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 31 | #endif 32 | 33 | #if !defined(SWIFT_PASTE) 34 | # define SWIFT_PASTE_HELPER(x, y) x##y 35 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 36 | #endif 37 | #if !defined(SWIFT_METATYPE) 38 | # define SWIFT_METATYPE(X) Class 39 | #endif 40 | 41 | #if defined(__has_attribute) && __has_attribute(objc_runtime_name) 42 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 43 | #else 44 | # define SWIFT_RUNTIME_NAME(X) 45 | #endif 46 | #if defined(__has_attribute) && __has_attribute(swift_name) 47 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 48 | #else 49 | # define SWIFT_COMPILE_NAME(X) 50 | #endif 51 | #if !defined(SWIFT_CLASS_EXTRA) 52 | # define SWIFT_CLASS_EXTRA 53 | #endif 54 | #if !defined(SWIFT_PROTOCOL_EXTRA) 55 | # define SWIFT_PROTOCOL_EXTRA 56 | #endif 57 | #if !defined(SWIFT_ENUM_EXTRA) 58 | # define SWIFT_ENUM_EXTRA 59 | #endif 60 | #if !defined(SWIFT_CLASS) 61 | # if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) 62 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 63 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 64 | # else 65 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 66 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 67 | # endif 68 | #endif 69 | 70 | #if !defined(SWIFT_PROTOCOL) 71 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 72 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 73 | #endif 74 | 75 | #if !defined(SWIFT_EXTENSION) 76 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 77 | #endif 78 | 79 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 80 | # if defined(__has_attribute) && __has_attribute(objc_designated_initializer) 81 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 82 | # else 83 | # define OBJC_DESIGNATED_INITIALIZER 84 | # endif 85 | #endif 86 | #if !defined(SWIFT_ENUM) 87 | # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type 88 | # if defined(__has_feature) && __has_feature(generalized_swift_name) 89 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type 90 | # else 91 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) 92 | # endif 93 | #endif 94 | #if defined(__has_feature) && __has_feature(modules) 95 | #endif 96 | 97 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 98 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 99 | #pragma clang diagnostic pop 100 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Headers/PathKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double PathKitVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char PathKitVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Modules/PathKit.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/PathKit.framework/Modules/PathKit.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Modules/PathKit.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/PathKit.framework/Modules/PathKit.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module PathKit { 2 | umbrella header "PathKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module PathKit.Swift { 9 | header "PathKit-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/PathKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/PathKit.framework/PathKit -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 15G1004 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | PathKit 11 | CFBundleIdentifier 12 | org.cocoapods.PathKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | PathKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.6.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 7D1014 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 15E60 37 | DTSDKName 38 | macosx10.11 39 | DTXcode 40 | 0731 41 | DTXcodeBuild 42 | 7D1014 43 | 44 | 45 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Versions/A/Headers/PathKit-Swift.h: -------------------------------------------------------------------------------- 1 | // Generated by Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31) 2 | #pragma clang diagnostic push 3 | 4 | #if defined(__has_include) && __has_include() 5 | # include 6 | #endif 7 | 8 | #pragma clang diagnostic ignored "-Wauto-import" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #if !defined(SWIFT_TYPEDEFS) 15 | # define SWIFT_TYPEDEFS 1 16 | # if defined(__has_include) && __has_include() 17 | # include 18 | # elif !defined(__cplusplus) || __cplusplus < 201103L 19 | typedef uint_least16_t char16_t; 20 | typedef uint_least32_t char32_t; 21 | # endif 22 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 23 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 24 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 25 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 26 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 27 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 28 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 29 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 30 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 31 | #endif 32 | 33 | #if !defined(SWIFT_PASTE) 34 | # define SWIFT_PASTE_HELPER(x, y) x##y 35 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 36 | #endif 37 | #if !defined(SWIFT_METATYPE) 38 | # define SWIFT_METATYPE(X) Class 39 | #endif 40 | 41 | #if defined(__has_attribute) && __has_attribute(objc_runtime_name) 42 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 43 | #else 44 | # define SWIFT_RUNTIME_NAME(X) 45 | #endif 46 | #if defined(__has_attribute) && __has_attribute(swift_name) 47 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 48 | #else 49 | # define SWIFT_COMPILE_NAME(X) 50 | #endif 51 | #if !defined(SWIFT_CLASS_EXTRA) 52 | # define SWIFT_CLASS_EXTRA 53 | #endif 54 | #if !defined(SWIFT_PROTOCOL_EXTRA) 55 | # define SWIFT_PROTOCOL_EXTRA 56 | #endif 57 | #if !defined(SWIFT_ENUM_EXTRA) 58 | # define SWIFT_ENUM_EXTRA 59 | #endif 60 | #if !defined(SWIFT_CLASS) 61 | # if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) 62 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 63 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 64 | # else 65 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 66 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 67 | # endif 68 | #endif 69 | 70 | #if !defined(SWIFT_PROTOCOL) 71 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 72 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 73 | #endif 74 | 75 | #if !defined(SWIFT_EXTENSION) 76 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 77 | #endif 78 | 79 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 80 | # if defined(__has_attribute) && __has_attribute(objc_designated_initializer) 81 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 82 | # else 83 | # define OBJC_DESIGNATED_INITIALIZER 84 | # endif 85 | #endif 86 | #if !defined(SWIFT_ENUM) 87 | # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type 88 | # if defined(__has_feature) && __has_feature(generalized_swift_name) 89 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type 90 | # else 91 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) 92 | # endif 93 | #endif 94 | #if defined(__has_feature) && __has_feature(modules) 95 | #endif 96 | 97 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 98 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 99 | #pragma clang diagnostic pop 100 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Versions/A/Headers/PathKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double PathKitVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char PathKitVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Versions/A/Modules/PathKit.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/PathKit.framework/Versions/A/Modules/PathKit.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Versions/A/Modules/PathKit.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/PathKit.framework/Versions/A/Modules/PathKit.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module PathKit { 2 | umbrella header "PathKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module PathKit.Swift { 9 | header "PathKit-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Versions/A/PathKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/PathKit.framework/Versions/A/PathKit -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 15G1004 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | PathKit 11 | CFBundleIdentifier 12 | org.cocoapods.PathKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | PathKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.6.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 7D1014 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 15E60 37 | DTSDKName 38 | macosx10.11 39 | DTXcode 40 | 0731 41 | DTXcodeBuild 42 | 7D1014 43 | 44 | 45 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Versions/Current/Headers/PathKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double PathKitVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char PathKitVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Versions/Current/Modules/PathKit.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/PathKit.framework/Versions/Current/Modules/PathKit.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Versions/Current/Modules/PathKit.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/PathKit.framework/Versions/Current/Modules/PathKit.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Versions/Current/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module PathKit { 2 | umbrella header "PathKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module PathKit.Swift { 9 | header "PathKit-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Versions/Current/PathKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/PathKit.framework/Versions/Current/PathKit -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/PathKit.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 15G1004 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | PathKit 11 | CFBundleIdentifier 12 | org.cocoapods.PathKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | PathKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.6.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 7D1014 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 15E60 37 | DTSDKName 38 | macosx10.11 39 | DTXcode 40 | 0731 41 | DTXcodeBuild 42 | 7D1014 43 | 44 | 45 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Headers/Stencil-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double StencilVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char StencilVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Modules/Stencil.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Stencil.framework/Modules/Stencil.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Modules/Stencil.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Stencil.framework/Modules/Stencil.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Stencil { 2 | umbrella header "Stencil-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module Stencil.Swift { 9 | header "Stencil-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 15G1004 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Stencil 11 | CFBundleIdentifier 12 | org.cocoapods.Stencil 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Stencil 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.6.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 7D1014 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 15E60 37 | DTSDKName 38 | macosx10.11 39 | DTXcode 40 | 0731 41 | DTXcodeBuild 42 | 7D1014 43 | 44 | 45 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Stencil: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Stencil.framework/Stencil -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Versions/A/Headers/Stencil-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double StencilVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char StencilVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Versions/A/Modules/Stencil.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Stencil.framework/Versions/A/Modules/Stencil.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Versions/A/Modules/Stencil.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Stencil.framework/Versions/A/Modules/Stencil.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Stencil { 2 | umbrella header "Stencil-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module Stencil.Swift { 9 | header "Stencil-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 15G1004 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Stencil 11 | CFBundleIdentifier 12 | org.cocoapods.Stencil 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Stencil 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.6.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 7D1014 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 15E60 37 | DTSDKName 38 | macosx10.11 39 | DTXcode 40 | 0731 41 | DTXcodeBuild 42 | 7D1014 43 | 44 | 45 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Versions/A/Stencil: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Stencil.framework/Versions/A/Stencil -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Versions/Current/Headers/Stencil-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double StencilVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char StencilVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Versions/Current/Modules/Stencil.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Stencil.framework/Versions/Current/Modules/Stencil.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Versions/Current/Modules/Stencil.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Stencil.framework/Versions/Current/Modules/Stencil.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Versions/Current/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Stencil { 2 | umbrella header "Stencil-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module Stencil.Swift { 9 | header "Stencil-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 15G1004 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Stencil 11 | CFBundleIdentifier 12 | org.cocoapods.Stencil 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Stencil 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.6.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 7D1014 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 15E60 37 | DTSDKName 38 | macosx10.11 39 | DTXcode 40 | 0731 41 | DTXcodeBuild 42 | 7D1014 43 | 44 | 45 | -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/Stencil.framework/Versions/Current/Stencil: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/Stencil.framework/Versions/Current/Stencil -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/libswiftAppKit.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/libswiftAppKit.dylib -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/libswiftCore.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/libswiftCore.dylib -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/libswiftCoreData.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/libswiftCoreData.dylib -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/libswiftCoreGraphics.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/libswiftCoreGraphics.dylib -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/libswiftCoreImage.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/libswiftCoreImage.dylib -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/libswiftDarwin.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/libswiftDarwin.dylib -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/libswiftDispatch.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/libswiftDispatch.dylib -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/libswiftFoundation.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/libswiftFoundation.dylib -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/libswiftIOKit.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/libswiftIOKit.dylib -------------------------------------------------------------------------------- /Pods/SwiftGen/lib/libswiftObjectiveC.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/Pods/SwiftGen/lib/libswiftObjectiveC.dylib -------------------------------------------------------------------------------- /Pods/SwiftGen/templates/colors-default.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen 2 | 3 | #if os(iOS) || os(tvOS) || os(watchOS) 4 | import UIKit.UIColor 5 | typealias Color = UIColor 6 | #elseif os(OSX) 7 | import AppKit.NSColor 8 | typealias Color = NSColor 9 | #endif 10 | 11 | extension Color { 12 | convenience init(rgbaValue: UInt32) { 13 | let red = CGFloat((rgbaValue >> 24) & 0xff) / 255.0 14 | let green = CGFloat((rgbaValue >> 16) & 0xff) / 255.0 15 | let blue = CGFloat((rgbaValue >> 8) & 0xff) / 255.0 16 | let alpha = CGFloat((rgbaValue ) & 0xff) / 255.0 17 | 18 | self.init(red: red, green: green, blue: blue, alpha: alpha) 19 | } 20 | } 21 | 22 | {% if colors %} 23 | {# Note: We don't use a UInt32 rawValue in this template so we can have multiple colors with the same rgbaValue #} 24 | // swiftlint:disable file_length 25 | // swiftlint:disable type_body_length 26 | enum {{enumName}} { 27 | {% for color in colors %} 28 | /// 29 | /// Alpha: {{color.alpha|hexToInt|int255toFloat|percent}}
(0x{{color.rgba}}) 30 | case {{color.name|swiftIdentifier}} 31 | {% endfor %} 32 | 33 | var rgbaValue: UInt32 { 34 | switch self { 35 | {% for color in colors %} 36 | case .{{color.name|swiftIdentifier}}: return 0x{{color.rgba}} 37 | {% endfor %} 38 | } 39 | } 40 | 41 | var color: Color { 42 | return Color(named: self) 43 | } 44 | } 45 | // swiftlint:enable type_body_length 46 | 47 | extension Color { 48 | convenience init(named name: {{enumName}}) { 49 | self.init(rgbaValue: name.rgbaValue) 50 | } 51 | } 52 | {% else %} 53 | // No color found 54 | {% endif %} 55 | -------------------------------------------------------------------------------- /Pods/SwiftGen/templates/colors-rawValue.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen 2 | 3 | #if os(iOS) || os(tvOS) || os(watchOS) 4 | import UIKit.UIColor 5 | typealias Color = UIColor 6 | #elseif os(OSX) 7 | import AppKit.NSColor 8 | typealias Color = NSColor 9 | #endif 10 | 11 | extension Color { 12 | convenience init(rgbaValue: UInt32) { 13 | let red = CGFloat((rgbaValue >> 24) & 0xff) / 255.0 14 | let green = CGFloat((rgbaValue >> 16) & 0xff) / 255.0 15 | let blue = CGFloat((rgbaValue >> 8) & 0xff) / 255.0 16 | let alpha = CGFloat((rgbaValue ) & 0xff) / 255.0 17 | 18 | self.init(red: red, green: green, blue: blue, alpha: alpha) 19 | } 20 | } 21 | 22 | {% if colors %} 23 | // swiftlint:disable file_length 24 | // swiftlint:disable type_body_length 25 | enum {{enumName|swiftIdentifier}}: UInt32 { 26 | {% for color in colors %} 27 | /// 28 | /// Alpha: {{color.alpha|hexToInt|int255toFloat|percent}}
(0x{{color.rgba}}) 29 | case {{color.name|swiftIdentifier}} = 0x{{color.rgba}} 30 | {% endfor %} 31 | 32 | var color: Color { 33 | return Color(named: self) 34 | } 35 | } 36 | // swiftlint:enable type_body_length 37 | 38 | extension Color { 39 | convenience init(named name: {{enumName}}) { 40 | self.init(rgbaValue: name.rawValue) 41 | } 42 | } 43 | {% else %} 44 | // No color found 45 | {% endif %} 46 | -------------------------------------------------------------------------------- /Pods/SwiftGen/templates/colors-swift3.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen 2 | 3 | #if os(iOS) || os(tvOS) || os(watchOS) 4 | import UIKit.UIColor 5 | typealias Color = UIColor 6 | #elseif os(OSX) 7 | import AppKit.NSColor 8 | typealias Color = NSColor 9 | #endif 10 | 11 | extension Color { 12 | convenience init(rgbaValue: UInt32) { 13 | let red = CGFloat((rgbaValue >> 24) & 0xff) / 255.0 14 | let green = CGFloat((rgbaValue >> 16) & 0xff) / 255.0 15 | let blue = CGFloat((rgbaValue >> 8) & 0xff) / 255.0 16 | let alpha = CGFloat((rgbaValue ) & 0xff) / 255.0 17 | 18 | self.init(red: red, green: green, blue: blue, alpha: alpha) 19 | } 20 | } 21 | 22 | {% if colors %} 23 | {# Note: We don't use a UInt32 rawValue in this template so we can have multiple colors with the same rgbaValue #} 24 | // swiftlint:disable file_length 25 | // swiftlint:disable type_body_length 26 | enum {{enumName}} { 27 | {% for color in colors %} 28 | /// 29 | /// Alpha: {{color.alpha|hexToInt|int255toFloat|percent}}
(0x{{color.rgba}}) 30 | case {{color.name|swiftIdentifier|snakeToCamelCase|lowerFirstWord}} 31 | {% endfor %} 32 | 33 | var rgbaValue: UInt32 { 34 | switch self { 35 | {% for color in colors %} 36 | case .{{color.name|swiftIdentifier|snakeToCamelCase|lowerFirstWord}}: return 0x{{color.rgba}} 37 | {% endfor %} 38 | } 39 | } 40 | 41 | var color: Color { 42 | return Color(named: self) 43 | } 44 | } 45 | // swiftlint:enable type_body_length 46 | 47 | extension Color { 48 | convenience init(named name: {{enumName}}) { 49 | self.init(rgbaValue: name.rgbaValue) 50 | } 51 | } 52 | {% else %} 53 | // No color found 54 | {% endif %} 55 | -------------------------------------------------------------------------------- /Pods/SwiftGen/templates/fonts-default.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen 2 | 3 | {% if families %} 4 | #if os(iOS) || os(tvOS) || os(watchOS) 5 | import UIKit.UIFont 6 | typealias Font = UIFont 7 | #elseif os(OSX) 8 | import AppKit.NSFont 9 | typealias Font = NSFont 10 | #endif 11 | 12 | // swiftlint:disable file_length 13 | 14 | protocol FontConvertible { 15 | func font(size: CGFloat) -> Font! 16 | } 17 | 18 | extension FontConvertible where Self: RawRepresentable, Self.RawValue == String { 19 | func font(size: CGFloat) -> Font! { 20 | return Font(font: self, size: size) 21 | } 22 | } 23 | 24 | extension Font { 25 | convenience init! 27 | (font: FontType, size: CGFloat) { 28 | self.init(name: font.rawValue, size: size) 29 | } 30 | } 31 | 32 | struct {{enumName}} { 33 | {% for family in families %} 34 | enum {{family.name|swiftIdentifier|snakeToCamelCaseNoPrefix}}: String, FontConvertible { 35 | {% for font in family.fonts %} 36 | case {{font.style|swiftIdentifier|snakeToCamelCaseNoPrefix}} = "{{font.fontName}}" 37 | {% endfor %} 38 | } 39 | {% endfor %} 40 | } 41 | {% else %} 42 | // No fonts found 43 | {% endif %} 44 | -------------------------------------------------------------------------------- /Pods/SwiftGen/templates/fonts-swift3.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen 2 | 3 | {% if families %} 4 | #if os(iOS) || os(tvOS) || os(watchOS) 5 | import UIKit.UIFont 6 | typealias Font = UIFont 7 | #elseif os(OSX) 8 | import AppKit.NSFont 9 | typealias Font = NSFont 10 | #endif 11 | 12 | // swiftlint:disable file_length 13 | 14 | protocol FontConvertible { 15 | func font(size: CGFloat) -> Font! 16 | } 17 | 18 | extension FontConvertible where Self: RawRepresentable, Self.RawValue == String { 19 | func font(size: CGFloat) -> Font! { 20 | return Font(font: self, size: size) 21 | } 22 | } 23 | 24 | extension Font { 25 | convenience init! 26 | (font: FontType, size: CGFloat) 27 | where FontType: RawRepresentable, FontType.RawValue == String { 28 | self.init(name: font.rawValue, size: size) 29 | } 30 | } 31 | 32 | struct {{enumName}} { 33 | {% for family in families %} 34 | enum {{family.name|swiftIdentifier|snakeToCamelCaseNoPrefix}}: String, FontConvertible { 35 | {% for font in family.fonts %} 36 | case {{font.style|swiftIdentifier|snakeToCamelCaseNoPrefix|lowerFirstWord}} = "{{font.fontName}}" 37 | {% endfor %} 38 | } 39 | {% endfor %} 40 | } 41 | {% else %} 42 | // No fonts found 43 | {% endif %} 44 | -------------------------------------------------------------------------------- /Pods/SwiftGen/templates/images-allvalues.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen 2 | 3 | {% if images %} 4 | #if os(iOS) || os(tvOS) || os(watchOS) 5 | import UIKit.UIImage 6 | typealias Image = UIImage 7 | #elseif os(OSX) 8 | import AppKit.NSImage 9 | typealias Image = NSImage 10 | #endif 11 | 12 | // swiftlint:disable file_length 13 | // swiftlint:disable type_body_length 14 | enum {{enumName}}: String { 15 | {% for image in images %} 16 | case {{image|swiftIdentifier}} = "{{image}}" 17 | {% endfor %} 18 | 19 | static let allValues = [{% for image in images %} 20 | {{image|swiftIdentifier}}, 21 | {% endfor %}] 22 | 23 | var image: Image { 24 | return Image(asset: self) 25 | } 26 | } 27 | // swiftlint:enable type_body_length 28 | 29 | extension Image { 30 | convenience init!(asset: {{enumName}}) { 31 | self.init(named: asset.rawValue) 32 | } 33 | } 34 | {% else %} 35 | // No image found 36 | {% endif %} 37 | -------------------------------------------------------------------------------- /Pods/SwiftGen/templates/images-default.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen 2 | 3 | {% if images %} 4 | #if os(iOS) || os(tvOS) || os(watchOS) 5 | import UIKit.UIImage 6 | typealias Image = UIImage 7 | #elseif os(OSX) 8 | import AppKit.NSImage 9 | typealias Image = NSImage 10 | #endif 11 | 12 | // swiftlint:disable file_length 13 | // swiftlint:disable type_body_length 14 | enum {{enumName}}: String { 15 | {% for image in images %} 16 | case {{image|swiftIdentifier}} = "{{image}}" 17 | {% endfor %} 18 | 19 | var image: Image { 20 | return Image(asset: self) 21 | } 22 | } 23 | // swiftlint:enable type_body_length 24 | 25 | extension Image { 26 | convenience init!(asset: {{enumName}}) { 27 | self.init(named: asset.rawValue) 28 | } 29 | } 30 | {% else %} 31 | // No image found 32 | {% endif %} 33 | -------------------------------------------------------------------------------- /Pods/SwiftGen/templates/images-swift3.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen 2 | 3 | {% if images %} 4 | #if os(iOS) || os(tvOS) || os(watchOS) 5 | import UIKit.UIImage 6 | typealias Image = UIImage 7 | #elseif os(OSX) 8 | import AppKit.NSImage 9 | typealias Image = NSImage 10 | #endif 11 | 12 | // swiftlint:disable file_length 13 | // swiftlint:disable type_body_length 14 | enum {{enumName}}: String { 15 | {% for image in images %} 16 | case {{image|swiftIdentifier|snakeToCamelCase|lowerFirstWord}} = "{{image}}" 17 | {% endfor %} 18 | 19 | var image: Image { 20 | return Image(asset: self) 21 | } 22 | } 23 | // swiftlint:enable type_body_length 24 | 25 | extension Image { 26 | convenience init!(asset: {{enumName}}) { 27 | self.init(named: asset.rawValue) 28 | } 29 | } 30 | {% else %} 31 | // No image found 32 | {% endif %} 33 | -------------------------------------------------------------------------------- /Pods/SwiftGen/templates/storyboards-osx-default.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen 2 | 3 | import Foundation 4 | import Cocoa 5 | 6 | {# This first part of the code is static, same every time whatever Storyboard you have #} 7 | protocol StoryboardSceneType { 8 | static var storyboardName: String { get } 9 | } 10 | 11 | extension StoryboardSceneType { 12 | static func storyboard() -> NSStoryboard { 13 | return NSStoryboard(name: self.storyboardName, bundle: nil) 14 | } 15 | 16 | static func initialController() -> AnyObject { 17 | guard let controller = storyboard().instantiateInitialController() 18 | else { 19 | fatalError("Failed to instantiate initialViewController for \(self.storyboardName)") 20 | } 21 | return controller 22 | } 23 | } 24 | 25 | extension StoryboardSceneType where Self: RawRepresentable, Self.RawValue == String { 26 | func controller() -> AnyObject { 27 | return Self.storyboard().instantiateControllerWithIdentifier(self.rawValue) 28 | } 29 | static func controller(identifier: Self) -> AnyObject { 30 | return identifier.controller() 31 | } 32 | } 33 | 34 | protocol StoryboardSegueType: RawRepresentable { } 35 | 36 | extension NSWindowController { 37 | func performSegue(segue: S, sender: AnyObject? = nil) { 38 | performSegueWithIdentifier(segue.rawValue, sender: sender) 39 | } 40 | } 41 | 42 | extension NSViewController { 43 | func performSegue(segue: S, sender: AnyObject? = nil) { 44 | performSegueWithIdentifier(segue.rawValue, sender: sender) 45 | } 46 | } 47 | 48 | {# This is where the generation begins, this code depends on what you have in your Storyboards #} 49 | {% if storyboards %} 50 | // swiftlint:disable file_length 51 | // swiftlint:disable type_body_length 52 | 53 | struct {{sceneEnumName}} { 54 | {% for storyboard in storyboards %} 55 | {% set storyboardName %}{{storyboard.name|swiftIdentifier}}{% endset %} 56 | {% if storyboard.scenes %} 57 | enum {{storyboardName}}: String, StoryboardSceneType { 58 | static let storyboardName = "{{storyboard.name}}" 59 | {% for scene in storyboard.scenes %} 60 | {% set sceneID %}{{scene.identifier|swiftIdentifier}}{% endset %} 61 | 62 | case {{sceneID}}Scene = "{{scene.identifier}}" 63 | {% if scene.customClass %} 64 | static func instantiate{{sceneID|snakeToCamelCase}}() -> {{scene.customClass}} { 65 | guard let vc = {{sceneEnumName}}.{{storyboardName}}.{{sceneID}}Scene.controller() as? {{scene.customClass}} 66 | else { 67 | fatalError("ViewController '{{scene.identifier}}' is not of the expected class {{scene.customClass}}.") 68 | } 69 | return vc 70 | } 71 | {% else %} 72 | static func instantiate{{sceneID|snakeToCamelCase}}() -> NS{{scene.baseType}} { 73 | guard let vc = {{sceneEnumName}}.{{storyboardName}}.{{sceneID}}Scene.controller() as? NS{{scene.baseType}} 74 | else { 75 | fatalError("ViewController '{{scene.identifier}}' is not of the expected class NS{{scene.baseType}}.") 76 | } 77 | return vc 78 | } 79 | {% endif %} 80 | {% endfor %} 81 | } 82 | {% else %} 83 | enum {{storyboardName}}: StoryboardSceneType { 84 | static let storyboardName = "{{storyboard.name}}" 85 | } 86 | {% endif %} 87 | {% endfor %} 88 | } 89 | 90 | struct {{segueEnumName}} { 91 | {% for storyboard in storyboards %}{% if storyboard.segues %} 92 | enum {{storyboard.name|swiftIdentifier}}: String, StoryboardSegueType { 93 | {% for segue in storyboard.segues %} 94 | case {{segue.identifier|swiftIdentifier}} = "{{segue.identifier}}" 95 | {% endfor %} 96 | } 97 | {% endif %}{% endfor %} 98 | } 99 | {% else %} 100 | // No storyboard found 101 | {% endif %} 102 | -------------------------------------------------------------------------------- /Pods/SwiftGen/templates/storyboards-osx-lowercase.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen 2 | 3 | import Foundation 4 | import Cocoa 5 | 6 | {# This first part of the code is static, same every time whatever Storyboard you have #} 7 | protocol StoryboardSceneType { 8 | static var storyboardName: String { get } 9 | } 10 | 11 | extension StoryboardSceneType { 12 | static func storyboard() -> NSStoryboard { 13 | return NSStoryboard(name: self.storyboardName, bundle: nil) 14 | } 15 | 16 | static func initialController() -> AnyObject { 17 | guard let controller = storyboard().instantiateInitialController() 18 | else { 19 | fatalError("Failed to instantiate initialViewController for \(self.storyboardName)") 20 | } 21 | return controller 22 | } 23 | } 24 | 25 | extension StoryboardSceneType where Self: RawRepresentable, Self.RawValue == String { 26 | func controller() -> AnyObject { 27 | return Self.storyboard().instantiateControllerWithIdentifier(self.rawValue) 28 | } 29 | static func controller(identifier: Self) -> AnyObject { 30 | return identifier.controller() 31 | } 32 | } 33 | 34 | protocol StoryboardSegueType: RawRepresentable { } 35 | 36 | extension NSWindowController { 37 | func performSegue(segue: S, sender: AnyObject? = nil) { 38 | performSegueWithIdentifier(segue.rawValue, sender: sender) 39 | } 40 | } 41 | 42 | extension NSViewController { 43 | func performSegue(segue: S, sender: AnyObject? = nil) { 44 | performSegueWithIdentifier(segue.rawValue, sender: sender) 45 | } 46 | } 47 | 48 | {# This is where the generation begins, this code depends on what you have in your Storyboards #} 49 | {% if storyboards %} 50 | // swiftlint:disable file_length 51 | // swiftlint:disable type_body_length 52 | 53 | struct {{sceneEnumName}} { 54 | {% for storyboard in storyboards %} 55 | {% set storyboardName %}{{storyboard.name|swiftIdentifier}}{% endset %} 56 | {% if storyboard.scenes %} 57 | enum {{storyboardName}}: String, StoryboardSceneType { 58 | static let storyboardName = "{{storyboard.name}}" 59 | {% for scene in storyboard.scenes %} 60 | {% set sceneID %}{{scene.identifier|swiftIdentifier|lowerFirstWord}}{% endset %} 61 | 62 | case {{sceneID}}Scene = "{{scene.identifier}}" 63 | {% if scene.customClass %} 64 | static func instantiate{{sceneID||snakeToCamelCase}}() -> {{scene.customClass}} { 65 | guard let vc = {{sceneEnumName}}.{{storyboardName}}.{{sceneID}}Scene.controller() as? {{scene.customClass}} 66 | else { 67 | fatalError("ViewController '{{scene.identifier}}' is not of the expected class {{scene.customClass}}.") 68 | } 69 | return vc 70 | } 71 | {% else %} 72 | static func instantiate{{sceneID||snakeToCamelCase}}() -> NS{{scene.baseType}} { 73 | guard let vc = {{sceneEnumName}}.{{storyboardName}}.{{sceneID}}Scene.controller() as? NS{{scene.baseType}} 74 | else { 75 | fatalError("ViewController '{{scene.identifier}}' is not of the expected class NS{{scene.baseType}}.") 76 | } 77 | return vc 78 | } 79 | {% endif %} 80 | {% endfor %} 81 | } 82 | {% else %} 83 | enum {{storyboardName}}: StoryboardSceneType { 84 | static let storyboardName = "{{storyboard.name}}" 85 | } 86 | {% endif %} 87 | {% endfor %} 88 | } 89 | 90 | struct {{segueEnumName}} { 91 | {% for storyboard in storyboards %}{% if storyboard.segues %} 92 | enum {{storyboard.name|swiftIdentifier}}: String, StoryboardSegueType { 93 | {% for segue in storyboard.segues %} 94 | case {{segue.identifier|swiftIdentifier}} = "{{segue.identifier}}" 95 | {% endfor %} 96 | } 97 | {% endif %}{% endfor %} 98 | } 99 | {% else %} 100 | // No storyboard found 101 | {% endif %} 102 | -------------------------------------------------------------------------------- /Pods/SwiftGen/templates/strings-default.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen 2 | 3 | {% if strings %} 4 | import Foundation 5 | 6 | // swiftlint:disable file_length 7 | // swiftlint:disable type_body_length 8 | enum {{enumName}} { 9 | {% for string in strings %} 10 | /// {{string.translation}} 11 | case {{string.key|swiftIdentifier|snakeToCamelCase}}{% if string.params %}({{string.params.types|join}}){% endif %} 12 | {% endfor %} 13 | } 14 | // swiftlint:enable type_body_length 15 | 16 | extension {{enumName}}: CustomStringConvertible { 17 | var description: String { return self.string } 18 | 19 | var string: String { 20 | switch self { 21 | {% for string in strings %} 22 | {% if string.params %} 23 | case .{{string.key|swiftIdentifier|snakeToCamelCase}}({{string.params.declarations|join}}): 24 | return {{enumName}}.tr("{{string.key}}", {{string.params.names|join}}) 25 | {% else %} 26 | case .{{string.key|swiftIdentifier|snakeToCamelCase}}: 27 | return {{enumName}}.tr("{{string.key}}") 28 | {% endif %} 29 | {% endfor %} 30 | } 31 | } 32 | 33 | private static func tr(key: String, _ args: CVarArgType...) -> String { 34 | let format = NSLocalizedString(key, comment: "") 35 | return String(format: format, locale: NSLocale.currentLocale(), arguments: args) 36 | } 37 | } 38 | 39 | func tr(key: {{enumName}}) -> String { 40 | return key.string 41 | } 42 | {% else %} 43 | // No string found 44 | {% endif %} 45 | -------------------------------------------------------------------------------- /Pods/SwiftGen/templates/strings-genstrings.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen 2 | 3 | {% if strings %} 4 | import Foundation 5 | 6 | enum {{enumName}} { 7 | {% for string in strings %} 8 | /// {{string.translation}} 9 | case {{string.key|swiftIdentifier|snakeToCamelCase}}{% if string.params %}({{string.params.types|join}}){% endif %} 10 | {% endfor %} 11 | } 12 | 13 | extension {{enumName}}: CustomStringConvertible { 14 | var description: String { return self.string } 15 | 16 | var string: String { 17 | switch self { 18 | {% for string in strings %} 19 | {% if string.params %} 20 | case .{{string.key|swiftIdentifier|snakeToCamelCase}}({{string.params.declarations|join}}): 21 | let format = NSLocalizedString("{{string.key}}", comment: "") 22 | return {{enumName}}.tr(format, {{string.params.names|join}}) 23 | {% else %} 24 | case .{{string.key|swiftIdentifier|snakeToCamelCase}}: 25 | let format = NSLocalizedString("{{string.key}}", comment: "") 26 | return {{enumName}}.tr(format) 27 | {% endif %} 28 | {% endfor %} 29 | } 30 | } 31 | 32 | private static func tr(format: String, _ args: CVarArgType...) -> String { 33 | return String(format: format, locale: NSLocale.currentLocale(), arguments: args) 34 | } 35 | } 36 | 37 | func tr(key: {{enumName}}) -> String { 38 | return key.string 39 | } 40 | {% else %} 41 | // No string found 42 | {% endif %} 43 | -------------------------------------------------------------------------------- /Pods/SwiftGen/templates/strings-swift3.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen 2 | 3 | {% if strings %} 4 | import Foundation 5 | 6 | // swiftlint:disable file_length 7 | // swiftlint:disable type_body_length 8 | enum {{enumName}} { 9 | {% for string in strings %} 10 | /// {{string.translation}} 11 | case {{string.key|swiftIdentifier|snakeToCamelCase|lowerFirstWord}}{% if string.params %}({{string.params.types|join}}){% endif %} 12 | {% endfor %} 13 | } 14 | // swiftlint:enable type_body_length 15 | 16 | extension {{enumName}}: CustomStringConvertible { 17 | var description: String { return self.string } 18 | 19 | var string: String { 20 | switch self { 21 | {% for string in strings %} 22 | {% if string.params %} 23 | case .{{string.key|swiftIdentifier|snakeToCamelCase|lowerFirstWord}}({{string.params.declarations|join}}): 24 | return {{enumName}}.tr(key: "{{string.key}}", {{string.params.names|join}}) 25 | {% else %} 26 | case .{{string.key|swiftIdentifier|snakeToCamelCase|lowerFirstWord}}: 27 | return {{enumName}}.tr(key: "{{string.key}}") 28 | {% endif %} 29 | {% endfor %} 30 | } 31 | } 32 | 33 | private static func tr(key: String, _ args: CVarArg...) -> String { 34 | let format = NSLocalizedString(key, comment: "") 35 | return String(format: format, locale: Locale.current, arguments: args) 36 | } 37 | } 38 | 39 | func tr(key: {{enumName}}) -> String { 40 | return key.string 41 | } 42 | {% else %} 43 | // No string found 44 | {% endif %} 45 | -------------------------------------------------------------------------------- /Pods/Swinject/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Swinject Contributors 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/Swinject/Sources/Assembler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Assembler.swift 3 | // Swinject 4 | // 5 | // Created by mike.owens on 12/9/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | 10 | /// The `Assembler` provides a means to build a container via `AssemblyType` instances. 11 | open class Assembler { 12 | 13 | /// the container that each assembly will build its `Service` definitions into 14 | fileprivate let container: Container 15 | 16 | /// expose the container as a resolver so `Service` registration only happens within an assembly 17 | open var resolver: ResolverType { 18 | return container 19 | } 20 | 21 | /// Will create an empty `Assembler` 22 | /// 23 | /// - parameter container: the baseline container 24 | /// 25 | public init(container: Container? = Container()) { 26 | self.container = container! 27 | } 28 | 29 | /// Will create an empty `Assembler` 30 | /// 31 | /// - parameter parentAssembler: the baseline assembler 32 | /// 33 | public init(parentAssembler: Assembler?) { 34 | container = Container(parent: parentAssembler?.container) 35 | } 36 | 37 | /// Will create a new `Assembler` with the given `AssemblyType` instances to build a `Container` 38 | /// 39 | /// - parameter assemblies: the list of assemblies to build the container from 40 | /// - parameter container: the baseline container 41 | /// 42 | public init(assemblies: [AssemblyType], container: Container? = Container()) throws { 43 | self.container = container! 44 | run(assemblies) 45 | } 46 | 47 | /// Will create a new `Assembler` with the given `AssemblyType` instances to build a `Container` 48 | /// 49 | /// - parameter assemblies: the list of assemblies to build the container from 50 | /// - parameter parentAssembler: the baseline assembler 51 | /// 52 | public init(assemblies: [AssemblyType], parentAssembler: Assembler?) throws { 53 | container = Container(parent: parentAssembler?.container) 54 | run(assemblies) 55 | } 56 | 57 | /// Will apply the assembly to the container. This is useful if you want to lazy load an assembly into the assembler's 58 | /// container. 59 | /// 60 | /// If this assembly type is load aware, the loaded hook will be invoked right after the container has assembled 61 | /// since after each call to `addAssembly` the container is fully loaded in its current state. If you wish to 62 | /// lazy load several assemblies that have interdependencies between each other use `appyAssemblies` 63 | /// 64 | /// - parameter assembly: the assembly to apply to the container 65 | /// 66 | open func apply(_ assembly: AssemblyType) { 67 | run([assembly]) 68 | } 69 | 70 | /// Will apply the assemblies to the container. This is useful if you want to lazy load several assemblies into the assembler's 71 | /// container 72 | /// 73 | /// If this assembly type is load aware, the loaded hook will be invoked right after the container has assembled 74 | /// since after each call to `addAssembly` the container is fully loaded in its current state. 75 | /// 76 | /// - parameter assemblies: the assemblies to apply to the container 77 | /// 78 | open func apply(_ assemblies: [AssemblyType]) { 79 | run(assemblies) 80 | } 81 | 82 | // MARK: Private 83 | 84 | fileprivate func run(_ assemblies: [AssemblyType]) { 85 | // build the container from each assembly 86 | for assembly in assemblies { 87 | assembly.assemble(self.container) 88 | } 89 | 90 | // inform all of the assemblies that the container is loaded 91 | for assembly in assemblies { 92 | assembly.loaded(self.resolver) 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /Pods/Swinject/Sources/AssemblyType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AssemblyType.swift 3 | // Swinject 4 | // 5 | // Created by mike.owens on 12/9/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | 10 | /// The `AssemblyType` provides a means to organize your `Service` registration in logic groups which allows 11 | /// the user to swap out different implementations of `Services` by providing different `AssemblyType` instances 12 | /// to the `Assembler` 13 | public protocol AssemblyType { 14 | 15 | /// Provide hook for `Assembler` to load Services into the provided container 16 | /// 17 | /// - parameter container: the container provided by the `Assembler` 18 | /// 19 | func assemble(_ container: Container) 20 | 21 | /// Provides a hook to the `AssemblyType` that will be called once the `Assembler` has loaded all `AssemblyType` 22 | /// instances into the container. 23 | /// 24 | /// - parameter resolver: the resolver that can resolve instances from the built container 25 | /// 26 | func loaded(_ resolver: ResolverType) 27 | } 28 | 29 | public extension AssemblyType { 30 | func loaded(_ resolver: ResolverType) { 31 | // no-op 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Pods/Swinject/Sources/FunctionType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FunctionType.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 11/28/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | // Type alias to expect a closure. 10 | internal typealias FunctionType = Any 11 | -------------------------------------------------------------------------------- /Pods/Swinject/Sources/ObjectScope.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ObjectScope.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 7/24/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | /// A configuration how an instance provided by a `Container` is shared in the system. 10 | /// The configuration is ignored if it is applied to a value type. 11 | /// 12 | /// **Cases:** 13 | /// 14 | /// - none 15 | /// - graph 16 | /// - container 17 | /// - hierarchy 18 | public enum ObjectScope: String { 19 | /// A new instance is always created by the `Container` when a type is resolved. 20 | /// The instance is not shared. (aka Transient scope.) 21 | case none 22 | 23 | /// Instances are shared only when an object graph is being created, 24 | /// otherwise a new instance is created by the `Container`. This is the default scope. 25 | case graph 26 | 27 | /// An instance provided by the `Container` is shared within the `Container`. (aka Singleton scope in the `Container`.) 28 | case container 29 | 30 | /// An instance provided by the `Container` is not only shared within the `Container` but also shared within its child `Containers`. 31 | case hierarchy 32 | } 33 | 34 | extension ObjectScope: CustomStringConvertible { 35 | public var description: String { 36 | return self.rawValue 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Pods/Swinject/Sources/ResolutionPool.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ResolutionPool.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 7/28/15. 6 | // Copyright (c) 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | internal struct ResolutionPool { 12 | fileprivate static let maxDepth = 200 13 | 14 | fileprivate var pool = [ServiceKey: Any]() 15 | fileprivate var depth: Int = 0 16 | fileprivate var pendingCompletions: [()->()] = [] 17 | 18 | internal subscript(key: ServiceKey) -> Any? { 19 | get { return pool[key] } 20 | set { pool[key] = newValue } 21 | } 22 | 23 | internal mutating func incrementDepth() { 24 | guard depth < ResolutionPool.maxDepth else { 25 | fatalError("Infinite recursive call for circular dependency has been detected. " + 26 | "To avoid the infinite call, 'initCompleted' handler should be used to inject circular dependency.") 27 | } 28 | depth += 1 29 | } 30 | 31 | internal mutating func decrementDepth() { 32 | assert(depth > 0, "The depth cannot be negative.") 33 | 34 | if depth == 1 { 35 | while let pendingCompletion = pendingCompletions.popLast() { 36 | pendingCompletion() // Must be invoked decrementing depth counter. 37 | } 38 | pool = [:] 39 | } 40 | depth -= 1 41 | } 42 | 43 | internal mutating func appendPendingCompletion(_ completion: @escaping ()->()) { 44 | pendingCompletions.append(completion) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Pods/Swinject/Sources/ServiceEntry.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ServiceEntry.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 7/24/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // A generic-type-free protocol to be the type of values in a strongly-typed collection. 12 | internal protocol ServiceEntryType: Any { 13 | func describeWithKey(_ serviceKey: ServiceKey) -> String 14 | } 15 | 16 | /// The `ServiceEntry` class represents an entry of a registered service type. 17 | /// As a returned instance from a `register` method of a `Container`, some configurations can be added. 18 | public final class ServiceEntry { 19 | fileprivate let serviceType: Service.Type 20 | internal let factory: FunctionType 21 | 22 | internal var objectScope = ObjectScope.graph 23 | internal var initCompleted: FunctionType? 24 | internal var instance: Any? 25 | 26 | internal init(serviceType: Service.Type, factory: FunctionType) { 27 | self.serviceType = serviceType 28 | self.factory = factory 29 | } 30 | 31 | internal func copyExceptInstance() -> ServiceEntry { 32 | let copy = ServiceEntry(serviceType: serviceType, factory: factory) 33 | copy.objectScope = objectScope 34 | copy.initCompleted = initCompleted 35 | return copy 36 | } 37 | 38 | /// Specifies the object scope to resolve the service. 39 | /// 40 | /// - Parameter scope: The `ObjectScope` value. 41 | /// 42 | /// - Returns: `self` to add another configuration fluently. 43 | @discardableResult 44 | public func inObjectScope(_ objectScope: ObjectScope) -> Self { 45 | self.objectScope = objectScope 46 | return self 47 | } 48 | 49 | /// Adds the callback to setup the instance after its `init` completes. 50 | /// *Property or method injections* can be performed in the callback. 51 | /// To resolve *circular dependencies*, `initCompleted` must be used. 52 | /// 53 | /// - Parameter completed: The closure to be called after the instantiation of the registered service. 54 | /// 55 | /// - Returns: `self` to add another configuration fluently. 56 | @discardableResult 57 | public func initCompleted(_ completed: @escaping (ResolverType, Service) -> ()) -> Self { 58 | initCompleted = completed 59 | return self 60 | } 61 | } 62 | 63 | extension ServiceEntry: ServiceEntryType { 64 | internal func describeWithKey(_ serviceKey: ServiceKey) -> String { 65 | // The protocol order in "protocol<>" is non-deterministic. 66 | let nameDescription = serviceKey.name.map { ", Name: \"\($0)\"" } ?? "" 67 | let optionDescription = serviceKey.option.map { ", \($0)" } ?? "" 68 | let initCompletedDescription = initCompleted.map { _ in ", InitCompleted: Specified" } ?? "" 69 | return "Service: \(serviceType)" 70 | + nameDescription 71 | + optionDescription 72 | + ", Factory: \(type(of: factory))" 73 | + ", ObjectScope: \(objectScope)" 74 | + initCompletedDescription 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Pods/Swinject/Sources/ServiceKey.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ServiceKey.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 7/23/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // MARK: ServiceKeyOptionType 12 | public protocol ServiceKeyOptionType: CustomStringConvertible { 13 | func isEqualTo(_ another: ServiceKeyOptionType) -> Bool 14 | var hashValue: Int { get } 15 | } 16 | 17 | // MARK: - ServiceKey 18 | internal struct ServiceKey { 19 | internal let factoryType: FunctionType.Type 20 | internal let name: String? 21 | internal let option: ServiceKeyOptionType? // Used for SwinjectStoryboard or other extensions. 22 | 23 | internal init(factoryType: FunctionType.Type, name: String? = nil, option: ServiceKeyOptionType? = nil) { 24 | self.factoryType = factoryType 25 | self.name = name 26 | self.option = option 27 | } 28 | } 29 | 30 | // MARK: Hashable 31 | extension ServiceKey: Hashable { 32 | var hashValue: Int { 33 | return String(describing: factoryType).hashValue ^ (name?.hashValue ?? 0) ^ (option?.hashValue ?? 0) 34 | } 35 | } 36 | 37 | // MARK: Equatable 38 | func == (lhs: ServiceKey, rhs: ServiceKey) -> Bool { 39 | return lhs.factoryType == rhs.factoryType && lhs.name == rhs.name && equalOptions(lhs.option, opt2: rhs.option) 40 | } 41 | 42 | private func equalOptions(_ opt1: ServiceKeyOptionType?, opt2: ServiceKeyOptionType?) -> Bool { 43 | switch (opt1, opt2) { 44 | case let (opt1?, opt2?): return opt1.isEqualTo(opt2) 45 | case (nil, nil): return true 46 | default: return false 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Pods/Swinject/Sources/SpinLock.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SpinLock.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 11/26/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | internal final class SpinLock { 12 | fileprivate let lock = NSLock() 13 | 14 | func sync(_ action: () -> T) -> T { 15 | lock.lock() 16 | defer { lock.unlock() } 17 | return action() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Pods/Swinject/Sources/Swinject.h: -------------------------------------------------------------------------------- 1 | // 2 | // Swinject.h 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 7/22/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Swinject. 12 | FOUNDATION_EXPORT double SwinjectVersionNumber; 13 | 14 | //! Project version string for Swinject. 15 | FOUNDATION_EXPORT const unsigned char SwinjectVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | -------------------------------------------------------------------------------- /Pods/Swinject/Sources/SynchronizedResolver.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SynchronizedResolver.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 11/23/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | internal final class SynchronizedResolver { 10 | internal let container: Container 11 | 12 | internal init(container: Container) { 13 | self.container = container 14 | } 15 | } 16 | 17 | extension SynchronizedResolver: _ResolverType { 18 | internal func _resolve(_ name: String?, option: ServiceKeyOptionType?, invoker: (Factory) -> Service) -> Service? { 19 | return container.lock.sync { 20 | return self.container._resolve(name, option: option, invoker: invoker) 21 | } 22 | } 23 | } 24 | 25 | extension SynchronizedResolver: ResolverType { 26 | internal func resolve(_ serviceType: Service.Type) -> Service? { 27 | return container.lock.sync { 28 | return self.container.resolve(serviceType) 29 | } 30 | } 31 | 32 | internal func resolve(_ serviceType: Service.Type, name: String?) -> Service? { 33 | return container.lock.sync { 34 | return self.container.resolve(serviceType, name: name) 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Pods/Swinject/Sources/_ResolverType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // _ResolverType.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 5/4/16. 6 | // Copyright © 2016 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | /// This protocol is designed for the use to extend Swinject functionality. 10 | /// Do NOT use this protocol unless you intend to write an extension or plugin to Swinject framework. 11 | /// 12 | /// A type conforming ResolverType protocol must conform _ResolverType protocol too. 13 | public protocol _ResolverType { 14 | /// This method is designed for the use to extend Swinject functionality. 15 | /// Do NOT use this method unless you intend to write an extension or plugin to Swinject framework. 16 | /// 17 | /// - Parameter name: The registration name. 18 | /// - Parameter option: A service key option for an extension/plugin. 19 | /// - Parameter invoker: A closure to execute service resolution. 20 | /// 21 | /// - Returns: The resolved service type instance, or nil if no service is found. 22 | func _resolve(_ name: String?, option: ServiceKeyOptionType?, invoker: (Factory) -> Service) -> Service? 23 | } 24 | -------------------------------------------------------------------------------- /Pods/SwinjectStoryboard/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Swinject Contributors 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/SwinjectStoryboard/Sources/Box.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Box.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 11/27/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | internal final class Box { 12 | internal let value: T 13 | 14 | internal init(_ value: T) { 15 | self.value = value 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Pods/SwinjectStoryboard/Sources/Container+SwinjectStoryboard.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Container+SwinjectStoryboard.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 11/28/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | import Swinject 10 | 11 | #if os(iOS) || os(OSX) || os(tvOS) 12 | extension Container { 13 | /// Adds a registration of the specified view or window controller that is configured in a storyboard. 14 | /// 15 | /// - Note: Do NOT explicitly resolve the controller registered by this method. 16 | /// The controller is intended to be resolved by `SwinjectStoryboard` implicitly. 17 | /// 18 | /// - Parameters: 19 | /// - controllerType: The controller type to register as a service type. 20 | /// The type is `UIViewController` in iOS, `NSViewController` or `NSWindowController` in OS X. 21 | /// - name: A registration name, which is used to differenciate from other registrations 22 | /// that have the same view or window controller type. 23 | /// - initCompleted: A closure to specifiy how the dependencies of the view or window controller are injected. 24 | /// It is invoked by the `Container` when the view or window controller is instantiated by `SwinjectStoryboard`. 25 | public func registerForStoryboard(_ controllerType: C.Type, name: String? = nil, initCompleted: @escaping (ResolverType, C) -> ()) { 26 | // Xcode 7.1 workaround for Issue #10. This workaround is not necessary with Xcode 7. 27 | // https://github.com/Swinject/Swinject/issues/10 28 | let factory = { (_: ResolverType, controller: Controller) in controller } 29 | let wrappingClosure: (ResolverType, Controller) -> () = { r, c in initCompleted(r, c as! C) } 30 | let option = SwinjectStoryboardOption(controllerType: controllerType) 31 | _register(Controller.self, factory: factory, name: name, option: option) 32 | .initCompleted(wrappingClosure) 33 | } 34 | } 35 | #endif 36 | 37 | 38 | extension Container { 39 | #if os(iOS) || os(tvOS) 40 | /// The typealias to UIViewController. 41 | public typealias Controller = UIViewController 42 | 43 | #elseif os(OSX) 44 | /// The typealias to AnyObject, which should be actually NSViewController or NSWindowController. 45 | /// See the reference of NSStoryboard.instantiateInitialController method. 46 | public typealias Controller = Any 47 | 48 | #endif 49 | } 50 | -------------------------------------------------------------------------------- /Pods/SwinjectStoryboard/Sources/RegistrationNameAssociatable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RegistrationNameAssociatable.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 8/1/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import ObjectiveC 11 | 12 | internal protocol RegistrationNameAssociatable: AnyObject { 13 | var swinjectRegistrationName: String? { get set } 14 | } 15 | 16 | extension RegistrationNameAssociatable { 17 | internal func getAssociatedString(_ key: UnsafeRawPointer) -> String? { 18 | return objc_getAssociatedObject(self, key) as? String 19 | } 20 | 21 | internal func setAssociatedString(_ string: String?, key: UnsafeRawPointer) { 22 | objc_setAssociatedObject(self, key, string, objc_AssociationPolicy.OBJC_ASSOCIATION_COPY) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Pods/SwinjectStoryboard/Sources/Storyboard+Swizzling.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Storyboard+Swizzling.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 10/10/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | private typealias Storyboard = UIStoryboard 12 | 13 | #elseif os(OSX) 14 | 15 | private typealias Storyboard = NSStoryboard 16 | 17 | #endif 18 | 19 | 20 | #if os(iOS) || os(tvOS) || os(OSX) 21 | 22 | extension Storyboard { 23 | // Class method `load` is not available in Swift. Instead `initialize` is used. 24 | // http://nshipster.com/swift-objc-runtime/ 25 | open override class func initialize() { 26 | if self !== Storyboard.self { 27 | return 28 | } 29 | 30 | struct Static { 31 | static var onceToken: () = { 32 | // Do not use #selector for now to support Xcode 7.2 (Swift 2.1) 33 | let originalName = "storyboardWithName:bundle:" 34 | let swizzledName = "swinject_storyboardWithName:bundle:" 35 | let original = class_getClassMethod(Storyboard.self, Selector(originalName)) 36 | let swizzled = class_getClassMethod(Storyboard.self, Selector(swizzledName)) 37 | method_exchangeImplementations(original, swizzled) 38 | return () 39 | }() 40 | } 41 | let _ = Static.onceToken 42 | } 43 | 44 | @objc 45 | fileprivate class func swinject_storyboardWithName(_ name: String, bundle storyboardBundleOrNil: Bundle) -> Storyboard { 46 | if self === Storyboard.self { 47 | // Instantiate SwinjectStoryboard if UI/NSStoryboard is tried to be instantiated. 48 | if SwinjectStoryboard.isCreatingStoryboardReference { 49 | return SwinjectStoryboard.createReferenced(name, bundle: storyboardBundleOrNil) 50 | } else { 51 | return SwinjectStoryboard.create(name, bundle: storyboardBundleOrNil) 52 | } 53 | } else { 54 | // Call original `storyboardWithName:bundle:` method swizzled with `swinject_storyboardWithName:bundle:` 55 | // if SwinjectStoryboard is tried to be instantiated. 56 | return self.swinject_storyboardWithName(name, bundle: storyboardBundleOrNil) 57 | } 58 | } 59 | } 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /Pods/SwinjectStoryboard/Sources/SwinjectStoryboard+StoryboardReference.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwinjectStoryboard+StoryboardReference. 3 | // SwinjectStoryboard 4 | // 5 | // Created by Jakub Vaňo on 01/09/16. 6 | // Copyright © 2016 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | internal extension SwinjectStoryboard { 10 | 11 | static func pushInstantiatingStoryboard(_ storyboard: SwinjectStoryboard) { 12 | storyboardStack.append(storyboard) 13 | } 14 | 15 | @discardableResult 16 | static func popInstantiatingStoryboard() -> SwinjectStoryboard? { 17 | return storyboardStack.popLast() 18 | } 19 | 20 | static var isCreatingStoryboardReference: Bool { 21 | return referencingStoryboard != nil 22 | } 23 | 24 | static var referencingStoryboard: SwinjectStoryboard? { 25 | return storyboardStack.last 26 | } 27 | 28 | static func createReferenced(_ name: String, bundle storyboardBundleOrNil: Bundle?) -> SwinjectStoryboard { 29 | if let container = referencingStoryboard?.container.value { 30 | return create(name, bundle: storyboardBundleOrNil, container: container) 31 | } else { 32 | return create(name, bundle: storyboardBundleOrNil) 33 | } 34 | } 35 | } 36 | 37 | private var storyboardStack = [SwinjectStoryboard]() 38 | -------------------------------------------------------------------------------- /Pods/SwinjectStoryboard/Sources/SwinjectStoryboard.h: -------------------------------------------------------------------------------- 1 | // 2 | // SwinjectStoryboard.h 3 | // SwinjectStoryboard 4 | // 5 | // Created by Yoichi Tagaya on 5/5/16. 6 | // Copyright © 2016 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for SwinjectStoryboard. 12 | FOUNDATION_EXPORT double SwinjectStoryboardVersionNumber; 13 | 14 | //! Project version string for SwinjectStoryboard. 15 | FOUNDATION_EXPORT const unsigned char SwinjectStoryboardVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | // TARGET_OS_MAC includes iOS, watchOS and tvOS, so TARGET_OS_MAC must be evaluated after them. 21 | #if TARGET_OS_IOS || TARGET_OS_TV || (!TARGET_OS_WATCH && TARGET_OS_MAC) 22 | 23 | #import 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Pods/SwinjectStoryboard/Sources/SwinjectStoryboardOption.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwinjectStoryboardOption.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 2/28/16. 6 | // Copyright © 2016 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | import Swinject 10 | 11 | #if os(iOS) || os(OSX) || os(tvOS) 12 | internal struct SwinjectStoryboardOption: ServiceKeyOptionType { 13 | internal let controllerType: String 14 | 15 | internal init(controllerType: Container.Controller.Type) { 16 | self.controllerType = String(reflecting: controllerType) 17 | } 18 | 19 | internal func isEqualTo(_ another: ServiceKeyOptionType) -> Bool { 20 | guard let another = another as? SwinjectStoryboardOption else { 21 | return false 22 | } 23 | 24 | return self.controllerType == another.controllerType 25 | } 26 | 27 | internal var hashValue: Int { 28 | return controllerType.hashValue 29 | } 30 | 31 | internal var description: String { 32 | return "Storyboard: \(controllerType)" 33 | } 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /Pods/SwinjectStoryboard/Sources/SwinjectStoryboardType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwinjectStoryboardType.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 10/12/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(OSX) || os(tvOS) 10 | 11 | // Objective-C optional protocol method is used instead of protocol extension to workaround the issue that 12 | // default implementation of a protocol method is always called if a class method conforming the protocol 13 | // is defined as an extention in a different framework. 14 | @objc 15 | public protocol SwinjectStoryboardType { 16 | /// Called by Swinject framework once before SwinjectStoryboard is instantiated. 17 | /// 18 | /// - Note: 19 | /// Implement this method and setup the default container if you implicitly instantiate UIWindow 20 | /// and its root view controller from "Main" storyboard. 21 | /// 22 | /// ```swift 23 | /// extension SwinjectStoryboard { 24 | /// class func setup() { 25 | /// let container = defaultContainer 26 | /// container.register(SomeType.self) { 27 | /// _ in 28 | /// SomeClass() 29 | /// } 30 | /// container.registerForStoryboard(ViewController.self) { 31 | /// r, c in 32 | /// c.something = r.resolve(SomeType.self) 33 | /// } 34 | /// } 35 | /// } 36 | /// ``` 37 | @objc optional static func setup() 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /Pods/SwinjectStoryboard/Sources/ViewController+Swinject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController+Swinject.swift 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 7/31/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | import Swinject 10 | 11 | #if os(iOS) || os(tvOS) 12 | 13 | private var uivcAssociationKey: String = "UIViewController.swinjectRegistrationName" 14 | 15 | extension UIViewController: RegistrationNameAssociatable { 16 | internal var swinjectRegistrationName: String? { 17 | get { 18 | return getAssociatedString(&uivcAssociationKey) 19 | } 20 | set { 21 | setAssociatedString(newValue, key: &uivcAssociationKey) 22 | } 23 | } 24 | } 25 | 26 | #elseif os(OSX) 27 | 28 | private var nsvcAssociationKey: String = "NSViewController.swinjectRegistrationName" 29 | private var nswcAssociationKey: String = "NSWindowController.swinjectRegistrationName" 30 | 31 | extension NSViewController: RegistrationNameAssociatable { 32 | internal var swinjectRegistrationName: String? { 33 | get { 34 | return getAssociatedString(key: &nsvcAssociationKey) 35 | } 36 | set { 37 | setAssociatedString(newValue, key: &nsvcAssociationKey) 38 | } 39 | } 40 | } 41 | 42 | extension NSWindowController: RegistrationNameAssociatable { 43 | internal var swinjectRegistrationName: String? { 44 | get { 45 | return getAssociatedString(key: &nswcAssociationKey) 46 | } 47 | set { 48 | setAssociatedString(newValue, key: &nswcAssociationKey) 49 | } 50 | } 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Pods/SwinjectStoryboard/Sources/iOS-tvOS/_SwinjectStoryboardBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // _SwinjectStoryboardBase.h 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 8/2/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// The base class of `SwinjectStoryboard`, which should not be used directly in your app. 12 | @interface _SwinjectStoryboardBase : UIStoryboard 13 | 14 | /// The factory method, which should not be used directly in your app. 15 | + (nonnull instancetype)_create:(nonnull NSString *)name bundle:(nullable NSBundle *)storyboardBundleOrNil; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/SwinjectStoryboard/Sources/iOS-tvOS/_SwinjectStoryboardBase.m: -------------------------------------------------------------------------------- 1 | // 2 | // _SwinjectStoryboardBase.m 3 | // Swinject 4 | // 5 | // Created by Yoichi Tagaya on 8/2/15. 6 | // Copyright © 2015 Swinject Contributors. All rights reserved. 7 | // 8 | 9 | #import "_SwinjectStoryboardBase.h" 10 | 11 | @implementation _SwinjectStoryboardBase 12 | 13 | + (nonnull instancetype)_create:(nonnull NSString *)name bundle:(nullable NSBundle *)storyboardBundleOrNil { 14 | return (id)[self storyboardWithName:name bundle:storyboardBundleOrNil]; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /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 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double AlamofireVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /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 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftGen" 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 | 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.0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Kingfisher/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 | 3.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Kingfisher/Kingfisher-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Kingfisher : NSObject 3 | @end 4 | @implementation PodsDummy_Kingfisher 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Kingfisher/Kingfisher-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Kingfisher/Kingfisher-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Kingfisher.h" 6 | 7 | FOUNDATION_EXPORT double KingfisherVersionNumber; 8 | FOUNDATION_EXPORT const unsigned char KingfisherVersionString[]; 9 | 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Kingfisher/Kingfisher.modulemap: -------------------------------------------------------------------------------- 1 | framework module Kingfisher { 2 | umbrella header "Kingfisher-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Kingfisher/Kingfisher.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Kingfisher 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftGen" 4 | OTHER_LDFLAGS = -framework "CFNetwork" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | SWIFT_VERSION = 3.0 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftIntro/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-SwiftIntro/Pods-SwiftIntro-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SwiftIntro : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SwiftIntro 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftIntro/Pods-SwiftIntro-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double Pods_SwiftIntroVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char Pods_SwiftIntroVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftIntro/Pods-SwiftIntro.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher" "$PODS_CONFIGURATION_BUILD_DIR/Swinject" "$PODS_CONFIGURATION_BUILD_DIR/SwinjectStoryboard" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftGen" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher/Kingfisher.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Swinject/Swinject.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwinjectStoryboard/SwinjectStoryboard.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SwiftGen" 8 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "Kingfisher" -framework "Swinject" -framework "SwinjectStoryboard" 9 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 10 | PODS_BUILD_DIR = $BUILD_DIR 11 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftIntro/Pods-SwiftIntro.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_SwiftIntro { 2 | umbrella header "Pods-SwiftIntro-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftIntro/Pods-SwiftIntro.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher" "$PODS_CONFIGURATION_BUILD_DIR/Swinject" "$PODS_CONFIGURATION_BUILD_DIR/SwinjectStoryboard" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftGen" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher/Kingfisher.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Swinject/Swinject.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwinjectStoryboard/SwinjectStoryboard.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SwiftGen" 8 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "Kingfisher" -framework "Swinject" -framework "SwinjectStoryboard" 9 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 10 | PODS_BUILD_DIR = $BUILD_DIR 11 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Swinject/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.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Swinject/Swinject-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Swinject : NSObject 3 | @end 4 | @implementation PodsDummy_Swinject 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Swinject/Swinject-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Swinject/Swinject-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Swinject.h" 6 | 7 | FOUNDATION_EXPORT double SwinjectVersionNumber; 8 | FOUNDATION_EXPORT const unsigned char SwinjectVersionString[]; 9 | 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Swinject/Swinject.modulemap: -------------------------------------------------------------------------------- 1 | framework module Swinject { 2 | umbrella header "Swinject-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Swinject/Swinject.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Swinject 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftGen" 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 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwinjectStoryboard/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/SwinjectStoryboard/SwinjectStoryboard-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SwinjectStoryboard : NSObject 3 | @end 4 | @implementation PodsDummy_SwinjectStoryboard 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwinjectStoryboard/SwinjectStoryboard-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwinjectStoryboard/SwinjectStoryboard-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "_SwinjectStoryboardBase.h" 6 | #import "SwinjectStoryboard.h" 7 | 8 | FOUNDATION_EXPORT double SwinjectStoryboardVersionNumber; 9 | FOUNDATION_EXPORT const unsigned char SwinjectStoryboardVersionString[]; 10 | 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwinjectStoryboard/SwinjectStoryboard.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwinjectStoryboard { 2 | umbrella header "SwinjectStoryboard-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwinjectStoryboard/SwinjectStoryboard.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SwinjectStoryboard 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Swinject" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftGen" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /SwiftIntro.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SwiftIntro.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /SwiftIntro/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 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /SwiftIntro/Assets.xcassets/first.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "first.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SwiftIntro/Assets.xcassets/first.imageset/first.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/SwiftIntro/Assets.xcassets/first.imageset/first.pdf -------------------------------------------------------------------------------- /SwiftIntro/Assets.xcassets/second.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "second.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SwiftIntro/Assets.xcassets/second.imageset/second.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sajjon/SwiftIntro/cbcf38194ab392d9e5a97e2a3d99ab73fdcf07aa/SwiftIntro/Assets.xcassets/second.imageset/second.pdf -------------------------------------------------------------------------------- /SwiftIntro/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 | 27 | 28 | -------------------------------------------------------------------------------- /SwiftIntro/Enums/Error.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Error.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 21/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct MyError: Error, CustomStringConvertible { 12 | let description: String 13 | let type: MyErrorType 14 | let code: Int 15 | 16 | init(_ type: MyErrorType = .unknown, description: String? = nil) { 17 | self.type = type 18 | self.code = type.rawValue 19 | self.description = description ?? type.errorMessage 20 | } 21 | 22 | init(_ type: MyErrorType = .unknown, error: Error) { 23 | self.type = type 24 | self.code = type.rawValue 25 | self.description = error.localizedDescription 26 | } 27 | 28 | var nsError: NSError { 29 | let userInfo = [NSLocalizedFailureReasonErrorKey: description] 30 | let error = NSError(domain: "SwiftIntro", code: code, userInfo: userInfo) 31 | return error 32 | } 33 | } 34 | 35 | enum MyErrorType: Int { 36 | case unknown = 10000 37 | case network = 10001 38 | case jsonParsing = 10002 39 | case modelMapping = 10003 40 | 41 | var errorMessage: String { 42 | switch self { 43 | case .jsonParsing: 44 | return "JSON could not be parsed" 45 | case .unknown: 46 | return "unknown" 47 | case .network: 48 | return "network error" 49 | case .modelMapping: 50 | return "JSON could not be mapped to a model" 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /SwiftIntro/Enums/Generated/Strings.swift: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen 2 | 3 | import Foundation 4 | 5 | // swiftlint:disable file_length 6 | // swiftlint:disable type_body_length 7 | enum L10n { 8 | /// my first memory 9 | case title 10 | /// Play! 11 | case startGame 12 | /// How good are you at memory? 13 | case level 14 | /// username 15 | case usernamePlaceholder 16 | /// What's your Instagram username? 17 | case username 18 | /// n00b 19 | case easy 20 | /// A-OK! 21 | case normal 22 | /// Kick-Ass 23 | case hard 24 | /// Pairs found %d of %d 25 | case pairsFoundUnformatted(Int, Int) 26 | /// Well done! 27 | case gameOverTitle 28 | /// You made it ^__^,\nyour click count was: 29 | case gameOverSubtitle 30 | /// %d 31 | case clickScore(Int) 32 | /// Lets try to get an\neven better score! 33 | case tryHarder 34 | /// Quit 35 | case quit 36 | /// Restart 37 | case restart 38 | /// Loading... 39 | case loading 40 | } 41 | // swiftlint:enable type_body_length 42 | 43 | extension L10n: CustomStringConvertible { 44 | var description: String { return self.string } 45 | 46 | var string: String { 47 | switch self { 48 | case .title: 49 | return L10n.tr(key: "Title") 50 | case .startGame: 51 | return L10n.tr(key: "StartGame") 52 | case .level: 53 | return L10n.tr(key: "Level") 54 | case .usernamePlaceholder: 55 | return L10n.tr(key: "UsernamePlaceholder") 56 | case .username: 57 | return L10n.tr(key: "Username") 58 | case .easy: 59 | return L10n.tr(key: "Easy") 60 | case .normal: 61 | return L10n.tr(key: "Normal") 62 | case .hard: 63 | return L10n.tr(key: "Hard") 64 | case .pairsFoundUnformatted(let p0, let p1): 65 | return L10n.tr(key: "PairsFoundUnformatted", p0, p1) 66 | case .gameOverTitle: 67 | return L10n.tr(key: "GameOverTitle") 68 | case .gameOverSubtitle: 69 | return L10n.tr(key: "GameOverSubtitle") 70 | case .clickScore(let p0): 71 | return L10n.tr(key: "ClickScore", p0) 72 | case .tryHarder: 73 | return L10n.tr(key: "TryHarder") 74 | case .quit: 75 | return L10n.tr(key: "Quit") 76 | case .restart: 77 | return L10n.tr(key: "Restart") 78 | case .loading: 79 | return L10n.tr(key: "Loading") 80 | } 81 | } 82 | 83 | private static func tr(key: String, _ args: CVarArg...) -> String { 84 | let format = NSLocalizedString(key, comment: "") 85 | return String(format: format, locale: Locale.current, arguments: args) 86 | } 87 | } 88 | 89 | func tr(key: L10n) -> String { 90 | return key.string 91 | } 92 | -------------------------------------------------------------------------------- /SwiftIntro/Enums/Level.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Level.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 19/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | enum Level { 12 | case easy, normal, hard 13 | 14 | var cardCount: Int { 15 | return self.rowCount*self.columnCount 16 | } 17 | 18 | var title: String { 19 | let localizedKey: L10n 20 | switch self { 21 | case .easy: 22 | localizedKey = .easy 23 | case .normal: 24 | localizedKey = .normal 25 | case .hard: 26 | localizedKey = .hard 27 | } 28 | let title = tr(key: localizedKey) 29 | return title 30 | } 31 | 32 | init(segmentedControlIndex: Int) { 33 | switch segmentedControlIndex { 34 | case 0: 35 | self = .easy 36 | case 1: 37 | self = .normal 38 | case 2: 39 | self = .hard 40 | default: 41 | fatalError("Should not be possible") 42 | } 43 | } 44 | 45 | var segmentedControlIndex: Int { 46 | let index: Int 47 | switch self { 48 | case .easy: 49 | index = 0 50 | case .normal: 51 | index = 1 52 | case .hard: 53 | index = 2 54 | } 55 | return index 56 | } 57 | 58 | var columnCount: Int { 59 | switch self { 60 | case .easy: 61 | return 2 62 | case .normal: 63 | return 3 64 | case .hard: 65 | return 4 66 | } 67 | } 68 | 69 | var rowCount: Int { 70 | switch self { 71 | case .easy: 72 | return 3 73 | case .normal: 74 | return 4 75 | case .hard: 76 | return 5 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /SwiftIntro/Extensions/Array_Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Array_Extension.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 18/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension Array { 12 | var shuffled: Array { 13 | var elements = self 14 | for index in indices.dropLast() { 15 | guard 16 | case let swapIndex = Int(arc4random_uniform(UInt32(count - index))) + index, 17 | swapIndex != index 18 | else { continue } 19 | swap(&elements[index], &elements[swapIndex]) 20 | } 21 | return elements 22 | } 23 | mutating func shuffle() { 24 | self = shuffled 25 | } 26 | 27 | var chooseOne: Element { 28 | return self[Int(arc4random_uniform(UInt32(count)))] 29 | } 30 | func choose(_ count: Int) -> [Element] { 31 | return Array(shuffled.prefix(count)) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SwiftIntro/Extensions/NSObject_Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject_Extension.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 01/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension NSObject { 12 | class var className: String { 13 | return NSStringFromClass(self).components(separatedBy: ".").last! 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SwiftIntro/Extensions/UIButton_Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton_Extension.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 18/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIButton { 12 | 13 | func setLocalizedTitle(_ key: L10n) { 14 | let title = tr(key: key) 15 | setTitle(title) 16 | } 17 | 18 | func setTitle(_ title: String) { 19 | setTitle(title, for: UIControlState()) 20 | setTitle(title, for: .highlighted) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SwiftIntro/Extensions/UILabel_Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel_Extension.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 18/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UILabel { 12 | 13 | func setLocalizedText(_ key: L10n) { 14 | let localizedText = tr(key: key) 15 | text = localizedText 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SwiftIntro/Extensions/UIView_Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIView_Extension.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 02/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIView { 12 | var isVisible: Bool { 13 | set { 14 | self.isHidden = !newValue 15 | } 16 | 17 | get { 18 | return !self.isHidden 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SwiftIntro/HTTP/APIClient.swift: -------------------------------------------------------------------------------- 1 | // 2 | // APIClient.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 01/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class APIClient { 12 | 13 | fileprivate let httpClient: HTTPClientProtocol 14 | 15 | init( 16 | httpClient: HTTPClientProtocol 17 | ) { 18 | self.httpClient = httpClient 19 | } 20 | } 21 | 22 | extension APIClient: APIClientProtocol { 23 | 24 | func getPhotos(_ username: String, done: @escaping Done) { 25 | httpClient.request(.photos(username), done: done) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SwiftIntro/HTTP/HTTPClient.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPClient.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 01/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Alamofire 11 | 12 | typealias JSON = [String: Any] 13 | 14 | class HTTPClient {} 15 | 16 | extension HTTPClient: HTTPClientProtocol { 17 | func request(_ route: Router, done: @escaping Done) { 18 | Alamofire.request(route) 19 | .validate() 20 | .responseObject { 21 | (response: DataResponse) in 22 | if let model = response.result.value { 23 | done(Result.success([model])) 24 | } else { 25 | let myError: MyError = (response.result.error as? MyError) ?? MyError(.unknown) 26 | done(Result.failure(myError)) 27 | } 28 | } 29 | } 30 | 31 | func collectionRequest(_ route: Router, done: @escaping Done) { 32 | Alamofire.request(route) 33 | .validate() 34 | .responseCollection { 35 | (response: DataResponse<[T]>) in 36 | if let model = response.result.value { 37 | done(Result.success(model)) 38 | } else { 39 | let myError: MyError = (response.result.error as? MyError) ?? MyError(.unknown) 40 | done(Result.failure(myError)) 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /SwiftIntro/HTTP/ImagePrefetcher.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImagePrefetcher.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 02/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Kingfisher 11 | 12 | import Foundation 13 | import Kingfisher 14 | 15 | protocol ImageCacheProtocol { 16 | func prefetchImages(_ urls: [URL], done: Closure?) 17 | func prefetchImage(_ url: URL, done: Closure?) 18 | func imageFromCache(_ url: URL?) -> UIImage? 19 | } 20 | 21 | class Cache: NSObject { 22 | 23 | 24 | fileprivate var cache: ImageCache { 25 | return ImageCache.default 26 | } 27 | } 28 | 29 | extension Cache: ImageCacheProtocol { 30 | 31 | func imageFromCache(_ url: URL?) -> UIImage? { 32 | guard let url = url else { return nil } 33 | let imageFromCache = cache.retrieveImageInDiskCache(forKey: url.absoluteString) 34 | return imageFromCache 35 | } 36 | 37 | func prefetchImages(_ urls: [URL], done: Closure? = nil) { 38 | let prefetcher = ImagePrefetcher(urls: urls, options: nil, progressBlock: nil) { 39 | (skipped, failed, completed) in 40 | print("Prefetching of image done, skipped \(skipped.count), failed: \(failed.count), completed: \(completed.count)") 41 | done?() 42 | } 43 | prefetcher.start() 44 | } 45 | 46 | func prefetchImage(_ url: URL, done: Closure? = nil) { 47 | prefetchImages([url], done: done) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /SwiftIntro/HTTP/Request_Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Request_Extension.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 01/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Alamofire 11 | 12 | protocol ResponseObjectSerializable { 13 | init?(response: HTTPURLResponse, representation: Any) 14 | } 15 | 16 | protocol ResponseCollectionSerializable { 17 | static func collection(from response: HTTPURLResponse, withRepresentation representation: Any) -> [Self] 18 | } 19 | 20 | extension ResponseCollectionSerializable where Self: ResponseObjectSerializable { 21 | static func collection(from response: HTTPURLResponse, withRepresentation representation: Any) -> [Self] { 22 | var collection: [Self] = [] 23 | 24 | if let representation = representation as? [[String: Any]] { 25 | for itemRepresentation in representation { 26 | if let item = Self(response: response, representation: itemRepresentation) { 27 | collection.append(item) 28 | } 29 | } 30 | } 31 | 32 | return collection 33 | } 34 | } 35 | 36 | 37 | extension DataRequest { 38 | 39 | @discardableResult 40 | func responseObject( 41 | queue: DispatchQueue? = nil, 42 | completionHandler: @escaping (DataResponse) -> Void) 43 | -> Self 44 | { 45 | let responseSerializer = DataResponseSerializer { request, response, data, error in 46 | if let error = error { 47 | return .failure(MyError(.network, error: error)) 48 | } 49 | 50 | let jsonResponseSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments) 51 | let result = jsonResponseSerializer.serializeResponse(request, response, data, nil) 52 | 53 | guard case let .success(jsonObject) = result else { 54 | return .failure(MyError(.jsonParsing, error: result.error!)) 55 | } 56 | 57 | guard let response = response, let responseObject = T(response: response, representation: jsonObject) else { 58 | return .failure(MyError(.modelMapping, description: "JSON could not be serialized: \(jsonObject)")) 59 | } 60 | 61 | return .success(responseObject) 62 | } 63 | 64 | return response(queue: queue, responseSerializer: responseSerializer, completionHandler: completionHandler) 65 | } 66 | 67 | @discardableResult 68 | func responseCollection( 69 | queue: DispatchQueue? = nil, 70 | completionHandler: @escaping (DataResponse<[T]>) -> Void) -> Self 71 | { 72 | let responseSerializer = DataResponseSerializer<[T]> { request, response, data, error in 73 | 74 | if let error = error { 75 | return .failure(MyError(.network, error: error)) 76 | } 77 | 78 | let jsonSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments) 79 | let result = jsonSerializer.serializeResponse(request, response, data, nil) 80 | 81 | guard case let .success(jsonObject) = result else { 82 | return .failure(MyError(.jsonParsing, error: result.error!)) 83 | } 84 | 85 | guard let response = response else { 86 | let reason = "Response collection could not be serialized due to nil response." 87 | return .failure(MyError(.modelMapping, description: reason)) 88 | } 89 | 90 | return .success(T.collection(from: response, withRepresentation: jsonObject)) 91 | } 92 | 93 | return response(responseSerializer: responseSerializer, completionHandler: completionHandler) 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /SwiftIntro/HTTP/Router.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Router.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 01/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Alamofire 11 | 12 | enum Router: URLRequestConvertible { 13 | static let baseURLString = "https://www.instagram.com/" 14 | 15 | case photos(String) 16 | 17 | var method: Alamofire.HTTPMethod { 18 | switch self { 19 | case .photos: 20 | return .get 21 | } 22 | } 23 | 24 | var path: String { 25 | switch self { 26 | case .photos(let username): 27 | return "\(username)/media/" 28 | } 29 | } 30 | 31 | var parameters: Parameters? { 32 | return nil 33 | } 34 | 35 | // MARK: URLRequestConvertible 36 | func asURLRequest() throws -> URLRequest { 37 | let url = try Router.baseURLString.asURL() 38 | var urlRequest = URLRequest(url: url.appendingPathComponent(path)) 39 | urlRequest.httpMethod = method.rawValue 40 | urlRequest = try URLEncoding.default.encode(urlRequest, with: parameters) 41 | return urlRequest 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /SwiftIntro/Models/DTO/GameConfiguration.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GameConfiguration.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 20/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct GameConfiguration { 12 | var level: Level = .normal 13 | var username: String = "taylorswift" 14 | } 15 | -------------------------------------------------------------------------------- /SwiftIntro/Models/DTO/GameResult.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GameResult.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 20/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct GameResult { 12 | let level: Level 13 | let clickCount: Int 14 | var cards: Cards! 15 | 16 | init(level: Level, clickCount: Int) { 17 | self.level = level 18 | self.clickCount = clickCount 19 | } 20 | } -------------------------------------------------------------------------------- /SwiftIntro/Models/FromJSON/Card.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Card.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 01/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | final class Card { 12 | let imageUrl: URL 13 | 14 | var isFlipped: Bool = false 15 | var isMatched: Bool = false 16 | 17 | init(imageUrl: URL) { 18 | self.imageUrl = imageUrl 19 | } 20 | } 21 | 22 | //MARK: Equatable 23 | extension Card: Equatable {} 24 | func == (lhs: Card, rhs: Card) -> Bool { 25 | let same = lhs.imageUrl == rhs.imageUrl 26 | return same 27 | } 28 | 29 | //MARK: Model 30 | extension Card: Model { 31 | 32 | convenience init?(response: HTTPURLResponse, json: JSON) { 33 | guard let 34 | media = json["images"] as? JSON, 35 | let image = media["standard_resolution"] as? JSON, 36 | let imageUrlString = image["url"] as? String, 37 | let imageUrl = URL(string: imageUrlString) else { return nil } 38 | self.init(imageUrl: imageUrl) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /SwiftIntro/Models/FromJSON/Cards.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Cards.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 01/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct Cards { 12 | var singles: [Card] 13 | var memoryCards: [Card] 14 | 15 | init(_ singles: [Card], cardCount: Int) { 16 | self.singles = singles 17 | self.memoryCards = memoryCardsFromSingles(singles, cardCount: cardCount) 18 | } 19 | 20 | init(_ singles: [Card], config: GameConfiguration) { 21 | self.init(singles, cardCount: config.level.cardCount) 22 | } 23 | } 24 | 25 | extension Cards { 26 | var count: Int { 27 | return memoryCards.count 28 | } 29 | 30 | func unflip() { 31 | for card in memoryCards { 32 | card.isFlipped = false 33 | } 34 | } 35 | 36 | func unmatch() { 37 | for card in memoryCards { 38 | card.isMatched = false 39 | } 40 | } 41 | 42 | func unflipped() -> Cards { 43 | unflip() 44 | return self 45 | } 46 | 47 | subscript(index: Int) -> Card { 48 | return memoryCards[index] 49 | } 50 | } 51 | 52 | extension Cards: Model { 53 | init?(response: HTTPURLResponse, json: JSON) { 54 | guard let jsonForCards = json["items"] as? [JSON] else { return nil } 55 | let cards = Card.collection(from: response, withRepresentation: jsonForCards) 56 | self.singles = cards 57 | memoryCards = [] 58 | } 59 | } 60 | 61 | private func memoryCardsFromSingles(_ singles: [Card], cardCount: Int) -> [Card] { 62 | let cardCount = min(singles.count, cardCount) 63 | var cards = singles 64 | cards.shuffle() 65 | cards = cards.choose(cardCount/2) 66 | var duplicated = duplicatedMemoryCards(cards) 67 | duplicated.shuffle() 68 | return duplicated 69 | } 70 | 71 | private func duplicatedMemoryCards(_ cards: [Card]) -> [Card] { 72 | var duplicated: [Card] = [] 73 | for memoryCard in cards { 74 | let duplicate = Card(imageUrl: memoryCard.imageUrl) 75 | duplicated.append(duplicate) 76 | duplicated.append(memoryCard) 77 | } 78 | return duplicated 79 | } 80 | 81 | -------------------------------------------------------------------------------- /SwiftIntro/Models/FromJSON/Result.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Result.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 21/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | enum Result { 12 | 13 | case success([T]) 14 | case failure(MyError) 15 | 16 | internal init(_ error: MyError) { 17 | self = .failure(error) 18 | } 19 | 20 | internal init(_ models: [T]) { 21 | self = .success(models) 22 | } 23 | 24 | /// Returns `true` if the result is a success, `false` otherwise. 25 | var isSuccess: Bool { 26 | switch self { 27 | case .success: 28 | return true 29 | case .failure: 30 | return false 31 | } 32 | } 33 | 34 | /// Returns `true` if the result is a failure, `false` otherwise. 35 | var isFailure: Bool { 36 | return !isSuccess 37 | } 38 | 39 | /// Returns the associated value if the result is a success, `nil` otherwise. 40 | var value: [T]? { 41 | switch self { 42 | case .success(let value): 43 | return value 44 | case .failure: 45 | return nil 46 | } 47 | } 48 | 49 | /// Returns the associated error value if the result is a failure, `nil` otherwise. 50 | var error: NSError? { 51 | switch self { 52 | case .success: 53 | return nil 54 | case .failure(let error): 55 | return error.nsError 56 | } 57 | } 58 | } 59 | 60 | // MARK: - CustomStringConvertible 61 | 62 | extension Result: CustomStringConvertible { 63 | /// The textual representation used when written to an output stream, which includes whether the result was a 64 | /// success or failure. 65 | var description: String { 66 | switch self { 67 | case .success: 68 | return "SUCCESS" 69 | case .failure: 70 | return "FAILURE" 71 | } 72 | } 73 | } 74 | 75 | // MARK: - CustomDebugStringConvertible 76 | 77 | extension Result: CustomDebugStringConvertible { 78 | /// The debug textual representation used when written to an output stream, which includes whether the result was a 79 | /// success or failure in addition to the value or error. 80 | var debugDescription: String { 81 | switch self { 82 | case .success(let value): 83 | return "SUCCESS: \(value)" 84 | case .failure(let error): 85 | return "FAILURE: \(error)" 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /SwiftIntro/Protocols/APIClientProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // APIClientProtocol.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 20/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | typealias Done = (Result) -> Void 12 | protocol APIClientProtocol { 13 | func getPhotos(_ username: String, done: @escaping Done) 14 | } 15 | -------------------------------------------------------------------------------- /SwiftIntro/Protocols/CellProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CellProtocol.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 20/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol CellProtocol { 12 | static var cellIdentifier: String {get} 13 | static var nib: UINib {get} 14 | func configure(with model: T, image: UIImage?) 15 | } 16 | -------------------------------------------------------------------------------- /SwiftIntro/Protocols/Configurable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Configurable.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 20/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol Configurable { 12 | var config: GameConfiguration! {get set} 13 | } -------------------------------------------------------------------------------- /SwiftIntro/Protocols/HTTPClientProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPClientProtocol.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 20/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol HTTPClientProtocol { 12 | func request(_ route: Router, done: @escaping Done) 13 | func collectionRequest(_ route: Router, done: @escaping Done) 14 | } 15 | -------------------------------------------------------------------------------- /SwiftIntro/Protocols/Model.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Model.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 21/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol Model: ResponseCollectionSerializable, ResponseObjectSerializable { 12 | init?(response: HTTPURLResponse, json: JSON) 13 | } 14 | 15 | extension Model { 16 | init?(response: HTTPURLResponse, representation: Any) { 17 | guard let json = representation as? JSON else { return nil } 18 | self.init(response: response, json: json) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SwiftIntro/SupportingFiles/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 01/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Swinject 11 | import SwinjectStoryboard 12 | 13 | @UIApplicationMain 14 | class AppDelegate: UIResponder { 15 | 16 | var window: UIWindow? 17 | let container: Container = SwinjectStoryboard.defaultContainer 18 | } 19 | 20 | extension AppDelegate: UIApplicationDelegate { 21 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 22 | return true 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SwiftIntro/SupportingFiles/DependencyInjectionConfigurator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DependencyInjectionConfigurator.swift 3 | // Intranet3 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 29/05/16. 6 | // Copyright © 2016 intranet3. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | import UIKit 12 | import Swinject 13 | import SwinjectStoryboard 14 | 15 | extension SwinjectStoryboard { 16 | class func setup() { 17 | 18 | defaultContainer.register(HTTPClientProtocol.self) { _ in 19 | HTTPClient() 20 | }.inObjectScope(.container) 21 | 22 | defaultContainer.register(APIClientProtocol.self) { r in 23 | APIClient( 24 | httpClient: r.resolve(HTTPClientProtocol.self)! 25 | ) 26 | }.inObjectScope(.container) 27 | 28 | defaultContainer.register(ImageCacheProtocol.self) { _ in 29 | Cache() 30 | }.inObjectScope(.container) 31 | 32 | defaultContainer.registerForStoryboard(GameVC.self) { r, c in 33 | c.imageCache = r.resolve(ImageCacheProtocol.self) 34 | } 35 | 36 | defaultContainer.registerForStoryboard(LoadingDataVC.self) { r, c in 37 | c.apiClient = r.resolve(APIClientProtocol.self) 38 | c.imageCache = r.resolve(ImageCacheProtocol.self) 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /SwiftIntro/SupportingFiles/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 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarTintParameters 34 | 35 | UINavigationBar 36 | 37 | Style 38 | UIBarStyleDefault 39 | Translucent 40 | 41 | 42 | 43 | UISupportedInterfaceOrientations 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /SwiftIntro/SupportingFiles/Macros.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Macros.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 09/01/16. 6 | // Copyright © 2016 intranet3. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | typealias Closure = () -> Void 13 | 14 | func onMain(_ closure: @escaping Closure) { 15 | DispatchQueue.main.async { 16 | () -> Void in 17 | closure() 18 | } 19 | } 20 | 21 | func delay(_ delay: Double, closure: @escaping Closure) { 22 | DispatchQueue.main.asyncAfter( 23 | deadline: DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), 24 | execute: closure 25 | ) 26 | } 27 | 28 | private func showNetworkLoadingInStatusBar(show: Bool) { 29 | UIApplication.shared.isNetworkActivityIndicatorVisible = show 30 | } 31 | 32 | func showNetworkLoadingInStatusBar() { 33 | showNetworkLoadingInStatusBar(show: true) 34 | } 35 | 36 | func hideNetworkLoadingInStatusBar() { 37 | showNetworkLoadingInStatusBar(show: false) 38 | } 39 | -------------------------------------------------------------------------------- /SwiftIntro/SupportingFiles/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Localizable.strings 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 10/01/16. 6 | // Copyright © 2016 intranet3. All rights reserved. 7 | // 8 | "Title" = "my first memory"; 9 | "StartGame" = "Play!"; 10 | "Level" = "How good are you at memory?"; 11 | "UsernamePlaceholder" = "username"; 12 | "Username" = "What's your Instagram username?"; 13 | "Easy" = "n00b"; 14 | "Normal" = "A-OK!"; 15 | "Hard" = "Kick-Ass"; 16 | "PairsFoundUnformatted" = "Pairs found %d of %d"; 17 | 18 | "GameOverTitle" = "Well done!"; 19 | "GameOverSubtitle" = "You made it ^__^,\nyour click count was:"; 20 | "ClickScore" = "%d"; 21 | "TryHarder" = "Lets try to get an\neven better score!"; 22 | 23 | "Quit" = "Quit"; 24 | "Restart" = "Restart"; 25 | "Loading" = "Loading..."; 26 | -------------------------------------------------------------------------------- /SwiftIntro/SupportingFiles/sv.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | // 2 | // Localizable.strings 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 10/01/16. 6 | // Copyright © 2016 intranet3. All rights reserved. 7 | // 8 | 9 | "StartGame" = "Spela!"; 10 | "Level" = "Hur bra är du på memory minne?"; 11 | "Username" = "Vad är ditt Instagram användarnamn?"; 12 | "UsernamePlaceholder" = "användarnamn"; 13 | "Easy" = "n00b"; 14 | "Normal" = "Okei"; 15 | "Hard" = "Kick-Ass"; 16 | "PairsFoundUnformatted" = "Par funna %d av %d"; 17 | 18 | "GameOverTitle" = "Bra jobbat!"; 19 | "GameOverSubtitle" = "Du klarade det ^__^,\nantal klick var:"; 20 | "ClickScore" = "%d"; 21 | "TryHarder" = "Försök få ett ännu bättre resultat!"; 22 | 23 | "Quit" = "Avsluta"; 24 | "Restart" = "Omstart!"; 25 | "Loading" = "Laddar..."; 26 | 27 | -------------------------------------------------------------------------------- /SwiftIntro/ViewControllers/GameOverVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GameOverVC.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 18/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class GameOverVC: UIViewController, Configurable { 12 | 13 | @IBOutlet weak var titleLabel: UILabel! 14 | @IBOutlet weak var subtitleLabel: UILabel! 15 | @IBOutlet weak var scoreLabel: UILabel! 16 | @IBOutlet weak var tryHarderLabel: UILabel! 17 | @IBOutlet weak var restartButton: UIButton! 18 | @IBOutlet weak var quitButton: UIButton! 19 | 20 | var config: GameConfiguration! 21 | var result: GameResult! 22 | 23 | override func viewDidLoad() { 24 | super.viewDidLoad() 25 | setupViews() 26 | } 27 | 28 | override func prepare(for segue: UIStoryboardSegue?, sender: Any?) { 29 | guard var configurable = segue?.destination as? Configurable else { return } 30 | configurable.config = config 31 | guard let gameVC = segue?.destination as? GameVC else { return } 32 | guard var cards = result.cards else { return } 33 | cards.unflip() 34 | cards.unmatch() 35 | cards.memoryCards.shuffle() 36 | gameVC.cards = cards 37 | } 38 | } 39 | 40 | //MARK: Private Methods 41 | private extension GameOverVC { 42 | func setupViews() { 43 | quitButton.layer.cornerRadius = quitButton.frame.height/2 44 | restartButton.layer.cornerRadius = restartButton.frame.height/2 45 | setupLocalizedText() 46 | } 47 | 48 | func setupLocalizedText() { 49 | titleLabel.setLocalizedText(.gameOverTitle) 50 | subtitleLabel.setLocalizedText(.gameOverSubtitle) 51 | scoreLabel.setLocalizedText(.clickScore(result.clickCount)) 52 | tryHarderLabel.setLocalizedText(.tryHarder) 53 | restartButton.setLocalizedTitle(.restart) 54 | quitButton.setLocalizedTitle(.quit) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /SwiftIntro/ViewControllers/GameVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GameVC.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 01/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private let gameOverSeque = "gameOverSeque" 12 | class GameVC: UIViewController, Configurable { 13 | 14 | //MARK: Variables 15 | @IBOutlet weak var collectionView: UICollectionView! 16 | @IBOutlet weak var scoreLabel: UILabel! 17 | @IBOutlet weak var labelsView: UIView! 18 | var config: GameConfiguration! 19 | var cards: Cards! 20 | fileprivate var result: GameResult! 21 | var imageCache: ImageCacheProtocol! 22 | 23 | fileprivate lazy var dataSourceAndDelegate: MemoryDataSourceAndDelegate = { 24 | let dataSourceAndDelegate = MemoryDataSourceAndDelegate( 25 | self.cards, 26 | level: self.config.level, 27 | delegate: self, 28 | imageCache: self.imageCache 29 | ) 30 | return dataSourceAndDelegate 31 | }() 32 | 33 | //MARK: Instantiation 34 | required init?(coder aDecoder: NSCoder) { 35 | super.init(coder: aDecoder) 36 | } 37 | 38 | //MARK: VC Lifecycle Methods 39 | override func viewDidLoad() { 40 | super.viewDidLoad() 41 | setupViews() 42 | } 43 | 44 | override func prepare(for segue: UIStoryboardSegue?, sender: Any?) { 45 | guard var configurable = segue?.destination as? Configurable else { return } 46 | configurable.config = config 47 | guard let vc = segue?.destination as? GameOverVC else { return } 48 | vc.result = result 49 | } 50 | } 51 | 52 | //MARK: GameDelegate 53 | extension GameVC: GameDelegate { 54 | 55 | func foundMatch(_ matches: Int) { 56 | setScoreLabel(matches) 57 | } 58 | 59 | func gameOver(_ result: GameResult) { 60 | self.result = result 61 | self.result.cards = cards 62 | collectionView.isUserInteractionEnabled = false 63 | delay(1) { 64 | self.performSegue(withIdentifier: gameOverSeque, sender: self) 65 | } 66 | } 67 | 68 | fileprivate func setScoreLabel(_ matches: Int) { 69 | let scoreText = L10n.pairsFoundUnformatted(matches, config.level.cardCount/2).string 70 | scoreLabel.text = scoreText 71 | } 72 | } 73 | 74 | //MARK: Private Methods 75 | private extension GameVC { 76 | func setupStyling() { 77 | setScoreLabel(0) 78 | labelsView.backgroundColor = UIColor.black 79 | collectionView.backgroundColor = UIColor.black 80 | } 81 | 82 | func setupViews() { 83 | collectionView.dataSource = dataSourceAndDelegate 84 | collectionView.delegate = dataSourceAndDelegate 85 | collectionView.register(CardCVCell.nib, forCellWithReuseIdentifier: CardCVCell.cellIdentifier) 86 | setupStyling() 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /SwiftIntro/ViewControllers/LoadingDataVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoadingDataVC.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 19/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Alamofire 11 | 12 | private let startGameSegue = "startGameSegue" 13 | class LoadingDataVC: UIViewController, Configurable { 14 | 15 | //MARK: Variables 16 | @IBOutlet weak var loadingLabel: UILabel! 17 | 18 | var config: GameConfiguration! 19 | fileprivate var cards: Cards? 20 | 21 | var apiClient: APIClientProtocol! 22 | var imageCache: ImageCacheProtocol! 23 | 24 | required init?(coder aDecoder: NSCoder) { 25 | super.init(coder: aDecoder) 26 | } 27 | 28 | //MARK: VC Lifecycle Methods 29 | override func viewDidLoad() { 30 | super.viewDidLoad() 31 | setupViews() 32 | fetchData() 33 | } 34 | 35 | override func prepare(for segue: UIStoryboardSegue?, sender: Any?) { 36 | guard let vc = segue?.destination as? GameVC else { return } 37 | vc.config = config 38 | vc.cards = cards 39 | } 40 | } 41 | 42 | private extension LoadingDataVC { 43 | 44 | func startGame() { 45 | performSegue(withIdentifier: startGameSegue, sender: self) 46 | } 47 | 48 | func setupViews() { 49 | setupLocalizedText() 50 | } 51 | 52 | func setupLocalizedText() { 53 | loadingLabel.setLocalizedText(.loading) 54 | } 55 | 56 | func fetchData() { 57 | apiClient.getPhotos(config.username) { 58 | result in 59 | switch result { 60 | case .failure(let error): 61 | print("Failed to get photos, error: \(error.description)") 62 | case .success(let model): 63 | self.setupWithModel(model.first) 64 | } 65 | } 66 | } 67 | 68 | func setupWithModel(_ model: Cards?) { 69 | guard let model = model else { return } 70 | let singles = model.singles 71 | self.cards = Cards(singles, config: config) 72 | prefetchImagesForCards(singles) 73 | } 74 | 75 | func prefetchImagesForCards(_ cards: [Card]) { 76 | let urls: [URL] = cards.map { return $0.imageUrl } 77 | imageCache.prefetchImages(urls) { 78 | print("images fetched") 79 | self.startGame() 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /SwiftIntro/ViewControllers/SettingsVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsVC.swift 3 | // SwiftIntro 4 | // 5 | // Created by Miriam Tisander on 02/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | class SettingsVC: UIViewController, Configurable { 13 | 14 | //MARK: Variables 15 | @IBOutlet weak var titleLabel: UILabel! 16 | @IBOutlet weak var usernameTextField: UITextField! 17 | @IBOutlet weak var usernameLabel: UILabel! 18 | @IBOutlet weak var segmentTitleLabel: UILabel! 19 | @IBOutlet weak var levelSegmentedControl: UISegmentedControl! 20 | @IBOutlet weak var startGameButton: UIButton! 21 | 22 | var config: GameConfiguration! 23 | 24 | //MARK: Initializers 25 | required init?(coder aDecoder: NSCoder) { 26 | self.config = GameConfiguration() 27 | super.init(coder: aDecoder) 28 | } 29 | 30 | //MARK: VC Lifecycle Methods 31 | override func viewDidLoad() { 32 | super.viewDidLoad() 33 | setupViews() 34 | populateViews() 35 | } 36 | 37 | override func prepare(for segue: UIStoryboardSegue?, sender: Any?) { 38 | guard let vc = segue?.destination as? LoadingDataVC else { return } 39 | if let username: String = usernameTextField.text, !username.isEmpty { 40 | config.username = username 41 | } 42 | 43 | vc.config = config 44 | } 45 | 46 | } 47 | 48 | //MARK: IBAction Methods 49 | extension SettingsVC { 50 | 51 | @IBAction func changedLevel(_ sender: UISegmentedControl) { 52 | let level = Level(segmentedControlIndex: sender.selectedSegmentIndex) 53 | config.level = level 54 | } 55 | } 56 | 57 | private extension SettingsVC { 58 | 59 | func setupViews() { 60 | setupLocalizableStrings() 61 | //startGameButton.layer.cornerRadius = startGameButton.frame.size.height/2 62 | } 63 | 64 | func populateViews() { 65 | usernameTextField.text = config.username 66 | levelSegmentedControl.selectedSegmentIndex = config.level.segmentedControlIndex 67 | } 68 | 69 | func setupLocalizableStrings() { 70 | titleLabel.setLocalizedText(.title) 71 | usernameTextField.placeholder = tr(key: .usernamePlaceholder) 72 | segmentTitleLabel.setLocalizedText(.level) 73 | setupLocalizationForSegmentedControl() 74 | usernameLabel.setLocalizedText(.username) 75 | startGameButton.setLocalizedTitle(.startGame) 76 | } 77 | 78 | func setupLocalizationForSegmentedControl() { 79 | for i in 0...2 { 80 | let level = Level(segmentedControlIndex: i) 81 | let title = level.title 82 | levelSegmentedControl.setTitle(title, forSegmentAt: i) 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /SwiftIntro/Views/Cells/CollectionViewCells/CardCVCell/CardCVCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CardCVCell.swift 3 | // SwiftIntro 4 | // 5 | // Created by Alexander Georgii-Hemming Cyon on 01/06/16. 6 | // Copyright © 2016 SwiftIntro. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Kingfisher 11 | 12 | class CardCVCell: UICollectionViewCell { 13 | @IBOutlet weak var cardFrontImageView: UIImageView! 14 | @IBOutlet weak var cardBackImageView: UIImageView! 15 | 16 | fileprivate var isFlipped: Bool = false { 17 | didSet { 18 | cardFrontImageView.isVisible = isFlipped 19 | cardBackImageView.isHidden = isFlipped 20 | } 21 | } 22 | 23 | override func awakeFromNib() { 24 | super.awakeFromNib() 25 | cardBackImageView.backgroundColor = UIColor.brown 26 | } 27 | 28 | override func prepareForReuse() { 29 | super.prepareForReuse() 30 | cardFrontImageView.image = nil 31 | isFlipped = false 32 | } 33 | 34 | func flipCard(_ cardModel: Card) { 35 | let isFlipped = cardModel.isFlipped 36 | let sourceView = isFlipped ? cardFrontImageView : cardBackImageView 37 | let targetView = isFlipped ? cardBackImageView : cardFrontImageView 38 | let flipDirection: UIViewAnimationOptions = isFlipped ? .transitionFlipFromRight : .transitionFlipFromLeft 39 | let options: UIViewAnimationOptions = [flipDirection, .showHideTransitionViews] 40 | UIView.transition(from: sourceView!, to: targetView!, duration: 0.6, options: options) { 41 | finished in 42 | cardModel.isFlipped = !isFlipped 43 | } 44 | } 45 | } 46 | 47 | //MARK: CellProtocol Methods 48 | extension CardCVCell: CellProtocol { 49 | 50 | static var nib: UINib { 51 | return UINib(nibName: className, bundle: nil) 52 | } 53 | 54 | static var cellIdentifier: String { 55 | return className 56 | } 57 | 58 | func configure(with model: T, image: UIImage?) { 59 | guard let card = model as? Card else { return } 60 | configure(with: card, image: image) 61 | } 62 | } 63 | 64 | private extension CardCVCell { 65 | func configure(with card: Card, image: UIImage?) { 66 | cardFrontImageView.image = image 67 | isFlipped = card.isFlipped 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /SwiftIntro/Views/Cells/CollectionViewCells/CardCVCell/CardCVCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | --------------------------------------------------------------------------------