Swift for Beginners: Create Collection View in Xcode (iOS - 2023)

Поделиться
HTML-код
  • Опубликовано: 24 июл 2024
  • We'll learn how to create a grid of cells - otherwise known as a UICollectionView. Going over the various interfaces and protocols we need to implement to get this set up and working.
    💻 Source Code: / iosacademy
    🎥 Subscribe for more: ruclips.net/user/iOSAcademy?su...
    😎 Like my teaching style? Check out some of my most popular courses: courses.iosacademy.io
    👉🏼 Connect (personal LinkedIn) / afrazsiddiqui
    🚀 Follow on LinkedIn / ios-academy
    iOS Academy offers the #1 course for iOS Development for Beginners. Learn to create iPhone and iPad apps from scratch. Everyone these days has an app idea; learn the important skill of making those apps, make yourself more marketable, change industries to get a different job, and enjoy the ride!
    This video is brought to you by Skillshare - an only community of teachers sharing awesome skills. Use the following link to get 2 months of FREE premium: www.skillshare.com/r/user/afraz

Комментарии • 101

  • @iOSAcademy
    @iOSAcademy  3 года назад

    Enjoy my teaching style? Check out some of my premium courses at courses.iosacademy.io/

  • @aakashadhikari4227
    @aakashadhikari4227 4 года назад +49

    Zooming in and out caused my eyes to readjust which is very uncomfortable but anyways great content. Thanks.

    • @iOSAcademy
      @iOSAcademy  4 года назад +3

      Thanks for the feedback. Ive reduced it in newer videos :)

  • @karthikeyaacharya8424
    @karthikeyaacharya8424 3 года назад +3

    Simple and a great video. Zooming also helped. Thanks.

  • @joseivanpenuelasontiveros926
    @joseivanpenuelasontiveros926 Год назад

    Your videos are awesome! I am starting into this iOS world and one thing that I think would be helpful for everyone is that you can use AutoLayout like in this video instead of coding the views, I've found myself struggling with AutoLayout but at the same time your videos have taught me a lot. Most of the projects out there are developed with AutoLayout, so it would be great if we can learn AutoLayout while learning to code too. You are awesome! thank you!

  • @fengjosephine
    @fengjosephine 3 года назад +1

    thanks for sharing and it was really great!

  • @explosionradical
    @explosionradical 4 года назад +1

    wonderful !! You the best teacher bro!

  • @mehradt8129
    @mehradt8129 3 года назад +1

    Great Video Thank you!

  • @Jump_Jay
    @Jump_Jay 2 года назад

    Question: Can this all be done in the viewController w/o having to go into the main.storyboard to add a collectionView from the Library?

  • @asagishinsou6502
    @asagishinsou6502 4 года назад +2

    The best lesson for start! Thx!

    • @iOSAcademy
      @iOSAcademy  4 года назад

      Your welcome! Don't forget to subscribe for more :)

    • @asagishinsou6502
      @asagishinsou6502 4 года назад

      @@iOSAcademy Already)

  • @GabrielNovakovskiNunes
    @GabrielNovakovskiNunes 3 года назад +1

    Nice bro! Thanks for the awesome content

  • @cassidydubarton6891
    @cassidydubarton6891 4 года назад +2

    When I right click the view controller at 15:07, the collectionView outlet is not available. I've double checked that all previous code is entered correctly.

  • @hmpark1778
    @hmpark1778 3 года назад

    Thank you for your video! How can I remove margin from this code ?

  • @hadyhelal6626
    @hadyhelal6626 3 года назад +1

    Wonderful Video Thank you

  • @dnthsn
    @dnthsn 3 года назад +1

    great stuff!

  • @avneetsingh2010
    @avneetsingh2010 3 года назад

    Great video... However, looks like it is failing when I run in iPad due to constraints issue... How can I make it compatible with all devices screen size?

  • @kimdaegyum
    @kimdaegyum 3 года назад

    Sorry for vagueness but am I doing something wrong when I tap on a selection and make the selection border highlighted to show user tapped it, when I come back the order gets all funky? Is it because it's a reusable cell?

  • @EnglishTurkishExpert
    @EnglishTurkishExpert 2 года назад

    Can I add a table view inside that "nib (xib)" complete with table cells to display dictionary data (retrieved from a web site?
    TIA

  • @albertbo2178
    @albertbo2178 2 года назад

    And what I would must change if I my cells has different widths and I want to automatically put cells in a new row when a new completed cell cannot be inserted in a previous row?

  • @JanChristianSwobo
    @JanChristianSwobo 4 года назад +1

    Was very helpful! thanks :)

    • @iOSAcademy
      @iOSAcademy  4 года назад

      Your welcome! Make sure to subscribe :)

    • @JanChristianSwobo
      @JanChristianSwobo 4 года назад

      @@iOSAcademy Already have! And talked to my friends about your amazing channel! You are creating real value for us

  • @laurapotter6321
    @laurapotter6321 2 года назад

    thank you for this tutorial! Could you please make a tutorial for "implementing the iphone lock screen" with 10 key buttons and simulate the unlock function? Thank you!!!

  • @jrrobles79
    @jrrobles79 4 года назад

    Hi!, I followed this steps but Im getting this error: Could not load NIB in bundle, and triggers when Im dequeue the cell, I have already check all the cell identifiers but still confussed what is happening

  • @TheBitterlove
    @TheBitterlove 2 года назад +2

    I am confused. Why do we need to specify the size 2 times (one in delegate and another view did load)?

  • @TheBradyR
    @TheBradyR 3 года назад +5

    This was really good basic tutorial; however, you move pretty fast so the zooming in gets a little frustrating when trying to follow along.
    Question: I am trying to create a grid type view of a bunch on buttons that will take the user to different screens. Each button will have an image with it, then have text overtop of what it is. What would be the best way to achieve my goal? Would using this method be better than using Table Cell View with a bunch of buttons?

  • @jurabekismatov9310
    @jurabekismatov9310 2 года назад +1

    Very amazing video But I don't understand one thing. Who can Explain me why HE is using "item size " twice? once in the viewDidLoad and Once as an extension ? what is the difference

  • @feripedis
    @feripedis 4 года назад +10

    Would be nice to have a part 2 where you associate each cell with a different image, maybe different format than the standard and have each cell executing an action.

    • @iOSAcademy
      @iOSAcademy  4 года назад +2

      Great idea. I've got plans to do more in depth table and collection view cell customization vids since its such a broad topic that people love :)

    • @nurlanakylbekov7266
      @nurlanakylbekov7266 4 года назад

      you can do it by yourself, it's izi. create an array of images. cell.image.image = yourArrayImage[indexPath.row]

  • @yinkaadeniran1825
    @yinkaadeniran1825 3 года назад

    Why set cell size inside viewdidload and also in the extension below

  • @jameelshehadeh9011
    @jameelshehadeh9011 3 года назад

    thank you afraz for this great content i am really learning new techniques from you, i have one question why did you used public func configure while nib was static func ? thank you

    • @aplanida1
      @aplanida1 3 года назад +1

      A public function is a function that is used on an "instance" of a class; in this case, an individual cell. A static function does not need an "instance" instantiated in order to perform the function.

    • @jameelshehadeh9011
      @jameelshehadeh9011 3 года назад

      Albert Planida thanks and appreciated got it now

  • @mourbatsalim4830
    @mourbatsalim4830 2 года назад

    how can popup the search bar of file in xcode please? :)

    • @eyabs
      @eyabs 2 года назад

      command shift O

  • @angrycode1899
    @angrycode1899 4 года назад

    12:09 I don't have a MyCollectionViewCell.nib option! It returns: Use of unresolved identifier 'MyCollectionViewCell'
    I Did set the identifier on the MyCollectionViewCell.xib to MyCollectionViewCell. I literally doing this tutorial for the 4th time now! I can even jump to definition which takes me to MyCollectionViewCell.swift. And I don't have any typo's.....
    collectionView.register(MyCollectionViewCell.nib(), forCellWithReuseIdentifier: "MyCollectionViewCell")
    Use of unresolved identifier 'MyCollectionViewCell'

  • @sidharthpanda8557
    @sidharthpanda8557 4 года назад

    Great Content. I dint give any focus on the zoom but your speed was a bit on the higher side. I had to slow down the view to follow.

    • @iOSAcademy
      @iOSAcademy  4 года назад +1

      Thanks! Ill make sure to keep a better pace going forward. Make sure to sub and stay tuned for more content

    • @sidharthpanda8557
      @sidharthpanda8557 4 года назад

      @@iOSAcademy already subscribed. Keep going

  • @DarkFlame-ul6kz
    @DarkFlame-ul6kz 4 года назад

    Amazing video! Liked and subbed. Just one question though. After this code works perfectly, I noticed that the cells all contain the same image. How can I change this so that each of the 12 cells contains a different image?

    • @arkemal
      @arkemal 3 года назад

      you have to create an array of image

    • @leaningtower73
      @leaningtower73 3 года назад

      First create an array of images:
      var images = [image1, image2, ....]
      Then recall the array in the function didSelectItemAt indexPath

  • @Marcel-wz2bh
    @Marcel-wz2bh 3 года назад

    Hi! like you said on the video, I don't really understand why'd you use static, could you please explain a little bit more?

    • @iOSAcademy
      @iOSAcademy  3 года назад +1

      Sure, Ill make a video on this

    • @Marcel-wz2bh
      @Marcel-wz2bh 3 года назад

      @@iOSAcademy thank you! i'll make sure to watch it

  • @ronick2299
    @ronick2299 3 года назад +1

    Awesome. But like the most of people saying, zooming in and out is not good way to show your codes.

    • @iOSAcademy
      @iOSAcademy  3 года назад +1

      Thanks. New videos have no zoom

  • @akashneeli140
    @akashneeli140 3 года назад

    how do I Contact you? I have some Doubts

  • @user-dk5zd8so1f
    @user-dk5zd8so1f 3 года назад

    where to download the codes?

    • @iOSAcademy
      @iOSAcademy  3 года назад +1

      GitHub, what is your username - I can add you

    • @user-dk5zd8so1f
      @user-dk5zd8so1f 3 года назад

      @@iOSAcademy eahnivy8

  • @jesseo.3581
    @jesseo.3581 4 года назад +1

    Gib sourcecode plz thx

    • @iOSAcademy
      @iOSAcademy  4 года назад

      Hey Jesse, Ive started including source code for newer videos as people have asked. I don't think I have the source for this anymore though.

  • @AkamiChannel
    @AkamiChannel 4 года назад

    A little too much zooming in my friend. I guess the video quality is technically HD, but it looks to me like you're recording on a Macbook retina display? Macbooks are 16 x 10 aspect ratio, so the only way you will get a crisp image in HD is by using an external monitor, possibly with a capture card. A lot of people say you need 2 computers to justify using a capture card, but actually that's not really true. Sometimes 1 computer with a capture card is fine. You are offloading some of the processing power for the encoding to the capture card hardware that way, and can achieve better results in my experience. Note that there is no such thing as an HDMI to USB adapter because USB cannot handle the data bandwidth of HDMI. It needs to undergo some video encoding, which the reason for a capture card.

    • @pallavi6130
      @pallavi6130 3 года назад

      ohhhh
      everything that u said I cant understand😆😆😂😂

  • @theofani
    @theofani 4 года назад +4

    Great tutorial! but, sorry, your zooming in and out making it hard to see the code structure.

    • @iOSAcademy
      @iOSAcademy  4 года назад +1

      Thanks and good feedback

  • @Hussey_52
    @Hussey_52 2 года назад

    Like the way you explain little details while implementing. But seriously the continuous moving and zooming is frustrating and distracting as hell.
    I had to pause the video mid way to give this feedback

  • @evangelosspyromilios5994
    @evangelosspyromilios5994 Год назад

    Mate your tutorial is really great but this extreme zoom in - zoom out made me dizzy

  • @hazzelnuts
    @hazzelnuts 4 года назад +6

    please don't zoom in and out frequently

    • @iOSAcademy
      @iOSAcademy  4 года назад +1

      Thanks for the feedback

  • @sankethalishetty
    @sankethalishetty 4 года назад +1

    I check your videos but i always exit out when you keep doing that zoom in and out.. Its really not comfortable. Could you please keep a constant screen instead of zoom in and out.. otherwise your videos are good.

    • @iOSAcademy
      @iOSAcademy  4 года назад

      Thanks for the feedback, newer videos have less zooming

  • @Dragonboh1
    @Dragonboh1 11 месяцев назад

    all cool but stop zooming screen every time, impossible to look code

  • @TheBooban
    @TheBooban 3 года назад

    3:15 ..the 3 protocols....are...delegates. Uh? Gawd have to re read about protocols and delegates now...

  • @erkkasep
    @erkkasep Год назад

    You might create a collection view with this tutorial but it is not the 2022 version. Even though macOS looks so old. Just stop lying people.

  • @agurchands2247
    @agurchands2247 4 года назад +1

    Please don't zoom at all. It's really hard to follow!

  • @martinnasierowski6248
    @martinnasierowski6248 4 года назад +2

    stop zooming please

  • @hellonishant
    @hellonishant Год назад

    stop zooming a lot

  • @jadielalfonso6025
    @jadielalfonso6025 2 года назад +1

    Why zooming in???? All that in and out is the most annoying thing I've seen... Good content though

  • @AviramNetanel
    @AviramNetanel 2 года назад

    I just couldn't watch it, with all these EXTRA ZOOMING all the time

  • @Alexander-dw5ow
    @Alexander-dw5ow 2 года назад

    It is all fine, but please don't zoom in so much, it becomes hard to see the whole picture, and really annoying. Thanks for the content anyway.

  • @mansapratapsingh417
    @mansapratapsingh417 3 года назад +1

    I think zooming in and out is disturbing rather than being any helpful.

  • @arkemal
    @arkemal 3 года назад

    Do never force unwrap an optional
    nice video otherwise

    • @iOSAcademy
      @iOSAcademy  3 года назад +1

      Yep, just for demo purposes

  • @MrAkshay7988
    @MrAkshay7988 4 года назад

    Man , stop zooming in and out , you are hurting our eyes, and ruining your great videos...

    • @iOSAcademy
      @iOSAcademy  4 года назад +1

      New videos have much less zoom :)

  • @fibowibo5359
    @fibowibo5359 3 года назад +1

    please stop zooming in and out it is just awful and makes it harder to code along

    • @iOSAcademy
      @iOSAcademy  3 года назад +1

      New videos have no zoom

  • @gzoll001
    @gzoll001 Год назад +1

    the zooming is nonsense. . .. cut it to 50% so that people can see something other than the current letter you are typing. Literally makes your video unwatchable.

  • @sandhyanallamilli2842
    @sandhyanallamilli2842 Год назад

    Stop ZOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOMING Pleaseeeeeeeeeeeeeeee.