Skip to content

Commit 307e40c

Browse files
committed
Added new property IASKWebViewHideBottomBar to hide the tab bar when pushed
Added an example to all *.plists. See: #504
1 parent 8d38685 commit 307e40c

File tree

8 files changed

+121
-0
lines changed

8 files changed

+121
-0
lines changed

InAppSettingsKitSampleApp/Settings.bundle/Root.inApp.plist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,24 @@
308308
<key>IASKChildTitle</key>
309309
<string></string>
310310
</dict>
311+
<dict>
312+
<key>File</key>
313+
<string>settings_about.html</string>
314+
<key>IASKViewControllerClass</key>
315+
<string>IASKAppSettingsWebViewController</string>
316+
<key>IASKViewControllerSelector</key>
317+
<string>initWithFile:specifier:</string>
318+
<key>Title</key>
319+
<string>WebView without tab bar (when pushed)</string>
320+
<key>IASKSubtitle</key>
321+
<string>use IASKWebViewHideBottomBar</string>
322+
<key>Type</key>
323+
<string>PSChildPaneSpecifier</string>
324+
<key>IASKChildTitle</key>
325+
<string>ABOUT_TITLE</string>
326+
<key>IASKWebViewHideBottomBar</key>
327+
<true/>
328+
</dict>
311329
<dict>
312330
<key>File</key>
313331
<string>https://github.com/futuretap/InAppSettingsKit</string>

InAppSettingsKitSampleApp/Settings.bundle/Root~ipad.inApp.plist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,24 @@
320320
<key>IASKChildTitle</key>
321321
<string>ABOUT_TITLE</string>
322322
</dict>
323+
<dict>
324+
<key>File</key>
325+
<string>settings_about.html</string>
326+
<key>IASKViewControllerClass</key>
327+
<string>IASKAppSettingsWebViewController</string>
328+
<key>IASKViewControllerSelector</key>
329+
<string>initWithFile:specifier:</string>
330+
<key>Title</key>
331+
<string>WebView without tab bar (when pushed)</string>
332+
<key>IASKSubtitle</key>
333+
<string>use IASKWebViewHideBottomBar</string>
334+
<key>Type</key>
335+
<string>PSChildPaneSpecifier</string>
336+
<key>IASKChildTitle</key>
337+
<string>ABOUT_TITLE</string>
338+
<key>IASKWebViewHideBottomBar</key>
339+
<true/>
340+
</dict>
323341
<dict>
324342
<key>File</key>
325343
<string>https://github.com/futuretap/InAppSettingsKit</string>

InAppSettingsKitSampleApp/Settings.bundle/Root~iphone.inApp.plist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,24 @@
320320
<key>IASKChildTitle</key>
321321
<string>ABOUT_TITLE</string>
322322
</dict>
323+
<dict>
324+
<key>File</key>
325+
<string>settings_about.html</string>
326+
<key>IASKViewControllerClass</key>
327+
<string>IASKAppSettingsWebViewController</string>
328+
<key>IASKViewControllerSelector</key>
329+
<string>initWithFile:specifier:</string>
330+
<key>Title</key>
331+
<string>WebView without tab bar (when pushed)</string>
332+
<key>IASKSubtitle</key>
333+
<string>use IASKWebViewHideBottomBar</string>
334+
<key>Type</key>
335+
<string>PSChildPaneSpecifier</string>
336+
<key>IASKChildTitle</key>
337+
<string>ABOUT_TITLE</string>
338+
<key>IASKWebViewHideBottomBar</key>
339+
<true/>
340+
</dict>
323341
<dict>
324342
<key>File</key>
325343
<string>https://github.com/futuretap/InAppSettingsKit</string>

Sources/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ @interface IASKAppSettingsWebViewController()
2424
@property (nonatomic, strong, readwrite) UIProgressView *progressView;
2525
@property (nonatomic, strong, readwrite) NSURL *url;
2626
@property (nonatomic, readwrite) BOOL showProgress;
27+
@property (nonatomic, readwrite) BOOL hideBottomBar;
2728
@end
2829

2930
@implementation IASKAppSettingsWebViewController
@@ -45,6 +46,7 @@ - (id)initWithFile:(NSString*)urlString specifier:(IASKSpecifier*)specifier {
4546
self.customTitle = [specifier localizedObjectForKey:kIASKChildTitle];
4647
self.title = self.customTitle ? : specifier.title;
4748
self.showProgress = [[specifier.specifierDict objectForKey:kIASKWebViewShowProgress] boolValue];
49+
self.hideBottomBar = [[specifier.specifierDict objectForKey:kIASKWebViewHideBottomBar] boolValue];
4850
}
4951
return self;
5052
}
@@ -112,6 +114,11 @@ - (void)loadView {
112114
options:NSKeyValueObservingOptionNew
113115
context:nil];
114116
}
117+
118+
if (self.hideBottomBar) {
119+
// Hide the tab bar when this view is pushed:
120+
self.hidesBottomBarWhenPushed = YES;
121+
}
115122
}
116123

117124
- (void)viewWillAppear:(BOOL)animated {

Sources/InAppSettingsKit/include/IASKSettingsReader.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ NS_ASSUME_NONNULL_BEGIN
152152
*/
153153
#define kIASKWebViewShowProgress @"IASKWebViewShowProgress"
154154

155+
/*
156+
IASKWebViewHideBottomBar can be set if IASKViewControllerClass is set to IASKAppSettingsWebViewController.
157+
If IASKWebViewHideBottomBar is set, it will hide the toolbar at the bottom of the screen when the IASKAppSettingsWebViewController is pushed on to a navigation controller. This will present the WKWebView full screen and prevents situations where the user can navigate the tab bar while the IASKAppSettingsWebViewController stays still present.
158+
*/
159+
#define kIASKWebViewHideBottomBar @"IASKWebViewHideBottomBar"
160+
155161
extern NSString * const IASKSettingChangedNotification;
156162
#define kIASKAppSettingChanged IASKSettingChangedNotification
157163

Tests/InAppSettingsKitTests/Settings.bundle/Root.inApp.plist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,24 @@
292292
<key>Type</key>
293293
<string>PSChildPaneSpecifier</string>
294294
</dict>
295+
<dict>
296+
<key>File</key>
297+
<string>settings_about.html</string>
298+
<key>IASKViewControllerClass</key>
299+
<string>IASKAppSettingsWebViewController</string>
300+
<key>IASKViewControllerSelector</key>
301+
<string>initWithFile:specifier:</string>
302+
<key>Title</key>
303+
<string>WebView without tab bar (when pushed)</string>
304+
<key>IASKSubtitle</key>
305+
<string>use IASKWebViewHideBottomBar</string>
306+
<key>Type</key>
307+
<string>PSChildPaneSpecifier</string>
308+
<key>IASKChildTitle</key>
309+
<string>ABOUT_TITLE</string>
310+
<key>IASKWebViewHideBottomBar</key>
311+
<true/>
312+
</dict>
295313
<dict>
296314
<key>File</key>
297315
<string>https://github.com/futuretap/InAppSettingsKit</string>

Tests/InAppSettingsKitTests/Settings.bundle/Root~ipad.inApp.plist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,24 @@
314314
<key>IASKChildTitle</key>
315315
<string>ABOUT_TITLE</string>
316316
</dict>
317+
<dict>
318+
<key>File</key>
319+
<string>settings_about.html</string>
320+
<key>IASKViewControllerClass</key>
321+
<string>IASKAppSettingsWebViewController</string>
322+
<key>IASKViewControllerSelector</key>
323+
<string>initWithFile:specifier:</string>
324+
<key>Title</key>
325+
<string>WebView without tab bar (when pushed)</string>
326+
<key>IASKSubtitle</key>
327+
<string>use IASKWebViewHideBottomBar</string>
328+
<key>Type</key>
329+
<string>PSChildPaneSpecifier</string>
330+
<key>IASKChildTitle</key>
331+
<string>ABOUT_TITLE</string>
332+
<key>IASKWebViewHideBottomBar</key>
333+
<true/>
334+
</dict>
317335
<dict>
318336
<key>File</key>
319337
<string>https://github.com/futuretap/InAppSettingsKit</string>

Tests/InAppSettingsKitTests/Settings.bundle/Root~iphone.inApp.plist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,24 @@
314314
<key>IASKChildTitle</key>
315315
<string>ABOUT_TITLE</string>
316316
</dict>
317+
<dict>
318+
<key>File</key>
319+
<string>settings_about.html</string>
320+
<key>IASKViewControllerClass</key>
321+
<string>IASKAppSettingsWebViewController</string>
322+
<key>IASKViewControllerSelector</key>
323+
<string>initWithFile:specifier:</string>
324+
<key>Title</key>
325+
<string>WebView without tab bar (when pushed)</string>
326+
<key>IASKSubtitle</key>
327+
<string>use IASKWebViewHideBottomBar</string>
328+
<key>Type</key>
329+
<string>PSChildPaneSpecifier</string>
330+
<key>IASKChildTitle</key>
331+
<string>ABOUT_TITLE</string>
332+
<key>IASKWebViewHideBottomBar</key>
333+
<true/>
334+
</dict>
317335
<dict>
318336
<key>File</key>
319337
<string>https://github.com/futuretap/InAppSettingsKit</string>

0 commit comments

Comments
 (0)