commit | author | age
|
655e66
|
1 |
/* |
H |
2 |
* Copyright (C) 2017 Twitter, Inc. |
|
3 |
* |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
* |
|
16 |
*/ |
a0a843
|
17 |
|
H |
18 |
#import <TwitterCore/TWTRSession.h> |
655e66
|
19 |
#import <TwitterKit/TWTRTwitter.h> |
a0a843
|
20 |
#import <UIKit/UIKit.h> |
H |
21 |
|
|
22 |
NS_ASSUME_NONNULL_BEGIN |
|
23 |
|
|
24 |
/** |
|
25 |
* A Button which launches the sign in to Twitter flow when tapped. |
|
26 |
*/ |
|
27 |
@interface TWTRLogInButton : UIButton |
|
28 |
|
|
29 |
/** |
|
30 |
* The completion block to be called with a `TWTRSession` if successful, |
|
31 |
* and a `NSError` if logging in failed or was canceled. |
|
32 |
*/ |
|
33 |
@property (nonatomic, copy) TWTRLogInCompletion logInCompletion; |
|
34 |
|
|
35 |
/** |
|
36 |
* Returns a new log in button which launches Twitter log in when tapped and |
|
37 |
* calls `completion` when logging in succeeds or fails. |
|
38 |
* |
655e66
|
39 |
* Internally, this button simply calls `-[TWTRTwitter logInWithCompletion:]`. |
a0a843
|
40 |
* |
H |
41 |
* @param completion The completion to be called with a `TWTRSession` if successful, |
|
42 |
* and a `NSError` if logging in failed or was canceled. |
|
43 |
* @return An initialized `TWTRLogInButton`. |
|
44 |
*/ |
|
45 |
+ (instancetype)buttonWithLogInCompletion:(TWTRLogInCompletion)completion; |
|
46 |
|
|
47 |
@end |
|
48 |
|
|
49 |
NS_ASSUME_NONNULL_END |