├── .coveralls.yml ├── .gitignore ├── .hound.yml ├── .swiftlint.yml ├── .travis.yml ├── Base.lproj └── Localizable.strings ├── IOSSwiftBoiler.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata ├── xcshareddata │ └── xcschemes │ │ └── IOSSwiftBoiler.xcscheme └── xcuserdata │ └── goodson.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── IOSSwiftBoiler.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── goodson.xcuserdatad │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── IOSSwiftBoiler ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── facebook_filled.imageset │ │ ├── Contents.json │ │ └── facebook_filled.png │ ├── forward.imageset │ │ ├── Contents.json │ │ ├── forward-1.png │ │ ├── forward-2.png │ │ └── forward.png │ ├── gradient.imageset │ │ ├── Contents.json │ │ └── gradient.png │ ├── home.imageset │ │ ├── Contents.json │ │ ├── home-1.png │ │ ├── home-2.png │ │ └── home.png │ ├── lock.imageset │ │ ├── Contents.json │ │ ├── lock-1.png │ │ ├── lock-2.png │ │ └── lock.png │ ├── logo.imageset │ │ ├── Contents.json │ │ └── logo-placeholder.png │ ├── settings-black.imageset │ │ ├── Contents.json │ │ ├── settings-1.png │ │ ├── settings-2.png │ │ └── settings.png │ ├── settings.imageset │ │ ├── Contents.json │ │ ├── settings-1.png │ │ ├── settings-2.png │ │ └── settings.png │ ├── twitter_filled.imageset │ │ ├── Contents.json │ │ └── twitter_filled.png │ └── user-large.imageset │ │ ├── Contents.json │ │ └── user-large.png ├── Assets │ └── background.mp4 ├── BackgroundGradientView.swift ├── Base.lproj │ └── Main.storyboard ├── Const.swift ├── Helpers.swift ├── IOSSwiftBoiler.xcdatamodeld │ ├── .xccurrentversion │ └── IOSSwiftBoiler.xcdatamodel │ │ └── contents ├── Info.plist ├── LaunchScreen.storyboard ├── LoginViewController.swift ├── MarqueeLabel.swift ├── SettingsViewController.swift ├── TextHeadingView.swift ├── TextHeadingView.xib ├── UserViewController.swift ├── Users.swift ├── WebViewController.swift ├── de.lproj │ └── Main.strings └── en.lproj │ └── Main.strings ├── IOSSwiftBoilerTests ├── IOSSwiftBoilerTests.swift ├── Info.plist └── WebViewControllerTests.swift ├── IOSSwiftBoilerUITests ├── IOSSwiftBoilerUITests.swift └── Info.plist ├── LICENSE.md ├── Podfile ├── Podfile.lock ├── Pods ├── Manifest.lock ├── Pods.xcodeproj │ ├── project.pbxproj │ ├── xcshareddata │ │ └── xcschemes │ │ │ ├── Pods-IOSSwiftBoiler.xcscheme │ │ │ ├── Pods-IOSSwiftBoilerTests.xcscheme │ │ │ ├── Pods-IOSSwiftBoilerUITests.xcscheme │ │ │ └── SwiftyJSON.xcscheme │ └── xcuserdata │ │ └── goodson.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── SwiftyJSON │ ├── LICENSE │ ├── README.md │ └── Source │ │ └── SwiftyJSON.swift └── Target Support Files │ ├── Pods-IOSSwiftBoiler │ ├── Info.plist │ ├── Pods-IOSSwiftBoiler-acknowledgements.markdown │ ├── Pods-IOSSwiftBoiler-acknowledgements.plist │ ├── Pods-IOSSwiftBoiler-dummy.m │ ├── Pods-IOSSwiftBoiler-frameworks.sh │ ├── Pods-IOSSwiftBoiler-resources.sh │ ├── Pods-IOSSwiftBoiler-umbrella.h │ ├── Pods-IOSSwiftBoiler.debug.xcconfig │ ├── Pods-IOSSwiftBoiler.modulemap │ └── Pods-IOSSwiftBoiler.release.xcconfig │ ├── Pods-IOSSwiftBoilerTests │ ├── Info.plist │ ├── Pods-IOSSwiftBoilerTests-acknowledgements.markdown │ ├── Pods-IOSSwiftBoilerTests-acknowledgements.plist │ ├── Pods-IOSSwiftBoilerTests-dummy.m │ ├── Pods-IOSSwiftBoilerTests-frameworks.sh │ ├── Pods-IOSSwiftBoilerTests-resources.sh │ ├── Pods-IOSSwiftBoilerTests-umbrella.h │ ├── Pods-IOSSwiftBoilerTests.debug.xcconfig │ ├── Pods-IOSSwiftBoilerTests.modulemap │ └── Pods-IOSSwiftBoilerTests.release.xcconfig │ ├── Pods-IOSSwiftBoilerUITests │ ├── Info.plist │ ├── Pods-IOSSwiftBoilerUITests-acknowledgements.markdown │ ├── Pods-IOSSwiftBoilerUITests-acknowledgements.plist │ ├── Pods-IOSSwiftBoilerUITests-dummy.m │ ├── Pods-IOSSwiftBoilerUITests-frameworks.sh │ ├── Pods-IOSSwiftBoilerUITests-resources.sh │ ├── Pods-IOSSwiftBoilerUITests-umbrella.h │ ├── Pods-IOSSwiftBoilerUITests.debug.xcconfig │ ├── Pods-IOSSwiftBoilerUITests.modulemap │ └── Pods-IOSSwiftBoilerUITests.release.xcconfig │ └── SwiftyJSON │ ├── Info.plist │ ├── SwiftyJSON-dummy.m │ ├── SwiftyJSON-prefix.pch │ ├── SwiftyJSON-umbrella.h │ ├── SwiftyJSON.modulemap │ └── SwiftyJSON.xcconfig ├── README.md ├── de.lproj └── Localizable.strings └── repo-data ├── 3d-touch-1.png ├── 3d-touch-2.png ├── home-logged-in.png ├── home-not-logged-in.png ├── login.gif └── settings.png /.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: nCjRVmlWmjhLUgLT0mmRVYoMqGW0QgJ2H 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /.hound.yml: -------------------------------------------------------------------------------- 1 | swift: 2 | config_file: .swiftlint.yml -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | # disabled_rules: # rule identifiers to exclude from running 2 | # - colon 3 | # - comma 4 | # - control_statement 5 | opt_in_rules: # some rules are only opt-in 6 | - empty_count 7 | - missing_docs 8 | # Find all the available rules by running: 9 | # swiftlint rules 10 | included: # paths to include during linting. `--path` is ignored if present. 11 | - Source 12 | excluded: # paths to ignore during linting. Takes precedence over `included`. 13 | - Carthage 14 | - Pods 15 | - Source/ExcludedFolder 16 | - Source/ExcludedFile.swift 17 | 18 | # configurable rules can be customized from this configuration file 19 | # binary rules can set their severity level 20 | force_cast: warning # implicitly 21 | force_try: 22 | severity: warning # explicitly 23 | # rules that have both warning and error levels, can set just the warning level 24 | # implicitly 25 | line_length: 110 26 | # they can set both implicitly with an array 27 | type_body_length: 28 | - 300 # warning 29 | - 400 # error 30 | # or they can set both explicitly 31 | file_length: 32 | warning: 500 33 | error: 1200 34 | # naming rules can set warnings/errors for min_length and max_length 35 | # additionally they can set excluded names 36 | type_name: 37 | min_length: 4 # only warning 38 | max_length: # warning and error 39 | warning: 40 40 | error: 50 41 | excluded: iPhone # excluded via string 42 | variable_name: 43 | min_length: # only min_length 44 | error: 4 # only error 45 | excluded: # excluded via string array 46 | - id 47 | - URL 48 | - GlobalAPIKey 49 | reporter: "xcode" # reporter type (xcode, json, csv, checkstyle) 50 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode7.3 3 | script: set -o pipefail && xcodebuild test -destination platform="iOS Simulator,name=iPhone 6s,OS=9.3" -workspace IOSSwiftBoiler.xcworkspace -scheme IOSSwiftBoiler -sdk iphonesimulator9.3 | xcpretty -------------------------------------------------------------------------------- /Base.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | IOSSwiftBoiler 4 | 5 | Created by Godson Ukpere on 3/17/16. 6 | Copyright © 2016 Godson Ukpere. All rights reserved. 7 | */ 8 | CLOSE = "Close"; 9 | CHOOSE = "Choose"; 10 | ACCOUNT = "Account"; 11 | ERROR = "Error"; 12 | ERROR_MESSAGE = "Error completing request"; 13 | DONE = "Done"; 14 | CANCEL = "Cancel"; 15 | LOGOUT = "Logout"; 16 | CONFIRM = "Confirm"; 17 | ARE_YOU_SURE = "Are you sure?"; 18 | USERNAME = ""; 19 | TNC = "Terms and Conditions"; 20 | HOME = "Home"; 21 | LOGIN = "Login"; 22 | OPEN = "Open"; 23 | SETTINGS = "Settings"; -------------------------------------------------------------------------------- /IOSSwiftBoiler.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /IOSSwiftBoiler.xcodeproj/xcshareddata/xcschemes/IOSSwiftBoiler.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 44 | 50 | 51 | 52 | 53 | 54 | 60 | 61 | 62 | 63 | 64 | 65 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /IOSSwiftBoiler.xcodeproj/xcuserdata/goodson.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | IOSSwiftBoiler.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 008681AF1C9A355B0036D514 16 | 17 | primary 18 | 19 | 20 | 008681C61C9A355B0036D514 21 | 22 | primary 23 | 24 | 25 | 008681D11C9A355B0036D514 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /IOSSwiftBoiler.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /IOSSwiftBoiler.xcworkspace/xcuserdata/goodson.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // IOSSwiftBoiler 4 | // 5 | // Created by Godson Ukpere on 3/17/16. 6 | // Copyright © 2016 Godson Ukpere. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CoreData 11 | import SwiftyJSON 12 | 13 | @UIApplicationMain 14 | class AppDelegate: UIResponder, UIApplicationDelegate { 15 | 16 | var window: UIWindow? 17 | 18 | func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool { 19 | 20 | return true 21 | } 22 | 23 | 24 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 25 | // Override point for customization after application launch. 26 | window?.tintColor = UIColor.init(red: 1.0, green: 0.46, blue: 0.7, alpha: 1.0) 27 | if #available(iOS 9.0, *) { 28 | let login = UIApplicationShortcutItem(type: NSLocalizedString("OPEN", comment: "Open"), localizedTitle:NSLocalizedString("LOGIN", comment: "Login"), localizedSubtitle: "", icon: UIApplicationShortcutIcon(templateImageName: "lock"), userInfo: [Const.ACTION_LOGIN: true]) 29 | 30 | let home = UIApplicationShortcutItem(type: NSLocalizedString("OPEN", comment: "Open"), localizedTitle: NSLocalizedString("HOME", comment: "Home"), localizedSubtitle: "", icon: UIApplicationShortcutIcon(templateImageName: "home"), userInfo: [Const.ACTION_HOME: true]) 31 | 32 | let settings = UIApplicationShortcutItem(type: NSLocalizedString("OPEN", comment: "Open"), localizedTitle: NSLocalizedString("SETTINGS", comment: "Settings"), localizedSubtitle: "", icon: UIApplicationShortcutIcon(templateImageName: "settings-black"), userInfo: [Const.ACTION_SETTINGS: true]) 33 | 34 | UIApplication.sharedApplication().shortcutItems = [home, settings] 35 | if !(Helpers.currentUser != nil) { 36 | UIApplication.sharedApplication().shortcutItems?.append(login) 37 | } 38 | } 39 | 40 | return true 41 | } 42 | 43 | @available(iOS 9.0, *) 44 | func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: (Bool) -> Void) { 45 | Helpers.launchActions = shortcutItem.userInfo 46 | completionHandler(true) 47 | } 48 | 49 | 50 | func applicationWillResignActive(application: UIApplication) { 51 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 52 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 53 | } 54 | 55 | func applicationDidEnterBackground(application: UIApplication) { 56 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 57 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 58 | } 59 | 60 | func applicationWillEnterForeground(application: UIApplication) { 61 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 62 | } 63 | 64 | func applicationDidBecomeActive(application: UIApplication) { 65 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 66 | } 67 | 68 | func applicationWillTerminate(application: UIApplication) { 69 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 70 | // Saves changes in the application's managed object context before the application terminates. 71 | self.saveContext() 72 | } 73 | 74 | // MARK: - Core Data stack 75 | 76 | lazy var applicationDocumentsDirectory: NSURL = { 77 | // The directory the application uses to store the Core Data store file. This code uses a directory named "com.godson.IOSSwiftBoiler" in the application's documents Application Support directory. 78 | let urls = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask) 79 | return urls[urls.count-1] 80 | }() 81 | 82 | lazy var managedObjectModel: NSManagedObjectModel = { 83 | // The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model. 84 | let modelURL = NSBundle.mainBundle().URLForResource("IOSSwiftBoiler", withExtension: "momd")! 85 | return NSManagedObjectModel(contentsOfURL: modelURL)! 86 | }() 87 | 88 | lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator = { 89 | // The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. 90 | // Create the coordinator and store 91 | let coordinator = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel) 92 | let url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("SingleViewCoreData.sqlite") 93 | var failureReason = "There was an error creating or loading the application's saved data." 94 | do { 95 | try coordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil) 96 | } catch { 97 | // Report any error we got. 98 | var dict = [String: AnyObject]() 99 | dict[NSLocalizedDescriptionKey] = "Failed to initialize the application's saved data" 100 | dict[NSLocalizedFailureReasonErrorKey] = failureReason 101 | 102 | dict[NSUnderlyingErrorKey] = error as NSError 103 | let wrappedError = NSError(domain: "YOUR_ERROR_DOMAIN", code: 9999, userInfo: dict) 104 | // Replace this with code to handle the error appropriately. 105 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 106 | NSLog("Unresolved error \(wrappedError), \(wrappedError.userInfo)") 107 | abort() 108 | } 109 | 110 | return coordinator 111 | }() 112 | 113 | lazy var managedObjectContext: NSManagedObjectContext = { 114 | // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) This property is optional since there are legitimate error conditions that could cause the creation of the context to fail. 115 | let coordinator = self.persistentStoreCoordinator 116 | var managedObjectContext = NSManagedObjectContext(concurrencyType: .MainQueueConcurrencyType) 117 | managedObjectContext.persistentStoreCoordinator = coordinator 118 | return managedObjectContext 119 | }() 120 | 121 | // MARK: - Core Data Saving support 122 | 123 | func saveContext () { 124 | if managedObjectContext.hasChanges { 125 | do { 126 | try managedObjectContext.save() 127 | } catch { 128 | // Replace this implementation with code to handle the error appropriately. 129 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 130 | let nserror = error as NSError 131 | NSLog("Unresolved error \(nserror), \(nserror.userInfo)") 132 | abort() 133 | } 134 | } 135 | } 136 | 137 | } 138 | 139 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/facebook_filled.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "facebook_filled.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/facebook_filled.imageset/facebook_filled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/facebook_filled.imageset/facebook_filled.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/forward.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "forward-2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "forward-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "forward.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/forward.imageset/forward-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/forward.imageset/forward-1.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/forward.imageset/forward-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/forward.imageset/forward-2.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/forward.imageset/forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/forward.imageset/forward.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/gradient.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "idiom" : "universal", 13 | "filename" : "gradient.png", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/gradient.imageset/gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/gradient.imageset/gradient.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/home.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "home-2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "home-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "home.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/home.imageset/home-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/home.imageset/home-1.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/home.imageset/home-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/home.imageset/home-2.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/home.imageset/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/home.imageset/home.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/lock.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "lock-2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "lock-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "lock.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/lock.imageset/lock-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/lock.imageset/lock-1.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/lock.imageset/lock-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/lock.imageset/lock-2.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/lock.imageset/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/lock.imageset/lock.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "logo-placeholder.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/logo.imageset/logo-placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/logo.imageset/logo-placeholder.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/settings-black.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "settings.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "settings-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "settings-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/settings-black.imageset/settings-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/settings-black.imageset/settings-1.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/settings-black.imageset/settings-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/settings-black.imageset/settings-2.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/settings-black.imageset/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/settings-black.imageset/settings.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/settings.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "settings.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "settings-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "settings-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/settings.imageset/settings-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/settings.imageset/settings-1.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/settings.imageset/settings-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/settings.imageset/settings-2.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/settings.imageset/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/settings.imageset/settings.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/twitter_filled.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "twitter_filled.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/twitter_filled.imageset/twitter_filled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/twitter_filled.imageset/twitter_filled.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/user-large.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "idiom" : "universal", 13 | "filename" : "user-large.png", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets.xcassets/user-large.imageset/user-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets.xcassets/user-large.imageset/user-large.png -------------------------------------------------------------------------------- /IOSSwiftBoiler/Assets/background.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/IOSSwiftBoiler/Assets/background.mp4 -------------------------------------------------------------------------------- /IOSSwiftBoiler/BackgroundGradientView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BackgroundGradientView.swift 3 | // ios-swift-boiler 4 | // 5 | // Created by Godson Ukpere on 3/15/16. 6 | // Copyright © 2016 Godson Ukpere. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class BackgroundGradientView: UIView { 12 | 13 | /* 14 | // Only override drawRect: if you perform custom drawing. 15 | // An empty implementation adversely affects performance during animation. 16 | override func drawRect(rect: CGRect) { 17 | // Drawing code 18 | } 19 | */ 20 | 21 | override init(frame: CGRect) { 22 | super.init(frame: frame) 23 | if self.subviews.count == 0 { 24 | setup() 25 | } 26 | } 27 | 28 | required init?(coder aDecoder: NSCoder) { 29 | super.init(coder: aDecoder) 30 | if self.subviews.count == 0 { 31 | setup() 32 | } 33 | } 34 | 35 | func setup() { 36 | if let backgroundImage = UIImage(named: "gradient") { 37 | self.backgroundColor = UIColor(patternImage: backgroundImage); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/Const.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Const.swift 3 | // ios swift boiler 4 | // 5 | // Created by Godson Ukpere on 3/14/16. 6 | // Copyright © 2016 Godson Ukpere. All rights reserved. 7 | // 8 | 9 | class Const { 10 | // Facebook JSON Keys 11 | static let KEY_FB_COVER_IMG:String = "cover" 12 | static let KEY_FB_ABOUT:String = "about" 13 | static let KEY_FB_BIO:String = "bio" 14 | 15 | // Twitter JSON Keys 16 | static let KEY_TWITTER_HANDLE:String = "screen_name" 17 | static let KEY_TWITTER_DESCRIPTION:String = "description" 18 | static let KEY_TWITTER_IMG:String = "profile_image_url" 19 | static let KEY_TWITTER_BG_IMG:String = "profile_background_image_url" 20 | static let KEY_TWITTER_ID:String = "id_str" 21 | 22 | // Ubiquituous JSON Keys 23 | static let KEY_NAME:String = "name" 24 | static let KEY_STATUS_CODE:String = "status_code" 25 | static let KEY_USER:String = "user" 26 | static let KEY_ID:String = "id" 27 | static let KEY_SECRET:String = "secret" 28 | static let KEY_TOKEN:String = "token" 29 | static let KEY_OAUTH_TOKEN:String = "oauth_token" 30 | static let KEY_SOURCE:String = "source" 31 | static let KEY_ACCESS_TOKEN:String = "access_token" 32 | static let KEY_OAUTH_TOKEN_SECRET:String = "oauth_token_secret" 33 | static let KEY_OAUTH_SIGNATURE:String = "oauth_signature" 34 | static let KEY_CREATED_AT:String = "created_at" 35 | static let KEY_IMG:String = "img" 36 | static let KEY_DESCRIPTION:String = "desc" 37 | static let KEY_ERROR:String = "error" 38 | static let KEY_CODE:String = "code" 39 | static let KEY_MESSAGE:String = "message" 40 | 41 | 42 | // User JSON Keys 43 | static let KEY_USER_ID:String = "user_id" 44 | static let KEY_USERNAME:String = "username" 45 | static let KEY_EMAIL:String = "email" 46 | static let KEY_BG_IMG:String = "bg_img" 47 | static let KEY_PLATFORM:String = "platform" 48 | 49 | // Login Platforms 50 | enum Platforms { 51 | static let FACEBOOK:String = "facebook" 52 | static let TWITTER:String = "twitter" 53 | } 54 | 55 | // TWITTER APP SECRET 56 | static let TWITTER_KEY:String = "UNCDambMvAgmJ4u8cB8GmuxKA" 57 | static let TWITTER_SECRET:String = "sBaC5cUwbO8fVtjuXbFquldXXZ0NGmTn6KJxNNjXiLHxYbcnJH" 58 | 59 | // MODEL NAMES 60 | static let MODEL_USERS:String = "Users" 61 | 62 | // SEGUE TITLES 63 | static let SEGUE_USER_VIEW:String = "UserView" 64 | static let SEGUE_LOGIN_VIEW:String = "LoginView" 65 | static let SEGUE_SETTINGS_VIEW:String = "SettingsView" 66 | static let SEGUE_WEB_VIEW:String = "WebView" 67 | 68 | // NOTIFICATIONS 69 | static let NOTIFICATION_USER_AUTH:String = "com.gottsohn.ios-swift-boiler.NC_USER_AUTH" 70 | 71 | // Storyboard Identifies 72 | static let ID_USER_VIEW_CONTROLLER:String = "UserViewController" 73 | static let ID_WEB_VIEW_CONTROLLER:String = "WebViewController" 74 | 75 | // LAUNCH ACTION 76 | static let ACTION_LOGIN:String = "LOGIN" 77 | static let ACTION_HOME:String = "HOME" 78 | static let ACTION_SETTINGS:String = "SETTINGS" 79 | } 80 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/Helpers.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Helpers.swift 3 | // ios swift boiler 4 | // 5 | // Created by Godson Ukpere on 3/14/16. 6 | // Copyright © 2016 Godson Ukpere. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CoreData 11 | import SwiftyJSON 12 | 13 | class Helpers { 14 | static var currentUser: JSON! 15 | static var launchActions:[String : NSSecureCoding]! 16 | 17 | static func showDialog(viewController:UIViewController, message:String, title:String, callbackOk:((action:UIAlertAction) -> Void)? = nil, callback:((action:UIAlertAction) -> Void)? = nil) { 18 | let alert = UIAlertController(title: title, message: message, preferredStyle: .Alert) 19 | let action = UIAlertAction(title: NSLocalizedString("CLOSE", comment: "Close"), style: .Default, handler: callback) 20 | alert.addAction(action) 21 | if callbackOk != nil { 22 | let okAction = UIAlertAction(title: "OK", style: .Default, handler: callbackOk) 23 | alert.addAction(okAction) 24 | } 25 | 26 | viewController.presentViewController(alert, animated: true, completion: nil) 27 | } 28 | 29 | static var appVersion:String { 30 | get { 31 | if NSBundle.mainBundle().infoDictionary != nil, 32 | let appVersion:String = NSBundle.mainBundle().infoDictionary!["CFBundleShortVersionString"] as? String { 33 | return appVersion 34 | } 35 | 36 | return "1.0" 37 | } 38 | } 39 | 40 | static func showError(view:UIViewController, error: NSError?, callback: ((action: UIAlertAction)-> ())? = nil) { 41 | var errorMessage:String? 42 | var errorTitle:String? 43 | if error != nil { 44 | errorMessage = error!.localizedDescription 45 | errorTitle = error!.localizedFailureReason 46 | } 47 | 48 | errorTitle = errorTitle ?? NSLocalizedString("ERROR", comment: "Error") 49 | errorMessage = errorMessage ?? NSLocalizedString("ERROR_MESSAGE", comment: "Error Message") 50 | showDialog(view, message: errorMessage!, title: errorTitle!, callback: callback) 51 | } 52 | 53 | static func getQueryStringParameter(url: String, param: String) -> String? { 54 | let url = NSURLComponents(string: url)! 55 | 56 | return 57 | (url.queryItems! as [NSURLQueryItem]) 58 | .filter({ (item) in item.name == param }).first?.value 59 | } 60 | 61 | static func saveManagedContext (view: UIViewController? = nil, context: NSManagedObjectContext, callback: (error: NSError?)->()) { 62 | do { 63 | try context.save() 64 | callback(error: nil) 65 | } catch let error as NSError { 66 | callback(error: error) 67 | if view != nil { 68 | self.showError(view!, error: error) 69 | } 70 | } 71 | } 72 | 73 | static func async(run:(()->())? = nil, completed:(()->())? = nil) { 74 | dispatch_async(dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0), { 75 | if run != nil { 76 | run!() 77 | } 78 | 79 | dispatch_sync(dispatch_get_main_queue(), { 80 | if completed != nil { 81 | completed!() 82 | } 83 | }) 84 | }) 85 | } 86 | 87 | internal static func getDataFromUrl(url:NSURL, completion: (data: NSData?, response: NSURLResponse?, error: NSError? ) -> ()) { 88 | Helpers.async({ 89 | NSURLSession.sharedSession().dataTaskWithURL(url) { 90 | data, response, error in 91 | Helpers.async { 92 | completion(data: data, response: response, error: error) 93 | } 94 | }.resume() 95 | }) 96 | } 97 | 98 | // Helper function to get image from internet 99 | static func setImage (imageView:UIImageView? = nil, url: String, callback: ((error:NSError?, image: UIImage?)-> Void)? = nil) { 100 | 101 | let nsURL = NSURL(string: url) 102 | self.getDataFromUrl(nsURL!) { 103 | data, response, error in 104 | let noImage = UIImage(named: "no-image") 105 | guard let data = data where error == nil else { 106 | if imageView != nil { 107 | imageView!.image = noImage 108 | } 109 | 110 | if callback != nil { 111 | callback!(error: error, image: noImage) 112 | } 113 | 114 | return 115 | } 116 | 117 | let image = UIImage(data: data) ?? noImage 118 | if imageView != nil { 119 | imageView!.image = image 120 | } 121 | 122 | if callback != nil { 123 | callback!(error: nil, image: image) 124 | } 125 | } 126 | } 127 | 128 | } 129 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/IOSSwiftBoiler.xcdatamodeld/.xccurrentversion: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _XCCurrentVersionName 6 | IOSSwiftBoiler.xcdatamodel 7 | 8 | 9 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/IOSSwiftBoiler.xcdatamodeld/IOSSwiftBoiler.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/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 | CFBundleLocalizations 14 | 15 | en 16 | de 17 | 18 | CFBundleName 19 | $(PRODUCT_NAME) 20 | CFBundlePackageType 21 | APPL 22 | CFBundleShortVersionString 23 | 1.0.1 24 | CFBundleSignature 25 | ???? 26 | CFBundleURLTypes 27 | 28 | 29 | CFBundleTypeRole 30 | Editor 31 | CFBundleURLIconFile 32 | 33 | CFBundleURLName 34 | prefs 35 | CFBundleURLSchemes 36 | 37 | prefs 38 | 39 | 40 | 41 | CFBundleVersion 42 | 0 43 | FacebookAppID 44 | 961478310602665 45 | FacebookDisplayName 46 | IOS Swift Boiler 47 | LSApplicationCategoryType 48 | public.app-category.social-networking 49 | LSApplicationQueriesSchemes 50 | 51 | fbapi 52 | fb-messenger-api 53 | fbauth2 54 | fbshareextension 55 | 56 | LSRequiresIPhoneOS 57 | 58 | NSAppTransportSecurity 59 | 60 | NSExceptionDomains 61 | 62 | akamaihd.net 63 | 64 | NSIncludesSubdomains 65 | 66 | NSTemporaryExceptionAllowsInsecureHTTPLoads 67 | 68 | NSTemporaryExceptionMinimumTLSVersion 69 | TLSv1.1 70 | NSThirdPartyExceptionRequiresForwardSecrecy 71 | 72 | 73 | facebook.com 74 | 75 | NSIncludesSubdomains 76 | 77 | NSThirdPartyExceptionRequiresForwardSecrecy 78 | 79 | 80 | fbcdn.net 81 | 82 | NSIncludesSubdomains 83 | 84 | NSThirdPartyExceptionRequiresForwardSecrecy 85 | 86 | 87 | godson.com.ng 88 | 89 | NSIncludesSubdomains 90 | 91 | NSTemporaryExceptionAllowsInsecureHTTPLoads 92 | 93 | NSTemporaryExceptionMinimumTLSVersion 94 | TLSv1.1 95 | NSThirdPartyExceptionRequiresForwardSecrecy 96 | 97 | 98 | twimg.com 99 | 100 | NSIncludesSubdomains 101 | 102 | NSTemporaryExceptionAllowsInsecureHTTPLoads 103 | 104 | NSTemporaryExceptionMinimumTLSVersion 105 | TLSv1.1 106 | NSThirdPartyExceptionRequiresForwardSecrecy 107 | 108 | 109 | 110 | 111 | UILaunchStoryboardName 112 | LaunchScreen 113 | UIMainStoryboardFile 114 | Main 115 | UIRequiredDeviceCapabilities 116 | 117 | armv7 118 | 119 | UIRequiresFullScreen 120 | 121 | UIStatusBarStyle 122 | UIStatusBarStyleLightContent 123 | UISupportedInterfaceOrientations 124 | 125 | UIInterfaceOrientationPortrait 126 | UIInterfaceOrientationPortraitUpsideDown 127 | 128 | UISupportedInterfaceOrientations~ipad 129 | 130 | UIInterfaceOrientationPortrait 131 | UIInterfaceOrientationPortraitUpsideDown 132 | UIInterfaceOrientationLandscapeLeft 133 | UIInterfaceOrientationLandscapeRight 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/LoginViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoginViewController.swift 3 | // ios swift boiler 4 | // 5 | // Created by Godson Ukpere on 3/14/16. 6 | // Copyright © 2016 Godson Ukpere. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import MediaPlayer 11 | import CoreData 12 | import Social 13 | import SwiftyJSON 14 | import Accounts 15 | 16 | class LoginViewController: UIViewController, UIGestureRecognizerDelegate { 17 | 18 | var player:AVPlayer! 19 | var avPlayerLayer:AVPlayerLayer! 20 | var isTrackingPanLocation = false 21 | let notificationCenter = NSNotificationCenter.defaultCenter() 22 | var panGestureRecognizer : UIPanGestureRecognizer! 23 | 24 | @IBOutlet weak var controlView:UIView! 25 | @IBOutlet weak var loadingIndicator:UIActivityIndicatorView! 26 | 27 | override func viewDidLoad() { 28 | super.viewDidLoad() 29 | // Play background Video 30 | playBgVideo() 31 | 32 | // Add Pull up / down Swipe to close to View 33 | panGestureRecognizer = UIPanGestureRecognizer(target: self, action: 34 | #selector(panRecognized(_:))) 35 | 36 | panGestureRecognizer.delegate = self 37 | view.addGestureRecognizer(panGestureRecognizer) 38 | } 39 | 40 | override func viewWillAppear(animated: Bool) { 41 | super.viewWillAppear(animated) 42 | 43 | } 44 | 45 | override func preferredStatusBarStyle() -> UIStatusBarStyle { 46 | return .LightContent 47 | } 48 | 49 | override func viewDidAppear(animated: Bool) { 50 | super.viewDidAppear(animated) 51 | player?.play() 52 | } 53 | 54 | override func didReceiveMemoryWarning() { 55 | super.didReceiveMemoryWarning() 56 | player?.pause() 57 | dismissViewControllerAnimated(false, completion: nil) 58 | notificationCenter.removeObserver(self) 59 | } 60 | 61 | // Swipe to close processor 62 | func panRecognized(recognizer:UIPanGestureRecognizer) { 63 | view.frame.origin.y = recognizer.translationInView(view).y 64 | if recognizer.state == .Began { 65 | recognizer.setTranslation(CGPointZero, inView : view) 66 | isTrackingPanLocation = true 67 | } else if recognizer.state == .Ended || recognizer.state == .Cancelled && isTrackingPanLocation { 68 | if abs(recognizer.translationInView(view).y) > 150 { 69 | recognizer.enabled = false 70 | return dismissViewControllerAnimated(true, completion: nil) 71 | } else { 72 | isTrackingPanLocation = false 73 | } 74 | 75 | UIView.animateWithDuration(0.2, delay: 0, options: .CurveEaseOut, animations:{ () -> Void in 76 | self.view.frame.origin.y = 0 77 | }, completion: nil) 78 | } else { 79 | isTrackingPanLocation = false 80 | } 81 | } 82 | 83 | func gestureRecognizer(gestureRecognizer: 84 | UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer 85 | otherGestureRecognizer : UIGestureRecognizer)->Bool { 86 | 87 | return true 88 | } 89 | 90 | // Loading indicator that displays during loading 91 | private func loading(isLoading:Bool = true) { 92 | Helpers.async { 93 | self.controlView.hidden = isLoading 94 | if isLoading { 95 | self.loadingIndicator.startAnimating() 96 | } else { 97 | self.loadingIndicator.stopAnimating() 98 | } 99 | } 100 | } 101 | 102 | func socialAccountAuth(identifier:String, options: 103 | [NSObject: AnyObject]?, sender: UIButton) { 104 | let account = ACAccountStore() 105 | let accountType = 106 | account.accountTypeWithAccountTypeIdentifier(identifier) 107 | 108 | account.requestAccessToAccountsWithType(accountType, options: 109 | options, completion: { 110 | success, error in 111 | var urlString:String = "prefs:root=" 112 | if identifier == ACAccountTypeIdentifierTwitter { 113 | urlString = "\(urlString)TWITTER" 114 | } else { 115 | urlString = "\(urlString)FACEBOOK" 116 | } 117 | 118 | let url:NSURL! = NSURL(string : urlString) 119 | if success { 120 | let arrayOfAccounts = 121 | account.accountsWithAccountType(accountType).map({ 122 | (account) -> ACAccount in 123 | 124 | return account as! ACAccount 125 | }) 126 | 127 | if arrayOfAccounts.count > 0 { 128 | if arrayOfAccounts.count > 1 { 129 | Helpers.async { 130 | self.listAccounts(arrayOfAccounts, identifier: 131 | identifier, sender: sender) 132 | } 133 | } else { 134 | self.getSocialParams(arrayOfAccounts.first!, 135 | identifier: identifier) 136 | } 137 | } else { 138 | UIApplication.sharedApplication().openURL(url) 139 | } 140 | } else { 141 | self.loading(false) 142 | if error?.code == 6 { 143 | UIApplication.sharedApplication().openURL(url) 144 | } else { 145 | Helpers.showError(self, error: error) 146 | } 147 | } 148 | }) 149 | } 150 | 151 | func getSocialParams(socialAccount: ACAccount, identifier:String) { 152 | loading() 153 | var serviceType:String = SLServiceTypeFacebook 154 | var urlString:String = "https://graph.facebook.com/me" 155 | var parameters:[String: String]? = ["fields": "email,cover,name,bio"] 156 | if identifier == ACAccountTypeIdentifierTwitter { 157 | serviceType = SLServiceTypeTwitter 158 | urlString = 159 | "https://api.twitter.com/1.1/account/verify_credentials.json" 160 | 161 | parameters = nil 162 | } 163 | 164 | let url:NSURL? = NSURL(string: urlString) 165 | let infoRequest:SLRequest = SLRequest(forServiceType: 166 | serviceType, requestMethod: .GET, URL: url, parameters: parameters) 167 | infoRequest.account = socialAccount 168 | infoRequest.performRequestWithHandler { data, response, error in 169 | var _error = error 170 | if error == nil { 171 | let result:JSON = JSON(data: data) 172 | let errorResult = result[Const.KEY_ERROR] 173 | if errorResult.isExists() { 174 | _error = NSError(domain: 175 | errorResult[Const.KEY_MESSAGE].stringValue, code: 176 | errorResult[Const.KEY_CODE].intValue, userInfo: nil) 177 | } else { 178 | if identifier == ACAccountTypeIdentifierTwitter { 179 | self.processTwitter(result, request: infoRequest 180 | .preparedURLRequest()) 181 | } else { 182 | self.processFacebook(result, request: infoRequest 183 | .preparedURLRequest()) 184 | } 185 | 186 | return 187 | } 188 | 189 | } 190 | 191 | Helpers.async { 192 | Helpers.showError(self, error: _error) 193 | self.loading(false) 194 | } 195 | } 196 | } 197 | 198 | func listAccounts(accounts: [ACAccount], identifier: String, sender: UIButton) { 199 | let optionMenu = UIAlertController(title: nil, message: "\(NSLocalizedString("CHOOSE", comment: "Choose")) \(NSLocalizedString("ACCOUNT", comment: "Account"))", preferredStyle: .ActionSheet) 200 | 201 | for account in accounts { 202 | let title = identifier == ACAccountTypeIdentifierTwitter ? 203 | "@\(account.username)" : account.userFullName 204 | 205 | let action = UIAlertAction(title: title, style: .Default, handler: { 206 | (alert: UIAlertAction!) -> Void in 207 | self.getSocialParams(account, identifier: identifier) 208 | }) 209 | 210 | optionMenu.addAction(action) 211 | } 212 | 213 | optionMenu.addAction(UIAlertAction(title: 214 | NSLocalizedString("CLOSE", comment: "Close"), style: .Cancel, 215 | handler: nil)) 216 | 217 | let popUpPresenter = optionMenu.popoverPresentationController 218 | popUpPresenter?.sourceView = sender 219 | popUpPresenter?.sourceRect = sender.bounds 220 | presentViewController(optionMenu, animated: true, completion: nil) 221 | } 222 | 223 | func getToken(string:String) -> (String, String) { 224 | let strings = string.characters.split("=").map(String.init) 225 | if strings.count > 6 { 226 | let token = strings[5].characters.split("\"").map(String.init)[0] 227 | let secret = strings[6].characters.split("\"").map(String.init)[0] 228 | return (token, secret) 229 | } else { 230 | return ("", "") 231 | } 232 | } 233 | 234 | // Action from button to login with Facebook 235 | @IBAction func facebookAuth (sender: UIButton) { 236 | socialAccountAuth(ACAccountTypeIdentifierFacebook, options: [ 237 | ACFacebookAppIdKey: "961478310602665", 238 | ACFacebookAudienceKey: ACFacebookAudienceEveryone, 239 | ACFacebookPermissionsKey: [ 240 | "basic_info", 241 | "public_profile", 242 | "email"] 243 | ], sender: sender) 244 | } 245 | 246 | func processFacebook(result:JSON, request: NSURLRequest) { 247 | if let userId = result[Const.KEY_ID].string { 248 | let bio:String = result[Const.KEY_FB_BIO].string ?? 249 | "Constantly on Replay.." 250 | 251 | let bgImg:String = result[Const.KEY_FB_COVER_IMG][Const.KEY_SOURCE].stringValue 252 | let name:String = result[Const.KEY_NAME].string ?? "Re-player" 253 | let email:String = result[Const.KEY_EMAIL].string ?? "" 254 | let params:[String: String] = [ 255 | Const.KEY_NAME: name, 256 | Const.KEY_EMAIL: email, 257 | Const.KEY_IMG : "https://graph.facebook.com/\(userId)/picture?width=200&height=200", 258 | Const.KEY_USER_ID : userId, 259 | Const.KEY_BG_IMG: bgImg, 260 | Const.KEY_DESCRIPTION: bio, 261 | Const.KEY_OAUTH_TOKEN: Helpers.getQueryStringParameter( 262 | request.URL!.absoluteString, param: Const.KEY_ACCESS_TOKEN) ?? "", 263 | Const.KEY_OAUTH_TOKEN_SECRET: "", 264 | Const.KEY_PLATFORM: Const.Platforms.FACEBOOK, 265 | Const.KEY_USERNAME: "" 266 | ] 267 | 268 | saveUser(params) 269 | } 270 | } 271 | 272 | func processTwitter(result:JSON, request: NSURLRequest) { 273 | var params:[String:String] = [:] 274 | let oauth = getToken(request.allHTTPHeaderFields!["Authorization"]!) 275 | params[Const.KEY_IMG] = result[Const.KEY_TWITTER_IMG].stringValue 276 | params[Const.KEY_BG_IMG] = result[Const.KEY_TWITTER_BG_IMG].stringValue 277 | params[Const.KEY_NAME] = result[Const.KEY_NAME].stringValue 278 | params[Const.KEY_EMAIL] = "" 279 | params[Const.KEY_USER_ID] = result[Const.KEY_TWITTER_ID].stringValue 280 | params[Const.KEY_OAUTH_TOKEN] = oauth.0 281 | params[Const.KEY_OAUTH_TOKEN_SECRET] = oauth.1 282 | params[Const.KEY_PLATFORM] = Const.Platforms.TWITTER 283 | params[Const.KEY_DESCRIPTION] = result[Const.KEY_TWITTER_DESCRIPTION].stringValue 284 | params[Const.KEY_USERNAME] = result[Const.KEY_TWITTER_HANDLE].stringValue 285 | saveUser(params) 286 | 287 | } 288 | 289 | // Close View 290 | @IBAction func goHome (sender: UIButton) { 291 | dismissViewControllerAnimated(true, completion: nil) 292 | } 293 | 294 | // Action from button to login with Twitter 295 | @IBAction func twitterAuth (sender: UIButton) { 296 | socialAccountAuth(ACAccountTypeIdentifierTwitter, options: 297 | nil, sender: sender) 298 | } 299 | 300 | func saveUser(user:[String:String]) { 301 | Users.saveUser(authUser: JSON(user)) { error in 302 | Helpers.async { 303 | if error != nil { 304 | Helpers.showError(self, error: error) 305 | } else { 306 | // Send a broadcast to inform concerning listeners that the user object as changed 307 | self.notificationCenter.postNotificationName( 308 | Const.NOTIFICATION_USER_AUTH, object: nil) 309 | // Close the view 310 | self.dismissViewControllerAnimated(true, completion: nil) 311 | } 312 | } 313 | } 314 | } 315 | 316 | func playBgVideo() { 317 | let path = NSBundle.mainBundle().pathForResource("Assets/background", ofType:"mp4") 318 | let url:NSURL = NSURL.fileURLWithPath(path!) 319 | player = AVPlayer(URL: url) 320 | avPlayerLayer = AVPlayerLayer(player: player) 321 | avPlayerLayer.frame = view.bounds 322 | avPlayerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill 323 | view.layer.addSublayer(avPlayerLayer) 324 | 325 | // Add observer to help repeat background video when it completes 326 | notificationCenter.addObserver(self, 327 | selector: #selector(playerItemDidReachEnd(_:)), 328 | name: AVPlayerItemDidPlayToEndTimeNotification, 329 | object: player?.currentItem) 330 | 331 | player.volume = 1.0 332 | player.play() 333 | } 334 | 335 | func playerItemDidReachEnd(notification: NSNotification) { 336 | player.seekToTime(kCMTimeZero) 337 | player.volume = 0.5 338 | player.play() 339 | } 340 | } 341 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/SettingsViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsViewController.swift 3 | // ios-swift-boiler 4 | // 5 | // Created by Godson Ukpere on 3/15/16. 6 | // Copyright © 2016 Godson Ukpere. All rights reserved. 7 | // 8 | 9 | 10 | import UIKit 11 | import CoreData 12 | 13 | class SettingsTableViewController: UITableViewController { 14 | 15 | let SONG_COUNT:Int = 30 16 | let url:String = "http://blog.godson.com.ng/terms-and-conditions/" 17 | let labelText:String = NSLocalizedString("TNC", comment: "TNC") 18 | 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | // self.navigationItem.rightBarButtonItem = self.editButtonItem() 22 | } 23 | 24 | override func didReceiveMemoryWarning() { 25 | super.didReceiveMemoryWarning() 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | override func viewDidAppear(animated: Bool) { 30 | super.viewDidAppear(animated) 31 | if Helpers.currentUser != nil, let loginCell:UITableViewCell = tableView.cellForRowAtIndexPath(NSIndexPath(forRow: 0, inSection: 0)) { 32 | (loginCell.viewWithTag(1) as! UILabel).text = NSLocalizedString("LOGOUT", comment: "Logout") 33 | let name:String = Helpers.currentUser[Const.KEY_USERNAME].string ?? Helpers.currentUser[Const.KEY_NAME].stringValue 34 | (loginCell.viewWithTag(2) as! UILabel).text = name.characters.count > 0 ? name : NSLocalizedString("USERNAME", comment: "Username") 35 | } 36 | 37 | if let versionCell:UITableViewCell = tableView.cellForRowAtIndexPath(NSIndexPath(forRow: 0, inSection: 1)) { 38 | (versionCell.viewWithTag(1) as! UILabel).text = Helpers.appVersion 39 | } 40 | } 41 | 42 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 43 | if let viewController:WebViewController = segue.destinationViewController as? WebViewController { 44 | viewController.url = url 45 | viewController.labelText = labelText 46 | } 47 | } 48 | 49 | @IBAction func close (sender: AnyObject) { 50 | dismissViewControllerAnimated(true, completion: nil) 51 | } 52 | 53 | override func numberOfSectionsInTableView(tableView: UITableView) -> Int { 54 | return 2 55 | } 56 | 57 | override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 58 | if section == 0 { 59 | return 1 60 | } else if section == 1 { 61 | return 3 62 | } 63 | 64 | return 0 65 | } 66 | 67 | override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 68 | tableView.deselectRowAtIndexPath(indexPath, animated: true) 69 | let alertMessage:String = NSLocalizedString("ARE_YOU_SURE", comment: "Are you sure") 70 | let alertTitle:String = NSLocalizedString("CONFIRM", comment: "Confirm") 71 | switch indexPath.section { 72 | case 0: 73 | switch indexPath.row { 74 | case 0: 75 | if Helpers.currentUser != nil { 76 | Helpers.showDialog(self, message: alertMessage, title: alertTitle, callbackOk: { 77 | action in 78 | Helpers.currentUser = nil 79 | Users.deleteData() 80 | NSNotificationCenter.defaultCenter().postNotificationName(Const.NOTIFICATION_USER_AUTH, object: nil) 81 | self.close(tableView) 82 | }) 83 | } else { 84 | close(tableView) 85 | } 86 | default: 87 | break 88 | } 89 | case 1: 90 | switch indexPath.row { 91 | case 1: 92 | // Open Web View 93 | break 94 | case 2: 95 | Helpers.showDialog(self, message: "About this app goes in here", title: "IOS Swift Boiler") 96 | default: 97 | break 98 | } 99 | default: 100 | break 101 | } 102 | } 103 | 104 | /* 105 | override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 106 | let cell = tableView.dequeueReusableCellWithIdentifier("reuseIdentifier", forIndexPath: indexPath) 107 | 108 | // Configure the cell... 109 | 110 | return cell 111 | } 112 | */ 113 | 114 | /* 115 | // Override to support conditional editing of the table view. 116 | override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool { 117 | // Return false if you do not want the specified item to be editable. 118 | return true 119 | } 120 | */ 121 | 122 | /* 123 | // Override to support editing the table view. 124 | override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { 125 | if editingStyle == .Delete { 126 | // Delete the row from the data source 127 | tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) 128 | } else if editingStyle == .Insert { 129 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view 130 | } 131 | } 132 | */ 133 | 134 | /* 135 | // Override to support rearranging the table view. 136 | override func tableView(tableView: UITableView, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) { 137 | 138 | } 139 | */ 140 | 141 | /* 142 | // Override to support conditional rearranging of the table view. 143 | override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool { 144 | // Return false if you do not want the item to be re-orderable. 145 | return true 146 | } 147 | */ 148 | } 149 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/TextHeadingView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TextHeadingView.swift 3 | // Replay 4 | // 5 | // Created by Godson Ukpere on 3/15/16. 6 | // Copyright © 2016 Godson Ukpere. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class TextHeadingView: UIView { 12 | @IBOutlet weak var textLabel: UILabel! 13 | @IBOutlet weak var imageView: UIImageView! 14 | @IBInspectable var messageText: String? { 15 | get { 16 | return textLabel.text 17 | } 18 | 19 | set(text) { 20 | textLabel.text = text 21 | textLabel.numberOfLines = 1 22 | textLabel.sizeToFit() 23 | } 24 | } 25 | 26 | override init(frame: CGRect) { 27 | super.init(frame: frame) 28 | if self.subviews.count == 0 { 29 | setup() 30 | } 31 | } 32 | 33 | required init?(coder aDecoder: NSCoder) { 34 | super.init(coder: aDecoder) 35 | if self.subviews.count == 0 { 36 | setup() 37 | } 38 | } 39 | 40 | func tapAction(sender: AnyObject) { 41 | callback() 42 | } 43 | 44 | var callback:()->() = { 45 | print("Du auswahlen das Anzeige") 46 | } 47 | 48 | func setup() { 49 | if let view = NSBundle.mainBundle().loadNibNamed("TextHeadingView", owner: self, options: nil).first as? UIView { 50 | view.frame = bounds 51 | view.autoresizingMask = [UIViewAutoresizing.FlexibleWidth, UIViewAutoresizing.FlexibleHeight] 52 | addSubview(view) 53 | textLabel = textLabel ?? view.subviews[0] as! UILabel 54 | view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(tapAction(_:)))) 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/TextHeadingView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 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 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/UserViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UserViewController.swift 3 | // ios swift boiler 4 | // 5 | // Created by Godson Ukpere on 3/14/16. 6 | // Copyright © 2016 Godson Ukpere. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftyJSON 11 | 12 | class UserViewController: UIViewController { 13 | 14 | @IBOutlet weak var activeUserView: UIView! 15 | @IBOutlet weak var inactiveUserView: UIView! 16 | @IBOutlet weak var usernameLabel: UILabel! 17 | @IBOutlet weak var fullnameLabel: UILabel! 18 | @IBOutlet weak var descriptionLabel: UILabel! 19 | @IBOutlet weak var userBackgroundView: UIImageView! 20 | @IBOutlet weak var profileImageView: UIImageView! 21 | @IBOutlet weak var musicTableView: UIView! 22 | @IBOutlet weak var headerView: TextHeadingView! 23 | 24 | let notificationCenter = NSNotificationCenter.defaultCenter() 25 | 26 | override func viewDidLoad() { 27 | super.viewDidLoad() 28 | notificationCenter.addObserver(self, selector: #selector(loginStatusChange(_:)), name: Const.NOTIFICATION_USER_AUTH, object: nil) 29 | 30 | populate() 31 | } 32 | 33 | override func viewDidAppear(animated: Bool) { 34 | super.viewDidAppear(animated) 35 | Helpers.async({ 36 | self.getUser() 37 | }) { 38 | self.processLaunch() 39 | } 40 | } 41 | 42 | func getUser() { 43 | Users.fetch(Const.MODEL_USERS) { context, result, error in 44 | if error == nil && result != nil { 45 | let user = result![0] 46 | var userJSON:JSON = JSON([:]) 47 | userJSON[Const.KEY_PLATFORM].stringValue = user.valueForKey(Const.KEY_PLATFORM) as! String 48 | userJSON[Const.KEY_USER_ID].stringValue = user.valueForKey(Const.KEY_USER_ID) as! String 49 | userJSON[Const.KEY_USERNAME].stringValue = user.valueForKey(Const.KEY_USERNAME) as! String 50 | userJSON[Const.KEY_IMG].stringValue = user.valueForKey(Const.KEY_IMG) as! String 51 | userJSON[Const.KEY_BG_IMG].stringValue = user.valueForKey(Const.KEY_BG_IMG) as! String 52 | userJSON[Const.KEY_OAUTH_TOKEN].stringValue = user.valueForKey(Const.KEY_OAUTH_TOKEN) as! String 53 | userJSON[Const.KEY_OAUTH_TOKEN_SECRET].stringValue = user.valueForKey(Const.KEY_OAUTH_TOKEN_SECRET) as! String 54 | userJSON[Const.KEY_EMAIL].stringValue = user.valueForKey(Const.KEY_EMAIL) as! String 55 | userJSON[Const.KEY_DESCRIPTION].stringValue = user.valueForKey(Const.KEY_DESCRIPTION) as! String 56 | userJSON[Const.KEY_NAME].stringValue = user.valueForKey(Const.KEY_NAME) as! String 57 | Helpers.currentUser = userJSON 58 | Helpers.async { 59 | NSNotificationCenter.defaultCenter().postNotificationName(Const.NOTIFICATION_USER_AUTH, object: self, userInfo: [:]) 60 | } 61 | } 62 | } 63 | } 64 | 65 | 66 | func processLaunch() { 67 | if Helpers.launchActions != nil { 68 | if Helpers.launchActions[Const.ACTION_LOGIN] != nil { 69 | performSegueWithIdentifier(Const.SEGUE_LOGIN_VIEW, sender: self) 70 | Helpers.launchActions = nil 71 | } else if Helpers.launchActions[Const.ACTION_SETTINGS] != nil { 72 | performSegueWithIdentifier(Const.SEGUE_SETTINGS_VIEW, sender: self) 73 | Helpers.launchActions = nil 74 | } 75 | } 76 | } 77 | 78 | override func preferredStatusBarStyle() -> UIStatusBarStyle { 79 | return .LightContent 80 | } 81 | 82 | @IBAction func showLogin(sender: UIButton) { 83 | 84 | } 85 | 86 | func loginStatusChange(notification: NSNotification) { 87 | populate() 88 | } 89 | 90 | func populate() { 91 | if Helpers.currentUser != nil { 92 | activeUserView.hidden = false 93 | inactiveUserView.hidden = true 94 | usernameLabel.text = Helpers.currentUser[Const.KEY_USERNAME].stringValue 95 | fullnameLabel.text = Helpers.currentUser[Const.KEY_NAME].stringValue 96 | descriptionLabel.text = Helpers.currentUser[Const.KEY_DESCRIPTION].stringValue 97 | profileImageView.layer.cornerRadius = profileImageView.bounds.height / CGFloat(2) 98 | Helpers.setImage(profileImageView, url: Helpers.currentUser[Const.KEY_IMG].stringValue) 99 | Helpers.setImage(userBackgroundView, url: Helpers.currentUser[Const.KEY_BG_IMG].stringValue) 100 | } else { 101 | activeUserView.hidden = true 102 | inactiveUserView.hidden = false 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/Users.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Users.swift 3 | // ios swift boiler 4 | // 5 | // Created by Godson Ukpere on 3/14/16. 6 | // Copyright © 2016 Godson Ukpere. All rights reserved. 7 | // 8 | 9 | import CoreData 10 | import SwiftyJSON 11 | @objc(Users) 12 | 13 | class Users: NSManagedObject { 14 | @NSManaged var name: String 15 | @NSManaged var platform: String 16 | @NSManaged var email: String 17 | @NSManaged var user_id: String 18 | @NSManaged var img: String 19 | @NSManaged var oauth_token: String 20 | @NSManaged var oauth_token_secret: String 21 | @NSManaged var bg_img: String 22 | @NSManaged var username: String 23 | @NSManaged var desc: String 24 | 25 | static func fetch (model:String, sortBy:String? = nil, sortAsc:Bool = false, format:String? = nil, args:String? = nil, callback:(context:NSManagedObjectContext, result:[NSManagedObject]?, error: NSError?)->()) { 26 | let appDelegate: AppDelegate = (UIApplication.sharedApplication().delegate as! AppDelegate) 27 | let context: NSManagedObjectContext = appDelegate.managedObjectContext 28 | let fetchRequest = NSFetchRequest(entityName: model) 29 | if format != nil && args != nil { 30 | fetchRequest.predicate = NSPredicate(format: format!, args!) 31 | } 32 | 33 | // If sort query parameter {sortBy} is set 34 | if sortBy != nil { 35 | fetchRequest.sortDescriptors = [NSSortDescriptor(key: sortBy, ascending: sortAsc)] 36 | } 37 | 38 | do { 39 | let result:[NSManagedObject] = try context.executeFetchRequest(fetchRequest) as! [NSManagedObject] 40 | if result.count != 0 { 41 | callback(context: context, result: result, error: nil) 42 | } else { 43 | callback(context: context, result: nil, error: nil) 44 | } 45 | } catch let error as NSError { 46 | callback(context: context, result: nil, error: error) 47 | } 48 | } 49 | 50 | static func managedObject (callback:(context:NSManagedObjectContext, user:Users)->()) { 51 | let appDelegate: AppDelegate = (UIApplication.sharedApplication().delegate as! AppDelegate) 52 | let context: NSManagedObjectContext = appDelegate.managedObjectContext 53 | let en = NSEntityDescription.entityForName(Const.MODEL_USERS, inManagedObjectContext: context) 54 | callback(context: context, user: Users(entity: en!, insertIntoManagedObjectContext: context)) 55 | } 56 | 57 | static func saveUser (view:UIViewController? = nil, authUser:JSON, token:String? = nil, callback: (error: NSError?)->()) { 58 | Helpers.currentUser = authUser; 59 | fetch(Const.MODEL_USERS) { context, result, error in 60 | if error == nil && result != nil { 61 | let user = result!.first 62 | if let oauthToken:String = authUser[Const.KEY_OAUTH_TOKEN].string { 63 | user?.setValue(oauthToken, forKey: Const.KEY_OAUTH_TOKEN) 64 | } 65 | 66 | if let oauthTokenSecret = authUser[Const.KEY_OAUTH_TOKEN_SECRET].string { 67 | user?.setValue(oauthTokenSecret, forKey: Const.KEY_OAUTH_TOKEN_SECRET) 68 | } 69 | 70 | user?.setValue(authUser[Const.KEY_USERNAME].stringValue, forKey: Const.KEY_USERNAME) 71 | user?.setValue(authUser[Const.KEY_NAME].stringValue, forKey: Const.KEY_NAME) 72 | user?.setValue(authUser[Const.KEY_EMAIL].stringValue, forKey: Const.KEY_EMAIL) 73 | user?.setValue(authUser[Const.KEY_DESCRIPTION].stringValue, forKey: Const.KEY_DESCRIPTION) 74 | Helpers.saveManagedContext(view!, context: context, callback: callback) 75 | } else { 76 | managedObject({ context, user in 77 | user.name = authUser[Const.KEY_NAME].stringValue 78 | user.desc = authUser[Const.KEY_DESCRIPTION].stringValue 79 | user.oauth_token = authUser[Const.KEY_OAUTH_TOKEN].stringValue 80 | user.oauth_token_secret = authUser[Const.KEY_OAUTH_TOKEN_SECRET].stringValue 81 | user.email = authUser[Const.KEY_EMAIL].stringValue 82 | user.user_id = authUser[Const.KEY_USER_ID].stringValue 83 | user.username = authUser[Const.KEY_USERNAME].stringValue 84 | user.img = authUser[Const.KEY_IMG].stringValue 85 | user.bg_img = authUser[Const.KEY_BG_IMG].stringValue 86 | user.platform = authUser[Const.KEY_PLATFORM].stringValue 87 | Helpers.saveManagedContext(view, context: context, callback: callback) 88 | }) 89 | } 90 | } 91 | } 92 | 93 | static func deleteData (limit:Int = 0, callback: ((count:Int, error:NSError?) -> ())? = nil) { 94 | fetch(Const.MODEL_USERS, sortBy: "user_id", sortAsc: true) { (context, result, error) -> () in 95 | var count:Int = 0 96 | if result != nil { 97 | for managedObject in result! { 98 | if count == limit && limit != 0 { 99 | break 100 | } 101 | 102 | context.deleteObject(managedObject) 103 | count += 1 104 | } 105 | 106 | Helpers.saveManagedContext(context: context) { 107 | errror in 108 | if callback != nil { 109 | callback!(count: count,error: error) 110 | } 111 | } 112 | } 113 | 114 | if callback != nil { 115 | callback!(count: count, error: nil) 116 | } 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/WebViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WebViewController.swift 3 | // ios swift boiler 4 | // 5 | // Created by Godson Ukpere on 3/14/16. 6 | // Copyright © 2016 Godson Ukpere. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class WebViewController: UIViewController, UIWebViewDelegate { 12 | 13 | @IBOutlet weak var webView: UIWebView! 14 | @IBOutlet weak var progressView: UIProgressView! 15 | @IBOutlet weak var titleView: UINavigationItem! 16 | 17 | var url:String! 18 | var labelText:String! 19 | var timer:NSTimer! 20 | 21 | override func viewDidLoad() { 22 | super.viewDidLoad() 23 | webView.delegate = self 24 | if url != nil { 25 | webView.loadRequest(NSURLRequest(URL: NSURL(string: url)!)) 26 | titleView.title = labelText 27 | } 28 | } 29 | 30 | func timerCallback() { 31 | if progressView.progress < 0.9 { 32 | progressView.progress += 0.005 33 | } 34 | } 35 | 36 | func webViewDidStartLoad(webView: UIWebView) { 37 | progressView.progress = 0.0 38 | progressView.hidden = false 39 | timer = NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector: #selector(timerCallback), userInfo: nil, repeats: true) 40 | } 41 | 42 | func webViewDidFinishLoad(webView: UIWebView) { 43 | doneLoading() 44 | } 45 | 46 | func doneLoading() { 47 | progressView.progress = 1.0 48 | progressView.hidden = true 49 | timer?.invalidate() 50 | } 51 | 52 | func webView(webView: UIWebView, didFailLoadWithError error: NSError?) { 53 | if error != nil { 54 | doneLoading() 55 | Helpers.showError(self, error: error!) 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/de.lproj/Main.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "UIViewController"; title = "Login View Controller"; ObjectID = "4k5-9N-fQq"; */ 3 | "4k5-9N-fQq.title" = "Login View Controller"; 4 | 5 | /* Class = "UILabel"; text = " "; ObjectID = "7VG-um-3zl"; */ 6 | "7VG-um-3zl.text" = " "; 7 | 8 | /* Class = "UITableViewSection"; footerTitle = "Visit blog.godson.com.ng from your Desktop Device"; ObjectID = "7yg-hm-3kv"; */ 9 | "7yg-hm-3kv.footerTitle" = "Besuche blog.godson.com.ng von Ihrem Desktop-Geräte"; 10 | 11 | /* Class = "UITableViewSection"; headerTitle = "Application"; ObjectID = "7yg-hm-3kv"; */ 12 | "7yg-hm-3kv.headerTitle" = "Applikation"; 13 | 14 | /* Class = "UILabel"; text = "Anmelden zu sehen guten Zeug"; ObjectID = "8jY-KN-yyH"; */ 15 | "8jY-KN-yyH.text" = "Anmelden zu sehen guten Zeug"; 16 | 17 | /* Class = "UILabel"; text = "Vollname"; ObjectID = "D1m-VS-UYP"; */ 18 | "D1m-VS-UYP.text" = "Vollname"; 19 | 20 | /* Class = "UILabel"; text = "Terms and Conditions"; ObjectID = "FOZ-VJ-cdc"; */ 21 | "FOZ-VJ-cdc.text" = "Geschäftsbedingungen"; 22 | 23 | /* Class = "UILabel"; text = "Swift Über Alles"; ObjectID = "FU9-lL-09k"; */ 24 | "FU9-lL-09k.text" = "Swift Über Alles"; 25 | 26 | /* Class = "UILabel"; text = "--"; ObjectID = "Jdm-YN-eJQ"; */ 27 | "Jdm-YN-eJQ.text" = "--"; 28 | 29 | /* Class = "UILabel"; text = "Anmelden"; ObjectID = "KZM-uP-oOP"; */ 30 | "KZM-uP-oOP.text" = "Anmelden"; 31 | 32 | /* Class = "UILabel"; text = "About"; ObjectID = "KfQ-88-5tJ"; */ 33 | "KfQ-88-5tJ.text" = "Über"; 34 | 35 | /* Class = "UILabel"; text = "Beschreibung"; ObjectID = "LkC-06-lGI"; */ 36 | "LkC-06-lGI.text" = "Beschreibung"; 37 | 38 | /* Class = "UITableViewSection"; headerTitle = "User Account"; ObjectID = "MCX-Fu-B5T"; */ 39 | "MCX-Fu-B5T.headerTitle" = "Benutzer Konto"; 40 | 41 | /* Class = "UILabel"; text = "Login"; ObjectID = "Omx-Ud-4dh"; */ 42 | "Omx-Ud-4dh.text" = "Anmelden"; 43 | 44 | /* Class = "UINavigationItem"; title = "Title"; ObjectID = "X4w-2M-Ny5"; */ 45 | "X4w-2M-Ny5.title" = "Titel"; 46 | 47 | /* Class = "UIButton"; normalTitle = "Go To Login"; ObjectID = "Zhu-o7-AfR"; */ 48 | "Zhu-o7-AfR.normalTitle" = "Anmelden Jetzt"; 49 | 50 | /* Class = "UILabel"; text = "Login to view and manage your profile."; ObjectID = "ekl-V3-ydV"; */ 51 | "ekl-V3-ydV.text" = "Anmelden Ihr Profil anzuzeigen und zu verwalten."; 52 | 53 | /* Class = "UIButton"; normalTitle = " Twitter"; ObjectID = "jhJ-xA-HOq"; */ 54 | "jhJ-xA-HOq.normalTitle" = " Twitter"; 55 | 56 | /* Class = "UILabel"; text = "Benutzername"; ObjectID = "mUK-g0-eZA"; */ 57 | "mUK-g0-eZA.text" = "Benutzername"; 58 | 59 | /* Class = "UILabel"; text = "Schmetterling ist schön"; ObjectID = "pem-vk-42n"; */ 60 | "pem-vk-42n.text" = "Schmetterling ist schön"; 61 | 62 | /* Class = "UIButton"; normalTitle = "Later"; ObjectID = "qxC-rP-McH"; */ 63 | "qxC-rP-McH.normalTitle" = "Später"; 64 | 65 | /* Class = "UILabel"; text = "gottsohn.github.io"; ObjectID = "tmc-ZG-eBr"; */ 66 | "tmc-ZG-eBr.text" = "gottsohn.github.io"; 67 | 68 | /* Class = "UILabel"; text = "Version"; ObjectID = "wDh-ur-WBb"; */ 69 | "wDh-ur-WBb.text" = "Version"; 70 | -------------------------------------------------------------------------------- /IOSSwiftBoiler/en.lproj/Main.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "UIViewController"; title = "Login View Controller"; ObjectID = "4k5-9N-fQq"; */ 3 | "4k5-9N-fQq.title" = "Login View Controller"; 4 | 5 | /* Class = "UILabel"; text = " "; ObjectID = "7VG-um-3zl"; */ 6 | "7VG-um-3zl.text" = " "; 7 | 8 | /* Class = "UITableViewSection"; footerTitle = "Visit blog.godson.com.ng from your Desktop Device"; ObjectID = "7yg-hm-3kv"; */ 9 | "7yg-hm-3kv.footerTitle" = "Visit blog.godson.com.ng from your Desktop Device"; 10 | 11 | /* Class = "UITableViewSection"; headerTitle = "Application"; ObjectID = "7yg-hm-3kv"; */ 12 | "7yg-hm-3kv.headerTitle" = "Application"; 13 | 14 | /* Class = "UILabel"; text = "Anmelden zu sehen guten Zeug"; ObjectID = "8jY-KN-yyH"; */ 15 | "8jY-KN-yyH.text" = "Login to view and manage your profile."; 16 | 17 | /* Class = "UILabel"; text = "Vollname"; ObjectID = "D1m-VS-UYP"; */ 18 | "D1m-VS-UYP.text" = "Fullname"; 19 | 20 | /* Class = "UILabel"; text = "Terms and Conditions"; ObjectID = "FOZ-VJ-cdc"; */ 21 | "FOZ-VJ-cdc.text" = "Terms and Conditions"; 22 | 23 | /* Class = "UILabel"; text = "Swift Über Alles"; ObjectID = "FU9-lL-09k"; */ 24 | "FU9-lL-09k.text" = "Swift Über Alles"; 25 | 26 | /* Class = "UILabel"; text = "--"; ObjectID = "Jdm-YN-eJQ"; */ 27 | "Jdm-YN-eJQ.text" = "--"; 28 | 29 | /* Class = "UILabel"; text = "Anmelden"; ObjectID = "KZM-uP-oOP"; */ 30 | "KZM-uP-oOP.text" = "Login"; 31 | 32 | /* Class = "UILabel"; text = "About"; ObjectID = "KfQ-88-5tJ"; */ 33 | "KfQ-88-5tJ.text" = "About"; 34 | 35 | /* Class = "UILabel"; text = "Beschreibung"; ObjectID = "LkC-06-lGI"; */ 36 | "LkC-06-lGI.text" = "Description"; 37 | 38 | /* Class = "UITableViewSection"; headerTitle = "User Account"; ObjectID = "MCX-Fu-B5T"; */ 39 | "MCX-Fu-B5T.headerTitle" = "User Account"; 40 | 41 | /* Class = "UILabel"; text = "Login"; ObjectID = "Omx-Ud-4dh"; */ 42 | "Omx-Ud-4dh.text" = "Login"; 43 | 44 | /* Class = "UINavigationItem"; title = "Title"; ObjectID = "X4w-2M-Ny5"; */ 45 | "X4w-2M-Ny5.title" = "Title"; 46 | 47 | /* Class = "UIButton"; normalTitle = "Go To Login"; ObjectID = "Zhu-o7-AfR"; */ 48 | "Zhu-o7-AfR.normalTitle" = "Go To Login"; 49 | 50 | /* Class = "UILabel"; text = "Login to view and manage your profile."; ObjectID = "ekl-V3-ydV"; */ 51 | "ekl-V3-ydV.text" = "Login to view and manage your profile."; 52 | 53 | /* Class = "UIButton"; normalTitle = " Twitter"; ObjectID = "jhJ-xA-HOq"; */ 54 | "jhJ-xA-HOq.normalTitle" = " Twitter"; 55 | 56 | /* Class = "UILabel"; text = "Benutzername"; ObjectID = "mUK-g0-eZA"; */ 57 | "mUK-g0-eZA.text" = "Username"; 58 | 59 | /* Class = "UILabel"; text = "Schmetterling ist schön"; ObjectID = "pem-vk-42n"; */ 60 | "pem-vk-42n.text" = "Schmetterling ist schön"; 61 | 62 | /* Class = "UIButton"; normalTitle = "Later"; ObjectID = "qxC-rP-McH"; */ 63 | "qxC-rP-McH.normalTitle" = "Later"; 64 | 65 | /* Class = "UILabel"; text = "gottsohn.github.io"; ObjectID = "tmc-ZG-eBr"; */ 66 | "tmc-ZG-eBr.text" = "gottsohn.github.io"; 67 | 68 | /* Class = "UILabel"; text = "Version"; ObjectID = "wDh-ur-WBb"; */ 69 | "wDh-ur-WBb.text" = "Version"; 70 | -------------------------------------------------------------------------------- /IOSSwiftBoilerTests/IOSSwiftBoilerTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IOSSwiftBoilerTests.swift 3 | // IOSSwiftBoilerTests 4 | // 5 | // Created by Godson Ukpere on 3/17/16. 6 | // Copyright © 2016 Godson Ukpere. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import IOSSwiftBoiler 11 | 12 | class IOSSwiftBoilerTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /IOSSwiftBoilerTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /IOSSwiftBoilerTests/WebViewControllerTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WebViewControllerTests.swift 3 | // IOSSwiftBoiler 4 | // 5 | // Created by Godson Ukpere on 3/17/16. 6 | // Copyright © 2016 Godson Ukpere. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import IOSSwiftBoiler 11 | 12 | class WebViewControllerTests: XCTestCase { 13 | 14 | var webViewController:WebViewController! 15 | var timer:NSTimer! 16 | var asyncExpectation:XCTestExpectation! 17 | override func setUp() { 18 | super.setUp() 19 | webViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier(Const.ID_WEB_VIEW_CONTROLLER) as! WebViewController 20 | } 21 | 22 | override func tearDown() { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | webViewController = nil 25 | super.tearDown() 26 | } 27 | 28 | func testViews() { 29 | XCTAssertNil(webViewController.webView) 30 | XCTAssertNil(webViewController.progressView) 31 | 32 | _ = webViewController.view 33 | 34 | XCTAssertNotNil(webViewController.webView) 35 | XCTAssertNotNil(webViewController.progressView) 36 | } 37 | 38 | func testWebViewNoLoad() { 39 | XCTAssertNil(webViewController.url) 40 | XCTAssertNil(webViewController.labelText) 41 | 42 | _ = webViewController.view 43 | 44 | 45 | XCTAssertEqual(webViewController.progressView.progress, 0.0) 46 | } 47 | 48 | func testWebViewLoad() { 49 | asyncExpectation = expectationWithDescription("server responded") 50 | XCTAssertNil(webViewController.url) 51 | XCTAssertNil(webViewController.labelText) 52 | 53 | webViewController.url = "http://blog.godson.com.ng" 54 | _ = webViewController.view 55 | 56 | timer = NSTimer.scheduledTimerWithTimeInterval(10, target: self, selector: #selector(WebViewControllerTests.checkProgress), userInfo: nil, repeats: false) 57 | waitForExpectationsWithTimeout(15, handler: nil) 58 | } 59 | 60 | func checkProgress() { 61 | XCTAssertNotNil(webViewController.progressView) 62 | XCTAssert(webViewController.progressView.hidden, "Progress View should be hidden") 63 | XCTAssertEqual(webViewController.progressView.progress, 1.0) 64 | timer.invalidate() 65 | asyncExpectation.fulfill() 66 | } 67 | 68 | func testPerformanceExample() { 69 | // This is an example of a performance test case. 70 | self.measureBlock { 71 | // Put the code you want to measure the time of here. 72 | } 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /IOSSwiftBoilerUITests/IOSSwiftBoilerUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IOSSwiftBoilerUITests.swift 3 | // IOSSwiftBoilerUITests 4 | // 5 | // Created by Godson Ukpere on 3/17/16. 6 | // Copyright © 2016 Godson Ukpere. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class IOSSwiftBoilerUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | if #available(iOS 9.0, *) { 22 | XCUIApplication().launch() 23 | } else { 24 | // Fallback on earlier versions 25 | } 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | override func tearDown() { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | super.tearDown() 33 | } 34 | 35 | func testExample() { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /IOSSwiftBoilerUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Godson Ukpere 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 13 | > all 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 21 | > THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '8.0' 3 | # Uncomment this line if you're using Swift 4 | use_frameworks! 5 | 6 | def all_pods 7 | pod 'SwiftyJSON' 8 | end 9 | 10 | target 'IOSSwiftBoiler' do 11 | all_pods 12 | end 13 | 14 | target 'IOSSwiftBoilerTests' do 15 | all_pods 16 | end 17 | 18 | target 'IOSSwiftBoilerUITests' do 19 | all_pods 20 | end 21 | 22 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SwiftyJSON (2.3.2) 3 | 4 | DEPENDENCIES: 5 | - SwiftyJSON 6 | 7 | SPEC CHECKSUMS: 8 | SwiftyJSON: 04ccea08915aa0109039157c7974cf0298da292a 9 | 10 | COCOAPODS: 0.39.0 11 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SwiftyJSON (2.3.2) 3 | 4 | DEPENDENCIES: 5 | - SwiftyJSON 6 | 7 | SPEC CHECKSUMS: 8 | SwiftyJSON: 04ccea08915aa0109039157c7974cf0298da292a 9 | 10 | COCOAPODS: 0.39.0 11 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-IOSSwiftBoiler.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-IOSSwiftBoilerTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-IOSSwiftBoilerUITests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/SwiftyJSON.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/goodson.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods-IOSSwiftBoiler.xcscheme_^#shared#^_ 8 | 9 | isShown 10 | 11 | 12 | Pods-IOSSwiftBoilerTests.xcscheme_^#shared#^_ 13 | 14 | isShown 15 | 16 | 17 | Pods-IOSSwiftBoilerUITests.xcscheme_^#shared#^_ 18 | 19 | isShown 20 | 21 | 22 | SwiftyJSON.xcscheme_^#shared#^_ 23 | 24 | isShown 25 | 26 | 27 | 28 | SuppressBuildableAutocreation 29 | 30 | 7FCC0620FA940C3C269AC632A35CB72F 31 | 32 | primary 33 | 34 | 35 | A2A784E9F6208843245E793EFBCBFE0D 36 | 37 | primary 38 | 39 | 40 | B786254F7251C342BACB8DA2FA3F5C9A 41 | 42 | primary 43 | 44 | 45 | EEC3FE6DE35630597660DDB2F64CF0D6 46 | 47 | primary 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Pods/SwiftyJSON/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Ruoyu Fu 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 13 | all 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 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Pods/SwiftyJSON/README.md: -------------------------------------------------------------------------------- 1 | #SwiftyJSON [中文介绍](http://tangplin.github.io/swiftyjson/) 2 | 3 | [![Travis CI](https://travis-ci.org/SwiftyJSON/SwiftyJSON.svg?branch=master)](https://travis-ci.org/SwiftyJSON/SwiftyJSON) 4 | 5 | SwiftyJSON makes it easy to deal with JSON data in Swift. 6 | 7 | 1. [Why is the typical JSON handling in Swift NOT good](#why-is-the-typical-json-handling-in-swift-not-good) 8 | 1. [Requirements](#requirements) 9 | 1. [Integration](#integration) 10 | 1. [Usage](#usage) 11 | - [Initialization](#initialization) 12 | - [Subscript](#subscript) 13 | - [Loop](#loop) 14 | - [Error](#error) 15 | - [Optional getter](#optional-getter) 16 | - [Non-optional getter](#non-optional-getter) 17 | - [Setter](#setter) 18 | - [Raw object](#raw-object) 19 | - [Literal convertibles](#literal-convertibles) 20 | 1. [Work with Alamofire](#work-with-alamofire) 21 | 22 | ##Why is the typical JSON handling in Swift NOT good? 23 | Swift is very strict about types. But although explicit typing is good for saving us from mistakes, it becomes painful when dealing with JSON and other areas that are, by nature, implicit about types. 24 | 25 | Take the Twitter API for example. Say we want to retrieve a user's "name" value of some tweet in Swift (according to Twitter's API https://dev.twitter.com/docs/api/1.1/get/statuses/home_timeline). 26 | 27 | The code would look like this: 28 | 29 | ```swift 30 | 31 | if let statusesArray = try? NSJSONSerialization.JSONObjectWithData(data, options: .AllowFragments) as? [[String: AnyObject]], 32 | let user = statusesArray[0]["user"] as? [String: AnyObject], 33 | let username = user["name"] as? String { 34 | // Finally we got the username 35 | } 36 | 37 | ``` 38 | 39 | It's not good. 40 | 41 | Even if we use optional chaining, it would be messy: 42 | 43 | ```swift 44 | 45 | if let JSONObject = try NSJSONSerialization.JSONObjectWithData(data, options: .AllowFragments) as? [[String: AnyObject]], 46 | let username = (JSONObject[0]["user"] as? [String: AnyObject])?["name"] as? String { 47 | // There's our username 48 | } 49 | 50 | ``` 51 | An unreadable mess--for something that should really be simple! 52 | 53 | With SwiftyJSON all you have to do is: 54 | 55 | ```swift 56 | 57 | let json = JSON(data: dataFromNetworking) 58 | if let userName = json[0]["user"]["name"].string { 59 | //Now you got your value 60 | } 61 | 62 | ``` 63 | 64 | And don't worry about the Optional Wrapping thing. It's done for you automatically. 65 | 66 | ```swift 67 | 68 | let json = JSON(data: dataFromNetworking) 69 | if let userName = json[999999]["wrong_key"]["wrong_name"].string { 70 | //Calm down, take it easy, the ".string" property still produces the correct Optional String type with safety 71 | } else { 72 | //Print the error 73 | print(json[999999]["wrong_key"]["wrong_name"]) 74 | } 75 | 76 | ``` 77 | 78 | ## Requirements 79 | 80 | - iOS 7.0+ / Mac OS X 10.9+ 81 | - Xcode 7 82 | 83 | ##Integration 84 | 85 | ####CocoaPods (iOS 8+, OS X 10.9+) 86 | You can use [Cocoapods](http://cocoapods.org/) to install `SwiftyJSON`by adding it to your `Podfile`: 87 | ```ruby 88 | platform :ios, '8.0' 89 | use_frameworks! 90 | 91 | target 'MyApp' do 92 | pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git' 93 | end 94 | ``` 95 | Note that this requires CocoaPods version 36, and your iOS deployment target to be at least 8.0: 96 | 97 | ####Carthage (iOS 8+, OS X 10.9+) 98 | You can use [Carthage](https://github.com/Carthage/Carthage) to install `SwiftyJSON` by adding it to your `Cartfile`: 99 | ``` 100 | github "SwiftyJSON/SwiftyJSON" 101 | ``` 102 | 103 | ####Manually (iOS 7+, OS X 10.9+) 104 | 105 | To use this library in your project manually you may: 106 | 107 | 1. for Projects, just drag SwiftyJSON.swift to the project tree 108 | 2. for Workspaces, include the whole SwiftyJSON.xcodeproj 109 | 110 | ## Usage 111 | 112 | ####Initialization 113 | ```swift 114 | import SwiftyJSON 115 | ``` 116 | ```swift 117 | let json = JSON(data: dataFromNetworking) 118 | ``` 119 | ```swift 120 | let json = JSON(jsonObject) 121 | ``` 122 | ```swift 123 | if let dataFromString = jsonString.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false) { 124 | let json = JSON(data: dataFromString) 125 | } 126 | ``` 127 | 128 | ####Subscript 129 | ```swift 130 | //Getting a double from a JSON Array 131 | let name = json[0].double 132 | ``` 133 | ```swift 134 | //Getting a string from a JSON Dictionary 135 | let name = json["name"].stringValue 136 | ``` 137 | ```swift 138 | //Getting a string using a path to the element 139 | let path = [1,"list",2,"name"] 140 | let name = json[path].string 141 | //Just the same 142 | let name = json[1]["list"][2]["name"].string 143 | //Alternatively 144 | let name = json[1,"list",2,"name"].string 145 | ``` 146 | ```swift 147 | //With a hard way 148 | let name = json[].string 149 | ``` 150 | ```swift 151 | //With a custom way 152 | let keys:[SubscriptType] = [1,"list",2,"name"] 153 | let name = json[keys].string 154 | ``` 155 | ####Loop 156 | ```swift 157 | //If json is .Dictionary 158 | for (key,subJson):(String, JSON) in json { 159 | //Do something you want 160 | } 161 | ``` 162 | *The first element is always a String, even if the JSON is an Array* 163 | ```swift 164 | //If json is .Array 165 | //The `index` is 0.. = json["list"].arrayValue 264 | ``` 265 | ```swift 266 | //If not a Dictionary or nil, return [:] 267 | let user: Dictionary = json["user"].dictionaryValue 268 | ``` 269 | 270 | ####Setter 271 | ```swift 272 | json["name"] = JSON("new-name") 273 | json[0] = JSON(1) 274 | ``` 275 | ```swift 276 | json["id"].int = 1234567890 277 | json["coordinate"].double = 8766.766 278 | json["name"].string = "Jack" 279 | json.arrayObject = [1,2,3,4] 280 | json.dictionary = ["name":"Jack", "age":25] 281 | ``` 282 | 283 | ####Raw object 284 | ```swift 285 | let jsonObject: AnyObject = json.object 286 | ``` 287 | ```swift 288 | if let jsonObject: AnyObject = json.rawValue 289 | ``` 290 | ```swift 291 | //convert the JSON to raw NSData 292 | if let data = json.rawData() { 293 | //Do something you want 294 | } 295 | ``` 296 | ```swift 297 | //convert the JSON to a raw String 298 | if let string = json.rawString() { 299 | //Do something you want 300 | } 301 | ``` 302 | ####Existance 303 | ```swift 304 | //shows you whether value specified in JSON or not 305 | if json["name"].isExists() 306 | ``` 307 | 308 | ####Literal convertibles 309 | For more info about literal convertibles: [Swift Literal Convertibles](http://nshipster.com/swift-literal-convertible/) 310 | ```swift 311 | //StringLiteralConvertible 312 | let json: JSON = "I'm a json" 313 | ``` 314 | ```swift 315 | //IntegerLiteralConvertible 316 | let json: JSON = 12345 317 | ``` 318 | ```swift 319 | //BooleanLiteralConvertible 320 | let json: JSON = true 321 | ``` 322 | ```swift 323 | //FloatLiteralConvertible 324 | let json: JSON = 2.8765 325 | ``` 326 | ```swift 327 | //DictionaryLiteralConvertible 328 | let json: JSON = ["I":"am", "a":"json"] 329 | ``` 330 | ```swift 331 | //ArrayLiteralConvertible 332 | let json: JSON = ["I", "am", "a", "json"] 333 | ``` 334 | ```swift 335 | //NilLiteralConvertible 336 | let json: JSON = nil 337 | ``` 338 | ```swift 339 | //With subscript in array 340 | var json: JSON = [1,2,3] 341 | json[0] = 100 342 | json[1] = 200 343 | json[2] = 300 344 | json[999] = 300 //Don't worry, nothing will happen 345 | ``` 346 | ```swift 347 | //With subscript in dictionary 348 | var json: JSON = ["name": "Jack", "age": 25] 349 | json["name"] = "Mike" 350 | json["age"] = "25" //It's OK to set String 351 | json["address"] = "L.A." // Add the "address": "L.A." in json 352 | ``` 353 | ```swift 354 | //Array & Dictionary 355 | var json: JSON = ["name": "Jack", "age": 25, "list": ["a", "b", "c", ["what": "this"]]] 356 | json["list"][3]["what"] = "that" 357 | json["list",3,"what"] = "that" 358 | let path = ["list",3,"what"] 359 | json[path] = "that" 360 | ``` 361 | ##Work with Alamofire 362 | 363 | SwiftyJSON nicely wraps the result of the Alamofire JSON response handler: 364 | ```swift 365 | Alamofire.request(.GET, url).validate().responseJSON { response in 366 | switch response.result { 367 | case .Success: 368 | if let value = response.result.value { 369 | let json = JSON(value) 370 | print("JSON: \(json)") 371 | } 372 | case .Failure(let error): 373 | print(error) 374 | } 375 | } 376 | ``` 377 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoiler/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 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-IOSSwiftBoiler/Pods-IOSSwiftBoiler-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SwiftyJSON 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2014 Ruoyu Fu 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in 18 | all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | THE SOFTWARE. 27 | 28 | Generated by CocoaPods - http://cocoapods.org 29 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoiler/Pods-IOSSwiftBoiler-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | The MIT License (MIT) 18 | 19 | Copyright (c) 2014 Ruoyu Fu 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in 29 | all copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 37 | THE SOFTWARE. 38 | 39 | Title 40 | SwiftyJSON 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - http://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoiler/Pods-IOSSwiftBoiler-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_IOSSwiftBoiler : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_IOSSwiftBoiler 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoiler/Pods-IOSSwiftBoiler-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "Pods-IOSSwiftBoiler/SwiftyJSON.framework" 88 | fi 89 | if [[ "$CONFIGURATION" == "Release" ]]; then 90 | install_framework "Pods-IOSSwiftBoiler/SwiftyJSON.framework" 91 | fi 92 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoiler/Pods-IOSSwiftBoiler-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 95 | fi 96 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoiler/Pods-IOSSwiftBoiler-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_IOSSwiftBoilerVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_IOSSwiftBoilerVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoiler/Pods-IOSSwiftBoiler.debug.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/SwiftyJSON.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "SwiftyJSON" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-IOSSwiftBoiler 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoiler/Pods-IOSSwiftBoiler.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_IOSSwiftBoiler { 2 | umbrella header "Pods-IOSSwiftBoiler-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoiler/Pods-IOSSwiftBoiler.release.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/SwiftyJSON.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "SwiftyJSON" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-IOSSwiftBoiler 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 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-IOSSwiftBoilerTests/Pods-IOSSwiftBoilerTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SwiftyJSON 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2014 Ruoyu Fu 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in 18 | all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | THE SOFTWARE. 27 | 28 | Generated by CocoaPods - http://cocoapods.org 29 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerTests/Pods-IOSSwiftBoilerTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | The MIT License (MIT) 18 | 19 | Copyright (c) 2014 Ruoyu Fu 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in 29 | all copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 37 | THE SOFTWARE. 38 | 39 | Title 40 | SwiftyJSON 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - http://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerTests/Pods-IOSSwiftBoilerTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_IOSSwiftBoilerTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_IOSSwiftBoilerTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerTests/Pods-IOSSwiftBoilerTests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "Pods-IOSSwiftBoilerTests/SwiftyJSON.framework" 88 | fi 89 | if [[ "$CONFIGURATION" == "Release" ]]; then 90 | install_framework "Pods-IOSSwiftBoilerTests/SwiftyJSON.framework" 91 | fi 92 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerTests/Pods-IOSSwiftBoilerTests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 95 | fi 96 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerTests/Pods-IOSSwiftBoilerTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_IOSSwiftBoilerTestsVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_IOSSwiftBoilerTestsVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerTests/Pods-IOSSwiftBoilerTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/SwiftyJSON.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "SwiftyJSON" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-IOSSwiftBoilerTests 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerTests/Pods-IOSSwiftBoilerTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_IOSSwiftBoilerTests { 2 | umbrella header "Pods-IOSSwiftBoilerTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerTests/Pods-IOSSwiftBoilerTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/SwiftyJSON.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "SwiftyJSON" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-IOSSwiftBoilerTests 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 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-IOSSwiftBoilerUITests/Pods-IOSSwiftBoilerUITests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SwiftyJSON 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2014 Ruoyu Fu 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in 18 | all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | THE SOFTWARE. 27 | 28 | Generated by CocoaPods - http://cocoapods.org 29 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerUITests/Pods-IOSSwiftBoilerUITests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | The MIT License (MIT) 18 | 19 | Copyright (c) 2014 Ruoyu Fu 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in 29 | all copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 37 | THE SOFTWARE. 38 | 39 | Title 40 | SwiftyJSON 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - http://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerUITests/Pods-IOSSwiftBoilerUITests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_IOSSwiftBoilerUITests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_IOSSwiftBoilerUITests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerUITests/Pods-IOSSwiftBoilerUITests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "Pods-IOSSwiftBoilerUITests/SwiftyJSON.framework" 88 | fi 89 | if [[ "$CONFIGURATION" == "Release" ]]; then 90 | install_framework "Pods-IOSSwiftBoilerUITests/SwiftyJSON.framework" 91 | fi 92 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerUITests/Pods-IOSSwiftBoilerUITests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 95 | fi 96 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerUITests/Pods-IOSSwiftBoilerUITests-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_IOSSwiftBoilerUITestsVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_IOSSwiftBoilerUITestsVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerUITests/Pods-IOSSwiftBoilerUITests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/SwiftyJSON.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "SwiftyJSON" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-IOSSwiftBoilerUITests 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerUITests/Pods-IOSSwiftBoilerUITests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_IOSSwiftBoilerUITests { 2 | umbrella header "Pods-IOSSwiftBoilerUITests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-IOSSwiftBoilerUITests/Pods-IOSSwiftBoilerUITests.release.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/SwiftyJSON.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "SwiftyJSON" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-IOSSwiftBoilerUITests 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.3.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON/SwiftyJSON-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SwiftyJSON : NSObject 3 | @end 4 | @implementation PodsDummy_SwiftyJSON 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON/SwiftyJSON-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON/SwiftyJSON-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double SwiftyJSONVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char SwiftyJSONVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON/SwiftyJSON.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftyJSON { 2 | umbrella header "SwiftyJSON-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftyJSON/SwiftyJSON.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SwiftyJSON" "${PODS_ROOT}/Headers/Public" 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IOS Swift Boiler Plate with Authentication 2 | 3 | A boiler plate written in Swift 2.2 with _Facebook_ and _Twitter_ Authentication. 4 | 5 | [![Swift Version][swift-image]][swift-url] 6 | [![License][license-image]][license-url] 7 | [![Build Status](https://travis-ci.org/gottsohn/ios-swift-boiler.svg?branch=master)](https://travis-ci.org/gottsohn/ios-swift-boiler) [![Coverage Status](https://coveralls.io/repos/github/gottsohn/ios-swift-boiler/badge.svg?branch=master)](https://coveralls.io/github/gottsohn/ios-swift-boiler?branch=master) 8 | 9 | 10 | ### Package Manager 11 | The packages are staged as recommended to avoid framework support deprecation. 12 | - [CocoaPods](https://cocoapods.org) 13 | 14 | ### Frameworks used 15 | - [CocoaPods](./Podfile) 16 | - [Alamofire](https://github.com/Alamofire/Alamofire) 17 | - [SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON) 18 | - Facebook SDK (Core and Login) 19 | 20 | ### Localization 21 | English :us: and German :de: are supported by the application, in _Localizable.strings_ and in the Storyboard's language files. 22 | 23 | ### CoreData Entities 24 | - [Users](./IOSSwiftBoiler/Users.swift) 25 | - _name_: `String` 26 | - _platform_: `String` 27 | - _email_: `String` 28 | - _user_id_: `String` 29 | - _img_: `String` 30 | - _oauth_token_: `String` 31 | - _oauth_token_secret_: `String` 32 | - _bg_img_: `String` 33 | - _username_: `String` 34 | - _desc_: `String` 35 | 36 | ### Twitter and Facebook API keys 37 | The Facebook _APP\_ID_ can be found in [LoginViewController.swift](./IOSSwiftBoiler/LoginViewController.swift#L237) in line _237_. 38 | 39 | Both Twitter and Facebook employ the Social.framework built into Xcode. 40 | 41 | ### How to use 42 | After launch, the application tries to get the user from the `Users` entity. If the user exists a View is displayed, and vice-versa. 43 | 44 | The currently logged in user is saved as a JSON object as `Helpers.currentUser`, where `Helpers` is a singleton. 45 | 46 | On successful authentication, the user is redirected to the _HomeViewController_ which now displays the user's profile details, and saves the user in the CoreData _Users_ entity. 47 | 48 | ### Perks 49 | - 3D Touch for context menu 50 | - Settings View Controller. 51 | 52 | ### Previews 53 | #### HomeViewController (not logged in) 54 | ![Logged out](./repo-data/home-not-logged-in.png) 55 | 56 | ------- 57 | 58 | #### LoginViewControllers 59 | 60 | The background video is located [here](./IOSSwiftBoiler/Assets/background.mp4) 61 | 62 | ![Logged out](./repo-data/login.gif) 63 | 64 | ------- 65 | 66 | #### HomeViewController (logged in) 67 | ![Logged in](./repo-data/home-logged-in.png) 68 | 69 | ------- 70 | 71 | #### SettingsViewController 72 | ![Settings](./repo-data/settings.png) 73 | 74 | ------- 75 | 76 | #### 3D Touch 77 | ![3d Touch context](./repo-data/3d-touch-1.png) ![3d Touch settings](./repo-data/3d-touch-2.png) 78 | 79 | ------- 80 | 81 | 82 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 83 | 84 | [swift-image]:https://img.shields.io/badge/swift-2.2-orange.svg 85 | [swift-url]: https://swift.org/ 86 | [license-image]: https://img.shields.io/badge/License-MIT-blue.svg 87 | [license-url]: LICENSE.md -------------------------------------------------------------------------------- /de.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | IOSSwiftBoiler 4 | 5 | Created by Godson Ukpere on 3/17/16. 6 | Copyright © 2016 Godson Ukpere. All rights reserved. 7 | */ 8 | CLOSE = "Schließen"; 9 | ERROR = "Fehler"; 10 | CHOOSE = "Wähle"; 11 | ACCOUNT = "Konto"; 12 | ERROR_MESSAGE = "Fehler Abschluss Anfrage"; 13 | DONE = "Fertig"; 14 | CANCEL = "Abbrechen"; 15 | LOGOUT = "Ausloggen"; 16 | CONFIRM = "Zulassen"; 17 | ARE_YOU_SURE = "Bist du sicher?"; 18 | USERNAME = ""; 19 | TNC = "Geschäftsbedingungen"; 20 | HOME = "Startseite"; 21 | LOGIN = "Anmelden"; 22 | OPEN = "Öffnen"; 23 | SETTINGS = "Einstellungen"; -------------------------------------------------------------------------------- /repo-data/3d-touch-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/repo-data/3d-touch-1.png -------------------------------------------------------------------------------- /repo-data/3d-touch-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/repo-data/3d-touch-2.png -------------------------------------------------------------------------------- /repo-data/home-logged-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/repo-data/home-logged-in.png -------------------------------------------------------------------------------- /repo-data/home-not-logged-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/repo-data/home-not-logged-in.png -------------------------------------------------------------------------------- /repo-data/login.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/repo-data/login.gif -------------------------------------------------------------------------------- /repo-data/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gottsohn/ios-swift-boiler/3aa236c78128d53dd10406ed9eba78981a73ee24/repo-data/settings.png --------------------------------------------------------------------------------