Powered by
Powered by
HuntMyIdeas-Inspire You To Make It Happen
Follow
   Me
  • Blogs
  • About Me
  • Home

Learn The Basic Concepts Of Working With Collection Views 

5/27/2016

0 Comments

 
Picture
The main objective of this Article is to introduce with you the most  basic part  of UICollectionView before using it in your Xcode project.

​I found this article important to help the developers who are curious to learn some of basics in iOS as a fresher.First of all,you should have some knowledge about View.
What is View in iOS?

Views are the building blocks for constructing your user interface in iOS.
​
Read:

​Some important notes about View in iPhone.
Some important points About View Controller.

What is Collection View ?
​

A collection view is basically used to display an ordered collection of data.Simply,It's basically a collection of  cells displayed in a grid or  according to the properties of custom layout you design.
The behaviour of collection view is similar to table view.Similar to table view,custom data source object supplies data to collection view and collection view displays it using cell ,layout and supplementary views.

The delegate of UICollectionView acts on behalf of Collection View in response to user interactions and so on.
​

Note:
UICollectionView is the subclass of UIScrollView.

Picture
Why we should use Collection view ?
​

1)It supports custom layout
2)One of the best things of collection view  is the separation between the data and the presentation layers,that depends upon a separate object to handle the layout.
3)You can design and view a catalog of items with variable sizes, optionally sorted into multiple sections
4)You can add,rearrange and edit a collection of items in collection view.
5)You can choose from a frequently changing display of items in collection view.


What is layout in collection view ?

1)The layout of collection view decides the placement and visual attributes of the views.
2)UIKit provides a layout that consists of a basic grid layout with some customisations.

Note:
You can use your own custom layouts to make the views flexible as per your own requirement.

Layout objects are subclasses of UICollectionViewLayout. 
Apple provides you the default flow layout to use.


Some major components of UICollectionView:
1.Cell:


Cell of collection view is similar to the table view.The cells are the main elements that make up the content of the view are added as the subviews to Collection View.Cells are arranged in grid like structure,can be created programmatically or by interface builder.​
​
Picture
BackgroundView:
You can customise the background of a cell as shown below which is presented as BackgroundView.
​
It's rendered just below the selected SelectedBackgroundView.



SelectedBackgroundView :

It supports for selection.As displayed a preview below indicates the cell is selected. It is rendered just below the ContentView when a cell is selected.


ContentView :

ContentView holds the content that the cell presents. It is rendered in the topmost z-order on the screen.
Picture
2.Supplementary Views:

You can display some extra information not within the cells somewhere within the collection view,you need to make use of supplementary views.

For example:
You can use them for header and footer customisation.
Picture
3.Decoration Views:
 It's an another part of collection view.If you want to enhance the visual appearance of the collection view ,you can use decoration views.

Example:
Adding a background image to collection view is a good example of decoration view.
Picture
How does Collection View behave?
Let me explain some behaviours a Collection View supports.

For example:



1)Users can elect one or more items from Collection View.
2)Users can Insert, delete, and reorder items or sections.
3)Users can edit an item
By default, the delegates of collection view can detect when the user taps a specific cell and it updates the cell’s selected or highlighted properties as appropriate. You can write code that configures a collection view to support multiple-item selection or that draws the selected or highlighted states yourself.

I have just shared some basic concept about UICollection View.I will come with more tutorials and sample codes about collection view in Objective C and as well as swift.If you find any difficulties understanding the above article or if you need any assistance ,feel free to put a comment :)

Read More Posts:
​
What Are The Main Responsibilities Of A View Controller ?
Explain The Difference Between loadView() And viewDidLoad() in iOS
How To Explain UIViewController Life Cycle in iOS ?
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Enter your email address:

    Delivered by FeedBurner

    RSS Feed

    Archives

    December 2019
    August 2018
    January 2018
    December 2017
    November 2017
    October 2017
    August 2017
    April 2017
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    December 2014
    November 2014
    October 2014
    September 2014
    August 2014
    July 2014
    June 2014


    ​​Categories

    All
    Affiliate Marketing
    Alexa Rank
    Apple's Latest Updates
    Blog Tips
    Cocos2d X
    Cocos2d-x
    Google AdSense Tips
    Grab-some-ultimate-ideas
    How-to-create-a-twinkling-star-background-effect-in-ios
    In-App Purchase Tutorial In Cocos2d-x (C++) Using SDKBOX
    Ios Interview Questions And Answers
    IOS Multiple Choice Questions And Answers
    Objective C
    Online Business
    Python
    Secrets To Effective IPhone App Marketing
    SEO Tips
    Swift Interview Questions
    Swift Tutorials
    Top 10 Articles Objective C
    Top 10 Articles-Objective-C
    Top 10 Popular Movies Ever
    Top 10 Popular Things To Know
    Top 10 Ultimate Issues Xcode
    Top 400 IOS Interview Questions
    Top IOS Sample Projects To Learn From
    Top Secrets To App Marketing
    UICollectionView
    Unity 3D
    Xcode

WELCOME TO HUNTMYIDEAS

Picture
I am Jitendra Gochhayat,an iOS Developer,Designer,blogger,
​from Odisha,India.
I write about ​​​blog tips and,
Make money online Tips,
​Objective C tutorials
SUSCRIBE TO NEWSLETTER

    Subscribe to this blog and receive notifications of new posts by email

Suscribe
Picture
Picture
Picture
Picture
Picture
HuntMyIdeas-2016 Powered By Weebly
Picture
Powered by Create your own unique website with customizable templates.
Powered by
Powered by