Skip to content

Commit

Permalink
Merge pull request #26 from tentenlee100/master
Browse files Browse the repository at this point in the history
add showsBackgroundLabel
  • Loading branch information
devedbox authored Apr 7, 2017
2 parents d732a25 + 13beb28 commit 56d314e
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 3 deletions.
10 changes: 7 additions & 3 deletions AXWebViewController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
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>"; };
2642E682614F41BF460E7673 /* libPods-AXWebViewController.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AXWebViewController.a"; sourceTree = BUILT_PRODUCTS_DIR; };
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>"; };
A13CC1551E977227003AC1B2 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Main.strings"; sourceTree = "<group>"; };
A13CC1561E977227003AC1B2 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
DCCF48231E7987C9009CF38E /* Swift.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Swift.pdf; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -196,7 +198,7 @@
TargetAttributes = {
01513BEA1C28F70700CB8238 = {
CreatedOnToolsVersion = 7.2;
DevelopmentTeam = TKA48YVS5T;
DevelopmentTeam = E5EPLTYPR9;
};
};
};
Expand Down Expand Up @@ -307,6 +309,7 @@
children = (
01513BF81C28F70700CB8238 /* Base */,
013513EA1D60B83D003BDCEA /* zh-Hans */,
A13CC1551E977227003AC1B2 /* zh-Hant */,
);
name = Main.storyboard;
sourceTree = "<group>";
Expand All @@ -316,6 +319,7 @@
children = (
01513BFD1C28F70700CB8238 /* Base */,
013513EB1D60B83D003BDCEA /* zh-Hans */,
A13CC1561E977227003AC1B2 /* zh-Hant */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
Expand Down Expand Up @@ -408,7 +412,7 @@
baseConfigurationReference = 3B7311EC599653BFAAF42107 /* Pods-AXWebViewController.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = TKA48YVS5T;
DEVELOPMENT_TEAM = E5EPLTYPR9;
INFOPLIST_FILE = AXWebViewController/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -423,7 +427,7 @@
baseConfigurationReference = 0326F0589F0B7F449EE39607 /* Pods-AXWebViewController.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = TKA48YVS5T;
DEVELOPMENT_TEAM = E5EPLTYPR9;
INFOPLIST_FILE = AXWebViewController/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
AXWebViewController.strings
AXWebViewController

Created by devedbox on 16/8/14.
Copyright © 2016年 AiXing. All rights reserved.
*/
"back" = "返回";
"close" = "關閉";
"loading" = "下載中...";
"load failed" = "下載失敗";
"load failed:" = "網頁下載失敗:";
"web page" = "網頁由";
"provided" = "提供";
"browsing the web" = "網頁瀏覽";

"messages" = "來自網頁的消息";
"cancel" = "取消";
"confirm" = "確定";
"input" = "輸入文字";
"terminate" = "網頁結束";

"OpenInChrome" = "在Chrome中打開";
"OpenInSafari" = "在Safari中打開";
2 changes: 2 additions & 0 deletions AXWebViewController/AXWebViewController/AXWebViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ typedef NS_ENUM(NSInteger, AXWebViewControllerNavigationType) {
@property(readonly, nonatomic) NSURL *URL;
/// Shows tool bar.
@property(assign, nonatomic) BOOL showsToolBar;
/// Shows showsBackgroundLabel default YES.
@property(assign, nonatomic) BOOL showsBackgroundLabel;
/// Navigation type.
@property(assign, nonatomic) AXWebViewControllerNavigationType navigationType;
/// Get a instance of `AXWebViewController` by a url string.
Expand Down
10 changes: 10 additions & 0 deletions AXWebViewController/AXWebViewController/AXWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ - (instancetype)initWithURL:(NSURL*)pageURL {
_cachePolicy = NSURLRequestReloadRevalidatingCacheData;
#endif
_showsToolBar = YES;
_showsBackgroundLabel = YES;
}
return self;
}
Expand All @@ -152,6 +153,8 @@ - (instancetype)initWithHTMLString:(NSString *)HTMLString baseURL:(NSURL *)baseU
_cachePolicy = NSURLRequestReloadRevalidatingCacheData;
#endif
_showsToolBar = YES;
_showsBackgroundLabel = YES;

}
return self;
}
Expand Down Expand Up @@ -546,6 +549,7 @@ - (UILabel *)backgroundLabel {
_backgroundLabel.backgroundColor = [UIColor clearColor];
_backgroundLabel.translatesAutoresizingMaskIntoConstraints = NO;
[_backgroundLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
_backgroundLabel.hidden = !self.showsBackgroundLabel;
return _backgroundLabel;
}

Expand Down Expand Up @@ -582,6 +586,7 @@ -(UIPanGestureRecognizer*)swipePanGesture{
return _swipePanGesture;
}
#endif
#pragma mark - Setter
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
- (void)setTimeoutInternal:(NSTimeInterval)timeoutInternal {
_timeoutInternal = timeoutInternal;
Expand All @@ -604,6 +609,11 @@ - (void)setShowsToolBar:(BOOL)showsToolBar {
[self updateToolbarItems];
}
}
- (void)setShowsBackgroundLabel:(BOOL)showsBackgroundLabel{
_backgroundLabel.hidden = !showsBackgroundLabel;
_showsBackgroundLabel = showsBackgroundLabel;
}


#pragma mark - Public
- (void)loadURL:(NSURL *)pageURL {
Expand Down
1 change: 1 addition & 0 deletions AXWebViewController/TableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
case 3: {
AXWebViewController *webVC = [[AXWebViewController alloc] initWithAddress:@"https://github.com/devedbox/AXWebViewController"];
webVC.showsToolBar = NO;
webVC.showsBackgroundLabel = NO;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_9_0
webVC.webView.allowsLinkPreview = YES;
#endif
Expand Down
1 change: 1 addition & 0 deletions AXWebViewController/zh-Hant.lproj/LaunchScreen.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

45 changes: 45 additions & 0 deletions AXWebViewController/zh-Hant.lproj/Main.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

/* Class = "UILabel"; text = "Present"; ObjectID = "58i-qo-HOo"; */
"58i-qo-HOo.text" = "Present";

/* Class = "UILabel"; text = "Github pages of AXWebViewController."; ObjectID = "96P-Cp-yAs"; */
"96P-Cp-yAs.text" = "Github pages of AXWebViewController.";

/* Class = "UITabBarItem"; title = "Item 1"; ObjectID = "E5r-4X-WNV"; */
"E5r-4X-WNV.title" = "Item 1";

/* Class = "UILabel"; text = "Lastest release pages of AXWebViewController."; ObjectID = "IH4-tk-BHC"; */
"IH4-tk-BHC.text" = "Lastest release pages of AXWebViewController.";

/* Class = "UILabel"; text = "File"; ObjectID = "Kda-Lk-aAt"; */
"Kda-Lk-aAt.text" = "File";

/* Class = "UILabel"; text = "push the web view controller in showing file at the bundle."; ObjectID = "LSh-pc-osX"; */
"LSh-pc-osX.text" = "push the web view controller in showing file at the bundle.";

/* Class = "UITabBarItem"; title = "Item"; ObjectID = "O96-bZ-DiV"; */
"O96-bZ-DiV.title" = "Item";

/* Class = "UILabel"; text = "Lastest release"; ObjectID = "Zyx-H3-mt5"; */
"Zyx-H3-mt5.text" = "Lastest release";

/* Class = "UILabel"; text = "Github"; ObjectID = "bBD-du-OYx"; */
"bBD-du-OYx.text" = "Github";

/* Class = "UILabel"; text = "push the web view controller in."; ObjectID = "c1w-bj-kxv"; */
"c1w-bj-kxv.text" = "push the web view controller in.";

/* Class = "UITabBarItem"; title = "Item"; ObjectID = "fZg-v3-Wbd"; */
"fZg-v3-Wbd.title" = "Item";

/* Class = "UILabel"; text = "Push"; ObjectID = "jPO-kr-MDH"; */
"jPO-kr-MDH.text" = "Push";

/* Class = "UITextField"; placeholder = "Input an address."; ObjectID = "mDR-r7-p1o"; */
"mDR-r7-p1o.placeholder" = "Input an address.";

/* Class = "UILabel"; text = "present the web view controller in."; ObjectID = "vDR-sB-qKY"; */
"vDR-sB-qKY.text" = "present the web view controller in.";

/* Class = "UITabBarItem"; title = "Item 2"; ObjectID = "zOo-MN-831"; */
"zOo-MN-831.title" = "Item 2";

0 comments on commit 56d314e

Please sign in to comment.