How to use RFQuiltLayout with a Swift project
Hi,
I'm a iOS newbie and have a Swift project, how do I use RFQuiltLayout with it? Do I import it via ProjectName-Bridging-Header? I've copied RFQuiltLayout.m & RFQuiltLayout.h files to a folder within my project and then called #import "RFQuiltLayout.h" in the Bridging-Header file. However, when I try to change the Custom Class for the Collection View Flow Layout of a Collection View, RFQuiltLayout doesn't show up.
I have the same issue, any help ? Cheers
same issue here.
add #import "RFQuiltLayout.h" to bridging-header.h file
add these to viewDidLoad:
var layout = RFQuiltLayout()
layout.direction = UICollectionViewScrollDirection.Horizontal //default is vertical
layout.blockPixels = CGSizeMake(100,100) //default
self.collectionView.collectionViewLayout = layout
implement delegate methods if required (they are optional)
Don't forget to set delegate for collection view
@VarshaSameer its not working in swift3, its blocking collection datasource also, i have checked with break point, datasource not getting called.
let layout = RFQuiltLayout() self.collectionObject.collectionViewLayout = layout layout.direction = .horizontal if isOrientation == true { } else { layout.blockPixels = CGSize(width: CGFloat(75), height: CGFloat(71)) }