|
22 | 22 |
|
23 | 23 | #import <UIKit/UIKit.h> |
24 | 24 |
|
| 25 | +NS_ASSUME_NONNULL_BEGIN |
| 26 | + |
25 | 27 | @interface TOWebViewController : UIViewController <UIWebViewDelegate> |
26 | 28 |
|
27 | 29 | /** |
|
45 | 47 | /** |
46 | 48 | Get/set the current URL being displayed. (Will automatically start loading) |
47 | 49 | */ |
48 | | -@property (nonatomic,strong) NSURL *url; |
| 50 | +@property (nonatomic,strong) NSURL *url; |
49 | 51 |
|
50 | 52 | /** |
51 | 53 | Get/set the request |
52 | 54 | */ |
53 | | -@property (nonatomic,strong) NSMutableURLRequest *urlRequest; |
| 55 | +@property (nonatomic,strong) NSMutableURLRequest *urlRequest; |
54 | 56 |
|
55 | 57 | /** |
56 | 58 | The web view used to display the HTML content. You can access it through this |
57 | 59 | read-only property if you need to anything specific, such as having it execute arbitrary JS code. |
58 | 60 | |
59 | 61 | @warning Usage of the web view's delegate property is reserved by this view controller. Do not set it to another object. |
60 | 62 | */ |
61 | | -@property (nonatomic,readonly) UIWebView *webView; |
| 63 | +@property (nonatomic,readonly) UIWebView *webView; |
62 | 64 |
|
63 | 65 | /** |
64 | 66 | Shows a loading progress bar underneath the top navigation bar. |
65 | 67 | |
66 | 68 | Default value is YES. |
67 | 69 | */ |
68 | | -@property (nonatomic,assign) BOOL showLoadingBar; |
| 70 | +@property (nonatomic,assign) BOOL showLoadingBar; |
69 | 71 |
|
70 | 72 | /** |
71 | 73 | Shows the URL of the web request currently being loaded, before the page's title attribute becomes available. |
72 | 74 | |
73 | 75 | Default value is YES. |
74 | 76 | */ |
75 | | -@property (nonatomic,assign) BOOL showUrlWhileLoading; |
| 77 | +@property (nonatomic,assign) BOOL showUrlWhileLoading; |
76 | 78 |
|
77 | 79 | /** |
78 | 80 | The tint colour of the page loading progress bar. |
|
81 | 83 | |
82 | 84 | Default value is nil. |
83 | 85 | */ |
84 | | -@property (nonatomic,copy) UIColor *loadingBarTintColor; |
| 86 | +@property (nonatomic,copy, nullable) UIColor *loadingBarTintColor; |
85 | 87 |
|
86 | 88 | /** |
87 | 89 | Hides all of the page navigation buttons, and on iPhone, hides the bottom toolbar. |
88 | 90 | |
89 | 91 | Default value is NO. |
90 | 92 | */ |
91 | | -@property (nonatomic,assign) BOOL navigationButtonsHidden; |
| 93 | +@property (nonatomic,assign) BOOL navigationButtonsHidden; |
92 | 94 |
|
93 | 95 | /** |
94 | 96 | An array of `UIBarButtonItem` objects that will be inserted alongside the default navigation |
|
97 | 99 | These buttons will remain visible, even if `navigationButtonsHidden` is set to YES. |
98 | 100 | |
99 | 101 | */ |
100 | | -@property (nonatomic,copy) NSArray *applicationBarButtonItems; |
| 102 | +@property (nonatomic,copy, nullable) NSArray *applicationBarButtonItems; |
101 | 103 |
|
102 | 104 | /** |
103 | 105 | Unlike `applicationBarButtonItems`, `UIBarButtonItem` objects placed set here |
104 | 106 | will ALWAYS remain on the left hand side of this controller's `UINavigationController`. |
105 | 107 | */ |
106 | | -@property (nonatomic, copy) NSArray *applicationLeftBarButtonItems; |
| 108 | +@property (nonatomic, copy, nullable) NSArray *applicationLeftBarButtonItems; |
107 | 109 |
|
108 | 110 | /** |
109 | 111 | An array of `UIBarButtonItem` objects from `applicationBarButtonitems` that will |
110 | 112 | disabled until pages are completely loaded. |
111 | 113 | */ |
112 | | -@property (nonatomic,copy) NSArray *loadCompletedApplicationBarButtonItems; |
| 114 | +@property (nonatomic,copy, nullable) NSArray *loadCompletedApplicationBarButtonItems; |
113 | 115 |
|
114 | 116 | /** |
115 | 117 | Shows the iOS 'Activty' button, which when tapped, presents a series of actions the user may |
116 | 118 | take, including copying the page URL, tweeting the URL, or switching to Safari or Chrome. |
117 | 119 | |
118 | 120 | Default value is YES. |
119 | 121 | */ |
120 | | -@property (nonatomic,assign) BOOL showActionButton; |
| 122 | +@property (nonatomic,assign) BOOL showActionButton; |
121 | 123 |
|
122 | 124 | /** |
123 | 125 | Shows the Done button when presented modally. When tapped, it dismisses the view controller. |
124 | 126 | |
125 | 127 | Default value is YES. |
126 | 128 | */ |
127 | | -@property (nonatomic,assign) BOOL showDoneButton; |
| 129 | +@property (nonatomic,assign) BOOL showDoneButton; |
128 | 130 |
|
129 | 131 | /** |
130 | 132 | If desired, override the title of the system 'Done' button to this string. |
131 | 133 | |
132 | 134 | Default value is nil. |
133 | 135 | */ |
134 | | -@property (nonatomic,copy) NSString *doneButtonTitle; |
| 136 | +@property (nonatomic,copy, nullable) NSString *doneButtonTitle; |
135 | 137 |
|
136 | 138 | /** |
137 | 139 | When web pages are loaded, the view controller's title property will be set to the page's |
138 | 140 | HTML title attribute. |
139 | 141 | |
140 | 142 | Default value is YES. |
141 | 143 | */ |
142 | | -@property (nonatomic,assign) BOOL showPageTitles; |
| 144 | +@property (nonatomic,assign) BOOL showPageTitles; |
143 | 145 |
|
144 | 146 | /** |
145 | 147 | View controller's title property will be set to the page's host. www prefix will be stripped |
146 | 148 | |
147 | 149 | Default value is NO. |
148 | 150 | */ |
149 | | -@property (nonatomic,assign) BOOL showPageHost; |
| 151 | +@property (nonatomic,assign) BOOL showPageHost; |
150 | 152 |
|
151 | 153 | /** |
152 | 154 | Disables the contextual popups that can appear when the user taps and holds on a page link. |
153 | 155 | |
154 | 156 | Default value is NO. |
155 | 157 | */ |
156 | | -@property (nonatomic,assign) BOOL disableContextualPopupMenu; |
| 158 | +@property (nonatomic,assign) BOOL disableContextualPopupMenu; |
157 | 159 |
|
158 | 160 | /** |
159 | 161 | Hides the default system background behind the outer bounds of the webview, and replaces it with |
160 | 162 | a background color derived from the the page content currently being displayed by the web view. |
161 | 163 | |
162 | 164 | Default value is NO. |
163 | 165 | */ |
164 | | -@property (nonatomic,assign) BOOL hideWebViewBoundaries; |
| 166 | +@property (nonatomic,assign) BOOL hideWebViewBoundaries; |
165 | 167 |
|
166 | 168 | /** |
167 | 169 | When the view controller is being presented as a modal popup, this block will be automatically performed |
168 | 170 | right after the view controller is dismissed. |
169 | 171 | */ |
170 | | -@property (nonatomic,copy) void (^modalCompletionHandler)(void); |
| 172 | +@property (nonatomic,copy, nullable) void (^modalCompletionHandler)(void); |
171 | 173 |
|
172 | 174 | /** |
173 | 175 | An optional block that when set, will have each incoming web load request forwarded to it, and can |
174 | 176 | determine whether to let them proceed or not. |
175 | 177 | */ |
176 | | -@property (nonatomic,copy) BOOL (^shouldStartLoadRequestHandler)(NSURLRequest *request, UIWebViewNavigationType navigationType); |
| 178 | +@property (nonatomic,copy, nullable) BOOL (^shouldStartLoadRequestHandler)(NSURLRequest *request, UIWebViewNavigationType navigationType); |
177 | 179 |
|
178 | 180 | /** |
179 | 181 | An optional block that when set, will be triggered if the web view failed to load a frame. |
180 | 182 | */ |
181 | | -@property (nonatomic,copy) void (^didFailLoadWithErrorRequestHandler)(NSError *error); |
| 183 | +@property (nonatomic,copy, nullable) void (^didFailLoadWithErrorRequestHandler)(NSError *error); |
182 | 184 |
|
183 | 185 | /** |
184 | 186 | An optional block that when set, will be triggered each time the web view has finished a load operation. |
185 | 187 | */ |
186 | | -@property (nonatomic,copy) void (^didFinishLoadHandler)(UIWebView *webView); |
| 188 | +@property (nonatomic,copy, nullable) void (^didFinishLoadHandler)(UIWebView *webView); |
187 | 189 |
|
188 | 190 | /** |
189 | 191 | This can be used to override the default tint color of the navigation button icons. |
190 | 192 | This property is mainly for iOS 6 and lower. Where possible, you should use iOS 7's proper color styling |
191 | 193 | system instead. |
192 | 194 | */ |
193 | | -@property (nonatomic,strong) UIColor *buttonTintColor; |
| 195 | +@property (nonatomic,strong, nullable) UIColor *buttonTintColor; |
194 | 196 |
|
195 | 197 | /** |
196 | 198 | On iOS 6 or below, this overrides the default opacity level of the bevel around the navigation buttons. |
197 | 199 | */ |
198 | | -@property (nonatomic,assign) CGFloat buttonBevelOpacity; |
| 200 | +@property (nonatomic,assign) CGFloat buttonBevelOpacity; |
199 | 201 |
|
200 | 202 | @end |
| 203 | + |
| 204 | +NS_ASSUME_NONNULL_END |
0 commit comments