Latest 0.1.3
Homepage https://github.com/logansease/ZoomyHeader
License MIT
Platforms ios 8.0
Authors

Zoomy header is a way to add an image cell to your UITableView that will zoom in as you scroll up, similar to Twitter and other apps.

Usage


import ZoomyHeader

class ViewController: UITableViewController {

//keep a reference to the zoomyHeaderCell
private var imageViewCell : ZoomyHeaderCell?

override func viewDidLoad() {
    super.viewDidLoad()

    //register zoomyHeaderCell with your tableView
    ZoomyHeaderCell.registerZoomyCellIdentifier(tableView)
}

//MARK: TableView
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

    //dequeue a zoomyheaderCell
    let identifier = "ZoomyHeaderCell"
    let cell = tableView.dequeueReusableCellWithIdentifier(identifier, forIndexPath: indexPath)

    //set up our header cell with our image, keep our reference to it and tell the class its initial height
    if let imageCell = cell as? ZoomyHeaderCell
    {
        imageCell.fullImageView.image = UIImage(named: "city1.jpg")
        imageViewCell = imageCell
        imageCell.originalHeight = 300
    }
    return cell
}

//MARK: Scroll View Delegate

//Notify the header cell that it should adjust as the tableview scrolls
override func scrollViewDidScroll(scrollView: UIScrollView) {

    //if we are scrolling the tableview then adjust the scrollview frame accordingly
    if let tableview = scrollView as? UITableView, imageCell = imageViewCell
    {
        imageCell.didScroll(tableview)
    }
}

Example

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

Requirements

iOS 8+

Installation

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

pod "ZoomyHeader"

Author

Logan Sease, [email protected]

License

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

Latest podspec

{
    "name": "ZoomyHeader",
    "version": "0.1.3",
    "summary": "A nice image header cell that zooms as you scroll up",
    "description": "Zoomy header is a way to add an image cell to your UITableView that will zoom in as you scroll up, similar to Twitter and other apps. It is simple to implement with just a few lines of code!",
    "homepage": "https://github.com/logansease/ZoomyHeader",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Logan Sease": "[email protected]"
    },
    "source": {
        "git": "https://github.com/logansease/ZoomyHeader.git",
        "tag": "0.1.3"
    },
    "social_media_url": "https://twitter.com/logansease",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ZoomyHeader/Classes/**/*",
    "resource_bundles": {
        "ZoomyHeader": "ZoomyHeader/Classes/**/*.xib"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This