Latest 2.0.5
Homepage https://github.com/uptechteam/AirBar
License MIT
Platforms ios 9.1, requires ARC
Authors

AirBar

UIScrollView driven expandable menu.

AirBar

Description

AirBar is a library for creating cool expandable menus.
Library observes UIScrollView scroll and provides state you can apply to your UI elements.

Demo

AirBar Demo

Installation

Library supports Carthage dependency manager. To install AirBar add following line to Cartfile in the root folder of your project.

github "uptechteam/AirBar" ~> 2.0

Or if you prefer using CocoaPods add following line to your project Podfile

pod 'AirBar', '~> 2.0'

How to use

1) Create BarController object using BarController(configuration Configuration, stateObserver: StateObserver) initializer, where Configuration is struct that contains height config and StateObserver is closure that will be called on state change.

2) Bind BarController to your UIScrollView object using set(scrollView: UIScrollView) method.

3) Provide UI transformations in closure passed as StateObserver init argument. Closure will receive State object that has following public methods:

  • height() – returns bar height;
  • transitionProgress() – returns bar transition progress between 0 and 2, where 0 – compact state, 1 – normal state, 2 – expanded state;
  • value(compactNormalRange: ValueRangeType, normalExpandedRange: ValueRangeType) – returns transformed CGFloat value that can be used for configuring UIKit element properties. ValueRangeType is enum with .range(CGFloat, CGFloat) and .value(CGFloat) cases. You can use it for example if you need static value 1 in normal-expanded transition and range (0, 1) in compact-normal transition.

4) (Optional) Contribute to repository.

Also you can find example application in library project.

Multiple UIScrollView objects

BarController supports using multiple UIScrollView objects. You can use preconfigure(scrollView: UIScrollView) method to configure scrolling view before setting it with set(scrollView: UIScrollView) method.

TODO

  • Implement expansion/concatination resistance;

Latest podspec

{
    "name": "AirBar",
    "version": "2.0.5",
    "summary": "Airbnb expandable bar.",
    "homepage": "https://github.com/uptechteam/AirBar",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Evgeny Matviyenko": "[email protected]"
    },
    "platforms": {
        "ios": "9.1"
    },
    "swift_version": "4.1",
    "requires_arc": true,
    "source": {
        "git": "https://github.com/uptechteam/AirBar.git",
        "tag": "v2.0.5",
        "submodules": true
    },
    "source_files": "AirBar/**/*.{h,swift}"
}

Pin It on Pinterest

Share This