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 |
*/ |
|
43 |
@interface BFAppLinkReturnToRefererController : NSObject <BFAppLinkReturnToRefererViewDelegate> |
|
44 |
|
|
45 |
/*! |
|
46 |
The delegate that will be notified when the user navigates back to the referer. |
|
47 |
*/ |
|
48 |
@property (nonatomic, weak) id<BFAppLinkReturnToRefererControllerDelegate> delegate; |
|
49 |
|
|
50 |
/*! |
|
51 |
The BFAppLinkReturnToRefererView this controller is controlling. |
|
52 |
*/ |
|
53 |
@property (nonatomic, strong) BFAppLinkReturnToRefererView *view; |
|
54 |
|
|
55 |
/*! |
|
56 |
Initializes a controller suitable for controlling a BFAppLinkReturnToRefererView that is to be displayed |
|
57 |
contained within another UIView (i.e., not displayed above the navigation bar). |
|
58 |
*/ |
|
59 |
- (instancetype)init; |
|
60 |
|
|
61 |
/*! |
|
62 |
Initializes a controller suitable for controlling a BFAppLinkReturnToRefererView that is to be displayed |
|
63 |
displayed above the navigation bar. |
|
64 |
*/ |
|
65 |
- (instancetype)initForDisplayAboveNavController:(UINavigationController *)navController; |
|
66 |
|
|
67 |
/*! |
|
68 |
Removes the view entirely from the navigation controller it is currently displayed in. |
|
69 |
*/ |
|
70 |
- (void)removeFromNavController; |
|
71 |
|
|
72 |
/*! |
|
73 |
Shows the BFAppLinkReturnToRefererView with the specified referer information. If nil or missing data, |
|
74 |
the view will not be displayed. */ |
|
75 |
- (void)showViewForRefererAppLink:(BFAppLink *)refererAppLink; |
|
76 |
|
|
77 |
/*! |
|
78 |
Shows the BFAppLinkReturnToRefererView with referer information extracted from the specified URL. |
|
79 |
If nil or missing referer App Link data, the view will not be displayed. */ |
|
80 |
- (void)showViewForRefererURL:(NSURL *)url; |
|
81 |
|
|
82 |
/*! |
|
83 |
Closes the view, possibly animating it. |
|
84 |
*/ |
|
85 |
- (void)closeViewAnimated:(BOOL)animated; |
|
86 |
|
|
87 |
@end |