@@ -845,7 +845,7 @@ - (void)createViews
845
845
self.spinner .userInteractionEnabled = NO ;
846
846
[self .spinner stopAnimating ];
847
847
848
- self.closeButton = [[UIBarButtonItem alloc ] initWithTitle: @" 닫기 " style: UIBarButtonItemStylePlain target: self action: @selector (close )];
848
+ self.closeButton = [[UIBarButtonItem alloc ] initWithTitle: @" Close " style: UIBarButtonItemStylePlain target: self action: @selector (close )];
849
849
self.closeButton .enabled = YES ;
850
850
if (_browserOptions.navigationbuttoncolor != nil ) { // Set button color if user sets it in options
851
851
self.closeButton .tintColor = [self colorFromHexString: _browserOptions.navigationbuttoncolor];
@@ -962,7 +962,15 @@ - (id)createNavigationViewContoller {
962
962
[nav.navigationBar setBackgroundImage: image forBarMetrics: UIBarMetricsDefault];
963
963
964
964
if (_browserOptions.toolbarcolor != nil ) {
965
- nav.navigationBar .barTintColor = [self colorFromHexString: _browserOptions.toolbarcolor];
965
+ if (@available (iOS 13.0 , *)) {
966
+ UINavigationBarAppearance* navBarAppearance = [self .navigationController.navigationBar standardAppearance ];
967
+ [navBarAppearance configureWithOpaqueBackground ];
968
+ navBarAppearance.backgroundColor = [self colorFromHexString: _browserOptions.toolbarcolor];
969
+ nav.navigationBar .standardAppearance = navBarAppearance;
970
+ nav.navigationBar .scrollEdgeAppearance = navBarAppearance;
971
+ } else {
972
+ nav.navigationBar .barTintColor = [self colorFromHexString: _browserOptions.toolbarcolor];
973
+ }
966
974
}
967
975
nav.modalPresentationStyle = self.modalPresentationStyle ;
968
976
nav.presentationController .delegate = self;
@@ -1234,7 +1242,16 @@ - (void) rePositionViews {
1234
1242
self.navigationController .navigationBar .shadowImage = image;
1235
1243
[self .navigationController.navigationBar setBackgroundImage: image forBarMetrics: UIBarMetricsDefault];
1236
1244
if (_browserOptions.toolbarcolor != nil ) {
1237
- self.navigationController .navigationBar .barTintColor = [self colorFromHexString: _browserOptions.toolbarcolor];
1245
+ if (@available (iOS 13.0 , *)) {
1246
+ UINavigationBarAppearance* navBarAppearance = [self .navigationController.navigationBar standardAppearance ];
1247
+ [navBarAppearance configureWithOpaqueBackground ];
1248
+ navBarAppearance.backgroundColor = [self colorFromHexString: _browserOptions.toolbarcolor];
1249
+ self.navigationController .navigationBar .standardAppearance = navBarAppearance;
1250
+ self.navigationController .navigationBar .scrollEdgeAppearance = navBarAppearance;
1251
+ } else {
1252
+ self.navigationController .navigationBar .barTintColor = [self colorFromHexString: _browserOptions.toolbarcolor];
1253
+ }
1254
+
1238
1255
}
1239
1256
1240
1257
self.navigationController .navigationBar .tintColor = [UIColor whiteColor ];
@@ -1243,7 +1260,7 @@ - (void) rePositionViews {
1243
1260
1244
1261
self.navigationController .navigationBar .titleTextAttributes = @{NSFontAttributeName : [UIFont systemFontOfSize: 14 ], NSForegroundColorAttributeName : [UIColor colorWithWhite: 1.0 alpha: 0.45 ]};
1245
1262
self.navigationItem .leftBarButtonItems = @[self .closeButton];
1246
- self.navigationItem .rightBarButtonItems = @[self .shareButton, self .forwardButton, fixedSpaceButton, self .backButton ];
1263
+ self.navigationItem .rightBarButtonItems = @[self .shareButton];
1247
1264
1248
1265
UILabel *label = [[UILabel alloc ] initWithFrame: CGRectZero];
1249
1266
label.textColor = [UIColor colorWithWhite: 1.0 alpha: 0.45 ];
@@ -1312,7 +1329,17 @@ - (void)webView:(WKWebView *)theWebView didFinishNavigation:(WKNavigation *)navi
1312
1329
[self .spinner stopAnimating ];
1313
1330
// custom
1314
1331
UILabel *label = (UILabel *)self.navigationItem .titleView ;
1315
- label.text = [self .currentURL absoluteString ];
1332
+
1333
+ // Extract the domain from the URL
1334
+ NSString *urlString = [self .currentURL absoluteString ];
1335
+ NSURL *url = [NSURL URLWithString: urlString];
1336
+ NSString *domain = url.host ;
1337
+
1338
+ // Remove "www." if it exists in the domain
1339
+ domain = [domain stringByReplacingOccurrencesOfString: @" www." withString: @" " ];
1340
+
1341
+ // Set the domain as the text for the label
1342
+ label.text = domain;
1316
1343
[label sizeToFit ];
1317
1344
1318
1345
[self .navigationDelegate didFinishNavigation: theWebView];
0 commit comments