Skip to content

Commit

Permalink
apply review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hanynady committed Jun 17, 2020
1 parent 1f7ac01 commit 6b11ef9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Sources/ParallaxPagerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public final class ParallaxPagerView: UIView {
private var contentOffsetObservation: NSKeyValueObservation?
private var contentInsetObservation: NSKeyValueObservation?

private unowned let containerViewController: UIViewController
private weak var containerViewController: UIViewController?

private var headerHeightConstraint: NSLayoutConstraint?
private var contentViewLeadingConstraint: NSLayoutConstraint?
Expand Down Expand Up @@ -224,8 +224,8 @@ public final class ParallaxPagerView: UIView {

layoutInternalScrollView()

containerViewController.automaticallyAdjustsScrollViewInsets = false
containerViewController.extendedLayoutIncludesOpaqueBars = false
containerViewController?.automaticallyAdjustsScrollViewInsets = false
containerViewController?.extendedLayoutIncludesOpaqueBars = false
preservesSuperviewLayoutMargins = true

headerView.clipsToBounds = true
Expand Down Expand Up @@ -505,7 +505,7 @@ public final class ParallaxPagerView: UIView {

vc.willMove(toParent: containerViewController)
internalScrollView.insertSubview(vc.view, at: 0)
containerViewController.addChild(vc)
containerViewController?.addChild(vc)
vc.didMove(toParent: containerViewController)

contentViewTrailingConstraint = NSLayoutConstraint(
Expand Down
2 changes: 1 addition & 1 deletion Sources/Protocols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public protocol ParallaxContentViewController {
func scrollableView() -> UIScrollView?
}

public protocol ParallaxViewDelegate: class {
public protocol ParallaxViewDelegate: AnyObject {
func parallaxViewDidScrollBy(percentage: CGFloat, oldOffset: CGPoint, newOffset: CGPoint)
}

Expand Down

0 comments on commit 6b11ef9

Please sign in to comment.