Updated Course: Custom Collection View Layout
We’re happy to announce that our 15th new course since WWDC is now available: Custom Collection View Layout!
In this 13-part course for intermediate to advanced iOS developers, you’ll learn how to customize the layout of collection views in iOS.
You’ll start with the basics, such as manipulating the default flow layout using a delegate, and by subclassing. Then you’ll move on to more advanced topics like creating a layout from scratch, changing layout attributes, and dynamic cell content.
Along the way, you’ll learn how to create a variety of commonly used layouts, such as a carousel style layout, a Pinterest-style layout, a layout with a stretchy header, and more.
This course is now fully up-to-date for iOS 10, Xcode 8, and Swift 3. Let’s take a look at what’s inside.
Video 1: Introduction. Get a quick overview of what’s inside this course, and why customizing collection view layout is useful.
Video 2: Flow Layout Basics. Learn the basics of how to effectively use UICollectionViewFlowLayout to create custom layouts using a delegate.
Video 3: Carousel Layout: Getting Started. You’ll begin creating a vertically scrolling carousel layout, where the featured cell is larger, then fades and shrinks as you scroll. Learn about subclassing UICollectionViewFlowLayout and overriding methods to achieve our results.
Video 4: Carousel Layout: Custom Cells. Learn how to enhance your layouts with custom cells. You’ll modify the storyboard, then subclass UICollectionViewCell, to create a custom cell that resembles a collectible playing card.
Video 5: Carousel Layout: Cell Snapping. Learn how to snap a “featured” cell to a specific scrolling location. You’ll override some methods to set a boundary that stops scrolling when a cell is in the center of the view.
Video 6: Stretchy Headers: Getting Started. Begin creating a vertical scrolling custom flow layout with a large section header at the top. When the user pulls down on the collection view, the header will stretch. Learn how to add and display headers in your custom layout.
Video 7: Stretchy Headers: Adding Depth. Learn how to modify the header so that when the user pulls down on the collection view, not only will the header stretch, but the foreground will scale up, while the background will scale down; giving the impression of depth.
Video 8: UICollectionViewLayout Basics. Learn the basics of UICollectionViewLayout, such as when to use it versus UICollectionViewFlowLayout, the key methods to provide your layouts behavior, and what’s going on under the hood.
Video 9: Mosaic Layout: Getting Started. You’ll begin creating a mosaic style, multicolumn layout, with cells of varying height. Learn how to define and implement a custom delegate protocol to calculate each cells height.
Video 10: Mosaic Layout: Layout Attributes. Learn about subclassing UICollectionViewLayoutAttributes to add a custom property that will store the image height for each item. You’ll also see how to override apply(_:) in the cell class, to use the new attribute.
Video 11: Mosaic Layout: Cell Content. You’ll finish up the Mosaic layout as you learn how to dynamically size each cell, independently, based on it’s content. See how to use the AVMakeRect() method to calculate an image height, and calculate a labels height based on it’s font and size.
Video 12: Multiple Collection View Layouts. Learn how you can use multiple custom layouts within the same app. You’ll see how to load and configure an additional layout, invalidate the old layout, and set the new layout to smoothly transition into view.
Video 13: Conclusion. Review what you’ve learned about creating custom collection view layouts, and where to go from here.
Where To Go From Here?
Want to check out the course? You can watch the introduction for free!
The rest of the course is for raywenderlich.com subscribers only. Here’s how you can get access:
- If you are a raywenderlich.com subscriber: The entire course is complete and available today. You can check out the first part here.
- If you are not a subscriber yet: What are you waiting for? Subscribe now to get access to our updated Custom Collection View Layout course, and our entire catalog of over 500 videos.
There’s much more in store for raywenderlich.com subscribers – if you’re curious, you can check out our full schedule of upcoming courses.
I hope you enjoy our new course, and stay tuned for many more new Swift 3 courses and updates to come!