Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 6 Collection View

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?

like image 361
foFox Avatar asked Jul 11 '12 09:07

foFox


People also ask

What are collection views in iOS?

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

What is collection view in Salesforce?

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.

What's new in iOS 9 collection view?

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.

How to reorder items in a collection view in iOS 9?

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.


3 Answers

You might want to take a look at PSTCollectionView.

Open Source, 100% API compatible replacement of UICollectionView for iOS4.3+

like image 50
CSL Avatar answered Oct 19 '22 18:10

CSL


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.

like image 33
ohho Avatar answered Oct 19 '22 20:10

ohho


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

like image 36
Daniel Avatar answered Oct 19 '22 20:10

Daniel