Summary

In this chapter, you learned how to harness the powers of the UICollectionView in your application. After introducing you to UICollectionView and using it, you were introduced to another powerful class, UICollectionViewFlowLayout. This class automatically creates a highly configurable grid to display cells in. You saw how to configure this grid by using Interface Builder, and then you learned that you can also configure the flow layout dynamically on a per cell basis. This enabled you to create a beautiful, tight grid layout that otherwise wouldn't have worked for all screen sizes.

Even though UICollectionViewFlowLayout is a powerful class already, you saw how to implement a great custom layout. You also learned how UICollectionView optimizes its rendering in iOS 10 by asking for cells before they are displayed by the UICollectionView. Based on how the work is divided over time, you saw why this is a great idea. Dropping frames is far less likely in iOS 10, and there's nothing you have to do in order to get it to work; it works straight out of the box. Finally, you learned how to implement features like deleting, reordering, and selecting items.

The material covered in this chapter is fairly complex, and it implements some pretty advanced interaction mechanisms, such as custom layouts, gesture recognition, and animation to provide feedback to the user. These concepts are very important in the toolbox of any iOS master because they cover a broad range of features that apps use.

The next chapter will cover another important concept in iOS, navigation. We'll look at how to navigate from one view to another using the storyboard in Interface Builder. We'll also dive deep into Auto Layout and UIStackView.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.180.76