├── .gitignore ├── Cartfile ├── Cartfile.resolved ├── CouchbaseLite.framework ├── CouchbaseLite ├── Headers │ ├── CBLAttachment.h │ ├── CBLAuthenticator.h │ ├── CBLBase.h │ ├── CBLDatabase.h │ ├── CBLDatabaseChange.h │ ├── CBLDocument.h │ ├── CBLGeometry.h │ ├── CBLJSON.h │ ├── CBLManager.h │ ├── CBLModel.h │ ├── CBLModelFactory.h │ ├── CBLQuery+FullTextSearch.h │ ├── CBLQuery+Geo.h │ ├── CBLQuery.h │ ├── CBLQueryBuilder.h │ ├── CBLReplication.h │ ├── CBLRevision.h │ ├── CBLUITableSource.h │ ├── CBLView.h │ ├── CouchbaseLite.h │ └── MYDynamicObject.h ├── Info.plist └── PrivateHeaders │ ├── CBLReplication+Transformation.h │ ├── CBLStatus.h │ └── CouchbaseLitePrivate.h ├── Crashlytics.framework ├── Crashlytics ├── Headers │ ├── ANSCompatibility.h │ ├── Answers.h │ ├── CLSAttributes.h │ ├── CLSLogging.h │ ├── CLSReport.h │ ├── CLSStackFrame.h │ └── Crashlytics.h ├── Info.plist ├── Modules │ └── module.modulemap ├── run ├── submit └── uploadDSYM ├── DeepStyle.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── DeepStyle ├── AddDeepStylePaintingViewController.swift ├── AddDeepStylePaintingViewController.xib ├── AddDeepStyleViewController.swift ├── AddDeepStyleViewController.xib ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ └── Icon-Small.png │ ├── Contents.json │ ├── Pablo picasso the dreamer.imageset │ │ ├── Contents.json │ │ └── Pablo picasso the dreamer.jpg │ ├── Picasso Girl Before a Mirror.imageset │ │ ├── Contents.json │ │ └── Picasso Girl Before a Mirror.jpg │ ├── back_porch.imageset │ │ ├── Contents.json │ │ └── back_porch.JPG │ ├── backyard.imageset │ │ ├── Contents.json │ │ └── backyard.jpg │ ├── icon-gear.imageset │ │ ├── Contents.json │ │ └── icon-gear-a-128.png │ ├── image_placeholder_icon.imageset │ │ ├── Contents.json │ │ └── image_placeholder_icon.png │ └── transit-icon.imageset │ │ ├── Contents.json │ │ └── transit-icon.png ├── CBUITableSource.h ├── CBUITableSource.m ├── Constants.swift ├── Couchbase-Lite-Bridging-Header.h ├── DBHelper.swift ├── DeepStyleJob.swift ├── DeepStyleJobViewController.swift ├── FullScreenImageViewController.swift ├── FullScreenImageViewController.xib ├── GalleryTableViewCell.swift ├── GalleryTableViewCell.xib ├── GalleryViewController.swift ├── GalleryViewController.xib ├── Info.plist ├── LoginSession.swift ├── LoginViewController.swift └── Util.swift ├── DeepStyle2Tests ├── DeepStyle2Tests.swift └── Info.plist ├── FBSDKCoreKit.framework ├── FBSDKCoreKit ├── Headers │ ├── FBSDKAccessToken.h │ ├── FBSDKAppEvents.h │ ├── FBSDKAppLinkResolver.h │ ├── FBSDKAppLinkUtility.h │ ├── FBSDKApplicationDelegate.h │ ├── FBSDKButton.h │ ├── FBSDKConstants.h │ ├── FBSDKCopying.h │ ├── FBSDKCoreKit.h │ ├── FBSDKGraphErrorRecoveryProcessor.h │ ├── FBSDKGraphRequest.h │ ├── FBSDKGraphRequestConnection.h │ ├── FBSDKGraphRequestDataAttachment.h │ ├── FBSDKMacros.h │ ├── FBSDKMutableCopying.h │ ├── FBSDKProfile.h │ ├── FBSDKProfilePictureView.h │ ├── FBSDKSettings.h │ ├── FBSDKTestUsersManager.h │ └── FBSDKUtility.h ├── Info.plist └── Modules │ └── module.modulemap ├── FBSDKLoginKit.framework ├── FBSDKLoginKit ├── Headers │ ├── FBSDKLoginButton.h │ ├── FBSDKLoginConstants.h │ ├── FBSDKLoginKit.h │ ├── FBSDKLoginManager.h │ ├── FBSDKLoginManagerLoginResult.h │ ├── FBSDKLoginTooltipView.h │ └── FBSDKTooltipView.h ├── Info.plist └── Modules │ └── module.modulemap ├── Fabric.framework ├── Fabric ├── Headers │ ├── FABAttributes.h │ └── Fabric.h ├── Info.plist ├── Modules │ └── module.modulemap ├── run └── uploadDSYM ├── README.md ├── libCBLForestDBStorage.a └── screenshots ├── add_image_1.png ├── add_image_2.png ├── deepstyle_screenshots_animated.gif ├── fb_login_1.png ├── fb_login_2.png ├── share_view.png ├── single_image_view.png ├── table.png └── three_image_view.png /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Cocoapods 23 | Pods 24 | DeepStyle/Info.plist.bak 25 | -------------------------------------------------------------------------------- /Cartfile: -------------------------------------------------------------------------------- 1 | github "cruffenach/CRToast" 2 | -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "cruffenach/CRToast" "0.0.9" 2 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/CouchbaseLite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/CouchbaseLite.framework/CouchbaseLite -------------------------------------------------------------------------------- /CouchbaseLite.framework/Headers/CBLAttachment.h: -------------------------------------------------------------------------------- 1 | // 2 | // CBLAttachment.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 6/21/12. 6 | // Copyright (c) 2012-2013 Couchbase, Inc. All rights reserved. 7 | // 8 | 9 | #import "CBLBase.h" 10 | @class CBLDocument, CBLRevision, CBLSavedRevision; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** A binary attachment to a document revision. 15 | Existing attachments can be gotten from -[CBLRevision attachmentNamed:]. 16 | New attachments can be created by calling the -setAttachment:... methods of CBLNewRevision or 17 | CBLModel. */ 18 | @interface CBLAttachment : NSObject 19 | 20 | /** The owning document revision. */ 21 | @property (readonly, retain) CBLRevision* revision; 22 | 23 | /** The owning document. */ 24 | @property (readonly) CBLDocument* document; 25 | 26 | /** The filename. */ 27 | @property (readonly, copy) NSString* name; 28 | 29 | /** The MIME type of the contents. */ 30 | @property (readonly, nullable) NSString* contentType; 31 | 32 | /** The length in bytes of the contents. */ 33 | @property (readonly) UInt64 length; 34 | 35 | /** The length in bytes of the encoded form of the attachment. 36 | This may be smaller than the length if the attachment is stored in compressed form. */ 37 | @property (readonly) UInt64 encodedLength; 38 | 39 | /** The Couchbase Lite metadata about the attachment, that lives in the document. */ 40 | @property (readonly) CBLJSONDict* metadata; 41 | 42 | /** Is the content locally available? This may be NO if the attachment's document was pulled 43 | from a remote database by a CBLReplication whose downloadAttachments property was NO. 44 | If so, the content accessors will return nil. The attachment can be downloaded by calling 45 | the replication's -downloadAttachment:onProgress: method. */ 46 | @property (readonly) BOOL contentAvailable; 47 | 48 | /** The data of the attachment. */ 49 | @property (readonly, nullable) NSData* content; 50 | 51 | /** Returns a stream from which you can read the data of the attachment. 52 | Remember to close it when you're done. */ 53 | - (NSInputStream*) openContentStream; 54 | 55 | /** The (file:) URL of the file containing the contents. 56 | This property is somewhat deprecated and is made available only for use with platform APIs that 57 | require file paths/URLs, e.g. some media playback APIs. Whenever possible, use the `content` 58 | property or the `openContentStream` method instead. 59 | The file must be treated as read-only! DO NOT MODIFY OR DELETE IT. 60 | If the database is encrypted, attachment files are also encrypted and not directly readable, 61 | so this property will return nil. */ 62 | @property (readonly, nullable) NSURL* contentURL; 63 | 64 | /** Deletes the attachment's contents from local storage. If the attachment is still available on 65 | a remote server, it can be restored by calling -[CBLReplication downloadAttachment:onProgress:]. 66 | */ 67 | - (BOOL) purge; 68 | 69 | - (instancetype) init NS_UNAVAILABLE; 70 | 71 | @end 72 | 73 | 74 | NS_ASSUME_NONNULL_END 75 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/Headers/CBLAuthenticator.h: -------------------------------------------------------------------------------- 1 | // 2 | // CBLAuthenticator.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 4/11/14. 6 | // Copyright (c) 2014 Couchbase, Inc. All rights reserved. 7 | 8 | 9 | #import "CBLBase.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /** The CBLAuthenticator protocol defines objects that can authenticate a user to a remote database 14 | server. An object conforming to this protocol is acquired from the CBLAuthenticator _class_'s 15 | factory methods, and is used by setting it as a CBLReplication's .authenticator property. 16 | This protocol is currently entirely opaque and not intended for applications to implement. 17 | The authenticator types are limited to those createable by factory methods. */ 18 | @protocol CBLAuthenticator 19 | // No user-servicable parts inside. 20 | @end 21 | 22 | 23 | /** The CBLAuthenticator class provides factory methods for creating authenticator objects, for use 24 | with the .authenticator property of a CBLReplication. */ 25 | @interface CBLAuthenticator : NSObject 26 | 27 | /** Creates an authenticator that will log in using HTTP Basic auth with the given user name and 28 | password. This should only be used over an SSL/TLS connection, as otherwise it's very easy for 29 | anyone sniffing network traffic to read the password. */ 30 | + (id) basicAuthenticatorWithName: (NSString*)name 31 | password: (NSString*)password; 32 | 33 | /** Creates an authenticator that will authenticate to a Couchbase Sync Gateway server using 34 | Facebook credentials. The token string must be an active Facebook login token. On iOS you can 35 | acquire one from the Accounts framework, or you can use Facebook's SDK to implement the 36 | login process. */ 37 | + (id) facebookAuthenticatorWithToken: (NSString*)token; 38 | 39 | /** Creates an authenticator that will authenticate to a Couchbase Sync Gateway server using the 40 | user's email address, with the Persona protocol (http://persona.org). The "assertion" token 41 | must have been acquired using the client-side Persona auth procedure; you can use the library 42 | https://github.com/couchbaselabs/browserid-ios to do this. */ 43 | + (id) personaAuthenticatorWithAssertion: (NSString*)assertion; 44 | 45 | /** Creates an authenticator that will authenticate to a CouchDB server using OAuth version 1. 46 | The parameters must have been acquired using the client-side OAuth login procedure. There are 47 | several iOS and Mac implementations of this, such as 48 | https://github.com/couchbaselabs/ios-oauthconsumer */ 49 | + (id) OAuth1AuthenticatorWithConsumerKey: (NSString*)consumerKey 50 | consumerSecret: (NSString*)consumerSecret 51 | token: (NSString*)token 52 | tokenSecret: (NSString*)tokenSecret 53 | signatureMethod: (NSString*)signatureMethod; 54 | 55 | /** Creates an authenticator that uses an SSL/TLS client certificate. 56 | @param identity The identity certificate plus private key 57 | @param certs Any additional CA certs needed to establish the chain of authority. */ 58 | + (id) SSLClientCertAuthenticatorWithIdentity: (SecIdentityRef)identity 59 | supportingCerts: (nullable NSArray*)certs; 60 | 61 | + (id) SSLClientCertAuthenticatorWithAnonymousIdentity: (NSString*)label; 62 | 63 | - (instancetype) init NS_UNAVAILABLE; 64 | 65 | @end 66 | 67 | 68 | 69 | NS_ASSUME_NONNULL_END 70 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/Headers/CBLBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // CBLBase.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 6/9/15. 6 | // Copyright © 2015 Couchbase, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | #if __has_feature(nullability) 13 | # ifndef NS_ASSUME_NONNULL_BEGIN 14 | // Xcode 6.3: 15 | # define NS_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") 16 | # define NS_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") 17 | # endif 18 | #else 19 | // Xcode 6.2 and earlier: 20 | # define NS_ASSUME_NONNULL_BEGIN 21 | # define NS_ASSUME_NONNULL_END 22 | # define nullable 23 | # define __nullable 24 | #endif 25 | 26 | 27 | #if __has_feature(objc_generics) 28 | #define CBLArrayOf(VALUE) NSArray 29 | #define CBLDictOf(KEY, VALUE) NSDictionary 30 | #else 31 | #define CBLArrayOf(VALUE) NSArray 32 | #define CBLDictOf(KEY, VALUE) NSDictionary 33 | #endif 34 | 35 | typedef CBLDictOf(NSString*, id) CBLJSONDict; 36 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/Headers/CBLDatabaseChange.h: -------------------------------------------------------------------------------- 1 | // 2 | // CBLDatabaseChange.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 1/18/13. 6 | // Copyright (c) 2013 Couchbase, Inc. All rights reserved. 7 | // 8 | // 9 | 10 | #import "CBLBase.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** Identifies a change to a database, that is, a newly added document revision. 15 | The CBLDocumentChangeNotification contains one of these in the "change" key of its 16 | userInfo dictionary, and CBLDatabaseChangeNotification contains an NSArray in "changes". */ 17 | @interface CBLDatabaseChange : NSObject 18 | 19 | /** The ID of the document that changed. */ 20 | @property (readonly) NSString* documentID; 21 | 22 | /** The ID of the newly-added revision. */ 23 | @property (readonly) NSString* revisionID; 24 | 25 | /** Is the new revision the document's current (default, winning) one? 26 | If not, there's a conflict. */ 27 | @property (readonly) BOOL isCurrentRevision; 28 | 29 | /** YES if the document is in conflict. (The conflict might pre-date this change.) */ 30 | @property (readonly) BOOL inConflict; 31 | 32 | /** The remote database URL that this change was pulled from, if any. */ 33 | @property (readonly, nullable) NSURL* source; 34 | 35 | - (instancetype) init NS_UNAVAILABLE; 36 | 37 | @end 38 | 39 | 40 | NS_ASSUME_NONNULL_END 41 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/Headers/CBLGeometry.h: -------------------------------------------------------------------------------- 1 | // 2 | // CBLGeometry.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 9/22/13. 6 | // Copyright (c) 2013 Couchbase, Inc. All rights reserved. 7 | // 8 | 9 | #import "CBLBase.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /** A 2D geometric point. */ 14 | typedef struct CBLGeoPoint { 15 | double x, y; 16 | } CBLGeoPoint; 17 | 18 | /** A 2D geometric rectangle. 19 | Note that unlike CGRect and NSRect, this stores max coords, not size. 20 | A rectangle with max coords equal to the min is equivalent to a point. 21 | It is illegal for the max coords to be less than the min. */ 22 | typedef struct CBLGeoRect { 23 | CBLGeoPoint min, max; 24 | } CBLGeoRect; 25 | 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | 32 | /** Compares two rectangles for equality. */ 33 | static inline BOOL CBLGeoRectEqual(CBLGeoRect a, CBLGeoRect b) { 34 | return a.min.x == b.min.x && a.min.y == b.min.y && a.max.x == b.max.x && a.max.y == b.max.y; 35 | } 36 | 37 | /** Returns YES if a rectangle is empty, i.e. equivalent to a single point. */ 38 | static inline BOOL CBLGeoRectIsEmpty(CBLGeoRect r) { 39 | return r.min.x == r.max.x && r.min.y == r.max.y; 40 | } 41 | 42 | 43 | /** Converts a string of four comma-separated numbers ("x0,y0,x1,y1") to a rectangle. */ 44 | BOOL CBLGeoCoordsStringToRect(NSString* __nullable coordsStr, CBLGeoRect* outRect); 45 | 46 | 47 | #pragma mark - CONVERTING TO/FROM JSON: 48 | 49 | /** Converts a point to GeoJSON format. 50 | For details see http://geojson.org/geojson-spec.html#point */ 51 | CBLJSONDict* CBLGeoPointToJSON(CBLGeoPoint pt); 52 | 53 | /** Converts a rectangle to GeoJSON format (as a polygon.) 54 | For details see http://geojson.org/geojson-spec.html#polygon */ 55 | CBLJSONDict* CBLGeoRectToJSON(CBLGeoRect rect); 56 | 57 | /** Computes the bounding box of a GeoJSON object. 58 | Currently only implemented for points and polygons. */ 59 | BOOL CBLGeoJSONBoundingBox(NSDictionary* __nullable geoJSON, CBLGeoRect* outBBox); 60 | 61 | 62 | /** Converts a point to a JSON-compatible array of two coordinates. */ 63 | CBLArrayOf(NSNumber*)* CBLGeoPointToCoordPair(CBLGeoPoint pt); 64 | 65 | /** Converts a JSON array of two coordinates [x,y] back into a point. */ 66 | BOOL CBLGeoCoordPairToPoint(NSArray* __nullable coords, CBLGeoPoint* outPoint); 67 | 68 | /** Converts a JSON array of four coordinates [x0, y0, x1, y1] to a rectangle. */ 69 | BOOL CBLGeoCoordsToRect(NSArray* __nullable coords, CBLGeoRect* outRect); 70 | 71 | #pragma mark - KEYS FOR MAP FUNCTIONS: 72 | 73 | /** Returns a special value that, when emitted as a key, is indexed as a geometric point. 74 | Used inside a map block, like so: `emit(CBLPointKey(3.0, 4.0), value);` */ 75 | id CBLGeoPointKey(double x, double y); 76 | 77 | /** Returns a special value that, when emitted as a key, is indexed as a geometric rectangle. */ 78 | id CBLGeoRectKey(double x0, double y0, double x1, double y1); 79 | 80 | /** Returns a special value that, when emitted as a key, is indexed as a GeoJSON 81 | shape. Currently only its bounding box is stored. 82 | Only points and polygons are supported; other shapes return nil. */ 83 | id CBLGeoJSONKey(NSDictionary* geoJSON); 84 | 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | 91 | NS_ASSUME_NONNULL_END 92 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/Headers/CBLJSON.h: -------------------------------------------------------------------------------- 1 | // 2 | // CBLJSON.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 2/27/12. 6 | // Copyright (c) 2012-2013 Couchbase, Inc. All rights reserved. 7 | // 8 | 9 | #import "CBLBase.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /** Identical to the corresponding NSJSON option flags. */ 14 | enum { 15 | CBLJSONReadingMutableContainers = (1UL << 0), 16 | CBLJSONReadingMutableLeaves = (1UL << 1), 17 | CBLJSONReadingAllowFragments = (1UL << 2) 18 | }; 19 | typedef NSUInteger CBLJSONReadingOptions; 20 | 21 | /** Identical to the corresponding NSJSON option flags, with one addition. */ 22 | enum { 23 | CBLJSONWritingPrettyPrinted = (1UL << 0), 24 | 25 | CBLJSONWritingAllowFragments = (1UL << 23) /**< Allows input to be an NSString or NSValue. */ 26 | }; 27 | typedef NSUInteger CBLJSONWritingOptions; 28 | 29 | 30 | /** Useful extensions for JSON serialization/parsing. */ 31 | @interface CBLJSON : NSJSONSerialization 32 | 33 | /** Same as -dataWithJSONObject... but returns an NSString. */ 34 | + (nullable NSString*) stringWithJSONObject:(id)obj 35 | options:(CBLJSONWritingOptions)opt 36 | error:(NSError**)error; 37 | 38 | /** Given valid JSON data representing a dictionary, inserts the contents of the given NSDictionary into it and returns the resulting JSON data. 39 | This does not parse or regenerate the JSON, so it's quite fast. 40 | But it will generate invalid JSON if the input JSON begins or ends with whitespace, or if the dictionary contains any keys that are already in the original JSON. */ 41 | + (NSData*) appendDictionary: (CBLJSONDict*)dict 42 | toJSONDictionaryData: (NSData*)json; 43 | 44 | /** Same as above but inserts a pre-encoded JSON dictionary instead of an NSDictionary. */ 45 | + (NSData*) appendJSONDictionaryData: (NSData*)extraJson 46 | toJSONDictionaryData: (NSData*)json; 47 | 48 | /** Encodes an NSDate as a string in ISO-8601 format. */ 49 | + (NSString*) JSONObjectWithDate: (NSDate*)date; 50 | + (NSString*) JSONObjectWithDate: (NSDate*)date timeZone:(NSTimeZone *)tz; 51 | 52 | /** Parses an ISO-8601 formatted date string to an NSDate object. 53 | If the object is not a string, or not valid ISO-8601, it returns nil. */ 54 | + (nullable NSDate*) dateWithJSONObject: (id)jsonObject; 55 | 56 | /** Parses an ISO-8601 formatted date string to an absolute time (timeSinceReferenceDate). 57 | If the object is not a string, or not valid ISO-8601, it returns a NAN value. */ 58 | + (CFAbsoluteTime) absoluteTimeWithJSONObject: (id)jsonObject; 59 | 60 | /** Follows a JSON-Pointer, returning the value pointed to, or nil if nothing. 61 | See spec at: http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-04 */ 62 | + (nullable id) valueAtPointer: (NSString*)pointer inObject: (id)object; 63 | 64 | /** Encodes an NSData as a string in Base64 format. */ 65 | + (NSString*) base64StringWithData: (NSData*)data; 66 | 67 | /** Parses a Base64-encoded string into an NSData object. 68 | If the object is not a string, or not valid Base64, it returns nil. */ 69 | + (nullable NSData*) dataWithBase64String: (id)jsonObject; 70 | 71 | /** Estimates the amount of memory used by the object and those it references. */ 72 | + (size_t) estimateMemorySize: (id)object; 73 | 74 | @end 75 | 76 | 77 | /** Wrapper for an NSArray of JSON data, that avoids having to parse the data if it's not used. 78 | NSData objects in the array will be parsed into native objects before being returned to the caller from -objectAtIndex. */ 79 | @interface CBLLazyArrayOfJSON : NSArray 80 | 81 | /** Initialize a lazy array. 82 | @param array An NSArray of NSData objects, each containing JSON. */ 83 | - (instancetype) initWithMutableArray: (NSMutableArray*)array; 84 | @end 85 | 86 | 87 | typedef void (^CBLOnMutateBlock)(); 88 | 89 | /** Protocol for classes whose instances can encode themselves as JSON. 90 | Such classes can be used directly as property types in CBLModel subclasses. */ 91 | @protocol CBLJSONEncoding 92 | - (nullable instancetype) initWithJSON: (id)jsonObject; 93 | - (id) encodeAsJSON; 94 | 95 | @optional 96 | /** If an implementation has mutable persistent state, it should implement this method. 97 | The implementation should save a copy of the block in an instance variable, and call the block 98 | whenever the instance's state has changed such that -encodeAsJSON will now return a different 99 | result. 100 | This allows the object's owner (typically a CBLModel) to detect such changes and mark itself 101 | as needing to be saved. */ 102 | - (void) setOnMutate: (CBLOnMutateBlock)onMutate; 103 | @end 104 | 105 | 106 | NS_ASSUME_NONNULL_END 107 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/Headers/CBLModelFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // CBLModelFactory.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 11/22/11. 6 | // Copyright (c) 2011-2013 Couchbase, Inc. All rights reserved. 7 | // 8 | 9 | #import "CBLDatabase.h" 10 | @class CBLDocument; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** A configurable mapping from CBLDocument to CBLModel. 15 | It associates a model class with a value of the document's "type" property. */ 16 | @interface CBLModelFactory : NSObject 17 | 18 | /** Returns a global shared CBLModelFactory that's consulted by all databases. 19 | Mappings registered in this instance will be used as a fallback by all other instances if they don't have their own. */ 20 | + (instancetype) sharedInstance; 21 | 22 | /** Given a document, attempts to return a CBLModel for it. 23 | If the document's modelObject property is set, it returns that value. 24 | If the document's "type" property has been registered, instantiates the associated class. 25 | Otherwise returns nil. */ 26 | - (id) modelForDocument: (CBLDocument*)document; 27 | 28 | /** Associates a value of the "type" property with a CBLModel subclass. 29 | When a document with this type value is loaded as a model, the given subclass will be 30 | instantiated (unless you explicitly instantiate a different CBLModel subclass.) 31 | As a bonus, when a model of this class is created with a new document, the document's "type" 32 | property will be set to the associated value. 33 | @param classOrName Either a CBLModel subclass, or its class name as an NSString. 34 | @param type The value value of a document's "type" property that should indicate this class. */ 35 | - (void) registerClass: (id)classOrName 36 | forDocumentType: (NSString*)type; 37 | 38 | /** Returns the appropriate CBLModel subclass for this document. 39 | The default implementation just passes the document's "type" property value to -classForDocumentType:, but subclasses could override this to use different properties (or even the document ID) to decide. */ 40 | - (nullable Class) classForDocument: (CBLDocument*)document; 41 | 42 | /** Looks up the CBLModel subclass that's been registered for a document type. */ 43 | - (Class) classForDocumentType: (NSString*)type; 44 | 45 | /** Looks up the document type for which the given class has been registered. 46 | If it's unregistered, or registered with multiple types, returns nil. */ 47 | - (nullable NSString*) documentTypeForClass: (Class)modelClass; 48 | 49 | /** Looks up the document types for which the given class has been registered. */ 50 | - (CBLArrayOf(NSString*)*) documentTypesForClass: (Class)modelClass; 51 | 52 | @end 53 | 54 | 55 | @interface CBLDatabase (CBLModelFactory) 56 | 57 | /** The CBLModel factory object to be used by this database. 58 | Every database has its own instance by default, but you can set this property to use a different one -- either to use a custom subclass, or to share a factory among multiple databases, or both. */ 59 | @property (retain, nullable) CBLModelFactory* modelFactory; 60 | 61 | @end 62 | 63 | 64 | NS_ASSUME_NONNULL_END 65 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/Headers/CBLQuery+FullTextSearch.h: -------------------------------------------------------------------------------- 1 | // 2 | // CBLQuery+FullTextSearch.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 9/21/13. 6 | // Copyright (c) 2013 Couchbase, Inc. All rights reserved. 7 | // 8 | 9 | #import "CBLQuery.h" 10 | 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | /** CBLQuery interface for full-text searches. 14 | To use this, the view's map function must have emitted full-text strings as keys 15 | using the CBLTextKey() function. */ 16 | @interface CBLQuery (FullTextSearch) 17 | 18 | /** Query string for a full-text search; works only if the view's map function has triggered full- 19 | text indexing by emitting strings wrapped by CBLTextKey(). 20 | The query rows produced by this search will be instances of CBLFullTextQueryRow. 21 | 22 | The query string will be broken up into words. "Noise" words like "the" and "hello" (also 23 | called "stop-words") are ignored. 24 | 25 | The result will include a row corresponding to every emitted CBLTextKey() that contains _any_ 26 | of the words in the query. Word matching tries to account for (English) grammatical variations 27 | like plurals and verb tenses, so for example "cat" will match "cats" and "type" will match 28 | "typing". 29 | 30 | **NOTE:** Full-text views have no keys, so the key-related query properties will be ignored. 31 | They also can't be reduced or grouped, so those properties are ignored too. */ 32 | @property (copy, nullable) NSString* fullTextQuery; 33 | 34 | /** If set to YES, the query will collect snippets of the text surrounding each match, available 35 | via the CBLFullTextQueryRow's -snippetWithWordStart:wordEnd: method. */ 36 | @property BOOL fullTextSnippets; 37 | 38 | /** If YES (the default) the full-text query result rows will be sorted by (approximate) relevance. 39 | If set to NO, the rows will be returned in the order the documents were added to the database, 40 | i.e. essentially unordered; this is somewhat faster, so it can be useful if you don't care 41 | about the ordering of the rows. */ 42 | @property BOOL fullTextRanking; 43 | 44 | @end 45 | 46 | 47 | 48 | /** A result row from a full-text query. 49 | A CBLQuery with its .fullTextQuery property set will produce CBLFullTextQueryRows. */ 50 | @interface CBLFullTextQueryRow : CBLQueryRow 51 | 52 | /** The text emitted when the view was indexed (the argument to CBLTextKey()) which contains the 53 | match(es). */ 54 | @property (readonly, nullable) NSString* fullText; 55 | 56 | /** Returns a short substring of the full text containing at least some of the matched words. 57 | This is useful to display in search results, and is faster than fetching the .fullText. 58 | NOTE: The "fullTextSnippets" property of the CBLQuery must be set to YES to enable this; 59 | otherwise the result will be nil. 60 | @param wordStart A delimiter that will be inserted before every instance of a match. 61 | @param wordEnd A delimiter that will be inserted after every instance of a match. */ 62 | - (NSString*) snippetWithWordStart: (NSString*)wordStart 63 | wordEnd: (NSString*)wordEnd; 64 | 65 | /** The number of query words that were found in the fullText. 66 | (If a query word appears more than once, only the first instance is counted.) */ 67 | @property (readonly) NSUInteger matchCount; 68 | 69 | /** The character range in the fullText of a particular match. */ 70 | - (NSRange) textRangeOfMatch: (NSUInteger)matchNumber; 71 | 72 | /** The index of the search term matched by a particular match. Search terms are the individual 73 | words in the full-text search expression, skipping duplicates and noise/stop-words. They're 74 | numbered from zero. */ 75 | - (NSUInteger) termIndexOfMatch: (NSUInteger)matchNumber; 76 | 77 | @end 78 | 79 | 80 | NS_ASSUME_NONNULL_END 81 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/Headers/CBLQuery+Geo.h: -------------------------------------------------------------------------------- 1 | // 2 | // CBLQuery+Geo.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 9/23/13. 6 | // Copyright (c) 2013 Couchbase, Inc. All rights reserved. 7 | // 8 | 9 | #import "CBLQuery.h" 10 | #import "CBLGeometry.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** CBLQuery interface for geo-queries. 15 | To use this, the view's map function must have emitted geometries (points, rects, etc.) 16 | as keys using the functions CBLGeoPointKey(), CBLGeoRectKey(), or CBLGeoJSONKey(). */ 17 | @interface CBLQuery (Geo) 18 | 19 | /** The geometric bounding box to search. Setting this property causes the query to 20 | search geometries rather than keys. */ 21 | @property CBLGeoRect boundingBox; 22 | 23 | @end 24 | 25 | 26 | /** A result row from a CouchbaseLite geo-query. 27 | A CBLQuery with its .boundingBox property set will produce CBLGeoQueryRows. */ 28 | @interface CBLGeoQueryRow : CBLQueryRow 29 | 30 | /** The row's geo bounding box in native form. 31 | If the emitted geo object was a point, the boundingBox's min and max will be equal. 32 | Note: The coordinates may have slight round-off error, because SQLite internally stores bounding 33 | boxes as 32-bit floats, but the coordinates are always rounded outwards -- making the bounding 34 | box slightly larger -- to avoid false negatives in searches. */ 35 | @property (readonly, nonatomic) CBLGeoRect boundingBox; 36 | 37 | /** The GeoJSON object emitted as the key of the emit() call by the map function. 38 | The format is a parsed GeoJSON point or polygon; see http://geojson.org/geojson-spec */ 39 | @property (readonly, nullable) NSDictionary* geometry; 40 | 41 | /** The GeoJSON object type of the row's geometry. 42 | Usually @"Point" or @"Rectangle", but may be another type if the emitted key was GeoJSON. 43 | (The "Rectangle" type is not standard GeoJSON.) */ 44 | @property (readonly, nonatomic, nullable) NSString* geometryType; 45 | 46 | @end 47 | 48 | 49 | NS_ASSUME_NONNULL_END 50 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/Headers/CBLQueryBuilder.h: -------------------------------------------------------------------------------- 1 | // 2 | // CBLQueryBuilder.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 8/4/14. 6 | // Copyright (c) 2014-2015 Couchbase, Inc. All rights reserved. 7 | // 8 | 9 | #import "CBLBase.h" 10 | @class CBLDatabase, CBLView, CBLQuery, CBLQueryEnumerator; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** A higher-level interface to views and queries that feels more like a traditional query language 15 | or like Core Data's NSFetchRequest. 16 | 17 | A CBLQueryBuilder is a template for creating families of queries. You should create an instance 18 | for a generalized query, leaving "$"-prefixed placeholder variables in your "where" predicate 19 | for any values that won't be known until the query needs to run. Then at query time, you give 20 | the builder values for the variables and it creates a query. 21 | 22 | (Note: CBLQueryBuilder is not cross-platform since its API is based on the Cocoa Foundation 23 | classes NSPredicate, NSExpression and NSSortDescriptor. Other implementations of Couchbase Lite 24 | will have equivalent functionality based on their platforms' APIs and idioms.) 25 | */ 26 | @interface CBLQueryBuilder : NSObject 27 | 28 | /** Initializes a CBLQueryBuilder. 29 | @param database The database to index and query. 30 | @param valueTemplate The result values you want, expressed either as keypath strings or 31 | NSExpressions; in either case they're evaluated relative to the 32 | document being indexed. 33 | @param predicateStr A predicate template string that specifies the condition(s) that a 34 | document's properties must match. Often includes "$"-prefixed variables that will 35 | be filled in at query time, like key ranges. 36 | (See Apple's predicate syntax documentation: http://goo.gl/8ty3xG ) 37 | @param sortDescriptors The sort order you want the results in. Items in the array can be 38 | NSSortDescriptors or NSStrings. A string will be interpreted as a sort descriptor 39 | with that keyPath; prefix it with "-" to indicate descending order. 40 | If the order of query rows is unimportant, pass nil. 41 | @param outError If the builder doesn't know how to handle the input, this will be filled in 42 | with an NSError describing the problem. 43 | @return The initialized CBLQueryBuilder, or nil on error. */ 44 | - (nullable instancetype) initWithDatabase: (nullable CBLDatabase*)database 45 | select: (nullable NSArray*)valueTemplate 46 | where: (NSString*)predicateStr 47 | orderBy: (nullable NSArray*)sortDescriptors 48 | error: (NSError**)outError; 49 | 50 | /** Initializes a CBLQueryBuilder. 51 | This is an alternate initializer that takes an NSPredicate instead of a predicate template 52 | string; see the main initializer for details. */ 53 | - (nullable instancetype) initWithDatabase: (nullable CBLDatabase*)database 54 | select: (nullable NSArray*)valueTemplate 55 | wherePredicate: (NSPredicate*)predicate 56 | orderBy: (nullable NSArray*)sortDescriptors 57 | error: (NSError**)outError; 58 | 59 | /** Initializes a CBLQueryBuilder, using an explicitly chosen view. 60 | See the main initializer for details. */ 61 | - (nullable instancetype) initWithView: (CBLView*)view 62 | select: (NSArray*)valueTemplate 63 | wherePredicate: (NSPredicate*)predicate 64 | orderBy: (nullable NSArray*)sortDescriptors 65 | error: (NSError**)outError; 66 | 67 | - (instancetype) init NS_UNAVAILABLE; 68 | 69 | /** The view the query builder is using. */ 70 | @property (readonly, nonatomic) CBLView* view; 71 | 72 | /** A human-readable string that explains in pseudocode what the query builder is doing. 73 | It shows what the map function does, and what the query's properties will be set to. 74 | This is intended for troubleshooting and debugging purposes only. */ 75 | @property (readonly, nonatomic) NSString* explanation; 76 | 77 | /** Creates a query, given a set of values for the variables. 78 | @param context A dictionary mapping variable names to values. The names should not include 79 | the dollar signs used in the predicate string; if a predicate referred to 80 | $FOO, the dictionary key should be @"FOO". 81 | @return The configured query, ready to run. */ 82 | - (CBLQuery*) createQueryWithContext: (nullable CBLJSONDict*)context; 83 | 84 | /** A convenience method that creates a query and runs it. See -createQueryWithContext:. */ 85 | - (nullable CBLQueryEnumerator*) runQueryWithContext: (nullable CBLJSONDict*)context 86 | error: (NSError**)outError; 87 | 88 | @end 89 | 90 | 91 | NS_ASSUME_NONNULL_END 92 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/Headers/CBLUITableSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // CBLUITableSource.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 8/2/11. 6 | // Copyright 2011-2013 Couchbase, Inc. All rights reserved. 7 | // 8 | 9 | #import "CBLBase.h" 10 | #import 11 | @class CBLDocument, CBLLiveQuery, CBLQueryRow; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | /** A UITableView data source driven by a CBLLiveQuery. 16 | It populates the table rows from the query rows, and automatically updates the table as the 17 | query results change when the database is updated. 18 | A CBLUITableSource can be created in a nib. If so, its tableView outlet should be wired up to 19 | the UITableView it manages, and the table view's dataSource outlet should be wired to it. */ 20 | @interface CBLUITableSource : NSObject = 60000) 22 | , UIDataSourceModelAssociation 23 | #endif 24 | > 25 | /** The table view to manage. */ 26 | @property (nonatomic, retain) IBOutlet UITableView* tableView; 27 | 28 | /** The query whose rows will be displayed in the table. */ 29 | @property (retain) CBLLiveQuery* query; 30 | 31 | /** Rebuilds the table from the query's current .rows property. */ 32 | -(void) reloadFromQuery; 33 | 34 | 35 | #pragma mark Row Accessors: 36 | 37 | /** The current array of CBLQueryRows being used as the data source for the table. */ 38 | @property (nonatomic, readonly, nullable) CBLArrayOf(CBLQueryRow*)* rows; 39 | 40 | /** Convenience accessor to get the row object for a given table row index. */ 41 | - (nullable CBLQueryRow*) rowAtIndex: (NSUInteger)index; 42 | 43 | /** Convenience accessor to find the index path of the row with a given document. */ 44 | - (nullable NSIndexPath*) indexPathForDocument: (CBLDocument*)document; 45 | 46 | /** Convenience accessor to return the query row at a given index path. */ 47 | - (nullable CBLQueryRow*) rowAtIndexPath: (NSIndexPath*)path; 48 | 49 | /** Convenience accessor to return the document at a given index path. */ 50 | - (nullable CBLDocument*) documentAtIndexPath: (NSIndexPath*)path; 51 | 52 | 53 | #pragma mark Displaying The Table: 54 | 55 | /** If non-nil, specifies the property name of the query row's value that will be used for the table row's visible label. 56 | If the row's value is not a dictionary, or if the property doesn't exist, the property will next be looked up in the document's properties. 57 | If this doesn't meet your needs for labeling rows, you should implement -couchTableSource:willUseCell:forRow: in the table's delegate. */ 58 | @property (copy, nullable) NSString* labelProperty; 59 | 60 | 61 | #pragma mark Editing The Table: 62 | 63 | /** Is the user allowed to delete rows by UI gestures? (Defaults to YES.) */ 64 | @property (nonatomic) BOOL deletionAllowed; 65 | 66 | /** Deletes the documents at the given row indexes, animating the removal from the table. */ 67 | - (BOOL) deleteDocumentsAtIndexes: (CBLArrayOf(NSIndexPath*)*)indexPaths 68 | error: (NSError**)outError; 69 | 70 | /** Asynchronously deletes the given documents, animating the removal from the table. */ 71 | - (BOOL) deleteDocuments: (CBLArrayOf(CBLDocument*)*)documents 72 | error: (NSError**)outError; 73 | 74 | @end 75 | 76 | 77 | /** Additional methods for the table view's delegate, that will be invoked by the CBLUITableSource. */ 78 | @protocol CBLUITableDelegate 79 | @optional 80 | 81 | /** Allows delegate to return its own custom cell, just like -tableView:cellForRowAtIndexPath:. 82 | If this returns nil the table source will create its own cell, as if this method were not implemented. */ 83 | - (UITableViewCell *)couchTableSource:(CBLUITableSource*)source 84 | cellForRowAtIndexPath:(NSIndexPath *)indexPath; 85 | 86 | /** Called after the query's results change, before the table view is reloaded. */ 87 | - (void)couchTableSource:(CBLUITableSource*)source 88 | willUpdateFromQuery:(CBLLiveQuery*)query; 89 | 90 | /** Called after the query's results change to update the table view. If this method is not implemented by the delegate, reloadData is called on the table view.*/ 91 | - (void)couchTableSource:(CBLUITableSource*)source 92 | updateFromQuery:(CBLLiveQuery*)query 93 | previousRows:(CBLArrayOf(CBLQueryRow*) *)previousRows; 94 | 95 | /** Called from -tableView:cellForRowAtIndexPath: just before it returns, giving the delegate a chance to customize the new cell. */ 96 | - (void)couchTableSource:(CBLUITableSource*)source 97 | willUseCell:(UITableViewCell*)cell 98 | forRow:(CBLQueryRow*)row; 99 | 100 | /** Called when the user wants to delete a row. 101 | If the delegate implements this method, it will be called *instead of* the 102 | default behavior of deleting the associated document. 103 | @param source The CBLUITableSource 104 | @param row The query row corresponding to the row to delete 105 | @return True if the row was deleted, false if not. */ 106 | - (bool)couchTableSource:(CBLUITableSource*)source 107 | deleteRow:(CBLQueryRow*)row; 108 | 109 | /** Called upon failure of a document deletion triggered by the user deleting a row. */ 110 | - (void)couchTableSource:(CBLUITableSource*)source 111 | deleteFailed:(NSError*)error; 112 | 113 | @end 114 | 115 | 116 | NS_ASSUME_NONNULL_END 117 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/Headers/CouchbaseLite.h: -------------------------------------------------------------------------------- 1 | // 2 | // CouchbaseLite.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 12/2/11. 6 | // Copyright (c) 2011-2013 Couchbase, Inc. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 9 | // except in compliance with the License. You may obtain a copy of the License at 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // Unless required by applicable law or agreed to in writing, software distributed under the 12 | // License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions 14 | // and limitations under the License. 15 | 16 | 17 | #define CBL_DEPRECATED // Enable deprecated methods. 18 | 19 | #import "CBLManager.h" 20 | #import "CBLDatabase.h" 21 | #import "CBLDatabaseChange.h" 22 | #import "CBLDocument.h" 23 | #import "CBLRevision.h" 24 | #import "CBLAttachment.h" 25 | #import "CBLView.h" 26 | #import "CBLQuery.h" 27 | #import "CBLQuery+FullTextSearch.h" 28 | #import "CBLQuery+Geo.h" 29 | #import "CBLQueryBuilder.h" 30 | #import "CBLAuthenticator.h" 31 | #import "CBLReplication.h" 32 | #import "CBLModel.h" 33 | #import "CBLModelFactory.h" 34 | #import "CBLJSON.h" 35 | 36 | #if TARGET_OS_IPHONE 37 | #import "CBLUITableSource.h" 38 | #else 39 | #import "CBLRegisterJSViewCompiler.h" 40 | #endif 41 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/Headers/MYDynamicObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // MYDynamicObject.h 3 | // MYUtilities 4 | // 5 | // Created by Jens Alfke on 8/6/09. 6 | // Copyright 2009 Jens Alfke. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | /** A generic class with runtime support for dynamic properties. 13 | You can subclass this and declare properties in the subclass without needing to implement them or make instance variables; simply note them as '@@dynamic' in the @@implementation. 14 | The dynamic accessors will be bridged to calls to -getValueOfProperty: and setValue:ofProperty:, allowing you to easily store property values in an NSDictionary or other container. */ 15 | @interface MYDynamicObject : NSObject 16 | 17 | /** Returns the names of all properties defined in this class and superclasses up to MYDynamicObject. */ 18 | + (NSSet*) propertyNames; 19 | 20 | /** Returns the value of a named property. 21 | This method will only be called for properties that have been declared in the class's @@interface using @@property. 22 | You must override this method -- the base implementation just raises an exception. */ 23 | - (id) getValueOfProperty: (NSString*)property; 24 | 25 | /** Sets the value of a named property. 26 | This method will only be called for properties that have been declared in the class's @@interface using @@property, and are not declared readonly. 27 | You must override this method -- the base implementation just raises an exception. 28 | @return YES if the property was set, NO if it isn't settable; an exception will be raised. 29 | Default implementation returns NO. */ 30 | - (BOOL) setValue: (id)value ofProperty: (NSString*)property; 31 | 32 | 33 | // FOR SUBCLASSES TO CALL: 34 | 35 | /** Given the name of an object-valued property, returns the class of the property's value. 36 | Returns nil if the property doesn't exist, or if its type isn't an object pointer or is 'id'. */ 37 | + (Class) classOfProperty: (NSString*)propertyName; 38 | 39 | + (NSString*) getterKey: (SEL)sel; 40 | + (NSString*) setterKey: (SEL)sel; 41 | 42 | // ADVANCED STUFF FOR SUBCLASSES TO OVERRIDE: 43 | 44 | + (IMP) impForGetterOfProperty: (NSString*)property ofClass: (Class)propertyClass; 45 | + (IMP) impForSetterOfProperty: (NSString*)property ofClass: (Class)propertyClass; 46 | + (IMP) impForGetterOfProperty: (NSString*)property ofProtocol: (Protocol*)propertyProtocol; 47 | + (IMP) impForSetterOfProperty: (NSString*)property ofProtocol: (Protocol*)propertyProtocol; 48 | + (IMP) impForGetterOfProperty: (NSString*)property ofType: (const char*)propertyType; 49 | + (IMP) impForSetterOfProperty: (NSString*)property ofType: (const char*)propertyType; 50 | 51 | @end 52 | 53 | /** Given an Objective-C class object, a property name, and a BOOL for whether the property should be readwrite, 54 | return YES if a property with the name exists , NO otherwise. 55 | If setter argument is YES but property is declared readonly, also returns NO. 56 | Information about the property is returned by reference: the subclass of cls that declares the property, 57 | and the property string part of the property attributes string. 58 | */ 59 | BOOL MYGetPropertyInfo(Class cls, 60 | NSString *propertyName, 61 | BOOL setter, 62 | Class *declaredInClass, 63 | const char* *propertyType); 64 | 65 | 66 | /** Given an Objective-C property type string, returns the property type as a Class object, 67 | or nil if a class does not apply or no such property is present. 68 | See Property Type String section of the Objective-C Runtime Programming Guide 69 | for more information about the format of the string. */ 70 | Class MYClassFromType(const char* propertyType, Class relativeToClass); 71 | 72 | /** Same as MYClassFromType, except for protocols. */ 73 | Protocol* MYProtocolFromType(const char* propertyType, Class relativeToClass); 74 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/CouchbaseLite.framework/Info.plist -------------------------------------------------------------------------------- /CouchbaseLite.framework/PrivateHeaders/CBLReplication+Transformation.h: -------------------------------------------------------------------------------- 1 | // 2 | // CBLReplication+Transformation.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 3/14/14. 6 | // Copyright (c) 2014 Couchbase, Inc. All rights reserved. 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | /** A callback block for transforming revision bodies during replication. 13 | See CBLReplication.propertiesTransformationBlock's documentation for details. */ 14 | typedef NSDictionary* __nonnull (^CBLPropertiesTransformationBlock)(NSDictionary* doc); 15 | 16 | 17 | @interface CBLReplication (Transformation) 18 | 19 | /** Optional callback for transforming document bodies during replication; can be used to encrypt documents stored on the remote server, for example. 20 | In a push replication, the block is called with document properties from the local database, and the transformed properties are what will be uploaded to the server. 21 | In a pull replication, the block is called with document properties downloaded from the server, and the transformed properties are what will be stored in the local database. 22 | The block takes an NSDictionary containing the document's properties (including the "_id" and "_rev" metadata), and returns a dictionary of transformed properties. It may return the input dictionary if it has no changes to make. 23 | The transformation MUST preserve the values of any keys whose names begin with an underscore ("_")! 24 | The block will be called on the background replicator thread, NOT on the CBLReplication's thread, so it shouldn't directly access any Couchbase Lite objects. */ 25 | @property (strong, nullable) CBLPropertiesTransformationBlock propertiesTransformationBlock; 26 | 27 | @end 28 | 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/PrivateHeaders/CBLStatus.h: -------------------------------------------------------------------------------- 1 | // 2 | // CBLStatus.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 4/5/12. 6 | // Copyright (c) 2012-2013 Couchbase, Inc. All rights reserved. 7 | // 8 | 9 | 10 | /** CouchbaseLite internal status/error codes. Superset of HTTP status codes. */ 11 | typedef enum { 12 | kCBLStatusOK = 200, 13 | kCBLStatusCreated = 201, 14 | kCBLStatusAccepted = 202, 15 | 16 | kCBLStatusNotModified = 304, 17 | 18 | kCBLStatusBadRequest = 400, 19 | kCBLStatusUnauthorized = 401, 20 | kCBLStatusForbidden = 403, 21 | kCBLStatusNotFound = 404, 22 | kCBLStatusMethodNotAllowed = 405, 23 | kCBLStatusNotAcceptable = 406, 24 | kCBLStatusConflict = 409, 25 | kCBLStatusGone = 410, 26 | kCBLStatusDuplicate = 412, // Formally known as "Precondition Failed" 27 | kCBLStatusUnsupportedType= 415, 28 | 29 | kCBLStatusServerError = 500, 30 | kCBLStatusNotImplemented = 501, 31 | 32 | // Non-HTTP errors: 33 | kCBLStatusBadEncoding = 490, 34 | kCBLStatusBadAttachment = 491, 35 | kCBLStatusAttachmentNotFound = 492, 36 | kCBLStatusBadJSON = 493, 37 | kCBLStatusBadID = 494, 38 | kCBLStatusBadParam = 495, 39 | kCBLStatusDeleted = 496, // Document deleted 40 | kCBLStatusInvalidStorageType = 497, 41 | 42 | kCBLStatusBadChangesFeed = 587, 43 | kCBLStatusChangesFeedTruncated = 588, 44 | kCBLStatusUpstreamError = 589, // Error from remote replication server 45 | kCBLStatusDBError = 590, // SQLite error 46 | kCBLStatusCorruptError = 591, // bad data in database 47 | kCBLStatusAttachmentError= 592, // problem with attachment store 48 | kCBLStatusCallbackError = 593, // app callback (emit fn, etc.) failed 49 | kCBLStatusException = 594, // Exception raised/caught 50 | kCBLStatusDBBusy = 595, // SQLite DB is busy (this is recoverable!) 51 | kCBLStatusCanceled = 596, // Operation was canceled by client 52 | } CBLStatus; 53 | 54 | 55 | static inline bool CBLStatusIsError(CBLStatus status) {return status >= 400;} 56 | 57 | int CBLStatusToHTTPStatus( CBLStatus status, NSString** outMessage ); 58 | 59 | NSError* CBLStatusToNSError( CBLStatus status ); 60 | NSError* CBLStatusToNSErrorWithInfo( CBLStatus status, NSString *reason, NSURL* url, 61 | NSDictionary* extraInfo ); 62 | 63 | /** If outError is not NULL, sets *outError to an NSError equivalent of status. 64 | @return YES if status is successful, NO if it's an error. */ 65 | BOOL CBLStatusToOutNSError(CBLStatus status, NSError** outError); 66 | 67 | CBLStatus CBLStatusFromNSError(NSError* error, CBLStatus defaultStatus); 68 | -------------------------------------------------------------------------------- /CouchbaseLite.framework/PrivateHeaders/CouchbaseLitePrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CouchbaseLitePrivate.h 3 | // CouchbaseLite 4 | // 5 | // Created by Jens Alfke on 6/19/12. 6 | // Copyright (c) 2012-2013 Couchbase, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | @class CBL_Server, CBL_BlobStoreWriter; 12 | 13 | 14 | @interface CBLManager () 15 | #if DEBUG // for unit tests only 16 | + (instancetype) createEmptyAtPath: (NSString*)path; // for testing 17 | + (instancetype) createEmptyAtTemporaryPath: (NSString*)name; // for testing 18 | - (CBLDatabase*) createEmptyDatabaseNamed: (NSString*)name error: (NSError**)outError; 19 | #endif 20 | + (void) setWarningsRaiseExceptions: (BOOL)wre; 21 | @end 22 | 23 | 24 | @interface CBLDatabase () 25 | - (instancetype) initWithDir: (NSString*)dir 26 | name: (NSString*)name 27 | manager: (CBLManager*)manager 28 | readOnly: (BOOL)readOnly; 29 | @property (readonly, nonatomic) NSMutableSet* unsavedModelsMutable; 30 | - (void) removeDocumentFromCache: (CBLDocument*)document; 31 | - (void) doAsyncAfterDelay: (NSTimeInterval)delay block: (void (^)())block; 32 | - (BOOL) waitFor: (BOOL (^)())block; 33 | - (void) addReplication: (CBLReplication*)repl; 34 | - (void) forgetReplication: (CBLReplication*)repl; 35 | - (void) _clearDocumentCache; 36 | - (void) _pruneDocumentCache; 37 | - (CBLDocument*) _cachedDocumentWithID: (NSString*)docID; 38 | @end 39 | 40 | @interface CBLDatabase (Private) 41 | @property (nonatomic, readonly) NSString* privateUUID; 42 | @property (nonatomic, readonly) NSString* publicUUID; 43 | - (NSString*) lastSequenceWithCheckpointID: (NSString*)checkpointID; 44 | - (BOOL) setLastSequence: (NSString*)lastSequence withCheckpointID: (NSString*)checkpointID; 45 | - (BOOL) hasAttachmentWithDigest: (NSString*)digest; 46 | - (uint64_t) lengthOfAttachmentWithDigest: (NSString*)digest; 47 | - (NSData*) contentOfAttachmentWithDigest: (NSString*)digest; 48 | - (NSInputStream*) contentStreamOfAttachmentWithDigest: (NSString*)digest; 49 | - (CBL_BlobStoreWriter*) attachmentWriter; 50 | - (void) rememberAttachmentWritersForDigests: (NSDictionary*)blobsByDigests; 51 | - (NSArray*) getPossibleAncestorsOfDocID: (NSString*)docID 52 | revID: (NSString*)revID 53 | limit: (NSUInteger)limit; 54 | - (BOOL) forceInsertRevisionWithJSON: (NSData*)json 55 | revisionHistory: (NSArray*)history 56 | source: (NSURL*)source 57 | error: (NSError**)outError; 58 | @end 59 | 60 | 61 | @interface CBLDatabaseChange () 62 | @property (readonly) UInt64 sequenceNumber; 63 | @property (readonly) BOOL isDeletion; 64 | /** The revID of the default "winning" revision, or nil if it did not change. */ 65 | @property (nonatomic, readonly) NSString* winningRevisionID; 66 | /** The revision that is now the default "winning" revision of the document, or nil if not known 67 | Guaranteed immutable.*/ 68 | /** Is this a relayed notification of one from another thread, not the original? */ 69 | @property (nonatomic, readonly) bool echoed; 70 | /** Discards the body of the revision to save memory. */ 71 | - (void) reduceMemoryUsage; 72 | @end 73 | 74 | 75 | @interface CBLDocument () 76 | - (CBLSavedRevision*) putProperties: (NSDictionary*)properties 77 | prevRevID: (NSString*)prevID 78 | allowConflict: (BOOL)allowConflict 79 | error: (NSError**)outError; 80 | - (NSArray*) getPossibleAncestorsOfRevisionID: (NSString*)revID 81 | limit: (NSUInteger)limit; 82 | @end 83 | 84 | 85 | @interface CBLRevision () 86 | @property (readonly) SInt64 sequence; 87 | @property (readonly) NSDictionary* attachmentMetadata; 88 | @end 89 | 90 | 91 | @interface CBLSavedRevision () 92 | @property (readonly) BOOL propertiesAreLoaded; 93 | @property (readonly) NSData* JSONData; 94 | - (NSArray*) getRevisionHistoryBackToRevisionIDs: (NSArray*)ancestorIDs 95 | error: (NSError**)outError; 96 | @end 97 | 98 | 99 | @interface CBLAttachment () 100 | + (NSDictionary*) installAttachmentBodies: (NSDictionary*)attachments 101 | intoDatabase: (CBLDatabase*)database __attribute__((nonnull(2))); 102 | @property (readwrite, copy) NSString* name; 103 | @property (readwrite, retain) CBLRevision* revision; 104 | @end 105 | 106 | 107 | @interface CBLReplication () 108 | @property (nonatomic, readonly) NSDictionary* properties; 109 | @end 110 | 111 | 112 | @interface CBLModelFactory () 113 | - (CBLQueryBuilder*) queryBuilderForClass: (Class)klass 114 | property: (NSString*)property; 115 | - (void) setQueryBuilder: (CBLQueryBuilder*)builder 116 | forClass: (Class)klass 117 | property: (NSString*)property; 118 | @end 119 | 120 | 121 | @interface CBLQuery () 122 | @property (nonatomic, strong) BOOL (^filterBlock)(CBLQueryRow*); 123 | @end 124 | -------------------------------------------------------------------------------- /Crashlytics.framework/Crashlytics: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/Crashlytics.framework/Crashlytics -------------------------------------------------------------------------------- /Crashlytics.framework/Headers/ANSCompatibility.h: -------------------------------------------------------------------------------- 1 | // 2 | // ANSCompatibility.h 3 | // AnswersKit 4 | // 5 | // Copyright (c) 2015 Crashlytics, Inc. All rights reserved. 6 | // 7 | 8 | #pragma once 9 | 10 | #if !__has_feature(nullability) 11 | #define nonnull 12 | #define nullable 13 | #define _Nullable 14 | #define _Nonnull 15 | #endif 16 | 17 | #ifndef NS_ASSUME_NONNULL_BEGIN 18 | #define NS_ASSUME_NONNULL_BEGIN 19 | #endif 20 | 21 | #ifndef NS_ASSUME_NONNULL_END 22 | #define NS_ASSUME_NONNULL_END 23 | #endif 24 | 25 | #if __has_feature(objc_generics) 26 | #define ANS_GENERIC_NSARRAY(type) NSArray 27 | #define ANS_GENERIC_NSDICTIONARY(key_type,object_key) NSDictionary 28 | #else 29 | #define ANS_GENERIC_NSARRAY(type) NSArray 30 | #define ANS_GENERIC_NSDICTIONARY(key_type,object_key) NSDictionary 31 | #endif 32 | -------------------------------------------------------------------------------- /Crashlytics.framework/Headers/CLSAttributes.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLSAttributes.h 3 | // Crashlytics 4 | // 5 | // Copyright (c) 2015 Crashlytics, Inc. All rights reserved. 6 | // 7 | 8 | #pragma once 9 | 10 | #define CLS_DEPRECATED(x) __attribute__ ((deprecated(x))) 11 | 12 | #if !__has_feature(nullability) 13 | #define nonnull 14 | #define nullable 15 | #define _Nullable 16 | #define _Nonnull 17 | #endif 18 | 19 | #ifndef NS_ASSUME_NONNULL_BEGIN 20 | #define NS_ASSUME_NONNULL_BEGIN 21 | #endif 22 | 23 | #ifndef NS_ASSUME_NONNULL_END 24 | #define NS_ASSUME_NONNULL_END 25 | #endif 26 | 27 | #if __has_feature(objc_generics) 28 | #define CLS_GENERIC_NSARRAY(type) NSArray 29 | #define CLS_GENERIC_NSDICTIONARY(key_type,object_key) NSDictionary 30 | #else 31 | #define CLS_GENERIC_NSARRAY(type) NSArray 32 | #define CLS_GENERIC_NSDICTIONARY(key_type,object_key) NSDictionary 33 | #endif 34 | -------------------------------------------------------------------------------- /Crashlytics.framework/Headers/CLSLogging.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLSLogging.h 3 | // Crashlytics 4 | // 5 | // Copyright (c) 2015 Crashlytics, Inc. All rights reserved. 6 | // 7 | #ifdef __OBJC__ 8 | #import "CLSAttributes.h" 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | #endif 13 | 14 | 15 | 16 | /** 17 | * 18 | * The CLS_LOG macro provides as easy way to gather more information in your log messages that are 19 | * sent with your crash data. CLS_LOG prepends your custom log message with the function name and 20 | * line number where the macro was used. If your app was built with the DEBUG preprocessor macro 21 | * defined CLS_LOG uses the CLSNSLog function which forwards your log message to NSLog and CLSLog. 22 | * If the DEBUG preprocessor macro is not defined CLS_LOG uses CLSLog only. 23 | * 24 | * Example output: 25 | * -[AppDelegate login:] line 134 $ login start 26 | * 27 | * If you would like to change this macro, create a new header file, unset our define and then define 28 | * your own version. Make sure this new header file is imported after the Crashlytics header file. 29 | * 30 | * #undef CLS_LOG 31 | * #define CLS_LOG(__FORMAT__, ...) CLSNSLog... 32 | * 33 | **/ 34 | #ifdef __OBJC__ 35 | #ifdef DEBUG 36 | #define CLS_LOG(__FORMAT__, ...) CLSNSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) 37 | #else 38 | #define CLS_LOG(__FORMAT__, ...) CLSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) 39 | #endif 40 | #endif 41 | 42 | /** 43 | * 44 | * Add logging that will be sent with your crash data. This logging will not show up in the system.log 45 | * and will only be visible in your Crashlytics dashboard. 46 | * 47 | **/ 48 | 49 | #ifdef __OBJC__ 50 | OBJC_EXTERN void CLSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2); 51 | OBJC_EXTERN void CLSLogv(NSString *format, va_list ap) NS_FORMAT_FUNCTION(1,0); 52 | 53 | /** 54 | * 55 | * Add logging that will be sent with your crash data. This logging will show up in the system.log 56 | * and your Crashlytics dashboard. It is not recommended for Release builds. 57 | * 58 | **/ 59 | OBJC_EXTERN void CLSNSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2); 60 | OBJC_EXTERN void CLSNSLogv(NSString *format, va_list ap) NS_FORMAT_FUNCTION(1,0); 61 | 62 | 63 | NS_ASSUME_NONNULL_END 64 | #endif 65 | -------------------------------------------------------------------------------- /Crashlytics.framework/Headers/CLSReport.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLSReport.h 3 | // Crashlytics 4 | // 5 | // Copyright (c) 2015 Crashlytics, Inc. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "CLSAttributes.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /** 14 | * The CLSCrashReport protocol is deprecated. See the CLSReport class and the CrashyticsDelegate changes for details. 15 | **/ 16 | @protocol CLSCrashReport 17 | 18 | @property (nonatomic, copy, readonly) NSString *identifier; 19 | @property (nonatomic, copy, readonly) NSDictionary *customKeys; 20 | @property (nonatomic, copy, readonly) NSString *bundleVersion; 21 | @property (nonatomic, copy, readonly) NSString *bundleShortVersionString; 22 | @property (nonatomic, copy, readonly) NSDate *crashedOnDate; 23 | @property (nonatomic, copy, readonly) NSString *OSVersion; 24 | @property (nonatomic, copy, readonly) NSString *OSBuildVersion; 25 | 26 | @end 27 | 28 | /** 29 | * The CLSReport exposes an interface to the phsyical report that Crashlytics has created. You can 30 | * use this class to get information about the event, and can also set some values after the 31 | * event has occured. 32 | **/ 33 | @interface CLSReport : NSObject 34 | 35 | - (instancetype)init NS_UNAVAILABLE; 36 | + (instancetype)new NS_UNAVAILABLE; 37 | 38 | /** 39 | * Returns the session identifier for the report. 40 | **/ 41 | @property (nonatomic, copy, readonly) NSString *identifier; 42 | 43 | /** 44 | * Returns the custom key value data for the report. 45 | **/ 46 | @property (nonatomic, copy, readonly) NSDictionary *customKeys; 47 | 48 | /** 49 | * Returns the CFBundleVersion of the application that generated the report. 50 | **/ 51 | @property (nonatomic, copy, readonly) NSString *bundleVersion; 52 | 53 | /** 54 | * Returns the CFBundleShortVersionString of the application that generated the report. 55 | **/ 56 | @property (nonatomic, copy, readonly) NSString *bundleShortVersionString; 57 | 58 | /** 59 | * Returns the date that the report was created. 60 | **/ 61 | @property (nonatomic, copy, readonly) NSDate *dateCreated; 62 | 63 | /** 64 | * Returns the os version that the application crashed on. 65 | **/ 66 | @property (nonatomic, copy, readonly) NSString *OSVersion; 67 | 68 | /** 69 | * Returns the os build version that the application crashed on. 70 | **/ 71 | @property (nonatomic, copy, readonly) NSString *OSBuildVersion; 72 | 73 | /** 74 | * Returns YES if the report contains any crash information, otherwise returns NO. 75 | **/ 76 | @property (nonatomic, assign, readonly) BOOL isCrash; 77 | 78 | /** 79 | * You can use this method to set, after the event, additional custom keys. The rules 80 | * and semantics for this method are the same as those documented in Crashlytics.h. Be aware 81 | * that the maximum size and count of custom keys is still enforced, and you can overwrite keys 82 | * and/or cause excess keys to be deleted by using this method. 83 | **/ 84 | - (void)setObjectValue:(nullable id)value forKey:(NSString *)key; 85 | 86 | /** 87 | * Record an application-specific user identifier. See Crashlytics.h for details. 88 | **/ 89 | @property (nonatomic, copy, nullable) NSString * userIdentifier; 90 | 91 | /** 92 | * Record a user name. See Crashlytics.h for details. 93 | **/ 94 | @property (nonatomic, copy, nullable) NSString * userName; 95 | 96 | /** 97 | * Record a user email. See Crashlytics.h for details. 98 | **/ 99 | @property (nonatomic, copy, nullable) NSString * userEmail; 100 | 101 | @end 102 | 103 | NS_ASSUME_NONNULL_END 104 | -------------------------------------------------------------------------------- /Crashlytics.framework/Headers/CLSStackFrame.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLSStackFrame.h 3 | // Crashlytics 4 | // 5 | // Copyright 2015 Crashlytics, Inc. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "CLSAttributes.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /** 14 | * 15 | * This class is used in conjunction with -[Crashlytics recordCustomExceptionName:reason:frameArray:] to 16 | * record information about non-ObjC/C++ exceptions. All information included here will be displayed 17 | * in the Crashlytics UI, and can influence crash grouping. Be particularly careful with the use of the 18 | * address property. If set, Crashlytics will attempt symbolication and could overwrite other properities 19 | * in the process. 20 | * 21 | **/ 22 | @interface CLSStackFrame : NSObject 23 | 24 | + (instancetype)stackFrame; 25 | + (instancetype)stackFrameWithAddress:(NSUInteger)address; 26 | + (instancetype)stackFrameWithSymbol:(NSString *)symbol; 27 | 28 | @property (nonatomic, copy, nullable) NSString *symbol; 29 | @property (nonatomic, copy, nullable) NSString *library; 30 | @property (nonatomic, copy, nullable) NSString *fileName; 31 | @property (nonatomic, assign) uint32_t lineNumber; 32 | @property (nonatomic, assign) uint64_t offset; 33 | @property (nonatomic, assign) uint64_t address; 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /Crashlytics.framework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 14F1021 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | Crashlytics 11 | CFBundleIdentifier 12 | com.twitter.crashlytics.ios 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Crashlytics 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 3.6.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | iPhoneOS 26 | 27 | CFBundleVersion 28 | 99 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 13B137 33 | DTPlatformName 34 | iphoneos 35 | DTPlatformVersion 36 | 9.1 37 | DTSDKBuild 38 | 13B137 39 | DTSDKName 40 | iphoneos9.1 41 | DTXcode 42 | 0710 43 | DTXcodeBuild 44 | 7B91b 45 | MinimumOSVersion 46 | 6.0 47 | NSHumanReadableCopyright 48 | Copyright © 2015 Crashlytics, Inc. All rights reserved. 49 | UIDeviceFamily 50 | 51 | 1 52 | 2 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Crashlytics.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Crashlytics { 2 | header "Crashlytics.h" 3 | header "Answers.h" 4 | header "ANSCompatibility.h" 5 | header "CLSLogging.h" 6 | header "CLSReport.h" 7 | header "CLSStackFrame.h" 8 | header "CLSAttributes.h" 9 | 10 | export * 11 | 12 | link "z" 13 | link "c++" 14 | } 15 | -------------------------------------------------------------------------------- /Crashlytics.framework/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # run 4 | # 5 | # Copyright (c) 2015 Crashlytics. All rights reserved. 6 | 7 | # Figure out where we're being called from 8 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 9 | 10 | # Quote path in case of spaces or special chars 11 | DIR="\"${DIR}" 12 | 13 | PATH_SEP="/" 14 | VALIDATE_COMMAND="uploadDSYM\" $@ validate run-script" 15 | UPLOAD_COMMAND="uploadDSYM\" $@ run-script" 16 | 17 | # Ensure params are as expected, run in sync mode to validate 18 | eval $DIR$PATH_SEP$VALIDATE_COMMAND 19 | return_code=$? 20 | 21 | if [[ $return_code != 0 ]]; then 22 | exit $return_code 23 | fi 24 | 25 | # Verification passed, upload dSYM in background to prevent Xcode from waiting 26 | # Note: Validation is performed again before upload. 27 | # Output can still be found in Console.app 28 | eval $DIR$PATH_SEP$UPLOAD_COMMAND > /dev/null 2>&1 & 29 | -------------------------------------------------------------------------------- /Crashlytics.framework/submit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/Crashlytics.framework/submit -------------------------------------------------------------------------------- /Crashlytics.framework/uploadDSYM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/Crashlytics.framework/uploadDSYM -------------------------------------------------------------------------------- /DeepStyle.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DeepStyle/AddDeepStylePaintingViewController.swift: -------------------------------------------------------------------------------- 1 | 2 | import UIKit 3 | 4 | @objc(AddDeepStylePaintingViewController) class AddDeepStylePaintingViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { 5 | 6 | // the view controller that spawned us will receive our images back, so it registers as a SourceAndStyleImageReciever 7 | var sourceAndStyleReceiver : SourceAndStyleImageReciever? = nil 8 | 9 | var paintingImage: UIImage? = nil 10 | var photoImage: UIImage? = nil 11 | 12 | @IBOutlet var choosePaintingButton: UIButton? = nil 13 | @IBOutlet var paintingImageView: UIImageView? = nil 14 | 15 | @IBOutlet var preset1ImageView: UIImageView? = nil 16 | @IBOutlet var preset2ImageView: UIImageView? = nil 17 | 18 | override func viewDidLoad() { 19 | super.viewDidLoad() 20 | 21 | let nextButton = UIBarButtonItem(title: "Next", style: UIBarButtonItemStyle.Plain, target: self, action: "create:") 22 | self.navigationItem.rightBarButtonItem = nextButton; 23 | 24 | // Do any additional setup after loading the view. 25 | self.navigationItem.title = "Choose Painting" 26 | 27 | } 28 | 29 | @IBAction func presetImage1Tapped(img: AnyObject) { 30 | paintingImageView?.image = preset1ImageView?.image 31 | } 32 | 33 | @IBAction func presetImage2Tapped(img: AnyObject) { 34 | paintingImageView?.image = preset2ImageView?.image 35 | } 36 | 37 | override func didReceiveMemoryWarning() { 38 | super.didReceiveMemoryWarning() 39 | // Dispose of any resources that can be recreated. 40 | } 41 | 42 | func showError(error: ErrorType) { 43 | 44 | print("Error: \(error)") 45 | let alert = UIAlertController( 46 | title: "Alert", 47 | message: "Oops! \(error)", 48 | preferredStyle: UIAlertControllerStyle.Alert 49 | ) 50 | alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil)) 51 | self.presentViewController(alert, animated: true, completion: nil) 52 | 53 | } 54 | 55 | @IBAction func create(sender: AnyObject) { 56 | 57 | if let painting = paintingImageView?.image { 58 | 59 | do { 60 | try sourceAndStyleReceiver?.dismissWithImages(self.photoImage!, styleImage: painting) 61 | } catch { 62 | showError(error) 63 | } 64 | 65 | } else { 66 | showError(AddJobError.MissingImage) 67 | } 68 | 69 | } 70 | 71 | 72 | func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) { 73 | if let image = info[UIImagePickerControllerOriginalImage] as? UIImage { 74 | self.paintingImage = image 75 | self.paintingImageView!.image = image 76 | } 77 | 78 | self.dismissViewControllerAnimated(true, completion: nil) 79 | } 80 | 81 | @IBAction func doPick (sender:AnyObject!) { 82 | 83 | let src = UIImagePickerControllerSourceType.PhotoLibrary 84 | let ok = UIImagePickerController.isSourceTypeAvailable(src) 85 | if !ok { 86 | return 87 | } 88 | 89 | let arr = UIImagePickerController.availableMediaTypesForSourceType(src) 90 | if arr == nil { 91 | return 92 | } 93 | let picker = UIImagePickerController() // see comments below for reason 94 | picker.sourceType = src 95 | picker.mediaTypes = arr! 96 | picker.delegate = self 97 | 98 | picker.allowsEditing = false // try true 99 | 100 | // this will automatically be fullscreen on phone and pad, looks fine 101 | // note that for .PhotoLibrary, iPhone app must permit portrait orientation 102 | // if we want a popover, on pad, we can do that; just uncomment next line 103 | // picker.modalPresentationStyle = .Popover 104 | self.presentViewController(picker, animated: true, completion: nil) 105 | // ignore: 106 | if let pop = picker.popoverPresentationController { 107 | let v = sender as! UIView 108 | pop.sourceView = v 109 | pop.sourceRect = v.bounds 110 | } 111 | 112 | } 113 | 114 | 115 | 116 | /* 117 | // MARK: - Navigation 118 | 119 | // In a storyboard-based application, you will often want to do a little preparation before navigation 120 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 121 | // Get the new view controller using segue.destinationViewController. 122 | // Pass the selected object to the new view controller. 123 | } 124 | */ 125 | 126 | } 127 | -------------------------------------------------------------------------------- /DeepStyle/AddDeepStylePaintingViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 49 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /DeepStyle/AddDeepStyleViewController.swift: -------------------------------------------------------------------------------- 1 | 2 | import UIKit 3 | import Crashlytics 4 | 5 | 6 | // Note regarding @objc(AddDeepStyleViewController) -- this is needed to workaround for crash where all IBOutlets are nil with iOS 8.x 7 | // http://bit.ly/1JHyDzo + http://bit.ly/1JHyDzo 8 | @objc(AddDeepStyleViewController) class AddDeepStyleViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { 9 | 10 | // the view controller that spawned us will receive our images back, so it registers as a SourceAndStyleImageReciever 11 | var sourceAndStyleReceiver : SourceAndStyleImageReciever? = nil 12 | 13 | var presenterViewController: PresenterViewController? = nil 14 | 15 | var photoImage: UIImage? = nil 16 | 17 | @IBOutlet var choosePhotoButton: UIButton? = nil 18 | @IBOutlet var photoImageView: UIImageView? = nil 19 | 20 | @IBOutlet var preset1ImageView: UIImageView? = nil 21 | @IBOutlet var preset2ImageView: UIImageView? = nil 22 | 23 | override func viewDidLoad() { 24 | 25 | super.viewDidLoad() 26 | 27 | let cancelButton = UIBarButtonItem(title: "Cancel", style: UIBarButtonItemStyle.Plain, target: self, action: "cancel:") 28 | self.navigationItem.leftBarButtonItem = cancelButton; 29 | 30 | let nextButton = UIBarButtonItem(title: "Next", style: UIBarButtonItemStyle.Plain, target: self, action: "next:") 31 | self.navigationItem.rightBarButtonItem = nextButton; 32 | 33 | self.navigationItem.title = "Choose Photo" 34 | 35 | } 36 | 37 | func cancel(sender: UIBarButtonItem) { 38 | presenterViewController?.dismiss() 39 | } 40 | 41 | func showError(error: ErrorType) { 42 | 43 | print("Error: \(error)") 44 | let alert = UIAlertController( 45 | title: "Alert", 46 | message: "Oops! \(error)", 47 | preferredStyle: UIAlertControllerStyle.Alert 48 | ) 49 | alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil)) 50 | self.presentViewController(alert, animated: true, completion: nil) 51 | 52 | } 53 | 54 | @IBAction func presetImage1Tapped(img: AnyObject) { 55 | photoImageView?.image = preset1ImageView?.image 56 | } 57 | 58 | @IBAction func presetImage2Tapped(img: AnyObject) { 59 | photoImageView?.image = preset2ImageView?.image 60 | } 61 | 62 | @IBAction func next(sender: AnyObject) { 63 | 64 | if let photo = photoImageView?.image { 65 | 66 | // TODO: push AddDeepStylePaintingImage to stack 67 | print("photo: \(photo)") 68 | let addPainting = AddDeepStylePaintingViewController() 69 | 70 | addPainting.sourceAndStyleReceiver = self.sourceAndStyleReceiver 71 | addPainting.photoImage = photo 72 | 73 | self.navigationController?.pushViewController(addPainting, animated: true) 74 | 75 | } else { 76 | showError(AddJobError.MissingImage) 77 | } 78 | 79 | } 80 | 81 | func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) { 82 | if let image = info[UIImagePickerControllerOriginalImage] as? UIImage { 83 | self.photoImage = image 84 | self.photoImageView!.image = image 85 | } 86 | 87 | self.dismissViewControllerAnimated(true, completion: nil) 88 | } 89 | 90 | 91 | @IBAction func doPick (sender:AnyObject!) { 92 | 93 | let src = UIImagePickerControllerSourceType.PhotoLibrary 94 | let ok = UIImagePickerController.isSourceTypeAvailable(src) 95 | if !ok { 96 | return 97 | } 98 | 99 | let arr = UIImagePickerController.availableMediaTypesForSourceType(src) 100 | if arr == nil { 101 | return 102 | } 103 | let picker = UIImagePickerController() // see comments below for reason 104 | picker.sourceType = src 105 | picker.mediaTypes = arr! 106 | picker.delegate = self 107 | 108 | picker.allowsEditing = false // try true 109 | 110 | // this will automatically be fullscreen on phone and pad, looks fine 111 | // note that for .PhotoLibrary, iPhone app must permit portrait orientation 112 | // if we want a popover, on pad, we can do that; just uncomment next line 113 | // picker.modalPresentationStyle = .Popover 114 | self.presentViewController(picker, animated: true, completion: nil) 115 | // ignore: 116 | if let pop = picker.popoverPresentationController { 117 | let v = sender as! UIView 118 | pop.sourceView = v 119 | pop.sourceRect = v.bounds 120 | } 121 | 122 | } 123 | 124 | 125 | override func didReceiveMemoryWarning() { 126 | super.didReceiveMemoryWarning() 127 | // Dispose of any resources that can be recreated. 128 | } 129 | 130 | 131 | /* 132 | // MARK: - Navigation 133 | 134 | // In a storyboard-based application, you will often want to do a little preparation before navigation 135 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 136 | // Get the new view controller using segue.destinationViewController. 137 | // Pass the selected object to the new view controller. 138 | } 139 | */ 140 | 141 | } 142 | 143 | enum AddJobError: ErrorType { 144 | case MissingImage 145 | } 146 | -------------------------------------------------------------------------------- /DeepStyle/AddDeepStyleViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /DeepStyle/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | 2 | import Foundation 3 | import UIKit 4 | import FBSDKCoreKit 5 | import FBSDKLoginKit 6 | import Fabric 7 | import Crashlytics 8 | 9 | @UIApplicationMain 10 | class AppDelegate: UIResponder, UIApplicationDelegate { 11 | 12 | var window: UIWindow? 13 | 14 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 15 | 16 | Fabric.with([Crashlytics.self]) 17 | 18 | FBSDKProfile.enableUpdatesOnAccessTokenChange(true) 19 | FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions) 20 | 21 | if DBHelper.sharedInstance.database == nil { 22 | return false 23 | } 24 | 25 | self.window = UIWindow(frame: UIScreen.mainScreen().bounds) 26 | self.window!.backgroundColor = UIColor.whiteColor() 27 | 28 | let recentGalleryVewController = GalleryViewController() 29 | let nav = UINavigationController(rootViewController: recentGalleryVewController) 30 | 31 | self.window!.rootViewController = nav 32 | self.window!.makeKeyAndVisible() 33 | 34 | return true 35 | } 36 | 37 | func applicationWillResignActive(application: UIApplication) { 38 | // 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. 39 | // 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. 40 | } 41 | 42 | func applicationDidEnterBackground(application: UIApplication) { 43 | // 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. 44 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 45 | } 46 | 47 | func applicationWillEnterForeground(application: UIApplication) { 48 | // 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. 49 | } 50 | 51 | func applicationDidBecomeActive(application: UIApplication) { 52 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 53 | FBSDKAppEvents.activateApp() 54 | } 55 | 56 | func applicationWillTerminate(application: UIApplication) { 57 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 58 | } 59 | 60 | func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool { 61 | return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation) 62 | } 63 | 64 | func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) { 65 | 66 | let tokenChars = UnsafePointer(deviceToken.bytes) 67 | var tokenString = "" 68 | 69 | for i in 0.. 10 | 11 | #import 12 | 13 | @class CBLDocument, CBLLiveQuery, CBLQueryRow; 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | /** A UITableView data source driven by a CBLLiveQuery. 18 | It populates the table rows from the query rows, and automatically updates the table as the 19 | query results change when the database is updated. 20 | A CBLUITableSource can be created in a nib. If so, its tableView outlet should be wired up to 21 | the UITableView it manages, and the table view's dataSource outlet should be wired to it. */ 22 | @interface CBUITableSource : NSObject = 60000) 24 | , UIDataSourceModelAssociation 25 | #endif 26 | > 27 | /** The table view to manage. */ 28 | @property (nonatomic, retain) IBOutlet UITableView* tableView; 29 | 30 | /** The query whose rows will be displayed in the table. */ 31 | @property (retain) CBLLiveQuery* query; 32 | 33 | /** Rebuilds the table from the query's current .rows property. */ 34 | -(void) reloadFromQuery; 35 | 36 | 37 | #pragma mark Row Accessors: 38 | 39 | /** The current array of CBLQueryRows being used as the data source for the table. */ 40 | @property (nonatomic, readonly, nullable) CBLArrayOf(CBLQueryRow*)* rows; 41 | 42 | /** Convenience accessor to get the row object for a given table row index. */ 43 | - (nullable CBLQueryRow*) rowAtIndex: (NSUInteger)index; 44 | 45 | /** Convenience accessor to find the index path of the row with a given document. */ 46 | - (nullable NSIndexPath*) indexPathForDocument: (CBLDocument*)document; 47 | 48 | /** Convenience accessor to return the query row at a given index path. */ 49 | - (nullable CBLQueryRow*) rowAtIndexPath: (NSIndexPath*)path; 50 | 51 | /** Convenience accessor to return the document at a given index path. */ 52 | - (nullable CBLDocument*) documentAtIndexPath: (NSIndexPath*)path; 53 | 54 | 55 | #pragma mark Displaying The Table: 56 | 57 | /** If non-nil, specifies the property name of the query row's value that will be used for the table row's visible label. 58 | If the row's value is not a dictionary, or if the property doesn't exist, the property will next be looked up in the document's properties. 59 | If this doesn't meet your needs for labeling rows, you should implement -couchTableSource:willUseCell:forRow: in the table's delegate. */ 60 | @property (copy, nullable) NSString* labelProperty; 61 | 62 | 63 | #pragma mark Editing The Table: 64 | 65 | /** Is the user allowed to delete rows by UI gestures? (Defaults to YES.) */ 66 | @property (nonatomic) BOOL deletionAllowed; 67 | 68 | /** Deletes the documents at the given row indexes, animating the removal from the table. */ 69 | - (BOOL) deleteDocumentsAtIndexes: (CBLArrayOf(NSIndexPath*)*)indexPaths 70 | error: (NSError**)outError; 71 | 72 | /** Asynchronously deletes the given documents, animating the removal from the table. */ 73 | - (BOOL) deleteDocuments: (CBLArrayOf(CBLDocument*)*)documents 74 | error: (NSError**)outError; 75 | 76 | @end 77 | 78 | 79 | /** Additional methods for the table view's delegate, that will be invoked by the CBLUITableSource. */ 80 | @protocol CBUITableDelegate 81 | @optional 82 | 83 | /** Allows delegate to return its own custom cell, just like -tableView:cellForRowAtIndexPath:. 84 | If this returns nil the table source will create its own cell, as if this method were not implemented. */ 85 | - (UITableViewCell *)couchTableSource:(CBUITableSource*)source 86 | cellForRowAtIndexPath:(NSIndexPath *)indexPath; 87 | 88 | /** Called after the query's results change, before the table view is reloaded. */ 89 | - (void)couchTableSource:(CBUITableSource*)source 90 | willUpdateFromQuery:(CBLLiveQuery*)query; 91 | 92 | /** Called after the query's results change to update the table view. If this method is not implemented by the delegate, reloadData is called on the table view.*/ 93 | - (void)couchTableSource:(CBUITableSource*)source 94 | updateFromQuery:(CBLLiveQuery*)query 95 | previousRows:(CBLArrayOf(CBLQueryRow*) *)previousRows; 96 | 97 | /** Called from -tableView:cellForRowAtIndexPath: just before it returns, giving the delegate a chance to customize the new cell. */ 98 | - (void)couchTableSource:(CBUITableSource*)source 99 | willUseCell:(UITableViewCell*)cell 100 | forRow:(CBLQueryRow*)row; 101 | 102 | /** Called when the user wants to delete a row. 103 | If the delegate implements this method, it will be called *instead of* the 104 | default behavior of deleting the associated document. 105 | @param source The CBLUITableSource 106 | @param row The query row corresponding to the row to delete 107 | @return True if the row was deleted, false if not. */ 108 | - (bool)couchTableSource:(CBUITableSource*)source 109 | deleteRow:(CBLQueryRow*)row; 110 | 111 | /** Called upon failure of a document deletion triggered by the user deleting a row. */ 112 | - (void)couchTableSource:(CBUITableSource*)source 113 | deleteFailed:(NSError*)error; 114 | 115 | @end 116 | 117 | 118 | NS_ASSUME_NONNULL_END 119 | -------------------------------------------------------------------------------- /DeepStyle/Constants.swift: -------------------------------------------------------------------------------- 1 | 2 | import Foundation 3 | 4 | struct Constants { 5 | static let localDocumentKeyDeviceToken = "DeviceToken" 6 | } -------------------------------------------------------------------------------- /DeepStyle/Couchbase-Lite-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Couchbase-Lite-Bridging-Header.h 3 | // DeepStyle2 4 | // 5 | // Created by Traun Leyden on 12/13/15. 6 | // Copyright © 2015 DeepStyle. All rights reserved. 7 | // 8 | 9 | #ifndef Couchbase_Lite_Bridging_Header_h 10 | #define Couchbase_Lite_Bridging_Header_h 11 | 12 | #import 13 | #import "CBUITableSource.h" 14 | 15 | #endif /* Couchbase_Lite_Bridging_Header_h */ 16 | -------------------------------------------------------------------------------- /DeepStyle/DeepStyleJob.swift: -------------------------------------------------------------------------------- 1 | 2 | import Foundation 3 | 4 | class DeepStyleJob: CBLModel { 5 | 6 | static let docType = "job" 7 | 8 | static let StateNotReadyToProcess = "NOT_READY_TO_PROCESS" 9 | static let StateReadyToProcess = "READY_TO_PROCESS" 10 | static let StateBeingProcessed = "BEING_PROCESSED" 11 | static let StateProcessingSuccessful = "PROCESSING_SUCCESSFUL" 12 | static let StateProcessingFailed = "PROCESSING_FAILED" 13 | 14 | @NSManaged var state: String? 15 | @NSManaged var owner: String? 16 | @NSManaged var owner_devicetoken: String? 17 | 18 | func styleImage() -> UIImage? { 19 | return imageAttachmentByName("style_image") 20 | } 21 | 22 | func sourceImage() -> UIImage? { 23 | return imageAttachmentByName("source_image") 24 | } 25 | 26 | func finishedImage() -> UIImage? { 27 | return imageAttachmentByName("result_image") 28 | } 29 | 30 | func imageAttachmentByName(imageName: String) -> UIImage? { 31 | if let imageAttachment = self.attachmentNamed(imageName) { 32 | return UIImage(data: imageAttachment.content!) 33 | } 34 | return nil 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /DeepStyle/FullScreenImageViewController.swift: -------------------------------------------------------------------------------- 1 | 2 | import UIKit 3 | 4 | @objc(FullScreenImageViewController) class FullScreenImageViewController: UIViewController { 5 | 6 | @IBOutlet var fullScreenImageView: UIImageView? = nil 7 | 8 | var fullScreenImage: UIImage? = nil 9 | 10 | override func viewDidLoad() { 11 | super.viewDidLoad() 12 | 13 | // Do any additional setup after loading the view. 14 | self.fullScreenImageView?.image = self.fullScreenImage 15 | 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | /*func setTheFullScreenImageView(fullscreenImageViewToUse: UIImageView) { 24 | self.fullScreenImageView = fullscreenImageViewToUse 25 | }*/ 26 | 27 | 28 | /* 29 | // MARK: - Navigation 30 | 31 | // In a storyboard-based application, you will often want to do a little preparation before navigation 32 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 33 | // Get the new view controller using segue.destinationViewController. 34 | // Pass the selected object to the new view controller. 35 | } 36 | */ 37 | 38 | } 39 | -------------------------------------------------------------------------------- /DeepStyle/FullScreenImageViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /DeepStyle/GalleryTableViewCell.swift: -------------------------------------------------------------------------------- 1 | 2 | 3 | import UIKit 4 | 5 | class GalleryTableViewCell: UITableViewCell { 6 | 7 | @IBOutlet var paintingImageView: UIImageView? = nil 8 | @IBOutlet var photoImageView: UIImageView? = nil 9 | @IBOutlet var finishedImageView: UIImageView? = nil 10 | 11 | override func awakeFromNib() { 12 | super.awakeFromNib() 13 | // Initialization code 14 | } 15 | 16 | override func setSelected(selected: Bool, animated: Bool) { 17 | super.setSelected(selected, animated: animated) 18 | 19 | // Configure the view for the selected state 20 | } 21 | 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /DeepStyle/GalleryTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /DeepStyle/GalleryViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /DeepStyle/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 | CFBundleURLTypes 22 | 23 | 24 | CFBundleURLSchemes 25 | 26 | fbDEEPSTYLE_FB_APP_ID 27 | 28 | 29 | 30 | CFBundleVersion 31 | 1 32 | Fabric 33 | 34 | APIKey 35 | DEEPSTYLE_FABRIC_APP_ID 36 | Kits 37 | 38 | 39 | KitInfo 40 | 41 | KitName 42 | Crashlytics 43 | 44 | 45 | 46 | FacebookAppID 47 | DEEPSTYLE_FB_APP_ID 48 | FacebookDisplayName 49 | DeepStyle 50 | LSApplicationQueriesSchemes 51 | 52 | fbauth2 53 | 54 | LSRequiresIPhoneOS 55 | 56 | NSAppTransportSecurity 57 | 58 | NSExceptionDomains 59 | 60 | akamaihd.net 61 | 62 | NSIncludesSubdomains 63 | 64 | NSThirdPartyExceptionRequiresForwardSecrecy 65 | 66 | 67 | amazonaws.com 68 | 69 | NSIncludesSubdomains 70 | 71 | NSTemporaryExceptionAllowsInsecureHTTPLoads 72 | 73 | NSTemporaryExceptionMinimumTLSVersion 74 | TLSv1.1 75 | 76 | couchbasemobile.com 77 | 78 | NSIncludesSubdomains 79 | 80 | NSTemporaryExceptionAllowsInsecureHTTPLoads 81 | 82 | NSTemporaryExceptionMinimumTLSVersion 83 | TLSv1.1 84 | 85 | facebook.com 86 | 87 | NSIncludesSubdomains 88 | 89 | NSThirdPartyExceptionRequiresForwardSecrecy 90 | 91 | 92 | fbcdn.net 93 | 94 | NSIncludesSubdomains 95 | 96 | NSThirdPartyExceptionRequiresForwardSecrecy 97 | 98 | 99 | localhost 100 | 101 | NSIncludesSubdomains 102 | 103 | NSTemporaryExceptionAllowsInsecureHTTPLoads 104 | 105 | NSTemporaryExceptionMinimumTLSVersion 106 | TLSv1.1 107 | 108 | 109 | 110 | UILaunchStoryboardName 111 | LaunchScreen 112 | UIRequiredDeviceCapabilities 113 | 114 | armv7 115 | 116 | UISupportedInterfaceOrientations 117 | 118 | UIInterfaceOrientationPortrait 119 | UIInterfaceOrientationLandscapeLeft 120 | UIInterfaceOrientationLandscapeRight 121 | 122 | UISupportedInterfaceOrientations~ipad 123 | 124 | UIInterfaceOrientationPortrait 125 | UIInterfaceOrientationPortraitUpsideDown 126 | UIInterfaceOrientationLandscapeLeft 127 | UIInterfaceOrientationLandscapeRight 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /DeepStyle/LoginSession.swift: -------------------------------------------------------------------------------- 1 | 2 | // Access point for the currently logged in user 3 | 4 | import Foundation 5 | import FBSDKCoreKit 6 | import FBSDKLoginKit 7 | import Crashlytics 8 | 9 | class LoginSession { 10 | 11 | static let sharedInstance = LoginSession() 12 | 13 | func getLoggedInUserId() throws -> String { 14 | 15 | if let accessToken = FBSDKAccessToken.currentAccessToken() { 16 | 17 | if let facebookUserId = LoginSession.sharedInstance.lookupSavedUserIdForAccessToken(accessToken.tokenString) { 18 | return facebookUserId 19 | } 20 | print("Could not lookup facebookUserId from \(accessToken.tokenString)") 21 | throw LoginSessionError.UserNotLoggedIn 22 | 23 | } else { 24 | throw LoginSessionError.UserNotLoggedIn 25 | } 26 | 27 | } 28 | 29 | func saveUserLoginInfo(userId: String, name: String, email: String) throws { 30 | try saveUserIdForCurrentFBAccessToken(userId, name: name, email: email) 31 | } 32 | 33 | // LoginSession.sharedInstance.lookupSavedUserIdForAccessToken(accessToken) 34 | func lookupSavedUserIdForAccessToken(accessToken: String) -> String? { 35 | return DBHelper.sharedInstance.lookupLocalDocKV(accessToken) 36 | } 37 | 38 | func saveUserIdForCurrentFBAccessToken(userId: String, name: String, email: String) throws { 39 | 40 | Crashlytics.sharedInstance().setUserIdentifier(userId) 41 | Crashlytics.sharedInstance().setUserName(name) 42 | Crashlytics.sharedInstance().setUserEmail(email) 43 | 44 | if let accessToken = FBSDKAccessToken.currentAccessToken() { 45 | let localDocKey = accessToken.tokenString 46 | try DBHelper.sharedInstance.setLocalDocKV(localDocKey, value: userId) 47 | } 48 | } 49 | 50 | func logout() throws { 51 | if let accessToken = FBSDKAccessToken.currentAccessToken() { 52 | let localDocKey = accessToken.tokenString 53 | try DBHelper.sharedInstance.setLocalDocKV(localDocKey, value: "") 54 | FBSDKAccessToken.setCurrentAccessToken(nil) 55 | } 56 | } 57 | 58 | } 59 | 60 | enum LoginSessionError: ErrorType { 61 | case UserNotLoggedIn 62 | } -------------------------------------------------------------------------------- /DeepStyle/LoginViewController.swift: -------------------------------------------------------------------------------- 1 | 2 | import UIKit 3 | import FBSDKCoreKit 4 | import FBSDKLoginKit 5 | 6 | // TODO: figure out why using a nib didn't work -- button was not centered 7 | // RE TODO: need to add constraints 8 | 9 | class LoginViewController: UIViewController, FBSDKLoginButtonDelegate, PresenterViewController { 10 | 11 | var presenterViewController: PresenterViewController? = nil 12 | var activityIndicator: UIActivityIndicatorView? = nil 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | 17 | // Add FB login button 18 | let loginView : FBSDKLoginButton = FBSDKLoginButton() 19 | loginView.delegate = self 20 | loginView.readPermissions = ["public_profile", "user_friends", "email"] 21 | self.view.addSubview(loginView) 22 | loginView.center = self.view.center 23 | 24 | } 25 | 26 | 27 | override func didReceiveMemoryWarning() { 28 | super.didReceiveMemoryWarning() 29 | // Dispose of any resources that can be recreated. 30 | } 31 | 32 | func loginButton(loginButton: FBSDKLoginButton!, didCompleteWithResult result: FBSDKLoginManagerLoginResult!, error: NSError!) { 33 | 34 | print("loginButton didCompleteWithResult called with result: \(result) error: \(error)") 35 | 36 | showActivityIndicator() 37 | 38 | if (error != nil) 39 | { 40 | self.showError("Error doing facebook login", error: error) 41 | return 42 | } 43 | 44 | let graphRequest : FBSDKGraphRequest = FBSDKGraphRequest(graphPath: "me", parameters: ["fields":"id,email,name,picture.width(480).height(480)"]) 45 | graphRequest.startWithCompletionHandler({ (connection, result, error) -> Void in 46 | 47 | if (error != nil) 48 | { 49 | self.showError("Error getting facebook ID", error: error) 50 | } 51 | else 52 | { 53 | let userId = result.valueForKey("id") as! String 54 | let name = result.valueForKey("name") as! String 55 | let email = result.valueForKey("email") as! String 56 | 57 | do { 58 | try LoginSession.sharedInstance.saveUserLoginInfo(userId, name: name, email: email) 59 | } catch { 60 | self.showError("Error saving user ID", error: error) 61 | } 62 | 63 | 64 | do { 65 | try DBHelper.sharedInstance.startReplicationFromFacebookToken() 66 | } catch { 67 | self.showError("Error starting replication", error: error) 68 | } 69 | 70 | if FBSDKAccessToken.currentAccessToken() != nil { 71 | self.presenterViewController?.dismiss() 72 | } else { 73 | self.showError("Error doing facebook login -- no access token", error: DBHelperError.FBUserNotLoggedIn) 74 | } 75 | 76 | self.hideActivityIndicator() 77 | 78 | } 79 | }) 80 | 81 | 82 | 83 | 84 | } 85 | 86 | func showActivityIndicator() { 87 | 88 | self.activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.Gray) 89 | 90 | self.activityIndicator!.center=self.view.center 91 | self.activityIndicator!.center.y += 50 // move it below the fb button 92 | self.activityIndicator!.startAnimating() 93 | self.view.addSubview(self.activityIndicator!) 94 | 95 | } 96 | 97 | func hideActivityIndicator() { 98 | self.activityIndicator?.removeFromSuperview() 99 | } 100 | 101 | func returnUserData() 102 | { 103 | 104 | } 105 | 106 | 107 | func showError(msg: String, error: ErrorType) { 108 | 109 | print("Error: \(msg) - \(error)") 110 | let alert = UIAlertController( 111 | title: "Alert", 112 | message: "Oops! \(msg) - \(error)", 113 | preferredStyle: UIAlertControllerStyle.Alert 114 | ) 115 | alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil)) 116 | self.presentViewController(alert, animated: true, completion: nil) 117 | 118 | } 119 | 120 | func loginButtonDidLogOut(loginButton: FBSDKLoginButton!) { 121 | print("loginButtonDidLogOut") 122 | } 123 | 124 | func loginButtonWillLogin(loginButton: FBSDKLoginButton!) -> Bool { 125 | print("loginButtonWillLogin") 126 | return true 127 | } 128 | 129 | func dismiss() { 130 | self.dismissViewControllerAnimated(true, completion: nil) 131 | } 132 | 133 | /* 134 | // MARK: - Navigation 135 | 136 | // In a storyboard-based application, you will often want to do a little preparation before navigation 137 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 138 | // Get the new view controller using segue.destinationViewController. 139 | // Pass the selected object to the new view controller. 140 | } 141 | */ 142 | 143 | } 144 | -------------------------------------------------------------------------------- /DeepStyle/Util.swift: -------------------------------------------------------------------------------- 1 | 2 | import Foundation 3 | import UIKit 4 | import CRToast 5 | 6 | protocol PresenterViewController { 7 | func dismiss() 8 | } 9 | 10 | protocol SourceAndStyleImageReciever { 11 | func dismissWithImages(sourceImage: UIImage, styleImage: UIImage) throws 12 | } 13 | 14 | func fixFinishedImageViewOrientation(finishedImage: UIImage, photoImage: UIImage) -> UIImage { 15 | 16 | // set the orientation of the finished image view to the same orientation of the 17 | // photo image view 18 | 19 | let newOrientatation = photoImage.imageOrientation 20 | 21 | let rotatedImage: UIImage = UIImage(CGImage: finishedImage.CGImage!, 22 | scale: 1.0 , 23 | orientation: newOrientatation) 24 | 25 | return rotatedImage 26 | 27 | } 28 | 29 | func showError(errorText: String) { 30 | 31 | let options: NSDictionary = [ 32 | kCRToastTextKey : errorText, 33 | kCRToastTextAlignmentKey : NSTextAlignment.Center.rawValue, 34 | kCRToastBackgroundColorKey : UIColor.redColor(), 35 | kCRToastAnimationInTypeKey : CRToastAnimationType.Gravity.rawValue, 36 | kCRToastAnimationOutTypeKey : CRToastAnimationType.Gravity.rawValue, 37 | kCRToastAnimationInDirectionKey : CRToastAnimationDirection.Top.rawValue, 38 | kCRToastAnimationOutDirectionKey : CRToastAnimationDirection.Top.rawValue, 39 | kCRToastTimeIntervalKey: NSTimeInterval(5.0), 40 | kCRToastNotificationTypeKey: CRToastType.StatusBar.rawValue, 41 | ] 42 | CRToastManager.showNotificationWithOptions(options as [NSObject : AnyObject], apperanceBlock: { () -> Void in 43 | print("Showing error notification \(errorText)") 44 | }, completionBlock: { () -> Void in 45 | print("Error notification finished \(errorText)") 46 | }) 47 | 48 | } 49 | -------------------------------------------------------------------------------- /DeepStyle2Tests/DeepStyle2Tests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DeepStyle2Tests.swift 3 | // DeepStyle2Tests 4 | // 5 | // Created by Traun Leyden on 12/13/15. 6 | // Copyright © 2015 DeepStyle. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import DeepStyle 11 | 12 | class DeepStyle2Tests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /DeepStyle2Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/FBSDKCoreKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/FBSDKCoreKit.framework/FBSDKCoreKit -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKAppLinkResolver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | @class BFTask; 22 | 23 | // Check if Bolts.framework is available for import 24 | #if __has_include() 25 | // Import it if it's available 26 | # import 27 | #else 28 | // Otherwise - redeclare BFAppLinkResolving protocol to resolve the problem of missing symbols 29 | // Please note: Bolts.framework is still required for AppLink resolving to work, 30 | // but this allows FBSDKCoreKit to weakly link Bolts.framework as well as this enables clang modulemaps to work. 31 | 32 | /*! 33 | Implement this protocol to provide an alternate strategy for resolving 34 | App Links that may include pre-fetching, caching, or querying for App Link 35 | data from an index provided by a service provider. 36 | */ 37 | @protocol BFAppLinkResolving 38 | 39 | /*! 40 | Asynchronously resolves App Link data for a given URL. 41 | 42 | @param url The URL to resolve into an App Link. 43 | @returns A BFTask that will return a BFAppLink for the given URL. 44 | */ 45 | - (BFTask *)appLinkFromURLInBackground:(NSURL *)url; 46 | 47 | @end 48 | 49 | #endif 50 | 51 | /*! 52 | @class FBSDKAppLinkResolver 53 | 54 | @abstract 55 | Provides an implementation of the BFAppLinkResolving protocol that uses the Facebook App Link 56 | Index API to resolve App Links given a URL. It also provides an additional helper method that can resolve 57 | multiple App Links in a single call. 58 | 59 | @discussion 60 | Usage of this type requires a client token. See `[FBSDKSettings setClientToken:]` and linking 61 | Bolts.framework 62 | */ 63 | @interface FBSDKAppLinkResolver : NSObject 64 | 65 | /*! 66 | @abstract Asynchronously resolves App Link data for multiple URLs. 67 | 68 | @param urls An array of NSURLs to resolve into App Links. 69 | @returns A BFTask that will return dictionary mapping input NSURLs to their 70 | corresponding BFAppLink. 71 | 72 | @discussion 73 | You should set the client token before making this call. See `[FBSDKSettings setClientToken:]` 74 | */ 75 | - (BFTask *)appLinksFromURLsInBackground:(NSArray *)urls; 76 | 77 | /*! 78 | @abstract Allocates and initializes a new instance of FBSDKAppLinkResolver. 79 | */ 80 | + (instancetype)resolver; 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKAppLinkUtility.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | /*! 22 | @abstract Describes the callback for fetchDeferredAppLink. 23 | @param url the url representing the deferred App Link 24 | @param error the error during the request, if any 25 | 26 | @discussion The url may also have a fb_click_time_utc query parameter that 27 | represents when the click occurred that caused the deferred App Link to be created. 28 | */ 29 | typedef void (^FBSDKDeferredAppLinkHandler)(NSURL *url, NSError *error); 30 | 31 | /*! 32 | @abstract Class containing App Links related utility methods. 33 | */ 34 | @interface FBSDKAppLinkUtility : NSObject 35 | 36 | /*! 37 | @abstract 38 | Call this method from the main thread to fetch deferred applink data if you use Mobile App 39 | Engagement Ads (https://developers.facebook.com/docs/ads-for-apps/mobile-app-ads-engagement). 40 | This may require a network round trip. If successful, the handler is invoked with the link 41 | data (this will only return a valid URL once, and future calls will result in a nil URL 42 | value in the callback). 43 | 44 | @param handler the handler to be invoked if there is deferred App Link data 45 | 46 | @discussion The handler may contain an NSError instance to capture any errors. In the 47 | common case where there simply was no app link data, the NSError instance will be nil. 48 | 49 | This method should only be called from a location that occurs after any launching URL has 50 | been processed (e.g., you should call this method from your application delegate's 51 | applicationDidBecomeActive:). 52 | */ 53 | + (void)fetchDeferredAppLink:(FBSDKDeferredAppLinkHandler)handler; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKApplicationDelegate.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | /*! 22 | @class FBSDKApplicationDelegate 23 | 24 | @abstract 25 | The FBSDKApplicationDelegate is designed to post process the results from Facebook Login 26 | or Facebook Dialogs (or any action that requires switching over to the native Facebook 27 | app or Safari). 28 | 29 | @discussion 30 | The methods in this class are designed to mirror those in UIApplicationDelegate, and you 31 | should call them in the respective methods in your AppDelegate implementation. 32 | */ 33 | @interface FBSDKApplicationDelegate : NSObject 34 | 35 | /*! 36 | @abstract Gets the singleton instance. 37 | */ 38 | + (instancetype)sharedInstance; 39 | 40 | /*! 41 | @abstract 42 | Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method 43 | of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction 44 | with the native Facebook app or Safari as part of SSO authorization flow or Facebook dialogs. 45 | 46 | @param application The application as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. 47 | 48 | @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. 49 | 50 | @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. 51 | 52 | @param annotation The annotation as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. 53 | 54 | @return YES if the url was intended for the Facebook SDK, NO if not. 55 | */ 56 | - (BOOL)application:(UIApplication *)application 57 | openURL:(NSURL *)url 58 | sourceApplication:(NSString *)sourceApplication 59 | annotation:(id)annotation; 60 | 61 | /*! 62 | @abstract 63 | Call this method from the [UIApplicationDelegate application:didFinishLaunchingWithOptions:] method 64 | of the AppDelegate for your app. It should be invoked for the proper use of the Facebook SDK. 65 | 66 | @param application The application as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. 67 | 68 | @param launchOptions The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. 69 | 70 | @return YES if the url was intended for the Facebook SDK, NO if not. 71 | */ 72 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKButton.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | /*! 22 | @abstract A base class for common SDK buttons. 23 | */ 24 | @interface FBSDKButton : UIButton 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKCopying.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | /*! 22 | @abstract Extension protocol for NSCopying that adds the copy method, which is implemented on NSObject. 23 | @discussion NSObject implicitly conforms to this protocol. 24 | */ 25 | @protocol FBSDKCopying 26 | 27 | /*! 28 | @abstract Implemented by NSObject as a convenience to copyWithZone:. 29 | @return A copy of the receiver. 30 | */ 31 | - (id)copy; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKCoreKit.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import 32 | #import 33 | #import 34 | #import 35 | #import 36 | 37 | #define FBSDK_VERSION_STRING @"4.8.0" 38 | #define FBSDK_TARGET_PLATFORM_VERSION @"v2.5" 39 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKGraphErrorRecoveryProcessor.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | #import "FBSDKConstants.h" 22 | 23 | @class FBSDKGraphErrorRecoveryProcessor; 24 | @class FBSDKGraphRequest; 25 | 26 | /*! 27 | @abstract Defines a delegate for `FBSDKGraphErrorRecoveryProcessor`. 28 | */ 29 | @protocol FBSDKGraphErrorRecoveryProcessorDelegate 30 | 31 | /*! 32 | @abstract Indicates the error recovery has been attempted. 33 | @param processor the processor instance. 34 | @param didRecover YES if the recovery was successful. 35 | @param error the error that that was attempted to be recovered from. 36 | */ 37 | - (void)processorDidAttemptRecovery:(FBSDKGraphErrorRecoveryProcessor *)processor didRecover:(BOOL)didRecover error:(NSError *)error; 38 | 39 | @optional 40 | /*! 41 | @abstract Indicates the processor is about to process the error. 42 | @param processor the processor instance. 43 | @param error the error is about to be processed. 44 | @discussion return NO if the processor should not process the error. For example, 45 | if you want to prevent alerts of localized messages but otherwise perform retries and recoveries, 46 | you could return NO for errors where userInfo[FBSDKGraphRequestErrorCategoryKey] equal to FBSDKGraphRequestErrorCategoryOther 47 | */ 48 | - (BOOL)processorWillProcessError:(FBSDKGraphErrorRecoveryProcessor *)processor error:(NSError *)error; 49 | 50 | @end 51 | 52 | /*! 53 | @abstract Defines a type that can process Facebook NSErrors with best practices. 54 | @discussion Facebook NSErrors can contain FBSDKErrorRecoveryAttempting instances to recover from errors, or 55 | localized messages to present to the user. This class will process the instances as follows: 56 | 57 | 1. If the error is temporary as indicated by FBSDKGraphRequestErrorCategoryKey, assume the recovery succeeded and 58 | notify the delegate. 59 | 2. If a FBSDKErrorRecoveryAttempting instance is available, display an alert (dispatched to main thread) 60 | with the recovery options and call the instance's [ attemptRecoveryFromError:optionIndex:...]. 61 | 3. If a FBSDKErrorRecoveryAttempting is not available, check the userInfo for FBSDKLocalizedErrorDescriptionKey 62 | and present that in an alert (dispatched to main thread). 63 | 64 | By default, FBSDKGraphRequests use this type to process errors and retry the request upon a successful 65 | recovery. 66 | 67 | Note that Facebook recovery attempters can present UI or even cause app switches (such as to login). Any such 68 | work is dispatched to the main thread (therefore your request handlers may then run on the main thread). 69 | 70 | Login recovery requires FBSDKLoginKit. Login will use FBSDKLoginBehaviorNative and will prompt the user 71 | for all permissions last granted. If any are declined on the new request, the recovery is not successful but 72 | the `[FBSDKAccessToken currentAccessToken]` might still have been updated. 73 | . 74 | */ 75 | @interface FBSDKGraphErrorRecoveryProcessor : NSObject 76 | 77 | /*! 78 | @abstract Gets the delegate. Note this is a strong reference, and is nil'ed out after recovery is complete. 79 | */ 80 | @property (nonatomic, strong, readonly) iddelegate; 81 | 82 | /*! 83 | @abstract Attempts to process the error, return YES if the error can be processed. 84 | @param error the error to process. 85 | @param request the relateed request that may be reissued. 86 | @param delegate the delegate that will be retained until recovery is complete. 87 | */ 88 | - (BOOL)processError:(NSError *)error request:(FBSDKGraphRequest *)request delegate:(id) delegate; 89 | 90 | /*! 91 | @abstract The callback for FBSDKErrorRecoveryAttempting 92 | @param didRecover if the recovery succeeded 93 | @param contextInfo unused 94 | */ 95 | - (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void *)contextInfo; 96 | 97 | @end 98 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKGraphRequest.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | #import 22 | 23 | @class FBSDKAccessToken; 24 | 25 | /*! 26 | @abstract Represents a request to the Facebook Graph API. 27 | 28 | @discussion `FBSDKGraphRequest` encapsulates the components of a request (the 29 | Graph API path, the parameters, error recovery behavior) and should be 30 | used in conjunction with `FBSDKGraphRequestConnection` to issue the request. 31 | 32 | Nearly all Graph APIs require an access token. Unless specified, the 33 | `[FBSDKAccessToken currentAccessToken]` is used. Therefore, most requests 34 | will require login first (see `FBSDKLoginManager` in FBSDKLoginKit.framework). 35 | 36 | A `- start` method is provided for convenience for single requests. 37 | 38 | By default, FBSDKGraphRequest will attempt to recover any errors returned from 39 | Facebook. You can disable this via `disableErrorRecovery:`. 40 | @see FBSDKGraphErrorRecoveryProcessor 41 | */ 42 | @interface FBSDKGraphRequest : NSObject 43 | 44 | /*! 45 | @abstract Initializes a new instance that use use `[FBSDKAccessToken currentAccessToken]`. 46 | @param graphPath the graph path (e.g., @"me"). 47 | @param parameters the optional parameters dictionary. 48 | */ 49 | - (instancetype)initWithGraphPath:(NSString *)graphPath 50 | parameters:(NSDictionary *)parameters; 51 | 52 | /*! 53 | @abstract Initializes a new instance that use use `[FBSDKAccessToken currentAccessToken]`. 54 | @param graphPath the graph path (e.g., @"me"). 55 | @param parameters the optional parameters dictionary. 56 | @param HTTPMethod the optional HTTP method. nil defaults to @"GET". 57 | */ 58 | - (instancetype)initWithGraphPath:(NSString *)graphPath 59 | parameters:(NSDictionary *)parameters 60 | HTTPMethod:(NSString *)HTTPMethod; 61 | 62 | /*! 63 | @abstract Initializes a new instance. 64 | @param graphPath the graph path (e.g., @"me"). 65 | @param parameters the optional parameters dictionary. 66 | @param tokenString the token string to use. Specifying nil will cause no token to be used. 67 | @param version the optional Graph API version (e.g., @"v2.0"). nil defaults to FBSDK_TARGET_PLATFORM_VERSION. 68 | @param HTTPMethod the optional HTTP method (e.g., @"POST"). nil defaults to @"GET". 69 | */ 70 | - (instancetype)initWithGraphPath:(NSString *)graphPath 71 | parameters:(NSDictionary *)parameters 72 | tokenString:(NSString *)tokenString 73 | version:(NSString *)version 74 | HTTPMethod:(NSString *)HTTPMethod 75 | NS_DESIGNATED_INITIALIZER; 76 | 77 | /*! 78 | @abstract The request parameters. 79 | */ 80 | @property (nonatomic, strong, readonly) NSMutableDictionary *parameters; 81 | 82 | /*! 83 | @abstract The access token string used by the request. 84 | */ 85 | @property (nonatomic, copy, readonly) NSString *tokenString; 86 | 87 | /*! 88 | @abstract The Graph API endpoint to use for the request, for example "me". 89 | */ 90 | @property (nonatomic, copy, readonly) NSString *graphPath; 91 | 92 | /*! 93 | @abstract The HTTPMethod to use for the request, for example "GET" or "POST". 94 | */ 95 | @property (nonatomic, copy, readonly) NSString *HTTPMethod; 96 | 97 | /*! 98 | @abstract The Graph API version to use (e.g., "v2.0") 99 | */ 100 | @property (nonatomic, copy, readonly) NSString *version; 101 | 102 | /*! 103 | @abstract If set, disables the automatic error recovery mechanism. 104 | @param disable whether to disable the automatic error recovery mechanism 105 | @discussion By default, non-batched FBSDKGraphRequest instances will automatically try to recover 106 | from errors by constructing a `FBSDKGraphErrorRecoveryProcessor` instance that 107 | re-issues the request on successful recoveries. The re-issued request will call the same 108 | handler as the receiver but may occur with a different `FBSDKGraphRequestConnection` instance. 109 | 110 | This will override [FBSDKSettings setGraphErrorRecoveryDisabled:]. 111 | */ 112 | - (void)setGraphErrorRecoveryDisabled:(BOOL)disable; 113 | 114 | /*! 115 | @abstract Starts a connection to the Graph API. 116 | @param handler The handler block to call when the request completes. 117 | */ 118 | - (FBSDKGraphRequestConnection *)startWithCompletionHandler:(FBSDKGraphRequestHandler)handler; 119 | 120 | @end 121 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKGraphRequestDataAttachment.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | /*! 22 | @abstract A container class for data attachments so that additional metadata can be provided about the attachment. 23 | */ 24 | @interface FBSDKGraphRequestDataAttachment : NSObject 25 | 26 | /*! 27 | @abstract Initializes the receiver with the attachment data and metadata. 28 | @param data The attachment data (retained, not copied) 29 | @param filename The filename for the attachment 30 | @param contentType The content type for the attachment 31 | */ 32 | - (instancetype)initWithData:(NSData *)data 33 | filename:(NSString *)filename 34 | contentType:(NSString *)contentType 35 | NS_DESIGNATED_INITIALIZER; 36 | 37 | /*! 38 | @abstract The content type for the attachment. 39 | */ 40 | @property (nonatomic, copy, readonly) NSString *contentType; 41 | 42 | /*! 43 | @abstract The attachment data. 44 | */ 45 | @property (nonatomic, strong, readonly) NSData *data; 46 | 47 | /*! 48 | @abstract The filename for the attachment. 49 | */ 50 | @property (nonatomic, copy, readonly) NSString *filename; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKMacros.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | #ifdef __cplusplus 22 | #define FBSDK_EXTERN extern "C" __attribute__((visibility ("default"))) 23 | #else 24 | #define FBSDK_EXTERN extern __attribute__((visibility ("default"))) 25 | #endif 26 | 27 | #define FBSDK_STATIC_INLINE static inline 28 | 29 | #define FBSDK_NO_DESIGNATED_INITIALIZER() \ 30 | @throw [NSException exceptionWithName:NSInvalidArgumentException \ 31 | reason:[NSString stringWithFormat:@"unrecognized selector sent to instance %p", self] \ 32 | userInfo:nil] 33 | 34 | #define FBSDK_NOT_DESIGNATED_INITIALIZER(DESIGNATED_INITIALIZER) \ 35 | @throw [NSException exceptionWithName:NSInvalidArgumentException \ 36 | reason:[NSString stringWithFormat:@"Please use the designated initializer [%p %@]", \ 37 | self, \ 38 | NSStringFromSelector(@selector(DESIGNATED_INITIALIZER))] \ 39 | userInfo:nil] 40 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKMutableCopying.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | #import 22 | 23 | /*! 24 | @abstract Extension protocol for NSMutableCopying that adds the mutableCopy method, which is implemented on NSObject. 25 | @discussion NSObject implicitly conforms to this protocol. 26 | */ 27 | @protocol FBSDKMutableCopying 28 | 29 | /*! 30 | @abstract Implemented by NSObject as a convenience to mutableCopyWithZone:. 31 | @return A mutable copy of the receiver. 32 | */ 33 | - (id)mutableCopy; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKProfile.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import "FBSDKMacros.h" 20 | #import "FBSDKProfilePictureView.h" 21 | 22 | /*! 23 | @abstract Notification indicating that the `currentProfile` has changed. 24 | @discussion the userInfo dictionary of the notification will contain keys 25 | `FBSDKProfileChangeOldKey` and 26 | `FBSDKProfileChangeNewKey`. 27 | */ 28 | FBSDK_EXTERN NSString *const FBSDKProfileDidChangeNotification; 29 | 30 | /* @abstract key in notification's userInfo object for getting the old profile. 31 | @discussion If there was no old profile, the key will not be present. 32 | */ 33 | FBSDK_EXTERN NSString *const FBSDKProfileChangeOldKey; 34 | 35 | /* @abstract key in notification's userInfo object for getting the new profile. 36 | @discussion If there is no new profile, the key will not be present. 37 | */ 38 | FBSDK_EXTERN NSString *const FBSDKProfileChangeNewKey; 39 | 40 | /*! 41 | @abstract Represents an immutable Facebook profile 42 | @discussion This class provides a global "currentProfile" instance to more easily 43 | add social context to your application. When the profile changes, a notification is 44 | posted so that you can update relevant parts of your UI and is persisted to NSUserDefaults. 45 | 46 | Typically, you will want to call `enableUpdatesOnAccessTokenChange:YES` so that 47 | it automatically observes changes to the `[FBSDKAccessToken currentAccessToken]`. 48 | 49 | You can use this class to build your own `FBSDKProfilePictureView` or in place of typical requests to "/me". 50 | */ 51 | @interface FBSDKProfile : NSObject 52 | 53 | /*! 54 | @abstract initializes a new instance. 55 | @param userID the user ID 56 | @param firstName the user's first name 57 | @param middleName the user's middle name 58 | @param lastName the user's last name 59 | @param name the user's complete name 60 | @param linkURL the link for this profile 61 | @param refreshDate the optional date this profile was fetched. Defaults to [NSDate date]. 62 | */ 63 | - (instancetype)initWithUserID:(NSString *)userID 64 | firstName:(NSString *)firstName 65 | middleName:(NSString *)middleName 66 | lastName:(NSString *)lastName 67 | name:(NSString *)name 68 | linkURL:(NSURL *)linkURL 69 | refreshDate:(NSDate *)refreshDate NS_DESIGNATED_INITIALIZER; 70 | /*! 71 | @abstract The user id 72 | */ 73 | @property (nonatomic, readonly) NSString *userID; 74 | /*! 75 | @abstract The user's first name 76 | */ 77 | @property (nonatomic, readonly) NSString *firstName; 78 | /*! 79 | @abstract The user's middle name 80 | */ 81 | @property (nonatomic, readonly) NSString *middleName; 82 | /*! 83 | @abstract The user's last name 84 | */ 85 | @property (nonatomic, readonly) NSString *lastName; 86 | /*! 87 | @abstract The user's complete name 88 | */ 89 | @property (nonatomic, readonly) NSString *name; 90 | /*! 91 | @abstract A URL to the user's profile. 92 | @discussion Consider using Bolts and `FBSDKAppLinkResolver` to resolve this 93 | to an app link to link directly to the user's profile in the Facebook app. 94 | */ 95 | @property (nonatomic, readonly) NSURL *linkURL; 96 | 97 | /*! 98 | @abstract The last time the profile data was fetched. 99 | */ 100 | @property (nonatomic, readonly) NSDate *refreshDate; 101 | 102 | /*! 103 | @abstract Gets the current FBSDKProfile instance. 104 | */ 105 | + (FBSDKProfile *)currentProfile; 106 | 107 | /*! 108 | @abstract Sets the current instance and posts the appropriate notification if the profile parameter is different 109 | than the receiver. 110 | @param profile the profile to set 111 | @discussion This persists the profile to NSUserDefaults. 112 | */ 113 | + (void)setCurrentProfile:(FBSDKProfile *)profile; 114 | 115 | /*! 116 | @abstract Indicates if `currentProfile` will automatically observe `FBSDKAccessTokenDidChangeNotification` notifications 117 | @param enable YES is observing 118 | @discussion If observing, this class will issue a graph request for public profile data when the current token's userID 119 | differs from the current profile. You can observe `FBSDKProfileDidChangeNotification` for when the profile is updated. 120 | 121 | Note that if `[FBSDKAccessToken currentAccessToken]` is unset, the `currentProfile` instance remains. It's also possible 122 | for `currentProfile` to return nil until the data is fetched. 123 | */ 124 | + (void)enableUpdatesOnAccessTokenChange:(BOOL)enable; 125 | 126 | /*! 127 | @abstract A convenience method for returning a complete `NSURL` for retrieving the user's profile image. 128 | @param mode The picture mode 129 | @param size The height and width. This will be rounded to integer precision. 130 | */ 131 | - (NSURL *)imageURLForPictureMode:(FBSDKProfilePictureMode)mode size:(CGSize)size; 132 | 133 | /*! 134 | @abstract A convenience method for returning a Graph API path for retrieving the user's profile image. 135 | @deprecated use `imageURLForPictureMode:size:` instead 136 | @discussion You can pass this to a `FBSDKGraphRequest` instance to download the image. 137 | @param mode The picture mode 138 | @param size The height and width. This will be rounded to integer precision. 139 | */ 140 | - (NSString *)imagePathForPictureMode:(FBSDKProfilePictureMode)mode size:(CGSize)size 141 | __attribute__ ((deprecated("use imageURLForPictureMode:size: instead"))); 142 | 143 | /*! 144 | @abstract Returns YES if the profile is equivalent to the receiver. 145 | @param profile the profile to compare to. 146 | */ 147 | - (BOOL)isEqualToProfile:(FBSDKProfile *)profile; 148 | @end 149 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKProfilePictureView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | /*! 22 | @typedef FBSDKProfilePictureMode enum 23 | @abstract Defines the aspect ratio mode for the source image of the profile picture. 24 | */ 25 | typedef NS_ENUM(NSUInteger, FBSDKProfilePictureMode) 26 | { 27 | /*! 28 | @abstract A square cropped version of the image will be included in the view. 29 | */ 30 | FBSDKProfilePictureModeSquare, 31 | /*! 32 | @abstract The original picture's aspect ratio will be used for the source image in the view. 33 | */ 34 | FBSDKProfilePictureModeNormal, 35 | }; 36 | 37 | /*! 38 | @abstract A view to display a profile picture. 39 | */ 40 | @interface FBSDKProfilePictureView : UIView 41 | 42 | /*! 43 | @abstract The mode for the receiver to determine the aspect ratio of the source image. 44 | */ 45 | @property (nonatomic, assign) FBSDKProfilePictureMode pictureMode; 46 | 47 | /*! 48 | @abstract The profile ID to show the picture for. 49 | */ 50 | @property (nonatomic, copy) NSString *profileID; 51 | 52 | /*! 53 | @abstract Explicitly marks the receiver as needing to update the image. 54 | @discussion This method is called whenever any properties that affect the source image are modified, but this can also 55 | be used to trigger a manual update of the image if it needs to be re-downloaded. 56 | */ 57 | - (void)setNeedsImageUpdate; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKTestUsersManager.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | @class FBSDKAccessToken; 22 | 23 | /*! 24 | @typedef 25 | 26 | @abstract Callback block for returning an array of FBSDKAccessToken instances (and possibly `NSNull` instances); or an error. 27 | */ 28 | typedef void (^FBSDKTestUsersManagerRetrieveTestAccountTokensHandler)(NSArray *tokens, NSError *error) ; 29 | 30 | /*! 31 | @typedef 32 | 33 | @abstract Callback block for removing a test user. 34 | */ 35 | typedef void (^FBSDKTestUsersManagerRemoveTestAccountHandler)(NSError *error) ; 36 | 37 | 38 | /*! 39 | @class FBSDKTestUsersManager 40 | @abstract Provides methods for managing test accounts for testing Facebook integration. 41 | 42 | @discussion Facebook allows developers to create test accounts for testing their applications' 43 | Facebook integration (see https://developers.facebook.com/docs/test_users/). This class 44 | simplifies use of these accounts for writing tests. It is not designed for use in 45 | production application code. 46 | 47 | This class will make Graph API calls on behalf of your app to manage test accounts and requires 48 | an app id and app secret. You will typically use this class to write unit or integration tests. 49 | Make sure you NEVER include your app secret in your production app. 50 | */ 51 | @interface FBSDKTestUsersManager : NSObject 52 | 53 | /*! 54 | @abstract construct or return the shared instance 55 | @param appID the Facebook app id 56 | @param appSecret the Facebook app secret 57 | */ 58 | + (instancetype)sharedInstanceForAppID:(NSString *)appID appSecret:(NSString *)appSecret; 59 | 60 | /*! 61 | @abstract retrieve FBSDKAccessToken instances for test accounts with the specific permissions. 62 | @param arraysOfPermissions an array of permissions sets, such as @[ [NSSet setWithObject:@"email"], [NSSet setWithObject:@"user_birthday"]] 63 | if you needed two test accounts with email and birthday permissions, respectively. You can pass in empty nested sets 64 | if you need two arbitrary test accounts. For convenience, passing nil is treated as @[ [NSSet set] ] 65 | for fetching a single test user. 66 | @param createIfNotFound if YES, new test accounts are created if no test accounts existed that fit the permissions 67 | requirement 68 | @param handler the callback to invoke which will return an array of `FBAccessTokenData` instances or an `NSError`. 69 | If param `createIfNotFound` is NO, the array may contain `[NSNull null]` instances. 70 | 71 | @discussion If you are requesting test accounts with differing number of permissions, try to order 72 | `arrayOfPermissionsArrays` so that the most number of permissions come first to minimize creation of new 73 | test accounts. 74 | */ 75 | - (void)requestTestAccountTokensWithArraysOfPermissions:(NSArray *)arraysOfPermissions 76 | createIfNotFound:(BOOL)createIfNotFound 77 | completionHandler:(FBSDKTestUsersManagerRetrieveTestAccountTokensHandler)handler; 78 | 79 | /*! 80 | @abstract add a test account with the specified permissions 81 | @param permissions the set of permissions, e.g., [NSSet setWithObjects:@"email", @"user_friends"] 82 | @param handler the callback handler 83 | */ 84 | - (void)addTestAccountWithPermissions:(NSSet *)permissions 85 | completionHandler:(FBSDKTestUsersManagerRetrieveTestAccountTokensHandler)handler; 86 | 87 | /*! 88 | @abstract remove a test account for the given user id 89 | @param userId the user id 90 | @param handler the callback handler 91 | */ 92 | - (void)removeTestAccount:(NSString *)userId completionHandler:(FBSDKTestUsersManagerRemoveTestAccountHandler)handler; 93 | 94 | /*! 95 | @abstract Make two test users friends with each other. 96 | @param first the token of the first user 97 | @param second the token of the second user 98 | @param callback the callback handler 99 | */ 100 | - (void)makeFriendsWithFirst:(FBSDKAccessToken *)first second:(FBSDKAccessToken *)second callback:(void (^)(NSError *))callback; 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Headers/FBSDKUtility.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | /*! 22 | @abstract Class to contain common utility methods. 23 | */ 24 | @interface FBSDKUtility : NSObject 25 | 26 | /*! 27 | @abstract Parses a query string into a dictionary. 28 | @param queryString The query string value. 29 | @return A dictionary with the key/value pairs. 30 | */ 31 | + (NSDictionary *)dictionaryWithQueryString:(NSString *)queryString; 32 | 33 | /*! 34 | @abstract Constructs a query string from a dictionary. 35 | @param dictionary The dictionary with key/value pairs for the query string. 36 | @param errorRef If an error occurs, upon return contains an NSError object that describes the problem. 37 | @result Query string representation of the parameters. 38 | */ 39 | + (NSString *)queryStringWithDictionary:(NSDictionary *)dictionary error:(NSError *__autoreleasing *)errorRef; 40 | 41 | /*! 42 | @abstract Decodes a value from an URL. 43 | @param value The value to decode. 44 | @result The decoded value. 45 | */ 46 | + (NSString *)URLDecode:(NSString *)value; 47 | 48 | /*! 49 | @abstract Encodes a value for an URL. 50 | @param value The value to encode. 51 | @result The encoded value. 52 | */ 53 | + (NSString *)URLEncode:(NSString *)value; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/FBSDKCoreKit.framework/Info.plist -------------------------------------------------------------------------------- /FBSDKCoreKit.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module FBSDKCoreKit { 2 | umbrella header "FBSDKCoreKit.h" 3 | 4 | export * 5 | module * { export * } 6 | 7 | explicit module FBSDKButton { 8 | header "FBSDKButton.h" 9 | export * 10 | } 11 | 12 | explicit module FBSDKAppLinkResolver { 13 | header "FBSDKAppLinkResolver.h" 14 | export * 15 | } 16 | 17 | explicit module FBSDKGraphErrorRecoveryProcessor { 18 | header "FBSDKGraphErrorRecoveryProcessor.h" 19 | export * 20 | } 21 | 22 | explicit module FBSDKGraphRequestDataAttachment { 23 | header "FBSDKGraphRequestDataAttachment.h" 24 | export * 25 | } 26 | 27 | explicit module FBSDKTestUsersManager { 28 | header "FBSDKTestUsersManager.h" 29 | export * 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /FBSDKLoginKit.framework/FBSDKLoginKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/FBSDKLoginKit.framework/FBSDKLoginKit -------------------------------------------------------------------------------- /FBSDKLoginKit.framework/Headers/FBSDKLoginButton.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | #import 22 | 23 | #import 24 | 25 | #import "FBSDKTooltipView.h" 26 | 27 | @protocol FBSDKLoginButtonDelegate; 28 | 29 | /*! 30 | @typedef NS_ENUM(NSUInteger, FBSDKLoginButtonTooltipBehavior) 31 | @abstract Indicates the desired login tooltip behavior. 32 | */ 33 | typedef NS_ENUM(NSUInteger, FBSDKLoginButtonTooltipBehavior) 34 | { 35 | /*! The default behavior. The tooltip will only be displayed if 36 | the app is eligible (determined by possible server round trip) */ 37 | FBSDKLoginButtonTooltipBehaviorAutomatic = 0, 38 | /*! Force display of the tooltip (typically for UI testing) */ 39 | FBSDKLoginButtonTooltipBehaviorForceDisplay = 1, 40 | /*! Force disable. In this case you can still exert more refined 41 | control by manually constructing a `FBSDKLoginTooltipView` instance. */ 42 | FBSDKLoginButtonTooltipBehaviorDisable = 2 43 | }; 44 | 45 | /*! 46 | @abstract A button that initiates a log in or log out flow upon tapping. 47 | @discussion `FBSDKLoginButton` works with `[FBSDKAccessToken currentAccessToken]` to 48 | determine what to display, and automatically starts authentication when tapped (i.e., 49 | you do not need to manually subscribe action targets). 50 | 51 | Like `FBSDKLoginManager`, you should make sure your app delegate is connected to 52 | `FBSDKApplicationDelegate` in order for the button's delegate to receive messages. 53 | 54 | `FBSDKLoginButton` has a fixed height, but you may change the width. `initWithFrame:CGRectZero` 55 | will size the button to its minimum frame. 56 | */ 57 | @interface FBSDKLoginButton : FBSDKButton 58 | 59 | /*! 60 | @abstract The default audience to use, if publish permissions are requested at login time. 61 | */ 62 | @property (assign, nonatomic) FBSDKDefaultAudience defaultAudience; 63 | /*! 64 | @abstract Gets or sets the delegate. 65 | */ 66 | @property (weak, nonatomic) IBOutlet id delegate; 67 | /*! 68 | @abstract Gets or sets the login behavior to use 69 | */ 70 | @property (assign, nonatomic) FBSDKLoginBehavior loginBehavior; 71 | /*! 72 | @abstract The publish permissions to request. 73 | 74 | @discussion Use `defaultAudience` to specify the default audience to publish to. 75 | Note this is converted to NSSet and is only 76 | an NSArray for the convenience of literal syntax. 77 | */ 78 | @property (copy, nonatomic) NSArray *publishPermissions; 79 | /*! 80 | @abstract The read permissions to request. 81 | 82 | @discussion Note, that if read permissions are specified, then publish permissions should not be specified. This is converted to NSSet and is only 83 | an NSArray for the convenience of literal syntax. 84 | */ 85 | @property (copy, nonatomic) NSArray *readPermissions; 86 | /*! 87 | @abstract Gets or sets the desired tooltip behavior. 88 | */ 89 | @property (assign, nonatomic) FBSDKLoginButtonTooltipBehavior tooltipBehavior; 90 | /*! 91 | @abstract Gets or sets the desired tooltip color style. 92 | */ 93 | @property (assign, nonatomic) FBSDKTooltipColorStyle tooltipColorStyle; 94 | 95 | @end 96 | 97 | /*! 98 | @protocol 99 | @abstract A delegate for `FBSDKLoginButton` 100 | */ 101 | @protocol FBSDKLoginButtonDelegate 102 | 103 | @required 104 | /*! 105 | @abstract Sent to the delegate when the button was used to login. 106 | @param loginButton the sender 107 | @param result The results of the login 108 | @param error The error (if any) from the login 109 | */ 110 | - (void) loginButton:(FBSDKLoginButton *)loginButton 111 | didCompleteWithResult:(FBSDKLoginManagerLoginResult *)result 112 | error:(NSError *)error; 113 | 114 | /*! 115 | @abstract Sent to the delegate when the button was used to logout. 116 | @param loginButton The button that was clicked. 117 | */ 118 | - (void)loginButtonDidLogOut:(FBSDKLoginButton *)loginButton; 119 | 120 | @optional 121 | /*! 122 | @abstract Sent to the delegate when the button is about to login. 123 | @param loginButton the sender 124 | @return YES if the login should be allowed to proceed, NO otherwise 125 | */ 126 | - (BOOL) loginButtonWillLogin:(FBSDKLoginButton *)loginButton; 127 | 128 | @end 129 | -------------------------------------------------------------------------------- /FBSDKLoginKit.framework/Headers/FBSDKLoginConstants.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | #import 22 | 23 | /*! 24 | @abstract The error domain for all errors from FBSDKLoginKit 25 | @discussion Error codes from the SDK in the range 300-399 are reserved for this domain. 26 | */ 27 | FBSDK_EXTERN NSString *const FBSDKLoginErrorDomain; 28 | 29 | /*! 30 | @typedef NS_ENUM(NSInteger, FBSDKLoginErrorCode) 31 | @abstract Error codes for FBSDKLoginErrorDomain. 32 | */ 33 | typedef NS_ENUM(NSInteger, FBSDKLoginErrorCode) 34 | { 35 | /*! 36 | @abstract Reserved. 37 | */ 38 | FBSDKLoginReservedErrorCode = 300, 39 | /*! 40 | @abstract The error code for unknown errors. 41 | */ 42 | FBSDKLoginUnknownErrorCode, 43 | 44 | /*! 45 | @abstract The user's password has changed and must log in again 46 | */ 47 | FBSDKLoginPasswordChangedErrorCode, 48 | /*! 49 | @abstract The user must log in to their account on www.facebook.com to restore access 50 | */ 51 | FBSDKLoginUserCheckpointedErrorCode, 52 | /*! 53 | @abstract Indicates a failure to request new permissions because the user has changed. 54 | */ 55 | FBSDKLoginUserMismatchErrorCode, 56 | /*! 57 | @abstract The user must confirm their account with Facebook before logging in 58 | */ 59 | FBSDKLoginUnconfirmedUserErrorCode, 60 | 61 | /*! 62 | @abstract The Accounts framework failed without returning an error, indicating the 63 | app's slider in the iOS Facebook Settings (device Settings -> Facebook -> App Name) has 64 | been disabled. 65 | */ 66 | FBSDKLoginSystemAccountAppDisabledErrorCode, 67 | /*! 68 | @abstract An error occurred related to Facebook system Account store 69 | */ 70 | FBSDKLoginSystemAccountUnavailableErrorCode, 71 | /*! 72 | @abstract The login response was missing a valid challenge string. 73 | */ 74 | FBSDKLoginBadChallengeString, 75 | }; 76 | -------------------------------------------------------------------------------- /FBSDKLoginKit.framework/Headers/FBSDKLoginKit.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | -------------------------------------------------------------------------------- /FBSDKLoginKit.framework/Headers/FBSDKLoginManagerLoginResult.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | @class FBSDKAccessToken; 22 | 23 | /*! 24 | @abstract Describes the result of a login attempt. 25 | */ 26 | @interface FBSDKLoginManagerLoginResult : NSObject 27 | 28 | /*! 29 | @abstract the access token. 30 | */ 31 | @property (copy, nonatomic) FBSDKAccessToken *token; 32 | 33 | /*! 34 | @abstract whether the login was cancelled by the user. 35 | */ 36 | @property (readonly, nonatomic) BOOL isCancelled; 37 | 38 | /*! 39 | @abstract the set of permissions granted by the user in the associated request. 40 | @discussion inspect the token's permissions set for a complete list. 41 | */ 42 | @property (copy, nonatomic) NSSet *grantedPermissions; 43 | 44 | /*! 45 | @abstract the set of permissions declined by the user in the associated request. 46 | @discussion inspect the token's permissions set for a complete list. 47 | */ 48 | @property (copy, nonatomic) NSSet *declinedPermissions; 49 | 50 | /*! 51 | @abstract Initializes a new instance. 52 | @param token the access token 53 | @param isCancelled whether the login was cancelled by the user 54 | @param grantedPermissions the set of granted permissions 55 | @param declinedPermissions the set of declined permissions 56 | */ 57 | - (instancetype)initWithToken:(FBSDKAccessToken *)token 58 | isCancelled:(BOOL)isCancelled 59 | grantedPermissions:(NSSet *)grantedPermissions 60 | declinedPermissions:(NSSet *)declinedPermissions 61 | NS_DESIGNATED_INITIALIZER; 62 | @end 63 | -------------------------------------------------------------------------------- /FBSDKLoginKit.framework/Headers/FBSDKLoginTooltipView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | #import 22 | 23 | @protocol FBSDKLoginTooltipViewDelegate; 24 | 25 | /*! 26 | @class FBSDKLoginTooltipView 27 | 28 | @abstract Represents a tooltip to be displayed next to a Facebook login button 29 | to highlight features for new users. 30 | 31 | @discussion The `FBSDKLoginButton` may display this view automatically. If you do 32 | not use the `FBSDKLoginButton`, you can manually call one of the `present*` methods 33 | as appropriate and customize behavior via `FBSDKLoginTooltipViewDelegate` delegate. 34 | 35 | By default, the `FBSDKLoginTooltipView` is not added to the superview until it is 36 | determined the app has migrated to the new login experience. You can override this 37 | (e.g., to test the UI layout) by implementing the delegate or setting `forceDisplay` to YES. 38 | 39 | */ 40 | @interface FBSDKLoginTooltipView : FBSDKTooltipView 41 | 42 | /*! @abstract the delegate */ 43 | @property (nonatomic, assign) id delegate; 44 | 45 | /*! @abstract if set to YES, the view will always be displayed and the delegate's 46 | `loginTooltipView:shouldAppear:` will NOT be called. */ 47 | @property (nonatomic, assign) BOOL forceDisplay; 48 | 49 | @end 50 | 51 | /*! 52 | @protocol 53 | 54 | @abstract 55 | The `FBSDKLoginTooltipViewDelegate` protocol defines the methods used to receive event 56 | notifications from `FBSDKLoginTooltipView` objects. 57 | */ 58 | @protocol FBSDKLoginTooltipViewDelegate 59 | 60 | @optional 61 | 62 | /*! 63 | @abstract 64 | Asks the delegate if the tooltip view should appear 65 | 66 | @param view The tooltip view. 67 | @param appIsEligible The value fetched from the server identifying if the app 68 | is eligible for the new login experience. 69 | 70 | @discussion Use this method to customize display behavior. 71 | */ 72 | - (BOOL)loginTooltipView:(FBSDKLoginTooltipView *)view shouldAppear:(BOOL)appIsEligible; 73 | 74 | /*! 75 | @abstract 76 | Tells the delegate the tooltip view will appear, specifically after it's been 77 | added to the super view but before the fade in animation. 78 | 79 | @param view The tooltip view. 80 | */ 81 | - (void)loginTooltipViewWillAppear:(FBSDKLoginTooltipView *)view; 82 | 83 | /*! 84 | @abstract 85 | Tells the delegate the tooltip view will not appear (i.e., was not 86 | added to the super view). 87 | 88 | @param view The tooltip view. 89 | */ 90 | - (void)loginTooltipViewWillNotAppear:(FBSDKLoginTooltipView *)view; 91 | 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /FBSDKLoginKit.framework/Headers/FBSDKTooltipView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 2 | // 3 | // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | // copy, modify, and distribute this software in source code or binary form for use 5 | // in connection with the web services and APIs provided by Facebook. 6 | // 7 | // As with any software that integrates with the Facebook platform, your use of 8 | // this software is subject to the Facebook Developer Principles and Policies 9 | // [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | // included in all copies or substantial portions of the software. 11 | // 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | #import 20 | 21 | /*! 22 | @typedef FBSDKTooltipViewArrowDirection enum 23 | 24 | @abstract 25 | Passed on construction to determine arrow orientation. 26 | */ 27 | typedef NS_ENUM(NSUInteger, FBSDKTooltipViewArrowDirection) 28 | { 29 | /*! View is located above given point, arrow is pointing down. */ 30 | FBSDKTooltipViewArrowDirectionDown = 0, 31 | /*! View is located below given point, arrow is pointing up. */ 32 | FBSDKTooltipViewArrowDirectionUp = 1, 33 | }; 34 | 35 | /*! 36 | @typedef FBSDKTooltipColorStyle enum 37 | 38 | @abstract 39 | Passed on construction to determine color styling. 40 | */ 41 | typedef NS_ENUM(NSUInteger, FBSDKTooltipColorStyle) 42 | { 43 | /*! Light blue background, white text, faded blue close button. */ 44 | FBSDKTooltipColorStyleFriendlyBlue = 0, 45 | /*! Dark gray background, white text, light gray close button. */ 46 | FBSDKTooltipColorStyleNeutralGray = 1, 47 | }; 48 | 49 | /*! 50 | @class FBSDKTooltipView 51 | 52 | @abstract 53 | Tooltip bubble with text in it used to display tips for UI elements, 54 | with a pointed arrow (to refer to the UI element). 55 | 56 | @discussion 57 | The tooltip fades in and will automatically fade out. See `displayDuration`. 58 | */ 59 | @interface FBSDKTooltipView : UIView 60 | 61 | /*! 62 | @abstract Gets or sets the amount of time in seconds the tooltip should be displayed. 63 | 64 | @discussion Set this to zero to make the display permanent until explicitly dismissed. 65 | Defaults to six seconds. 66 | */ 67 | @property (nonatomic, assign) CFTimeInterval displayDuration; 68 | 69 | /*! 70 | @abstract Gets or sets the color style after initialization. 71 | 72 | @discussion Defaults to value passed to -initWithTagline:message:colorStyle:. 73 | */ 74 | @property (nonatomic, assign) FBSDKTooltipColorStyle colorStyle; 75 | 76 | /*! 77 | @abstract Gets or sets the message. 78 | */ 79 | @property (nonatomic, copy) NSString *message; 80 | 81 | /*! 82 | @abstract Gets or sets the optional phrase that comprises the first part of the label (and is highlighted differently). 83 | */ 84 | @property (nonatomic, copy) NSString *tagline; 85 | 86 | /*! 87 | @abstract 88 | Designated initializer. 89 | 90 | @param tagline First part of the label, that will be highlighted with different color. Can be nil. 91 | 92 | @param message Main message to display. 93 | 94 | @param colorStyle Color style to use for tooltip. 95 | 96 | @discussion 97 | If you need to show a tooltip for login, consider using the `FBSDKLoginTooltipView` view. 98 | 99 | @see FBSDKLoginTooltipView 100 | */ 101 | - (instancetype)initWithTagline:(NSString *)tagline message:(NSString *)message colorStyle:(FBSDKTooltipColorStyle)colorStyle; 102 | 103 | /*! 104 | @abstract 105 | Show tooltip at the top or at the bottom of given view. 106 | Tooltip will be added to anchorView.window.rootViewController.view 107 | 108 | @param anchorView view to show at, must be already added to window view hierarchy, in order to decide 109 | where tooltip will be shown. (If there's not enough space at the top of the anchorView in window bounds - 110 | tooltip will be shown at the bottom of it) 111 | 112 | @discussion 113 | Use this method to present the tooltip with automatic positioning or 114 | use -presentInView:withArrowPosition:direction: for manual positioning 115 | If anchorView is nil or has no window - this method does nothing. 116 | */ 117 | - (void)presentFromView:(UIView *)anchorView; 118 | 119 | /*! 120 | @abstract 121 | Adds tooltip to given view, with given position and arrow direction. 122 | 123 | @param view View to be used as superview. 124 | 125 | @param arrowPosition Point in view's cordinates, where arrow will be pointing 126 | 127 | @param arrowDirection whenever arrow should be pointing up (message bubble is below the arrow) or 128 | down (message bubble is above the arrow). 129 | */ 130 | - (void)presentInView:(UIView *)view withArrowPosition:(CGPoint)arrowPosition direction:(FBSDKTooltipViewArrowDirection)arrowDirection; 131 | 132 | /*! 133 | @abstract 134 | Remove tooltip manually. 135 | 136 | @discussion 137 | Calling this method isn't necessary - tooltip will dismiss itself automatically after the `displayDuration`. 138 | */ 139 | - (void)dismiss; 140 | 141 | @end 142 | -------------------------------------------------------------------------------- /FBSDKLoginKit.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/FBSDKLoginKit.framework/Info.plist -------------------------------------------------------------------------------- /FBSDKLoginKit.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module FBSDKLoginKit { 2 | umbrella header "FBSDKLoginKit.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Fabric.framework/Fabric: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/Fabric.framework/Fabric -------------------------------------------------------------------------------- /Fabric.framework/Headers/FABAttributes.h: -------------------------------------------------------------------------------- 1 | // 2 | // FABAttributes.h 3 | // Fabric 4 | // 5 | // Copyright (C) 2015 Twitter, Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #pragma once 21 | 22 | #define FAB_UNAVAILABLE(x) __attribute__((unavailable(x))) 23 | 24 | #if __has_feature(nullability) 25 | #define fab_nullable nullable 26 | #define fab_nonnull nonnull 27 | #define fab_null_unspecified null_unspecified 28 | #define fab_null_resettable null_resettable 29 | #define __fab_nullable __nullable 30 | #define __fab_nonnull __nonnull 31 | #define __fab_null_unspecified __null_unspecified 32 | #else 33 | #define fab_nullable 34 | #define fab_nonnull 35 | #define fab_null_unspecified 36 | #define fab_null_resettable 37 | #define __fab_nullable 38 | #define __fab_nonnull 39 | #define __fab_null_unspecified 40 | #endif 41 | 42 | #ifndef NS_ASSUME_NONNULL_BEGIN 43 | #define NS_ASSUME_NONNULL_BEGIN 44 | #endif 45 | 46 | #ifndef NS_ASSUME_NONNULL_END 47 | #define NS_ASSUME_NONNULL_END 48 | #endif 49 | 50 | 51 | /** 52 | * The following macros are defined here to provide 53 | * backwards compatability. If you are still using 54 | * them you should migrate to the new versions that 55 | * are defined above. 56 | */ 57 | #define FAB_NONNULL __fab_nonnull 58 | #define FAB_NULLABLE __fab_nullable 59 | #define FAB_START_NONNULL NS_ASSUME_NONNULL_BEGIN 60 | #define FAB_END_NONNULL NS_ASSUME_NONNULL_END 61 | -------------------------------------------------------------------------------- /Fabric.framework/Headers/Fabric.h: -------------------------------------------------------------------------------- 1 | // 2 | // Fabric.h 3 | // Fabric 4 | // 5 | // Copyright (C) 2015 Twitter, Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | #import 21 | #import "FABAttributes.h" 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | #if TARGET_OS_IPHONE 26 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < 60000 27 | #error "Fabric's minimum iOS version is 6.0" 28 | #endif 29 | #else 30 | #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070 31 | #error "Fabric's minimum OS X version is 10.7" 32 | #endif 33 | #endif 34 | 35 | /** 36 | * Fabric Base. Coordinates configuration and starts all provided kits. 37 | */ 38 | @interface Fabric : NSObject 39 | 40 | /** 41 | * Initialize Fabric and all provided kits. Call this method within your App Delegate's `application:didFinishLaunchingWithOptions:` and provide the kits you wish to use. 42 | * 43 | * For example, in Objective-C: 44 | * 45 | * `[Fabric with:@[[Crashlytics class], [Twitter class], [Digits class], [MoPub class]]];` 46 | * 47 | * Swift: 48 | * 49 | * `Fabric.with([Crashlytics.self(), Twitter.self(), Digits.self(), MoPub.self()])` 50 | * 51 | * Only the first call to this method is honored. Subsequent calls are no-ops. 52 | * 53 | * @param kitClasses An array of kit Class objects 54 | * 55 | * @return Returns the shared Fabric instance. In most cases this can be ignored. 56 | */ 57 | + (instancetype)with:(NSArray *)kitClasses; 58 | 59 | /** 60 | * Returns the Fabric singleton object. 61 | */ 62 | + (instancetype)sharedSDK; 63 | 64 | /** 65 | * This BOOL enables or disables debug logging, such as kit version information. The default value is NO. 66 | */ 67 | @property (nonatomic, assign) BOOL debug; 68 | 69 | /** 70 | * Unavailable. Use `+sharedSDK` to retrieve the shared Fabric instance. 71 | */ 72 | - (id)init FAB_UNAVAILABLE("Use +sharedSDK to retrieve the shared Fabric instance."); 73 | 74 | @end 75 | 76 | NS_ASSUME_NONNULL_END 77 | 78 | -------------------------------------------------------------------------------- /Fabric.framework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 14F1021 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Fabric 11 | CFBundleIdentifier 12 | io.fabric.sdk.ios 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Fabric 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.6.4 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | iPhoneOS 26 | 27 | CFBundleVersion 28 | 45 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 13B137 33 | DTPlatformName 34 | iphoneos 35 | DTPlatformVersion 36 | 9.1 37 | DTSDKBuild 38 | 13B137 39 | DTSDKName 40 | iphoneos9.1 41 | DTXcode 42 | 0710 43 | DTXcodeBuild 44 | 7B91b 45 | MinimumOSVersion 46 | 6.0 47 | NSHumanReadableCopyright 48 | Copyright © 2015 Twitter. All rights reserved. 49 | UIDeviceFamily 50 | 51 | 1 52 | 2 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Fabric.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Fabric { 2 | umbrella header "Fabric.h" 3 | 4 | export * 5 | module * { export * } 6 | } -------------------------------------------------------------------------------- /Fabric.framework/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # run 4 | # 5 | # Copyright (c) 2015 Crashlytics. All rights reserved. 6 | 7 | # Figure out where we're being called from 8 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 9 | 10 | # Quote path in case of spaces or special chars 11 | DIR="\"${DIR}" 12 | 13 | PATH_SEP="/" 14 | VALIDATE_COMMAND="uploadDSYM\" $@ validate run-script" 15 | UPLOAD_COMMAND="uploadDSYM\" $@ run-script" 16 | 17 | # Ensure params are as expected, run in sync mode to validate 18 | eval $DIR$PATH_SEP$VALIDATE_COMMAND 19 | return_code=$? 20 | 21 | if [[ $return_code != 0 ]]; then 22 | exit $return_code 23 | fi 24 | 25 | # Verification passed, upload dSYM in background to prevent Xcode from waiting 26 | # Note: Validation is performed again before upload. 27 | # Output can still be found in Console.app 28 | eval $DIR$PATH_SEP$UPLOAD_COMMAND > /dev/null 2>&1 & 29 | -------------------------------------------------------------------------------- /Fabric.framework/uploadDSYM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/Fabric.framework/uploadDSYM -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | This is an iOS app that uses [neural-style](https://github.com/jcjohnson/neural-style) to apply a style from one image (usually a painting) to another image (usually a photograph). 3 | 4 | It's built on top of [Couchbase Lite iOS](https://github.com/couchbase/couchbase-lite-ios) and the open source [Couchbase Mobile](http://mobile.couchbase.com) mobile database product suite. 5 | 6 | 7 | 8 | 9 | ## Pre-requisites to build 10 | 11 | * Xcode 7 12 | * [Carthage](https://github.com/Carthage/Carthage) 13 | 14 | ## Instructions to build 15 | 16 | Clone the repo: 17 | 18 | ``` 19 | $ git clone 20 | ``` 21 | 22 | Install Carthage: 23 | 24 | ``` 25 | $ brew install carthage 26 | ``` 27 | 28 | Get the Carthage dependencies: 29 | 30 | ``` 31 | $ carthage bootstrap 32 | ``` 33 | 34 | Add the following environment variables to your `~/.bash_profile`: 35 | 36 | ``` 37 | export DEEPSTYLE_FB_APP_ID= 38 | export DEEPSTYLE_FABRIC_APP_ID= 39 | export DEEPSTYLE_FABRIC_APP_SECRET= 40 | ``` 41 | 42 | Open XCode and build. 43 | 44 | 45 | ## Deploying 46 | 47 | * Install [Couchbase Sync Gateway](https://github.com/couchbase/sync_gateway) and use [this Sync Gateway config](https://github.com/tleyden/deepstyle/blob/master/docs/sync-gateway-config.json) 48 | * Install the [accompanying backend module](https://github.com/tleyden/deepstyle) 49 | 50 | -------------------------------------------------------------------------------- /libCBLForestDBStorage.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/libCBLForestDBStorage.a -------------------------------------------------------------------------------- /screenshots/add_image_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/screenshots/add_image_1.png -------------------------------------------------------------------------------- /screenshots/add_image_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/screenshots/add_image_2.png -------------------------------------------------------------------------------- /screenshots/deepstyle_screenshots_animated.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/screenshots/deepstyle_screenshots_animated.gif -------------------------------------------------------------------------------- /screenshots/fb_login_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/screenshots/fb_login_1.png -------------------------------------------------------------------------------- /screenshots/fb_login_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/screenshots/fb_login_2.png -------------------------------------------------------------------------------- /screenshots/share_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/screenshots/share_view.png -------------------------------------------------------------------------------- /screenshots/single_image_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/screenshots/single_image_view.png -------------------------------------------------------------------------------- /screenshots/table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/screenshots/table.png -------------------------------------------------------------------------------- /screenshots/three_image_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tleyden/deepstyle-ios/169d70f6f1d51394154435c6102310c5bfa0ec44/screenshots/three_image_view.png --------------------------------------------------------------------------------