在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:BenjaminPrieur/IOStickyHeader开源软件地址:https://github.com/BenjaminPrieur/IOStickyHeader开源编程语言:Swift 91.4%开源软件介绍:I migrated CSStickyHeaderFlowLayout library (Obj-C) to swift3.0 IOStickyHeaderParallax, Sticky Headers, Growing image heading, done right in one UICollectionViewLayout. UsageTo run the example project, clone the repo, and run Don't forget to set your flow layout with IOStickyHeader in your storyboard Register that nib file to your collection view controller in code: import IOStickyHeader
let headerNib = UINib(nibName: "IOGrowHeader", bundle: NSBundle.mainBundle())
override func viewDidLoad() {
super.viewDidLoad()
self.collectionView.registerNib(self.headerNib, forSupplementaryViewOfKind: IOStickyHeaderParallaxHeader, withReuseIdentifier: "header")
} Implement func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
switch kind {
case IOStickyHeaderParallaxHeader:
let cell = collectionView.dequeueReusableSupplementaryViewOfKind(kind, withReuseIdentifier: "header", forIndexPath: indexPath) as! IOGrowHeader
return cell
default:
assert(false, "Unexpected element kind")
}
} Requirements
InstallationCococaPodsIOStickyHeader is available through CocoaPods. To install it, simply add the following line to your Podfile: use_frameworks!
pod "IOStickyHeader" CarthageCarthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. You can install Carthage with Homebrew using the following command: $ brew update
$ brew install carthage To integrate IOStickyHeader into your Xcode project using Carthage, specify it in your
Run AuthorBenjamin Prieur LicenseIOStickyHeader is available under the MIT license. See the LICENSE file for more info. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论