Skip to content

Commit

Permalink
adds configurable background color to albumviewcontroller and checks …
Browse files Browse the repository at this point in the history
…for safe area insets if there is no navigation controller
  • Loading branch information
MichaelNeas committed Nov 30, 2020
1 parent 10bccd9 commit 64d5549
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ class DropdownPresentationController: UIPresentationController {
// Match color with navigation bar
presentedViewController.view.backgroundColor = navigationBar.barTintColor
} else {
position = .zero
if #available(iOS 11.0, *) {
position = CGPoint(x: containerView.safeAreaInsets.left, y: containerView.safeAreaInsets.top)
} else {
position = .zero
}
}

return CGRect(origin: position, size: size)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Scene/Albums/AlbumsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class AlbumsViewController: UIViewController {
tableView.register(AlbumCell.self, forCellReuseIdentifier: AlbumCell.identifier)
tableView.dataSource = dataSource
tableView.delegate = self
tableView.backgroundColor = .clear
tableView.backgroundColor = settings.theme.backgroundColor
view.addSubview(tableView)

let lineHeight: CGFloat = 0.5
Expand Down

0 comments on commit 64d5549

Please sign in to comment.