Giter Site home page Giter Site logo

rubygarage / collection-view-layouts Goto Github PK

View Code? Open in Web Editor NEW
671.0 671.0 84.0 1.05 MB

A library that implements custom flow layouts for iOS apps

License: Apache License 2.0

Ruby 2.54% Swift 97.46%
500px collectionview collectionviewflowlayout facebook flickr flipboard instagram ios pinterest swift tags

collection-view-layouts's People

Contributors

jowkame avatar radyslavkrechet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

collection-view-layouts's Issues

No such module 'collection_view_layouts'

I've followed the How-to for the Example project but when I'm trying to build it I am getting "No such module 'collection_view_layouts' in ViewControllers/ViewController.swift.

What am I doing wrong? Or is something missing?

Regards.

3 x 3 Layout Type?

Hi all,

Thanks for providing great layouts on 7 layout types (Tags, Pinterest, 500px, Instagram, Flipboard, Facebook, Flickr).

However, I would like to have a 3 x 3 layout which is similar to Flipboard Layout on second, third and fifth row, as per screenshot below:
Screenshot 2019-07-30 at 1 42 43 PM

What should I set to achieve this layout?

Thanks.

Awesome!

Just want to tell you the big thanks for this great lib! ๐Ÿ‘๐Ÿป๐Ÿ˜ƒ

Unable to read license file issue

Hi,
As I tried to install this I am getting this warning:
[!] Unable to read the license file LICENSE for the spec `collection-view-layouts (0.1.2)
and the framework is not working. Can you please help me?

How to switch into another view controller after item clicked?

Hi all,

First of all, thanks for this great library.

I have successfully implemented the Instagram layout into my iOS app.

Now, I am trying to implement one function whereby after clicked on either one of the display item, it will switch into another view controller.

I have tried with three methods of switching view controller (Segue / Identifier / AppDelegate) with respective settings in storyboard, but all does not success.

Overall Flow:
Settings Page -> Display All Instagram Layout Data -> Clicked Item -> Switch To Another View Controller

What should I do to successfully switch into another view controller after item clicked?

Thanks.

SettingsCVProvider Source Code:

import UIKit
import FAPanels

class SettingsCVProvider: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {
    var items = [[String]]()
    
    // MARK: - UICollectionViewDataSource
    
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return items[section].count
    }
    
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ContentCellIdentifier", for: indexPath)
        
        if let cell = cell as? CollectionViewContentCell {
            let item = items[indexPath.section][indexPath.row]
            cell.populate(with: item)
        }
        
        return cell
    }
    
    // MARK: - UICollectionViewDelegate
    
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        // handle tap events
        NSLog("SettingsCVProvider collectionView() Clicked Item: \(indexPath.item)")
        
        if(indexPath.item == 0) {
            NSLog("SettingsCVProvider collectionView() Testing Confirm")
            
            // Switch To Settings Page
            // Method 1
            performSegue(withIdentifier: "TestingConfirm", sender: self)
            
            // Method 2
            let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
            let identifier = "TestingConfirmNavigationVCIdentifier"

            let finalVC: UIViewController = mainStoryboard.instantiateViewController(withIdentifier: identifier)
            _ = panel!.center(finalVC)
            
            // Method 3
            // Initialize FA Panels Side Menu
            let appDelegate = UIApplication.shared.delegate as? AppDelegate
            let storyboard = UIStoryboard(name: "Main", bundle: nil)
            let TestingConfirmVC: TestingConfirmVC = storyboard.instantiateViewController(withIdentifier: "TestingConfirmNavigationVCIdentifier") as! TestingConfirmVC

            //  Set FA Panels Controllers
            let rootController = FAPanelController()
            rootController.center(TestingConfirmVC)

            appDelegate?.window?.rootViewController = rootController
        }
    }
}

Main.storyboard Flow:
Screenshot 2019-08-05 at 11 32 41 AM

Cannot set max cell in row.

Althought I set kMaxCellsInRow = 2, it still shows 3 cells in a row of Px500FlowLayout. Pls check. Thanks.

pod issues

[!] Unable to read the license file LICENSE for the spec collection-view-layouts (0.1.2)

Got an warning "[!] Unable to read the license file `LICENSE` for the spec `collection-view-layouts (0.1.2)`"

Hello,

Thank you for the library. It works well on my project.

However, there is a minor error when running pod install. The warning is "[!] Unable to read the license file LICENSE for the spec collection-view-layouts (0.1.2)". As a result, it fails to achieve the license information in LICENSE file which is needed in my project.
I think the cause of the warning is the name of the license file, it should be LICENSE (without .txt). Otherwise, Cocoapods won't be able to read the file.

Thank you again.
Tony Hoang

Usage with images from the web

Hi

Just stumbled upon this library while looking to arrange items in different layouts.

How do I use this with images loaded from the web? As far as I've seen, the sample app returns cell size according to the length of the string placed in the corresponding item. I'd be very thankful if you could guide me as to how I could implement one of these layouts with URL of the image link.

Sticky collection header

Hi,

This library is missing the feature to make header sticky like tableView for plain style.

centeredHorizontally

collectionView.selectItem(at: indexPath, animated: true, scrollPosition: .centeredHorizontally)
is wrong in first or in last items

Header cannot be displayed

How to display collection header??

These function cannot be called.

func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
    print(kind)
    let reusableview = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "headerID", for: indexPath) as! HeaderView
    reusableview.frame = CGRect(x: 0, y: 0, width: 200, height: 60)
    return reusableview
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
    return CGSize(width: view.frame.width, height: 200)
}

Horizontal scrolling support

I have been trying to set the TagsStyleFlowLayout to work with a horizontally scrolling UICollectionView but it seems the layout overrides this and forces it to scroll vertically.

It would be very useful to allow it scroll horizontally as well.

Hello Need Some help

I am looking similar thing for android... if you know where i can find it can you share the link , Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.