Skip to content
This repository was archived by the owner on Jan 16, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add Parse/Bolts frameworks for tvOS.
  • Loading branch information
nlutsenko committed Dec 8, 2015
commit e66cec3548a4d913c3d435beafc9edca3b93f732
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ Vendor/Parse.framework
Vendor/Bolts.framework
Vendor/FBSDKCoreKit.framework
Vendor/FBSDKLoginKit.framework

Vendor/tvOS/FBSDKCoreKit.framework
Vendor/tvOS/FBSDKTVOSKit.framework
Binary file added Vendor/tvOS/Bolts.framework/Bolts
Binary file not shown.
42 changes: 42 additions & 0 deletions Vendor/tvOS/Bolts.framework/Headers/BFCancellationToken.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/

#import <Foundation/Foundation.h>

#import <Bolts/BFCancellationTokenRegistration.h>

NS_ASSUME_NONNULL_BEGIN

/*!
A block that will be called when a token is cancelled.
*/
typedef void(^BFCancellationBlock)();

/*!
The consumer view of a CancellationToken.
Propagates notification that operations should be canceled.
A BFCancellationToken has methods to inspect whether the token has been cancelled.
*/
@interface BFCancellationToken : NSObject

/*!
Whether cancellation has been requested for this token source.
*/
@property (nonatomic, assign, readonly, getter=isCancellationRequested) BOOL cancellationRequested;

/*!
Register a block to be notified when the token is cancelled.
If the token is already cancelled the delegate will be notified immediately.
*/
- (BFCancellationTokenRegistration *)registerCancellationObserverWithBlock:(BFCancellationBlock)block;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/*!
Represents the registration of a cancellation observer with a cancellation token.
Can be used to unregister the observer at a later time.
*/
@interface BFCancellationTokenRegistration : NSObject

/*!
Removes the cancellation observer registered with the token
and releases all resources associated with this registration.
*/
- (void)dispose;

@end

NS_ASSUME_NONNULL_END
60 changes: 60 additions & 0 deletions Vendor/tvOS/Bolts.framework/Headers/BFCancellationTokenSource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class BFCancellationToken;

/*!
BFCancellationTokenSource represents the producer side of a CancellationToken.
Signals to a CancellationToken that it should be canceled.
It is a cancellation token that also has methods
for changing the state of a token by cancelling it.
*/
@interface BFCancellationTokenSource : NSObject

/*!
Creates a new cancellation token source.
*/
+ (instancetype)cancellationTokenSource;

/*!
The cancellation token associated with this CancellationTokenSource.
*/
@property (nonatomic, strong, readonly) BFCancellationToken *token;

/*!
Whether cancellation has been requested for this token source.
*/
@property (nonatomic, assign, readonly, getter=isCancellationRequested) BOOL cancellationRequested;

/*!
Cancels the token if it has not already been cancelled.
*/
- (void)cancel;

/*!
Schedules a cancel operation on this CancellationTokenSource after the specified number of milliseconds.
@param millis The number of milliseconds to wait before completing the returned task.
If delay is `0` the cancel is executed immediately. If delay is `-1` any scheduled cancellation is stopped.
*/
- (void)cancelAfterDelay:(int)millis;

/*!
Releases all resources associated with this token source,
including disposing of all registrations.
*/
- (void)dispose;

@end

NS_ASSUME_NONNULL_END
18 changes: 18 additions & 0 deletions Vendor/tvOS/Bolts.framework/Headers/BFDefines.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/

#import <Foundation/Foundation.h>

#if __has_feature(objc_generics) || __has_extension(objc_generics)
# define BF_GENERIC(type) <type>
#else
# define BF_GENERIC(type)
# define BFGenericType id
#endif
62 changes: 62 additions & 0 deletions Vendor/tvOS/Bolts.framework/Headers/BFExecutor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/*!
An object that can run a given block.
*/
@interface BFExecutor : NSObject

/*!
Returns a default executor, which runs continuations immediately until the call stack gets too
deep, then dispatches to a new GCD queue.
*/
+ (instancetype)defaultExecutor;

/*!
Returns an executor that runs continuations on the thread where the previous task was completed.
*/
+ (instancetype)immediateExecutor;

/*!
Returns an executor that runs continuations on the main thread.
*/
+ (instancetype)mainThreadExecutor;

/*!
Returns a new executor that uses the given block to execute continuations.
@param block The block to use.
*/
+ (instancetype)executorWithBlock:(void(^)(void(^block)()))block;

/*!
Returns a new executor that runs continuations on the given queue.
@param queue The instance of `dispatch_queue_t` to dispatch all continuations onto.
*/
+ (instancetype)executorWithDispatchQueue:(dispatch_queue_t)queue;

/*!
Returns a new executor that runs continuations on the given queue.
@param queue The instance of `NSOperationQueue` to run all continuations on.
*/
+ (instancetype)executorWithOperationQueue:(NSOperationQueue *)queue;

/*!
Runs the given block using this executor's particular strategy.
@param block The block to execute.
*/
- (void)execute:(void(^)())block;

@end

NS_ASSUME_NONNULL_END
Loading