commit | author | age
|
bad748
|
1 |
/* |
W |
2 |
* Copyright (c) 2014, Facebook, Inc. |
|
3 |
* All rights reserved. |
|
4 |
* |
|
5 |
* This source code is licensed under the BSD-style license found in the |
|
6 |
* LICENSE file in the root directory of this source tree. An additional grant |
|
7 |
* of patent rights can be found in the PATENTS file in the same directory. |
|
8 |
* |
|
9 |
*/ |
|
10 |
|
|
11 |
#import <Foundation/Foundation.h> |
|
12 |
#import <UIKit/UIKit.h> |
|
13 |
|
|
14 |
#import <Bolts/BFAppLinkReturnToRefererView.h> |
|
15 |
|
|
16 |
@class BFAppLink; |
|
17 |
@class BFAppLinkReturnToRefererController; |
|
18 |
|
|
19 |
/*! |
|
20 |
Protocol that a class can implement in order to be notified when the user has navigated back |
|
21 |
to the referer of an App Link. |
|
22 |
*/ |
|
23 |
@protocol BFAppLinkReturnToRefererControllerDelegate <NSObject> |
|
24 |
|
|
25 |
@optional |
|
26 |
|
|
27 |
/*! Called when the user has tapped to navigate, but before the navigation has been performed. */ |
|
28 |
- (void)returnToRefererController:(BFAppLinkReturnToRefererController *)controller |
|
29 |
willNavigateToAppLink:(BFAppLink *)appLink; |
|
30 |
|
|
31 |
/*! Called after the navigation has been attempted, with an indication of whether the referer |
|
32 |
app link was successfully opened. */ |
|
33 |
- (void)returnToRefererController:(BFAppLinkReturnToRefererController *)controller |
|
34 |
didNavigateToAppLink:(BFAppLink *)url |
|
35 |
type:(BFAppLinkNavigationType)type; |
|
36 |
|
|
37 |
@end |
|
38 |
|
|
39 |
/*! |
|
40 |
A controller class that implements default behavior for a BFAppLinkReturnToRefererView, including |
|
41 |
the ability to display the view above the navigation bar for navigation-based apps. |
|
42 |
*/ |
13e53a
|
43 |
NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension") |
bad748
|
44 |
@interface BFAppLinkReturnToRefererController : NSObject <BFAppLinkReturnToRefererViewDelegate> |
W |
45 |
|
|
46 |
/*! |
|
47 |
The delegate that will be notified when the user navigates back to the referer. |
|
48 |
*/ |
|
49 |
@property (nonatomic, weak) id<BFAppLinkReturnToRefererControllerDelegate> delegate; |
|
50 |
|
|
51 |
/*! |
|
52 |
The BFAppLinkReturnToRefererView this controller is controlling. |
|
53 |
*/ |
|
54 |
@property (nonatomic, strong) BFAppLinkReturnToRefererView *view; |
|
55 |
|
|
56 |
/*! |
|
57 |
Initializes a controller suitable for controlling a BFAppLinkReturnToRefererView that is to be displayed |
|
58 |
contained within another UIView (i.e., not displayed above the navigation bar). |
|
59 |
*/ |
|
60 |
- (instancetype)init; |
|
61 |
|
|
62 |
/*! |
|
63 |
Initializes a controller suitable for controlling a BFAppLinkReturnToRefererView that is to be displayed |
|
64 |
displayed above the navigation bar. |
|
65 |
*/ |
|
66 |
- (instancetype)initForDisplayAboveNavController:(UINavigationController *)navController; |
|
67 |
|
|
68 |
/*! |
|
69 |
Removes the view entirely from the navigation controller it is currently displayed in. |
|
70 |
*/ |
|
71 |
- (void)removeFromNavController; |
|
72 |
|
|
73 |
/*! |
|
74 |
Shows the BFAppLinkReturnToRefererView with the specified referer information. If nil or missing data, |
|
75 |
the view will not be displayed. */ |
|
76 |
- (void)showViewForRefererAppLink:(BFAppLink *)refererAppLink; |
|
77 |
|
|
78 |
/*! |
|
79 |
Shows the BFAppLinkReturnToRefererView with referer information extracted from the specified URL. |
|
80 |
If nil or missing referer App Link data, the view will not be displayed. */ |
|
81 |
- (void)showViewForRefererURL:(NSURL *)url; |
|
82 |
|
|
83 |
/*! |
|
84 |
Closes the view, possibly animating it. |
|
85 |
*/ |
|
86 |
- (void)closeViewAnimated:(BOOL)animated; |
|
87 |
|
|
88 |
@end |