RFQuiltLayout icon indicating copy to clipboard operation
RFQuiltLayout copied to clipboard

How to use RFQuiltLayout with a Swift project

Open netwire88 opened this issue 11 years ago • 4 comments

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.

netwire88 avatar Oct 25 '14 22:10 netwire88

I have the same issue, any help ? Cheers

natpicone avatar Oct 31 '14 10:10 natpicone

same issue here.

ningt avatar Nov 12 '14 16:11 ningt

   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

Varsha-Kulkarni avatar Jul 08 '15 11:07 Varsha-Kulkarni

@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)) }

karthisiva avatar Jan 02 '17 07:01 karthisiva