commit | author | age
|
a0a843
|
1 |
// |
H |
2 |
// TWTRLogInButton.h |
|
3 |
// TwitterKit |
|
4 |
// |
|
5 |
// Copyright (c) 2015 Twitter. All rights reserved. |
|
6 |
// |
|
7 |
|
|
8 |
#import <TwitterCore/TWTRSession.h> |
|
9 |
#import <TwitterKit/Twitter.h> |
|
10 |
#import <UIKit/UIKit.h> |
|
11 |
|
|
12 |
NS_ASSUME_NONNULL_BEGIN |
|
13 |
|
|
14 |
/** |
|
15 |
* A Button which launches the sign in to Twitter flow when tapped. |
|
16 |
*/ |
|
17 |
@interface TWTRLogInButton : UIButton |
|
18 |
|
|
19 |
/** |
|
20 |
* The completion block to be called with a `TWTRSession` if successful, |
|
21 |
* and a `NSError` if logging in failed or was canceled. |
|
22 |
*/ |
|
23 |
@property (nonatomic, copy) TWTRLogInCompletion logInCompletion; |
|
24 |
|
|
25 |
/** |
|
26 |
* Returns a new log in button which launches Twitter log in when tapped and |
|
27 |
* calls `completion` when logging in succeeds or fails. |
|
28 |
* |
|
29 |
* Internally, this button simply calls `-[Twitter logInWithCompletion:]`. |
|
30 |
* |
|
31 |
* @param completion The completion to be called with a `TWTRSession` if successful, |
|
32 |
* and a `NSError` if logging in failed or was canceled. |
|
33 |
* @return An initialized `TWTRLogInButton`. |
|
34 |
*/ |
|
35 |
+ (instancetype)buttonWithLogInCompletion:(TWTRLogInCompletion)completion; |
|
36 |
|
|
37 |
@end |
|
38 |
|
|
39 |
NS_ASSUME_NONNULL_END |