diff --git a/AgileWorks/AgileWorks/Main/Builder/MainTabBarViewBuilder.swift b/AgileWorks/AgileWorks/Main/Builder/MainTabBarViewBuilder.swift index 8036bf9bf167dff81674be5c8cf8a33fb9ffdcd6..75fc631d02b0a6e5253e1a54e56f91925951a184 100644 --- a/AgileWorks/AgileWorks/Main/Builder/MainTabBarViewBuilder.swift +++ b/AgileWorks/AgileWorks/Main/Builder/MainTabBarViewBuilder.swift @@ -82,35 +82,35 @@ extension MainTabBarViewBuilderImpl { view.tabBarItem.image = createTabBarItem(imageName: BarItem.home.rawValue, color: normalColor) view.tabBarItem.selectedImage = createTabBarItem(imageName: SelectedBarItem.home.rawValue, color: selectedColor) viewVC.loadURL = createLoadUrl(urlPath: ViewURL.home.rawValue) - viewVC.naviTitle = getDisplayString(key: "HomeTitle", comment: "") + viewVC.navigationItem.title = getDisplayString(key: "HomeTitle", comment: "") viewVC.tabTitleKey = "HomeTitle" case ViewType.work.rawValue: view.tabBarItem.title = getDisplayString(key: "WorkTitle", comment: "") view.tabBarItem.image = createTabBarItem(imageName: BarItem.work.rawValue, color: normalColor) view.tabBarItem.selectedImage = createTabBarItem(imageName: SelectedBarItem.work.rawValue, color: selectedColor) viewVC.loadURL = createLoadUrl(urlPath: ViewURL.work.rawValue) - viewVC.naviTitle = getDisplayString(key: "WorkTitle", comment: "") + viewVC.navigationItem.title = getDisplayString(key: "WorkTitle", comment: "") viewVC.tabTitleKey = "WorkTitle" case ViewType.documents.rawValue: view.tabBarItem.title = getDisplayString(key: "DocumentsTitle", comment: "") view.tabBarItem.image = createTabBarItem(imageName: BarItem.documents.rawValue, color: normalColor) view.tabBarItem.selectedImage = createTabBarItem(imageName: SelectedBarItem.documents.rawValue, color: selectedColor) viewVC.loadURL = createLoadUrl(urlPath: ViewURL.documents.rawValue) - viewVC.naviTitle = getDisplayString(key: "DocumentsTitle", comment: "") + viewVC.navigationItem.title = getDisplayString(key: "DocumentsTitle", comment: "") viewVC.tabTitleKey = "DocumentsTitle" case ViewType.search.rawValue: view.tabBarItem.title = getDisplayString(key: "SearchTitle", comment: "") view.tabBarItem.image = createTabBarItem(imageName: BarItem.search.rawValue, color: normalColor) view.tabBarItem.selectedImage = createTabBarItem(imageName: SelectedBarItem.search.rawValue, color: selectedColor) viewVC.loadURL = createLoadUrl(urlPath: ViewURL.search.rawValue) - viewVC.naviTitle = getDisplayString(key: "SearchTitle", comment: "") + viewVC.navigationItem.title = getDisplayString(key: "SearchTitle", comment: "") viewVC.tabTitleKey = "SearchTitle" default: view.tabBarItem.title = getDisplayString(key: "HomeTitle", comment: "") view.tabBarItem.image = createTabBarItem(imageName: BarItem.home.rawValue, color: normalColor) view.tabBarItem.selectedImage = createTabBarItem(imageName: SelectedBarItem.home.rawValue, color: selectedColor) viewVC.loadURL = createLoadUrl(urlPath: ViewURL.home.rawValue) - viewVC.naviTitle = getDisplayString(key: "HomeTitle", comment: "") + viewVC.navigationItem.title = getDisplayString(key: "HomeTitle", comment: "") viewVC.tabTitleKey = "HomeTitle" } diff --git a/AgileWorks/AgileWorks/Main/Wireframe/MainTabBarViewWireframe.swift b/AgileWorks/AgileWorks/Main/Wireframe/MainTabBarViewWireframe.swift index cfeaf2380aa46f029f6e582667faf14c2ea382e1..1ee5b97f02d211ff1fe26fb0276de345419568e8 100644 --- a/AgileWorks/AgileWorks/Main/Wireframe/MainTabBarViewWireframe.swift +++ b/AgileWorks/AgileWorks/Main/Wireframe/MainTabBarViewWireframe.swift @@ -69,7 +69,7 @@ extension MainTabBarViewWireframeImpl: MainTabBarViewWireframe { let modalWebVC = WebViewBuilderImpl().buildVC() // URL , タイトル設定 modalWebVC.loadURL = notificationData.url - modalWebVC.naviTitle = notificationData.title + modalWebVC.navigationItem.title = notificationData.title modalWebVC.showNotification = true let nav = UINavigationController(rootViewController: modalWebVC) nav.modalPresentationStyle = .fullScreen diff --git a/AgileWorks/AgileWorks/WebView/View/WebViewController.swift b/AgileWorks/AgileWorks/WebView/View/WebViewController.swift index 629356c07f8efe433859cf5ab7688f1663127a00..811846b871f4e81da7f7e463af81dcb12826a9be 100644 --- a/AgileWorks/AgileWorks/WebView/View/WebViewController.swift +++ b/AgileWorks/AgileWorks/WebView/View/WebViewController.swift @@ -22,7 +22,6 @@ class WebViewController: UIViewController { // 別ウインドウで開いたときの子ウインドウスタック var subViewStack = SubViewStack() var loadURL: String! - var naviTitle: String! var showNotification = false // UserAgent let kCustomUserAgent = "AwMobileApp Safari/605.1.15" @@ -34,20 +33,12 @@ class WebViewController: UIViewController { //widgetから新規タブを開く際のフラグ var openByWidget = false // 表示中タイトルキー - var nowTitleKey: String! var tabTitleKey: String! // 現在表示中のURL var nowURL: String! // 初期ロード完了フラグ var initLoadComp = false - // Title を設定する URL を定義 - var urlToTitle: [String: String] = [ - "Mobile#home": getDisplayString(key: "HomeTitle", comment: ""), - "Mobile#work": getDisplayString(key: "WorkTitle", comment: ""), - "Mobile#formSelection": getDisplayString(key: "DocumentsTitle", comment: ""), - "Mobile#agileWorksSearch": getDisplayString(key: "SearchTitle", comment: "") - ] // 書類表示時 URL let docUrl: [String] = ["Mobile#docDetail", "#docDetail"] @@ -80,7 +71,6 @@ class WebViewController: UIViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - self.navigationItem.title = naviTitle } // WebView セットアップ @@ -285,14 +275,6 @@ class WebViewController: UIViewController { if let url = change![NSKeyValueChangeKey.newKey] as? URL { let urlString: String = url.absoluteString self.nowURL = urlString - for (key, value) in self.urlToTitle { - if urlString.contains(key) { - // タイトルの再設定 - naviTitle = value - break - } - } - self.navigationItem.title = naviTitle DispatchQueue.main.async { // token チェック self.updateSession(isInit: false) @@ -374,25 +356,7 @@ class WebViewController: UIViewController { } //ログイン画面の固定文言表示 func setupFixedWording() { - urlToTitle = [ - "Mobile#home": getDisplayString(key: "HomeTitle", comment: ""), - "Mobile#work": getDisplayString(key: "WorkTitle", comment: ""), - "Mobile#formSelection": getDisplayString(key: "DocumentsTitle", comment: ""), - "Mobile#agileWorksSearch": getDisplayString(key: "SearchTitle", comment: "") - ] - if self.nowTitleKey != nil { - for (key, value) in urlToTitle { - if self.nowTitleKey.contains(key) { - // タイトルの再設定 - naviTitle = value - break - } - } - } else { - // タイトルの再設定 - naviTitle = getDisplayString(key: tabTitleKey, comment: "") - } - self.navigationItem.title = naviTitle + self.navigationItem.title = getDisplayString(key: tabTitleKey, comment: "") disconnectLabel.text = getDisplayString(key: "DisconnectNetworkLabel", comment: "") checkConnectButton.setTitle(getDisplayString(key: "CheckConnectButton", comment: ""), for: .normal) }