Skip to content

Instantly share code, notes, and snippets.

@Exey
Created April 21, 2020 18:48
Show Gist options
  • Save Exey/2bd837b526ce9a54d5dbec68c181f4bc to your computer and use it in GitHub Desktop.
Save Exey/2bd837b526ce9a54d5dbec68c181f4bc to your computer and use it in GitHub Desktop.
func resetUITableViewAppearance() {
UITableView.appearance().separatorStyle = .none
UITableView.appearance().separatorInset = .zero
UITableView.appearance().showsHorizontalScrollIndicator = false
UITableView.appearance().showsVerticalScrollIndicator = false
UITableView.appearance().layoutMargins = .zero
UITableView.appearance().contentInset = .zero
UITableView.appearance().contentOffset = .zero
UITableViewCell.appearance().selectionStyle = .none
UITableViewCell.appearance().separatorInset = .zero
UITableViewCell.appearance().layoutMargins = .zero
UITableViewHeaderFooterView.appearance().tintColor = .clear
}
func displayNavigationBarAsColored() {
let navBarAppearance = UINavigationBarAppearance()
navBarAppearance.configureWithOpaqueBackground()
//navBarAppearance.backgroundColor = UIColor.BACKGROUND2 // your color
navBarAppearance.shadowImage = nil // line
navBarAppearance.shadowColor = nil // line
navBarAppearance.titleTextAttributes = [
.foregroundColor: UIColor.PRIMARY!,
]
navBarAppearance.largeTitleTextAttributes = [
.foregroundColor: UIColor.PRIMARY!,
]
UINavigationBar.appearance().standardAppearance = navBarAppearance
UINavigationBar.appearance().compactAppearance = navBarAppearance
UINavigationBar.appearance().scrollEdgeAppearance = navBarAppearance
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment