ClimbBar 1.0.6

ClimbBar 1.0.6

Maintained by Keisuke Yamagishi.



ClimbBar 1.0.6

  • By
  • keisuke

ClimbBar

Overview

iOS library that can extend a View that has scrollable elements such as UITableView and UIWebView.

As you can see in the example apps, the scroll bar hides the navigation bar.

travis status
result

Cocoapods

pod 'ClimbBar'

git clone

Via SSH: For those who plan on regularly making direct commits, cloning over SSH may provide a better experience (which requires uploading SSH keys to GitHub):

$ git clone [email protected]:keisukeYamagishi/ClimbBar.git

Via https: For those checking out sources as read-only, HTTPS works best:

$ git clone https://github.com/keisukeYamagishi/ClimbBar.git

Use it

Custom bar

ClimbBar uses contentInset to move the scroll elements, so

As in the picture below

Storyboard

Code

self.scrollable.contentInsetAdjustmentBehavior = .never

Apple offical site

UIScrollView.ContentInsetAdjustmentBehavior Constants indicating how safe area insets are added to the adjusted content inset.

Please use it as Never.

UIScrollView.ContentInsetAdjustmentBehavior (Apple)

BUT Look at the following

If you use UINavigationController, it will work without using it.

Sample code

override func viewDidLoad() {
        super.viewDidLoad()
        self.tableView.dataSource = self
       
        let conf = Configuration(range: UIApplication.shared.statusBarFrame.height..<UIApplication.shared.statusBarFrame.height + (self.navigationController?.navigationBar.frame.size.height)!)
        
        self.title = "ViewController"
        
        self.climbBar = ClimbBar(configurations: conf,
                                 scrollable: self.tableView,
                                 state: { (state) in
                                    self.navigationController!.setAlpha(alpha: CGFloat(state.alpha))
                                    self.navigationController?.navigationBar.frame = CGRect(x: 0,
                                                                                            y: state.originY,
                                                                                            width: self.view.frame.size.width,
                                                                                            height: 44)
        })
    }