Skip to content

Commit

Permalink
Merge pull request #155 from kfinteractive/master
Browse files Browse the repository at this point in the history
Adds support for respecting initial safeAreaInsets.
  • Loading branch information
scenee committed Mar 8, 2019
2 parents 87ff5d6 + 7160e4a commit ce891e4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Framework/Sources/FloatingPanelController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,8 @@ public class FloatingPanelController: UIViewController, UIScrollViewDelegate, UI
// inset's update expectedly.
// 2. The safe area top inset can be variable on the large title navigation bar(iOS11+).
// That's why it needs the observation to keep `adjustedContentInsets` correct.
safeAreaInsetsObservation = self.observe(\.view.safeAreaInsets) { [weak self] (vc, chaneg) in
guard let `self` = self else { return }
self.update(safeAreaInsets: vc.layoutInsets)
safeAreaInsetsObservation = self.observe(\.view.safeAreaInsets, options: [.initial, .new]) { [weak self] (vc, _) in
self?.update(safeAreaInsets: vc.layoutInsets)
}
} else {
// KVOs for topLayoutGuide & bottomLayoutGuide are not effective.
Expand Down

0 comments on commit ce891e4

Please sign in to comment.