Swift: How to create Facebook News Feed (Part 1) – UICollectionView, NSLayoutConstraint



Part 2:

In this tutorial, we’ll learn how to create from scratch the Facebook News Feed using a UICollectionView. We then go over exactly how to layout every cell’s subview by using NSLayoutConstraint. Next we go over Extensions to make adding constraints much much easier. By the time you complete the project, you’ll have the perfect understanding of how to construct your views for the perfect layout.

Completed project:
https://www.letsbuildthatapp.com/course/Facebook-News-Feed

Helpful tutorials:
Build UICollectionViews programmatically: https://youtu.be/up-YD3rZeJA
Building a to-do list with UICollectionView: https://youtu.be/hexuJ6qL06I

Related Posts
How to Build Instagram Newsfeed – UITableView and UICollectionView Tutorial – How to Make An App

DOWNLOAD STARTER CODE: https://www.ductran.co/p/cm6 In this episode, we are using to build Facebook Newsfeed using UITableView and UITableViewController in iOS Read more

Adding an Outlet For Real – Intro to iOS App Development with Swift

This video is part of an online course, Intro to iOS App Development. Check out the course here: https://www.udacity.com/course/ud585. This Read more

Creating a New ViewController – Intro to iOS App Development with Swift

This video is part of an online course, Intro to iOS App Development. Check out the course here: https://www.udacity.com/course/ud585. This Read more

30 thoughts on “Swift: How to create Facebook News Feed (Part 1) – UICollectionView, NSLayoutConstraint”

  1. hi , thanks for this vedeo but i have a problem when i put:
    let label : UILable {….}()
    my project have this error "Thread 1: signal SIGABRT" i don't know why

    Reply
  2. Hi Brian, U R so genius, I have a problem , that tired me so much, the proplem is what I should do if my dataSource bring data from api and in this api there some posts haven't image, how I treat with this situation????
    I so need to your help, please!

    Reply
  3. hello bro, i have problem in my code i cant follow you because in here there is problem who can't be exactly as rich as you, and i want know email you

    Reply
  4. Wow, loved the function to reduce the boiler plate code! Nice work Brian! Your style with the view closures and the simplified layout constraints make it so much easier to read the layout code.

    Reply
  5. Het Brian!  I like the video, just a constructive advice…you're going to fast! That's why I ask you if you had a link with the final code so I can see how it works

    Reply
  6. Thanks for a nice video, I am new to iOS programming and trying to follow your video. I am using Xcode 9.1 version and I could not find window = UIWindow(frame: UIScreen.mainScreen().bounds) Is it not supported in this version?

    Reply
  7. navigationBarAppearace.titleTextAttributes =[NSForegroundColorAttributeName:UIColor.whiteColor()]
    has been updated to ->
    UINavigationBar.appearance().titleTextAttributes = [NSAttributedStringKey.foregroundColor:UIColor.white];

    Reply
  8. When it takes you 40 minute to do his 5 minutes lol 😉 PS: there are slight changes in some of the methods
    Quick question: Why is it that when you change the navbar title color or barTintColor in the viewDidLoad method they don't show up(or maybe they do but disappear after the function runs) while they do show up permanently in the didFinishLaunchingWithOptions function?? Thanks in advance!

    Reply
  9. What is the syntax: let xxx:xxx = {}(); called in Swift? I think it's a read-only property but I don't know why the () is required at the end.

    Reply
  10. Xcode does not show NavigationBar.appearance().titleTextAttributes completion guide, but if you type it by hand, build OK, Xcode bad?
    and Brian, is layout anchor a better choice than visual format to layout views?

    Reply
  11. Hey Brian could you please helpl me I can't get displayed the comments pending for approval in my group here is the link

    https://www.facebook.com/groups/LaSegunditaDallas/pending

    Reply
  12. Hi, thanks again for your tutorials. Can you have a look my question on stackoverflow? I am trying to add a gradient in cell's class but it doesnt work. http://stackoverflow.com/questions/42566304/cant-inherit-size-of-uiview#42566377 thanks

    Reply

Leave a Comment