Skip to content

Commit

Permalink
Remove unused delegate method.
Browse files Browse the repository at this point in the history
Waiting on rdar://25109211
  • Loading branch information
andreamazz committed Mar 15, 2016
1 parent 753005f commit ca4f916
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions Source/ScrollingNavigationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@ import UIKit
/**
Scrolling Navigation Bar delegate protocol
*/
public protocol ScrollingNavigationControllerDelegate: NSObjectProtocol {
@objc public protocol ScrollingNavigationControllerDelegate: NSObjectProtocol {
/**
Called when the state of the navigation bar changes
*/
func scrollingNavigationController(controller: ScrollingNavigationController, didChangeState state: NavigationBarState)
func scrollingNavigationController(controller: ScrollingNavigationController, didChangeNavigationBarFrame frame: CGRect)
}

public extension ScrollingNavigationControllerDelegate {
func scrollingNavigationController(controller: ScrollingNavigationController, didChangeState state: NavigationBarState) {}
func scrollingNavigationController(controller: ScrollingNavigationController, didChangeNavigationBarFrame frame: CGRect) {}
optional func scrollingNavigationController(controller: ScrollingNavigationController, didChangeState state: NavigationBarState)
}

/**
Expand All @@ -39,7 +33,7 @@ public class ScrollingNavigationController: UINavigationController, UIGestureRec
public private(set) var state: NavigationBarState = .Expanded {
didSet {
if state != oldValue {
scrollingNavbarDelegate?.scrollingNavigationController(self, didChangeState: state)
scrollingNavbarDelegate?.scrollingNavigationController?(self, didChangeState: state)
}
}
}
Expand Down Expand Up @@ -300,8 +294,6 @@ public class ScrollingNavigationController: UINavigationController, UIGestureRec
frame.origin = CGPoint(x: frame.origin.x, y: frame.origin.y - delta)
navigationBar.frame = frame

scrollingNavbarDelegate?.scrollingNavigationController(self, didChangeNavigationBarFrame: frame)

// Resize the view if the navigation bar is not translucent
if !navigationBar.translucent {
let navBarY = navigationBar.frame.origin.y + navigationBar.frame.size.height
Expand Down

0 comments on commit ca4f916

Please sign in to comment.