Latest 1.1.1
Homepage https://github.com/zhiquan911/CHParallaxHeaderView
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

demo.gif

Features

  • 使用Swift扩展特性编写,调用简单
  • UIView扩展支持视差缩放效果
  • UINavigationBar扩展支持视差渐变效果

Requirements

  • iOS 8+
  • Xcode 8+
  • Swift 3.0+
  • iPhone/iPad

Installation

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

pod "CHParallaxHeaderView"

Example


    @IBOutlet var tableView: UITableView!
    @IBOutlet var imageViewHeader: UIView!

    //在view出现时添加特性
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        let color = UIColor(white: 1, alpha: 1)
        //添加渐变效果并跟踪着哪个View
        self.navigationController?.navigationBar.ch_addGradient(by: self.tableView,
                                                                barColor: color)

        //添加缩放视差效果并跟踪着哪个View
        self.imageViewHeader.ch_addParallax(by: self.tableView)
    }

    //在view消失时移除特性
    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)

        //当控制器是消失时,把绑定的跟踪移除
        self.navigationController?.navigationBar.ch_removeGradient()
        self.imageViewHeader.ch_removeParallax()
    }

Author

Chance, [email protected]

Donations

为了让开发者更积极分享技术,开源程序代码,我们发起数字货币捐助计划,捐款只接收以下货币。

  • BTC Address: 1HvgRTi2CmaSHUkfWUCAqkYjF7AiBohzbB

  • ETH/ETC Address: 0xc312ed502fb57e0c42f9C7663CB7A3B0A6c4f6D2

License

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

Latest podspec

{
    "name": "CHParallaxHeaderView",
    "version": "1.1.1",
    "summary": "u4f7fu7528Swfitu6269u5c55u4e3aUIViewu6dfbu52a0u968fUIScrollViewu6edau52a8u4ea7u751fu89c6u5deeu6548u679c",
    "description": "u4f7fu7528Swfitu6269u5c55u4e3aUIViewu6dfbu52a0u968fUIScrollViewu6edau52a8u4ea7u751fu89c6u5deeu6548u679cuff0cu5b9eu73b0u4e86UINavigationBaru6edau52a8UIScrollViewu65f6u6e10u53d8uff0cUIViewu968fUIScrollViewu6edau52a8u7f29u653e",
    "homepage": "https://github.com/zhiquan911/CHParallaxHeaderView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Chance": "[email protected]"
    },
    "source": {
        "git": "https://github.com/zhiquan911/CHParallaxHeaderView.git",
        "tag": "1.1.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "CHParallaxHeaderView/Classes/**/*"
}

Pin It on Pinterest

Share This