├── Bolts.framework ├── Bolts ├── Headers │ ├── BFAppLink.h │ ├── BFAppLinkNavigation.h │ ├── BFAppLinkResolving.h │ ├── BFAppLinkReturnToRefererController.h │ ├── BFAppLinkReturnToRefererView.h │ ├── BFAppLinkTarget.h │ ├── BFCancellationToken.h │ ├── BFCancellationTokenRegistration.h │ ├── BFCancellationTokenSource.h │ ├── BFDefines.h │ ├── BFExecutor.h │ ├── BFMeasurementEvent.h │ ├── BFTask.h │ ├── BFTaskCompletionSource.h │ ├── BFURL.h │ ├── BFWebViewAppLinkResolver.h │ ├── Bolts.h │ └── BoltsVersion.h ├── Info.plist └── Modules │ └── module.modulemap ├── Parse.framework ├── Headers │ ├── PFACL.h │ ├── PFAnalytics.h │ ├── PFAnonymousUtils.h │ ├── PFCloud.h │ ├── PFConfig.h │ ├── PFConstants.h │ ├── PFFile.h │ ├── PFGeoPoint.h │ ├── PFInstallation.h │ ├── PFNetworkActivityIndicatorManager.h │ ├── PFNullability.h │ ├── PFObject+Subclass.h │ ├── PFObject.h │ ├── PFProduct.h │ ├── PFPurchase.h │ ├── PFPush.h │ ├── PFQuery.h │ ├── PFRelation.h │ ├── PFRole.h │ ├── PFSession.h │ ├── PFSubclassing.h │ ├── PFUser.h │ ├── PFUserAuthenticationDelegate.h │ └── Parse.h ├── Info.plist ├── Modules │ └── module.modulemap ├── Parse ├── en.lproj │ └── Parse.strings └── third_party_licenses.txt ├── README.md ├── Screenshots ├── Screenshot_1.png ├── Screenshot_2.png └── Screenshot_3.png ├── Uber.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── bogy.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── bogy.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── Uber.xcscheme │ └── xcschememanagement.plist └── Uber ├── AppDelegate.swift ├── Assets.xcassets └── AppIcon.appiconset │ ├── Contents.json │ ├── Entypo_e740(0)_120-1.png │ ├── Entypo_e740(0)_120.png │ ├── Entypo_e740(0)_180.png │ ├── Entypo_e740(0)_58.png │ └── Entypo_e740(0)_80.png ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Cell.swift ├── DriverViewController.swift ├── Info.plist ├── RiderViewController.swift ├── ViewController.swift └── ViewRequestViewController.swift /Bolts.framework/Bolts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedFish/Uber/a6e83e686517e60414d067edcccd0d202ca793e4/Bolts.framework/Bolts -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFAppLink.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | 13 | /*! The version of the App Link protocol that this library supports */ 14 | FOUNDATION_EXPORT NSString *const BFAppLinkVersion; 15 | 16 | /*! 17 | Contains App Link metadata relevant for navigation on this device 18 | derived from the HTML at a given URL. 19 | */ 20 | @interface BFAppLink : NSObject 21 | 22 | /*! 23 | Creates a BFAppLink with the given list of BFAppLinkTargets and target URL. 24 | 25 | Generally, this will only be used by implementers of the BFAppLinkResolving protocol, 26 | as these implementers will produce App Link metadata for a given URL. 27 | 28 | @param sourceURL the URL from which this App Link is derived 29 | @param targets an ordered list of BFAppLinkTargets for this platform derived 30 | from App Link metadata. 31 | @param webURL the fallback web URL, if any, for the app link. 32 | */ 33 | + (instancetype)appLinkWithSourceURL:(NSURL *)sourceURL 34 | targets:(NSArray *)targets 35 | webURL:(NSURL *)webURL; 36 | 37 | /*! The URL from which this BFAppLink was derived */ 38 | @property (nonatomic, strong, readonly) NSURL *sourceURL; 39 | 40 | /*! 41 | The ordered list of targets applicable to this platform that will be used 42 | for navigation. 43 | */ 44 | @property (nonatomic, copy, readonly) NSArray *targets; 45 | 46 | /*! The fallback web URL to use if no targets are installed on this device. */ 47 | @property (nonatomic, strong, readonly) NSURL *webURL; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFAppLinkNavigation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | 13 | #import 14 | 15 | /*! 16 | The result of calling navigate on a BFAppLinkNavigation 17 | */ 18 | typedef NS_ENUM(NSInteger, BFAppLinkNavigationType) { 19 | /*! Indicates that the navigation failed and no app was opened */ 20 | BFAppLinkNavigationTypeFailure, 21 | /*! Indicates that the navigation succeeded by opening the URL in the browser */ 22 | BFAppLinkNavigationTypeBrowser, 23 | /*! Indicates that the navigation succeeded by opening the URL in an app on the device */ 24 | BFAppLinkNavigationTypeApp 25 | }; 26 | 27 | @protocol BFAppLinkResolving; 28 | @class BFTask; 29 | 30 | /*! 31 | Represents a pending request to navigate to an App Link. Most developers will 32 | simply use navigateToURLInBackground: to open a URL, but developers can build 33 | custom requests with additional navigation and app data attached to them by 34 | creating BFAppLinkNavigations themselves. 35 | */ 36 | @interface BFAppLinkNavigation : NSObject 37 | 38 | /*! 39 | The extras for the AppLinkNavigation. This will generally contain application-specific 40 | data that should be passed along with the request, such as advertiser or affiliate IDs or 41 | other such metadata relevant on this device. 42 | */ 43 | @property (nonatomic, copy, readonly) NSDictionary *extras; 44 | 45 | /*! 46 | The al_applink_data for the AppLinkNavigation. This will generally contain data common to 47 | navigation attempts such as back-links, user agents, and other information that may be used 48 | in routing and handling an App Link request. 49 | */ 50 | @property (nonatomic, copy, readonly) NSDictionary *appLinkData; 51 | 52 | /*! The AppLink to navigate to */ 53 | @property (nonatomic, strong, readonly) BFAppLink *appLink; 54 | 55 | /*! Creates an AppLinkNavigation with the given link, extras, and App Link data */ 56 | + (instancetype)navigationWithAppLink:(BFAppLink *)appLink 57 | extras:(NSDictionary *)extras 58 | appLinkData:(NSDictionary *)appLinkData; 59 | 60 | /*! Performs the navigation */ 61 | - (BFAppLinkNavigationType)navigate:(NSError **)error; 62 | 63 | /*! Returns a BFAppLink for the given URL */ 64 | + (BFTask *)resolveAppLinkInBackground:(NSURL *)destination; 65 | 66 | /*! Returns a BFAppLink for the given URL using the given App Link resolution strategy */ 67 | + (BFTask *)resolveAppLinkInBackground:(NSURL *)destination resolver:(id)resolver; 68 | 69 | /*! Navigates to a BFAppLink and returns whether it opened in-app or in-browser */ 70 | + (BFAppLinkNavigationType)navigateToAppLink:(BFAppLink *)link error:(NSError **)error; 71 | 72 | /*! Navigates to a URL (an asynchronous action) and returns a BFNavigationType */ 73 | + (BFTask *)navigateToURLInBackground:(NSURL *)destination; 74 | 75 | /*! 76 | Navigates to a URL (an asynchronous action) using the given App Link resolution 77 | strategy and returns a BFNavigationType 78 | */ 79 | + (BFTask *)navigateToURLInBackground:(NSURL *)destination resolver:(id)resolver; 80 | 81 | /*! 82 | Gets the default resolver to be used for App Link resolution. If the developer has not set one explicitly, 83 | a basic, built-in resolver will be used. 84 | */ 85 | + (id)defaultResolver; 86 | 87 | /*! 88 | Sets the default resolver to be used for App Link resolution. Setting this to nil will revert the 89 | default resolver to the basic, built-in resolver provided by Bolts. 90 | */ 91 | + (void)setDefaultResolver:(id)resolver; 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFAppLinkResolving.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | 13 | @class BFTask; 14 | 15 | /*! 16 | Implement this protocol to provide an alternate strategy for resolving 17 | App Links that may include pre-fetching, caching, or querying for App Link 18 | data from an index provided by a service provider. 19 | */ 20 | @protocol BFAppLinkResolving 21 | 22 | /*! 23 | Asynchronously resolves App Link data for a given URL. 24 | 25 | @param url The URL to resolve into an App Link. 26 | @returns A BFTask that will return a BFAppLink for the given URL. 27 | */ 28 | - (BFTask *)appLinkFromURLInBackground:(NSURL *)url; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFAppLinkReturnToRefererController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | #import 13 | 14 | #import 15 | 16 | @class BFAppLink; 17 | @class BFAppLinkReturnToRefererController; 18 | 19 | /*! 20 | Protocol that a class can implement in order to be notified when the user has navigated back 21 | to the referer of an App Link. 22 | */ 23 | @protocol BFAppLinkReturnToRefererControllerDelegate 24 | 25 | @optional 26 | 27 | /*! Called when the user has tapped to navigate, but before the navigation has been performed. */ 28 | - (void)returnToRefererController:(BFAppLinkReturnToRefererController *)controller 29 | willNavigateToAppLink:(BFAppLink *)appLink; 30 | 31 | /*! Called after the navigation has been attempted, with an indication of whether the referer 32 | app link was successfully opened. */ 33 | - (void)returnToRefererController:(BFAppLinkReturnToRefererController *)controller 34 | didNavigateToAppLink:(BFAppLink *)url 35 | type:(BFAppLinkNavigationType)type; 36 | 37 | @end 38 | 39 | /*! 40 | A controller class that implements default behavior for a BFAppLinkReturnToRefererView, including 41 | the ability to display the view above the navigation bar for navigation-based apps. 42 | */ 43 | @interface BFAppLinkReturnToRefererController : NSObject 44 | 45 | /*! 46 | The delegate that will be notified when the user navigates back to the referer. 47 | */ 48 | @property (nonatomic, weak) id delegate; 49 | 50 | /*! 51 | The BFAppLinkReturnToRefererView this controller is controlling. 52 | */ 53 | @property (nonatomic, strong) BFAppLinkReturnToRefererView *view; 54 | 55 | /*! 56 | Initializes a controller suitable for controlling a BFAppLinkReturnToRefererView that is to be displayed 57 | contained within another UIView (i.e., not displayed above the navigation bar). 58 | */ 59 | - (instancetype)init; 60 | 61 | /*! 62 | Initializes a controller suitable for controlling a BFAppLinkReturnToRefererView that is to be displayed 63 | displayed above the navigation bar. 64 | */ 65 | - (instancetype)initForDisplayAboveNavController:(UINavigationController *)navController; 66 | 67 | /*! 68 | Removes the view entirely from the navigation controller it is currently displayed in. 69 | */ 70 | - (void)removeFromNavController; 71 | 72 | /*! 73 | Shows the BFAppLinkReturnToRefererView with the specified referer information. If nil or missing data, 74 | the view will not be displayed. */ 75 | - (void)showViewForRefererAppLink:(BFAppLink *)refererAppLink; 76 | 77 | /*! 78 | Shows the BFAppLinkReturnToRefererView with referer information extracted from the specified URL. 79 | If nil or missing referer App Link data, the view will not be displayed. */ 80 | - (void)showViewForRefererURL:(NSURL *)url; 81 | 82 | /*! 83 | Closes the view, possibly animating it. 84 | */ 85 | - (void)closeViewAnimated:(BOOL)animated; 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFAppLinkReturnToRefererView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | #import 13 | 14 | #import 15 | 16 | @class BFAppLinkReturnToRefererView; 17 | @class BFURL; 18 | 19 | typedef NS_ENUM(NSUInteger, BFIncludeStatusBarInSize) { 20 | BFIncludeStatusBarInSizeNever, 21 | BFIncludeStatusBarInSizeIOS7AndLater, 22 | BFIncludeStatusBarInSizeAlways, 23 | }; 24 | 25 | /*! 26 | Protocol that a class can implement in order to be notified when the user has navigated back 27 | to the referer of an App Link. 28 | */ 29 | @protocol BFAppLinkReturnToRefererViewDelegate 30 | 31 | /*! 32 | Called when the user has tapped inside the close button. 33 | */ 34 | - (void)returnToRefererViewDidTapInsideCloseButton:(BFAppLinkReturnToRefererView *)view; 35 | 36 | /*! 37 | Called when the user has tapped inside the App Link portion of the view. 38 | */ 39 | - (void)returnToRefererViewDidTapInsideLink:(BFAppLinkReturnToRefererView *)view 40 | link:(BFAppLink *)link; 41 | 42 | @end 43 | 44 | /*! 45 | Provides a UIView that displays a button allowing users to navigate back to the 46 | application that launched the App Link currently being handled, if the App Link 47 | contained referer data. The user can also close the view by clicking a close button 48 | rather than navigating away. If the view is provided an App Link that does not contain 49 | referer data, it will have zero size and no UI will be displayed. 50 | */ 51 | @interface BFAppLinkReturnToRefererView : UIView 52 | 53 | /*! 54 | The delegate that will be notified when the user navigates back to the referer. 55 | */ 56 | @property (nonatomic, weak) id delegate; 57 | 58 | /*! 59 | The color of the text label and close button. 60 | */ 61 | @property (nonatomic, strong) UIColor *textColor; 62 | 63 | @property (nonatomic, strong) BFAppLink *refererAppLink; 64 | 65 | /*! 66 | Indicates whether to extend the size of the view to include the current status bar 67 | size, for use in scenarios where the view might extend under the status bar on iOS 7 and 68 | above; this property has no effect on earlier versions of iOS. 69 | */ 70 | @property (nonatomic, assign) BFIncludeStatusBarInSize includeStatusBarInSize; 71 | 72 | /*! 73 | Indicates whether the user has closed the view by clicking the close button. 74 | */ 75 | @property (nonatomic, assign) BOOL closed; 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFAppLinkTarget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | 13 | /*! 14 | Represents a target defined in App Link metadata, consisting of at least 15 | a URL, and optionally an App Store ID and name. 16 | */ 17 | @interface BFAppLinkTarget : NSObject 18 | 19 | /*! Creates a BFAppLinkTarget with the given app site and target URL. */ 20 | + (instancetype)appLinkTargetWithURL:(NSURL *)url 21 | appStoreId:(NSString *)appStoreId 22 | appName:(NSString *)appName; 23 | 24 | /*! The URL prefix for this app link target */ 25 | @property (nonatomic, strong, readonly) NSURL *URL; 26 | 27 | /*! The app ID for the app store */ 28 | @property (nonatomic, copy, readonly) NSString *appStoreId; 29 | 30 | /*! The name of the app */ 31 | @property (nonatomic, copy, readonly) NSString *appName; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFCancellationToken.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | 13 | #import 14 | 15 | /*! 16 | A block that will be called when a token is cancelled. 17 | */ 18 | typedef void(^BFCancellationBlock)(); 19 | 20 | /*! 21 | The consumer view of a CancellationToken. 22 | Propagates notification that operations should be canceled. 23 | A BFCancellationToken has methods to inspect whether the token has been cancelled. 24 | */ 25 | @interface BFCancellationToken : NSObject 26 | 27 | /*! 28 | Whether cancellation has been requested for this token source. 29 | */ 30 | @property (nonatomic, assign, readonly, getter=isCancellationRequested) BOOL cancellationRequested; 31 | 32 | /*! 33 | Register a block to be notified when the token is cancelled. 34 | If the token is already cancelled the delegate will be notified immediately. 35 | */ 36 | - (BFCancellationTokenRegistration *)registerCancellationObserverWithBlock:(BFCancellationBlock)block; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFCancellationTokenRegistration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | 13 | /*! 14 | Represents the registration of a cancellation observer with a cancellation token. 15 | Can be used to unregister the observer at a later time. 16 | */ 17 | @interface BFCancellationTokenRegistration : NSObject 18 | 19 | /*! 20 | Removes the cancellation observer registered with the token 21 | and releases all resources associated with this registration. 22 | */ 23 | - (void)dispose; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFCancellationTokenSource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | 13 | @class BFCancellationToken; 14 | 15 | /*! 16 | BFCancellationTokenSource represents the producer side of a CancellationToken. 17 | Signals to a CancellationToken that it should be canceled. 18 | It is a cancellation token that also has methods 19 | for changing the state of a token by cancelling it. 20 | */ 21 | @interface BFCancellationTokenSource : NSObject 22 | 23 | /*! 24 | Creates a new cancellation token source. 25 | */ 26 | + (instancetype)cancellationTokenSource; 27 | 28 | /*! 29 | The cancellation token associated with this CancellationTokenSource. 30 | */ 31 | @property (nonatomic, strong, readonly) BFCancellationToken *token; 32 | 33 | /*! 34 | Whether cancellation has been requested for this token source. 35 | */ 36 | @property (nonatomic, assign, readonly, getter=isCancellationRequested) BOOL cancellationRequested; 37 | 38 | /*! 39 | Cancels the token if it has not already been cancelled. 40 | */ 41 | - (void)cancel; 42 | 43 | /*! 44 | Schedules a cancel operation on this CancellationTokenSource after the specified number of milliseconds. 45 | @param millis The number of milliseconds to wait before completing the returned task. 46 | If delay is `0` the cancel is executed immediately. If delay is `-1` any scheduled cancellation is stopped. 47 | */ 48 | - (void)cancelAfterDelay:(int)millis; 49 | 50 | /*! 51 | Releases all resources associated with this token source, 52 | including disposing of all registrations. 53 | */ 54 | - (void)dispose; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFDefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | 13 | #if __has_feature(objc_generics) || __has_extension(objc_generics) 14 | # define BF_GENERIC(type) 15 | #else 16 | # define BF_GENERIC(type) 17 | # define BFGenericType id 18 | #endif 19 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFExecutor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | 13 | /*! 14 | An object that can run a given block. 15 | */ 16 | @interface BFExecutor : NSObject 17 | 18 | /*! 19 | Returns a default executor, which runs continuations immediately until the call stack gets too 20 | deep, then dispatches to a new GCD queue. 21 | */ 22 | + (instancetype)defaultExecutor; 23 | 24 | /*! 25 | Returns an executor that runs continuations on the thread where the previous task was completed. 26 | */ 27 | + (instancetype)immediateExecutor; 28 | 29 | /*! 30 | Returns an executor that runs continuations on the main thread. 31 | */ 32 | + (instancetype)mainThreadExecutor; 33 | 34 | /*! 35 | Returns a new executor that uses the given block to execute continuations. 36 | @param block The block to use. 37 | */ 38 | + (instancetype)executorWithBlock:(void(^)(void(^block)()))block; 39 | 40 | /*! 41 | Returns a new executor that runs continuations on the given queue. 42 | @param queue The instance of `dispatch_queue_t` to dispatch all continuations onto. 43 | */ 44 | + (instancetype)executorWithDispatchQueue:(dispatch_queue_t)queue; 45 | 46 | /*! 47 | Returns a new executor that runs continuations on the given queue. 48 | @param queue The instance of `NSOperationQueue` to run all continuations on. 49 | */ 50 | + (instancetype)executorWithOperationQueue:(NSOperationQueue *)queue; 51 | 52 | /*! 53 | Runs the given block using this executor's particular strategy. 54 | @param block The block to execute. 55 | */ 56 | - (void)execute:(void(^)())block; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFMeasurementEvent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | 13 | /*! The name of the notification posted by BFMeasurementEvent */ 14 | FOUNDATION_EXPORT NSString *const BFMeasurementEventNotificationName; 15 | 16 | /*! Defines keys in the userInfo object for the notification named BFMeasurementEventNotificationName */ 17 | /*! The string field for the name of the event */ 18 | FOUNDATION_EXPORT NSString *const BFMeasurementEventNameKey; 19 | /*! The dictionary field for the arguments of the event */ 20 | FOUNDATION_EXPORT NSString *const BFMeasurementEventArgsKey; 21 | 22 | /*! Bolts Events raised by BFMeasurementEvent for Applink */ 23 | /*! 24 | The name of the event posted when [BFURL URLWithURL:] is called successfully. This represents the successful parsing of an app link URL. 25 | */ 26 | FOUNDATION_EXPORT NSString *const BFAppLinkParseEventName; 27 | 28 | /*! 29 | The name of the event posted when [BFURL URLWithInboundURL:] is called successfully. 30 | This represents parsing an inbound app link URL from a different application 31 | */ 32 | FOUNDATION_EXPORT NSString *const BFAppLinkNavigateInEventName; 33 | 34 | /*! The event raised when the user navigates from your app to other apps */ 35 | FOUNDATION_EXPORT NSString *const BFAppLinkNavigateOutEventName; 36 | 37 | /*! 38 | The event raised when the user navigates out from your app and back to the referrer app. 39 | e.g when the user leaves your app after tapping the back-to-referrer navigation bar 40 | */ 41 | FOUNDATION_EXPORT NSString *const BFAppLinkNavigateBackToReferrerEventName; 42 | 43 | @interface BFMeasurementEvent : NSObject 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFTask.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | 13 | #import 14 | #import 15 | 16 | /*! 17 | Error domain used if there was multiple errors on . 18 | */ 19 | extern NSString *const BFTaskErrorDomain; 20 | 21 | /*! 22 | An exception that is thrown if there was multiple exceptions on . 23 | */ 24 | extern NSString *const BFTaskMultipleExceptionsException; 25 | 26 | @class BFExecutor; 27 | @class BFTask; 28 | 29 | /*! 30 | The consumer view of a Task. A BFTask has methods to 31 | inspect the state of the task, and to add continuations to 32 | be run once the task is complete. 33 | */ 34 | @interface BFTask BF_GENERIC(__covariant BFGenericType) : NSObject 35 | 36 | /*! 37 | A block that can act as a continuation for a task. 38 | */ 39 | typedef id(^BFContinuationBlock)(BFTask BF_GENERIC(BFGenericType) *task); 40 | 41 | /*! 42 | Creates a task that is already completed with the given result. 43 | @param result The result for the task. 44 | */ 45 | + (instancetype)taskWithResult:(BFGenericType)result; 46 | 47 | /*! 48 | Creates a task that is already completed with the given error. 49 | @param error The error for the task. 50 | */ 51 | + (instancetype)taskWithError:(NSError *)error; 52 | 53 | /*! 54 | Creates a task that is already completed with the given exception. 55 | @param exception The exception for the task. 56 | */ 57 | + (instancetype)taskWithException:(NSException *)exception; 58 | 59 | /*! 60 | Creates a task that is already cancelled. 61 | */ 62 | + (instancetype)cancelledTask; 63 | 64 | /*! 65 | Returns a task that will be completed (with result == nil) once 66 | all of the input tasks have completed. 67 | @param tasks An `NSArray` of the tasks to use as an input. 68 | */ 69 | + (instancetype)taskForCompletionOfAllTasks:(NSArray *)tasks; 70 | 71 | /*! 72 | Returns a task that will be completed once all of the input tasks have completed. 73 | If all tasks complete successfully without being faulted or cancelled the result will be 74 | an `NSArray` of all task results in the order they were provided. 75 | @param tasks An `NSArray` of the tasks to use as an input. 76 | */ 77 | + (instancetype)taskForCompletionOfAllTasksWithResults:(NSArray *)tasks; 78 | 79 | /*! 80 | Returns a task that will be completed a certain amount of time in the future. 81 | @param millis The approximate number of milliseconds to wait before the 82 | task will be finished (with result == nil). 83 | */ 84 | + (instancetype)taskWithDelay:(int)millis; 85 | 86 | /*! 87 | Returns a task that will be completed a certain amount of time in the future. 88 | @param millis The approximate number of milliseconds to wait before the 89 | task will be finished (with result == nil). 90 | @param token The cancellation token (optional). 91 | */ 92 | + (instancetype)taskWithDelay:(int)millis 93 | cancellationToken:(BFCancellationToken *)token; 94 | 95 | /*! 96 | Returns a task that will be completed after the given block completes with 97 | the specified executor. 98 | @param executor A BFExecutor responsible for determining how the 99 | continuation block will be run. 100 | @param block The block to immediately schedule to run with the given executor. 101 | @returns A task that will be completed after block has run. 102 | If block returns a BFTask, then the task returned from 103 | this method will not be completed until that task is completed. 104 | */ 105 | + (instancetype)taskFromExecutor:(BFExecutor *)executor 106 | withBlock:(id (^)())block; 107 | 108 | // Properties that will be set on the task once it is completed. 109 | 110 | /*! 111 | The result of a successful task. 112 | */ 113 | @property (nonatomic, strong, readonly) BFGenericType result; 114 | 115 | /*! 116 | The error of a failed task. 117 | */ 118 | @property (nonatomic, strong, readonly) NSError *error; 119 | 120 | /*! 121 | The exception of a failed task. 122 | */ 123 | @property (nonatomic, strong, readonly) NSException *exception; 124 | 125 | /*! 126 | Whether this task has been cancelled. 127 | */ 128 | @property (nonatomic, assign, readonly, getter=isCancelled) BOOL cancelled; 129 | 130 | /*! 131 | Whether this task has completed due to an error or exception. 132 | */ 133 | @property (nonatomic, assign, readonly, getter=isFaulted) BOOL faulted; 134 | 135 | /*! 136 | Whether this task has completed. 137 | */ 138 | @property (nonatomic, assign, readonly, getter=isCompleted) BOOL completed; 139 | 140 | /*! 141 | Enqueues the given block to be run once this task is complete. 142 | This method uses a default execution strategy. The block will be 143 | run on the thread where the previous task completes, unless the 144 | the stack depth is too deep, in which case it will be run on a 145 | dispatch queue with default priority. 146 | @param block The block to be run once this task is complete. 147 | @returns A task that will be completed after block has run. 148 | If block returns a BFTask, then the task returned from 149 | this method will not be completed until that task is completed. 150 | */ 151 | - (instancetype)continueWithBlock:(BFContinuationBlock)block; 152 | 153 | /*! 154 | Enqueues the given block to be run once this task is complete. 155 | This method uses a default execution strategy. The block will be 156 | run on the thread where the previous task completes, unless the 157 | the stack depth is too deep, in which case it will be run on a 158 | dispatch queue with default priority. 159 | @param block The block to be run once this task is complete. 160 | @param cancellationToken The cancellation token (optional). 161 | @returns A task that will be completed after block has run. 162 | If block returns a BFTask, then the task returned from 163 | this method will not be completed until that task is completed. 164 | */ 165 | - (instancetype)continueWithBlock:(BFContinuationBlock)block 166 | cancellationToken:(BFCancellationToken *)cancellationToken; 167 | 168 | /*! 169 | Enqueues the given block to be run once this task is complete. 170 | @param executor A BFExecutor responsible for determining how the 171 | continuation block will be run. 172 | @param block The block to be run once this task is complete. 173 | @returns A task that will be completed after block has run. 174 | If block returns a BFTask, then the task returned from 175 | this method will not be completed until that task is completed. 176 | */ 177 | - (instancetype)continueWithExecutor:(BFExecutor *)executor 178 | withBlock:(BFContinuationBlock)block; 179 | /*! 180 | Enqueues the given block to be run once this task is complete. 181 | @param executor A BFExecutor responsible for determining how the 182 | continuation block will be run. 183 | @param block The block to be run once this task is complete. 184 | @param cancellationToken The cancellation token (optional). 185 | @returns A task that will be completed after block has run. 186 | If block returns a BFTask, then the task returned from 187 | his method will not be completed until that task is completed. 188 | */ 189 | - (instancetype)continueWithExecutor:(BFExecutor *)executor 190 | block:(BFContinuationBlock)block 191 | cancellationToken:(BFCancellationToken *)cancellationToken; 192 | 193 | /*! 194 | Identical to continueWithBlock:, except that the block is only run 195 | if this task did not produce a cancellation, error, or exception. 196 | If it did, then the failure will be propagated to the returned 197 | task. 198 | @param block The block to be run once this task is complete. 199 | @returns A task that will be completed after block has run. 200 | If block returns a BFTask, then the task returned from 201 | this method will not be completed until that task is completed. 202 | */ 203 | - (instancetype)continueWithSuccessBlock:(BFContinuationBlock)block; 204 | 205 | /*! 206 | Identical to continueWithBlock:, except that the block is only run 207 | if this task did not produce a cancellation, error, or exception. 208 | If it did, then the failure will be propagated to the returned 209 | task. 210 | @param block The block to be run once this task is complete. 211 | @param cancellationToken The cancellation token (optional). 212 | @returns A task that will be completed after block has run. 213 | If block returns a BFTask, then the task returned from 214 | this method will not be completed until that task is completed. 215 | */ 216 | - (instancetype)continueWithSuccessBlock:(BFContinuationBlock)block 217 | cancellationToken:(BFCancellationToken *)cancellationToken; 218 | 219 | /*! 220 | Identical to continueWithExecutor:withBlock:, except that the block 221 | is only run if this task did not produce a cancellation, error, or 222 | exception. If it did, then the failure will be propagated to the 223 | returned task. 224 | @param executor A BFExecutor responsible for determining how the 225 | continuation block will be run. 226 | @param block The block to be run once this task is complete. 227 | @returns A task that will be completed after block has run. 228 | If block returns a BFTask, then the task returned from 229 | this method will not be completed until that task is completed. 230 | */ 231 | - (instancetype)continueWithExecutor:(BFExecutor *)executor 232 | withSuccessBlock:(BFContinuationBlock)block; 233 | 234 | /*! 235 | Identical to continueWithExecutor:withBlock:, except that the block 236 | is only run if this task did not produce a cancellation, error, or 237 | exception. If it did, then the failure will be propagated to the 238 | returned task. 239 | @param executor A BFExecutor responsible for determining how the 240 | continuation block will be run. 241 | @param block The block to be run once this task is complete. 242 | @param cancellationToken The cancellation token (optional). 243 | @returns A task that will be completed after block has run. 244 | If block returns a BFTask, then the task returned from 245 | this method will not be completed until that task is completed. 246 | */ 247 | - (instancetype)continueWithExecutor:(BFExecutor *)executor 248 | successBlock:(BFContinuationBlock)block 249 | cancellationToken:(BFCancellationToken *)cancellationToken; 250 | 251 | /*! 252 | Waits until this operation is completed. 253 | This method is inefficient and consumes a thread resource while 254 | it's running. It should be avoided. This method logs a warning 255 | message if it is used on the main thread. 256 | */ 257 | - (void)waitUntilFinished; 258 | 259 | @end 260 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFTaskCompletionSource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | 13 | #import 14 | 15 | @class BFTask BF_GENERIC(BFGenericType); 16 | 17 | /*! 18 | A BFTaskCompletionSource represents the producer side of tasks. 19 | It is a task that also has methods for changing the state of the 20 | task by settings its completion values. 21 | */ 22 | @interface BFTaskCompletionSource BF_GENERIC(__covariant BFGenericType) : NSObject 23 | 24 | /*! 25 | Creates a new unfinished task. 26 | */ 27 | + (instancetype)taskCompletionSource; 28 | 29 | /*! 30 | The task associated with this TaskCompletionSource. 31 | */ 32 | @property (nonatomic, strong, readonly) BFTask BF_GENERIC(BFGenericType) *task; 33 | 34 | /*! 35 | Completes the task by setting the result. 36 | Attempting to set this for a completed task will raise an exception. 37 | @param result The result of the task. 38 | */ 39 | - (void)setResult:(BFGenericType)result; 40 | 41 | /*! 42 | Completes the task by setting the error. 43 | Attempting to set this for a completed task will raise an exception. 44 | @param error The error for the task. 45 | */ 46 | - (void)setError:(NSError *)error; 47 | 48 | /*! 49 | Completes the task by setting an exception. 50 | Attempting to set this for a completed task will raise an exception. 51 | @param exception The exception for the task. 52 | */ 53 | - (void)setException:(NSException *)exception; 54 | 55 | /*! 56 | Completes the task by marking it as cancelled. 57 | Attempting to set this for a completed task will raise an exception. 58 | */ 59 | - (void)cancel; 60 | 61 | /*! 62 | Sets the result of the task if it wasn't already completed. 63 | @returns whether the new value was set. 64 | */ 65 | - (BOOL)trySetResult:(BFGenericType)result; 66 | 67 | /*! 68 | Sets the error of the task if it wasn't already completed. 69 | @param error The error for the task. 70 | @returns whether the new value was set. 71 | */ 72 | - (BOOL)trySetError:(NSError *)error; 73 | 74 | /*! 75 | Sets the exception of the task if it wasn't already completed. 76 | @param exception The exception for the task. 77 | @returns whether the new value was set. 78 | */ 79 | - (BOOL)trySetException:(NSException *)exception; 80 | 81 | /*! 82 | Sets the cancellation state of the task if it wasn't already completed. 83 | @returns whether the new value was set. 84 | */ 85 | - (BOOL)trySetCancelled; 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFURL.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | 13 | @class BFAppLink; 14 | 15 | /*! 16 | Provides a set of utilities for working with NSURLs, such as parsing of query parameters 17 | and handling for App Link requests. 18 | */ 19 | @interface BFURL : NSObject 20 | 21 | /*! 22 | Creates a link target from a raw URL. 23 | On success, this posts the BFAppLinkParseEventName measurement event. If you are constructing the BFURL within your application delegate's 24 | application:openURL:sourceApplication:annotation:, you should instead use URLWithInboundURL:sourceApplication: 25 | to support better BFMeasurementEvent notifications 26 | @param url The instance of `NSURL` to create BFURL from. 27 | */ 28 | + (BFURL *)URLWithURL:(NSURL *)url; 29 | 30 | /*! 31 | Creates a link target from a raw URL received from an external application. This is typically called from the app delegate's 32 | application:openURL:sourceApplication:annotation: and will post the BFAppLinkNavigateInEventName measurement event. 33 | @param url The instance of `NSURL` to create BFURL from. 34 | @param sourceApplication the bundle ID of the app that is requesting your app to open the URL. The same sourceApplication in application:openURL:sourceApplication:annotation: 35 | */ 36 | + (BFURL *)URLWithInboundURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication; 37 | 38 | /*! 39 | Gets the target URL. If the link is an App Link, this is the target of the App Link. 40 | Otherwise, it is the url that created the target. 41 | */ 42 | @property (nonatomic, strong, readonly) NSURL *targetURL; 43 | 44 | /*! 45 | Gets the query parameters for the target, parsed into an NSDictionary. 46 | */ 47 | @property (nonatomic, strong, readonly) NSDictionary *targetQueryParameters; 48 | 49 | /*! 50 | If this link target is an App Link, this is the data found in al_applink_data. 51 | Otherwise, it is nil. 52 | */ 53 | @property (nonatomic, strong, readonly) NSDictionary *appLinkData; 54 | 55 | /*! 56 | If this link target is an App Link, this is the data found in extras. 57 | */ 58 | @property (nonatomic, strong, readonly) NSDictionary *appLinkExtras; 59 | 60 | /*! 61 | The App Link indicating how to navigate back to the referer app, if any. 62 | */ 63 | @property (nonatomic, strong, readonly) BFAppLink *appLinkReferer; 64 | 65 | /*! 66 | The URL that was used to create this BFURL. 67 | */ 68 | @property (nonatomic, strong, readonly) NSURL *inputURL; 69 | 70 | /*! 71 | The query parameters of the inputURL, parsed into an NSDictionary. 72 | */ 73 | @property (nonatomic, strong, readonly) NSDictionary *inputQueryParameters; 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BFWebViewAppLinkResolver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | 13 | #import 14 | 15 | /*! 16 | A reference implementation for an App Link resolver that uses a hidden UIWebView 17 | to parse the HTML containing App Link metadata. 18 | */ 19 | @interface BFWebViewAppLinkResolver : NSObject 20 | 21 | /*! 22 | Gets the instance of a BFWebViewAppLinkResolver. 23 | */ 24 | + (instancetype)sharedInstance; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/Bolts.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 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 | 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | #import 19 | 20 | #if __has_include() && TARGET_OS_IPHONE 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #endif 31 | 32 | /*! @abstract 80175001: There were multiple errors. */ 33 | extern NSInteger const kBFMultipleErrorsError; 34 | 35 | @interface Bolts : NSObject 36 | 37 | /*! 38 | Returns the version of the Bolts Framework as an NSString. 39 | @returns The NSString representation of the current version. 40 | */ 41 | + (NSString *)version; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Bolts.framework/Headers/BoltsVersion.h: -------------------------------------------------------------------------------- 1 | #define BOLTS_VERSION @"1.2.2" 2 | -------------------------------------------------------------------------------- /Bolts.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedFish/Uber/a6e83e686517e60414d067edcccd0d202ca793e4/Bolts.framework/Info.plist -------------------------------------------------------------------------------- /Bolts.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Bolts { 2 | umbrella header "Bolts.h" 3 | 4 | export * 5 | module * { export * } 6 | 7 | explicit module BFAppLinkResolving { 8 | header "BFAppLinkResolving.h" 9 | export * 10 | } 11 | explicit module BFWebViewAppLinkResolver { 12 | header "BFWebViewAppLinkResolver.h" 13 | export * 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFACL.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | 14 | PF_ASSUME_NONNULL_BEGIN 15 | 16 | @class PFRole; 17 | @class PFUser; 18 | 19 | /*! 20 | The `PFACL` class is used to control which users can access or modify a particular object. 21 | Each can have its own `PFACL`. You can grant read and write permissions separately to specific users, 22 | to groups of users that belong to roles, or you can grant permissions to "the public" so that, 23 | for example, any user could read a particular object but only a particular set of users could write to that object. 24 | */ 25 | @interface PFACL : NSObject 26 | 27 | ///-------------------------------------- 28 | /// @name Creating an ACL 29 | ///-------------------------------------- 30 | 31 | /*! 32 | @abstract Creates an ACL with no permissions granted. 33 | 34 | @returns Returns a new `PFACL`. 35 | */ 36 | + (instancetype)ACL; 37 | 38 | /*! 39 | @abstract Creates an ACL where only the provided user has access. 40 | 41 | @param user The user to assign access. 42 | */ 43 | + (instancetype)ACLWithUser:(PFUser *)user; 44 | 45 | ///-------------------------------------- 46 | /// @name Controlling Public Access 47 | ///-------------------------------------- 48 | 49 | /*! 50 | @abstract Set whether the public is allowed to read this object. 51 | 52 | @param allowed Whether the public can read this object. 53 | */ 54 | - (void)setPublicReadAccess:(BOOL)allowed; 55 | 56 | /*! 57 | @abstract Gets whether the public is allowed to read this object. 58 | 59 | @returns `YES` if the public read access is enabled, otherwise `NO`. 60 | */ 61 | - (BOOL)getPublicReadAccess; 62 | 63 | /*! 64 | @abstract Set whether the public is allowed to write this object. 65 | 66 | @param allowed Whether the public can write this object. 67 | */ 68 | - (void)setPublicWriteAccess:(BOOL)allowed; 69 | 70 | /*! 71 | @abstract Gets whether the public is allowed to write this object. 72 | 73 | @returns `YES` if the public write access is enabled, otherwise `NO`. 74 | */ 75 | - (BOOL)getPublicWriteAccess; 76 | 77 | ///-------------------------------------- 78 | /// @name Controlling Access Per-User 79 | ///-------------------------------------- 80 | 81 | /*! 82 | @abstract Set whether the given user id is allowed to read this object. 83 | 84 | @param allowed Whether the given user can write this object. 85 | @param userId The <[PFObject objectId]> of the user to assign access. 86 | */ 87 | - (void)setReadAccess:(BOOL)allowed forUserId:(NSString *)userId; 88 | 89 | /*! 90 | @abstract Gets whether the given user id is *explicitly* allowed to read this object. 91 | Even if this returns `NO`, the user may still be able to access it if returns `YES` 92 | or if the user belongs to a role that has access. 93 | 94 | @param userId The <[PFObject objectId]> of the user for which to retrive access. 95 | 96 | @returns `YES` if the user with this `objectId` has *explicit* read access, otherwise `NO`. 97 | */ 98 | - (BOOL)getReadAccessForUserId:(NSString *)userId; 99 | 100 | /*! 101 | @abstract Set whether the given user id is allowed to write this object. 102 | 103 | @param allowed Whether the given user can read this object. 104 | @param userId The `objectId` of the user to assign access. 105 | */ 106 | - (void)setWriteAccess:(BOOL)allowed forUserId:(NSString *)userId; 107 | 108 | /*! 109 | @abstract Gets whether the given user id is *explicitly* allowed to write this object. 110 | Even if this returns NO, the user may still be able to write it if returns `YES` 111 | or if the user belongs to a role that has access. 112 | 113 | @param userId The <[PFObject objectId]> of the user for which to retrive access. 114 | 115 | @returns `YES` if the user with this `objectId` has *explicit* write access, otherwise `NO`. 116 | */ 117 | - (BOOL)getWriteAccessForUserId:(NSString *)userId; 118 | 119 | /*! 120 | @abstract Set whether the given user is allowed to read this object. 121 | 122 | @param allowed Whether the given user can read this object. 123 | @param user The user to assign access. 124 | */ 125 | - (void)setReadAccess:(BOOL)allowed forUser:(PFUser *)user; 126 | 127 | /*! 128 | @abstract Gets whether the given user is *explicitly* allowed to read this object. 129 | Even if this returns `NO`, the user may still be able to access it if returns `YES` 130 | or if the user belongs to a role that has access. 131 | 132 | @param user The user for which to retrive access. 133 | 134 | @returns `YES` if the user has *explicit* read access, otherwise `NO`. 135 | */ 136 | - (BOOL)getReadAccessForUser:(PFUser *)user; 137 | 138 | /*! 139 | @abstract Set whether the given user is allowed to write this object. 140 | 141 | @param allowed Whether the given user can write this object. 142 | @param user The user to assign access. 143 | */ 144 | - (void)setWriteAccess:(BOOL)allowed forUser:(PFUser *)user; 145 | 146 | /*! 147 | @abstract Gets whether the given user is *explicitly* allowed to write this object. 148 | Even if this returns `NO`, the user may still be able to write it if returns `YES` 149 | or if the user belongs to a role that has access. 150 | 151 | @param user The user for which to retrive access. 152 | 153 | @returns `YES` if the user has *explicit* write access, otherwise `NO`. 154 | */ 155 | - (BOOL)getWriteAccessForUser:(PFUser *)user; 156 | 157 | ///-------------------------------------- 158 | /// @name Controlling Access Per-Role 159 | ///-------------------------------------- 160 | 161 | /*! 162 | @abstract Get whether users belonging to the role with the given name are allowed to read this object. 163 | Even if this returns `NO`, the role may still be able to read it if a parent role has read access. 164 | 165 | @param name The name of the role. 166 | 167 | @returns `YES` if the role has read access, otherwise `NO`. 168 | */ 169 | - (BOOL)getReadAccessForRoleWithName:(NSString *)name; 170 | 171 | /*! 172 | @abstract Set whether users belonging to the role with the given name are allowed to read this object. 173 | 174 | @param allowed Whether the given role can read this object. 175 | @param name The name of the role. 176 | */ 177 | - (void)setReadAccess:(BOOL)allowed forRoleWithName:(NSString *)name; 178 | 179 | /*! 180 | @abstract Get whether users belonging to the role with the given name are allowed to write this object. 181 | Even if this returns `NO`, the role may still be able to write it if a parent role has write access. 182 | 183 | @param name The name of the role. 184 | 185 | @returns `YES` if the role has read access, otherwise `NO`. 186 | */ 187 | - (BOOL)getWriteAccessForRoleWithName:(NSString *)name; 188 | 189 | /*! 190 | @abstract Set whether users belonging to the role with the given name are allowed to write this object. 191 | 192 | @param allowed Whether the given role can write this object. 193 | @param name The name of the role. 194 | */ 195 | - (void)setWriteAccess:(BOOL)allowed forRoleWithName:(NSString *)name; 196 | 197 | /*! 198 | @abstract Get whether users belonging to the given role are allowed to read this object. 199 | Even if this returns `NO`, the role may still be able to read it if a parent role has read access. 200 | 201 | @discussion The role must already be saved on the server and 202 | it's data must have been fetched in order to use this method. 203 | 204 | @param role The name of the role. 205 | 206 | @returns `YES` if the role has read access, otherwise `NO`. 207 | */ 208 | - (BOOL)getReadAccessForRole:(PFRole *)role; 209 | 210 | /*! 211 | @abstract Set whether users belonging to the given role are allowed to read this object. 212 | 213 | @discussion The role must already be saved on the server and 214 | it's data must have been fetched in order to use this method. 215 | 216 | @param allowed Whether the given role can read this object. 217 | @param role The role to assign access. 218 | */ 219 | - (void)setReadAccess:(BOOL)allowed forRole:(PFRole *)role; 220 | 221 | /*! 222 | @abstract Get whether users belonging to the given role are allowed to write this object. 223 | Even if this returns `NO`, the role may still be able to write it if a parent role has write access. 224 | 225 | @discussion The role must already be saved on the server and 226 | it's data must have been fetched in order to use this method. 227 | 228 | @param role The name of the role. 229 | 230 | @returns `YES` if the role has write access, otherwise `NO`. 231 | */ 232 | - (BOOL)getWriteAccessForRole:(PFRole *)role; 233 | 234 | /*! 235 | @abstract Set whether users belonging to the given role are allowed to write this object. 236 | 237 | @discussion The role must already be saved on the server and 238 | it's data must have been fetched in order to use this method. 239 | 240 | @param allowed Whether the given role can write this object. 241 | @param role The role to assign access. 242 | */ 243 | - (void)setWriteAccess:(BOOL)allowed forRole:(PFRole *)role; 244 | 245 | ///-------------------------------------- 246 | /// @name Setting Access Defaults 247 | ///-------------------------------------- 248 | 249 | /*! 250 | @abstract Sets a default ACL that will be applied to all instances of when they are created. 251 | 252 | @param acl The ACL to use as a template for all instance of created after this method has been called. 253 | This value will be copied and used as a template for the creation of new ACLs, so changes to the 254 | instance after this method has been called will not be reflected in new instance of . 255 | @param currentUserAccess - If `YES`, the `PFACL` that is applied to newly-created instance of will 256 | provide read and write access to the <[PFUser currentUser]> at the time of creation. 257 | - If `NO`, the provided `acl` will be used without modification. 258 | - If `acl` is `nil`, this value is ignored. 259 | */ 260 | + (void)setDefaultACL:(PF_NULLABLE PFACL *)acl withAccessForCurrentUser:(BOOL)currentUserAccess; 261 | 262 | @end 263 | 264 | PF_ASSUME_NONNULL_END 265 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFAnalytics.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | 14 | #import 15 | 16 | PF_ASSUME_NONNULL_BEGIN 17 | 18 | /*! 19 | `PFAnalytics` provides an interface to Parse's logging and analytics backend. 20 | 21 | Methods will return immediately and cache the request (+ timestamp) to be 22 | handled "eventually." That is, the request will be sent immediately if possible 23 | or the next time a network connection is available. 24 | */ 25 | @interface PFAnalytics : NSObject 26 | 27 | ///-------------------------------------- 28 | /// @name App-Open / Push Analytics 29 | ///-------------------------------------- 30 | 31 | /*! 32 | @abstract Tracks this application being launched. If this happened as the result of the 33 | user opening a push notification, this method sends along information to 34 | correlate this open with that push. 35 | 36 | @discussion Pass in `nil` to track a standard "application opened" event. 37 | 38 | @param launchOptions The `NSDictionary` indicating the reason the application was 39 | launched, if any. This value can be found as a parameter to various 40 | `UIApplicationDelegate` methods, and can be empty or `nil`. 41 | 42 | @returns Returns the task encapsulating the work being done. 43 | */ 44 | + (BFTask PF_GENERIC(NSNumber *)*)trackAppOpenedWithLaunchOptions:(PF_NULLABLE NSDictionary *)launchOptions; 45 | 46 | /*! 47 | @abstract Tracks this application being launched. 48 | If this happened as the result of the user opening a push notification, 49 | this method sends along information to correlate this open with that push. 50 | 51 | @discussion Pass in `nil` to track a standard "application opened" event. 52 | 53 | @param launchOptions The dictionary indicating the reason the application was 54 | launched, if any. This value can be found as a parameter to various 55 | `UIApplicationDelegate` methods, and can be empty or `nil`. 56 | @param block The block to execute on server response. 57 | It should have the following argument signature: `^(BOOL succeeded, NSError *error)` 58 | */ 59 | + (void)trackAppOpenedWithLaunchOptionsInBackground:(PF_NULLABLE NSDictionary *)launchOptions 60 | block:(PF_NULLABLE PFBooleanResultBlock)block; 61 | 62 | /*! 63 | @abstract Tracks this application being launched. If this happened as the result of the 64 | user opening a push notification, this method sends along information to 65 | correlate this open with that push. 66 | 67 | @param userInfo The Remote Notification payload, if any. This value can be 68 | found either under `UIApplicationLaunchOptionsRemoteNotificationKey` on `launchOptions`, 69 | or as a parameter to `application:didReceiveRemoteNotification:`. 70 | This can be empty or `nil`. 71 | 72 | @returns Returns the task encapsulating the work being done. 73 | */ 74 | + (BFTask PF_GENERIC(NSNumber *)*)trackAppOpenedWithRemoteNotificationPayload:(PF_NULLABLE NSDictionary *)userInfo; 75 | 76 | /*! 77 | @abstract Tracks this application being launched. If this happened as the result of the 78 | user opening a push notification, this method sends along information to 79 | correlate this open with that push. 80 | 81 | @param userInfo The Remote Notification payload, if any. This value can be 82 | found either under `UIApplicationLaunchOptionsRemoteNotificationKey` on `launchOptions`, 83 | or as a parameter to `application:didReceiveRemoteNotification:`. This can be empty or `nil`. 84 | @param block The block to execute on server response. 85 | It should have the following argument signature: `^(BOOL succeeded, NSError *error)` 86 | */ 87 | + (void)trackAppOpenedWithRemoteNotificationPayloadInBackground:(PF_NULLABLE NSDictionary *)userInfo 88 | block:(PF_NULLABLE PFBooleanResultBlock)block; 89 | 90 | ///-------------------------------------- 91 | /// @name Custom Analytics 92 | ///-------------------------------------- 93 | 94 | /*! 95 | @abstract Tracks the occurrence of a custom event. 96 | 97 | @discussion Parse will store a data point at the time of invocation with the given event name. 98 | 99 | @param name The name of the custom event to report to Parse as having happened. 100 | 101 | @returns Returns the task encapsulating the work being done. 102 | */ 103 | + (BFTask PF_GENERIC(NSNumber *)*)trackEvent:(NSString *)name; 104 | 105 | /*! 106 | @abstract Tracks the occurrence of a custom event. Parse will store a data point at the 107 | time of invocation with the given event name. The event will be sent at some 108 | unspecified time in the future, even if Parse is currently inaccessible. 109 | 110 | @param name The name of the custom event to report to Parse as having happened. 111 | @param block The block to execute on server response. 112 | It should have the following argument signature: `^(BOOL succeeded, NSError *error)` 113 | */ 114 | + (void)trackEventInBackground:(NSString *)name block:(PF_NULLABLE PFBooleanResultBlock)block; 115 | 116 | /*! 117 | @abstract Tracks the occurrence of a custom event with additional dimensions. Parse will 118 | store a data point at the time of invocation with the given event name. 119 | 120 | @discussion Dimensions will allow segmentation of the occurrences of this custom event. 121 | Keys and values should be NSStrings, and will throw otherwise. 122 | 123 | To track a user signup along with additional metadata, consider the following: 124 | 125 | NSDictionary *dimensions = @{ @"gender": @"m", 126 | @"source": @"web", 127 | @"dayType": @"weekend" }; 128 | [PFAnalytics trackEvent:@"signup" dimensions:dimensions]; 129 | 130 | @warning There is a default limit of 8 dimensions per event tracked. 131 | 132 | @param name The name of the custom event to report to Parse as having happened. 133 | @param dimensions The `NSDictionary` of information by which to segment this event. 134 | 135 | @returns Returns the task encapsulating the work being done. 136 | */ 137 | + (BFTask PF_GENERIC(NSNumber *)*)trackEvent:(NSString *)name dimensions:(PF_NULLABLE NSDictionary *)dimensions; 138 | 139 | /*! 140 | @abstract Tracks the occurrence of a custom event with additional dimensions. Parse will 141 | store a data point at the time of invocation with the given event name. The 142 | event will be sent at some unspecified time in the future, even if Parse is currently inaccessible. 143 | 144 | @discussionDimensions will allow segmentation of the occurrences of this custom event. 145 | Keys and values should be NSStrings, and will throw otherwise. 146 | 147 | To track a user signup along with additional metadata, consider the following: 148 | NSDictionary *dimensions = @{ @"gender": @"m", 149 | @"source": @"web", 150 | @"dayType": @"weekend" }; 151 | [PFAnalytics trackEvent:@"signup" dimensions:dimensions]; 152 | 153 | There is a default limit of 8 dimensions per event tracked. 154 | 155 | @param name The name of the custom event to report to Parse as having happened. 156 | @param dimensions The `NSDictionary` of information by which to segment this event. 157 | @param block The block to execute on server response. 158 | It should have the following argument signature: `^(BOOL succeeded, NSError *error)` 159 | */ 160 | + (void)trackEventInBackground:(NSString *)name 161 | dimensions:(PF_NULLABLE NSDictionary *)dimensions 162 | block:(PF_NULLABLE PFBooleanResultBlock)block; 163 | 164 | @end 165 | 166 | PF_ASSUME_NONNULL_END 167 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFAnonymousUtils.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | 14 | #import 15 | #import 16 | 17 | PF_ASSUME_NONNULL_BEGIN 18 | 19 | /*! 20 | Provides utility functions for working with Anonymously logged-in users. 21 | Anonymous users have some unique characteristics: 22 | 23 | - Anonymous users don't need a user name or password. 24 | - Once logged out, an anonymous user cannot be recovered. 25 | - When the current user is anonymous, the following methods can be used to switch 26 | to a different user or convert the anonymous user into a regular one: 27 | - signUp converts an anonymous user to a standard user with the given username and password. 28 | Data associated with the anonymous user is retained. 29 | - logIn switches users without converting the anonymous user. 30 | Data associated with the anonymous user will be lost. 31 | - Service logIn (e.g. Facebook, Twitter) will attempt to convert 32 | the anonymous user into a standard user by linking it to the service. 33 | If a user already exists that is linked to the service, it will instead switch to the existing user. 34 | - Service linking (e.g. Facebook, Twitter) will convert the anonymous user 35 | into a standard user by linking it to the service. 36 | */ 37 | @interface PFAnonymousUtils : NSObject 38 | 39 | ///-------------------------------------- 40 | /// @name Creating an Anonymous User 41 | ///-------------------------------------- 42 | 43 | /*! 44 | @abstract Creates an anonymous user asynchronously and sets as a result to `BFTask`. 45 | 46 | @returns The task, that encapsulates the work being done. 47 | */ 48 | + (BFTask PF_GENERIC(PFUser *)*)logInInBackground; 49 | 50 | /*! 51 | @abstract Creates an anonymous user. 52 | 53 | @param block The block to execute when anonymous user creation is complete. 54 | It should have the following argument signature: `^(PFUser *user, NSError *error)`. 55 | */ 56 | + (void)logInWithBlock:(PF_NULLABLE PFUserResultBlock)block; 57 | 58 | /* 59 | @abstract Creates an anonymous user. 60 | 61 | @param target Target object for the selector. 62 | @param selector The selector that will be called when the asynchronous request is complete. 63 | It should have the following signature: `(void)callbackWithUser:(PFUser *)user error:(NSError *)error`. 64 | */ 65 | + (void)logInWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector; 66 | 67 | ///-------------------------------------- 68 | /// @name Determining Whether a User is Anonymous 69 | ///-------------------------------------- 70 | 71 | /*! 72 | @abstract Whether the object is logged in anonymously. 73 | 74 | @param user object to check for anonymity. The user must be logged in on this device. 75 | 76 | @returns `YES` if the user is anonymous. `NO` if the user is not the current user or is not anonymous. 77 | */ 78 | + (BOOL)isLinkedWithUser:(PF_NULLABLE PFUser *)user; 79 | 80 | @end 81 | 82 | PF_ASSUME_NONNULL_END 83 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFCloud.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | 14 | #import 15 | 16 | PF_ASSUME_NONNULL_BEGIN 17 | 18 | /*! 19 | The `PFCloud` class provides methods for interacting with Parse Cloud Functions. 20 | */ 21 | @interface PFCloud : NSObject 22 | 23 | /*! 24 | @abstract Calls the given cloud function *synchronously* with the parameters provided. 25 | 26 | @param function The function name to call. 27 | @param parameters The parameters to send to the function. 28 | 29 | @returns The response from the cloud function. 30 | */ 31 | + (PF_NULLABLE_S id)callFunction:(NSString *)function 32 | withParameters:(PF_NULLABLE NSDictionary *)parameters PF_SWIFT_UNAVAILABLE; 33 | 34 | /*! 35 | @abstract Calls the given cloud function *synchronously* with the parameters provided and 36 | sets the error if there is one. 37 | 38 | @param function The function name to call. 39 | @param parameters The parameters to send to the function. 40 | @param error Pointer to an `NSError` that will be set if necessary. 41 | 42 | @returns The response from the cloud function. 43 | This result could be a `NSDictionary`, an `NSArray`, `NSNumber` or `NSString`. 44 | */ 45 | + (PF_NULLABLE_S id)callFunction:(NSString *)function 46 | withParameters:(PF_NULLABLE NSDictionary *)parameters 47 | error:(NSError **)error; 48 | 49 | /*! 50 | @abstract Calls the given cloud function *asynchronously* with the parameters provided. 51 | 52 | @param function The function name to call. 53 | @param parameters The parameters to send to the function. 54 | 55 | @returns The task, that encapsulates the work being done. 56 | */ 57 | + (BFTask *)callFunctionInBackground:(NSString *)function 58 | withParameters:(PF_NULLABLE NSDictionary *)parameters; 59 | 60 | /*! 61 | @abstract Calls the given cloud function *asynchronously* with the parameters provided 62 | and executes the given block when it is done. 63 | 64 | @param function The function name to call. 65 | @param parameters The parameters to send to the function. 66 | @param block The block to execute when the function call finished. 67 | It should have the following argument signature: `^(id result, NSError *error)`. 68 | */ 69 | + (void)callFunctionInBackground:(NSString *)function 70 | withParameters:(PF_NULLABLE NSDictionary *)parameters 71 | block:(PF_NULLABLE PFIdResultBlock)block; 72 | 73 | /* 74 | @abstract Calls the given cloud function *asynchronously* with the parameters provided 75 | and then executes the given selector when it is done. 76 | 77 | @param function The function name to call. 78 | @param parameters The parameters to send to the function. 79 | @param target The object to call the selector on. 80 | @param selector The selector to call when the function call finished. 81 | It should have the following signature: `(void)callbackWithResult:(id)result error:(NSError *)error`. 82 | Result will be `nil` if error is set and vice versa. 83 | */ 84 | + (void)callFunctionInBackground:(NSString *)function 85 | withParameters:(PF_NULLABLE NSDictionary *)parameters 86 | target:(PF_NULLABLE_S id)target 87 | selector:(PF_NULLABLE_S SEL)selector; 88 | 89 | @end 90 | 91 | PF_ASSUME_NONNULL_END 92 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFConfig.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | 14 | #import 15 | #import 16 | 17 | PF_ASSUME_NONNULL_BEGIN 18 | 19 | @class PFConfig; 20 | 21 | typedef void(^PFConfigResultBlock)(PFConfig *PF_NULLABLE_S config, NSError *PF_NULLABLE_S error); 22 | 23 | /*! 24 | `PFConfig` is a representation of the remote configuration object. 25 | It enables you to add things like feature gating, a/b testing or simple "Message of the day". 26 | */ 27 | @interface PFConfig : NSObject 28 | 29 | ///-------------------------------------- 30 | /// @name Current Config 31 | ///-------------------------------------- 32 | 33 | /*! 34 | @abstract Returns the most recently fetched config. 35 | 36 | @discussion If there was no config fetched - this method will return an empty instance of `PFConfig`. 37 | 38 | @returns Current, last fetched instance of PFConfig. 39 | */ 40 | + (PFConfig *)currentConfig; 41 | 42 | ///-------------------------------------- 43 | /// @name Retrieving Config 44 | ///-------------------------------------- 45 | 46 | /*! 47 | @abstract Gets the `PFConfig` object *synchronously* from the server. 48 | 49 | @returns Instance of `PFConfig` if the operation succeeded, otherwise `nil`. 50 | */ 51 | + (PF_NULLABLE PFConfig *)getConfig PF_SWIFT_UNAVAILABLE; 52 | 53 | /*! 54 | @abstract Gets the `PFConfig` object *synchronously* from the server and sets an error if it occurs. 55 | 56 | @param error Pointer to an `NSError` that will be set if necessary. 57 | 58 | @returns Instance of PFConfig if the operation succeeded, otherwise `nil`. 59 | */ 60 | + (PF_NULLABLE PFConfig *)getConfig:(NSError **)error; 61 | 62 | /*! 63 | @abstract Gets the `PFConfig` *asynchronously* and sets it as a result of a task. 64 | 65 | @returns The task, that encapsulates the work being done. 66 | */ 67 | + (BFTask PF_GENERIC(PFConfig *)*)getConfigInBackground; 68 | 69 | /*! 70 | @abstract Gets the `PFConfig` *asynchronously* and executes the given callback block. 71 | 72 | @param block The block to execute. 73 | It should have the following argument signature: `^(PFConfig *config, NSError *error)`. 74 | */ 75 | + (void)getConfigInBackgroundWithBlock:(PF_NULLABLE PFConfigResultBlock)block; 76 | 77 | ///-------------------------------------- 78 | /// @name Parameters 79 | ///-------------------------------------- 80 | 81 | /*! 82 | @abstract Returns the object associated with a given key. 83 | 84 | @param key The key for which to return the corresponding configuration value. 85 | 86 | @returns The value associated with `key`, or `nil` if there is no such value. 87 | */ 88 | - (PF_NULLABLE_S id)objectForKey:(NSString *)key; 89 | 90 | /*! 91 | @abstract Returns the object associated with a given key. 92 | 93 | @discussion This method enables usage of literal syntax on `PFConfig`. 94 | E.g. `NSString *value = config[@"key"];` 95 | 96 | @see objectForKey: 97 | 98 | @param keyedSubscript The keyed subscript for which to return the corresponding configuration value. 99 | 100 | @returns The value associated with `key`, or `nil` if there is no such value. 101 | */ 102 | - (PF_NULLABLE_S id)objectForKeyedSubscript:(NSString *)keyedSubscript; 103 | 104 | @end 105 | 106 | PF_ASSUME_NONNULL_END 107 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFConstants.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | 14 | @class PFObject; 15 | @class PFUser; 16 | 17 | ///-------------------------------------- 18 | /// @name Version 19 | ///-------------------------------------- 20 | 21 | #define PARSE_VERSION @"1.8.5" 22 | 23 | extern NSInteger const PARSE_API_VERSION; 24 | 25 | ///-------------------------------------- 26 | /// @name Platform 27 | ///-------------------------------------- 28 | 29 | #define PARSE_IOS_ONLY (TARGET_OS_IPHONE) 30 | #define PARSE_OSX_ONLY (TARGET_OS_MAC && !(TARGET_OS_IPHONE)) 31 | 32 | extern NSString *const PF_NONNULL_S kPFDeviceType; 33 | 34 | #if PARSE_IOS_ONLY 35 | #import 36 | #else 37 | #import 38 | #endif 39 | 40 | ///-------------------------------------- 41 | /// @name Server 42 | ///-------------------------------------- 43 | 44 | extern NSString *const PF_NONNULL_S kPFParseServer; 45 | 46 | ///-------------------------------------- 47 | /// @name Cache Policies 48 | ///-------------------------------------- 49 | 50 | /*! 51 | `PFCachePolicy` specifies different caching policies that could be used with . 52 | 53 | This lets you show data when the user's device is offline, 54 | or when the app has just started and network requests have not yet had time to complete. 55 | Parse takes care of automatically flushing the cache when it takes up too much space. 56 | 57 | @warning Cache policy could only be set when Local Datastore is not enabled. 58 | 59 | @see PFQuery 60 | */ 61 | typedef NS_ENUM(uint8_t, PFCachePolicy) { 62 | /*! 63 | @abstract The query does not load from the cache or save results to the cache. 64 | This is the default cache policy. 65 | */ 66 | kPFCachePolicyIgnoreCache = 0, 67 | /*! 68 | @abstract The query only loads from the cache, ignoring the network. 69 | If there are no cached results, this causes a `NSError` with `kPFErrorCacheMiss` code. 70 | */ 71 | kPFCachePolicyCacheOnly, 72 | /*! 73 | @abstract The query does not load from the cache, but it will save results to the cache. 74 | */ 75 | kPFCachePolicyNetworkOnly, 76 | /*! 77 | @abstract The query first tries to load from the cache, but if that fails, it loads results from the network. 78 | If there are no cached results, this causes a `NSError` with `kPFErrorCacheMiss` code. 79 | */ 80 | kPFCachePolicyCacheElseNetwork, 81 | /*! 82 | @abstract The query first tries to load from the network, but if that fails, it loads results from the cache. 83 | If there are no cached results, this causes a `NSError` with `kPFErrorCacheMiss` code. 84 | */ 85 | kPFCachePolicyNetworkElseCache, 86 | /*! 87 | @abstract The query first loads from the cache, then loads from the network. 88 | The callback will be called twice - first with the cached results, then with the network results. 89 | Since it returns two results at different times, this cache policy cannot be used with synchronous or task methods. 90 | */ 91 | kPFCachePolicyCacheThenNetwork 92 | }; 93 | 94 | ///-------------------------------------- 95 | /// @name Logging Levels 96 | ///-------------------------------------- 97 | 98 | /*! 99 | `PFLogLevel` enum specifies different levels of logging that could be used to limit or display more messages in logs. 100 | 101 | @see [Parse setLogLevel:] 102 | @see [Parse logLevel] 103 | */ 104 | typedef NS_ENUM(uint8_t, PFLogLevel) { 105 | /*! 106 | Log level that disables all logging. 107 | */ 108 | PFLogLevelNone = 0, 109 | /*! 110 | Log level that if set is going to output error messages to the log. 111 | */ 112 | PFLogLevelError = 1, 113 | /*! 114 | Log level that if set is going to output the following messages to log: 115 | - Errors 116 | - Warnings 117 | */ 118 | PFLogLevelWarning = 2, 119 | /*! 120 | Log level that if set is going to output the following messages to log: 121 | - Errors 122 | - Warnings 123 | - Informational messages 124 | */ 125 | PFLogLevelInfo = 3, 126 | /*! 127 | Log level that if set is going to output the following messages to log: 128 | - Errors 129 | - Warnings 130 | - Informational messages 131 | - Debug messages 132 | */ 133 | PFLogLevelDebug = 4 134 | }; 135 | 136 | ///-------------------------------------- 137 | /// @name Errors 138 | ///-------------------------------------- 139 | 140 | extern NSString *const PF_NONNULL_S PFParseErrorDomain; 141 | 142 | /*! 143 | `PFErrorCode` enum contains all custom error codes that are used as `code` for `NSError` for callbacks on all classes. 144 | 145 | These codes are used when `domain` of `NSError` that you receive is set to `PFParseErrorDomain`. 146 | */ 147 | typedef NS_ENUM(NSInteger, PFErrorCode) { 148 | /*! 149 | @abstract Internal server error. No information available. 150 | */ 151 | kPFErrorInternalServer = 1, 152 | /*! 153 | @abstract The connection to the Parse servers failed. 154 | */ 155 | kPFErrorConnectionFailed = 100, 156 | /*! 157 | @abstract Object doesn't exist, or has an incorrect password. 158 | */ 159 | kPFErrorObjectNotFound = 101, 160 | /*! 161 | @abstract You tried to find values matching a datatype that doesn't 162 | support exact database matching, like an array or a dictionary. 163 | */ 164 | kPFErrorInvalidQuery = 102, 165 | /*! 166 | @abstract Missing or invalid classname. Classnames are case-sensitive. 167 | They must start with a letter, and `a-zA-Z0-9_` are the only valid characters. 168 | */ 169 | kPFErrorInvalidClassName = 103, 170 | /*! 171 | @abstract Missing object id. 172 | */ 173 | kPFErrorMissingObjectId = 104, 174 | /*! 175 | @abstract Invalid key name. Keys are case-sensitive. 176 | They must start with a letter, and `a-zA-Z0-9_` are the only valid characters. 177 | */ 178 | kPFErrorInvalidKeyName = 105, 179 | /*! 180 | @abstract Malformed pointer. Pointers must be arrays of a classname and an object id. 181 | */ 182 | kPFErrorInvalidPointer = 106, 183 | /*! 184 | @abstract Malformed json object. A json dictionary is expected. 185 | */ 186 | kPFErrorInvalidJSON = 107, 187 | /*! 188 | @abstract Tried to access a feature only available internally. 189 | */ 190 | kPFErrorCommandUnavailable = 108, 191 | /*! 192 | @abstract Field set to incorrect type. 193 | */ 194 | kPFErrorIncorrectType = 111, 195 | /*! 196 | @abstract Invalid channel name. A channel name is either an empty string (the broadcast channel) 197 | or contains only `a-zA-Z0-9_` characters and starts with a letter. 198 | */ 199 | kPFErrorInvalidChannelName = 112, 200 | /*! 201 | @abstract Invalid device token. 202 | */ 203 | kPFErrorInvalidDeviceToken = 114, 204 | /*! 205 | @abstract Push is misconfigured. See details to find out how. 206 | */ 207 | kPFErrorPushMisconfigured = 115, 208 | /*! 209 | @abstract The object is too large. 210 | */ 211 | kPFErrorObjectTooLarge = 116, 212 | /*! 213 | @abstract That operation isn't allowed for clients. 214 | */ 215 | kPFErrorOperationForbidden = 119, 216 | /*! 217 | @abstract The results were not found in the cache. 218 | */ 219 | kPFErrorCacheMiss = 120, 220 | /*! 221 | @abstract Keys in `NSDictionary` values may not include `$` or `.`. 222 | */ 223 | kPFErrorInvalidNestedKey = 121, 224 | /*! 225 | @abstract Invalid file name. 226 | A file name can contain only `a-zA-Z0-9_.` characters and should be between 1 and 36 characters. 227 | */ 228 | kPFErrorInvalidFileName = 122, 229 | /*! 230 | @abstract Invalid ACL. An ACL with an invalid format was saved. This should not happen if you use . 231 | */ 232 | kPFErrorInvalidACL = 123, 233 | /*! 234 | @abstract The request timed out on the server. Typically this indicates the request is too expensive. 235 | */ 236 | kPFErrorTimeout = 124, 237 | /*! 238 | @abstract The email address was invalid. 239 | */ 240 | kPFErrorInvalidEmailAddress = 125, 241 | /*! 242 | A unique field was given a value that is already taken. 243 | */ 244 | kPFErrorDuplicateValue = 137, 245 | /*! 246 | @abstract Role's name is invalid. 247 | */ 248 | kPFErrorInvalidRoleName = 139, 249 | /*! 250 | @abstract Exceeded an application quota. Upgrade to resolve. 251 | */ 252 | kPFErrorExceededQuota = 140, 253 | /*! 254 | @abstract Cloud Code script had an error. 255 | */ 256 | kPFScriptError = 141, 257 | /*! 258 | @abstract Cloud Code validation failed. 259 | */ 260 | kPFValidationError = 142, 261 | /*! 262 | @abstract Product purchase receipt is missing. 263 | */ 264 | kPFErrorReceiptMissing = 143, 265 | /*! 266 | @abstract Product purchase receipt is invalid. 267 | */ 268 | kPFErrorInvalidPurchaseReceipt = 144, 269 | /*! 270 | @abstract Payment is disabled on this device. 271 | */ 272 | kPFErrorPaymentDisabled = 145, 273 | /*! 274 | @abstract The product identifier is invalid. 275 | */ 276 | kPFErrorInvalidProductIdentifier = 146, 277 | /*! 278 | @abstract The product is not found in the App Store. 279 | */ 280 | kPFErrorProductNotFoundInAppStore = 147, 281 | /*! 282 | @abstract The Apple server response is not valid. 283 | */ 284 | kPFErrorInvalidServerResponse = 148, 285 | /*! 286 | @abstract Product fails to download due to file system error. 287 | */ 288 | kPFErrorProductDownloadFileSystemFailure = 149, 289 | /*! 290 | @abstract Fail to convert data to image. 291 | */ 292 | kPFErrorInvalidImageData = 150, 293 | /*! 294 | @abstract Unsaved file. 295 | */ 296 | kPFErrorUnsavedFile = 151, 297 | /*! 298 | @abstract Fail to delete file. 299 | */ 300 | kPFErrorFileDeleteFailure = 153, 301 | /*! 302 | @abstract Application has exceeded its request limit. 303 | */ 304 | kPFErrorRequestLimitExceeded = 155, 305 | /*! 306 | @abstract Invalid event name. 307 | */ 308 | kPFErrorInvalidEventName = 160, 309 | /*! 310 | @abstract Username is missing or empty. 311 | */ 312 | kPFErrorUsernameMissing = 200, 313 | /*! 314 | @abstract Password is missing or empty. 315 | */ 316 | kPFErrorUserPasswordMissing = 201, 317 | /*! 318 | @abstract Username has already been taken. 319 | */ 320 | kPFErrorUsernameTaken = 202, 321 | /*! 322 | @abstract Email has already been taken. 323 | */ 324 | kPFErrorUserEmailTaken = 203, 325 | /*! 326 | @abstract The email is missing, and must be specified. 327 | */ 328 | kPFErrorUserEmailMissing = 204, 329 | /*! 330 | @abstract A user with the specified email was not found. 331 | */ 332 | kPFErrorUserWithEmailNotFound = 205, 333 | /*! 334 | @abstract The user cannot be altered by a client without the session. 335 | */ 336 | kPFErrorUserCannotBeAlteredWithoutSession = 206, 337 | /*! 338 | @abstract Users can only be created through sign up. 339 | */ 340 | kPFErrorUserCanOnlyBeCreatedThroughSignUp = 207, 341 | /*! 342 | @abstract An existing Facebook account already linked to another user. 343 | */ 344 | kPFErrorFacebookAccountAlreadyLinked = 208, 345 | /*! 346 | @abstract An existing account already linked to another user. 347 | */ 348 | kPFErrorAccountAlreadyLinked = 208, 349 | /*! 350 | Error code indicating that the current session token is invalid. 351 | */ 352 | kPFErrorInvalidSessionToken = 209, 353 | kPFErrorUserIdMismatch = 209, 354 | /*! 355 | @abstract Facebook id missing from request. 356 | */ 357 | kPFErrorFacebookIdMissing = 250, 358 | /*! 359 | @abstract Linked id missing from request. 360 | */ 361 | kPFErrorLinkedIdMissing = 250, 362 | /*! 363 | @abstract Invalid Facebook session. 364 | */ 365 | kPFErrorFacebookInvalidSession = 251, 366 | /*! 367 | @abstract Invalid linked session. 368 | */ 369 | kPFErrorInvalidLinkedSession = 251, 370 | }; 371 | 372 | ///-------------------------------------- 373 | /// @name Blocks 374 | ///-------------------------------------- 375 | 376 | typedef void (^PFBooleanResultBlock)(BOOL succeeded, NSError *PF_NULLABLE_S error); 377 | typedef void (^PFIntegerResultBlock)(int number, NSError *PF_NULLABLE_S error); 378 | typedef void (^PFArrayResultBlock)(NSArray *PF_NULLABLE_S objects, NSError *PF_NULLABLE_S error); 379 | typedef void (^PFObjectResultBlock)(PFObject *PF_NULLABLE_S object, NSError *PF_NULLABLE_S error); 380 | typedef void (^PFSetResultBlock)(NSSet *PF_NULLABLE_S channels, NSError *PF_NULLABLE_S error); 381 | typedef void (^PFUserResultBlock)(PFUser *PF_NULLABLE_S user, NSError *PF_NULLABLE_S error); 382 | typedef void (^PFDataResultBlock)(NSData *PF_NULLABLE_S data, NSError *PF_NULLABLE_S error); 383 | typedef void (^PFDataStreamResultBlock)(NSInputStream *PF_NULLABLE_S stream, NSError *PF_NULLABLE_S error); 384 | typedef void (^PFStringResultBlock)(NSString *PF_NULLABLE_S string, NSError *PF_NULLABLE_S error); 385 | typedef void (^PFIdResultBlock)(PF_NULLABLE_S id object, NSError *PF_NULLABLE_S error); 386 | typedef void (^PFProgressBlock)(int percentDone); 387 | 388 | ///-------------------------------------- 389 | /// @name Network Notifications 390 | ///-------------------------------------- 391 | 392 | /*! 393 | @abstract The name of the notification that is going to be sent before any URL request is sent. 394 | */ 395 | extern NSString *const PF_NONNULL_S PFNetworkWillSendURLRequestNotification; 396 | 397 | /*! 398 | @abstract The name of the notification that is going to be sent after any URL response is received. 399 | */ 400 | extern NSString *const PF_NONNULL_S PFNetworkDidReceiveURLResponseNotification; 401 | 402 | /*! 403 | @abstract The key of request(NSURLRequest) in the userInfo dictionary of a notification. 404 | @note This key is populated in userInfo, only if `PFLogLevel` on `Parse` is set to `PFLogLevelDebug`. 405 | */ 406 | extern NSString *const PF_NONNULL_S PFNetworkNotificationURLRequestUserInfoKey; 407 | 408 | /*! 409 | @abstract The key of response(NSHTTPURLResponse) in the userInfo dictionary of a notification. 410 | @note This key is populated in userInfo, only if `PFLogLevel` on `Parse` is set to `PFLogLevelDebug`. 411 | */ 412 | extern NSString *const PF_NONNULL_S PFNetworkNotificationURLResponseUserInfoKey; 413 | 414 | /*! 415 | @abstract The key of repsonse body (usually `NSString` with JSON) in the userInfo dictionary of a notification. 416 | @note This key is populated in userInfo, only if `PFLogLevel` on `Parse` is set to `PFLogLevelDebug`. 417 | */ 418 | extern NSString *const PF_NONNULL_S PFNetworkNotificationURLResponseBodyUserInfoKey; 419 | 420 | 421 | ///-------------------------------------- 422 | /// @name Deprecated Macros 423 | ///-------------------------------------- 424 | 425 | #ifndef PARSE_DEPRECATED 426 | # ifdef __deprecated_msg 427 | # define PARSE_DEPRECATED(_MSG) __deprecated_msg(_MSG) 428 | # else 429 | # ifdef __deprecated 430 | # define PARSE_DEPRECATED(_MSG) __attribute__((deprecated)) 431 | # else 432 | # define PARSE_DEPRECATED(_MSG) 433 | # endif 434 | # endif 435 | #endif 436 | 437 | ///-------------------------------------- 438 | /// @name Extensions Macros 439 | ///-------------------------------------- 440 | 441 | #ifndef PF_EXTENSION_UNAVAILABLE 442 | # if PARSE_IOS_ONLY 443 | # ifdef NS_EXTENSION_UNAVAILABLE_IOS 444 | # define PF_EXTENSION_UNAVAILABLE(_msg) NS_EXTENSION_UNAVAILABLE_IOS(_msg) 445 | # else 446 | # define PF_EXTENSION_UNAVAILABLE(_msg) 447 | # endif 448 | # else 449 | # ifdef NS_EXTENSION_UNAVAILABLE_MAC 450 | # define PF_EXTENSION_UNAVAILABLE(_msg) NS_EXTENSION_UNAVAILABLE_MAC(_msg) 451 | # else 452 | # define PF_EXTENSION_UNAVAILABLE(_msg) 453 | # endif 454 | # endif 455 | #endif 456 | 457 | ///-------------------------------------- 458 | /// @name Swift Macros 459 | ///-------------------------------------- 460 | 461 | #ifndef PF_SWIFT_UNAVAILABLE 462 | # ifdef NS_SWIFT_UNAVAILABLE 463 | # define PF_SWIFT_UNAVAILABLE NS_SWIFT_UNAVAILABLE("") 464 | # else 465 | # define PF_SWIFT_UNAVAILABLE 466 | # endif 467 | #endif 468 | 469 | ///-------------------------------------- 470 | /// @name Obj-C Generics Macros 471 | ///-------------------------------------- 472 | 473 | #if __has_feature(objc_generics) || __has_extension(objc_generics) 474 | # define PF_GENERIC(...) <__VA_ARGS__> 475 | #else 476 | # define PF_GENERIC(...) 477 | # define PFGenericObject PFObject * 478 | #endif 479 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFFile.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | 14 | #import 15 | 16 | PF_ASSUME_NONNULL_BEGIN 17 | 18 | /*! 19 | `PFFile` representes a file of binary data stored on the Parse servers. 20 | This can be a image, video, or anything else that an application needs to reference in a non-relational way. 21 | */ 22 | @interface PFFile : NSObject 23 | 24 | ///-------------------------------------- 25 | /// @name Creating a PFFile 26 | ///-------------------------------------- 27 | 28 | /*! 29 | @abstract Creates a file with given data. A name will be assigned to it by the server. 30 | 31 | @param data The contents of the new `PFFile`. 32 | 33 | @returns A new `PFFile`. 34 | */ 35 | + (instancetype)fileWithData:(NSData *)data; 36 | 37 | /*! 38 | @abstract Creates a file with given data and name. 39 | 40 | @param name The name of the new PFFile. The file name must begin with and 41 | alphanumeric character, and consist of alphanumeric characters, periods, 42 | spaces, underscores, or dashes. 43 | @param data The contents of the new `PFFile`. 44 | 45 | @returns A new `PFFile` object. 46 | */ 47 | + (instancetype)fileWithName:(PF_NULLABLE NSString *)name data:(NSData *)data; 48 | 49 | /*! 50 | @abstract Creates a file with the contents of another file. 51 | 52 | @warning This method raises an exception if the file at path is not accessible 53 | or if there is not enough disk space left. 54 | 55 | @param name The name of the new `PFFile`. The file name must begin with and alphanumeric character, 56 | and consist of alphanumeric characters, periods, spaces, underscores, or dashes. 57 | @param path The path to the file that will be uploaded to Parse. 58 | 59 | @returns A new `PFFile` instance. 60 | */ 61 | + (instancetype)fileWithName:(PF_NULLABLE NSString *)name contentsAtPath:(NSString *)path; 62 | 63 | /*! 64 | @abstract Creates a file with the contents of another file. 65 | 66 | @param name The name of the new `PFFile`. The file name must begin with and alphanumeric character, 67 | and consist of alphanumeric characters, periods, spaces, underscores, or dashes. 68 | @param path The path to the file that will be uploaded to Parse. 69 | @param error On input, a pointer to an error object. 70 | If an error occurs, this pointer is set to an actual error object containing the error information. 71 | You may specify `nil` for this parameter if you do not want the error information. 72 | 73 | @returns A new `PFFile` instance or `nil` if the error occured. 74 | */ 75 | + (instancetype)fileWithName:(PF_NULLABLE NSString *)name contentsAtPath:(NSString *)path error:(NSError **)error; 76 | 77 | /*! 78 | @abstract Creates a file with given data, name and content type. 79 | 80 | @warning This method raises an exception if the data supplied is not accessible or could not be saved. 81 | 82 | @param name The name of the new `PFFile`. The file name must begin with and alphanumeric character, 83 | and consist of alphanumeric characters, periods, spaces, underscores, or dashes. 84 | @param data The contents of the new `PFFile`. 85 | @param contentType Represents MIME type of the data. 86 | 87 | @returns A new `PFFile` instance. 88 | */ 89 | + (instancetype)fileWithName:(PF_NULLABLE NSString *)name 90 | data:(NSData *)data 91 | contentType:(PF_NULLABLE NSString *)contentType; 92 | 93 | /*! 94 | @abstract Creates a file with given data, name and content type. 95 | 96 | @param name The name of the new `PFFile`. The file name must begin with and alphanumeric character, 97 | and consist of alphanumeric characters, periods, spaces, underscores, or dashes. 98 | @param data The contents of the new `PFFile`. 99 | @param contentType Represents MIME type of the data. 100 | @param error On input, a pointer to an error object. 101 | If an error occurs, this pointer is set to an actual error object containing the error information. 102 | You may specify `nil` for this parameter if you do not want the error information. 103 | 104 | @returns A new `PFFile` instance or `nil` if the error occured. 105 | */ 106 | + (instancetype)fileWithName:(PF_NULLABLE NSString *)name 107 | data:(NSData *)data 108 | contentType:(PF_NULLABLE NSString *)contentType 109 | error:(NSError **)error; 110 | 111 | /*! 112 | @abstract Creates a file with given data and content type. 113 | 114 | @param data The contents of the new `PFFile`. 115 | @param contentType Represents MIME type of the data. 116 | 117 | @returns A new `PFFile` object. 118 | */ 119 | + (instancetype)fileWithData:(NSData *)data contentType:(PF_NULLABLE NSString *)contentType; 120 | 121 | /*! 122 | @abstract The name of the file. 123 | 124 | @discussion Before the file is saved, this is the filename given by 125 | the user. After the file is saved, that name gets prefixed with a unique 126 | identifier. 127 | */ 128 | @property (nonatomic, copy, readonly) NSString *name; 129 | 130 | /*! 131 | @abstract The url of the file. 132 | */ 133 | @property (PF_NULLABLE_PROPERTY nonatomic, copy, readonly) NSString *url; 134 | 135 | ///-------------------------------------- 136 | /// @name Storing Data with Parse 137 | ///-------------------------------------- 138 | 139 | /*! 140 | @abstract Whether the file has been uploaded for the first time. 141 | */ 142 | @property (nonatomic, assign, readonly) BOOL isDirty; 143 | 144 | /*! 145 | @abstract Saves the file *synchronously*. 146 | 147 | @returns Returns whether the save succeeded. 148 | */ 149 | - (BOOL)save PF_SWIFT_UNAVAILABLE; 150 | 151 | /*! 152 | @abstract Saves the file *synchronously* and sets an error if it occurs. 153 | 154 | @param error Pointer to an `NSError` that will be set if necessary. 155 | 156 | @returns Returns whether the save succeeded. 157 | */ 158 | - (BOOL)save:(NSError **)error; 159 | 160 | /*! 161 | @abstract Saves the file *asynchronously*. 162 | 163 | @returns The task, that encapsulates the work being done. 164 | */ 165 | - (BFTask PF_GENERIC(NSNumber *)*)saveInBackground; 166 | 167 | /*! 168 | @abstract Saves the file *asynchronously* 169 | 170 | @param progressBlock The block should have the following argument signature: `^(int percentDone)` 171 | 172 | @returns The task, that encapsulates the work being done. 173 | */ 174 | - (BFTask PF_GENERIC(NSNumber *)*)saveInBackgroundWithProgressBlock:(PF_NULLABLE PFProgressBlock)progressBlock; 175 | 176 | /*! 177 | @abstract Saves the file *asynchronously* and executes the given block. 178 | 179 | @param block The block should have the following argument signature: `^(BOOL succeeded, NSError *error)`. 180 | */ 181 | - (void)saveInBackgroundWithBlock:(PF_NULLABLE PFBooleanResultBlock)block; 182 | 183 | /*! 184 | @abstract Saves the file *asynchronously* and executes the given block. 185 | 186 | @discussion This method will execute the progressBlock periodically with the percent progress. 187 | `progressBlock` will get called with `100` before `resultBlock` is called. 188 | 189 | @param block The block should have the following argument signature: `^(BOOL succeeded, NSError *error)` 190 | @param progressBlock The block should have the following argument signature: `^(int percentDone)` 191 | */ 192 | - (void)saveInBackgroundWithBlock:(PF_NULLABLE PFBooleanResultBlock)block 193 | progressBlock:(PF_NULLABLE PFProgressBlock)progressBlock; 194 | 195 | /* 196 | @abstract Saves the file *asynchronously* and calls the given callback. 197 | 198 | @param target The object to call selector on. 199 | @param selector The selector to call. 200 | It should have the following signature: `(void)callbackWithResult:(NSNumber *)result error:(NSError *)error`. 201 | `error` will be `nil` on success and set if there was an error. 202 | `[result boolValue]` will tell you whether the call succeeded or not. 203 | */ 204 | - (void)saveInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector; 205 | 206 | ///-------------------------------------- 207 | /// @name Getting Data from Parse 208 | ///-------------------------------------- 209 | 210 | /*! 211 | @abstract Whether the data is available in memory or needs to be downloaded. 212 | */ 213 | @property (assign, readonly) BOOL isDataAvailable; 214 | 215 | /*! 216 | @abstract *Synchronously* gets the data from cache if available or fetches its contents from the network. 217 | 218 | @returns The `NSData` object containing file data. Returns `nil` if there was an error in fetching. 219 | */ 220 | - (PF_NULLABLE NSData *)getData PF_SWIFT_UNAVAILABLE; 221 | 222 | /*! 223 | @abstract This method is like but avoids ever holding the entire `PFFile` contents in memory at once. 224 | 225 | @discussion This can help applications with many large files avoid memory warnings. 226 | 227 | @returns A stream containing the data. Returns `nil` if there was an error in fetching. 228 | */ 229 | - (PF_NULLABLE NSInputStream *)getDataStream PF_SWIFT_UNAVAILABLE; 230 | 231 | /*! 232 | @abstract *Synchronously* gets the data from cache if available or fetches its contents from the network. 233 | Sets an error if it occurs. 234 | 235 | @param error Pointer to an `NSError` that will be set if necessary. 236 | 237 | @returns The `NSData` object containing file data. Returns `nil` if there was an error in fetching. 238 | */ 239 | - (PF_NULLABLE NSData *)getData:(NSError **)error; 240 | 241 | /*! 242 | @abstract This method is like but avoids ever holding the entire `PFFile` contents in memory at once. 243 | 244 | @param error Pointer to an `NSError` that will be set if necessary. 245 | 246 | @returns A stream containing the data. Returns nil if there was an error in 247 | fetching. 248 | */ 249 | - (PF_NULLABLE NSInputStream *)getDataStream:(NSError **)error; 250 | 251 | /*! 252 | @abstract This method is like but it fetches asynchronously to avoid blocking the current thread. 253 | 254 | @see getData 255 | 256 | @returns The task, that encapsulates the work being done. 257 | */ 258 | - (BFTask PF_GENERIC(NSData *)*)getDataInBackground; 259 | 260 | /*! 261 | @abstract This method is like but it fetches asynchronously to avoid blocking the current thread. 262 | 263 | @discussion This can help applications with many large files avoid memory warnings. 264 | 265 | @see getData 266 | 267 | @param progressBlock The block should have the following argument signature: ^(int percentDone) 268 | 269 | @returns The task, that encapsulates the work being done. 270 | */ 271 | - (BFTask PF_GENERIC(NSData *)*)getDataInBackgroundWithProgressBlock:(PF_NULLABLE PFProgressBlock)progressBlock; 272 | 273 | /*! 274 | @abstract This method is like but avoids 275 | ever holding the entire `PFFile` contents in memory at once. 276 | 277 | @discussion This can help applications with many large files avoid memory warnings. 278 | 279 | @returns The task, that encapsulates the work being done. 280 | */ 281 | - (BFTask PF_GENERIC(NSInputStream *)*)getDataStreamInBackground; 282 | 283 | /*! 284 | @abstract This method is like , but yields a live-updating stream. 285 | 286 | @discussion Instead of , which yields a stream that can be read from only after the request has 287 | completed, this method gives you a stream directly written to by the HTTP session. As this stream is not pre-buffered, 288 | it is strongly advised to use the `NSStreamDelegate` methods, in combination with a run loop, to consume the data in 289 | the stream, to do proper async file downloading. 290 | 291 | @note You MUST open this stream before reading from it. 292 | @note Do NOT call on this task from the main thread. It may result in a deadlock. 293 | 294 | @returns A task that produces a *live* stream that is being written to with the data from the server. 295 | */ 296 | - (BFTask PF_GENERIC(NSInputStream *)*)getDataDownloadStreamInBackground; 297 | 298 | /*! 299 | @abstract This method is like but avoids 300 | ever holding the entire `PFFile` contents in memory at once. 301 | 302 | @discussion This can help applications with many large files avoid memory warnings. 303 | @param progressBlock The block should have the following argument signature: ^(int percentDone) 304 | 305 | @returns The task, that encapsulates the work being done. 306 | */ 307 | - (BFTask PF_GENERIC(NSInputStream *)*)getDataStreamInBackgroundWithProgressBlock:(PF_NULLABLE PFProgressBlock)progressBlock; 308 | 309 | /*! 310 | @abstract This method is like , but yields a live-updating stream. 311 | 312 | @discussion Instead of , which yields a stream that can be read from only after the request has 313 | completed, this method gives you a stream directly written to by the HTTP session. As this stream is not pre-buffered, 314 | it is strongly advised to use the `NSStreamDelegate` methods, in combination with a run loop, to consume the data in 315 | the stream, to do proper async file downloading. 316 | 317 | @note You MUST open this stream before reading from it. 318 | @note Do NOT call on this task from the main thread. It may result in a deadlock. 319 | 320 | @param progressBlock The block should have the following argument signature: `^(int percentDone)` 321 | 322 | @returns A task that produces a *live* stream that is being written to with the data from the server. 323 | */ 324 | - (BFTask PF_GENERIC(NSInputStream *)*)getDataDownloadStreamInBackgroundWithProgressBlock:(PF_NULLABLE PFProgressBlock)progressBlock; 325 | 326 | /*! 327 | @abstract *Asynchronously* gets the data from cache if available or fetches its contents from the network. 328 | 329 | @param block The block should have the following argument signature: `^(NSData *result, NSError *error)` 330 | */ 331 | - (void)getDataInBackgroundWithBlock:(PF_NULLABLE PFDataResultBlock)block; 332 | 333 | /*! 334 | @abstract This method is like but avoids 335 | ever holding the entire `PFFile` contents in memory at once. 336 | 337 | @discussion This can help applications with many large files avoid memory warnings. 338 | 339 | @param block The block should have the following argument signature: `(NSInputStream *result, NSError *error)` 340 | */ 341 | - (void)getDataStreamInBackgroundWithBlock:(PF_NULLABLE PFDataStreamResultBlock)block; 342 | 343 | /*! 344 | @abstract *Asynchronously* gets the data from cache if available or fetches its contents from the network. 345 | 346 | @discussion This method will execute the progressBlock periodically with the percent progress. 347 | `progressBlock` will get called with `100` before `resultBlock` is called. 348 | 349 | @param resultBlock The block should have the following argument signature: ^(NSData *result, NSError *error) 350 | @param progressBlock The block should have the following argument signature: ^(int percentDone) 351 | */ 352 | - (void)getDataInBackgroundWithBlock:(PF_NULLABLE PFDataResultBlock)resultBlock 353 | progressBlock:(PF_NULLABLE PFProgressBlock)progressBlock; 354 | 355 | /*! 356 | @abstract This method is like but avoids 357 | ever holding the entire `PFFile` contents in memory at once. 358 | 359 | @discussion This can help applications with many large files avoid memory warnings. 360 | 361 | @param resultBlock The block should have the following argument signature: `^(NSInputStream *result, NSError *error)`. 362 | @param progressBlock The block should have the following argument signature: `^(int percentDone)`. 363 | */ 364 | - (void)getDataStreamInBackgroundWithBlock:(PF_NULLABLE PFDataStreamResultBlock)resultBlock 365 | progressBlock:(PF_NULLABLE PFProgressBlock)progressBlock; 366 | 367 | /* 368 | @abstract *Asynchronously* gets the data from cache if available or fetches its contents from the network. 369 | 370 | @param target The object to call selector on. 371 | @param selector The selector to call. 372 | It should have the following signature: `(void)callbackWithResult:(NSData *)result error:(NSError *)error`. 373 | `error` will be `nil` on success and set if there was an error. 374 | */ 375 | - (void)getDataInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector; 376 | 377 | ///-------------------------------------- 378 | /// @name Interrupting a Transfer 379 | ///-------------------------------------- 380 | 381 | /*! 382 | @abstract Cancels the current request (upload or download of file). 383 | */ 384 | - (void)cancel; 385 | 386 | @end 387 | 388 | PF_ASSUME_NONNULL_END 389 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFGeoPoint.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 | #import 12 | 13 | #import 14 | 15 | PF_ASSUME_NONNULL_BEGIN 16 | 17 | @class PFGeoPoint; 18 | 19 | typedef void(^PFGeoPointResultBlock)(PFGeoPoint *PF_NULLABLE_S geoPoint, NSError *PF_NULLABLE_S error); 20 | 21 | /*! 22 | `PFGeoPoint` may be used to embed a latitude / longitude point as the value for a key in a . 23 | It could be used to perform queries in a geospatial manner using <[PFQuery whereKey:nearGeoPoint:]>. 24 | 25 | Currently, instances of may only have one key associated with a `PFGeoPoint` type. 26 | */ 27 | @interface PFGeoPoint : NSObject 28 | 29 | ///-------------------------------------- 30 | /// @name Creating a Geo Point 31 | ///-------------------------------------- 32 | 33 | /*! 34 | @abstract Create a PFGeoPoint object. Latitude and longitude are set to `0.0`. 35 | 36 | @returns Returns a new `PFGeoPoint`. 37 | */ 38 | + (instancetype)geoPoint; 39 | 40 | /*! 41 | @abstract Creates a new `PFGeoPoint` object for the given `CLLocation`, set to the location's coordinates. 42 | 43 | @param location Instace of `CLLocation`, with set latitude and longitude. 44 | 45 | @returns Returns a new PFGeoPoint at specified location. 46 | */ 47 | + (instancetype)geoPointWithLocation:(PF_NULLABLE CLLocation *)location; 48 | 49 | /*! 50 | @abstract Create a new `PFGeoPoint` object with the specified latitude and longitude. 51 | 52 | @param latitude Latitude of point in degrees. 53 | @param longitude Longitude of point in degrees. 54 | 55 | @returns New point object with specified latitude and longitude. 56 | */ 57 | + (instancetype)geoPointWithLatitude:(double)latitude longitude:(double)longitude; 58 | 59 | /*! 60 | @abstract Fetches the current device location and executes a block with a new `PFGeoPoint` object. 61 | 62 | @param resultBlock A block which takes the newly created `PFGeoPoint` as an argument. 63 | It should have the following argument signature: `^(PFGeoPoint *geoPoint, NSError *error)` 64 | */ 65 | + (void)geoPointForCurrentLocationInBackground:(PF_NULLABLE PFGeoPointResultBlock)resultBlock; 66 | 67 | ///-------------------------------------- 68 | /// @name Controlling Position 69 | ///-------------------------------------- 70 | 71 | /*! 72 | @abstract Latitude of point in degrees. Valid range is from `-90.0` to `90.0`. 73 | */ 74 | @property (nonatomic, assign) double latitude; 75 | 76 | /*! 77 | @abstract Longitude of point in degrees. Valid range is from `-180.0` to `180.0`. 78 | */ 79 | @property (nonatomic, assign) double longitude; 80 | 81 | ///-------------------------------------- 82 | /// @name Calculating Distance 83 | ///-------------------------------------- 84 | 85 | /*! 86 | @abstract Get distance in radians from this point to specified point. 87 | 88 | @param point `PFGeoPoint` that represents the location of other point. 89 | 90 | @returns Distance in radians between the receiver and `point`. 91 | */ 92 | - (double)distanceInRadiansTo:(PF_NULLABLE PFGeoPoint *)point; 93 | 94 | /*! 95 | @abstract Get distance in miles from this point to specified point. 96 | 97 | @param point `PFGeoPoint` that represents the location of other point. 98 | 99 | @returns Distance in miles between the receiver and `point`. 100 | */ 101 | - (double)distanceInMilesTo:(PF_NULLABLE PFGeoPoint *)point; 102 | 103 | /*! 104 | @abstract Get distance in kilometers from this point to specified point. 105 | 106 | @param point `PFGeoPoint` that represents the location of other point. 107 | 108 | @returns Distance in kilometers between the receiver and `point`. 109 | */ 110 | - (double)distanceInKilometersTo:(PF_NULLABLE PFGeoPoint *)point; 111 | 112 | @end 113 | 114 | PF_ASSUME_NONNULL_END 115 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFInstallation.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | #import 14 | #import 15 | 16 | PF_ASSUME_NONNULL_BEGIN 17 | 18 | /*! 19 | A Parse Framework Installation Object that is a local representation of an 20 | installation persisted to the Parse cloud. This class is a subclass of a 21 | , and retains the same functionality of a PFObject, but also extends 22 | it with installation-specific fields and related immutability and validity 23 | checks. 24 | 25 | A valid `PFInstallation` can only be instantiated via 26 | <[PFInstallation currentInstallation]> because the required identifier fields 27 | are readonly. The and fields are also readonly properties which 28 | are automatically updated to match the device's time zone and application badge 29 | when the `PFInstallation` is saved, thus these fields might not reflect the 30 | latest device state if the installation has not recently been saved. 31 | 32 | `PFInstallation` objects which have a valid and are saved to 33 | the Parse cloud can be used to target push notifications. 34 | */ 35 | 36 | @interface PFInstallation : PFObject 37 | 38 | ///-------------------------------------- 39 | /// @name Accessing the Current Installation 40 | ///-------------------------------------- 41 | 42 | /*! 43 | @abstract Gets the currently-running installation from disk and returns an instance of it. 44 | 45 | @discussion If this installation is not stored on disk, returns a `PFInstallation` 46 | with and fields set to those of the 47 | current installation. 48 | 49 | @result Returns a `PFInstallation` that represents the currently-running installation. 50 | */ 51 | + (instancetype)currentInstallation; 52 | 53 | ///-------------------------------------- 54 | /// @name Installation Properties 55 | ///-------------------------------------- 56 | 57 | /*! 58 | @abstract The device type for the `PFInstallation`. 59 | */ 60 | @property (nonatomic, copy, readonly) NSString *deviceType; 61 | 62 | /*! 63 | @abstract The installationId for the `PFInstallation`. 64 | */ 65 | @property (nonatomic, copy, readonly) NSString *installationId; 66 | 67 | /*! 68 | @abstract The device token for the `PFInstallation`. 69 | */ 70 | @property (PF_NULLABLE_PROPERTY nonatomic, copy) NSString *deviceToken; 71 | 72 | /*! 73 | @abstract The badge for the `PFInstallation`. 74 | */ 75 | @property (nonatomic, assign) NSInteger badge; 76 | 77 | /*! 78 | @abstract The name of the time zone for the `PFInstallation`. 79 | */ 80 | @property (PF_NULLABLE_PROPERTY nonatomic, copy, readonly) NSString *timeZone; 81 | 82 | /*! 83 | @abstract The channels for the `PFInstallation`. 84 | */ 85 | @property (PF_NULLABLE_PROPERTY nonatomic, copy) NSArray *channels; 86 | 87 | /*! 88 | @abstract Sets the device token string property from an `NSData`-encoded token. 89 | 90 | @param deviceTokenData A token that identifies the device. 91 | */ 92 | - (void)setDeviceTokenFromData:(PF_NULLABLE NSData *)deviceTokenData; 93 | 94 | ///-------------------------------------- 95 | /// @name Querying for Installations 96 | ///-------------------------------------- 97 | 98 | /*! 99 | @abstract Creates a for `PFInstallation` objects. 100 | 101 | @discussion Only the following types of queries are allowed for installations: 102 | 103 | - `[query getObjectWithId:]` 104 | - `[query whereKey:@"installationId" equalTo:]` 105 | - `[query whereKey:@"installationId" matchesKey: inQuery:]` 106 | 107 | You can add additional query conditions, but one of the above must appear as a top-level `AND` clause in the query. 108 | */ 109 | + (PF_NULLABLE PFQuery *)query; 110 | 111 | @end 112 | 113 | PF_ASSUME_NONNULL_END 114 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 | #import 12 | 13 | #import 14 | 15 | PF_ASSUME_NONNULL_BEGIN 16 | 17 | /*! 18 | `PFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. 19 | When enabled, it will start managing the network activity indicator in the status bar, 20 | according to the network operations that are performed by Parse SDK. 21 | 22 | The number of active requests is incremented or decremented like a stack or a semaphore, 23 | the activity indicator will animate, as long as the number is greater than zero. 24 | */ 25 | @interface PFNetworkActivityIndicatorManager : NSObject 26 | 27 | /*! 28 | A Boolean value indicating whether the manager is enabled. 29 | If `YES` - the manager will start managing the status bar network activity indicator, 30 | according to the network operations that are performed by Parse SDK. 31 | The default value is `YES`. 32 | */ 33 | @property (nonatomic, assign, getter = isEnabled) BOOL enabled; 34 | 35 | /*! 36 | A Boolean value indicating whether the network activity indicator is currently displayed in the status bar. 37 | */ 38 | @property (nonatomic, assign, readonly, getter = isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; 39 | 40 | /*! 41 | The value that indicates current network activities count. 42 | */ 43 | @property (nonatomic, assign, readonly) NSUInteger networkActivityCount; 44 | 45 | /*! 46 | @abstract Returns the shared network activity indicator manager object for the system. 47 | 48 | @returns The systemwide network activity indicator manager. 49 | */ 50 | + (instancetype)sharedManager; 51 | 52 | /*! 53 | @abstract Increments the number of active network requests. 54 | 55 | @discussion If this number was zero before incrementing, 56 | this will start animating network activity indicator in the status bar. 57 | */ 58 | - (void)incrementActivityCount; 59 | 60 | /*! 61 | @abstract Decrements the number of active network requests. 62 | 63 | @discussion If this number becomes zero after decrementing, 64 | this will stop animating network activity indicator in the status bar. 65 | */ 66 | - (void)decrementActivityCount; 67 | 68 | @end 69 | 70 | PF_ASSUME_NONNULL_END 71 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFNullability.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 | #ifndef Parse_PFNullability_h 11 | #define Parse_PFNullability_h 12 | 13 | ///-------------------------------------- 14 | /// @name Nullability Annotation Support 15 | ///-------------------------------------- 16 | 17 | #if __has_feature(nullability) 18 | # define PF_NONNULL nonnull 19 | # define PF_NONNULL_S __nonnull 20 | # define PF_NULLABLE nullable 21 | # define PF_NULLABLE_S __nullable 22 | # define PF_NULLABLE_PROPERTY nullable, 23 | #else 24 | # define PF_NONNULL 25 | # define PF_NONNULL_S 26 | # define PF_NULLABLE 27 | # define PF_NULLABLE_S 28 | # define PF_NULLABLE_PROPERTY 29 | #endif 30 | 31 | #if __has_feature(assume_nonnull) 32 | # ifdef NS_ASSUME_NONNULL_BEGIN 33 | # define PF_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN 34 | # else 35 | # define PF_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") 36 | # endif 37 | # ifdef NS_ASSUME_NONNULL_END 38 | # define PF_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END 39 | # else 40 | # define PF_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") 41 | # endif 42 | #else 43 | # define PF_ASSUME_NONNULL_BEGIN 44 | # define PF_ASSUME_NONNULL_END 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFObject+Subclass.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | #import 14 | 15 | PF_ASSUME_NONNULL_BEGIN 16 | 17 | @class PFQuery; 18 | 19 | /*! 20 | ### Subclassing Notes 21 | 22 | Developers can subclass `PFObject` for a more native object-oriented class structure. 23 | Strongly-typed subclasses of `PFObject` must conform to the protocol 24 | and must call before <[Parse setApplicationId:clientKey:]> is called. 25 | After this it will be returned by and other `PFObject` factories. 26 | 27 | All methods in except for <[PFSubclassing parseClassName]> 28 | are already implemented in the `PFObject+Subclass` category. 29 | 30 | Including `PFObject+Subclass.h` in your implementation file provides these implementations automatically. 31 | 32 | Subclasses support simpler initializers, query syntax, and dynamic synthesizers. 33 | The following shows an example subclass: 34 | 35 | \@interface MYGame : PFObject 36 | 37 | // Accessing this property is the same as objectForKey:@"title" 38 | @property (nonatomic, copy) NSString *title; 39 | 40 | + (NSString *)parseClassName; 41 | 42 | @end 43 | 44 | 45 | @implementation MYGame 46 | 47 | @dynamic title; 48 | 49 | + (NSString *)parseClassName { 50 | return @"Game"; 51 | } 52 | 53 | @end 54 | 55 | 56 | MYGame *game = [[MYGame alloc] init]; 57 | game.title = @"Bughouse"; 58 | [game saveInBackground]; 59 | */ 60 | @interface PFObject (Subclass) 61 | 62 | ///-------------------------------------- 63 | /// @name Methods for Subclasses 64 | ///-------------------------------------- 65 | 66 | /*! 67 | @abstract Creates an instance of the registered subclass with this class's . 68 | 69 | @discussion This helps a subclass ensure that it can be subclassed itself. 70 | For example, `[PFUser object]` will return a `MyUser` object if `MyUser` is a registered subclass of `PFUser`. 71 | For this reason, `[MyClass object]` is preferred to `[[MyClass alloc] init]`. 72 | This method can only be called on subclasses which conform to `PFSubclassing`. 73 | A default implementation is provided by `PFObject` which should always be sufficient. 74 | */ 75 | + (instancetype)object; 76 | 77 | /*! 78 | @abstract Creates a reference to an existing `PFObject` for use in creating associations between `PFObjects`. 79 | 80 | @discussion Calling on this object will return `NO` until or has been called. 81 | This method can only be called on subclasses which conform to . 82 | A default implementation is provided by `PFObject` which should always be sufficient. 83 | No network request will be made. 84 | 85 | @param objectId The object id for the referenced object. 86 | 87 | @returns An instance of `PFObject` without data. 88 | */ 89 | + (instancetype)objectWithoutDataWithObjectId:(PF_NULLABLE NSString *)objectId; 90 | 91 | /*! 92 | @abstract Registers an Objective-C class for Parse to use for representing a given Parse class. 93 | 94 | @discussion Once this is called on a `PFObject` subclass, any `PFObject` Parse creates with a class name 95 | that matches `[self parseClassName]` will be an instance of subclass. 96 | This method can only be called on subclasses which conform to . 97 | A default implementation is provided by `PFObject` which should always be sufficient. 98 | */ 99 | + (void)registerSubclass; 100 | 101 | /*! 102 | @abstract Returns a query for objects of type . 103 | 104 | @discussion This method can only be called on subclasses which conform to . 105 | A default implementation is provided by which should always be sufficient. 106 | */ 107 | + (PF_NULLABLE PFQuery *)query; 108 | 109 | /*! 110 | @abstract Returns a query for objects of type with a given predicate. 111 | 112 | @discussion A default implementation is provided by which should always be sufficient. 113 | @warning This method can only be called on subclasses which conform to . 114 | 115 | @param predicate The predicate to create conditions from. 116 | 117 | @returns An instance of . 118 | 119 | @see [PFQuery queryWithClassName:predicate:] 120 | */ 121 | + (PF_NULLABLE PFQuery *)queryWithPredicate:(PF_NULLABLE NSPredicate *)predicate; 122 | 123 | @end 124 | 125 | PF_ASSUME_NONNULL_END 126 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFProduct.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | #import 14 | #import 15 | #import 16 | 17 | PF_ASSUME_NONNULL_BEGIN 18 | 19 | /*! 20 | The `PFProduct` class represents an in-app purchase product on the Parse server. 21 | By default, products can only be created via the Data Browser. Saving a `PFProduct` will result in error. 22 | However, the products' metadata information can be queried and viewed. 23 | 24 | This class is currently for iOS only. 25 | */ 26 | @interface PFProduct : PFObject 27 | 28 | ///-------------------------------------- 29 | /// @name Product-specific Properties 30 | ///-------------------------------------- 31 | 32 | /*! 33 | @abstract The product identifier of the product. 34 | 35 | @discussion This should match the product identifier in iTunes Connect exactly. 36 | */ 37 | @property (PF_NULLABLE_PROPERTY nonatomic, strong) NSString *productIdentifier; 38 | 39 | /*! 40 | @abstract The icon of the product. 41 | */ 42 | @property (PF_NULLABLE_PROPERTY nonatomic, strong) PFFile *icon; 43 | 44 | /*! 45 | @abstract The title of the product. 46 | */ 47 | @property (PF_NULLABLE_PROPERTY nonatomic, strong) NSString *title; 48 | 49 | /*! 50 | @abstract The subtitle of the product. 51 | */ 52 | @property (PF_NULLABLE_PROPERTY nonatomic, strong) NSString *subtitle; 53 | 54 | /*! 55 | @abstract The order in which the product information is displayed in . 56 | 57 | @discussion The product with a smaller order is displayed earlier in the . 58 | */ 59 | @property (PF_NULLABLE_PROPERTY nonatomic, strong) NSNumber *order; 60 | 61 | /*! 62 | @abstract The name of the associated download. 63 | 64 | @discussion If there is no downloadable asset, it should be `nil`. 65 | */ 66 | @property (PF_NULLABLE_PROPERTY nonatomic, strong, readonly) NSString *downloadName; 67 | 68 | @end 69 | 70 | PF_ASSUME_NONNULL_END 71 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFPurchase.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 | #import 12 | 13 | #import 14 | #import 15 | 16 | @class PFProduct; 17 | 18 | PF_ASSUME_NONNULL_BEGIN 19 | 20 | typedef void (^PFPurchaseProductObservationBlock)(SKPaymentTransaction *transaction); 21 | typedef void (^PFPurchaseBuyProductResultBlock)(NSError *PF_NULLABLE_S error); 22 | typedef void (^PFPurchaseDownloadAssetResultBlock)(NSString *PF_NULLABLE_S filePath, NSError *PF_NULLABLE_S error); 23 | 24 | /*! 25 | `PFPurchase` provides a set of APIs for working with in-app purchases. 26 | 27 | This class is currently for iOS only. 28 | */ 29 | @interface PFPurchase : NSObject 30 | 31 | /*! 32 | @abstract Add application logic block which is run when buying a product. 33 | 34 | @discussion This method should be called once for each product, and should be called before 35 | calling . All invocations to should happen within 36 | the same method, and on the main thread. It is recommended to place all invocations of this method 37 | in `application:didFinishLaunchingWithOptions:`. 38 | 39 | @param productIdentifier the product identifier 40 | @param block The block to be run when buying a product. 41 | */ 42 | + (void)addObserverForProduct:(NSString *)productIdentifier block:(PFPurchaseProductObservationBlock)block; 43 | 44 | /*! 45 | @abstract *Asynchronously* initiates the purchase for the product. 46 | 47 | @param productIdentifier the product identifier 48 | @param block the completion block. 49 | */ 50 | + (void)buyProduct:(NSString *)productIdentifier block:(PFPurchaseBuyProductResultBlock)block; 51 | 52 | /*! 53 | @abstract *Asynchronously* download the purchased asset, which is stored on Parse's server. 54 | 55 | @discussion Parse verifies the receipt with Apple and delivers the content only if the receipt is valid. 56 | 57 | @param transaction the transaction, which contains the receipt. 58 | @param completion the completion block. 59 | */ 60 | + (void)downloadAssetForTransaction:(SKPaymentTransaction *)transaction 61 | completion:(PFPurchaseDownloadAssetResultBlock)completion; 62 | 63 | /*! 64 | @abstract *Asynchronously* download the purchased asset, which is stored on Parse's server. 65 | 66 | @discussion Parse verifies the receipt with Apple and delivers the content only if the receipt is valid. 67 | 68 | @param transaction the transaction, which contains the receipt. 69 | @param completion the completion block. 70 | @param progress the progress block, which is called multiple times to reveal progress of the download. 71 | */ 72 | + (void)downloadAssetForTransaction:(SKPaymentTransaction *)transaction 73 | completion:(PFPurchaseDownloadAssetResultBlock)completion 74 | progress:(PF_NULLABLE PFProgressBlock)progress; 75 | 76 | /*! 77 | @abstract *Asynchronously* restore completed transactions for the current user. 78 | 79 | @discussion Only nonconsumable purchases are restored. If observers for the products have been added before 80 | calling this method, invoking the method reruns the application logic associated with the purchase. 81 | 82 | @warning This method is only important to developers who want to preserve purchase states across 83 | different installations of the same app. 84 | */ 85 | + (void)restore; 86 | 87 | /*! 88 | @abstract Returns a content path of the asset of a product, if it was purchased and downloaded. 89 | 90 | @discussion To download and verify purchases use . 91 | 92 | @warning This method will return `nil`, if the purchase wasn't verified or if the asset was not downloaded. 93 | */ 94 | + (PF_NULLABLE NSString *)assetContentPathForProduct:(PFProduct *)product; 95 | 96 | @end 97 | 98 | PF_ASSUME_NONNULL_END 99 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFRelation.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | #import 14 | #import 15 | 16 | PF_ASSUME_NONNULL_BEGIN 17 | 18 | /*! 19 | The `PFRelation` class that is used to access all of the children of a many-to-many relationship. 20 | Each instance of `PFRelation` is associated with a particular parent object and key. 21 | */ 22 | @interface PFRelation : NSObject 23 | 24 | /*! 25 | @abstract The name of the class of the target child objects. 26 | */ 27 | @property (PF_NULLABLE_PROPERTY nonatomic, copy) NSString *targetClass; 28 | 29 | ///-------------------------------------- 30 | /// @name Accessing Objects 31 | ///-------------------------------------- 32 | 33 | /*! 34 | @abstract Returns a object that can be used to get objects in this relation. 35 | */ 36 | - (PF_NULLABLE PFQuery *)query; 37 | 38 | ///-------------------------------------- 39 | /// @name Modifying Relations 40 | ///-------------------------------------- 41 | 42 | /*! 43 | @abstract Adds a relation to the passed in object. 44 | 45 | @param object A object to add relation to. 46 | */ 47 | - (void)addObject:(PFObject *)object; 48 | 49 | /*! 50 | @abstract Removes a relation to the passed in object. 51 | 52 | @param object A object to add relation to. 53 | */ 54 | - (void)removeObject:(PFObject *)object; 55 | 56 | @end 57 | 58 | PF_ASSUME_NONNULL_END 59 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFRole.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | #import 14 | #import 15 | 16 | PF_ASSUME_NONNULL_BEGIN 17 | 18 | /*! 19 | The `PFRole` class represents a Role on the Parse server. 20 | `PFRoles` represent groupings of objects for the purposes of granting permissions 21 | (e.g. specifying a for a ). 22 | Roles are specified by their sets of child users and child roles, 23 | all of which are granted any permissions that the parent role has. 24 | 25 | Roles must have a name (which cannot be changed after creation of the role), and must specify an ACL. 26 | */ 27 | @interface PFRole : PFObject 28 | 29 | ///-------------------------------------- 30 | /// @name Creating a New Role 31 | ///-------------------------------------- 32 | 33 | /*! 34 | @abstract Constructs a new `PFRole` with the given name. 35 | If no default ACL has been specified, you must provide an ACL for the role. 36 | 37 | @param name The name of the Role to create. 38 | */ 39 | - (instancetype)initWithName:(NSString *)name; 40 | 41 | /*! 42 | @abstract Constructs a new `PFRole` with the given name. 43 | 44 | @param name The name of the Role to create. 45 | @param acl The ACL for this role. Roles must have an ACL. 46 | */ 47 | - (instancetype)initWithName:(NSString *)name acl:(PF_NULLABLE PFACL *)acl; 48 | 49 | /*! 50 | @abstract Constructs a new `PFRole` with the given name. 51 | 52 | @discussion If no default ACL has been specified, you must provide an ACL for the role. 53 | 54 | @param name The name of the Role to create. 55 | */ 56 | + (instancetype)roleWithName:(NSString *)name; 57 | 58 | /*! 59 | @abstract Constructs a new `PFRole` with the given name. 60 | 61 | @param name The name of the Role to create. 62 | @param acl The ACL for this role. Roles must have an ACL. 63 | */ 64 | + (instancetype)roleWithName:(NSString *)name acl:(PF_NULLABLE PFACL *)acl; 65 | 66 | ///-------------------------------------- 67 | /// @name Role-specific Properties 68 | ///-------------------------------------- 69 | 70 | /*! 71 | @abstract Gets or sets the name for a role. 72 | 73 | @discussion This value must be set before the role has been saved to the server, 74 | and cannot be set once the role has been saved. 75 | 76 | @warning A role's name can only contain alphanumeric characters, `_`, `-`, and spaces. 77 | */ 78 | @property (nonatomic, copy) NSString *name; 79 | 80 | /*! 81 | @abstract Gets the for the objects that are direct children of this role. 82 | 83 | @discussion These users are granted any privileges that this role has been granted 84 | (e.g. read or write access through ACLs). You can add or remove users from 85 | the role through this relation. 86 | */ 87 | @property (nonatomic, strong, readonly) PFRelation *users; 88 | 89 | /*! 90 | @abstract Gets the for the `PFRole` objects that are direct children of this role. 91 | 92 | @discussion These roles' users are granted any privileges that this role has been granted 93 | (e.g. read or write access through ACLs). You can add or remove child roles 94 | from this role through this relation. 95 | */ 96 | @property (nonatomic, strong, readonly) PFRelation *roles; 97 | 98 | @end 99 | 100 | PF_ASSUME_NONNULL_END 101 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFSession.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | 14 | #import 15 | #import 16 | 17 | PF_ASSUME_NONNULL_BEGIN 18 | 19 | @class PFSession; 20 | 21 | typedef void(^PFSessionResultBlock)(PFSession *PF_NULLABLE_S session, NSError *PF_NULLABLE_S error); 22 | 23 | /*! 24 | `PFSession` is a local representation of a session. 25 | This class is a subclass of a , 26 | and retains the same functionality as any other subclass of . 27 | */ 28 | @interface PFSession : PFObject 29 | 30 | /*! 31 | @abstract The session token string for this session. 32 | */ 33 | @property (PF_NULLABLE_PROPERTY nonatomic, copy, readonly) NSString *sessionToken; 34 | 35 | /*! 36 | *Asynchronously* fetches a `PFSession` object related to the current user. 37 | 38 | @returns A task that is `completed` with an instance of `PFSession` class or is `faulted` if the operation fails. 39 | */ 40 | + (BFTask PF_GENERIC(PFSession *)*)getCurrentSessionInBackground; 41 | 42 | /*! 43 | *Asynchronously* fetches a `PFSession` object related to the current user. 44 | 45 | @param block The block to execute when the operation completes. 46 | It should have the following argument signature: `^(PFSession *session, NSError *error)`. 47 | */ 48 | + (void)getCurrentSessionInBackgroundWithBlock:(PF_NULLABLE PFSessionResultBlock)block; 49 | 50 | @end 51 | 52 | PF_ASSUME_NONNULL_END 53 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFSubclassing.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | 14 | @class PFQuery; 15 | 16 | PF_ASSUME_NONNULL_BEGIN 17 | 18 | /*! 19 | If a subclass of conforms to `PFSubclassing` and calls , 20 | Parse framework will be able to use that class as the native class for a Parse cloud object. 21 | 22 | Classes conforming to this protocol should subclass and 23 | include `PFObject+Subclass.h` in their implementation file. 24 | This ensures the methods in the Subclass category of are exposed in its subclasses only. 25 | */ 26 | @protocol PFSubclassing 27 | 28 | /*! 29 | @abstract Constructs an object of the most specific class known to implement . 30 | 31 | @discussion This method takes care to help subclasses be subclassed themselves. 32 | For example, `[PFUser object]` returns a by default but will return an 33 | object of a registered subclass instead if one is known. 34 | A default implementation is provided by which should always be sufficient. 35 | 36 | @returns Returns the object that is instantiated. 37 | */ 38 | + (instancetype)object; 39 | 40 | /*! 41 | @abstract Creates a reference to an existing PFObject for use in creating associations between PFObjects. 42 | 43 | @discussion Calling <[PFObject isDataAvailable]> on this object will return `NO` 44 | until <[PFObject fetchIfNeeded]> has been called. No network request will be made. 45 | A default implementation is provided by PFObject which should always be sufficient. 46 | 47 | @param objectId The object id for the referenced object. 48 | 49 | @returns A new without data. 50 | */ 51 | + (instancetype)objectWithoutDataWithObjectId:(PF_NULLABLE NSString *)objectId; 52 | 53 | /*! 54 | @abstract The name of the class as seen in the REST API. 55 | */ 56 | + (NSString *)parseClassName; 57 | 58 | /*! 59 | @abstract Create a query which returns objects of this type. 60 | 61 | @discussion A default implementation is provided by which should always be sufficient. 62 | */ 63 | + (PF_NULLABLE PFQuery *)query; 64 | 65 | /*! 66 | @abstract Returns a query for objects of this type with a given predicate. 67 | 68 | @discussion A default implementation is provided by which should always be sufficient. 69 | 70 | @param predicate The predicate to create conditions from. 71 | 72 | @returns An instance of . 73 | 74 | @see [PFQuery queryWithClassName:predicate:] 75 | */ 76 | + (PF_NULLABLE PFQuery *)queryWithPredicate:(PF_NULLABLE NSPredicate *)predicate; 77 | 78 | /*! 79 | @abstract Lets Parse know this class should be used to instantiate all objects with class type . 80 | 81 | @warning This method must be called before <[Parse setApplicationId:clientKey:]> 82 | */ 83 | + (void)registerSubclass; 84 | 85 | @end 86 | 87 | PF_ASSUME_NONNULL_END 88 | -------------------------------------------------------------------------------- /Parse.framework/Headers/PFUserAuthenticationDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | 14 | PF_ASSUME_NONNULL_BEGIN 15 | 16 | /*! 17 | Provides a general interface for delegation of third party authentication with s. 18 | */ 19 | @protocol PFUserAuthenticationDelegate 20 | 21 | /*! 22 | @abstract Called when restoring third party authentication credentials that have been serialized, 23 | such as session keys, user id, etc. 24 | 25 | @note This method will be executed on a background thread. 26 | 27 | @param authData The auth data for the provider. This value may be `nil` when unlinking an account. 28 | 29 | @returns `YES` - if the `authData` was succesfully synchronized, 30 | or `NO` if user should not longer be associated because of bad `authData`. 31 | */ 32 | - (BOOL)restoreAuthenticationWithAuthData:(PF_NULLABLE NSDictionary PF_GENERIC(NSString *, NSString *) *)authData; 33 | 34 | @end 35 | 36 | PF_ASSUME_NONNULL_END 37 | -------------------------------------------------------------------------------- /Parse.framework/Headers/Parse.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Parse, LLC. 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 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | #import 19 | #import 20 | #import 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import 32 | 33 | #if TARGET_OS_IPHONE 34 | 35 | #import 36 | #import 37 | #import 38 | 39 | #endif 40 | 41 | PF_ASSUME_NONNULL_BEGIN 42 | 43 | /*! 44 | The `Parse` class contains static functions that handle global configuration for the Parse framework. 45 | */ 46 | @interface Parse : NSObject 47 | 48 | ///-------------------------------------- 49 | /// @name Connecting to Parse 50 | ///-------------------------------------- 51 | 52 | /*! 53 | @abstract Sets the applicationId and clientKey of your application. 54 | 55 | @param applicationId The application id of your Parse application. 56 | @param clientKey The client key of your Parse application. 57 | */ 58 | + (void)setApplicationId:(NSString *)applicationId clientKey:(NSString *)clientKey; 59 | 60 | /*! 61 | @abstract The current application id that was used to configure Parse framework. 62 | */ 63 | + (NSString *)getApplicationId; 64 | 65 | /*! 66 | @abstract The current client key that was used to configure Parse framework. 67 | */ 68 | + (NSString *)getClientKey; 69 | 70 | ///-------------------------------------- 71 | /// @name Enabling Local Datastore 72 | ///-------------------------------------- 73 | 74 | /*! 75 | @abstract Enable pinning in your application. This must be called before your application can use 76 | pinning. The recommended way is to call this method before `setApplicationId:clientKey:`. 77 | */ 78 | + (void)enableLocalDatastore; 79 | 80 | /*! 81 | @abstract Flag that indicates whether Local Datastore is enabled. 82 | 83 | @returns `YES` if Local Datastore is enabled, otherwise `NO`. 84 | */ 85 | + (BOOL)isLocalDatastoreEnabled; 86 | 87 | ///-------------------------------------- 88 | /// @name Enabling Extensions Data Sharing 89 | ///-------------------------------------- 90 | 91 | /*! 92 | @abstract Enables data sharing with an application group identifier. 93 | 94 | @discussion After enabling - Local Datastore, `currentUser`, `currentInstallation` and all eventually commands 95 | are going to be available to every application/extension in a group that have the same Parse applicationId. 96 | 97 | @warning This method is required to be called before . 98 | 99 | @param groupIdentifier Application Group Identifier to share data with. 100 | */ 101 | + (void)enableDataSharingWithApplicationGroupIdentifier:(NSString *)groupIdentifier PF_EXTENSION_UNAVAILABLE("Use `enableDataSharingWithApplicationGroupIdentifier:containingApplication:`."); 102 | 103 | /*! 104 | @abstract Enables data sharing with an application group identifier. 105 | 106 | @discussion After enabling - Local Datastore, `currentUser`, `currentInstallation` and all eventually commands 107 | are going to be available to every application/extension in a group that have the same Parse applicationId. 108 | 109 | @warning This method is required to be called before . 110 | This method can only be used by application extensions. 111 | 112 | @param groupIdentifier Application Group Identifier to share data with. 113 | @param bundleIdentifier Bundle identifier of the containing application. 114 | */ 115 | + (void)enableDataSharingWithApplicationGroupIdentifier:(NSString *)groupIdentifier 116 | containingApplication:(NSString *)bundleIdentifier; 117 | 118 | /*! 119 | @abstract Application Group Identifier for Data Sharing 120 | 121 | @returns `NSString` value if data sharing is enabled, otherwise `nil`. 122 | */ 123 | + (NSString *)applicationGroupIdentifierForDataSharing; 124 | 125 | /*! 126 | @abstract Containing application bundle identifier. 127 | 128 | @returns `NSString` value if data sharing is enabled, otherwise `nil`. 129 | */ 130 | + (NSString *)containingApplicationBundleIdentifierForDataSharing; 131 | 132 | #if PARSE_IOS_ONLY 133 | 134 | ///-------------------------------------- 135 | /// @name Configuring UI Settings 136 | ///-------------------------------------- 137 | 138 | /*! 139 | @abstract Set whether to show offline messages when using a Parse view or view controller related classes. 140 | 141 | @param enabled Whether a `UIAlertView` should be shown when the device is offline 142 | and network access is required from a view or view controller. 143 | 144 | @deprecated This method has no effect. 145 | */ 146 | + (void)offlineMessagesEnabled:(BOOL)enabled PARSE_DEPRECATED("This method is deprecated and has no effect."); 147 | 148 | /*! 149 | @abstract Set whether to show an error message when using a Parse view or view controller related classes 150 | and a Parse error was generated via a query. 151 | 152 | @param enabled Whether a `UIAlertView` should be shown when an error occurs. 153 | 154 | @deprecated This method has no effect. 155 | */ 156 | + (void)errorMessagesEnabled:(BOOL)enabled PARSE_DEPRECATED("This method is deprecated and has no effect."); 157 | 158 | #endif 159 | 160 | ///-------------------------------------- 161 | /// @name Logging 162 | ///-------------------------------------- 163 | 164 | /*! 165 | @abstract Sets the level of logging to display. 166 | 167 | @discussion By default: 168 | - If running inside an app that was downloaded from iOS App Store - it is set to 169 | - All other cases - it is set to 170 | 171 | @param logLevel Log level to set. 172 | @see PFLogLevel 173 | */ 174 | + (void)setLogLevel:(PFLogLevel)logLevel; 175 | 176 | /*! 177 | @abstract Log level that will be displayed. 178 | 179 | @discussion By default: 180 | - If running inside an app that was downloaded from iOS App Store - it is set to 181 | - All other cases - it is set to 182 | 183 | @returns A value. 184 | @see PFLogLevel 185 | */ 186 | + (PFLogLevel)logLevel; 187 | 188 | @end 189 | 190 | PF_ASSUME_NONNULL_END 191 | -------------------------------------------------------------------------------- /Parse.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedFish/Uber/a6e83e686517e60414d067edcccd0d202ca793e4/Parse.framework/Info.plist -------------------------------------------------------------------------------- /Parse.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Parse { 2 | umbrella header "Parse.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Parse.framework/Parse: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedFish/Uber/a6e83e686517e60414d067edcccd0d202ca793e4/Parse.framework/Parse -------------------------------------------------------------------------------- /Parse.framework/en.lproj/Parse.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedFish/Uber/a6e83e686517e60414d067edcccd0d202ca793e4/Parse.framework/en.lproj/Parse.strings -------------------------------------------------------------------------------- /Parse.framework/third_party_licenses.txt: -------------------------------------------------------------------------------- 1 | THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THE PARSE PRODUCT. 2 | 3 | ----- 4 | 5 | The following software may be included in this product: OAuthCore. This software contains the following license and notice below: 6 | 7 | Copyright (C) 2012 Loren Brichter 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 14 | 15 | ----- 16 | 17 | The following software may be included in this product: google-breakpad. This software contains the following license and notice below: 18 | 19 | Copyright (c) 2006, Google Inc. 20 | All rights reserved. 21 | 22 | Redistribution and use in source and binary forms, with or without 23 | modification, are permitted provided that the following conditions are 24 | met: 25 | 26 | * Redistributions of source code must retain the above copyright 27 | notice, this list of conditions and the following disclaimer. 28 | * Redistributions in binary form must reproduce the above 29 | copyright notice, this list of conditions and the following disclaimer 30 | in the documentation and/or other materials provided with the 31 | distribution. 32 | * Neither the name of Google Inc. nor the names of its 33 | contributors may be used to endorse or promote products derived from 34 | this software without specific prior written permission. 35 | 36 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 37 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 38 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 39 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 40 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 41 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 42 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 43 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 44 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 45 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 46 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 47 | 48 | -------------------------------------------------------------------- 49 | 50 | Copyright 2001-2004 Unicode, Inc. 51 | 52 | Disclaimer 53 | 54 | This source code is provided as is by Unicode, Inc. No claims are 55 | made as to fitness for any particular purpose. No warranties of any 56 | kind are expressed or implied. The recipient agrees to determine 57 | applicability of information provided. If this file has been 58 | purchased on magnetic or optical media from Unicode, Inc., the 59 | sole remedy for any claim will be exchange of defective media 60 | within 90 days of receipt. 61 | 62 | Limitations on Rights to Redistribute This Code 63 | 64 | Unicode, Inc. hereby grants the right to freely use the information 65 | supplied in this file in the creation of products supporting the 66 | Unicode Standard, and to make copies of this file in any form 67 | for internal or external distribution as long as this notice 68 | remains attached. 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Uber Clone iOS Application 2 | 3 | Uber Clone iOS 9 application using Swift 2 (Xcode 7). 4 | This project is a clone of Uber which is a transportation network application. It allows riders to submit trip request which is then routed to Uber drivers who use their own cars. 5 | 6 | The app implements some of the main features of Uber: 7 | - Login/Signup page 8 | - Logout 9 | - Call an Uber 10 | - Check rider request (disance, time, location) 11 | - Get direction to the rider who call an Uber 12 | - Get position of the driver in real time 13 | 14 | The application uses these main elements : 15 | - [Parse](https://www.parse.com) Framework 16 | - MapKit 17 | - Background location updates mode 18 | - Navigation controller 19 | - Table view controller 20 | 21 | ## Screenshots: 22 | 23 | ![ScreenShot1](https://raw.github.com/RedFish/Uber/master/Screenshots/Screenshot_1.png) 24 | ![ScreenShot1](https://raw.github.com/RedFish/Uber/master/Screenshots/Screenshot_2.png) 25 | ![ScreenShot1](https://raw.github.com/RedFish/Uber/master/Screenshots/Screenshot_3.png) 26 | -------------------------------------------------------------------------------- /Screenshots/Screenshot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedFish/Uber/a6e83e686517e60414d067edcccd0d202ca793e4/Screenshots/Screenshot_1.png -------------------------------------------------------------------------------- /Screenshots/Screenshot_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedFish/Uber/a6e83e686517e60414d067edcccd0d202ca793e4/Screenshots/Screenshot_2.png -------------------------------------------------------------------------------- /Screenshots/Screenshot_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedFish/Uber/a6e83e686517e60414d067edcccd0d202ca793e4/Screenshots/Screenshot_3.png -------------------------------------------------------------------------------- /Uber.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D4A312531BC851960087FF8C /* Cell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4A312521BC851960087FF8C /* Cell.swift */; }; 11 | D4A312551BC85FB30087FF8C /* ViewRequestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4A312541BC85FB30087FF8C /* ViewRequestViewController.swift */; }; 12 | D4AD62841BC3028800F4D6C7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4AD62831BC3028800F4D6C7 /* AppDelegate.swift */; }; 13 | D4AD62861BC3028800F4D6C7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4AD62851BC3028800F4D6C7 /* ViewController.swift */; }; 14 | D4AD62891BC3028800F4D6C7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D4AD62871BC3028800F4D6C7 /* Main.storyboard */; }; 15 | D4AD628B1BC3028800F4D6C7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D4AD628A1BC3028800F4D6C7 /* Assets.xcassets */; }; 16 | D4AD628E1BC3028800F4D6C7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D4AD628C1BC3028800F4D6C7 /* LaunchScreen.storyboard */; }; 17 | D4AD62981BC302CC00F4D6C7 /* Bolts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4AD62961BC302CC00F4D6C7 /* Bolts.framework */; }; 18 | D4AD62991BC302CC00F4D6C7 /* Parse.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4AD62971BC302CC00F4D6C7 /* Parse.framework */; }; 19 | D4AD629B1BC302EE00F4D6C7 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4AD629A1BC302EE00F4D6C7 /* AudioToolbox.framework */; }; 20 | D4AD629D1BC302F700F4D6C7 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4AD629C1BC302F700F4D6C7 /* CFNetwork.framework */; }; 21 | D4AD629F1BC302FF00F4D6C7 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4AD629E1BC302FF00F4D6C7 /* CoreGraphics.framework */; }; 22 | D4AD62A11BC3030800F4D6C7 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4AD62A01BC3030800F4D6C7 /* CoreLocation.framework */; }; 23 | D4AD62A31BC3031000F4D6C7 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4AD62A21BC3031000F4D6C7 /* QuartzCore.framework */; }; 24 | D4AD62A51BC3031600F4D6C7 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4AD62A41BC3031600F4D6C7 /* Security.framework */; }; 25 | D4AD62A91BC3032500F4D6C7 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4AD62A81BC3032500F4D6C7 /* SystemConfiguration.framework */; }; 26 | D4AD62AB1BC3033300F4D6C7 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D4AD62AA1BC3033300F4D6C7 /* libz.tbd */; }; 27 | D4AD62AD1BC3033B00F4D6C7 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D4AD62AC1BC3033B00F4D6C7 /* libsqlite3.tbd */; }; 28 | D4AD62AF1BC3189300F4D6C7 /* RiderViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4AD62AE1BC3189300F4D6C7 /* RiderViewController.swift */; }; 29 | D4AD62B11BC319BF00F4D6C7 /* DriverViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4AD62B01BC319BF00F4D6C7 /* DriverViewController.swift */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | D4A312521BC851960087FF8C /* Cell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Cell.swift; sourceTree = ""; }; 34 | D4A312541BC85FB30087FF8C /* ViewRequestViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewRequestViewController.swift; sourceTree = ""; }; 35 | D4AD62801BC3028800F4D6C7 /* Uber.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Uber.app; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | D4AD62831BC3028800F4D6C7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | D4AD62851BC3028800F4D6C7 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 38 | D4AD62881BC3028800F4D6C7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 39 | D4AD628A1BC3028800F4D6C7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 40 | D4AD628D1BC3028800F4D6C7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 41 | D4AD628F1BC3028800F4D6C7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 42 | D4AD62961BC302CC00F4D6C7 /* Bolts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Bolts.framework; sourceTree = ""; }; 43 | D4AD62971BC302CC00F4D6C7 /* Parse.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Parse.framework; sourceTree = ""; }; 44 | D4AD629A1BC302EE00F4D6C7 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 45 | D4AD629C1BC302F700F4D6C7 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; 46 | D4AD629E1BC302FF00F4D6C7 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 47 | D4AD62A01BC3030800F4D6C7 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; 48 | D4AD62A21BC3031000F4D6C7 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 49 | D4AD62A41BC3031600F4D6C7 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 50 | D4AD62A81BC3032500F4D6C7 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 51 | D4AD62AA1BC3033300F4D6C7 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 52 | D4AD62AC1BC3033B00F4D6C7 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; }; 53 | D4AD62AE1BC3189300F4D6C7 /* RiderViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RiderViewController.swift; sourceTree = ""; }; 54 | D4AD62B01BC319BF00F4D6C7 /* DriverViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DriverViewController.swift; sourceTree = ""; }; 55 | /* End PBXFileReference section */ 56 | 57 | /* Begin PBXFrameworksBuildPhase section */ 58 | D4AD627D1BC3028800F4D6C7 /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | D4AD62AD1BC3033B00F4D6C7 /* libsqlite3.tbd in Frameworks */, 63 | D4AD62AB1BC3033300F4D6C7 /* libz.tbd in Frameworks */, 64 | D4AD62A91BC3032500F4D6C7 /* SystemConfiguration.framework in Frameworks */, 65 | D4AD62A51BC3031600F4D6C7 /* Security.framework in Frameworks */, 66 | D4AD62A31BC3031000F4D6C7 /* QuartzCore.framework in Frameworks */, 67 | D4AD62A11BC3030800F4D6C7 /* CoreLocation.framework in Frameworks */, 68 | D4AD629F1BC302FF00F4D6C7 /* CoreGraphics.framework in Frameworks */, 69 | D4AD629D1BC302F700F4D6C7 /* CFNetwork.framework in Frameworks */, 70 | D4AD629B1BC302EE00F4D6C7 /* AudioToolbox.framework in Frameworks */, 71 | D4AD62991BC302CC00F4D6C7 /* Parse.framework in Frameworks */, 72 | D4AD62981BC302CC00F4D6C7 /* Bolts.framework in Frameworks */, 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | /* End PBXFrameworksBuildPhase section */ 77 | 78 | /* Begin PBXGroup section */ 79 | D4AD62771BC3028800F4D6C7 = { 80 | isa = PBXGroup; 81 | children = ( 82 | D4AD62951BC3029600F4D6C7 /* Framework */, 83 | D4AD62821BC3028800F4D6C7 /* Uber */, 84 | D4AD62811BC3028800F4D6C7 /* Products */, 85 | ); 86 | sourceTree = ""; 87 | }; 88 | D4AD62811BC3028800F4D6C7 /* Products */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | D4AD62801BC3028800F4D6C7 /* Uber.app */, 92 | ); 93 | name = Products; 94 | sourceTree = ""; 95 | }; 96 | D4AD62821BC3028800F4D6C7 /* Uber */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | D4AD62831BC3028800F4D6C7 /* AppDelegate.swift */, 100 | D4AD62851BC3028800F4D6C7 /* ViewController.swift */, 101 | D4AD62AE1BC3189300F4D6C7 /* RiderViewController.swift */, 102 | D4AD62B01BC319BF00F4D6C7 /* DriverViewController.swift */, 103 | D4A312541BC85FB30087FF8C /* ViewRequestViewController.swift */, 104 | D4A312521BC851960087FF8C /* Cell.swift */, 105 | D4AD62871BC3028800F4D6C7 /* Main.storyboard */, 106 | D4AD628A1BC3028800F4D6C7 /* Assets.xcassets */, 107 | D4AD628C1BC3028800F4D6C7 /* LaunchScreen.storyboard */, 108 | D4AD628F1BC3028800F4D6C7 /* Info.plist */, 109 | ); 110 | path = Uber; 111 | sourceTree = ""; 112 | }; 113 | D4AD62951BC3029600F4D6C7 /* Framework */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | D4AD62AC1BC3033B00F4D6C7 /* libsqlite3.tbd */, 117 | D4AD62AA1BC3033300F4D6C7 /* libz.tbd */, 118 | D4AD62A81BC3032500F4D6C7 /* SystemConfiguration.framework */, 119 | D4AD62A41BC3031600F4D6C7 /* Security.framework */, 120 | D4AD62A21BC3031000F4D6C7 /* QuartzCore.framework */, 121 | D4AD62A01BC3030800F4D6C7 /* CoreLocation.framework */, 122 | D4AD629E1BC302FF00F4D6C7 /* CoreGraphics.framework */, 123 | D4AD629C1BC302F700F4D6C7 /* CFNetwork.framework */, 124 | D4AD629A1BC302EE00F4D6C7 /* AudioToolbox.framework */, 125 | D4AD62961BC302CC00F4D6C7 /* Bolts.framework */, 126 | D4AD62971BC302CC00F4D6C7 /* Parse.framework */, 127 | ); 128 | name = Framework; 129 | sourceTree = ""; 130 | }; 131 | /* End PBXGroup section */ 132 | 133 | /* Begin PBXNativeTarget section */ 134 | D4AD627F1BC3028800F4D6C7 /* Uber */ = { 135 | isa = PBXNativeTarget; 136 | buildConfigurationList = D4AD62921BC3028800F4D6C7 /* Build configuration list for PBXNativeTarget "Uber" */; 137 | buildPhases = ( 138 | D4AD627C1BC3028800F4D6C7 /* Sources */, 139 | D4AD627D1BC3028800F4D6C7 /* Frameworks */, 140 | D4AD627E1BC3028800F4D6C7 /* Resources */, 141 | ); 142 | buildRules = ( 143 | ); 144 | dependencies = ( 145 | ); 146 | name = Uber; 147 | productName = Uber; 148 | productReference = D4AD62801BC3028800F4D6C7 /* Uber.app */; 149 | productType = "com.apple.product-type.application"; 150 | }; 151 | /* End PBXNativeTarget section */ 152 | 153 | /* Begin PBXProject section */ 154 | D4AD62781BC3028800F4D6C7 /* Project object */ = { 155 | isa = PBXProject; 156 | attributes = { 157 | LastUpgradeCheck = 0830; 158 | ORGANIZATIONNAME = "Richard Guerci"; 159 | TargetAttributes = { 160 | D4AD627F1BC3028800F4D6C7 = { 161 | CreatedOnToolsVersion = 7.0.1; 162 | DevelopmentTeam = BDP2BDP9HM; 163 | LastSwiftMigration = 0830; 164 | SystemCapabilities = { 165 | com.apple.BackgroundModes = { 166 | enabled = 1; 167 | }; 168 | com.apple.InAppPurchase = { 169 | enabled = 0; 170 | }; 171 | }; 172 | }; 173 | }; 174 | }; 175 | buildConfigurationList = D4AD627B1BC3028800F4D6C7 /* Build configuration list for PBXProject "Uber" */; 176 | compatibilityVersion = "Xcode 3.2"; 177 | developmentRegion = English; 178 | hasScannedForEncodings = 0; 179 | knownRegions = ( 180 | en, 181 | Base, 182 | ); 183 | mainGroup = D4AD62771BC3028800F4D6C7; 184 | productRefGroup = D4AD62811BC3028800F4D6C7 /* Products */; 185 | projectDirPath = ""; 186 | projectRoot = ""; 187 | targets = ( 188 | D4AD627F1BC3028800F4D6C7 /* Uber */, 189 | ); 190 | }; 191 | /* End PBXProject section */ 192 | 193 | /* Begin PBXResourcesBuildPhase section */ 194 | D4AD627E1BC3028800F4D6C7 /* Resources */ = { 195 | isa = PBXResourcesBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | D4AD628E1BC3028800F4D6C7 /* LaunchScreen.storyboard in Resources */, 199 | D4AD628B1BC3028800F4D6C7 /* Assets.xcassets in Resources */, 200 | D4AD62891BC3028800F4D6C7 /* Main.storyboard in Resources */, 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | }; 204 | /* End PBXResourcesBuildPhase section */ 205 | 206 | /* Begin PBXSourcesBuildPhase section */ 207 | D4AD627C1BC3028800F4D6C7 /* Sources */ = { 208 | isa = PBXSourcesBuildPhase; 209 | buildActionMask = 2147483647; 210 | files = ( 211 | D4AD62B11BC319BF00F4D6C7 /* DriverViewController.swift in Sources */, 212 | D4A312551BC85FB30087FF8C /* ViewRequestViewController.swift in Sources */, 213 | D4AD62861BC3028800F4D6C7 /* ViewController.swift in Sources */, 214 | D4A312531BC851960087FF8C /* Cell.swift in Sources */, 215 | D4AD62AF1BC3189300F4D6C7 /* RiderViewController.swift in Sources */, 216 | D4AD62841BC3028800F4D6C7 /* AppDelegate.swift in Sources */, 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXSourcesBuildPhase section */ 221 | 222 | /* Begin PBXVariantGroup section */ 223 | D4AD62871BC3028800F4D6C7 /* Main.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | D4AD62881BC3028800F4D6C7 /* Base */, 227 | ); 228 | name = Main.storyboard; 229 | sourceTree = ""; 230 | }; 231 | D4AD628C1BC3028800F4D6C7 /* LaunchScreen.storyboard */ = { 232 | isa = PBXVariantGroup; 233 | children = ( 234 | D4AD628D1BC3028800F4D6C7 /* Base */, 235 | ); 236 | name = LaunchScreen.storyboard; 237 | sourceTree = ""; 238 | }; 239 | /* End PBXVariantGroup section */ 240 | 241 | /* Begin XCBuildConfiguration section */ 242 | D4AD62901BC3028800F4D6C7 /* Debug */ = { 243 | isa = XCBuildConfiguration; 244 | buildSettings = { 245 | ALWAYS_SEARCH_USER_PATHS = NO; 246 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 247 | CLANG_CXX_LIBRARY = "libc++"; 248 | CLANG_ENABLE_MODULES = YES; 249 | CLANG_ENABLE_OBJC_ARC = YES; 250 | CLANG_WARN_BOOL_CONVERSION = YES; 251 | CLANG_WARN_CONSTANT_CONVERSION = YES; 252 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 253 | CLANG_WARN_EMPTY_BODY = YES; 254 | CLANG_WARN_ENUM_CONVERSION = YES; 255 | CLANG_WARN_INFINITE_RECURSION = YES; 256 | CLANG_WARN_INT_CONVERSION = YES; 257 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 258 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 259 | CLANG_WARN_UNREACHABLE_CODE = YES; 260 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 261 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 262 | COPY_PHASE_STRIP = NO; 263 | DEBUG_INFORMATION_FORMAT = dwarf; 264 | ENABLE_STRICT_OBJC_MSGSEND = YES; 265 | ENABLE_TESTABILITY = YES; 266 | GCC_C_LANGUAGE_STANDARD = gnu99; 267 | GCC_DYNAMIC_NO_PIC = NO; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_OPTIMIZATION_LEVEL = 0; 270 | GCC_PREPROCESSOR_DEFINITIONS = ( 271 | "DEBUG=1", 272 | "$(inherited)", 273 | ); 274 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 275 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 276 | GCC_WARN_UNDECLARED_SELECTOR = YES; 277 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 278 | GCC_WARN_UNUSED_FUNCTION = YES; 279 | GCC_WARN_UNUSED_VARIABLE = YES; 280 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 281 | MTL_ENABLE_DEBUG_INFO = YES; 282 | ONLY_ACTIVE_ARCH = YES; 283 | SDKROOT = iphoneos; 284 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 285 | }; 286 | name = Debug; 287 | }; 288 | D4AD62911BC3028800F4D6C7 /* Release */ = { 289 | isa = XCBuildConfiguration; 290 | buildSettings = { 291 | ALWAYS_SEARCH_USER_PATHS = NO; 292 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 293 | CLANG_CXX_LIBRARY = "libc++"; 294 | CLANG_ENABLE_MODULES = YES; 295 | CLANG_ENABLE_OBJC_ARC = YES; 296 | CLANG_WARN_BOOL_CONVERSION = YES; 297 | CLANG_WARN_CONSTANT_CONVERSION = YES; 298 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 299 | CLANG_WARN_EMPTY_BODY = YES; 300 | CLANG_WARN_ENUM_CONVERSION = YES; 301 | CLANG_WARN_INFINITE_RECURSION = YES; 302 | CLANG_WARN_INT_CONVERSION = YES; 303 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 304 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 305 | CLANG_WARN_UNREACHABLE_CODE = YES; 306 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 307 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 308 | COPY_PHASE_STRIP = NO; 309 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 310 | ENABLE_NS_ASSERTIONS = NO; 311 | ENABLE_STRICT_OBJC_MSGSEND = YES; 312 | GCC_C_LANGUAGE_STANDARD = gnu99; 313 | GCC_NO_COMMON_BLOCKS = YES; 314 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 315 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 316 | GCC_WARN_UNDECLARED_SELECTOR = YES; 317 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 318 | GCC_WARN_UNUSED_FUNCTION = YES; 319 | GCC_WARN_UNUSED_VARIABLE = YES; 320 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 321 | MTL_ENABLE_DEBUG_INFO = NO; 322 | SDKROOT = iphoneos; 323 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 324 | VALIDATE_PRODUCT = YES; 325 | }; 326 | name = Release; 327 | }; 328 | D4AD62931BC3028800F4D6C7 /* Debug */ = { 329 | isa = XCBuildConfiguration; 330 | buildSettings = { 331 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 332 | FRAMEWORK_SEARCH_PATHS = ( 333 | "$(inherited)", 334 | "$(PROJECT_DIR)", 335 | ); 336 | INFOPLIST_FILE = Uber/Info.plist; 337 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 338 | PRODUCT_BUNDLE_IDENTIFIER = com.guerci.richard.Uber; 339 | PRODUCT_NAME = "$(TARGET_NAME)"; 340 | SWIFT_VERSION = 3.0; 341 | }; 342 | name = Debug; 343 | }; 344 | D4AD62941BC3028800F4D6C7 /* Release */ = { 345 | isa = XCBuildConfiguration; 346 | buildSettings = { 347 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 348 | FRAMEWORK_SEARCH_PATHS = ( 349 | "$(inherited)", 350 | "$(PROJECT_DIR)", 351 | ); 352 | INFOPLIST_FILE = Uber/Info.plist; 353 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 354 | PRODUCT_BUNDLE_IDENTIFIER = com.guerci.richard.Uber; 355 | PRODUCT_NAME = "$(TARGET_NAME)"; 356 | SWIFT_VERSION = 3.0; 357 | }; 358 | name = Release; 359 | }; 360 | /* End XCBuildConfiguration section */ 361 | 362 | /* Begin XCConfigurationList section */ 363 | D4AD627B1BC3028800F4D6C7 /* Build configuration list for PBXProject "Uber" */ = { 364 | isa = XCConfigurationList; 365 | buildConfigurations = ( 366 | D4AD62901BC3028800F4D6C7 /* Debug */, 367 | D4AD62911BC3028800F4D6C7 /* Release */, 368 | ); 369 | defaultConfigurationIsVisible = 0; 370 | defaultConfigurationName = Release; 371 | }; 372 | D4AD62921BC3028800F4D6C7 /* Build configuration list for PBXNativeTarget "Uber" */ = { 373 | isa = XCConfigurationList; 374 | buildConfigurations = ( 375 | D4AD62931BC3028800F4D6C7 /* Debug */, 376 | D4AD62941BC3028800F4D6C7 /* Release */, 377 | ); 378 | defaultConfigurationIsVisible = 0; 379 | defaultConfigurationName = Release; 380 | }; 381 | /* End XCConfigurationList section */ 382 | }; 383 | rootObject = D4AD62781BC3028800F4D6C7 /* Project object */; 384 | } 385 | -------------------------------------------------------------------------------- /Uber.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Uber.xcodeproj/project.xcworkspace/xcuserdata/bogy.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedFish/Uber/a6e83e686517e60414d067edcccd0d202ca793e4/Uber.xcodeproj/project.xcworkspace/xcuserdata/bogy.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Uber.xcodeproj/xcuserdata/bogy.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Uber.xcodeproj/xcuserdata/bogy.xcuserdatad/xcschemes/Uber.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /Uber.xcodeproj/xcuserdata/bogy.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Uber.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | D4AD627F1BC3028800F4D6C7 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Uber/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Uber 4 | // 5 | // Created by Richard Guerci on 05/10/2015. 6 | // Copyright © 2015 Richard Guerci. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Parse 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | 18 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 19 | // Enable storing and querying data from Local Datastore. 20 | // Remove this line if you don't want to use Local Datastore features or want to use cachePolicy. 21 | Parse.enableLocalDatastore() 22 | 23 | // **************************************************************************** 24 | // Uncomment this line if you want to enable Crash Reporting 25 | // ParseCrashReporting.enable() 26 | // 27 | // Uncomment and fill in with your Parse credentials: 28 | Parse.setApplicationId("yDZO3W0Qln3T84PKkDxOrbqUFviBse4QzrUe2tv1", 29 | clientKey: "Qb1WDWWQMaAb20MOxYxLrFy6Dl08Gk0yJvQROJil") 30 | // 31 | // If you are using Facebook, uncomment and add your FacebookAppID to your bundle's plist as 32 | // described here: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/ 33 | // Uncomment the line inside ParseStartProject-Bridging-Header and the following line here: 34 | //PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions) 35 | // **************************************************************************** 36 | 37 | PFUser.enableAutomaticUser() 38 | 39 | let defaultACL = PFACL(); 40 | 41 | // If you would like all objects to be private by default, remove this line. 42 | defaultACL.setPublicReadAccess(true) 43 | 44 | PFACL.setDefault(defaultACL, withAccessForCurrentUser:true) 45 | 46 | if application.applicationState != UIApplicationState.background { 47 | // Track an app open here if we launch with a push, unless 48 | // "content_available" was used to trigger a background push (introduced in iOS 7). 49 | // In that case, we skip tracking here to avoid double counting the app-open. 50 | 51 | let preBackgroundPush = !application.responds(to: #selector(getter: UIApplication.backgroundRefreshStatus)) 52 | let oldPushHandlerOnly = !self.responds(to: #selector(UIApplicationDelegate.application(_:didReceiveRemoteNotification:fetchCompletionHandler:))) 53 | var noPushPayload = false; 54 | if let options = launchOptions { 55 | noPushPayload = options[UIApplicationLaunchOptionsKey.remoteNotification] != nil; 56 | } 57 | if (preBackgroundPush || oldPushHandlerOnly || noPushPayload) { 58 | PFAnalytics.trackAppOpened(launchOptions: launchOptions) 59 | } 60 | } 61 | 62 | // 63 | // Swift 1.2 64 | // 65 | // if application.respondsToSelector("registerUserNotificationSettings:") { 66 | // let userNotificationTypes = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound 67 | // let settings = UIUserNotificationSettings(forTypes: userNotificationTypes, categories: nil) 68 | // application.registerUserNotificationSettings(settings) 69 | // application.registerForRemoteNotifications() 70 | // } else { 71 | // let types = UIRemoteNotificationType.Badge | UIRemoteNotificationType.Alert | UIRemoteNotificationType.Sound 72 | // application.registerForRemoteNotificationTypes(types) 73 | // } 74 | 75 | // 76 | // Swift 2.0 77 | // 78 | // if #available(iOS 8.0, *) { 79 | // let types: UIUserNotificationType = [.Alert, .Badge, .Sound] 80 | // let settings = UIUserNotificationSettings(forTypes: types, categories: nil) 81 | // application.registerUserNotificationSettings(settings) 82 | // application.registerForRemoteNotifications() 83 | // } else { 84 | // let types: UIRemoteNotificationType = [.Alert, .Badge, .Sound] 85 | // application.registerForRemoteNotificationTypes(types) 86 | // } 87 | 88 | return true//FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions) 89 | } 90 | 91 | //-------------------------------------- 92 | // MARK: Push Notifications 93 | //-------------------------------------- 94 | 95 | func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { 96 | let installation = PFInstallation.current() 97 | installation.setDeviceTokenFrom(deviceToken) 98 | installation.saveInBackground() 99 | 100 | PFPush.subscribeToChannel(inBackground: "") { (succeeded: Bool, error: Error?) in 101 | if succeeded { 102 | print("ParseStarterProject successfully subscribed to push notifications on the broadcast channel.\n"); 103 | } else { 104 | print("ParseStarterProject failed to subscribe to push notifications on the broadcast channel with error = %@.\n", error?.localizedDescription ?? "Unknow") 105 | } 106 | } 107 | } 108 | 109 | func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { 110 | if (error as NSError?)?.code == 3010 { 111 | print("Push notifications are not supported in the iOS Simulator.\n") 112 | } else { 113 | print("application:didFailToRegisterForRemoteNotificationsWithError: %@\n", error) 114 | } 115 | } 116 | 117 | func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) { 118 | PFPush.handle(userInfo) 119 | if application.applicationState == UIApplicationState.inactive { 120 | PFAnalytics.trackAppOpened(withRemoteNotificationPayload: userInfo) 121 | } 122 | } 123 | 124 | /////////////////////////////////////////////////////////// 125 | // Uncomment this method if you want to use Push Notifications with Background App Refresh 126 | /////////////////////////////////////////////////////////// 127 | // func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) { 128 | // if application.applicationState == UIApplicationState.Inactive { 129 | // PFAnalytics.trackAppOpenedWithRemoteNotificationPayload(userInfo) 130 | // } 131 | // } 132 | 133 | //-------------------------------------- 134 | // MARK: Facebook SDK Integration 135 | //-------------------------------------- 136 | 137 | /* 138 | func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool { 139 | return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation) 140 | } 141 | 142 | 143 | //Make sure it isn't already declared in the app delegate (possible redefinition of func error) 144 | func applicationDidBecomeActive(application: UIApplication) { 145 | FBSDKAppEvents.activateApp() 146 | } 147 | */ 148 | 149 | func applicationWillResignActive(_ application: UIApplication) { 150 | // 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. 151 | // 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. 152 | } 153 | 154 | func applicationDidEnterBackground(_ application: UIApplication) { 155 | // 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. 156 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 157 | } 158 | 159 | func applicationWillEnterForeground(_ application: UIApplication) { 160 | // 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. 161 | } 162 | 163 | func applicationWillTerminate(_ application: UIApplication) { 164 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 165 | } 166 | 167 | 168 | } 169 | 170 | -------------------------------------------------------------------------------- /Uber/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "Entypo_e740(0)_58.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "idiom" : "iphone", 11 | "size" : "29x29", 12 | "scale" : "3x" 13 | }, 14 | { 15 | "size" : "40x40", 16 | "idiom" : "iphone", 17 | "filename" : "Entypo_e740(0)_80.png", 18 | "scale" : "2x" 19 | }, 20 | { 21 | "size" : "40x40", 22 | "idiom" : "iphone", 23 | "filename" : "Entypo_e740(0)_120-1.png", 24 | "scale" : "3x" 25 | }, 26 | { 27 | "size" : "60x60", 28 | "idiom" : "iphone", 29 | "filename" : "Entypo_e740(0)_120.png", 30 | "scale" : "2x" 31 | }, 32 | { 33 | "size" : "60x60", 34 | "idiom" : "iphone", 35 | "filename" : "Entypo_e740(0)_180.png", 36 | "scale" : "3x" 37 | } 38 | ], 39 | "info" : { 40 | "version" : 1, 41 | "author" : "xcode" 42 | } 43 | } -------------------------------------------------------------------------------- /Uber/Assets.xcassets/AppIcon.appiconset/Entypo_e740(0)_120-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedFish/Uber/a6e83e686517e60414d067edcccd0d202ca793e4/Uber/Assets.xcassets/AppIcon.appiconset/Entypo_e740(0)_120-1.png -------------------------------------------------------------------------------- /Uber/Assets.xcassets/AppIcon.appiconset/Entypo_e740(0)_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedFish/Uber/a6e83e686517e60414d067edcccd0d202ca793e4/Uber/Assets.xcassets/AppIcon.appiconset/Entypo_e740(0)_120.png -------------------------------------------------------------------------------- /Uber/Assets.xcassets/AppIcon.appiconset/Entypo_e740(0)_180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedFish/Uber/a6e83e686517e60414d067edcccd0d202ca793e4/Uber/Assets.xcassets/AppIcon.appiconset/Entypo_e740(0)_180.png -------------------------------------------------------------------------------- /Uber/Assets.xcassets/AppIcon.appiconset/Entypo_e740(0)_58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedFish/Uber/a6e83e686517e60414d067edcccd0d202ca793e4/Uber/Assets.xcassets/AppIcon.appiconset/Entypo_e740(0)_58.png -------------------------------------------------------------------------------- /Uber/Assets.xcassets/AppIcon.appiconset/Entypo_e740(0)_80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedFish/Uber/a6e83e686517e60414d067edcccd0d202ca793e4/Uber/Assets.xcassets/AppIcon.appiconset/Entypo_e740(0)_80.png -------------------------------------------------------------------------------- /Uber/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 | -------------------------------------------------------------------------------- /Uber/Cell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Cell.swift 3 | // Uber 4 | // 5 | // Created by Richard Guerci on 09/10/2015. 6 | // Copyright © 2015 Richard Guerci. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class Cell: UITableViewCell { 12 | 13 | @IBOutlet weak var username: UILabel! 14 | @IBOutlet weak var distance: UILabel! 15 | @IBOutlet weak var time: UILabel! 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Uber/DriverViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DriverViewController.swift 3 | // Uber 4 | // 5 | // Created by Richard Guerci on 05/10/2015. 6 | // Copyright © 2015 Richard Guerci. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Parse 11 | import MapKit 12 | 13 | struct RiderRequest { 14 | var username = "" 15 | var location = PFGeoPoint() 16 | var date = Date() 17 | } 18 | 19 | 20 | extension Double { 21 | func format(_ f: String) -> String { 22 | return NSString(format: "%\(f)f" as NSString, self) as String 23 | } 24 | } 25 | 26 | class DriverViewController: UITableViewController, CLLocationManagerDelegate { 27 | 28 | var mapManager: CLLocationManager! 29 | var location = PFGeoPoint() 30 | var riderRequests : [RiderRequest]! 31 | 32 | override func viewDidLoad() { 33 | super.viewDidLoad() 34 | 35 | riderRequests = [RiderRequest()] 36 | riderRequests.removeAll() 37 | 38 | //initialize LocationManager 39 | mapManager = CLLocationManager() 40 | mapManager.delegate = self 41 | mapManager.desiredAccuracy = kCLLocationAccuracyBest 42 | mapManager.requestAlwaysAuthorization() 43 | mapManager.startUpdatingLocation() 44 | } 45 | 46 | override func didReceiveMemoryWarning() { 47 | super.didReceiveMemoryWarning() 48 | } 49 | 50 | // MARK: - Table view data source 51 | 52 | override func numberOfSections(in tableView: UITableView) -> Int { 53 | // #warning Incomplete implementation, return the number of sections 54 | return 1 55 | } 56 | 57 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 58 | // #warning Incomplete implementation, return the number of rows 59 | return riderRequests.count 60 | } 61 | 62 | 63 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 64 | let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! Cell 65 | 66 | cell.username.text = riderRequests[indexPath.row].username 67 | let distance:Double = location.distanceInKilometers(to: riderRequests[indexPath.row].location) 68 | let format = ".1" 69 | cell.distance.text = "\(distance.format(format)) km" 70 | let minutes = abs(Int(riderRequests[indexPath.row].date.timeIntervalSinceNow / 60)) 71 | cell.time.text = "\(minutes) minutes ago" 72 | 73 | return cell 74 | } 75 | 76 | //Called every time the location is updated 77 | func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { 78 | //Get the location 79 | let userLocation:CLLocation = locations[0] 80 | //let coordinate = CLLocationCoordinate2DMake(userLocation.coordinate.latitude, userLocation.coordinate.longitude) 81 | location = PFGeoPoint(latitude: userLocation.coordinate.latitude, longitude: userLocation.coordinate.longitude) 82 | 83 | //update current location 84 | PFUser.current()?["driverLocation"] = self.location 85 | PFUser.current()!.saveInBackground() 86 | 87 | 88 | //refresh table 89 | let query = PFQuery(className: "RiderRequest") 90 | query.whereKey("location", nearGeoPoint: location, withinKilometers: 25) 91 | query.order(byAscending: "createdAt") 92 | query.limit = 10 93 | query.findObjectsInBackground(block: { (objects, error) -> Void in 94 | if error != nil { 95 | print("Error finding RiderRequest") 96 | } 97 | else { 98 | if let objects = objects { 99 | self.riderRequests.removeAll() 100 | for object in objects { 101 | if object["driverResponded"] == nil { 102 | let username = object["username"] as! String 103 | let location = object["location"] as! PFGeoPoint 104 | let date = object.createdAt 105 | self.riderRequests.append(RiderRequest(username: username, location: location, date: date!)) 106 | } 107 | } 108 | 109 | self.riderRequests = self.riderRequests.sorted(by: { $0.location.distanceInKilometers(to: self.location) < $1.location.distanceInKilometers(to: self.location) }) 110 | self.tableView.reloadData() 111 | } 112 | } 113 | }) 114 | } 115 | 116 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 117 | if segue.identifier == "logoutDriver" { 118 | PFUser.logOut() 119 | navigationController?.setNavigationBarHidden(navigationController?.isNavigationBarHidden == false, animated: false) 120 | } 121 | else if segue.identifier == "showViewRequest" { 122 | if let destination = segue.destination as? ViewRequestViewController { 123 | destination.request = riderRequests[(tableView.indexPathForSelectedRow?.row)!] 124 | } 125 | } 126 | } 127 | 128 | } 129 | -------------------------------------------------------------------------------- /Uber/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSLocationAlwaysUsageDescription 26 | So that rider can track your location 27 | NSLocationWhenInUseUsageDescription 28 | So that your Uber driver can find you 29 | UIBackgroundModes 30 | 31 | location 32 | 33 | UILaunchStoryboardName 34 | LaunchScreen 35 | UIMainStoryboardFile 36 | Main 37 | UIRequiredDeviceCapabilities 38 | 39 | armv7 40 | 41 | UISupportedInterfaceOrientations 42 | 43 | UIInterfaceOrientationPortrait 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Uber/RiderViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RiderViewController.swift 3 | // Uber 4 | // 5 | // Created by Richard Guerci on 05/10/2015. 6 | // Copyright © 2015 Richard Guerci. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Parse 11 | import MapKit 12 | 13 | class RiderViewController: UIViewController, CLLocationManagerDelegate { 14 | 15 | var mapManager: CLLocationManager! 16 | @IBOutlet weak var map: MKMapView! 17 | @IBOutlet weak var uberButton: UIButton! 18 | let riderAnnotation = MKPointAnnotation() 19 | let driverAnnotation = MKPointAnnotation() 20 | var location = PFGeoPoint () 21 | var driverLocation = CLLocationCoordinate2D () 22 | var isCallingUber = false 23 | var isDriverOnTheWay = false 24 | 25 | override func viewDidLoad() { 26 | super.viewDidLoad() 27 | 28 | //initialize LocationManager 29 | mapManager = CLLocationManager() 30 | mapManager.delegate = self 31 | mapManager.desiredAccuracy = kCLLocationAccuracyBest 32 | mapManager.requestWhenInUseAuthorization() 33 | mapManager.startUpdatingLocation() 34 | 35 | } 36 | 37 | override func didReceiveMemoryWarning() { 38 | super.didReceiveMemoryWarning() 39 | 40 | } 41 | @IBAction func callUberButtonAction(_ sender: AnyObject) { 42 | if !isCallingUber { 43 | let riderRequest = PFObject(className: "RiderRequest") 44 | riderRequest["username"] = PFUser.current()?.username 45 | riderRequest["location"] = location 46 | riderRequest.saveInBackground { (succsess, error) -> Void in 47 | if error == nil { 48 | //Success 49 | self.isCallingUber = true 50 | self.uberButton.setTitle("Cancel Uber", for: UIControlState()) 51 | } 52 | else { 53 | self.displayAlert("Could not call Uber", message: "Try again later") 54 | } 55 | } 56 | } 57 | else { 58 | //check if already followed 59 | let query = PFQuery(className: "RiderRequest") 60 | query.whereKey("username", equalTo: (PFUser.current()?.username)!) 61 | query.findObjectsInBackground(block: { (objects, error) -> Void in 62 | if error != nil { 63 | print("Error finding RiderRequest") 64 | } 65 | else { 66 | if let objects = objects { 67 | for object in objects { 68 | object.deleteInBackground() 69 | } 70 | } 71 | } 72 | }) 73 | self.uberButton.setTitle("Call an Uber", for: UIControlState()) 74 | isCallingUber = false 75 | } 76 | } 77 | 78 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 79 | if segue.identifier == "logoutRider" { 80 | PFUser.logOut() 81 | } 82 | } 83 | 84 | //Called every time the location is updated 85 | func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { 86 | //Get the location 87 | let userLocation:CLLocation = locations[0] 88 | let coordinate = CLLocationCoordinate2DMake(userLocation.coordinate.latitude, userLocation.coordinate.longitude) 89 | var latDelta = 0.01 90 | var lonDelta = 0.01 91 | if isDriverOnTheWay { 92 | latDelta = abs(driverLocation.latitude - coordinate.latitude) * 2 + 0.005 93 | lonDelta = abs(driverLocation.longitude - coordinate.longitude) * 2 + 0.005 94 | } 95 | let span:MKCoordinateSpan = MKCoordinateSpanMake(latDelta, lonDelta) 96 | let region:MKCoordinateRegion = MKCoordinateRegionMake(coordinate, span) 97 | map.setRegion(region, animated: true) 98 | 99 | location = PFGeoPoint(latitude: userLocation.coordinate.latitude, longitude: userLocation.coordinate.longitude) 100 | 101 | //get location of driver 102 | if isCallingUber { 103 | let query = PFQuery(className: "RiderRequest") 104 | query.whereKey("username", equalTo: (PFUser.current()?.username)!) 105 | query.findObjectsInBackground(block: { (objects, error) -> Void in 106 | if error != nil { 107 | print("Error finding RiderRequest") 108 | } 109 | else { 110 | if let objects = objects { 111 | for object in objects { 112 | if object["driverResponded"] != nil { 113 | if let driverResponded = object["driverResponded"] as? String { 114 | let queryUser = PFUser.query() 115 | queryUser?.whereKey("username", equalTo: driverResponded) 116 | queryUser?.findObjectsInBackground(block: { (drivers, error) -> Void in 117 | if error == nil { 118 | if let drivers = drivers { 119 | for driver in drivers { 120 | if let driverLocation = driver["driverLocation"] as? PFGeoPoint { 121 | let location = CLLocation(latitude: driverLocation.latitude, longitude: driverLocation.longitude) 122 | self.driverLocation = CLLocationCoordinate2DMake(driverLocation.latitude, driverLocation.longitude) 123 | let distance = (location.distance(from: CLLocation(latitude: self.location.latitude, longitude: self.location.longitude))/1000).format(".1") 124 | self.uberButton.setTitle("Driver is \(distance)km away!", for: UIControlState()) 125 | self.isDriverOnTheWay = true 126 | } 127 | } 128 | } 129 | } 130 | else { print("Cannot find driver") } 131 | }) 132 | } 133 | } 134 | } 135 | } 136 | } 137 | }) 138 | } 139 | 140 | 141 | map.removeAnnotation(riderAnnotation) 142 | riderAnnotation.coordinate = coordinate 143 | riderAnnotation.title = "You are here" 144 | map.addAnnotation(riderAnnotation) 145 | 146 | if isDriverOnTheWay { 147 | map.removeAnnotation(driverAnnotation) 148 | driverAnnotation.coordinate = driverLocation 149 | driverAnnotation.title = "Driver is here" 150 | map.addAnnotation(driverAnnotation) 151 | } 152 | } 153 | 154 | func displayAlert(_ title:String, message:String){ 155 | let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert) 156 | alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { (action) -> Void in 157 | self.dismiss(animated: true, completion: nil) 158 | })) 159 | self.present(alert, animated: true, completion: nil) 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /Uber/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Uber 4 | // 5 | // Created by Richard Guerci on 05/10/2015. 6 | // Copyright © 2015 Richard Guerci. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Parse 11 | 12 | class ViewController: UIViewController, UITextFieldDelegate { 13 | 14 | @IBOutlet weak var username: UITextField! 15 | @IBOutlet weak var password: UITextField! 16 | @IBOutlet weak var `switch`: UISwitch! 17 | @IBOutlet weak var riderLabel: UILabel! 18 | @IBOutlet weak var driverLabel: UILabel! 19 | @IBOutlet weak var submitButton: UIButton! 20 | @IBOutlet weak var toggleButton: UIButton! 21 | @IBOutlet weak var questionLabel: UILabel! 22 | 23 | var activityIndicator: UIActivityIndicatorView = UIActivityIndicatorView() 24 | var isSignUpMode = true 25 | 26 | override func viewDidLoad() { 27 | super.viewDidLoad() 28 | 29 | `switch`.isHidden = false 30 | riderLabel.isHidden = false 31 | driverLabel.isHidden = false 32 | username.delegate = self 33 | password.delegate = self 34 | } 35 | 36 | @IBAction func submitButtonAction(_ sender: AnyObject) { 37 | 38 | if username.text == "" || password.text == "" { 39 | displayAlert("Missing Field(s)", message: "Username and password are required") 40 | } 41 | else { 42 | //start spinner 43 | activityIndicator = UIActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 50, height: 50)) 44 | activityIndicator.center = self.view.center 45 | activityIndicator.hidesWhenStopped = true 46 | activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.gray 47 | view.addSubview(activityIndicator) 48 | //ignore interaction events 49 | activityIndicator.startAnimating() 50 | UIApplication.shared.beginIgnoringInteractionEvents() 51 | 52 | //set default error message 53 | var errorMessage = "Please try again" 54 | 55 | if isSignUpMode { 56 | //signup with parse 57 | let user = PFUser() 58 | user.username = username.text 59 | user.password = password.text 60 | user["isDriver"] = self.`switch`.isOn 61 | 62 | user.signUpInBackground(block: {(succeeded, error) in 63 | //enable interaction events 64 | self.activityIndicator.stopAnimating() 65 | UIApplication.shared.endIgnoringInteractionEvents() 66 | 67 | if error != nil { 68 | if let errorString = (error as NSError?)?.userInfo["error"] as? String { 69 | errorMessage = errorString 70 | } 71 | self.displayAlert("Failed to sign up", message: errorMessage) 72 | } else { 73 | self.displayAlert("Sign Up Succcess", message: "You can start using Uber") 74 | self.password.text = "" 75 | self.toggleButtonAction(nil) 76 | } 77 | }) 78 | } 79 | else{ 80 | //login with parse 81 | PFUser.logInWithUsername(inBackground: username.text!, password:password.text!) { 82 | (user: PFUser?, error: Error?) -> Void in 83 | //enable interaction events 84 | self.activityIndicator.stopAnimating() 85 | UIApplication.shared.endIgnoringInteractionEvents() 86 | 87 | if error != nil {//login failed 88 | if let errorString = (error as NSError?)?.userInfo["error"] as? String { 89 | errorMessage = errorString 90 | } 91 | self.displayAlert("Failed to login", message: errorMessage) 92 | } 93 | else { 94 | self.login() 95 | } 96 | } 97 | } 98 | } 99 | } 100 | 101 | func login(){ 102 | if let isDriver = PFUser.current()!["isDriver"] { 103 | if isDriver as! Bool { 104 | self.performSegue(withIdentifier: "showDriverView", sender: self) 105 | } 106 | else { 107 | self.performSegue(withIdentifier: "showRiderView", sender: self) 108 | } 109 | } 110 | } 111 | 112 | @IBAction func toggleButtonAction(_ sender: AnyObject?) { 113 | isSignUpMode = !isSignUpMode 114 | if isSignUpMode { 115 | `switch`.isHidden = false 116 | riderLabel.isHidden = false 117 | driverLabel.isHidden = false 118 | questionLabel.text = "Already registered ?" 119 | submitButton.setTitle("Sign Up", for: UIControlState()) 120 | toggleButton.setTitle("login", for: UIControlState()) 121 | } 122 | else { 123 | `switch`.isHidden = true 124 | riderLabel.isHidden = true 125 | driverLabel.isHidden = true 126 | questionLabel.text = "Not registered yet ?" 127 | submitButton.setTitle("Login", for: UIControlState()) 128 | toggleButton.setTitle("sign up", for: UIControlState()) 129 | } 130 | } 131 | 132 | 133 | override func didReceiveMemoryWarning() { 134 | super.didReceiveMemoryWarning() 135 | // Dispose of any resources that can be recreated. 136 | } 137 | 138 | func displayAlert(_ title:String, message:String){ 139 | let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert) 140 | alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { (action) -> Void in 141 | self.dismiss(animated: true, completion: nil) 142 | })) 143 | self.present(alert, animated: true, completion: nil) 144 | } 145 | 146 | //Remove keyboard when touch ouside the keyboard 147 | override func touchesBegan(_ touches: Set, with event: UIEvent?) { 148 | self.view.endEditing(true) 149 | } 150 | 151 | //Remove keyboard when clic 'return' 152 | func textFieldShouldReturn(_ textField: UITextField) -> Bool { 153 | textField.resignFirstResponder() 154 | return true 155 | } 156 | 157 | override func viewDidAppear(_ animated: Bool) { 158 | if let _ = PFUser.current()?.username { 159 | login() 160 | } 161 | } 162 | } 163 | 164 | -------------------------------------------------------------------------------- /Uber/ViewRequestViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewRequestViewController.swift 3 | // Uber 4 | // 5 | // Created by Richard Guerci on 09/10/2015. 6 | // Copyright © 2015 Richard Guerci. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Parse 11 | import MapKit 12 | 13 | class ViewRequestViewController: UIViewController, CLLocationManagerDelegate { 14 | 15 | var mapManager: CLLocationManager! 16 | @IBOutlet weak var map: MKMapView! 17 | var request = RiderRequest() 18 | 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | 22 | let userLocation = CLLocationCoordinate2D(latitude: request.location.latitude, longitude: request.location.longitude) 23 | let coordinate = CLLocationCoordinate2DMake(userLocation.latitude, userLocation.longitude) 24 | let span:MKCoordinateSpan = MKCoordinateSpanMake(0.01, 0.01) 25 | let region:MKCoordinateRegion = MKCoordinateRegionMake(coordinate, span) 26 | map.setRegion(region, animated: true) 27 | let riderAnnotation = MKPointAnnotation() 28 | riderAnnotation.coordinate = coordinate 29 | riderAnnotation.title = "\(request.username) is waiting here" 30 | map.addAnnotation(riderAnnotation) 31 | } 32 | 33 | @IBAction func pickUpRiderButtonAction(_ sender: AnyObject) { 34 | let query = PFQuery(className: "RiderRequest") 35 | query.whereKey("username", equalTo: request.username) 36 | query.findObjectsInBackground(block: { (objects, error) -> Void in 37 | if error != nil { 38 | print("Error finding RiderRequest") 39 | } 40 | else { 41 | if let objects = objects { 42 | for object in objects { 43 | let queryUpdate = PFQuery(className: "RiderRequest") 44 | queryUpdate.getObjectInBackground(withId: object.objectId!, block: {(object:PFObject?, error:Error?) -> Void in 45 | if error != nil { 46 | print("Error getting object RiderRequest") 47 | } 48 | else if let object = object{ 49 | //upadate db 50 | object["driverResponded"] = PFUser.current()?.username 51 | object.saveInBackground() 52 | 53 | //launch direction in maps 54 | CLGeocoder().reverseGeocodeLocation(CLLocation(latitude: self.request.location.latitude, longitude: self.request.location.longitude), completionHandler: { (placemarks, error) -> Void in 55 | if (error == nil) { 56 | //if statement was changed 57 | if let p = placemarks?[0] { 58 | let mapItem = MKMapItem(placemark: MKPlacemark(placemark:p)) 59 | mapItem.name = "Drive to this place to pick up \(self.request.username)" 60 | let launchOptions = [MKLaunchOptionsDirectionsModeKey : MKLaunchOptionsDirectionsModeDriving] 61 | mapItem.openInMaps(launchOptions: launchOptions) 62 | } 63 | } 64 | }) 65 | 66 | } 67 | }) 68 | } 69 | } 70 | } 71 | }) 72 | } 73 | 74 | override func didReceiveMemoryWarning() { 75 | super.didReceiveMemoryWarning() 76 | } 77 | } 78 | --------------------------------------------------------------------------------