Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use RFQuiltLayout with a Swift project #25

Open
netwire88 opened this issue Oct 25, 2014 · 4 comments
Open

How to use RFQuiltLayout with a Swift project #25

netwire88 opened this issue Oct 25, 2014 · 4 comments

Comments

@netwire88
Copy link

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.

@natpicone
Copy link

I have the same issue, any help ?
Cheers

@ningt
Copy link

ningt commented Nov 12, 2014

same issue here.

@Varsha-Kulkarni
Copy link

   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

@karthisiva
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants