commit | author | age
|
bad748
|
1 |
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
W |
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 <UIKit/UIKit.h> |
|
20 |
|
|
21 |
#import <FBSDKLoginKit/FBSDKTooltipView.h> |
|
22 |
|
|
23 |
@protocol FBSDKLoginTooltipViewDelegate; |
|
24 |
|
9febd9
|
25 |
/** |
bad748
|
26 |
|
9febd9
|
27 |
Represents a tooltip to be displayed next to a Facebook login button |
bad748
|
28 |
to highlight features for new users. |
W |
29 |
|
9febd9
|
30 |
|
W |
31 |
The `FBSDKLoginButton` may display this view automatically. If you do |
bad748
|
32 |
not use the `FBSDKLoginButton`, you can manually call one of the `present*` methods |
W |
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 |
|
9febd9
|
42 |
/** the delegate */ |
W |
43 |
@property (nonatomic, weak) id<FBSDKLoginTooltipViewDelegate> delegate; |
bad748
|
44 |
|
9febd9
|
45 |
/** if set to YES, the view will always be displayed and the delegate's |
bad748
|
46 |
`loginTooltipView:shouldAppear:` will NOT be called. */ |
W |
47 |
@property (nonatomic, assign) BOOL forceDisplay; |
|
48 |
|
|
49 |
@end |
|
50 |
|
9febd9
|
51 |
/** |
bad748
|
52 |
@protocol |
W |
53 |
|
9febd9
|
54 |
The `FBSDKLoginTooltipViewDelegate` protocol defines the methods used to receive event |
bad748
|
55 |
notifications from `FBSDKLoginTooltipView` objects. |
W |
56 |
*/ |
|
57 |
@protocol FBSDKLoginTooltipViewDelegate <NSObject> |
|
58 |
|
|
59 |
@optional |
|
60 |
|
9febd9
|
61 |
/** |
W |
62 |
Asks the delegate if the tooltip view should appear |
bad748
|
63 |
|
9febd9
|
64 |
- Parameter view: The tooltip view. |
W |
65 |
- Parameter appIsEligible: The value fetched from the server identifying if the app |
bad748
|
66 |
is eligible for the new login experience. |
W |
67 |
|
9febd9
|
68 |
|
W |
69 |
Use this method to customize display behavior. |
bad748
|
70 |
*/ |
W |
71 |
- (BOOL)loginTooltipView:(FBSDKLoginTooltipView *)view shouldAppear:(BOOL)appIsEligible; |
|
72 |
|
9febd9
|
73 |
/** |
W |
74 |
Tells the delegate the tooltip view will appear, specifically after it's been |
bad748
|
75 |
added to the super view but before the fade in animation. |
W |
76 |
|
9febd9
|
77 |
- Parameter view: The tooltip view. |
bad748
|
78 |
*/ |
W |
79 |
- (void)loginTooltipViewWillAppear:(FBSDKLoginTooltipView *)view; |
|
80 |
|
9febd9
|
81 |
/** |
W |
82 |
Tells the delegate the tooltip view will not appear (i.e., was not |
bad748
|
83 |
added to the super view). |
W |
84 |
|
9febd9
|
85 |
- Parameter view: The tooltip view. |
bad748
|
86 |
*/ |
W |
87 |
- (void)loginTooltipViewWillNotAppear:(FBSDKLoginTooltipView *)view; |
|
88 |
|
|
89 |
|
|
90 |
@end |