UICollectionView Swift Tutorial Pt 6 – Build Pinterest Newsfeed with UICollectionView

Join this course for FREE:

UICollectionView has increasingly been popular in world-class apps because it’s incredibly effective and customizable with a stand-alone layout object – UICollectionLayout subclass.

In this course, you’ll learn how to:
+ Create UICollectionView and UICollectionViewController
+ Subclass UICollectionViewCell to create custom Collection View Cell
+ Create subclass for UICollectionViewLayout to create Pinterest Newsfeed Effect
+ Calculate custom column and row height
+ and much more…

This course will contain multiple parts:
1 – How to create Pinterest Layout – Design solution
2 – Calculate Cell Attributes
3 – Continue Implementing prepare method for cell attributes
4 – Use Delegate to calculate dynamic cell height
5 – Continue calculate dynamic cell height
6 – Make them work all together
7 – Where to go from here?

If you’d love to get this course for free, join Duc at:

FREE iOS Course: — How to build social network apps

Code Mastery is hosted by Duc Tran, founder of Developers Academy.

This is his free-style no notes, no teleprompter presentation and live coding broadcast with you guys everyday.

To join Duc’s free courses, register for free at


Duc Tran is founder of Developers Academy, one of the world’s leading iOS, Android and Web development trainers.

More than 2,000,000 developers have studied his video trainings; 100,000 developers see his posts each month. Each year, Duc has helped 20,000 plus developers gratudate from his online courses or video series.

To subscribe and get free tutorials, courses and weekly content, visit me at:
Connect with Duc on facebook:
Tweet him:
Get daily inspiration:






10 responses to “UICollectionView Swift Tutorial Pt 6 – Build Pinterest Newsfeed with UICollectionView”

  1. Shubham Singh Avatar

    Hi Duc,I went through this training session and I created the app, works nice but I have one problem… I want to show more the three lines in the Caption, so increased the maxHeight in NewsFeedsVC from 64 to 196. But still I see three line of text and also increased height but text doesn't fill into that…!! Why…? I am sure I am missing something… need your help…!

  2. marq Avatar

    Nice tutorial, how would one use `insertItems(at: [indexPath])`?
    I would like to insert more cells at the bottom (for pagination) using the already cached layout properties?

  3. DragonAngel the Original Avatar

    Awesome Duc! Also, I love that you are always improving your English. I appreciate this effort since my first Language is French and it's much easier to follow along. This is a great tutorial and I will implement this in my app for sure!
    Thanks again!


  4. Sw Hyun Avatar

    Hi, Duc. Thank you for your awesome tutorials. I have a question for you. I am trying to use the Pinterest Layout with asynchronous image requests. In my project, the image request API gets called asynchronously in cellForItemIndexPath, and then later finishes to download images in the Main thread. The heightForPhotoAt method seems to be called earlier than cellForItemIndexPath method so that cell size is not properly configured. Could you give me an advice?

  5. 하현수 Avatar

    wow i never seen swift lecture video like this ! When I handle UICollectionViewController during make a feed style collection, I didn't consider about customizing collection view layout. thank you for uploading video

  6. Mebe Mac Avatar

    I have a billion dollar app idea (an innovator social media). But I need someone who can program, code, design, distribute and develop it (someone who works with this, knowing a lot about computer science). And I'm underage and can't help financially (so it would be a free work). Who wants to come with me? Imagine, we could be the co-founders of a big company. Just like Evan Spiegel and Bobby Murphy, co-founders of Snapchat! Can it be you?

  7. venkat prabhu Avatar

    Thank you for uploading, it helps me a Lot
    Please could you make a video on "SQlite Database"

  8. Roger Lacson Avatar

    Awesome tuts! Best learning setup ever.

  9. Mojalefa Tsoaeli Avatar

    Thanks mate! Love your work to the core!!!

  10. Encik Pulasan Avatar

    Nice tutorial. didn't know can change the constraint like that. Learn new things everyday. Thanks for the good tutorial. 😀

Leave a Reply

Your email address will not be published. Required fields are marked *