Latest 0.1.0
Homepage https://github.com/nixsm/SimpleCollapsingHeaderView
License MIT
Platforms ios 9.0
Frameworks UIKit
Authors

CI Status
Version
License
Platform

A Simple collapsing header view based on this post

Usage

  1. Open o storyboard or Xib file.
  2. Drag and drop a UIView to a ViewController
  3. In Identity Inspector, replace the class from UITextField to SimpleCollapsingHeaderView and the module to SimpleCollapsingHeaderView.
  4. Configure Min Height and Max Height in the Attribute Inspector
  5. Add the following constraints:
    • Trailing Space to Superview
    • Leading Space to Superview
    • Top Space to Superview
    • Height equal to Max Height property (Unfornutately I still haven’t figured a way to update the height constraint based on the @IBInspectable)
  6. Connect the Height Constraint to the headerHeightConstraint of the SimpleCollapsingHeaderView
  7. Connect the SimpleCollapsingHeaderView to you ViewController
  8. Call collapseHeaderView(using: scrollView) inside your scrollViewDidScroll(_ scrollView: UIScrollView) method

Animations

Animations can be done by implementing the SimpleCollapsingHeaderViewDelegate, the onHeaderDidAnimate returns the percentage of how much the Header view is collapsed

A simple animation can be found inside the example Project

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Minimum iOS version required: 9.0

TODOs

  • Implement the previous scroll inset in a way that you can have more than 1 scrollView resizing the Header View

Installation

SimpleCollapsingHeaderView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'SimpleCollapsingHeaderView'

Author

Nicholas Meschke, [email protected]

License

SimpleCollapsingHeaderView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SimpleCollapsingHeaderView",
    "version": "0.1.0",
    "summary": "An easy to use library for collapsing header views in iOS",
    "description": "An easy to use library to implement a collapsing header view in iOS, that supports simple animations",
    "homepage": "https://github.com/nixsm/SimpleCollapsingHeaderView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "nixsm": "[email protected]"
    },
    "source": {
        "git": "https://github.com/nixsm/SimpleCollapsingHeaderView.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/Nixsm_",
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "SimpleCollapsingHeaderView/Classes/**/*",
    "frameworks": "UIKit",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This