Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

📏 Advanced compositional layouts for UICollectionView [iOS 13+].

License

NotificationsYou must be signed in to change notification settings

eleev/compositional-layouts-kit

Repository files navigation

PlatformPlatformLanguageCustomLayoutsAPILast CommitNLOCContributorsRepo SizeLicense

If you like the project, please give it a star ⭐ It will show the creator your appreciation and help others to discover the repo.

✍️ About

📏 This repository features a set of sophisticated compositional layouts forUICollectionView, complete with practical examples. Each layout is designed to adapt seamlessly to both portrait and landscape orientations, and is fully compatible with alliOS andiPadOS size classes.

📚 Contents

Please wait while the.gif files are loading (there are12 files, that weight around170Mb)...

🏗 Setup

There are no dependencies as well as any package managers involved. The project has more like a demo app setup e.g simply grab what you need for your needs. Each layout is wrapped into a separateUIViewController type for convenience (I could've create a separate layout factory and have just a single view controller, however, for the sake of simplicity I decided to make it possible to extract layouts with all the dependent code).

✈️ Usage

Simply grab aUIViewController type with a custom layout and adjust it for your needs. The layouts are inhere.

🆘 Tips

  1. Not all layouts may look cool in landscape orientations. In order to make them look cooler and take advantage of different aspect ratio of a screen, you need to create an alternative layout that is basically the copy of the portrait layout, but has different set of fractional width and height.
  2. If you want to have different layouts in portrait and landscape device orientations, you need to use either one of the following approaches:
    • UseviewWillTransition(to size: , with coordinator:) method (ofUIViewController class) andsetCollectionViewLayout(, animated: completion:) method ofUICollectionView class to properly animate changes of layout when changing orientation.
    • More advanced and preffered approach is to implement a customUICollectionViewTransitionLayout, which is (a quote fromApple's Docs):

    A special type of layout object that lets you implement behaviors when changing from one layout to another in your collection view.

⚠️ Warning

The assets used in this project were taken from theWeb. Do not use them for commercial purposes and proprietary projects. They are used just for demonstration only.

👨‍💻 Author

Astemir Eleev

🔖 Licence

The project is available underMIT Licence

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp