Skip to content

Commit 56d314e

Browse files
authored
Merge pull request #26 from tentenlee100/master
add showsBackgroundLabel
2 parents d732a25 + 13beb28 commit 56d314e

7 files changed

Lines changed: 90 additions & 3 deletions

File tree

AXWebViewController.xcodeproj/project.pbxproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
0326F0589F0B7F449EE39607 /* Pods-AXWebViewController.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AXWebViewController.release.xcconfig"; path = "Pods/Target Support Files/Pods-AXWebViewController/Pods-AXWebViewController.release.xcconfig"; sourceTree = "<group>"; };
5656
2642E682614F41BF460E7673 /* libPods-AXWebViewController.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AXWebViewController.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5757
3B7311EC599653BFAAF42107 /* Pods-AXWebViewController.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AXWebViewController.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AXWebViewController/Pods-AXWebViewController.debug.xcconfig"; sourceTree = "<group>"; };
58+
A13CC1551E977227003AC1B2 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Main.strings"; sourceTree = "<group>"; };
59+
A13CC1561E977227003AC1B2 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
5860
DCCF48231E7987C9009CF38E /* Swift.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Swift.pdf; sourceTree = "<group>"; };
5961
/* End PBXFileReference section */
6062

@@ -196,7 +198,7 @@
196198
TargetAttributes = {
197199
01513BEA1C28F70700CB8238 = {
198200
CreatedOnToolsVersion = 7.2;
199-
DevelopmentTeam = TKA48YVS5T;
201+
DevelopmentTeam = E5EPLTYPR9;
200202
};
201203
};
202204
};
@@ -307,6 +309,7 @@
307309
children = (
308310
01513BF81C28F70700CB8238 /* Base */,
309311
013513EA1D60B83D003BDCEA /* zh-Hans */,
312+
A13CC1551E977227003AC1B2 /* zh-Hant */,
310313
);
311314
name = Main.storyboard;
312315
sourceTree = "<group>";
@@ -316,6 +319,7 @@
316319
children = (
317320
01513BFD1C28F70700CB8238 /* Base */,
318321
013513EB1D60B83D003BDCEA /* zh-Hans */,
322+
A13CC1561E977227003AC1B2 /* zh-Hant */,
319323
);
320324
name = LaunchScreen.storyboard;
321325
sourceTree = "<group>";
@@ -408,7 +412,7 @@
408412
baseConfigurationReference = 3B7311EC599653BFAAF42107 /* Pods-AXWebViewController.debug.xcconfig */;
409413
buildSettings = {
410414
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
411-
DEVELOPMENT_TEAM = TKA48YVS5T;
415+
DEVELOPMENT_TEAM = E5EPLTYPR9;
412416
INFOPLIST_FILE = AXWebViewController/Info.plist;
413417
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
414418
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -423,7 +427,7 @@
423427
baseConfigurationReference = 0326F0589F0B7F449EE39607 /* Pods-AXWebViewController.release.xcconfig */;
424428
buildSettings = {
425429
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
426-
DEVELOPMENT_TEAM = TKA48YVS5T;
430+
DEVELOPMENT_TEAM = E5EPLTYPR9;
427431
INFOPLIST_FILE = AXWebViewController/Info.plist;
428432
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
429433
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
AXWebViewController.strings
3+
AXWebViewController
4+
5+
Created by devedbox on 16/8/14.
6+
Copyright © 2016年 AiXing. All rights reserved.
7+
*/
8+
"back" = "返回";
9+
"close" = "關閉";
10+
"loading" = "下載中...";
11+
"load failed" = "下載失敗";
12+
"load failed:" = "網頁下載失敗:";
13+
"web page" = "網頁由";
14+
"provided" = "提供";
15+
"browsing the web" = "網頁瀏覽";
16+
17+
"messages" = "來自網頁的消息";
18+
"cancel" = "取消";
19+
"confirm" = "確定";
20+
"input" = "輸入文字";
21+
"terminate" = "網頁結束";
22+
23+
"OpenInChrome" = "在Chrome中打開";
24+
"OpenInSafari" = "在Safari中打開";

AXWebViewController/AXWebViewController/AXWebViewController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ typedef NS_ENUM(NSInteger, AXWebViewControllerNavigationType) {
128128
@property(readonly, nonatomic) NSURL *URL;
129129
/// Shows tool bar.
130130
@property(assign, nonatomic) BOOL showsToolBar;
131+
/// Shows showsBackgroundLabel default YES.
132+
@property(assign, nonatomic) BOOL showsBackgroundLabel;
131133
/// Navigation type.
132134
@property(assign, nonatomic) AXWebViewControllerNavigationType navigationType;
133135
/// Get a instance of `AXWebViewController` by a url string.

AXWebViewController/AXWebViewController/AXWebViewController.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ - (instancetype)initWithURL:(NSURL*)pageURL {
130130
_cachePolicy = NSURLRequestReloadRevalidatingCacheData;
131131
#endif
132132
_showsToolBar = YES;
133+
_showsBackgroundLabel = YES;
133134
}
134135
return self;
135136
}
@@ -152,6 +153,8 @@ - (instancetype)initWithHTMLString:(NSString *)HTMLString baseURL:(NSURL *)baseU
152153
_cachePolicy = NSURLRequestReloadRevalidatingCacheData;
153154
#endif
154155
_showsToolBar = YES;
156+
_showsBackgroundLabel = YES;
157+
155158
}
156159
return self;
157160
}
@@ -546,6 +549,7 @@ - (UILabel *)backgroundLabel {
546549
_backgroundLabel.backgroundColor = [UIColor clearColor];
547550
_backgroundLabel.translatesAutoresizingMaskIntoConstraints = NO;
548551
[_backgroundLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
552+
_backgroundLabel.hidden = !self.showsBackgroundLabel;
549553
return _backgroundLabel;
550554
}
551555

@@ -582,6 +586,7 @@ -(UIPanGestureRecognizer*)swipePanGesture{
582586
return _swipePanGesture;
583587
}
584588
#endif
589+
#pragma mark - Setter
585590
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
586591
- (void)setTimeoutInternal:(NSTimeInterval)timeoutInternal {
587592
_timeoutInternal = timeoutInternal;
@@ -604,6 +609,11 @@ - (void)setShowsToolBar:(BOOL)showsToolBar {
604609
[self updateToolbarItems];
605610
}
606611
}
612+
- (void)setShowsBackgroundLabel:(BOOL)showsBackgroundLabel{
613+
_backgroundLabel.hidden = !showsBackgroundLabel;
614+
_showsBackgroundLabel = showsBackgroundLabel;
615+
}
616+
607617

608618
#pragma mark - Public
609619
- (void)loadURL:(NSURL *)pageURL {

AXWebViewController/TableViewController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
6666
case 3: {
6767
AXWebViewController *webVC = [[AXWebViewController alloc] initWithAddress:@"https://github.com/devedbox/AXWebViewController"];
6868
webVC.showsToolBar = NO;
69+
webVC.showsBackgroundLabel = NO;
6970
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_9_0
7071
webVC.webView.allowsLinkPreview = YES;
7172
#endif
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
/* Class = "UILabel"; text = "Present"; ObjectID = "58i-qo-HOo"; */
3+
"58i-qo-HOo.text" = "Present";
4+
5+
/* Class = "UILabel"; text = "Github pages of AXWebViewController."; ObjectID = "96P-Cp-yAs"; */
6+
"96P-Cp-yAs.text" = "Github pages of AXWebViewController.";
7+
8+
/* Class = "UITabBarItem"; title = "Item 1"; ObjectID = "E5r-4X-WNV"; */
9+
"E5r-4X-WNV.title" = "Item 1";
10+
11+
/* Class = "UILabel"; text = "Lastest release pages of AXWebViewController."; ObjectID = "IH4-tk-BHC"; */
12+
"IH4-tk-BHC.text" = "Lastest release pages of AXWebViewController.";
13+
14+
/* Class = "UILabel"; text = "File"; ObjectID = "Kda-Lk-aAt"; */
15+
"Kda-Lk-aAt.text" = "File";
16+
17+
/* Class = "UILabel"; text = "push the web view controller in showing file at the bundle."; ObjectID = "LSh-pc-osX"; */
18+
"LSh-pc-osX.text" = "push the web view controller in showing file at the bundle.";
19+
20+
/* Class = "UITabBarItem"; title = "Item"; ObjectID = "O96-bZ-DiV"; */
21+
"O96-bZ-DiV.title" = "Item";
22+
23+
/* Class = "UILabel"; text = "Lastest release"; ObjectID = "Zyx-H3-mt5"; */
24+
"Zyx-H3-mt5.text" = "Lastest release";
25+
26+
/* Class = "UILabel"; text = "Github"; ObjectID = "bBD-du-OYx"; */
27+
"bBD-du-OYx.text" = "Github";
28+
29+
/* Class = "UILabel"; text = "push the web view controller in."; ObjectID = "c1w-bj-kxv"; */
30+
"c1w-bj-kxv.text" = "push the web view controller in.";
31+
32+
/* Class = "UITabBarItem"; title = "Item"; ObjectID = "fZg-v3-Wbd"; */
33+
"fZg-v3-Wbd.title" = "Item";
34+
35+
/* Class = "UILabel"; text = "Push"; ObjectID = "jPO-kr-MDH"; */
36+
"jPO-kr-MDH.text" = "Push";
37+
38+
/* Class = "UITextField"; placeholder = "Input an address."; ObjectID = "mDR-r7-p1o"; */
39+
"mDR-r7-p1o.placeholder" = "Input an address.";
40+
41+
/* Class = "UILabel"; text = "present the web view controller in."; ObjectID = "vDR-sB-qKY"; */
42+
"vDR-sB-qKY.text" = "present the web view controller in.";
43+
44+
/* Class = "UITabBarItem"; title = "Item 2"; ObjectID = "zOo-MN-831"; */
45+
"zOo-MN-831.title" = "Item 2";

0 commit comments

Comments
 (0)