I love those collection views Apple introduced in iOS6 SDK. But my iPad is not getting an upgrade to 6.0, so theres a question. If I set the deployment target to 5.1, will I be able to use those new GUI elements they added in 6.0? Or do I have to code something like a Collection View myself?
Collection Views allow content to be displayed using arbitrary layouts. They allow easily creating grid-like layouts out of the box, while also supporting custom layouts. Collection Views in Xamarin.iOS - Xamarin | Microsoft Docs
The Collection View provides a flexible way to present content to the user. Similar to a table view, a collection view gets data from custom data source objects and displays it using a combination of cell, layout, and supplementary views. A collection view can display items in a grid or in a custom layout that you design.
Changes in iOS 9 In iOS 9, the collection view (UICollectionView) now supports drag reordering of items out of the box by adding a new default gesture recognizer and several new supporting methods.
In iOS 9, the quickest way to add reordering to a collection view is to use a UICollectionViewController. The collection view controller now has a InstallsStandardGestureForInteractiveMovementproperty, which adds a standard gesture recognizerthat supports dragging to reorder items in the collection.
You might want to take a look at PSTCollectionView.
Open Source, 100% API compatible replacement of UICollectionView for iOS4.3+
UICollectionView
class is only available for iOS 6.0 or later. You have to set the deployment target to 6.0 (or later) in order to use it. Xcode 4.5 or later supports iOS 6 development.
Building on what ohho said, you don't have to build for 6.0 and later to use this, you can use it if it's available by checking the presence of the class at runtime, you can still set your deployment target to say 4.3.
All this means is that you must check at runtime if you have the UICollectionView
class. If you don't then you must do whatever you did before, I usually used AQGridView
.
To find out how to check at runtime for a class and or feature, please check out this post: https://stackoverflow.com/a/12590035/662605
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With