Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix presentation on iOS 12
Browse files Browse the repository at this point in the history
  • Loading branch information
kylehickinson committed Feb 24, 2021
1 parent c33750a commit dc636a4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions Client/Extensions/AppearanceExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ extension Theme {
UIToolbar.appearance().barTintColor = colors.footer

UINavigationBar.appearance().tintColor = colors.accent
UINavigationBar.appearance().largeTitleTextAttributes = [.foregroundColor: colors.tints.home]
UINavigationBar.appearance().appearanceBarTintColor = colors.header

UISwitch.appearance().appearanceOnTintColor = colors.accent
Expand Down
12 changes: 12 additions & 0 deletions Client/Frontend/Browser/BrowserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1822,6 +1822,12 @@ class BrowserViewController: UIViewController {
sourcesAdded: nil
)
let container = UINavigationController(rootViewController: controller)
let idiom = UIDevice.current.userInterfaceIdiom
if #available(iOS 13.0, *) {
container.modalPresentationStyle = idiom == .phone ? .pageSheet : .formSheet
} else {
container.modalPresentationStyle = idiom == .phone ? .fullScreen : .formSheet
}
self.present(container, animated: true)
}
activities.append(addToBraveToday)
Expand Down Expand Up @@ -1873,6 +1879,12 @@ class BrowserViewController: UIViewController {
sourcesAdded: nil
)
let container = UINavigationController(rootViewController: controller)
let idiom = UIDevice.current.userInterfaceIdiom
if #available(iOS 13.0, *) {
container.modalPresentationStyle = idiom == .phone ? .pageSheet : .formSheet
} else {
container.modalPresentationStyle = idiom == .phone ? .fullScreen : .formSheet
}
self.present(container, animated: true)
}
activities.append(addToBraveToday)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ class BraveTodaySettingsViewController: TableViewController {
self?.reloadSections()
}
let container = UINavigationController(rootViewController: controller)
let idiom = UIDevice.current.userInterfaceIdiom
if #available(iOS 13.0, *) {
container.modalPresentationStyle = idiom == .phone ? .pageSheet : .formSheet
} else {
container.modalPresentationStyle = idiom == .phone ? .fullScreen : .formSheet
}
self.present(container, animated: true)
}, image: nil, accessory: .disclosureIndicator)
]
Expand Down

0 comments on commit dc636a4

Please sign in to comment.