Skip to content

Commit

Permalink
Fix followers delta movement
Browse files Browse the repository at this point in the history
  • Loading branch information
andreamazz committed Apr 24, 2018
1 parent 151e7a1 commit 7e3a45c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Demo/ScrollingNavbarDemo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@
</connections>
</collectionView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XzF-ga-ICa">
<rect key="frame" x="0.0" y="617" width="375" height="50"/>
<rect key="frame" x="0.0" y="607" width="375" height="60"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Custom Footer" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5ui-vC-XuS">
<rect key="frame" x="145.5" y="18" width="84" height="14.5"/>
<rect key="frame" x="145.5" y="23" width="84" height="14.5"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
Expand All @@ -340,7 +340,7 @@
<constraints>
<constraint firstItem="5ui-vC-XuS" firstAttribute="centerY" secondItem="XzF-ga-ICa" secondAttribute="centerY" id="2tj-VG-x9E"/>
<constraint firstItem="5ui-vC-XuS" firstAttribute="centerX" secondItem="XzF-ga-ICa" secondAttribute="centerX" id="FlN-6o-584"/>
<constraint firstAttribute="height" constant="50" id="QjH-xD-JgT"/>
<constraint firstAttribute="height" constant="60" id="QjH-xD-JgT"/>
</constraints>
</view>
</subviews>
Expand Down
2 changes: 1 addition & 1 deletion Source/ScrollingNavigationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ open class ScrollingNavigationController: UINavigationController, UIGestureRecog
private func updateFollowers(_ delta: CGFloat) {
followers.forEach {
guard let tabBar = $0.view as? UITabBar else {
$0.view?.transform = $0.view?.transform.translatedBy(x: 0, y: CGFloat($0.direction.rawValue) * delta) ?? .identity
$0.view?.transform = $0.view?.transform.translatedBy(x: 0, y: CGFloat($0.direction.rawValue) * delta * (($0.view?.frame.height ?? 0) / navigationBar.frame.height)) ?? .identity
return
}
tabBar.isTranslucent = true
Expand Down

0 comments on commit 7e3a45c

Please sign in to comment.