Giter Site home page Giter Site logo

jackrostron / collectionviewpaginglayout Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amirdew/collectionviewpaginglayout

0.0 0.0 0.0 36.16 MB

A simple but highly customizable UICollectionViewLayout for UICollectionView -- Simple SwiftUI views that let you make page-view effects.

License: MIT License

Ruby 0.73% Objective-C 0.38% Swift 98.90%

collectionviewpaginglayout's Introduction

CollectionViewPagingLayout - PagingView for SwiftUI

License platforms pod Carthage compatible Swift Package Manager compatible

Previews

Layout Designer


Custom implementations, UIKit: TransformableView, SwiftUI: TransformPageView

Click on image to see the code

UIKit: SnapshotTransformView, SwiftUI: SnapshotPageView

UIKit: ScaleTransformView, SwiftUI: ScalePageView

UIKit: StackTransformView, SwiftUI: StackPageView

About

UIKit:
A simple but powerful framework that lets you make complex layouts for your UICollectionView.
The implementation is quite simple. Just a custom UICollectionViewLayout that gives you the ability to apply transforms to the cells.
No UICollectionView inheritance or anything like that.

SwiftUI:
A simple View that lets you make page-view effects.
Powered by UICollectionView


For more details, see How to use

Installation

This framework doesn't contain any external dependencies.

# Podfile
use_frameworks!

target 'YOUR_TARGET_NAME' do
    pod 'CollectionViewPagingLayout'
end

Replace YOUR_TARGET_NAME and then, in the Podfile directory, type:

$ pod install

Add this to Cartfile

github "CollectionViewPagingLayout"

and then, in the Cartfile directory, type:

$ carthage update

using Xcode:

File > Swift Packages > Add Package Dependency

Manually

Just add all the files under Lib directory to your project

How to use

There is a macOS app to make it even easier for you to build your custom layout.
It allows you to tweak many options and see the result in real-time.
It also generates the code for you. So, you can copy it to your project.

You can purchase the app from App Store and support this repository, or you can build it yourself from the source.
Yes, the macOS app is open-source too!.

Continue for SwiftUI or UIKit

Limitations

  • Specify the number of visible items:
    You need to specify the number of visible items.
    Since this layout gives you the flexibility to show the next and previous cells,
    By default, it loads all of the cells in the collectionview's frame, which means iOS keeps all of them in the memory.
    Based on your design, you can specify the number of items that you need to show.

  • It doesn't support RTL layouts:
    however, you can achieve a similar result by tweaking options, for instance try StackTransformViewOptions.Layout.reverse

Credit

License

CollectionViewPagingLayout is available under the MIT license. See LICENSE file for more info.

collectionviewpaginglayout's People

Contributors

amirdew avatar zzzworm avatar gpolyansky avatar levi avatar neph3779 avatar raxityo avatar smpanaro avatar jlynch1 avatar

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.