├── .gitignore ├── LICENSE ├── Podfile ├── Podfile.lock ├── Pods ├── Alamofire │ ├── LICENSE │ ├── README.md │ └── Source │ │ ├── Alamofire.swift │ │ ├── Download.swift │ │ ├── Error.swift │ │ ├── Manager.swift │ │ ├── MultipartFormData.swift │ │ ├── ParameterEncoding.swift │ │ ├── Request.swift │ │ ├── Response.swift │ │ ├── ResponseSerialization.swift │ │ ├── Result.swift │ │ ├── ServerTrustPolicy.swift │ │ ├── Stream.swift │ │ ├── Upload.swift │ │ └── Validation.swift ├── AlamofireImage │ ├── LICENSE │ ├── README.md │ └── Source │ │ ├── Image.swift │ │ ├── ImageCache.swift │ │ ├── ImageDownloader.swift │ │ ├── ImageFilter.swift │ │ ├── Request+AlamofireImage.swift │ │ ├── UIImage+AlamofireImage.swift │ │ └── UIImageView+AlamofireImage.swift ├── Headers │ └── Private │ │ ├── MJExtension │ │ ├── MJExtension.h │ │ ├── MJExtensionConst.h │ │ ├── MJFoundation.h │ │ ├── MJProperty.h │ │ ├── MJPropertyKey.h │ │ ├── MJPropertyType.h │ │ ├── NSObject+MJClass.h │ │ ├── NSObject+MJCoding.h │ │ ├── NSObject+MJKeyValue.h │ │ ├── NSObject+MJProperty.h │ │ └── NSString+MJExtension.h │ │ └── Shimmer │ │ ├── FBShimmering.h │ │ ├── FBShimmeringLayer.h │ │ └── FBShimmeringView.h ├── Local Podspecs │ └── SwiftyJSON.podspec.json ├── MJExtension │ ├── LICENSE │ ├── MJExtension │ │ ├── MJExtension.h │ │ ├── MJExtensionConst.h │ │ ├── MJExtensionConst.m │ │ ├── MJFoundation.h │ │ ├── MJFoundation.m │ │ ├── MJProperty.h │ │ ├── MJProperty.m │ │ ├── MJPropertyKey.h │ │ ├── MJPropertyKey.m │ │ ├── MJPropertyType.h │ │ ├── MJPropertyType.m │ │ ├── NSObject+MJClass.h │ │ ├── NSObject+MJClass.m │ │ ├── NSObject+MJCoding.h │ │ ├── NSObject+MJCoding.m │ │ ├── NSObject+MJKeyValue.h │ │ ├── NSObject+MJKeyValue.m │ │ ├── NSObject+MJProperty.h │ │ ├── NSObject+MJProperty.m │ │ ├── NSString+MJExtension.h │ │ └── NSString+MJExtension.m │ └── README.md ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj ├── Shimmer │ ├── FBShimmering │ │ ├── FBShimmering.h │ │ ├── FBShimmeringLayer.h │ │ ├── FBShimmeringLayer.m │ │ ├── FBShimmeringView.h │ │ └── FBShimmeringView.m │ ├── LICENSE │ └── README.md ├── SwiftKeychain │ ├── LICENSE.txt │ ├── README.md │ └── SwiftKeychain │ │ └── Keychain │ │ ├── ArchiveKey.swift │ │ ├── GenericKey.swift │ │ ├── Keychain.swift │ │ ├── KeychainItem.swift │ │ ├── KeychainQuery.swift │ │ └── KeychainService.swift ├── SwiftyJSON │ ├── LICENSE │ ├── README.md │ └── Source │ │ └── SwiftyJSON.swift ├── Target Support Files │ ├── Alamofire │ │ ├── Alamofire-dummy.m │ │ ├── Alamofire-prefix.pch │ │ ├── Alamofire-umbrella.h │ │ ├── Alamofire.modulemap │ │ ├── Alamofire.xcconfig │ │ └── Info.plist │ ├── AlamofireImage │ │ ├── AlamofireImage-dummy.m │ │ ├── AlamofireImage-prefix.pch │ │ ├── AlamofireImage-umbrella.h │ │ ├── AlamofireImage.modulemap │ │ ├── AlamofireImage.xcconfig │ │ └── Info.plist │ ├── MJExtension │ │ ├── Info.plist │ │ ├── MJExtension-dummy.m │ │ ├── MJExtension-prefix.pch │ │ ├── MJExtension-umbrella.h │ │ ├── MJExtension.modulemap │ │ └── MJExtension.xcconfig │ ├── Pods-UBERGuide │ │ ├── Info.plist │ │ ├── Pods-UBERGuide-acknowledgements.markdown │ │ ├── Pods-UBERGuide-acknowledgements.plist │ │ ├── Pods-UBERGuide-dummy.m │ │ ├── Pods-UBERGuide-frameworks.sh │ │ ├── Pods-UBERGuide-resources.sh │ │ ├── Pods-UBERGuide-umbrella.h │ │ ├── Pods-UBERGuide.debug.xcconfig │ │ ├── Pods-UBERGuide.modulemap │ │ └── Pods-UBERGuide.release.xcconfig │ ├── Shimmer │ │ ├── Info.plist │ │ ├── Shimmer-dummy.m │ │ ├── Shimmer-prefix.pch │ │ ├── Shimmer-umbrella.h │ │ ├── Shimmer.modulemap │ │ └── Shimmer.xcconfig │ ├── SwiftKeychain │ │ ├── Info.plist │ │ ├── SwiftKeychain-dummy.m │ │ ├── SwiftKeychain-prefix.pch │ │ ├── SwiftKeychain-umbrella.h │ │ ├── SwiftKeychain.modulemap │ │ └── SwiftKeychain.xcconfig │ ├── SwiftyJSON │ │ ├── Info.plist │ │ ├── SwiftyJSON-dummy.m │ │ ├── SwiftyJSON-prefix.pch │ │ ├── SwiftyJSON-umbrella.h │ │ ├── SwiftyJSON.modulemap │ │ └── SwiftyJSON.xcconfig │ └── p2.OAuth2 │ │ ├── Info.plist │ │ ├── p2.OAuth2-dummy.m │ │ ├── p2.OAuth2-prefix.pch │ │ ├── p2.OAuth2-umbrella.h │ │ ├── p2.OAuth2.modulemap │ │ └── p2.OAuth2.xcconfig └── p2.OAuth2 │ ├── LICENSE.txt │ ├── OAuth2+iOS │ ├── OAuth2+iOS.swift │ └── OAuth2WebViewController.swift │ ├── OAuth2 │ ├── OAuth2.swift │ ├── OAuth2AuthConfig.swift │ ├── OAuth2Base.swift │ ├── OAuth2ClientConfig.swift │ ├── OAuth2ClientCredentials.swift │ ├── OAuth2CodeGrant.swift │ ├── OAuth2CodeGrantBasicAuth.swift │ ├── OAuth2CodeGrantFacebook.swift │ ├── OAuth2DynReg.swift │ ├── OAuth2Error.swift │ ├── OAuth2ImplicitGrant.swift │ ├── OAuth2PasswordGrant.swift │ ├── OAuth2Request.swift │ └── extensions.swift │ └── README.md ├── README.md ├── ScreenShots ├── IMG_0458.PNG ├── IMG_0459.PNG ├── IMG_0460.PNG ├── IMG_0461.PNG ├── IMG_0462.PNG ├── IMG_0463.PNG ├── IMG_0464.PNG ├── IMG_0465.PNG ├── IMG_0466.PNG ├── IMG_0467.PNG └── IMG_0468.PNG ├── UBERGuide.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── UBERGuide.xcworkspace └── contents.xcworkspacedata ├── UBERGuide ├── API.swift ├── ARFrontView.h ├── ARFrontView.m ├── ARNode.h ├── ARNode.m ├── ARViewController.h ├── ARViewController.m ├── AppDelegate.swift ├── Assets.xcassets │ ├── 1.imageset │ │ ├── 1.png │ │ ├── 1@2x.png │ │ ├── 1@3x.png │ │ └── Contents.json │ ├── 2.imageset │ │ ├── 2.png │ │ ├── 2@2x.png │ │ ├── 2@3x.png │ │ └── Contents.json │ ├── 3.imageset │ │ ├── 3.png │ │ ├── 3@2x.png │ │ ├── 3@3x.png │ │ └── Contents.json │ ├── 4.imageset │ │ ├── 4.png │ │ ├── 4@2x.png │ │ ├── 4@3x.png │ │ └── Contents.json │ ├── 5.imageset │ │ ├── 5.png │ │ ├── 5@2x.png │ │ ├── 5@3x.png │ │ └── Contents.json │ ├── 6.imageset │ │ ├── 6.png │ │ ├── 6@2x.png │ │ ├── 6@3x.png │ │ └── Contents.json │ ├── 7.imageset │ │ ├── 7.png │ │ ├── 7@2x.png │ │ ├── 7@3x.png │ │ └── Contents.json │ ├── 8.imageset │ │ ├── 8.png │ │ ├── 8@2x.png │ │ ├── 8@3x.png │ │ └── Contents.json │ ├── 9.imageset │ │ ├── 9.png │ │ ├── 9@2x.png │ │ ├── 9@3x.png │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x-1.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ ├── Icon-Small.png │ │ ├── Icon-Small@2x-1.png │ │ ├── Icon-Small@2x-2.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x-1.png │ │ ├── Icon-Small@3x.png │ │ ├── Icon-Spotlight-40.png │ │ ├── Icon-Spotlight-40@2x-1.png │ │ ├── Icon-Spotlight-40@2x.png │ │ ├── Icon-Spotlight-40@3x.png │ │ ├── Icon.png │ │ └── Icon@2x.png │ ├── Brand Assets.launchimage │ │ └── Contents.json │ ├── Car Body.imageset │ │ ├── Car Body.png │ │ ├── Car Body@2x.png │ │ ├── Car Body@3x.png │ │ └── Contents.json │ ├── Contents.json │ ├── MapBackground.imageset │ │ ├── Contents.json │ │ ├── fuck.png │ │ ├── fuck副本 2.png │ │ └── fuck副本.png │ ├── Person.imageset │ │ ├── Contents.json │ │ ├── Person.png │ │ ├── Person@2x.png │ │ └── Person@3x.png │ ├── RideProgressBackground.imageset │ │ ├── Contents.json │ │ └── WeChat_1452958258.jpeg │ ├── Road.imageset │ │ ├── Contents.json │ │ ├── Road.png │ │ ├── Road@2x.png │ │ └── Road@3x.png │ ├── Tire.imageset │ │ ├── Contents.json │ │ ├── Tire Left.png │ │ ├── Tire Left@2x.png │ │ └── Tire Left@3x.png │ ├── haha.imageset │ │ ├── Contents.json │ │ └── haha.jpg │ ├── icon_ plate.imageset │ │ ├── Contents.json │ │ ├── icon_ plate.png │ │ ├── icon_ plate@2x.png │ │ └── icon_ plate@3x.png │ ├── icon_call.imageset │ │ ├── Contents.json │ │ ├── icon_call.png │ │ ├── icon_call@2x.png │ │ └── icon_call@3x.png │ ├── icon_car.imageset │ │ ├── Contents.json │ │ ├── icon_car.png │ │ ├── icon_car@2x.png │ │ └── icon_car@3x.png │ ├── rateView.imageset │ │ ├── Contents.json │ │ ├── rateView.png │ │ ├── rateView@2x.png │ │ └── rateView@3x.png │ └── welcomeBackground.imageset │ │ ├── Contents.json │ │ ├── Line + Road + CCTV.png │ │ ├── Line + Road + CCTV@2x.png │ │ └── Line + Road + CCTV@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CityWelcomeViewController.h ├── CityWelcomeViewController.m ├── Constants.swift ├── Extensions.swift ├── GeoJSON_Geometry.h ├── GeoJSON_Geometry.m ├── GeoJSON_Index.h ├── GeoJSON_Index.m ├── GeoJSON_Properties.h ├── GeoJSON_Properties.m ├── GeoJSON_Root.h ├── GeoJSON_Root.m ├── HelloSceneViewController.h ├── HelloSceneViewController.m ├── Info.plist ├── LocationManager.h ├── LocationManager.m ├── LookForRideViewController.h ├── LookForRideViewController.m ├── RideInfo.swift ├── RideInfoLocation.xib ├── RideInfoMessage.xib ├── RideInfoProgress.xib ├── RideInfoViews.swift ├── RideProgressViewController.swift ├── Tag.swift ├── TagCell.xib ├── TagViewController.swift ├── TagViews.swift ├── UBERGuide-Bridging-Header.h ├── UIView+ViewFrameGeometry.h ├── UIView+ViewFrameGeometry.m ├── UberAuth.swift ├── WaitDriverViewController.h ├── WaitDriverViewController.m ├── circleLoadingView.h ├── circleLoadingView.m ├── lookingAnimationView.h └── lookingAnimationView.m ├── UBERGuideTests ├── Info.plist └── UBERGuideTests.swift └── UBERGuideUITests ├── Info.plist └── UBERGuideUITests.swift /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | Realm.framework 9 | AVOSCloud.framework 10 | 11 | ## Various settings 12 | *.pbxuser 13 | !default.pbxuser 14 | *.mode1v3 15 | !default.mode1v3 16 | *.mode2v3 17 | !default.mode2v3 18 | *.perspectivev3 19 | !default.perspectivev3 20 | xcuserdata 21 | 22 | ## Other 23 | *.xccheckout 24 | *.moved-aside 25 | *.xcuserstate 26 | *.xcscmblueprint 27 | 28 | ## Obj-C/Swift specific 29 | *.hmap 30 | *.ipa 31 | 32 | # CocoaPods 33 | # 34 | # We recommend against adding the Pods directory to your .gitignore. However 35 | # you should judge for yourself, the pros and cons are mentioned at: 36 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 37 | # 38 | # Pods/ 39 | 40 | # Carthage 41 | # 42 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 43 | # Carthage/Checkouts 44 | 45 | Carthage/Build 46 | 47 | # fastlane 48 | # 49 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 50 | # screenshots whenever they are needed. 51 | # For more information about the recommended setup visit: 52 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 53 | 54 | fastlane/report.xml 55 | fastlane/screenshots 56 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 hACKbUSTER 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # 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 | target 'UBERGuide' do 7 | # pod 'Realm' 8 | pod 'p2.OAuth2', '~> 2.1.3' 9 | pod 'Shimmer', '~> 1.0.2' 10 | pod 'AlamofireImage', '~> 2.2.0' 11 | pod 'Alamofire', '~> 3.0' 12 | pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git' 13 | pod 'MJExtension' 14 | end 15 | 16 | target 'UBERGuideTests' do 17 | # pod 'Realm/Headers' 18 | end 19 | 20 | target 'UBERGuideUITests' do 21 | 22 | end 23 | 24 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (3.1.4) 3 | - AlamofireImage (2.2.0): 4 | - Alamofire (~> 3.1) 5 | - MJExtension (3.0.10) 6 | - p2.OAuth2 (2.1.3): 7 | - SwiftKeychain (~> 0.1.5) 8 | - Shimmer (1.0.2) 9 | - SwiftKeychain (0.1.5) 10 | - SwiftyJSON (2.3.2) 11 | 12 | DEPENDENCIES: 13 | - Alamofire (~> 3.0) 14 | - AlamofireImage (~> 2.2.0) 15 | - MJExtension 16 | - p2.OAuth2 (~> 2.1.3) 17 | - Shimmer (~> 1.0.2) 18 | - SwiftyJSON (from `https://github.com/SwiftyJSON/SwiftyJSON.git`) 19 | 20 | EXTERNAL SOURCES: 21 | SwiftyJSON: 22 | :git: https://github.com/SwiftyJSON/SwiftyJSON.git 23 | 24 | CHECKOUT OPTIONS: 25 | SwiftyJSON: 26 | :commit: 929539eb6a3304eaa9153ca44041a78b85bf2ee5 27 | :git: https://github.com/SwiftyJSON/SwiftyJSON.git 28 | 29 | SPEC CHECKSUMS: 30 | Alamofire: fbc829692f351fa1d8a31dd75fd7f7f56fea31fb 31 | AlamofireImage: bedb8a4bdfb98eda81ba12952fba6e9e90420922 32 | MJExtension: d86aacb740c87519d20e3cca55b6fa4be6cc7548 33 | p2.OAuth2: ce5d6fe61f564354a8267ec3482f0316ae24cfa3 34 | Shimmer: c5374be1c2b0c9e292fb05b339a513cf291cac86 35 | SwiftKeychain: 1387edad8b56c659daa93d9ffc99526bac5b0088 36 | SwiftyJSON: 04ccea08915aa0109039157c7974cf0298da292a 37 | 38 | COCOAPODS: 0.39.0 39 | -------------------------------------------------------------------------------- /Pods/Alamofire/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/Error.swift: -------------------------------------------------------------------------------- 1 | // Error.swift 2 | // 3 | // Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) 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 | 23 | import Foundation 24 | 25 | /// The `Error` struct provides a convenience for creating custom Alamofire NSErrors. 26 | public struct Error { 27 | /// The domain used for creating all Alamofire errors. 28 | public static let Domain = "com.alamofire.error" 29 | 30 | /// The custom error codes generated by Alamofire. 31 | public enum Code: Int { 32 | case InputStreamReadFailed = -6000 33 | case OutputStreamWriteFailed = -6001 34 | case ContentTypeValidationFailed = -6002 35 | case StatusCodeValidationFailed = -6003 36 | case DataSerializationFailed = -6004 37 | case StringSerializationFailed = -6005 38 | case JSONSerializationFailed = -6006 39 | case PropertyListSerializationFailed = -6007 40 | } 41 | 42 | /** 43 | Creates an `NSError` with the given error code and failure reason. 44 | 45 | - parameter code: The error code. 46 | - parameter failureReason: The failure reason. 47 | 48 | - returns: An `NSError` with the given error code and failure reason. 49 | */ 50 | public static func errorWithCode(code: Code, failureReason: String) -> NSError { 51 | return errorWithCode(code.rawValue, failureReason: failureReason) 52 | } 53 | 54 | /** 55 | Creates an `NSError` with the given error code and failure reason. 56 | 57 | - parameter code: The error code. 58 | - parameter failureReason: The failure reason. 59 | 60 | - returns: An `NSError` with the given error code and failure reason. 61 | */ 62 | public static func errorWithCode(code: Int, failureReason: String) -> NSError { 63 | let userInfo = [NSLocalizedFailureReasonErrorKey: failureReason] 64 | return NSError(domain: Domain, code: code, userInfo: userInfo) 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/Response.swift: -------------------------------------------------------------------------------- 1 | // Response.swift 2 | // 3 | // Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) 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 | 23 | import Foundation 24 | 25 | /// Used to store all response data returned from a completed `Request`. 26 | public struct Response { 27 | /// The URL request sent to the server. 28 | public let request: NSURLRequest? 29 | 30 | /// The server's response to the URL request. 31 | public let response: NSHTTPURLResponse? 32 | 33 | /// The data returned by the server. 34 | public let data: NSData? 35 | 36 | /// The result of response serialization. 37 | public let result: Result 38 | 39 | /** 40 | Initializes the `Response` instance with the specified URL request, URL response, server data and response 41 | serialization result. 42 | 43 | - parameter request: The URL request sent to the server. 44 | - parameter response: The server's response to the URL request. 45 | - parameter data: The data returned by the server. 46 | - parameter result: The result of response serialization. 47 | 48 | - returns: the new `Response` instance. 49 | */ 50 | public init(request: NSURLRequest?, response: NSHTTPURLResponse?, data: NSData?, result: Result) { 51 | self.request = request 52 | self.response = response 53 | self.data = data 54 | self.result = result 55 | } 56 | } 57 | 58 | // MARK: - CustomStringConvertible 59 | 60 | extension Response: CustomStringConvertible { 61 | /// The textual representation used when written to an output stream, which includes whether the result was a 62 | /// success or failure. 63 | public var description: String { 64 | return result.debugDescription 65 | } 66 | } 67 | 68 | // MARK: - CustomDebugStringConvertible 69 | 70 | extension Response: CustomDebugStringConvertible { 71 | /// The debug textual representation used when written to an output stream, which includes the URL request, the URL 72 | /// response, the server data and the response serialization result. 73 | public var debugDescription: String { 74 | var output: [String] = [] 75 | 76 | output.append(request != nil ? "[Request]: \(request!)" : "[Request]: nil") 77 | output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") 78 | output.append("[Data]: \(data?.length ?? 0) bytes") 79 | output.append("[Result]: \(result.debugDescription)") 80 | 81 | return output.joinWithSeparator("\n") 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/Result.swift: -------------------------------------------------------------------------------- 1 | // Result.swift 2 | // 3 | // Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) 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 | 23 | import Foundation 24 | 25 | /** 26 | Used to represent whether a request was successful or encountered an error. 27 | 28 | - Success: The request and all post processing operations were successful resulting in the serialization of the 29 | provided associated value. 30 | - Failure: The request encountered an error resulting in a failure. The associated values are the original data 31 | provided by the server as well as the error that caused the failure. 32 | */ 33 | public enum Result { 34 | case Success(Value) 35 | case Failure(Error) 36 | 37 | /// Returns `true` if the result is a success, `false` otherwise. 38 | public var isSuccess: Bool { 39 | switch self { 40 | case .Success: 41 | return true 42 | case .Failure: 43 | return false 44 | } 45 | } 46 | 47 | /// Returns `true` if the result is a failure, `false` otherwise. 48 | public var isFailure: Bool { 49 | return !isSuccess 50 | } 51 | 52 | /// Returns the associated value if the result is a success, `nil` otherwise. 53 | public var value: Value? { 54 | switch self { 55 | case .Success(let value): 56 | return value 57 | case .Failure: 58 | return nil 59 | } 60 | } 61 | 62 | /// Returns the associated error value if the result is a failure, `nil` otherwise. 63 | public var error: Error? { 64 | switch self { 65 | case .Success: 66 | return nil 67 | case .Failure(let error): 68 | return error 69 | } 70 | } 71 | } 72 | 73 | // MARK: - CustomStringConvertible 74 | 75 | extension Result: CustomStringConvertible { 76 | /// The textual representation used when written to an output stream, which includes whether the result was a 77 | /// success or failure. 78 | public var description: String { 79 | switch self { 80 | case .Success: 81 | return "SUCCESS" 82 | case .Failure: 83 | return "FAILURE" 84 | } 85 | } 86 | } 87 | 88 | // MARK: - CustomDebugStringConvertible 89 | 90 | extension Result: CustomDebugStringConvertible { 91 | /// The debug textual representation used when written to an output stream, which includes whether the result was a 92 | /// success or failure in addition to the value or error. 93 | public var debugDescription: String { 94 | switch self { 95 | case .Success(let value): 96 | return "SUCCESS: \(value)" 97 | case .Failure(let error): 98 | return "FAILURE: \(error)" 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Pods/AlamofireImage/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/AlamofireImage/Source/Image.swift: -------------------------------------------------------------------------------- 1 | // Image.swift 2 | // 3 | // Copyright (c) 2015 Alamofire Software Foundation (http://alamofire.org/) 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 | 23 | import Foundation 24 | 25 | #if os(iOS) || os(tvOS) || os(watchOS) 26 | import UIKit 27 | public typealias Image = UIImage 28 | #elseif os(OSX) 29 | import Cocoa 30 | public typealias Image = NSImage 31 | #endif 32 | -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJExtensionConst.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJExtensionConst.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJFoundation.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJFoundation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJProperty.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJProperty.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJPropertyKey.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJPropertyKey.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJPropertyType.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJPropertyType.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSObject+MJClass.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJClass.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSObject+MJCoding.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJCoding.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSObject+MJKeyValue.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJKeyValue.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSObject+MJProperty.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJProperty.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSString+MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSString+MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Shimmer/FBShimmering.h: -------------------------------------------------------------------------------- 1 | ../../../Shimmer/FBShimmering/FBShimmering.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Shimmer/FBShimmeringLayer.h: -------------------------------------------------------------------------------- 1 | ../../../Shimmer/FBShimmering/FBShimmeringLayer.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Shimmer/FBShimmeringView.h: -------------------------------------------------------------------------------- 1 | ../../../Shimmer/FBShimmering/FBShimmeringView.h -------------------------------------------------------------------------------- /Pods/Local Podspecs/SwiftyJSON.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SwiftyJSON", 3 | "version": "2.3.2", 4 | "summary": "SwiftyJSON makes it easy to deal with JSON data in Swift", 5 | "homepage": "https://github.com/SwiftyJSON/SwiftyJSON", 6 | "license": { 7 | "type": "MIT" 8 | }, 9 | "authors": { 10 | "lingoer": "lingoerer@gmail.com", 11 | "tangplin": "tangplin@gmail.com" 12 | }, 13 | "requires_arc": true, 14 | "platforms": { 15 | "osx": "10.9", 16 | "ios": "8.0", 17 | "watchos": "2.0", 18 | "tvos": "9.0" 19 | }, 20 | "source": { 21 | "git": "https://github.com/SwiftyJSON/SwiftyJSON.git", 22 | "tag": "2.3.2" 23 | }, 24 | "source_files": "Source/*.swift" 25 | } 26 | -------------------------------------------------------------------------------- /Pods/MJExtension/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2015 MJExtension (https://github.com/CoderMJLee/MJExtension) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJExtension.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 代码地址:https://github.com/CoderMJLee/MJExtension 8 | // 代码地址:http://code4app.com/ios/%E5%AD%97%E5%85%B8-JSON-%E4%B8%8E%E6%A8%A1%E5%9E%8B%E7%9A%84%E8%BD%AC%E6%8D%A2/5339992a933bf062608b4c57 9 | 10 | #import "NSObject+MJCoding.h" 11 | #import "NSObject+MJProperty.h" 12 | #import "NSObject+MJClass.h" 13 | #import "NSObject+MJKeyValue.h" 14 | #import "NSString+MJExtension.h" 15 | #import "MJExtensionConst.h" -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJExtensionConst.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __MJExtensionConst__H__ 3 | #define __MJExtensionConst__H__ 4 | 5 | #import 6 | 7 | // 过期 8 | #define MJExtensionDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead) 9 | 10 | // 构建错误 11 | #define MJExtensionBuildError(clazz, msg) \ 12 | NSError *error = [NSError errorWithDomain:msg code:250 userInfo:nil]; \ 13 | [clazz setMj_error:error]; 14 | 15 | // 日志输出 16 | #ifdef DEBUG 17 | #define MJExtensionLog(...) NSLog(__VA_ARGS__) 18 | #else 19 | #define MJExtensionLog(...) 20 | #endif 21 | 22 | /** 23 | * 断言 24 | * @param condition 条件 25 | * @param returnValue 返回值 26 | */ 27 | #define MJExtensionAssertError(condition, returnValue, clazz, msg) \ 28 | [clazz setMj_error:nil]; \ 29 | if ((condition) == NO) { \ 30 | MJExtensionBuildError(clazz, msg); \ 31 | return returnValue;\ 32 | } 33 | 34 | #define MJExtensionAssert2(condition, returnValue) \ 35 | if ((condition) == NO) return returnValue; 36 | 37 | /** 38 | * 断言 39 | * @param condition 条件 40 | */ 41 | #define MJExtensionAssert(condition) MJExtensionAssert2(condition, ) 42 | 43 | /** 44 | * 断言 45 | * @param param 参数 46 | * @param returnValue 返回值 47 | */ 48 | #define MJExtensionAssertParamNotNil2(param, returnValue) \ 49 | MJExtensionAssert2((param) != nil, returnValue) 50 | 51 | /** 52 | * 断言 53 | * @param param 参数 54 | */ 55 | #define MJExtensionAssertParamNotNil(param) MJExtensionAssertParamNotNil2(param, ) 56 | 57 | /** 58 | * 打印所有的属性 59 | */ 60 | #define MJLogAllIvars \ 61 | -(NSString *)description \ 62 | { \ 63 | return [self mj_keyValues].description; \ 64 | } 65 | #define MJExtensionLogAllProperties MJLogAllIvars 66 | 67 | /** 68 | * 类型(属性类型) 69 | */ 70 | extern NSString *const MJPropertyTypeInt; 71 | extern NSString *const MJPropertyTypeShort; 72 | extern NSString *const MJPropertyTypeFloat; 73 | extern NSString *const MJPropertyTypeDouble; 74 | extern NSString *const MJPropertyTypeLong; 75 | extern NSString *const MJPropertyTypeLongLong; 76 | extern NSString *const MJPropertyTypeChar; 77 | extern NSString *const MJPropertyTypeBOOL1; 78 | extern NSString *const MJPropertyTypeBOOL2; 79 | extern NSString *const MJPropertyTypePointer; 80 | 81 | extern NSString *const MJPropertyTypeIvar; 82 | extern NSString *const MJPropertyTypeMethod; 83 | extern NSString *const MJPropertyTypeBlock; 84 | extern NSString *const MJPropertyTypeClass; 85 | extern NSString *const MJPropertyTypeSEL; 86 | extern NSString *const MJPropertyTypeId; 87 | 88 | #endif -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJExtensionConst.m: -------------------------------------------------------------------------------- 1 | #ifndef __MJExtensionConst__M__ 2 | #define __MJExtensionConst__M__ 3 | 4 | #import 5 | 6 | /** 7 | * 成员变量类型(属性类型) 8 | */ 9 | NSString *const MJPropertyTypeInt = @"i"; 10 | NSString *const MJPropertyTypeShort = @"s"; 11 | NSString *const MJPropertyTypeFloat = @"f"; 12 | NSString *const MJPropertyTypeDouble = @"d"; 13 | NSString *const MJPropertyTypeLong = @"l"; 14 | NSString *const MJPropertyTypeLongLong = @"q"; 15 | NSString *const MJPropertyTypeChar = @"c"; 16 | NSString *const MJPropertyTypeBOOL1 = @"c"; 17 | NSString *const MJPropertyTypeBOOL2 = @"b"; 18 | NSString *const MJPropertyTypePointer = @"*"; 19 | 20 | NSString *const MJPropertyTypeIvar = @"^{objc_ivar=}"; 21 | NSString *const MJPropertyTypeMethod = @"^{objc_method=}"; 22 | NSString *const MJPropertyTypeBlock = @"@?"; 23 | NSString *const MJPropertyTypeClass = @"#"; 24 | NSString *const MJPropertyTypeSEL = @":"; 25 | NSString *const MJPropertyTypeId = @"@"; 26 | 27 | #endif -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJFoundation.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJFoundation.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 14/7/16. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MJFoundation : NSObject 12 | + (BOOL)isClassFromFoundation:(Class)c; 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJFoundation.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJFoundation.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 14/7/16. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJFoundation.h" 10 | #import "MJExtensionConst.h" 11 | #import 12 | 13 | static NSSet *foundationClasses_; 14 | 15 | @implementation MJFoundation 16 | 17 | + (NSSet *)foundationClasses 18 | { 19 | if (foundationClasses_ == nil) { 20 | // 集合中没有NSObject,因为几乎所有的类都是继承自NSObject,具体是不是NSObject需要特殊判断 21 | foundationClasses_ = [NSSet setWithObjects: 22 | [NSURL class], 23 | [NSDate class], 24 | [NSValue class], 25 | [NSData class], 26 | [NSError class], 27 | [NSArray class], 28 | [NSDictionary class], 29 | [NSString class], 30 | [NSAttributedString class], nil]; 31 | } 32 | return foundationClasses_; 33 | } 34 | 35 | + (BOOL)isClassFromFoundation:(Class)c 36 | { 37 | if (c == [NSObject class] || c == [NSManagedObject class]) return YES; 38 | 39 | __block BOOL result = NO; 40 | [[self foundationClasses] enumerateObjectsUsingBlock:^(Class foundationClass, BOOL *stop) { 41 | if ([c isSubclassOfClass:foundationClass]) { 42 | result = YES; 43 | *stop = YES; 44 | } 45 | }]; 46 | return result; 47 | } 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJProperty.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJProperty.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/4/17. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 包装一个成员属性 8 | 9 | #import 10 | #import 11 | #import "MJPropertyType.h" 12 | #import "MJPropertyKey.h" 13 | 14 | /** 15 | * 包装一个成员 16 | */ 17 | @interface MJProperty : NSObject 18 | /** 成员属性 */ 19 | @property (nonatomic, assign) objc_property_t property; 20 | /** 成员属性的名字 */ 21 | @property (nonatomic, readonly) NSString *name; 22 | 23 | /** 成员属性的类型 */ 24 | @property (nonatomic, readonly) MJPropertyType *type; 25 | /** 成员属性来源于哪个类(可能是父类) */ 26 | @property (nonatomic, assign) Class srcClass; 27 | 28 | /**** 同一个成员属性 - 父类和子类的行为可能不一致(originKey、propertyKeys、objectClassInArray) ****/ 29 | /** 设置最原始的key */ 30 | - (void)setOriginKey:(id)originKey forClass:(Class)c; 31 | /** 对应着字典中的多级key(里面存放的数组,数组里面都是MJPropertyKey对象) */ 32 | - (NSArray *)propertyKeysForClass:(Class)c; 33 | 34 | /** 模型数组中的模型类型 */ 35 | - (void)setObjectClassInArray:(Class)objectClass forClass:(Class)c; 36 | - (Class)objectClassInArrayForClass:(Class)c; 37 | /**** 同一个成员变量 - 父类和子类的行为可能不一致(key、keys、objectClassInArray) ****/ 38 | 39 | /** 40 | * 设置object的成员变量值 41 | */ 42 | - (void)setValue:(id)value forObject:(id)object; 43 | /** 44 | * 得到object的成员属性值 45 | */ 46 | - (id)valueForObject:(id)object; 47 | 48 | /** 49 | * 初始化 50 | */ 51 | + (instancetype)cachedPropertyWithProperty:(objc_property_t)property; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJPropertyKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyKey.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/8/11. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum { 12 | MJPropertyKeyTypeDictionary = 0, // 字典的key 13 | MJPropertyKeyTypeArray // 数组的key 14 | } MJPropertyKeyType; 15 | 16 | /** 17 | * 属性的key 18 | */ 19 | @interface MJPropertyKey : NSObject 20 | /** key的名字 */ 21 | @property (copy, nonatomic) NSString *name; 22 | /** key的种类,可能是@"10",可能是@"age" */ 23 | @property (assign, nonatomic) MJPropertyKeyType type; 24 | 25 | /** 26 | * 根据当前的key,也就是name,从object(字典或者数组)中取值 27 | */ 28 | - (id)valueInObject:(id)object; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJPropertyKey.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyKey.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/8/11. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJPropertyKey.h" 10 | 11 | @implementation MJPropertyKey 12 | 13 | - (id)valueInObject:(id)object 14 | { 15 | if ([object isKindOfClass:[NSDictionary class]] && self.type == MJPropertyKeyTypeDictionary) { 16 | return object[self.name]; 17 | } else if ([object isKindOfClass:[NSArray class]] && self.type == MJPropertyKeyTypeArray) { 18 | NSArray *array = object; 19 | NSUInteger index = self.name.intValue; 20 | if (index < array.count) return array[index]; 21 | return nil; 22 | } 23 | return nil; 24 | } 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJPropertyType.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyType.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 包装一种类型 8 | 9 | #import 10 | 11 | /** 12 | * 包装一种类型 13 | */ 14 | @interface MJPropertyType : NSObject 15 | /** 类型标识符 */ 16 | @property (nonatomic, copy) NSString *code; 17 | 18 | /** 是否为id类型 */ 19 | @property (nonatomic, readonly, getter=isIdType) BOOL idType; 20 | 21 | /** 是否为基本数字类型:int、float等 */ 22 | @property (nonatomic, readonly, getter=isNumberType) BOOL numberType; 23 | 24 | /** 是否为BOOL类型 */ 25 | @property (nonatomic, readonly, getter=isBoolType) BOOL boolType; 26 | 27 | /** 对象类型(如果是基本数据类型,此值为nil) */ 28 | @property (nonatomic, readonly) Class typeClass; 29 | 30 | /** 类型是否来自于Foundation框架,比如NSString、NSArray */ 31 | @property (nonatomic, readonly, getter = isFromFoundation) BOOL fromFoundation; 32 | /** 类型是否不支持KVC */ 33 | @property (nonatomic, readonly, getter = isKVCDisabled) BOOL KVCDisabled; 34 | 35 | /** 36 | * 获得缓存的类型对象 37 | */ 38 | + (instancetype)cachedTypeWithCode:(NSString *)code; 39 | @end -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJPropertyType.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyType.m 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJPropertyType.h" 10 | #import "MJExtension.h" 11 | #import "MJFoundation.h" 12 | #import "MJExtensionConst.h" 13 | 14 | @implementation MJPropertyType 15 | 16 | static NSMutableDictionary *types_; 17 | + (void)initialize 18 | { 19 | types_ = [NSMutableDictionary dictionary]; 20 | } 21 | 22 | + (instancetype)cachedTypeWithCode:(NSString *)code 23 | { 24 | MJExtensionAssertParamNotNil2(code, nil); 25 | 26 | MJPropertyType *type = types_[code]; 27 | if (type == nil) { 28 | type = [[self alloc] init]; 29 | type.code = code; 30 | types_[code] = type; 31 | } 32 | return type; 33 | } 34 | 35 | #pragma mark - 公共方法 36 | - (void)setCode:(NSString *)code 37 | { 38 | _code = code; 39 | 40 | MJExtensionAssertParamNotNil(code); 41 | 42 | if ([code isEqualToString:MJPropertyTypeId]) { 43 | _idType = YES; 44 | } else if (code.length == 0) { 45 | _KVCDisabled = YES; 46 | } else if (code.length > 3 && [code hasPrefix:@"@\""]) { 47 | // 去掉@"和",截取中间的类型名称 48 | _code = [code substringWithRange:NSMakeRange(2, code.length - 3)]; 49 | _typeClass = NSClassFromString(_code); 50 | _fromFoundation = [MJFoundation isClassFromFoundation:_typeClass]; 51 | _numberType = [_typeClass isSubclassOfClass:[NSNumber class]]; 52 | 53 | } else if ([code isEqualToString:MJPropertyTypeSEL] || 54 | [code isEqualToString:MJPropertyTypeIvar] || 55 | [code isEqualToString:MJPropertyTypeMethod]) { 56 | _KVCDisabled = YES; 57 | } 58 | 59 | // 是否为数字类型 60 | NSString *lowerCode = _code.lowercaseString; 61 | NSArray *numberTypes = @[MJPropertyTypeInt, MJPropertyTypeShort, MJPropertyTypeBOOL1, MJPropertyTypeBOOL2, MJPropertyTypeFloat, MJPropertyTypeDouble, MJPropertyTypeLong, MJPropertyTypeLongLong, MJPropertyTypeChar]; 62 | if ([numberTypes containsObject:lowerCode]) { 63 | _numberType = YES; 64 | 65 | if ([lowerCode isEqualToString:MJPropertyTypeBOOL1] 66 | || [lowerCode isEqualToString:MJPropertyTypeBOOL2]) { 67 | _boolType = YES; 68 | } 69 | } 70 | } 71 | @end 72 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/NSObject+MJClass.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJClass.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/8/11. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * 遍历所有类的block(父类) 13 | */ 14 | typedef void (^MJClassesEnumeration)(Class c, BOOL *stop); 15 | 16 | /** 这个数组中的属性名才会进行字典和模型的转换 */ 17 | typedef NSArray * (^MJAllowedPropertyNames)(); 18 | /** 这个数组中的属性名才会进行归档 */ 19 | typedef NSArray * (^MJAllowedCodingPropertyNames)(); 20 | 21 | /** 这个数组中的属性名将会被忽略:不进行字典和模型的转换 */ 22 | typedef NSArray * (^MJIgnoredPropertyNames)(); 23 | /** 这个数组中的属性名将会被忽略:不进行归档 */ 24 | typedef NSArray * (^MJIgnoredCodingPropertyNames)(); 25 | 26 | /** 27 | * 类相关的扩展 28 | */ 29 | @interface NSObject (MJClass) 30 | /** 31 | * 遍历所有的类 32 | */ 33 | + (void)mj_enumerateClasses:(MJClassesEnumeration)enumeration; 34 | + (void)mj_enumerateAllClasses:(MJClassesEnumeration)enumeration; 35 | 36 | #pragma mark - 属性白名单配置 37 | /** 38 | * 这个数组中的属性名才会进行字典和模型的转换 39 | * 40 | * @param allowedPropertyNames 这个数组中的属性名才会进行字典和模型的转换 41 | */ 42 | + (void)mj_setupAllowedPropertyNames:(MJAllowedPropertyNames)allowedPropertyNames; 43 | 44 | /** 45 | * 这个数组中的属性名才会进行字典和模型的转换 46 | */ 47 | + (NSMutableArray *)mj_totalAllowedPropertyNames; 48 | 49 | #pragma mark - 属性黑名单配置 50 | /** 51 | * 这个数组中的属性名将会被忽略:不进行字典和模型的转换 52 | * 53 | * @param ignoredPropertyNames 这个数组中的属性名将会被忽略:不进行字典和模型的转换 54 | */ 55 | + (void)mj_setupIgnoredPropertyNames:(MJIgnoredPropertyNames)ignoredPropertyNames; 56 | 57 | /** 58 | * 这个数组中的属性名将会被忽略:不进行字典和模型的转换 59 | */ 60 | + (NSMutableArray *)mj_totalIgnoredPropertyNames; 61 | 62 | #pragma mark - 归档属性白名单配置 63 | /** 64 | * 这个数组中的属性名才会进行归档 65 | * 66 | * @param allowedCodingPropertyNames 这个数组中的属性名才会进行归档 67 | */ 68 | + (void)mj_setupAllowedCodingPropertyNames:(MJAllowedCodingPropertyNames)allowedCodingPropertyNames; 69 | 70 | /** 71 | * 这个数组中的属性名才会进行字典和模型的转换 72 | */ 73 | + (NSMutableArray *)mj_totalAllowedCodingPropertyNames; 74 | 75 | #pragma mark - 归档属性黑名单配置 76 | /** 77 | * 这个数组中的属性名将会被忽略:不进行归档 78 | * 79 | * @param ignoredCodingPropertyNames 这个数组中的属性名将会被忽略:不进行归档 80 | */ 81 | + (void)mj_setupIgnoredCodingPropertyNames:(MJIgnoredCodingPropertyNames)ignoredCodingPropertyNames; 82 | 83 | /** 84 | * 这个数组中的属性名将会被忽略:不进行归档 85 | */ 86 | + (NSMutableArray *)mj_totalIgnoredCodingPropertyNames; 87 | 88 | #pragma mark - 内部使用 89 | + (void)mj_setupBlockReturnValue:(id (^)())block key:(const char *)key; 90 | @end 91 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/NSObject+MJCoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJCoding.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MJExtensionConst.h" 11 | 12 | /** 13 | * Codeing协议 14 | */ 15 | @protocol MJCoding 16 | @optional 17 | /** 18 | * 这个数组中的属性名才会进行归档 19 | */ 20 | + (NSArray *)mj_allowedCodingPropertyNames; 21 | /** 22 | * 这个数组中的属性名将会被忽略:不进行归档 23 | */ 24 | + (NSArray *)mj_ignoredCodingPropertyNames; 25 | @end 26 | 27 | @interface NSObject (MJCoding) 28 | /** 29 | * 解码(从文件中解析对象) 30 | */ 31 | - (void)mj_decode:(NSCoder *)decoder; 32 | /** 33 | * 编码(将对象写入文件中) 34 | */ 35 | - (void)mj_encode:(NSCoder *)encoder; 36 | @end 37 | 38 | /** 39 | 归档的实现 40 | */ 41 | #define MJCodingImplementation \ 42 | - (id)initWithCoder:(NSCoder *)decoder \ 43 | { \ 44 | if (self = [super init]) { \ 45 | [self mj_decode:decoder]; \ 46 | } \ 47 | return self; \ 48 | } \ 49 | \ 50 | - (void)encodeWithCoder:(NSCoder *)encoder \ 51 | { \ 52 | [self mj_encode:encoder]; \ 53 | } 54 | 55 | #define MJExtensionCodingImplementation MJCodingImplementation -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/NSObject+MJCoding.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJCoding.m 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "NSObject+MJCoding.h" 10 | #import "NSObject+MJClass.h" 11 | #import "NSObject+MJProperty.h" 12 | #import "MJProperty.h" 13 | 14 | @implementation NSObject (MJCoding) 15 | 16 | - (void)mj_encode:(NSCoder *)encoder 17 | { 18 | Class clazz = [self class]; 19 | 20 | NSArray *allowedCodingPropertyNames = [clazz mj_totalAllowedCodingPropertyNames]; 21 | NSArray *ignoredCodingPropertyNames = [clazz mj_totalIgnoredCodingPropertyNames]; 22 | 23 | [clazz mj_enumerateProperties:^(MJProperty *property, BOOL *stop) { 24 | // 检测是否被忽略 25 | if (allowedCodingPropertyNames.count && ![allowedCodingPropertyNames containsObject:property.name]) return; 26 | if ([ignoredCodingPropertyNames containsObject:property.name]) return; 27 | 28 | id value = [property valueForObject:self]; 29 | if (value == nil) return; 30 | [encoder encodeObject:value forKey:property.name]; 31 | }]; 32 | } 33 | 34 | - (void)mj_decode:(NSCoder *)decoder 35 | { 36 | Class clazz = [self class]; 37 | 38 | NSArray *allowedCodingPropertyNames = [clazz mj_totalAllowedCodingPropertyNames]; 39 | NSArray *ignoredCodingPropertyNames = [clazz mj_totalIgnoredCodingPropertyNames]; 40 | 41 | [clazz mj_enumerateProperties:^(MJProperty *property, BOOL *stop) { 42 | // 检测是否被忽略 43 | if (allowedCodingPropertyNames.count && ![allowedCodingPropertyNames containsObject:property.name]) return; 44 | if ([ignoredCodingPropertyNames containsObject:property.name]) return; 45 | 46 | id value = [decoder decodeObjectForKey:property.name]; 47 | if (value == nil) { // 兼容以前的MJExtension版本 48 | value = [decoder decodeObjectForKey:[@"_" stringByAppendingString:property.name]]; 49 | } 50 | if (value == nil) return; 51 | [property setValue:value forObject:self]; 52 | }]; 53 | } 54 | @end 55 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/NSObject+MJProperty.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJProperty.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/4/17. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MJExtensionConst.h" 11 | 12 | @class MJProperty; 13 | 14 | /** 15 | * 遍历成员变量用的block 16 | * 17 | * @param property 成员的包装对象 18 | * @param stop YES代表停止遍历,NO代表继续遍历 19 | */ 20 | typedef void (^MJPropertiesEnumeration)(MJProperty *property, BOOL *stop); 21 | 22 | /** 将属性名换为其他key去字典中取值 */ 23 | typedef NSDictionary * (^MJReplacedKeyFromPropertyName)(); 24 | typedef NSString * (^MJReplacedKeyFromPropertyName121)(NSString *propertyName); 25 | /** 数组中需要转换的模型类 */ 26 | typedef NSDictionary * (^MJObjectClassInArray)(); 27 | /** 用于过滤字典中的值 */ 28 | typedef id (^MJNewValueFromOldValue)(id object, id oldValue, MJProperty *property); 29 | 30 | /** 31 | * 成员属性相关的扩展 32 | */ 33 | @interface NSObject (MJProperty) 34 | #pragma mark - 遍历 35 | /** 36 | * 遍历所有的成员 37 | */ 38 | + (void)mj_enumerateProperties:(MJPropertiesEnumeration)enumeration; 39 | 40 | #pragma mark - 新值配置 41 | /** 42 | * 用于过滤字典中的值 43 | * 44 | * @param newValueFormOldValue 用于过滤字典中的值 45 | */ 46 | + (void)mj_setupNewValueFromOldValue:(MJNewValueFromOldValue)newValueFormOldValue; 47 | + (id)mj_getNewValueFromObject:(__unsafe_unretained id)object oldValue:(__unsafe_unretained id)oldValue property:(__unsafe_unretained MJProperty *)property; 48 | 49 | #pragma mark - key配置 50 | /** 51 | * 将属性名换为其他key去字典中取值 52 | * 53 | * @param replacedKeyFromPropertyName 将属性名换为其他key去字典中取值 54 | */ 55 | + (void)mj_setupReplacedKeyFromPropertyName:(MJReplacedKeyFromPropertyName)replacedKeyFromPropertyName; 56 | /** 57 | * 将属性名换为其他key去字典中取值 58 | * 59 | * @param replacedKeyFromPropertyName121 将属性名换为其他key去字典中取值 60 | */ 61 | + (void)mj_setupReplacedKeyFromPropertyName121:(MJReplacedKeyFromPropertyName121)replacedKeyFromPropertyName121; 62 | 63 | #pragma mark - array model class配置 64 | /** 65 | * 数组中需要转换的模型类 66 | * 67 | * @param objectClassInArray 数组中需要转换的模型类 68 | */ 69 | + (void)mj_setupObjectClassInArray:(MJObjectClassInArray)objectClassInArray; 70 | @end 71 | 72 | @interface NSObject (MJPropertyDeprecated_v_2_5_16) 73 | + (void)enumerateProperties:(MJPropertiesEnumeration)enumeration MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 74 | + (void)setupNewValueFromOldValue:(MJNewValueFromOldValue)newValueFormOldValue MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 75 | + (id)getNewValueFromObject:(__unsafe_unretained id)object oldValue:(__unsafe_unretained id)oldValue property:(__unsafe_unretained MJProperty *)property MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 76 | + (void)setupReplacedKeyFromPropertyName:(MJReplacedKeyFromPropertyName)replacedKeyFromPropertyName MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 77 | + (void)setupReplacedKeyFromPropertyName121:(MJReplacedKeyFromPropertyName121)replacedKeyFromPropertyName121 MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 78 | + (void)setupObjectClassInArray:(MJObjectClassInArray)objectClassInArray MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 79 | @end -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/NSString+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+MJExtension.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/6/7. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MJExtensionConst.h" 11 | 12 | @interface NSString (MJExtension) 13 | /** 14 | * 驼峰转下划线(loveYou -> love_you) 15 | */ 16 | - (NSString *)mj_underlineFromCamel; 17 | /** 18 | * 下划线转驼峰(love_you -> loveYou) 19 | */ 20 | - (NSString *)mj_camelFromUnderline; 21 | /** 22 | * 首字母变大写 23 | */ 24 | - (NSString *)mj_firstCharUpper; 25 | /** 26 | * 首字母变小写 27 | */ 28 | - (NSString *)mj_firstCharLower; 29 | 30 | - (BOOL)mj_isPureInt; 31 | 32 | - (NSURL *)mj_url; 33 | @end 34 | 35 | @interface NSString (MJExtensionDeprecated_v_2_5_16) 36 | - (NSString *)underlineFromCamel MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 37 | - (NSString *)camelFromUnderline MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 38 | - (NSString *)firstCharUpper MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 39 | - (NSString *)firstCharLower MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 40 | - (BOOL)isPureInt MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 41 | - (NSURL *)url MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/NSString+MJExtension.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+MJExtension.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/6/7. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "NSString+MJExtension.h" 10 | 11 | @implementation NSString (MJExtension) 12 | - (NSString *)mj_underlineFromCamel 13 | { 14 | if (self.length == 0) return self; 15 | NSMutableString *string = [NSMutableString string]; 16 | for (NSUInteger i = 0; i= 2) [string appendString:[cmp substringFromIndex:1]]; 40 | } else { 41 | [string appendString:cmp]; 42 | } 43 | } 44 | return string; 45 | } 46 | 47 | - (NSString *)mj_firstCharLower 48 | { 49 | if (self.length == 0) return self; 50 | NSMutableString *string = [NSMutableString string]; 51 | [string appendString:[NSString stringWithFormat:@"%c", [self characterAtIndex:0]].lowercaseString]; 52 | if (self.length >= 2) [string appendString:[self substringFromIndex:1]]; 53 | return string; 54 | } 55 | 56 | - (NSString *)mj_firstCharUpper 57 | { 58 | if (self.length == 0) return self; 59 | NSMutableString *string = [NSMutableString string]; 60 | [string appendString:[NSString stringWithFormat:@"%c", [self characterAtIndex:0]].uppercaseString]; 61 | if (self.length >= 2) [string appendString:[self substringFromIndex:1]]; 62 | return string; 63 | } 64 | 65 | - (BOOL)mj_isPureInt 66 | { 67 | NSScanner *scan = [NSScanner scannerWithString:self]; 68 | int val; 69 | return [scan scanInt:&val] && [scan isAtEnd]; 70 | } 71 | 72 | - (NSURL *)mj_url 73 | { 74 | // [self stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"!$&'()*+,-./:;=?@_~%#[]"]]; 75 | 76 | return [NSURL URLWithString:(NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)self, (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]", NULL,kCFStringEncodingUTF8))]; 77 | } 78 | @end 79 | 80 | @implementation NSString (MJExtensionDeprecated_v_2_5_16) 81 | - (NSString *)underlineFromCamel 82 | { 83 | return self.mj_underlineFromCamel; 84 | } 85 | 86 | - (NSString *)camelFromUnderline 87 | { 88 | return self.mj_camelFromUnderline; 89 | } 90 | 91 | - (NSString *)firstCharLower 92 | { 93 | return self.mj_firstCharLower; 94 | } 95 | 96 | - (NSString *)firstCharUpper 97 | { 98 | return self.mj_firstCharUpper; 99 | } 100 | 101 | - (BOOL)isPureInt 102 | { 103 | return self.mj_isPureInt; 104 | } 105 | 106 | - (NSURL *)url 107 | { 108 | return self.mj_url; 109 | } 110 | @end 111 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (3.1.4) 3 | - AlamofireImage (2.2.0): 4 | - Alamofire (~> 3.1) 5 | - MJExtension (3.0.10) 6 | - p2.OAuth2 (2.1.3): 7 | - SwiftKeychain (~> 0.1.5) 8 | - Shimmer (1.0.2) 9 | - SwiftKeychain (0.1.5) 10 | - SwiftyJSON (2.3.2) 11 | 12 | DEPENDENCIES: 13 | - Alamofire (~> 3.0) 14 | - AlamofireImage (~> 2.2.0) 15 | - MJExtension 16 | - p2.OAuth2 (~> 2.1.3) 17 | - Shimmer (~> 1.0.2) 18 | - SwiftyJSON (from `https://github.com/SwiftyJSON/SwiftyJSON.git`) 19 | 20 | EXTERNAL SOURCES: 21 | SwiftyJSON: 22 | :git: https://github.com/SwiftyJSON/SwiftyJSON.git 23 | 24 | CHECKOUT OPTIONS: 25 | SwiftyJSON: 26 | :commit: 929539eb6a3304eaa9153ca44041a78b85bf2ee5 27 | :git: https://github.com/SwiftyJSON/SwiftyJSON.git 28 | 29 | SPEC CHECKSUMS: 30 | Alamofire: fbc829692f351fa1d8a31dd75fd7f7f56fea31fb 31 | AlamofireImage: bedb8a4bdfb98eda81ba12952fba6e9e90420922 32 | MJExtension: d86aacb740c87519d20e3cca55b6fa4be6cc7548 33 | p2.OAuth2: ce5d6fe61f564354a8267ec3482f0316ae24cfa3 34 | Shimmer: c5374be1c2b0c9e292fb05b339a513cf291cac86 35 | SwiftKeychain: 1387edad8b56c659daa93d9ffc99526bac5b0088 36 | SwiftyJSON: 04ccea08915aa0109039157c7974cf0298da292a 37 | 38 | COCOAPODS: 0.39.0 39 | -------------------------------------------------------------------------------- /Pods/Shimmer/FBShimmering/FBShimmering.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | typedef NS_ENUM(NSInteger, FBShimmerDirection) { 13 | FBShimmerDirectionRight, // Shimmer animation goes from left to right 14 | FBShimmerDirectionLeft, // Shimmer animation goes from right to left 15 | FBShimmerDirectionUp, // Shimmer animation goes from below to above 16 | FBShimmerDirectionDown, // Shimmer animation goes from above to below 17 | }; 18 | 19 | @protocol FBShimmering 20 | 21 | //! @abstract Set this to YES to start shimming and NO to stop. Defaults to NO. 22 | @property (nonatomic, assign, readwrite, getter = isShimmering) BOOL shimmering; 23 | 24 | //! @abstract The time interval between shimmerings in seconds. Defaults to 0.4. 25 | @property (assign, nonatomic, readwrite) CFTimeInterval shimmeringPauseDuration; 26 | 27 | //! @abstract The opacity of the content while it is shimmering. Defaults to 1.0. 28 | @property (assign, nonatomic, readwrite) CGFloat shimmeringAnimationOpacity; 29 | 30 | //! @abstract The opacity of the content before it is shimmering. Defaults to 0.5. 31 | @property (assign, nonatomic, readwrite) CGFloat shimmeringOpacity; 32 | 33 | //! @abstract The speed of shimmering, in points per second. Defaults to 230. 34 | @property (assign, nonatomic, readwrite) CGFloat shimmeringSpeed; 35 | 36 | //! @abstract The highlight length of shimmering. Range of [0,1], defaults to 0.33. 37 | @property (assign, nonatomic, readwrite) CGFloat shimmeringHighlightLength; 38 | 39 | //! @abstract @deprecated Same as "shimmeringHighlightLength", just for downward compatibility 40 | @property (assign, nonatomic, readwrite, getter = shimmeringHighlightLength, setter = setShimmeringHighlightLength:) CGFloat shimmeringHighlightWidth; 41 | 42 | //! @abstract The direction of shimmering animation. Defaults to FBShimmerDirectionRight. 43 | @property (assign, nonatomic, readwrite) FBShimmerDirection shimmeringDirection; 44 | 45 | //! @abstract The duration of the fade used when shimmer begins. Defaults to 0.1. 46 | @property (assign, nonatomic, readwrite) CFTimeInterval shimmeringBeginFadeDuration; 47 | 48 | //! @abstract The duration of the fade used when shimmer ends. Defaults to 0.3. 49 | @property (assign, nonatomic, readwrite) CFTimeInterval shimmeringEndFadeDuration; 50 | 51 | /** 52 | @abstract The absolute CoreAnimation media time when the shimmer will fade in. 53 | @discussion Only valid after setting {@ref shimmering} to NO. 54 | */ 55 | @property (assign, nonatomic, readonly) CFTimeInterval shimmeringFadeTime; 56 | 57 | @end 58 | 59 | -------------------------------------------------------------------------------- /Pods/Shimmer/FBShimmering/FBShimmeringLayer.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "FBShimmering.h" 13 | 14 | /** 15 | @abstract Lightweight, generic shimmering layer. 16 | */ 17 | @interface FBShimmeringLayer : CALayer 18 | 19 | //! @abstract The content layer to be shimmered. 20 | @property (strong, nonatomic) CALayer *contentLayer; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/Shimmer/FBShimmering/FBShimmeringView.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "FBShimmering.h" 13 | 14 | /** 15 | @abstract Lightweight, generic shimmering view. 16 | */ 17 | @interface FBShimmeringView : UIView 18 | 19 | //! @abstract The content view to be shimmered. 20 | @property (strong, nonatomic) UIView *contentView; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/Shimmer/FBShimmering/FBShimmeringView.m: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "FBShimmeringView.h" 11 | 12 | #import "FBShimmeringLayer.h" 13 | 14 | #if !__has_feature(objc_arc) 15 | #error This file must be compiled with ARC. Convert your project to ARC or specify the -fobjc-arc flag. 16 | #endif 17 | 18 | @implementation FBShimmeringView 19 | 20 | + (Class)layerClass 21 | { 22 | return [FBShimmeringLayer class]; 23 | } 24 | 25 | #define __layer ((FBShimmeringLayer *)self.layer) 26 | 27 | #define LAYER_ACCESSOR(accessor, ctype) \ 28 | - (ctype)accessor { \ 29 | return [__layer accessor]; \ 30 | } 31 | 32 | #define LAYER_MUTATOR(mutator, ctype) \ 33 | - (void)mutator (ctype)value { \ 34 | [__layer mutator value]; \ 35 | } 36 | 37 | #define LAYER_RW_PROPERTY(accessor, mutator, ctype) \ 38 | LAYER_ACCESSOR (accessor, ctype) \ 39 | LAYER_MUTATOR (mutator, ctype) 40 | 41 | LAYER_RW_PROPERTY(isShimmering, setShimmering:, BOOL) 42 | LAYER_RW_PROPERTY(shimmeringPauseDuration, setShimmeringPauseDuration:, CFTimeInterval) 43 | LAYER_RW_PROPERTY(shimmeringAnimationOpacity, setShimmeringAnimationOpacity:, CGFloat) 44 | LAYER_RW_PROPERTY(shimmeringOpacity, setShimmeringOpacity:, CGFloat) 45 | LAYER_RW_PROPERTY(shimmeringSpeed, setShimmeringSpeed:, CGFloat) 46 | LAYER_RW_PROPERTY(shimmeringHighlightLength, setShimmeringHighlightLength:, CGFloat) 47 | LAYER_RW_PROPERTY(shimmeringDirection, setShimmeringDirection:, FBShimmerDirection) 48 | LAYER_ACCESSOR(shimmeringFadeTime, CFTimeInterval) 49 | LAYER_RW_PROPERTY(shimmeringBeginFadeDuration, setShimmeringBeginFadeDuration:, CFTimeInterval) 50 | LAYER_RW_PROPERTY(shimmeringEndFadeDuration, setShimmeringEndFadeDuration:, CFTimeInterval) 51 | 52 | - (void)setContentView:(UIView *)contentView 53 | { 54 | if (contentView != _contentView) { 55 | _contentView = contentView; 56 | [self addSubview:contentView]; 57 | __layer.contentLayer = contentView.layer; 58 | } 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Pods/Shimmer/LICENSE: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | For Shimmer software 4 | 5 | Copyright (c) 2014, Facebook, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | * Neither the name Facebook nor the names of its contributors may be used to 18 | endorse or promote products derived from this software without specific 19 | prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /Pods/Shimmer/README.md: -------------------------------------------------------------------------------- 1 | # Shimmer 2 | Shimmer is an easy way to add a shimmering effect to any view in your app. It's useful as an unobtrusive loading indicator. 3 | 4 | Shimmer was originally developed to show loading status in [Paper](http://facebook.com/paper). 5 | 6 | ![Shimmer](https://github.com/facebook/Shimmer/blob/master/shimmer.gif?raw=true) 7 | 8 | ## Usage 9 | To use Shimmer, create a `FBShimmeringView` or `FBShimmeringLayer` and add your content. To start shimmering, set the `shimmering` property to `YES`. 10 | 11 | An example of making a label shimmer: 12 | 13 | ```objective-c 14 | FBShimmeringView *shimmeringView = [[FBShimmeringView alloc] initWithFrame:self.view.bounds]; 15 | [self.view addSubview:shimmeringView]; 16 | 17 | UILabel *loadingLabel = [[UILabel alloc] initWithFrame:shimmeringView.bounds]; 18 | loadingLabel.textAlignment = NSTextAlignmentCenter; 19 | loadingLabel.text = NSLocalizedString(@"Shimmer", nil); 20 | shimmeringView.contentView = loadingLabel; 21 | 22 | // Start shimmering. 23 | shimmeringView.shimmering = YES; 24 | ``` 25 | 26 | There's also an example project. In the example, you can swipe horizontally and vertically to try various shimmering parameters, or tap to start or stop shimmering. (To build the example locally, you'll need to open `FBShimmering.xcworkpace` rather than the `.xcodeproj`.) 27 | 28 | ## Installation 29 | There are two options: 30 | 31 | 1. Shimmer is available as `Shimmer` in [Cocoapods](http://cocoapods.org). 32 | 2. Manually add the files into your Xcode project. Slightly simpler, but updates are also manual. 33 | 34 | Shimmer requires iOS 6 or later. 35 | 36 | ## How it works 37 | Shimmer uses the `-[CALayer mask]` property to enable shimmering, similar to what's described in John Harper's 2009 WWDC talk (unfortunately no longer online). Shimmer uses CoreAnimation's timing features to smoothly transition "on-beat" when starting and stopping the shimmer. 38 | 39 | ## Contributing 40 | See the CONTRIBUTING file for how to help out. 41 | 42 | ## License 43 | Shimmer is BSD-licensed. We also provide an additional patent grant. 44 | 45 | -------------------------------------------------------------------------------- /Pods/SwiftKeychain/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Yanko Dimitrov http://www.yankodimitrov.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Pods/SwiftKeychain/SwiftKeychain/Keychain/ArchiveKey.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ArchiveKey.swift 3 | // SwiftKeychain 4 | // 5 | // Created by Yanko Dimitrov on 11/13/14. 6 | // Copyright (c) 2014 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class ArchiveKey: BaseKey { 12 | 13 | public var object: NSCoding? 14 | 15 | private var secretData: NSData? { 16 | 17 | if let objectToArchive = object { 18 | 19 | return NSKeyedArchiver.archivedDataWithRootObject(objectToArchive) 20 | } 21 | 22 | return nil 23 | } 24 | 25 | /////////////////////////////////////////////////////// 26 | // MARK: - Initializers 27 | /////////////////////////////////////////////////////// 28 | 29 | public init(keyName: String, object: NSCoding? = nil) { 30 | 31 | self.object = object 32 | super.init(name: keyName) 33 | } 34 | 35 | /////////////////////////////////////////////////////// 36 | // MARK: - KeychainItem 37 | /////////////////////////////////////////////////////// 38 | 39 | public override func makeQueryForKeychain(keychain: KeychainService) -> KeychainQuery { 40 | 41 | let query = KeychainQuery(keychain: keychain) 42 | 43 | query.addField(kSecClass, withValue: kSecClassGenericPassword) 44 | query.addField(kSecAttrService, withValue: keychain.serviceName) 45 | query.addField(kSecAttrAccount, withValue: name) 46 | 47 | return query 48 | } 49 | 50 | public override func fieldsToLock() -> [NSObject: AnyObject] { 51 | 52 | var fields = [NSObject: AnyObject]() 53 | 54 | if let data = secretData { 55 | 56 | fields[kSecValueData as String] = data 57 | } 58 | 59 | return fields 60 | } 61 | 62 | public override func unlockData(data: NSData) { 63 | 64 | object = NSKeyedUnarchiver.unarchiveObjectWithData(data) as? NSCoding 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Pods/SwiftKeychain/SwiftKeychain/Keychain/GenericKey.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GenericKey.swift 3 | // SwiftKeychain 4 | // 5 | // Created by Yanko Dimitrov on 11/12/14. 6 | // Copyright (c) 2014 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class GenericKey: BaseKey { 12 | 13 | public var value: NSString? 14 | 15 | private var secretData: NSData? { 16 | 17 | return value?.dataUsingEncoding(NSUTF8StringEncoding) 18 | } 19 | 20 | /////////////////////////////////////////////////////// 21 | // MARK: - Initializers 22 | /////////////////////////////////////////////////////// 23 | 24 | public init(keyName: String, value: NSString? = nil) { 25 | 26 | self.value = value 27 | super.init(name: keyName) 28 | } 29 | 30 | /////////////////////////////////////////////////////// 31 | // MARK: - KeychainItem 32 | /////////////////////////////////////////////////////// 33 | 34 | public override func makeQueryForKeychain(keychain: KeychainService) -> KeychainQuery { 35 | 36 | let query = KeychainQuery(keychain: keychain) 37 | 38 | query.addField(kSecClass, withValue: kSecClassGenericPassword) 39 | query.addField(kSecAttrService, withValue: keychain.serviceName) 40 | query.addField(kSecAttrAccount, withValue: name) 41 | 42 | return query 43 | } 44 | 45 | public override func fieldsToLock() -> [NSObject: AnyObject] { 46 | 47 | var fields = [NSObject: AnyObject]() 48 | 49 | if let data = secretData { 50 | 51 | fields[kSecValueData as String] = data 52 | } 53 | 54 | return fields 55 | } 56 | 57 | public override func unlockData(data: NSData) { 58 | 59 | value = NSString(data: data, encoding: NSUTF8StringEncoding) 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Pods/SwiftKeychain/SwiftKeychain/Keychain/KeychainItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeychainItem.swift 3 | // SwiftKeychain 4 | // 5 | // Created by Yanko Dimitrov on 11/11/14. 6 | // Copyright (c) 2014 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol KeychainItem { 12 | 13 | var name: String {get} 14 | 15 | /** 16 | Make a KeychainQuery for the specified KeychainService 17 | 18 | :param: keychain - KeychainService instance 19 | */ 20 | func makeQueryForKeychain(keychain: KeychainService) -> KeychainQuery 21 | 22 | /** 23 | Returns a dictionary wtih the Keychain fields and their values 24 | that will be saved in the Keychain. 25 | 26 | :returns: dictionary 27 | */ 28 | func fieldsToLock() -> [NSObject: AnyObject] 29 | 30 | /** 31 | Decodes the obtained from the Keychain data 32 | 33 | :param: data - the NSData stored in the Keychain 34 | */ 35 | func unlockData(data: NSData) 36 | } 37 | 38 | 39 | /** 40 | BaseKey 41 | */ 42 | public class BaseKey: KeychainItem { 43 | 44 | private let keyName: String 45 | 46 | public var name: String { 47 | 48 | return keyName 49 | } 50 | 51 | public init(name: String) { 52 | 53 | keyName = name 54 | } 55 | 56 | public func makeQueryForKeychain(keychain: KeychainService) -> KeychainQuery { 57 | 58 | assertionFailure("should be overridden in subclass") 59 | 60 | return KeychainQuery(keychain: keychain) 61 | } 62 | 63 | public func fieldsToLock() -> [NSObject: AnyObject] { 64 | 65 | assertionFailure("should be overridden in subclass") 66 | 67 | return [NSObject: AnyObject]() 68 | } 69 | 70 | public func unlockData(data: NSData) { 71 | 72 | assertionFailure("should be overridden in subclass") 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Pods/SwiftKeychain/SwiftKeychain/Keychain/KeychainQuery.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeychainQuery.swift 3 | // SwiftKeychain 4 | // 5 | // Created by Yanko Dimitrov on 11/13/14. 6 | // Copyright (c) 2014 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class KeychainQuery { 12 | 13 | private lazy var queryFields = NSMutableDictionary() 14 | 15 | public var fields: NSDictionary { 16 | 17 | return queryFields 18 | } 19 | 20 | /////////////////////////////////////////////////////// 21 | // MARK: - Initializers 22 | /////////////////////////////////////////////////////// 23 | 24 | public init(keychain: KeychainService) { 25 | 26 | addField(kSecAttrAccessible, withValue: keychain.accessMode) 27 | 28 | if let accessGroup = keychain.accessGroup { 29 | 30 | addField(kSecAttrAccessGroup, withValue: accessGroup) 31 | } 32 | } 33 | 34 | /////////////////////////////////////////////////////// 35 | // MARK: - Methods 36 | /////////////////////////////////////////////////////// 37 | 38 | public func shouldReturnData() { 39 | 40 | addField(kSecReturnData, withValue: true) 41 | } 42 | 43 | public func addField(field: NSString, withValue value: AnyObject) { 44 | 45 | queryFields.setObject(value, forKey: field) 46 | } 47 | 48 | public func addFields(fields: [NSObject: AnyObject]) { 49 | 50 | queryFields.addEntriesFromDictionary(fields) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Pods/SwiftKeychain/SwiftKeychain/Keychain/KeychainService.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeychainService.swift 3 | // SwiftKeychain 4 | // 5 | // Created by Yanko Dimitrov on 11/11/14. 6 | // Copyright (c) 2014 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol KeychainService { 12 | 13 | var accessMode: NSString {get} 14 | var serviceName: String {get} 15 | var accessGroup: String? {get set} 16 | 17 | func add(key: KeychainItem) -> NSError? 18 | func update(key: KeychainItem) -> NSError? 19 | func remove(key: KeychainItem) -> NSError? 20 | func get(key: T) -> (item: T?, error: NSError?) 21 | } 22 | -------------------------------------------------------------------------------- /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/Target Support Files/Alamofire/Alamofire-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Alamofire : NSObject 3 | @end 4 | @implementation PodsDummy_Alamofire 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double AlamofireVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.modulemap: -------------------------------------------------------------------------------- 1 | framework module Alamofire { 2 | umbrella header "Alamofire-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Alamofire" "${PODS_ROOT}/Headers/Public" 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/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 | 3.1.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AlamofireImage/AlamofireImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AlamofireImage : NSObject 3 | @end 4 | @implementation PodsDummy_AlamofireImage 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AlamofireImage/AlamofireImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AlamofireImage/AlamofireImage-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double AlamofireImageVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char AlamofireImageVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AlamofireImage/AlamofireImage.modulemap: -------------------------------------------------------------------------------- 1 | framework module AlamofireImage { 2 | umbrella header "AlamofireImage-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AlamofireImage/AlamofireImage.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AlamofireImage" "${PODS_ROOT}/Headers/Public" 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/AlamofireImage/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.2.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/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 | 3.0.10 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/MJExtension-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MJExtension : NSObject 3 | @end 4 | @implementation PodsDummy_MJExtension 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/MJExtension-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/MJExtension-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "MJExtension.h" 4 | #import "MJExtensionConst.h" 5 | #import "MJFoundation.h" 6 | #import "MJProperty.h" 7 | #import "MJPropertyKey.h" 8 | #import "MJPropertyType.h" 9 | #import "NSObject+MJClass.h" 10 | #import "NSObject+MJCoding.h" 11 | #import "NSObject+MJKeyValue.h" 12 | #import "NSObject+MJProperty.h" 13 | #import "NSString+MJExtension.h" 14 | 15 | FOUNDATION_EXPORT double MJExtensionVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char MJExtensionVersionString[]; 17 | 18 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/MJExtension.modulemap: -------------------------------------------------------------------------------- 1 | framework module MJExtension { 2 | umbrella header "MJExtension-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/MJExtension.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MJExtension" "${PODS_ROOT}/Headers/Public" 3 | PODS_ROOT = ${SRCROOT} 4 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-UBERGuide/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-UBERGuide/Pods-UBERGuide-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_UBERGuide : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_UBERGuide 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-UBERGuide/Pods-UBERGuide-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_UBERGuideVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_UBERGuideVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-UBERGuide/Pods-UBERGuide.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/Alamofire.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/AlamofireImage.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MJExtension.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Shimmer.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SwiftKeychain.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SwiftyJSON.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/p2_OAuth2.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "AlamofireImage" -framework "MJExtension" -framework "Shimmer" -framework "SwiftKeychain" -framework "SwiftyJSON" -framework "p2_OAuth2" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-UBERGuide 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-UBERGuide/Pods-UBERGuide.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_UBERGuide { 2 | umbrella header "Pods-UBERGuide-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-UBERGuide/Pods-UBERGuide.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/Alamofire.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/AlamofireImage.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MJExtension.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Shimmer.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SwiftKeychain.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SwiftyJSON.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/p2_OAuth2.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "AlamofireImage" -framework "MJExtension" -framework "Shimmer" -framework "SwiftKeychain" -framework "SwiftyJSON" -framework "p2_OAuth2" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-UBERGuide 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Shimmer/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.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Shimmer/Shimmer-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Shimmer : NSObject 3 | @end 4 | @implementation PodsDummy_Shimmer 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Shimmer/Shimmer-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Shimmer/Shimmer-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "FBShimmering.h" 4 | #import "FBShimmeringLayer.h" 5 | #import "FBShimmeringView.h" 6 | 7 | FOUNDATION_EXPORT double ShimmerVersionNumber; 8 | FOUNDATION_EXPORT const unsigned char ShimmerVersionString[]; 9 | 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Shimmer/Shimmer.modulemap: -------------------------------------------------------------------------------- 1 | framework module Shimmer { 2 | umbrella header "Shimmer-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Shimmer/Shimmer.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Shimmer" "${PODS_ROOT}/Headers/Public" 3 | PODS_ROOT = ${SRCROOT} 4 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftKeychain/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 | 0.1.5 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftKeychain/SwiftKeychain-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SwiftKeychain : NSObject 3 | @end 4 | @implementation PodsDummy_SwiftKeychain 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftKeychain/SwiftKeychain-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftKeychain/SwiftKeychain-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double SwiftKeychainVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char SwiftKeychainVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftKeychain/SwiftKeychain.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftKeychain { 2 | umbrella header "SwiftKeychain-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftKeychain/SwiftKeychain.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SwiftKeychain" "${PODS_ROOT}/Headers/Public" 3 | OTHER_LDFLAGS = -framework "Security" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /Pods/Target Support Files/p2.OAuth2/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.1.3 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/p2.OAuth2/p2.OAuth2-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_p2_OAuth2 : NSObject 3 | @end 4 | @implementation PodsDummy_p2_OAuth2 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/p2.OAuth2/p2.OAuth2-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/p2.OAuth2/p2.OAuth2-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double p2_OAuth2VersionNumber; 5 | FOUNDATION_EXPORT const unsigned char p2_OAuth2VersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/p2.OAuth2/p2.OAuth2.modulemap: -------------------------------------------------------------------------------- 1 | framework module p2_OAuth2 { 2 | umbrella header "p2.OAuth2-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/p2.OAuth2/p2.OAuth2.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/p2.OAuth2" "${PODS_ROOT}/Headers/Public" 3 | OTHER_SWIFT_FLAGS = -DIMPORT_SWIFT_KEYCHAIN $(inherited) "-D" "COCOAPODS" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/p2.OAuth2/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2015 Pascal Pfiffner 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /Pods/p2.OAuth2/OAuth2/OAuth2AuthConfig.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OAuth2AuthConfig.swift 3 | // OAuth2 4 | // 5 | // Created by Pascal Pfiffner on 16/11/15. 6 | // Copyright © 2015 Pascal Pfiffner. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | 22 | /** 23 | Simple struct to hold client-side authorization configuration variables. 24 | */ 25 | public struct OAuth2AuthConfig 26 | { 27 | public struct UI { 28 | 29 | /// Title to propagate to views handled by OAuth2, such as OAuth2WebViewController. 30 | public var title: String? = nil 31 | 32 | // TODO: figure out a neat way to make this a UIBarButtonItem if compiled for iOS 33 | /// By assigning your own UIBarButtonItem (!) you can override the back button that is shown in the iOS embedded web view (does NOT apply to `SFSafariViewController`). 34 | public var backButton: AnyObject? = nil 35 | 36 | /// Starting with iOS 9, `SFSafariViewController` will be used for embedded authorization instead of our custom class. You can turn this off here. 37 | public var useSafariView = true 38 | 39 | /// Internally used to store the `SFSafariViewControllerDelegate` 40 | var safariViewDelegate: AnyObject? 41 | } 42 | 43 | /// Whether the receiver should use the request body instead of the Authorization header for the client secret. 44 | public var secretInBody: Bool = false 45 | 46 | /// Whether to use an embedded web view for authorization (true) or the OS browser (false, the default) 47 | public var authorizeEmbedded: Bool = false 48 | 49 | /// Context information for the authorization flow; e.g. the parent view controller to use on iOS. 50 | public var authorizeContext: AnyObject? = nil 51 | 52 | /// UI-specific configuration 53 | public var ui = UI() 54 | } 55 | 56 | -------------------------------------------------------------------------------- /Pods/p2.OAuth2/OAuth2/OAuth2ClientCredentials.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OAuth2ClientCredentials.swift 3 | // OAuth2 4 | // 5 | // Created by Pascal Pfiffner on 5/27/15. 6 | // Copyright 2015 Pascal Pfiffner 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | import Foundation 22 | 23 | 24 | /** 25 | Class to handle two-legged OAuth2 requests of the "client_credentials" type. 26 | */ 27 | public class OAuth2ClientCredentials: OAuth2 { 28 | 29 | public override class var grantType: String { 30 | return "client_credentials" 31 | } 32 | 33 | public override func authorize(params params: OAuth2StringDict? = nil, autoDismiss: Bool = true) { 34 | tryToObtainAccessTokenIfNeeded() { success in 35 | if success { 36 | self.didAuthorize(OAuth2JSON()) 37 | } 38 | else { 39 | self.logIfVerbose("No access token, requesting a new one") 40 | self.obtainAccessToken() { params, error in 41 | if let error = error { 42 | self.didFail(error) 43 | } 44 | else { 45 | self.didAuthorize(params ?? OAuth2JSON()) 46 | } 47 | } 48 | } 49 | } 50 | } 51 | 52 | /** 53 | Use the client credentials to retrieve a fresh access token. 54 | 55 | - parameter callback: The callback to call after the process has finished 56 | */ 57 | func obtainAccessToken(callback: ((params: OAuth2JSON?, error: ErrorType?) -> Void)) { 58 | do { 59 | let post = try tokenRequest() 60 | logIfVerbose("Requesting new access token from \(post.URL?.description)") 61 | 62 | performRequest(post) { data, status, error in 63 | do { 64 | guard let data = data else { 65 | throw error ?? OAuth2Error.NoDataInResponse 66 | } 67 | 68 | let params = try self.parseAccessTokenResponse(data) 69 | self.logIfVerbose("Did get access token [\(nil != self.clientConfig.accessToken)]") 70 | callback(params: params, error: nil) 71 | } 72 | catch let error { 73 | callback(params: nil, error: error) 74 | } 75 | } 76 | } 77 | catch let error { 78 | callback(params: nil, error: error) 79 | } 80 | } 81 | 82 | /** 83 | Creates a POST request with x-www-form-urlencoded body created from the supplied URL's query part. 84 | */ 85 | func tokenRequest() throws -> NSMutableURLRequest { 86 | guard let clientId = clientConfig.clientId where !clientId.isEmpty else { 87 | throw OAuth2Error.NoClientId 88 | } 89 | guard let secret = clientConfig.clientSecret else { 90 | throw OAuth2Error.NoClientSecret 91 | } 92 | 93 | let req = NSMutableURLRequest(URL: clientConfig.tokenURL ?? clientConfig.authorizeURL) 94 | req.HTTPMethod = "POST" 95 | req.setValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type") 96 | req.setValue("application/json", forHTTPHeaderField: "Accept") 97 | 98 | // check if scope is set 99 | var body = "grant_type=client_credentials" 100 | if let scope = clientConfig.scope { 101 | body += "&scope=\(scope.wwwFormURLEncodedString)" 102 | } 103 | if authConfig.secretInBody { 104 | logIfVerbose("Adding “client_id” and “client_secret” to request body") 105 | body += "&client_id=\(clientId.wwwFormURLEncodedString)&client_secret=\(secret.wwwFormURLEncodedString)" 106 | } 107 | 108 | // add Authorization header (if not in body) 109 | else { 110 | logIfVerbose("Adding “Authorization” header as “Basic client-key:client-secret”") 111 | let pw = "\(clientId.wwwFormURLEncodedString):\(secret.wwwFormURLEncodedString)" 112 | if let utf8 = pw.dataUsingEncoding(NSUTF8StringEncoding) { 113 | req.setValue("Basic \(utf8.base64EncodedStringWithOptions([]))", forHTTPHeaderField: "Authorization") 114 | } 115 | else { 116 | throw OAuth2Error.UTF8EncodeError 117 | } 118 | } 119 | req.HTTPBody = body.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: true) 120 | 121 | return req 122 | } 123 | } 124 | 125 | -------------------------------------------------------------------------------- /Pods/p2.OAuth2/OAuth2/OAuth2CodeGrantBasicAuth.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OAuth2CodeGrantBasicAuth.swift 3 | // OAuth2 4 | // 5 | // Created by Pascal Pfiffner on 3/27/15. 6 | // Copyright 2015 Pascal Pfiffner 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | import Foundation 22 | 23 | 24 | /** 25 | Enhancing the code grant flow by allowing to specify a specific "Basic xx" authorization header. 26 | 27 | This class allows you to manually set the "Authorization" header to a given string, as accepted in its `basicToken` property. It will 28 | override the superclasses automatic generation of an Authorization header if the client has a clientSecret, so you only need to use 29 | this subclass if you need a different header (this is different to version 1.2.3 and earlier of this framework). 30 | */ 31 | public class OAuth2CodeGrantBasicAuth: OAuth2CodeGrant 32 | { 33 | /// The full token string to be used in the authorization header. 34 | var basicToken: String? 35 | 36 | /** 37 | Adds support to override the basic Authorization header value by specifying: 38 | 39 | - basic: takes precedence over client_id and client_secret for the token request Authorization header 40 | */ 41 | public override init(settings: OAuth2JSON) { 42 | if let basic = settings["basic"] as? String { 43 | basicToken = basic 44 | } 45 | 46 | super.init(settings: settings) 47 | } 48 | 49 | /** 50 | Calls super's implementation to obtain a token request, then adds the custom "Basic" authorization header. 51 | */ 52 | override func tokenRequestWithURL(url: NSURL) throws -> NSMutableURLRequest { 53 | let req = try super.tokenRequestWithURL(url) 54 | if let basic = basicToken { 55 | logIfVerbose("Overriding “Basic” authorization header, as specified during client initialization") 56 | req.setValue("Basic \(basic)", forHTTPHeaderField: "Authorization") 57 | } 58 | else { 59 | logIfVerbose("Using extended code grant, but \"basicToken\" is not actually specified. Using standard code grant.") 60 | } 61 | 62 | return req 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /Pods/p2.OAuth2/OAuth2/OAuth2CodeGrantFacebook.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OAuth2CodeGrantFacebook.swift 3 | // OAuth2 4 | // 5 | // Created by Pascal Pfiffner on 2/1/15. 6 | // Copyright 2015 Pascal Pfiffner 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | import Foundation 22 | 23 | 24 | /** 25 | Facebook only returns an "access_token=xyz&..." string, no true JSON, hence we override `parseTokenExchangeResponse` 26 | and deal with the situation in a subclass. 27 | */ 28 | public class OAuth2CodeGrantFacebook: OAuth2CodeGrant 29 | { 30 | /** 31 | Facebook doesn't return JSON but a plain URL-query-like string. This override takes care of the situation and 32 | extracts the token from the response. 33 | */ 34 | override func parseAccessTokenResponse(data: NSData) throws -> OAuth2JSON { 35 | if let str = NSString(data: data, encoding: NSUTF8StringEncoding) as? String { 36 | let query = self.dynamicType.paramsFromQuery(str) 37 | return try parseAccessTokenResponse(query) 38 | } 39 | throw OAuth2Error.ResponseError("Invalid response data from token request") 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /Pods/p2.OAuth2/OAuth2/OAuth2ImplicitGrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OAuth2ImplicitGrant.swift 3 | // OAuth2 4 | // 5 | // Created by Pascal Pfiffner on 6/9/14. 6 | // Copyright 2014 Pascal Pfiffner 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | import Foundation 22 | 23 | 24 | /** 25 | Class to handle OAuth2 requests for public clients, such as distributed Mac/iOS Apps. 26 | */ 27 | public class OAuth2ImplicitGrant: OAuth2 { 28 | 29 | override public class var grantType: String { 30 | return "implicit" 31 | } 32 | 33 | override public class var responseType: String? { 34 | return "token" 35 | } 36 | 37 | override public func handleRedirectURL(redirect: NSURL) { 38 | logIfVerbose("Handling redirect URL \(redirect.description)") 39 | do { 40 | // token should be in the URL fragment 41 | let comp = NSURLComponents(URL: redirect, resolvingAgainstBaseURL: true) 42 | guard let fragment = comp?.percentEncodedFragment where fragment.characters.count > 0 else { 43 | throw OAuth2Error.InvalidRedirectURL(redirect.absoluteString) 44 | } 45 | 46 | let params = OAuth2ImplicitGrant.paramsFromQuery(fragment) 47 | let dict = try parseAccessTokenResponse(params) 48 | logIfVerbose("Successfully extracted access token") 49 | didAuthorize(dict) 50 | } 51 | catch let error { 52 | didFail(error) 53 | } 54 | } 55 | 56 | override public func assureAccessTokenParamsAreValid(params: OAuth2JSON) throws { 57 | try assureMatchesState(params) 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /Pods/p2.OAuth2/OAuth2/OAuth2Request.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OAuth2Request.swift 3 | // OAuth2 4 | // 5 | // Created by Pascal Pfiffner on 6/24/14. 6 | // Copyright 2014 Pascal Pfiffner 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | import Foundation 22 | 23 | 24 | /** 25 | A request that can be signed by an OAuth2 instance. 26 | */ 27 | public class OAuth2Request: NSMutableURLRequest 28 | { 29 | /** 30 | Convenience initalizer to instantiate and sign a mutable URL request in one go. 31 | */ 32 | convenience init(URL: NSURL!, oauth: OAuth2, cachePolicy: NSURLRequestCachePolicy, timeoutInterval: NSTimeInterval) { 33 | self.init(URL: URL, cachePolicy: cachePolicy, timeoutInterval: timeoutInterval) 34 | self.sign(oauth) 35 | } 36 | 37 | /** 38 | Signs the receiver by setting its "Authorization" header to "Bearer {token}". 39 | 40 | Will log an error if the OAuth2 instance does not have an access token! 41 | */ 42 | func sign(oauth: OAuth2) { 43 | if let access = oauth.clientConfig.accessToken where !access.isEmpty { 44 | self.setValue("Bearer \(access)", forHTTPHeaderField: "Authorization") 45 | } 46 | else { 47 | NSLog("Cannot sign request, access token is empty") 48 | } 49 | } 50 | } 51 | 52 | 53 | /** 54 | An NSURLSession delegate that allows you to use self-signed SSL certificates. 55 | 56 | Doing so is a REALLY BAD IDEA, even in development environments where you can use real, free certificates that are valid a few months. 57 | Still, sometimes you'll have to do this so this class is provided, but DO NOT SUBMIT your app using self-signed SSL certs to the App 58 | Store. You have been warned! 59 | */ 60 | public class OAuth2DebugURLSessionDelegate: NSObject, NSURLSessionDelegate 61 | { 62 | /// The host to allow a self-signed SSL certificate for. 63 | let host: String 64 | 65 | public init(host: String) { 66 | self.host = host 67 | } 68 | 69 | public func URLSession(session: NSURLSession, didReceiveChallenge challenge: NSURLAuthenticationChallenge, 70 | completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) { 71 | if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { 72 | if challenge.protectionSpace.host == host { 73 | let credential = NSURLCredential(forTrust: challenge.protectionSpace.serverTrust!) 74 | completionHandler(.UseCredential, credential) 75 | return 76 | } 77 | } 78 | completionHandler(.CancelAuthenticationChallenge, nil) 79 | } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /Pods/p2.OAuth2/OAuth2/extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // extensions.swift 3 | // OAuth2 4 | // 5 | // Created by Pascal Pfiffner on 6/6/14. 6 | // Copyright 2014 Pascal Pfiffner 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | import Foundation 22 | 23 | 24 | extension NSHTTPURLResponse 25 | { 26 | /// A localized string explaining the current `statusCode`. 27 | public var statusString: String { 28 | get { 29 | return NSHTTPURLResponse.localizedStringForStatusCode(self.statusCode) 30 | } 31 | } 32 | } 33 | 34 | 35 | extension String 36 | { 37 | private static var wwwFormURLPlusSpaceCharacterSet: NSCharacterSet = NSMutableCharacterSet.wwwFormURLPlusSpaceCharacterSet() 38 | 39 | /// Encodes a string to become x-www-form-urlencoded; the space is encoded as plus sign (+). 40 | var wwwFormURLEncodedString: String { 41 | let characterSet = String.wwwFormURLPlusSpaceCharacterSet 42 | return (stringByAddingPercentEncodingWithAllowedCharacters(characterSet) ?? "").stringByReplacingOccurrencesOfString(" ", withString: "+") 43 | } 44 | 45 | /// Decodes a percent-encoded string and converts the plus sign into a space. 46 | var wwwFormURLDecodedString: String { 47 | let rep = stringByReplacingOccurrencesOfString("+", withString: " ") 48 | return rep.stringByRemovingPercentEncoding ?? rep 49 | } 50 | } 51 | 52 | 53 | extension NSMutableCharacterSet 54 | { 55 | /** 56 | Return the character set that does NOT need percent-encoding for x-www-form-urlencoded requests INCLUDING SPACE. 57 | YOU are responsible for replacing spaces " " with the plus sign "+". 58 | 59 | RFC3986 and the W3C spec are not entirely consistent, we're using W3C's spec which says: 60 | http://www.w3.org/TR/html5/forms.html#application/x-www-form-urlencoded-encoding-algorithm 61 | 62 | > If the byte is 0x20 (U+0020 SPACE if interpreted as ASCII): 63 | > - Replace the byte with a single 0x2B byte ("+" (U+002B) character if interpreted as ASCII). 64 | > If the byte is in the range 0x2A (*), 0x2D (-), 0x2E (.), 0x30 to 0x39 (0-9), 0x41 to 0x5A (A-Z), 0x5F (_), 65 | > 0x61 to 0x7A (a-z) 66 | > - Leave byte as-is 67 | */ 68 | class func wwwFormURLPlusSpaceCharacterSet() -> NSMutableCharacterSet { 69 | let set = NSMutableCharacterSet.alphanumericCharacterSet() 70 | set.addCharactersInString("-._* ") 71 | return set 72 | } 73 | } 74 | 75 | 76 | extension NSURLRequest { 77 | 78 | /** Print the requests's headers and body to stdout. */ 79 | public func oauth2_print() { 80 | print("---") 81 | print("HTTP/1.1 \(HTTPMethod) \(URL?.description ?? "/")") 82 | allHTTPHeaderFields?.forEach() { print("\($0): \($1)") } 83 | print("") 84 | if let data = HTTPBody, let body = NSString(data: data, encoding: NSUTF8StringEncoding) { 85 | print(body as String) 86 | } 87 | print("---") 88 | } 89 | } 90 | 91 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Smart Traveller 2 | 3 | ![image](https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/master/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-60%402x.png) 4 | 5 | ## Intro 6 | 7 | It's the project we did for Uber Hackathon China 2016. This is the repo for iOS client. 8 | Using swift and Objective-C. 9 | 10 | The project code is 'UberGuide', but since the product name can not contain anything related with Uber, so we name it 'Smart Traveller'. 11 | 12 | ## What's this for? 13 | 14 | This idea comes from some single foreign travellers across the world. Based on Uber's internationality, when we try to explore the culture and something else with a new place we've never been before, Uber can help you connect with the city very convenient and comfortable. Without searching for a map in your own language and trying to understand it, you only need to choose the aspect which you want to know end explore about the place you are, and press the beging button directly, then Uber will come for you, no matter where you are, even if you can't communicate with the driver, Uber can find you! 15 | 16 | So we build a simple App based on this idea, in order to create a better user experience for travellers all around the world, giving them simple and comfortable way to explore about the city. Users will constantly receive messages about the place they are passing by on the Uber, they don't know where exactly they are heading for, only if they get close to the destination will we tell them what the place is and all the detailed information about it. 17 | 18 | Exploration of a city is what Uber API can bring us, more amazing, more convenient, more comfortable. 19 | 20 | ## Tech Details 21 | 22 | The client is written in Swift and Objective-C, using CocoaPod to manage third party services. Some frameworks have huge files, so we added it into the gitignore and you should download and import them into the project manually. `AVOSCloud.framework` [Download here](https://leancloud.cn/docs/sdk_down.html). Only if you add these two static framework can you build the project and build the bridge-file between Swift and Objective-C. 23 | 24 | ## ScreenShots 25 | 26 | img 27 | img 28 | img 29 | img 30 | img 31 | img 32 | img 33 | img 34 | img 35 | img 36 | img -------------------------------------------------------------------------------- /ScreenShots/IMG_0458.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/ScreenShots/IMG_0458.PNG -------------------------------------------------------------------------------- /ScreenShots/IMG_0459.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/ScreenShots/IMG_0459.PNG -------------------------------------------------------------------------------- /ScreenShots/IMG_0460.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/ScreenShots/IMG_0460.PNG -------------------------------------------------------------------------------- /ScreenShots/IMG_0461.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/ScreenShots/IMG_0461.PNG -------------------------------------------------------------------------------- /ScreenShots/IMG_0462.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/ScreenShots/IMG_0462.PNG -------------------------------------------------------------------------------- /ScreenShots/IMG_0463.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/ScreenShots/IMG_0463.PNG -------------------------------------------------------------------------------- /ScreenShots/IMG_0464.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/ScreenShots/IMG_0464.PNG -------------------------------------------------------------------------------- /ScreenShots/IMG_0465.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/ScreenShots/IMG_0465.PNG -------------------------------------------------------------------------------- /ScreenShots/IMG_0466.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/ScreenShots/IMG_0466.PNG -------------------------------------------------------------------------------- /ScreenShots/IMG_0467.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/ScreenShots/IMG_0467.PNG -------------------------------------------------------------------------------- /ScreenShots/IMG_0468.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/ScreenShots/IMG_0468.PNG -------------------------------------------------------------------------------- /UBERGuide.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /UBERGuide.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /UBERGuide/ARFrontView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ARFrontView.h 3 | // Renaissance 4 | // 5 | // Created by Fincher Justin on 15/12/21. 6 | // Copyright © 2015年 Fincher Justin. All rights reserved. 7 | // 8 | 9 | #import 10 | #include 11 | #import 12 | #import "ARNode.h" 13 | @import SceneKit; 14 | @import GLKit; 15 | 16 | @protocol ARDataSourceDelegate 17 | @required 18 | - (ARNode *)ARFrontView:(SCNScene *)ARScene 19 | nodeForRowAtIndexPath:(NSIndexPath *)indexPath; 20 | 21 | - (NSInteger)ARFrontView:(SCNScene *)ARScene 22 | numberOfRowsInSection:(NSInteger)section; 23 | 24 | - (NSInteger)numberOfSectionsInARScene:(SCNScene *)ARScene; 25 | 26 | @optional 27 | 28 | 29 | @end 30 | 31 | 32 | @interface ARFrontView : SCNView 33 | 34 | @property (nonatomic, weak) id dataSource; 35 | @property (nonatomic,strong) SCNScene *ARScene; 36 | @property (nonatomic, strong) CMMotionManager *motionManager; 37 | 38 | @property (nonatomic,strong) CMAttitude *playerAttitude; 39 | 40 | @property (nonatomic,strong) SCNNode *cameraNode; 41 | @property (nonatomic,strong) NSMutableArray *ARNodeArray; 42 | 43 | 44 | - (void)reloadData; 45 | - (id)initWithFrame:(CGRect)frame dataSource:(id)dataSource; 46 | 47 | 48 | @property (nonatomic,strong) SCNNode *mapNode; 49 | @property (nonatomic,strong) SCNMaterial *mapNodeMaterial; 50 | 51 | @end -------------------------------------------------------------------------------- /UBERGuide/ARNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // ARNode.h 3 | // Renaissance 4 | // 5 | // Created by Fincher Justin on 15/12/22. 6 | // Copyright © 2015年 Fincher Justin. All rights reserved. 7 | // 8 | @import CoreLocation; 9 | #import 10 | 11 | @interface ARNode : SCNNode 12 | 13 | @property (nonatomic) CLLocation *nodeLocation; 14 | @property (nonatomic) CLLocation *playerLocation; 15 | 16 | @property (nonatomic) UIView *ARView; 17 | 18 | @property (nonatomic) SCNPlane *planeGeometry; 19 | 20 | + (ARNode *)nodeWithGeometry:(SCNGeometry *)geometry; 21 | 22 | - (void)setNodeWithARView:(UIView *)view 23 | nodeLocation:(CLLocation *)nodeCLLocation 24 | playerLocation:(CLLocation *)playerCLLocation; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /UBERGuide/ARNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // ARNode.m 3 | // Renaissance 4 | // 5 | // Created by Fincher Justin on 15/12/22. 6 | // Copyright © 2015年 Fincher Justin. All rights reserved. 7 | // 8 | 9 | 10 | #import "ARNode.h" 11 | 12 | @implementation ARNode 13 | @synthesize ARView,planeGeometry; 14 | @synthesize nodeLocation,playerLocation; 15 | 16 | 17 | - (void)setNodeWithARView:(UIView *)view 18 | nodeLocation:(CLLocation *)nodeCLLocation 19 | playerLocation:(CLLocation *)playerCLLocation 20 | { 21 | NSLog(@"setNodeWithARView"); 22 | self.ARView = view; 23 | self.nodeLocation = nodeCLLocation; 24 | self.playerLocation = playerCLLocation; 25 | planeGeometry = [SCNPlane planeWithWidth:view.bounds.size.width height:view.bounds.size.height]; 26 | planeGeometry.cornerRadius = 5; 27 | self.geometry = planeGeometry; 28 | SCNMaterial *planeMaterial = [SCNMaterial material]; 29 | planeMaterial.diffuse.contents = [self imageWithView:ARView]; 30 | planeGeometry.materials = @[planeMaterial]; 31 | planeMaterial.doubleSided = YES; 32 | 33 | 34 | self.scale = SCNVector3Make(-1, 1, 1); 35 | 36 | CLLocationDistance lineMeters = [nodeLocation distanceFromLocation:playerLocation]; 37 | 38 | // ^ latitude 39 | // | 40 | // * ---- + 41 | // | l1 | node 42 | // | | 43 | // | | 44 | // + ---- * ---> longitudes 45 | // player l2 46 | CLLocation * locationOne = [[CLLocation alloc] initWithLatitude:nodeLocation.coordinate.latitude longitude:playerLocation.coordinate.longitude]; 47 | CLLocation * locationTwo = [[CLLocation alloc] initWithLatitude:playerLocation.coordinate.latitude longitude:nodeLocation.coordinate.longitude]; 48 | 49 | CLLocationDistance longitudeDistance = [playerLocation distanceFromLocation:locationTwo]; 50 | CLLocationDistance latitudeDistance = [playerLocation distanceFromLocation:locationOne]; 51 | 52 | double longitudePosition,latitudePosition; 53 | if ((nodeLocation.coordinate.longitude - playerLocation.coordinate.longitude)>0 || (nodeLocation.coordinate.longitude - playerLocation.coordinate.longitude)<180) 54 | { 55 | longitudePosition = longitudeDistance; 56 | }else 57 | { 58 | longitudePosition = -longitudeDistance; 59 | } 60 | 61 | if ((nodeLocation.coordinate.latitude - playerLocation.coordinate.latitude)>0) 62 | { 63 | latitudePosition = latitudeDistance; 64 | }else 65 | { 66 | latitudePosition = -latitudeDistance; 67 | } 68 | 69 | 70 | //NSLog(@"longitudeDistance : %f latitudeDistance : %f",longitudePosition,latitudePosition); 71 | 72 | self.position = SCNVector3Make(longitudePosition, lineMeters/2, latitudePosition); 73 | 74 | //self.position = SCNVector3Make(latitudePosition, lineMeters / 6, longitudePosition); 75 | 76 | SCNNode *virtualCameraNode = [SCNNode node]; 77 | virtualCameraNode.position = SCNVector3Make(0, 0, 0); 78 | SCNLookAtConstraint * CONSTRAINT = [SCNLookAtConstraint lookAtConstraintWithTarget:virtualCameraNode]; 79 | CONSTRAINT.gimbalLockEnabled = YES; 80 | self.constraints = @[CONSTRAINT]; 81 | } 82 | 83 | - (UIImage *) imageWithView:(UIView *)view 84 | { 85 | UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 0.0); 86 | [view.layer renderInContext:UIGraphicsGetCurrentContext()]; 87 | 88 | UIImage * img = UIGraphicsGetImageFromCurrentImageContext(); 89 | 90 | UIGraphicsEndImageContext(); 91 | 92 | return img; 93 | } 94 | 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /UBERGuide/ARViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ARViewController.h 3 | // Renaissance 4 | // 5 | // Created by Fincher Justin on 15/12/21. 6 | // Copyright © 2015年 Fincher Justin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ARFrontView.h" 11 | #import "GeoJSON_Root.h" 12 | 13 | @interface ARViewController : UIViewController 14 | 15 | @property (nonatomic,strong) ARFrontView *ARView; 16 | @property (nonatomic,strong) GeoJSON_Root *ARdata; 17 | @property (nonatomic,strong) CLLocation * playerLocation; 18 | 19 | @end 20 | 21 | 22 | -------------------------------------------------------------------------------- /UBERGuide/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | @UIApplicationMain 4 | class AppDelegate: UIResponder, UIApplicationDelegate { 5 | 6 | var window: UIWindow? 7 | 8 | 9 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 10 | // Override point for customization after application launch. 11 | AVOSCloud.setApplicationId("2z1W2xH4ycKwIhLYWHktun5v-gzGzoHsz", clientKey: "V6EKIfWHr6pW7e3dFk57WFn2") 12 | LocationManager.sharedInstance().startCapture() 13 | 14 | return true 15 | } 16 | 17 | func applicationWillResignActive(application: UIApplication) { 18 | // 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. 19 | // 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. 20 | } 21 | 22 | func applicationDidEnterBackground(application: UIApplication) { 23 | // 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. 24 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 25 | } 26 | 27 | func applicationWillEnterForeground(application: UIApplication) { 28 | // 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. 29 | } 30 | 31 | func applicationDidBecomeActive(application: UIApplication) { 32 | // 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. 33 | } 34 | 35 | func applicationWillTerminate(application: UIApplication) { 36 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 37 | } 38 | 39 | func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool { 40 | var splitUrl = url.absoluteString.componentsSeparatedByString(":") 41 | 42 | if splitUrl[0] == "uberguide" { 43 | print("received redirect") 44 | try! UberAuth.sharedInstance.oauth2?.handleRedirectURL(url) 45 | } 46 | 47 | return true 48 | } 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/1.imageset/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/1.imageset/1.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/1.imageset/1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/1.imageset/1@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/1.imageset/1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/1.imageset/1@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "1@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "1@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/2.imageset/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/2.imageset/2.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/2.imageset/2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/2.imageset/2@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/2.imageset/2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/2.imageset/2@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "2@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "2@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/3.imageset/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/3.imageset/3.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/3.imageset/3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/3.imageset/3@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/3.imageset/3@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/3.imageset/3@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "3.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "3@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "3@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/4.imageset/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/4.imageset/4.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/4.imageset/4@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/4.imageset/4@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/4.imageset/4@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/4.imageset/4@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "4.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "4@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "4@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/5.imageset/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/5.imageset/5.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/5.imageset/5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/5.imageset/5@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/5.imageset/5@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/5.imageset/5@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "5.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "5@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "5@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/6.imageset/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/6.imageset/6.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/6.imageset/6@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/6.imageset/6@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/6.imageset/6@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/6.imageset/6@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/6.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "6.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "6@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "6@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/7.imageset/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/7.imageset/7.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/7.imageset/7@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/7.imageset/7@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/7.imageset/7@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/7.imageset/7@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/7.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "7.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "7@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "7@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/8.imageset/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/8.imageset/8.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/8.imageset/8@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/8.imageset/8@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/8.imageset/8@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/8.imageset/8@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/8.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "8.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "8@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "8@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/9.imageset/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/9.imageset/9.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/9.imageset/9@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/9.imageset/9@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/9.imageset/9@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/9.imageset/9@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/9.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "9.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "9@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "9@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-Small@2x-1.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-Small@3x-1.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-Spotlight-40@2x-1.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-Spotlight-40@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "57x57", 29 | "idiom" : "iphone", 30 | "filename" : "Icon.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "57x57", 35 | "idiom" : "iphone", 36 | "filename" : "Icon@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-60@3x-1.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "29x29", 53 | "idiom" : "ipad", 54 | "filename" : "Icon-Small.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "29x29", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-Small@2x-2.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "40x40", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-Spotlight-40.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "40x40", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-Spotlight-40@2x.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "76x76", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-76.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "76x76", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-76@2x.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "idiom" : "ipad", 89 | "size" : "83.5x83.5", 90 | "scale" : "2x" 91 | }, 92 | { 93 | "size" : "60x60", 94 | "idiom" : "car", 95 | "filename" : "Icon-60@3x.png", 96 | "scale" : "3x" 97 | }, 98 | { 99 | "size" : "29x29", 100 | "idiom" : "watch", 101 | "filename" : "Icon-Small@2x.png", 102 | "role" : "companionSettings", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "29x29", 107 | "idiom" : "watch", 108 | "filename" : "Icon-Small@3x.png", 109 | "role" : "companionSettings", 110 | "scale" : "3x" 111 | } 112 | ], 113 | "info" : { 114 | "version" : 1, 115 | "author" : "xcode" 116 | } 117 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-60@3x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-60@3x-1.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Small.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x-2.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x-1.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x-1.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/AppIcon.appiconset/Icon@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Brand Assets.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "minimum-system-version" : "7.0", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "orientation" : "portrait", 11 | "idiom" : "iphone", 12 | "minimum-system-version" : "7.0", 13 | "subtype" : "retina4", 14 | "scale" : "2x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Car Body.imageset/Car Body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/Car Body.imageset/Car Body.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Car Body.imageset/Car Body@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/Car Body.imageset/Car Body@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Car Body.imageset/Car Body@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/Car Body.imageset/Car Body@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Car Body.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Car Body.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Car Body@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "Car Body@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/MapBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "fuck.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "fuck副本 2.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "fuck副本.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/MapBackground.imageset/fuck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/MapBackground.imageset/fuck.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/MapBackground.imageset/fuck副本 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/MapBackground.imageset/fuck副本 2.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/MapBackground.imageset/fuck副本.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/MapBackground.imageset/fuck副本.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Person.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Person.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Person@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "Person@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Person.imageset/Person.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/Person.imageset/Person.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Person.imageset/Person@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/Person.imageset/Person@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Person.imageset/Person@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/Person.imageset/Person@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/RideProgressBackground.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" : "WeChat_1452958258.jpeg", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/RideProgressBackground.imageset/WeChat_1452958258.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/RideProgressBackground.imageset/WeChat_1452958258.jpeg -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Road.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Road.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Road@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "Road@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Road.imageset/Road.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/Road.imageset/Road.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Road.imageset/Road@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/Road.imageset/Road@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Road.imageset/Road@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/Road.imageset/Road@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Tire.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Tire Left.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Tire Left@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "Tire Left@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Tire.imageset/Tire Left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/Tire.imageset/Tire Left.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Tire.imageset/Tire Left@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/Tire.imageset/Tire Left@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/Tire.imageset/Tire Left@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/Tire.imageset/Tire Left@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/haha.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "haha.jpg", 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 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/haha.imageset/haha.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/haha.imageset/haha.jpg -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/icon_ plate.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_ plate.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon_ plate@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "icon_ plate@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/icon_ plate.imageset/icon_ plate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/icon_ plate.imageset/icon_ plate.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/icon_ plate.imageset/icon_ plate@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/icon_ plate.imageset/icon_ plate@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/icon_ plate.imageset/icon_ plate@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/icon_ plate.imageset/icon_ plate@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/icon_call.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_call.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon_call@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "icon_call@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/icon_call.imageset/icon_call.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/icon_call.imageset/icon_call.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/icon_call.imageset/icon_call@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/icon_call.imageset/icon_call@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/icon_call.imageset/icon_call@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/icon_call.imageset/icon_call@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/icon_car.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_car.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon_car@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "icon_car@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/icon_car.imageset/icon_car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/icon_car.imageset/icon_car.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/icon_car.imageset/icon_car@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/icon_car.imageset/icon_car@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/icon_car.imageset/icon_car@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/icon_car.imageset/icon_car@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/rateView.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "rateView.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "rateView@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "rateView@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/rateView.imageset/rateView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/rateView.imageset/rateView.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/rateView.imageset/rateView@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/rateView.imageset/rateView@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/rateView.imageset/rateView@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/rateView.imageset/rateView@3x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/welcomeBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Line + Road + CCTV.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Line + Road + CCTV@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "Line + Road + CCTV@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/welcomeBackground.imageset/Line + Road + CCTV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/welcomeBackground.imageset/Line + Road + CCTV.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/welcomeBackground.imageset/Line + Road + CCTV@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/welcomeBackground.imageset/Line + Road + CCTV@2x.png -------------------------------------------------------------------------------- /UBERGuide/Assets.xcassets/welcomeBackground.imageset/Line + Road + CCTV@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hACKbUSTER/UberGuide-iOS/6e9d145f8688498fdd77288dc275f51560d5dc68/UBERGuide/Assets.xcassets/welcomeBackground.imageset/Line + Road + CCTV@3x.png -------------------------------------------------------------------------------- /UBERGuide/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /UBERGuide/CityWelcomeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CityWelcomeViewController.h 3 | // UBERGuide 4 | // 5 | // Created by Fincher Justin on 16/1/16. 6 | // Copyright © 2016年 hACKbUSTER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CityWelcomeViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /UBERGuide/CityWelcomeViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CityWelcomeViewController.m 3 | // UBERGuide 4 | // 5 | // Created by Fincher Justin on 16/1/16. 6 | // Copyright © 2016年 hACKbUSTER. All rights reserved. 7 | // 8 | 9 | #import "CityWelcomeViewController.h" 10 | #import "LookForRideViewController.h" 11 | #import "LocationManager.h" 12 | 13 | @interface CityWelcomeViewController () 14 | @property (weak, nonatomic) IBOutlet UILabel *cityLabel; 15 | @property (strong, nonatomic) NSTimer *timer; 16 | @end 17 | 18 | @implementation CityWelcomeViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | // Do any additional setup after loading the view. 23 | 24 | _timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(setCityLabelText) userInfo:nil repeats:YES]; 25 | } 26 | 27 | - (void)setCityLabelText 28 | { 29 | if ([LocationManager sharedInstance].currentLocationName) 30 | { 31 | NSLog(@"[LocationManager sharedInstance].currentLocationName"); 32 | _cityLabel.text = [LocationManager sharedInstance].currentLocationName; 33 | [_timer invalidate]; 34 | } 35 | } 36 | - (IBAction)beginExploringButtonPressed:(id)sender { 37 | 38 | } 39 | 40 | - (void)didReceiveMemoryWarning { 41 | [super didReceiveMemoryWarning]; 42 | // Dispose of any resources that can be recreated. 43 | } 44 | 45 | /* 46 | #pragma mark - Navigation 47 | 48 | // In a storyboard-based application, you will often want to do a little preparation before navigation 49 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 50 | // Get the new view controller using [segue destinationViewController]. 51 | // Pass the selected object to the new view controller. 52 | } 53 | */ 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /UBERGuide/Constants.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | struct Constants { 4 | static let uberClientId = "4Pm0nE1Hmz9_cFKw1RhD4xMcW_nCYUK4" 5 | static let uberClientSecret = "EZpaS6Sl_fjdeNVbedBctJpf_JePO34ZArJQmk0Z" 6 | } 7 | -------------------------------------------------------------------------------- /UBERGuide/Extensions.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension String { 4 | func heightWithConstrainedWidth(width: CGFloat, font: UIFont) -> CGFloat { 5 | let constraintRect = CGSize(width: width, height: CGFloat.max) 6 | 7 | let paragraph = NSMutableParagraphStyle() 8 | paragraph.lineBreakMode = .ByWordWrapping 9 | let boundingBox = self.boundingRectWithSize(constraintRect, options: NSStringDrawingOptions.UsesLineFragmentOrigin, attributes: 10 | [NSFontAttributeName: font, NSParagraphStyleAttributeName: paragraph], context: nil) 11 | 12 | return boundingBox.height 13 | } 14 | } -------------------------------------------------------------------------------- /UBERGuide/GeoJSON_Geometry.h: -------------------------------------------------------------------------------- 1 | // 2 | // GeoJSON_Geometry.h 3 | // Renaissance 4 | // 5 | // Created by Fincher Justin on 15/12/23. 6 | // Copyright © 2015年 Fincher Justin. All rights reserved. 7 | // 8 | 9 | #import 10 | @import CoreLocation; 11 | 12 | @protocol GeoJSON_Geometry 13 | 14 | @end 15 | 16 | @interface GeoJSON_Geometry : NSObject 17 | 18 | @property (copy, nonatomic) NSString *type; 19 | @property (nonatomic) NSMutableArray *coordinates; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /UBERGuide/GeoJSON_Geometry.m: -------------------------------------------------------------------------------- 1 | // 2 | // GeoJSON_Geometry.m 3 | // Renaissance 4 | // 5 | // Created by Fincher Justin on 15/12/23. 6 | // Copyright © 2015年 Fincher Justin. All rights reserved. 7 | // 8 | 9 | #import "GeoJSON_Geometry.h" 10 | 11 | @implementation GeoJSON_Geometry 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /UBERGuide/GeoJSON_Index.h: -------------------------------------------------------------------------------- 1 | // 2 | // GeoJSON_Index.h 3 | // Renaissance 4 | // 5 | // Created by Fincher Justin on 15/12/23. 6 | // Copyright © 2015年 Fincher Justin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "GeoJSON_Geometry.h" 11 | #include "GeoJSON_Properties.h" 12 | 13 | @protocol GeoJSON_Index 14 | 15 | @end 16 | 17 | 18 | @interface GeoJSON_Index : NSObject 19 | 20 | @property (copy, nonatomic) NSString *type; 21 | @property (strong,nonatomic) GeoJSON_Properties *properties; 22 | @property (strong,nonatomic) GeoJSON_Geometry *geometry; 23 | @end 24 | -------------------------------------------------------------------------------- /UBERGuide/GeoJSON_Index.m: -------------------------------------------------------------------------------- 1 | // 2 | // GeoJSON_Index.m 3 | // Renaissance 4 | // 5 | // Created by Fincher Justin on 15/12/23. 6 | // Copyright © 2015年 Fincher Justin. All rights reserved. 7 | // 8 | 9 | #import "GeoJSON_Index.h" 10 | 11 | @implementation GeoJSON_Index 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /UBERGuide/GeoJSON_Properties.h: -------------------------------------------------------------------------------- 1 | // 2 | // GeoJSON_Properties.h 3 | // Renaissance 4 | // 5 | // Created by Fincher Justin on 15/12/24. 6 | // Copyright © 2015年 Fincher Justin. All rights reserved. 7 | // 8 | 9 | #import 10 | @import CoreLocation; 11 | 12 | @protocol GeoJSON_Properties 13 | 14 | @end 15 | @interface GeoJSON_Properties : NSObject 16 | @property (copy, nonatomic) NSString *name; 17 | @property (copy, nonatomic) NSArray *tags; 18 | @end 19 | -------------------------------------------------------------------------------- /UBERGuide/GeoJSON_Properties.m: -------------------------------------------------------------------------------- 1 | // 2 | // GeoJSON_Properties.m 3 | // Renaissance 4 | // 5 | // Created by Fincher Justin on 15/12/24. 6 | // Copyright © 2015年 Fincher Justin. All rights reserved. 7 | // 8 | 9 | #import "GeoJSON_Properties.h" 10 | 11 | @implementation GeoJSON_Properties 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /UBERGuide/GeoJSON_Root.h: -------------------------------------------------------------------------------- 1 | // 2 | // GeoJSON_Root.h 3 | // Renaissance 4 | // 5 | // Created by Fincher Justin on 15/12/23. 6 | // Copyright © 2015年 Fincher Justin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "GeoJSON_Index.h" 11 | 12 | 13 | @interface GeoJSON_Root : NSObject 14 | 15 | @property (copy, nonatomic) NSString *type; 16 | @property (nonatomic,strong) NSMutableArray *features; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /UBERGuide/GeoJSON_Root.m: -------------------------------------------------------------------------------- 1 | // 2 | // GeoJSON_Root.m 3 | // Renaissance 4 | // 5 | // Created by Fincher Justin on 15/12/23. 6 | // Copyright © 2015年 Fincher Justin. All rights reserved. 7 | // 8 | 9 | #import "GeoJSON_Root.h" 10 | 11 | @implementation GeoJSON_Root 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /UBERGuide/HelloSceneViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HelloSceneViewController.h 3 | // UBERGuide 4 | // 5 | // Created by Fincher Justin on 16/1/16. 6 | // Copyright © 2016年 hACKbUSTER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HelloSceneViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /UBERGuide/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Smart Traveler 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIcons 12 | 13 | CFBundleIcons~ipad 14 | 15 | CFBundleIdentifier 16 | $(PRODUCT_BUNDLE_IDENTIFIER) 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundleName 20 | $(PRODUCT_NAME) 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 1.0 25 | CFBundleSignature 26 | ???? 27 | CFBundleURLTypes 28 | 29 | 30 | CFBundleTypeRole 31 | Editor 32 | CFBundleURLName 33 | com.hACKbUSTER.UBERGuide 34 | CFBundleURLSchemes 35 | 36 | UBERGuide 37 | 38 | 39 | 40 | CFBundleVersion 41 | 1 42 | LSRequiresIPhoneOS 43 | 44 | NSAppTransportSecurity 45 | 46 | NSAllowsArbitraryLoads 47 | 48 | 49 | NSLocationAlwaysUsageDescription 50 | UBER Guide needs your location 51 | NSLocationWhenInUseUsageDescription 52 | UBER Guide needs your location 53 | UIBackgroundModes 54 | 55 | location 56 | 57 | UILaunchStoryboardName 58 | LaunchScreen 59 | UIMainStoryboardFile 60 | Main 61 | UIRequiredDeviceCapabilities 62 | 63 | armv7 64 | 65 | UISupportedInterfaceOrientations 66 | 67 | UIInterfaceOrientationPortrait 68 | 69 | UISupportedInterfaceOrientations~ipad 70 | 71 | UIInterfaceOrientationPortrait 72 | UIInterfaceOrientationPortraitUpsideDown 73 | UIInterfaceOrientationLandscapeLeft 74 | UIInterfaceOrientationLandscapeRight 75 | 76 | privacy - location usage description 77 | UBER Guide needs your location 78 | 79 | 80 | -------------------------------------------------------------------------------- /UBERGuide/LocationManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // LocationManager.h 3 | // UBERGuide 4 | // 5 | // Created by 叔 陈 on 16/1/16. 6 | // Copyright © 2016年 hACKbUSTER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LocationManager : NSObject 12 | 13 | @property (nonatomic, strong) NSDictionary *dict; 14 | @property (nonatomic, strong) NSString *currentLocationName; 15 | 16 | + (LocationManager *) sharedInstance; 17 | - (void)startCapture; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /UBERGuide/LocationManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // LocationManager.m 3 | // UBERGuide 4 | // 5 | // Created by 叔 陈 on 16/1/16. 6 | // Copyright © 2016年 hACKbUSTER. All rights reserved. 7 | // 8 | 9 | #import "LocationManager.h" 10 | #import 11 | #import 12 | 13 | 14 | @interface LocationManager() 15 | 16 | @property (nonatomic, strong) CLLocationManager *locationManager; 17 | @property (strong, nonatomic) CLGeocoder *geoCoder; 18 | 19 | @end 20 | 21 | @implementation LocationManager 22 | 23 | static NSString *currentLocation = @"currentLocation"; 24 | static NSString *currentLocationLatitude = @"currentLocationLatitude"; 25 | static NSString *currentLocationLongitude = @"currentLocationLongitude"; 26 | static NSString *currentLocationHorizontalAccuracy = @"currentLocationHorizontalAccuracy"; 27 | static NSString *currentLocationAltitude = @"currentLocationAltitude"; 28 | static NSString *currentLocationVerticalAccuracy = @"currentLocationVerticalAccuracy"; 29 | 30 | 31 | + (LocationManager *) sharedInstance 32 | { 33 | static dispatch_once_t onceToken; 34 | static LocationManager * sharedInstance; 35 | dispatch_once(&onceToken, ^{ 36 | sharedInstance = [[LocationManager alloc] init]; 37 | }); 38 | return sharedInstance; 39 | 40 | } 41 | 42 | - (id)init 43 | { 44 | self = [super init]; 45 | return self; 46 | } 47 | 48 | - (void)startCapture 49 | { 50 | if(self) 51 | { 52 | self.dict = [NSDictionary dictionary]; 53 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) 54 | { 55 | //NSLog(@"[[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0"); 56 | [_locationManager requestAlwaysAuthorization]; 57 | _locationManager.allowsBackgroundLocationUpdates = YES; 58 | } 59 | 60 | if ([CLLocationManager locationServicesEnabled]) { 61 | //NSLog(@"[CLLocationManager locationServicesEnabled]"); 62 | self.locationManager = [[CLLocationManager alloc] init];//创建位置管理器 63 | _locationManager.delegate=self; 64 | _locationManager.desiredAccuracy=kCLLocationAccuracyBest; 65 | //_locationManager.distanceFilter=1000.0f; 66 | [_locationManager startUpdatingLocation]; 67 | 68 | } 69 | } 70 | } 71 | -(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations 72 | { 73 | //NSLog(@"didUpdateLocations:(NSArray *)locations"); 74 | CLLocation* newLocation = [locations lastObject]; 75 | NSString *currentLatitude=[[NSString alloc]initWithFormat:@"%g",newLocation.coordinate.latitude]; 76 | NSString *currentLongitude=[[NSString alloc]initWithFormat:@"%g",newLocation.coordinate.longitude]; 77 | NSString *currentHorizontalAccuracy = [[NSString alloc]initWithFormat:@"%g",newLocation.horizontalAccuracy]; 78 | NSString *currentAltitude = [[NSString alloc]initWithFormat:@"%g",newLocation.altitude]; 79 | NSString *currentVerticalAccuracy =[[NSString alloc]initWithFormat:@"%g",newLocation.verticalAccuracy]; 80 | 81 | 82 | self.dict = [NSDictionary dictionaryWithObjects:@[currentLatitude,currentLongitude,currentHorizontalAccuracy,currentAltitude,currentVerticalAccuracy,newLocation] forKeys:@[currentLocationLatitude,currentLocationLongitude,currentLocationHorizontalAccuracy,currentLocationAltitude,currentLocationVerticalAccuracy,currentLocation]]; 83 | 84 | 85 | _geoCoder = [[CLGeocoder alloc] init]; 86 | [_geoCoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray *placemarks, NSError *error) 87 | { 88 | if (!error) 89 | { 90 | CLPlacemark *placemark = placemarks[0]; 91 | NSLog(@"Found %@", placemark.administrativeArea); 92 | //_currentLocationName = placemark.administrativeArea; 93 | } 94 | 95 | }]; 96 | 97 | } 98 | 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /UBERGuide/LookForRideViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LookForRideViewController.h 3 | // UBERGuide 4 | // 5 | // Created by Fincher Justin on 16/1/16. 6 | // Copyright © 2016年 hACKbUSTER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LookForRideViewController : UIViewController 12 | 13 | @property (strong, nonatomic) NSString *tripTitle; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /UBERGuide/RideInfo.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | class RideInfo { 4 | let type: String 5 | let message: String? 6 | let icon: NSURL? 7 | let lat: Double? 8 | let lon: Double? 9 | let description: String? 10 | let summary: String? 11 | let title: String? 12 | let detailTitle: String? 13 | 14 | init(type: String, message: String?, icon: NSURL?, lat: Double?, lon: Double?, description: String?, summary: String?, title: String?, detailTitle: String?) { 15 | self.type = type 16 | self.message = message 17 | self.icon = icon 18 | self.lat = lat 19 | self.lon = lon 20 | self.description = description 21 | self.summary = summary 22 | self.title = title 23 | self.detailTitle = detailTitle 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /UBERGuide/RideInfoProgress.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /UBERGuide/Tag.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | struct Tag { 4 | let id: String 5 | let text: String 6 | let icon: NSURL 7 | let enLabel: String 8 | 9 | init(id: String, text: String, icon: NSURL, enLabel: String) { 10 | self.id = id 11 | self.text = text 12 | self.icon = icon 13 | self.enLabel = enLabel 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /UBERGuide/TagViews.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | class TagCell: UICollectionViewCell { 5 | static let margin: CGFloat = 6 6 | static let width: CGFloat = (UIScreen.mainScreen().bounds.width - 4 * TagCell.margin) / 3 7 | 8 | @IBOutlet weak var icon: UIImageView! 9 | @IBOutlet weak var text: UILabel! 10 | 11 | override func awakeFromNib() { 12 | super.awakeFromNib() 13 | 14 | text.numberOfLines = 0 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /UBERGuide/UBERGuide-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import 6 | #import "LocationManager.h" 7 | #import "circleLoadingView.h" 8 | #import "LookForRideViewController.h" 9 | #import "ARViewController.h" -------------------------------------------------------------------------------- /UBERGuide/UIView+ViewFrameGeometry.h: -------------------------------------------------------------------------------- 1 | /* 2 | Erica Sadun, http://ericasadun.com 3 | iPhone Developer's Cookbook, 3.0 Edition 4 | BSD License, Use at your own risk 5 | */ 6 | 7 | #import 8 | 9 | #define ScreenWidth [[UIScreen mainScreen] bounds].size.width 10 | #define ScreenHeight [[UIScreen mainScreen] bounds].size.height 11 | 12 | CGPoint CGRectGetCenter(CGRect rect); 13 | CGRect CGRectMoveToCenter(CGRect rect, CGPoint center); 14 | double radians(float degrees); 15 | CATransform3D getTransForm3DWithAngle(CGFloat angle); 16 | 17 | @interface UIView (ViewFrameGeometry) 18 | @property CGPoint origin; 19 | @property CGSize size; 20 | 21 | @property (readonly) CGPoint bottomLeft; 22 | @property (readonly) CGPoint bottomRight; 23 | @property (readonly) CGPoint topRight; 24 | 25 | @property CGFloat height; 26 | @property CGFloat width; 27 | 28 | @property CGFloat top; 29 | @property CGFloat left; 30 | 31 | @property CGFloat bottom; 32 | @property CGFloat right; 33 | 34 | - (void) moveBy: (CGPoint) delta; 35 | - (void) scaleBy: (CGFloat) scaleFactor; 36 | - (void) fitInSize: (CGSize) aSize; 37 | 38 | - (UIImage *)convertViewToImage; 39 | @end -------------------------------------------------------------------------------- /UBERGuide/UberAuth.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import p2_OAuth2 3 | 4 | @objc class UberAuth: NSObject { 5 | static let sharedInstance = UberAuth() 6 | 7 | var oauth2: OAuth2? 8 | 9 | var token: String? { 10 | let defaults = NSUserDefaults.standardUserDefaults() 11 | return defaults.stringForKey("uber_token") 12 | } 13 | 14 | func save(token token: String) { 15 | let defaults = NSUserDefaults.standardUserDefaults() 16 | defaults.setValue(token, forKey: "uber_token") 17 | } 18 | 19 | var request_id: String? { 20 | let defaults = NSUserDefaults.standardUserDefaults() 21 | if defaults.objectForKey("request_id") == nil { 22 | return "" 23 | } else { 24 | return defaults.stringForKey("request_id") 25 | } 26 | } 27 | 28 | func saveRequestId(request_id request_id: String) { 29 | let defaults = NSUserDefaults.standardUserDefaults() 30 | defaults.setValue(request_id, forKey: "request_id") 31 | } 32 | 33 | func authenticate(completionHandler: Void -> Void) { 34 | print("authenticate") 35 | 36 | if let _ = token { 37 | return completionHandler() 38 | } 39 | 40 | let settings = [ 41 | "client_id": Constants.uberClientId, 42 | "client_secret": Constants.uberClientSecret, 43 | "authorize_uri": "https://login.uber.com/oauth/v2/authorize", 44 | "token_uri": "https://login.uber.com/oauth/token", 45 | "redirect_uris": ["UBERGuide://oauth/callback"], 46 | "scope": "request", 47 | ] as OAuth2JSON 48 | 49 | oauth2 = OAuth2CodeGrant(settings: settings) 50 | oauth2!.verbose = true 51 | oauth2!.forgetTokens() 52 | oauth2!.onAuthorize = { parameters in 53 | print("Did authorize with parameters: \(parameters)") 54 | let token = parameters["access_token"] as! String 55 | self.save(token: token) 56 | API().postToken(token: token) 57 | completionHandler() 58 | } 59 | oauth2!.onFailure = { error in 60 | if let error = error { 61 | print("Authorization went wrong: \(error)") 62 | } 63 | } 64 | oauth2!.authorize() 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /UBERGuide/WaitDriverViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WaitDriverViewController.h 3 | // UBERGuide 4 | // 5 | // Created by Fincher Justin on 16/1/16. 6 | // Copyright © 2016年 hACKbUSTER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WaitDriverViewController : UIViewController 12 | 13 | @property (nonatomic, strong) NSDictionary *dict; 14 | @property (weak, nonatomic) IBOutlet UILabel *driverStarLabel; 15 | @property (weak, nonatomic) IBOutlet UILabel *driverNameLabel; 16 | @property (weak, nonatomic) IBOutlet UIImageView *driverProfileImageView; 17 | @property (weak, nonatomic) IBOutlet UILabel *carTypeLabel; 18 | @property (weak, nonatomic) IBOutlet UILabel *carPlateLabel; 19 | @end 20 | -------------------------------------------------------------------------------- /UBERGuide/WaitDriverViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // WaitDriverViewController.m 3 | // UBERGuide 4 | // 5 | // Created by Fincher Justin on 16/1/16. 6 | // Copyright © 2016年 hACKbUSTER. All rights reserved. 7 | // 8 | 9 | #import "WaitDriverViewController.h" 10 | #import "UBERGuide-Swift.h" 11 | 12 | @interface WaitDriverViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet UIImageView *mapImageView; 15 | 16 | @end 17 | 18 | @implementation WaitDriverViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | // Do any additional setup after loading the view. 23 | [[self navigationController] setNavigationBarHidden:NO animated:YES]; 24 | 25 | self.title = @"Driver is on the way..."; 26 | [self.navigationController.navigationBar setTranslucent:NO]; 27 | self.navigationController.navigationBar.barTintColor = [UIColor whiteColor]; 28 | self.navigationController.navigationBar.tintColor = [UIColor blackColor]; 29 | 30 | self.driverProfileImageView.layer.masksToBounds = YES; 31 | self.mapImageView.clipsToBounds = YES; 32 | 33 | if(self.dict == nil) 34 | { 35 | self.dict = [NSDictionary dictionary]; 36 | } 37 | 38 | self.driverStarLabel.text = [NSString stringWithFormat:@"%@",[[self.dict objectForKey:@"driver"] objectForKey:@"rating"]]; 39 | self.driverNameLabel.text = [NSString stringWithFormat:@"Mr. %@",[[self.dict objectForKey:@"driver"] objectForKey:@"name"]]; 40 | self.carTypeLabel.text = [NSString stringWithFormat:@"%@ %@",[[self.dict objectForKey:@"vehicle"] objectForKey:@"make"],[[self.dict objectForKey:@"vehicle"] objectForKey:@"model"]]; 41 | 42 | self.driverProfileImageView.contentMode = UIViewContentModeScaleAspectFill; 43 | 44 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 45 | UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[[self.dict objectForKey:@"driver"] objectForKey:@"picture_url"]]]]; 46 | dispatch_async(dispatch_get_main_queue(), ^{ 47 | self.driverProfileImageView.alpha = 0.0f; 48 | [self.driverProfileImageView setImage:image]; 49 | [UIView animateWithDuration:0.3f animations:^{ 50 | self.driverProfileImageView.alpha = 1.0f; 51 | }]; 52 | }); 53 | }); 54 | 55 | // After 15 seconds perform this selector to update the state to in_progress 56 | [self performSelector:@selector(updateState) withObject:nil afterDelay:15.0f]; 57 | } 58 | 59 | - (void)updateState 60 | { 61 | API *api = [[API alloc]init]; 62 | [api updateStateWithState:@"in_progress" completionHandler:^{ 63 | [self performSegueWithIdentifier:@"RideProgressSegue" sender:self]; 64 | }]; 65 | } 66 | 67 | - (void)viewWillAppear:(BOOL)animated 68 | { 69 | [super viewWillAppear:animated]; 70 | 71 | // Because requesting map is meaningless in Sand Box Mode, and loading Map will cost a very long time, so we comment this out in order to make things simple. 72 | 73 | // API *api = [[API alloc]init]; 74 | // [api requestMap:^(id object) { 75 | // [self.mapWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[[object objectForKey:@"data"] objectForKey:@"href"]]]]; 76 | // }]; 77 | } 78 | 79 | - (IBAction)ContactDriver:(id)sender { 80 | NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",[[self.dict objectForKey:@"driver"] objectForKey:@"phone_number"]]; 81 | UIWebView * callWebview = [[UIWebView alloc] init]; 82 | [callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]]; 83 | [self.view addSubview:callWebview]; 84 | } 85 | 86 | - (void)viewDidLayoutSubviews 87 | { 88 | [super viewDidLayoutSubviews]; 89 | _driverProfileImageView.layer.cornerRadius = _driverProfileImageView.frame.size.width/2; 90 | } 91 | 92 | - (void)didReceiveMemoryWarning { 93 | [super didReceiveMemoryWarning]; 94 | // Dispose of any resources that can be recreated. 95 | } 96 | 97 | /* 98 | #pragma mark - Navigation 99 | 100 | // In a storyboard-based application, you will often want to do a little preparation before navigation 101 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 102 | // Get the new view controller using [segue destinationViewController]. 103 | // Pass the selected object to the new view controller. 104 | } 105 | */ 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /UBERGuide/circleLoadingView.h: -------------------------------------------------------------------------------- 1 | // 2 | // circleLoadingView.h 3 | // UBERGuide 4 | // 5 | // Created by 叔 陈 on 16/1/16. 6 | // Copyright © 2016年 hACKbUSTER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface circleLoadingView : UIView 12 | 13 | - (void)animate; 14 | @end 15 | -------------------------------------------------------------------------------- /UBERGuide/circleLoadingView.m: -------------------------------------------------------------------------------- 1 | // 2 | // circleLoadingView.m 3 | // UBERGuide 4 | // 5 | // Created by 叔 陈 on 16/1/16. 6 | // Copyright © 2016年 hACKbUSTER. All rights reserved. 7 | // 8 | 9 | #import "circleLoadingView.h" 10 | #import "UIView+ViewFrameGeometry.h" 11 | 12 | #define AnimationDeepBlueColor [UIColor colorWithRed:62/255.0f green:171/255.0f blue:219/255.0f alpha:1.0f] 13 | #define AnimationLightBlueColor [UIColor colorWithRed:169/255.0f green:222/255.0f blue:241/255.0f alpha:1.0f] 14 | 15 | @implementation circleLoadingView 16 | 17 | - (id)initWithFrame:(CGRect)frame 18 | { 19 | self = [super initWithFrame:frame]; 20 | if(self) 21 | { 22 | 23 | } 24 | return self; 25 | } 26 | 27 | - (void)animate 28 | { 29 | [self.layer addAnimation:[self loopAnimation] forKey:@"fuck"]; 30 | } 31 | 32 | - (CAKeyframeAnimation *)loopAnimation 33 | { 34 | NSMutableArray *tmp = [NSMutableArray array]; 35 | for(NSInteger i=0;i<4;i++) 36 | { 37 | [tmp addObject:(id)[self viewFrameImageWithIndex:i].CGImage]; 38 | } 39 | 40 | CAKeyframeAnimation *loopAnimation; 41 | loopAnimation = [CAKeyframeAnimation animationWithKeyPath:@"contents"]; 42 | loopAnimation.values = tmp; 43 | loopAnimation.duration = 1.2f; 44 | loopAnimation.cumulative = YES; 45 | loopAnimation.repeatCount = HUGE_VAL; 46 | loopAnimation.removedOnCompletion= NO; 47 | loopAnimation.fillMode=kCAFillModeForwards; 48 | loopAnimation.autoreverses = NO; 49 | loopAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 50 | loopAnimation.speed = 1.0f; 51 | loopAnimation.beginTime = 0.0f; 52 | return loopAnimation; 53 | } 54 | 55 | - (UIImage *)viewFrameImageWithIndex:(NSInteger)index 56 | { 57 | UIView *view = [[UIView alloc]initWithFrame:self.frame]; 58 | CGFloat width = 10.0f; 59 | UIView *leftCircle = [[UIView alloc]initWithFrame:CGRectMake((self.width - 7*width)/2.0f, 0.0f, width, width)]; 60 | leftCircle.layer.cornerRadius = width/2.0f; 61 | leftCircle.backgroundColor = AnimationLightBlueColor; 62 | 63 | UIView *centerCircle = [[UIView alloc]initWithFrame:CGRectMake(leftCircle.right + width * 2.0f, 0.0f, width, width)]; 64 | centerCircle.layer.cornerRadius = width/2.0f; 65 | centerCircle.backgroundColor = AnimationLightBlueColor; 66 | 67 | UIView *rightCircle = [[UIView alloc]initWithFrame:CGRectMake(centerCircle.right + width * 2.0f, 0.0f, width, width)]; 68 | rightCircle.layer.cornerRadius = width/2.0f; 69 | rightCircle.backgroundColor = AnimationLightBlueColor; 70 | 71 | if(index == 1) { 72 | leftCircle.backgroundColor = AnimationDeepBlueColor; 73 | centerCircle.backgroundColor = AnimationLightBlueColor; 74 | rightCircle.backgroundColor = AnimationLightBlueColor; 75 | } else if(index == 2) { 76 | leftCircle.backgroundColor = AnimationDeepBlueColor; 77 | centerCircle.backgroundColor = AnimationDeepBlueColor; 78 | rightCircle.backgroundColor = AnimationLightBlueColor; 79 | } else if(index == 3) { 80 | leftCircle.backgroundColor = AnimationDeepBlueColor; 81 | centerCircle.backgroundColor = AnimationDeepBlueColor; 82 | rightCircle.backgroundColor = AnimationDeepBlueColor; 83 | } 84 | 85 | [view addSubview:leftCircle]; 86 | [view addSubview:centerCircle]; 87 | [view addSubview:rightCircle]; 88 | 89 | return [view convertViewToImage]; 90 | } 91 | @end 92 | -------------------------------------------------------------------------------- /UBERGuide/lookingAnimationView.h: -------------------------------------------------------------------------------- 1 | // 2 | // lookingAnimationView.h 3 | // UBERGuide 4 | // 5 | // Created by 叔 陈 on 16/1/16. 6 | // Copyright © 2016年 hACKbUSTER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface lookingAnimationView : UIView 12 | 13 | @property (strong, nonatomic) UILabel *titleLabel; 14 | 15 | - (void)animate; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /UBERGuide/lookingAnimationView.m: -------------------------------------------------------------------------------- 1 | // 2 | // lookingAnimationView.m 3 | // UBERGuide 4 | // 5 | // Created by 叔 陈 on 16/1/16. 6 | // Copyright © 2016年 hACKbUSTER. All rights reserved. 7 | // 8 | 9 | #import "lookingAnimationView.h" 10 | #import "UIView+ViewFrameGeometry.h" 11 | #import "circleLoadingView.h" 12 | 13 | @interface lookingAnimationView() 14 | { 15 | circleLoadingView *_circleLoading; 16 | } 17 | 18 | @end 19 | 20 | @implementation lookingAnimationView 21 | 22 | /* 23 | // Only override drawRect: if you perform custom drawing. 24 | // An empty implementation adversely affects performance during animation. 25 | - (void)drawRect:(CGRect)rect { 26 | // Drawing code 27 | } 28 | */ 29 | 30 | - (id)initWithFrame:(CGRect)frame 31 | { 32 | self = [super initWithFrame:frame]; 33 | if(self) 34 | { 35 | _circleLoading = [[circleLoadingView alloc]initWithFrame:CGRectMake(0.0f, 0.0f, self.width, 20.0f)]; 36 | [self addSubview:_circleLoading]; 37 | 38 | _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0.0f, _circleLoading.bottom + 10.0f, self.width, 21.0f)]; 39 | _titleLabel.text = @"Looking for rides"; 40 | _titleLabel.textAlignment = NSTextAlignmentCenter; 41 | _titleLabel.textColor = [UIColor colorWithRed:0.29f green:0.73f blue:0.89f alpha:1.0f];; 42 | _titleLabel.font = [UIFont systemFontOfSize:18.0f]; 43 | [self addSubview:_titleLabel]; 44 | } 45 | return self; 46 | } 47 | 48 | - (void)animate 49 | { 50 | _titleLabel.text = @"Looking for rides"; 51 | [_circleLoading animate]; 52 | } 53 | @end 54 | -------------------------------------------------------------------------------- /UBERGuideTests/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 | -------------------------------------------------------------------------------- /UBERGuideTests/UBERGuideTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UBERGuideTests.swift 3 | // UBERGuideTests 4 | // 5 | // Created by Fincher Justin on 16/1/16. 6 | // Copyright © 2016年 hACKbUSTER. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import UBERGuide 11 | 12 | class UBERGuideTests: 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 | -------------------------------------------------------------------------------- /UBERGuideUITests/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 | -------------------------------------------------------------------------------- /UBERGuideUITests/UBERGuideUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UBERGuideUITests.swift 3 | // UBERGuideUITests 4 | // 5 | // Created by Fincher Justin on 16/1/16. 6 | // Copyright © 2016年 hACKbUSTER. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class UBERGuideUITests: 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 | XCUIApplication().launch() 22 | 23 | // 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. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | --------------------------------------------------------------------------------