Skip to content

Commit

Permalink
Merge branch 'master' into fix-scrollview-install-layout-bug-on-iOS-10
Browse files Browse the repository at this point in the history
  • Loading branch information
nataliq-pp authored Jan 29, 2019
2 parents 255eaac + 16e879d commit feff130
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Form/UIScrollView+Pinning.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ private extension UIScrollView {

// Handle transitions views that are not custom (our zoom modal). How fragile is this logic?
if let coord = viewController?.transitionCoordinator, coord.presentationStyle != .custom,
let containerView: UIView = (coord as? NSObject)?.value(forKey: "containerView") as? UIView { // Using value(forKey:) as non-optional coord.containerView might return nil on iOS 9
let containerView: UIView = (coord as? NSObject)?.value(forKey: "containerView") as? UIView,
self.isDescendant(of: containerView) { // Using value(forKey:) as non-optional coord.containerView might return nil on iOS 9
parent = containerView
} else if let superview = self.superview {
parent = superview
Expand Down Expand Up @@ -235,7 +236,7 @@ private extension UIScrollView {
// The parent moved between views when being presented and dismissed etc.
// This mean we have to re-pin if that happens.
// FIXME: In iOS 11 we should be able to use contentLayoutGuide instead of parent to setup our constraints and be able to remove this hack.
bag += combineLatest(parent.subviewsSignal.plain(), didMoveToWindowSignal).onValue { _ in
bag += combineLatest(parent.subviewsSignal, windowSignal).onValue { [weak parent] _ in
guard let superView = self.superview, superView != parent else { return }

let offset = self.contentOffset.y
Expand Down

0 comments on commit feff130

Please sign in to comment.