iOS Dev 11: CollectionViews | Swift 5, XCode 11

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ม.ค. 2025

ความคิดเห็น • 89

  • @olajideosho9186
    @olajideosho9186 3 ปีที่แล้ว +5

    The most straightforward CollectionView Tutorial on TH-cam.

  • @waheedafolabi6929
    @waheedafolabi6929 4 ปีที่แล้ว +1

    Needed a refresher and you just saved my life. Thanks Emmanuel!

  • @liveanimails
    @liveanimails 4 ปีที่แล้ว +1

    yes, it would be nice to have a video continuation so that the pictures are automatically adjusted to any screen and rotation

    • @EmmanuelOkwara
      @EmmanuelOkwara  4 ปีที่แล้ว

      Sure! I’ll consider it as a future video 😊

  • @michelleweekes1514
    @michelleweekes1514 3 ปีที่แล้ว

    Thank you so much! You saved me as I am creating a final project in school and needed to know how to do this!

  • @yusufmd1090
    @yusufmd1090 3 ปีที่แล้ว +2

    Your explanation is awesome bro.Thank you. Waiting for more videos.

  • @girishparate5899
    @girishparate5899 3 ปีที่แล้ว

    I loved to see a video about reusable UIVIews like Button, Text, Input text 😇

  • @buendiaoma
    @buendiaoma 2 ปีที่แล้ว

    Thanks buddy!!! I saw manny videos and this one is the best!!! Good job!!!

  • @raychen4458
    @raychen4458 2 ปีที่แล้ว

    Wanna see a more adaptable collection cell when it comes to different sizes, too !

  • @林莉-y2y
    @林莉-y2y 3 ปีที่แล้ว

    Thanks, Emmanuel! You helped me a lot to learn it.

  • @muzammalabdulghafoor6418
    @muzammalabdulghafoor6418 2 ปีที่แล้ว

    Simple and great explanation

  • @achintbhamra6701
    @achintbhamra6701 2 ปีที่แล้ว +2

    kindly explain XIB file if you can !!

  • @vitorgomes4794
    @vitorgomes4794 3 ปีที่แล้ว

    First of all, thanks for sharing this content Emmanuel. I would like to know if it is possible to explain about 15:11 when you said it is possible to make it more responsible. I am trying same things you did in the video but trying to adapt to different screen sizes

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว +2

      Thanks, Viktor.
      In this video, I returned a fixed size for each cell (200x300).
      When you run the app on smaller/larger screens, the cells will maintain the same dimension.
      A good way to make it more adaptive is to return a dynamic value for the width and height based on certain conditions.
      For example, we could set the cell's width to = (view.frame.size.width / 2) - (padding), this way, regardless of the screen size, there will always be 2 cells per row.
      In the same way, you can also calculate the height of the cell.

    • @vitorgomes4794
      @vitorgomes4794 3 ปีที่แล้ว

      @@EmmanuelOkwara Thanks Emmanuel I also found almost the same answer as you provided. But how about the height when I am using a single cell? How can I make the height dynamic? I know that I need to calculate elements heights to give as a return of sizeForItemAt, but I don't know how to collect the size outside the extension. To be more clear, this is the result I trying to achieve: imgur.com/a/NggMTJ8

    • @vitorgomes4794
      @vitorgomes4794 3 ปีที่แล้ว

      I tried this but did not worked, app crashes: On my CollectionViewCell file create the functions heightSum (factTextHeight: CGFloat, categoriesHeight: CGFloat) -> CGFloa and then made it return heightSum = lbFactsText.frame.height + lbCategories.frame.height. On my ViewController, specifically made on cellForIitemAt this: height = cell.heightSum(factTextHeight: cell.lbFactsText.frame.height, categoriesHeight: cell.lbCategories.frame.height) (where height is a global variable on ViewController), then, on CGSize(width: width - 40, height: sizeForItemAt is called before cellForItemAt method right?

  • @aksanazir753
    @aksanazir753 3 ปีที่แล้ว +1

    Superb video.
    Can u plx tell me how can i go to other page in which detail about the movie is written by simply tapping on the inage or title. Plxxxx

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว +2

      At the point of this video, we know when a particular cell is tapped.
      The next thing we need to do is launch the new page that’ll display the information and send the movie at that index to the new view controller.
      We actually have that done in another series we’re currently working on. You can checkout this video....
      th-cam.com/video/Ud4zMWwyTwA/w-d-xo.html

    • @aksanazir753
      @aksanazir753 3 ปีที่แล้ว

      @@EmmanuelOkwara sir can u plx tell me if i click on image i want to perform some action like print("abc") and when i click on the title i want to perform another action like print("123"). how can i do that. plx help

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว

      You can implement this by adding a tap feature recognizer to the image and label, then assign their actions to different methods.
      You can check this video to see how to add tap to a view.
      th-cam.com/video/uFL0klyR7G0/w-d-xo.html

  • @richardgomez9093
    @richardgomez9093 ปีที่แล้ว

    hi thank for the video is there a way to put it horizontaly many thanks

    • @EmmanuelOkwara
      @EmmanuelOkwara  ปีที่แล้ว

      You could either check the Yummie series on my channel or this video
      th-cam.com/video/9Aoi-4sW6JU/w-d-xo.html

  • @rax7838
    @rax7838 3 ปีที่แล้ว +1

    Your videos are so helpful. I feel like I found a gold mine. only problem is the font is too big so we can't see the all code. for some reason it is very exhausting to me. but still love your work. and how we can make cells responsible instead of giving fixed h and w

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว

      Thanks for the feedback. 😊
      I’ll try to work on the font and make it more accessible.

  • @mahmutenescetin9235
    @mahmutenescetin9235 3 ปีที่แล้ว

    thanks bro, this video fixed my problem

  • @guruswriting
    @guruswriting 3 ปีที่แล้ว

    Thanks Emmanuel, can you do a video on passing data from collection view to detail view controller pls (so the tapped image displays)? Thanks

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว +1

      I actually did that in this video: th-cam.com/video/Ud4zMWwyTwA/w-d-xo.html
      Also, if you aren’t following the Yummie series, I’d advice you to take a moment and follow it. You’ll learn a whole lot 😊

    • @guruswriting
      @guruswriting 3 ปีที่แล้ว

      @@EmmanuelOkwara Thanks a lot Emmanuel for taking the time to reply, will checkout out right away, appreciate it!

  • @superfortekiai
    @superfortekiai 6 วันที่ผ่านมา

    Awesome tutorial

  • @maryamnajafizada5729
    @maryamnajafizada5729 ปีที่แล้ว

    Thank you so much. I just had a question, how to make the collection View cell to be clicked on like a button? If anyone else knows the answer to the question, I would very much appreciate it.

  • @c.burhan55sw
    @c.burhan55sw 2 ปีที่แล้ว

    thank you so much bro u saved me :)

  • @EmreDurmus.
    @EmreDurmus. ปีที่แล้ว

    although my code is the same, I get an error Unexpectedly found nil while implicitly unwrapping an Optional value how can I solve it

    • @EmmanuelOkwara
      @EmmanuelOkwara  ปีที่แล้ว

      This means that the value of the property was not set. You may have to confirm from the video to see if you missed an assignment somewhere.

  • @BranGaming20
    @BranGaming20 2 ปีที่แล้ว

    hello, i was following all your collectionview tutorial also using kingfisher, but how to play a video in cell? i want a cell fill by image or video randomly, please help me TIA

    • @EmmanuelOkwara
      @EmmanuelOkwara  2 ปีที่แล้ว

      Unfortunately I haven’t made a video on AVPlayer yet but you could checkout this tutorial.
      www.raywenderlich.com/10857372-how-to-play-record-and-merge-videos-in-ios-and-swift

    • @BranGaming20
      @BranGaming20 2 ปีที่แล้ว

      @@EmmanuelOkwara thanks for reply!

  • @shirakuyanai4095
    @shirakuyanai4095 3 ปีที่แล้ว

    Hey what if I want to pick one of the images and make it appear on another collection view in other views?

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว

      In 13:35 you see how we can identify tap on a collectionviewcell.
      We can pass that data into the second view controller and populate your data source with it.

  • @jestinsaji8246
    @jestinsaji8246 3 ปีที่แล้ว

    how to implement in such a way that when i make switch on from the main viewController the switch action have to be perfomed in another ViewController.

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว

      I believe I did something exactly similar in these videos:
      Observer: th-cam.com/video/Ja1wPuaWyp4/w-d-xo.html
      Delegates: th-cam.com/video/HtU6yZbtCAQ/w-d-xo.html

    • @jestinsaji8246
      @jestinsaji8246 3 ปีที่แล้ว

      @@EmmanuelOkwara i want switch in only one page, when that switch is enabled then the next viewcontrollers color have to change

  • @alex741321
    @alex741321 3 ปีที่แล้ว

    Great tutorial, thanks

  • @JohnLiuFromHK
    @JohnLiuFromHK 3 ปีที่แล้ว

    Thank you, you explained very well in this video. As you said, I really want to know how to adapt better for different screen size, or customize more. Like setting the margin, padding or sth like that would help :)

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว

      I’ll definitely consider a more in-depth tutorial on this topic. 😊

  • @amilzith5211
    @amilzith5211 3 ปีที่แล้ว +1

    How to add image in the array

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว +4

      Hello, Amil
      I added the images to the array using Image Literal.
      You can bring up the Library by holding down COMMAND + Shift + L
      or
      You can type in #imageLiteral(resourceName: "image_name") and the string will be replaced with a thumbnail preview of the actual image.

  • @jestinsaji8246
    @jestinsaji8246 3 ปีที่แล้ว

    how 2 create 2 segments such that segment 0 to display table view and segment 1 to display a collection view

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว +2

      Just like you’ve said, you could have a segmentView, a collectionview and a tableview in your UI.
      When the value of the segmentView changes, you check the selectedSegmentIndex property and set the isHidden property of both collectionView and tableView accordingly.

    • @jestinsaji9182
      @jestinsaji9182 3 ปีที่แล้ว

      @@EmmanuelOkwara i have done but getting error can u make one

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว +1

      I created a sample app here. I hope it helps.
      github.com/EMacco/ios-tutorials/tree/segment-view

    • @jestinsaji8246
      @jestinsaji8246 3 ปีที่แล้ว

      @@EmmanuelOkwara thanks a lot

  • @vivekbhadane1870
    @vivekbhadane1870 3 ปีที่แล้ว

    can you help me for dynamic text. i achieve this layout but when i try to dynamic text but not working.

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว

      Dynamic cell height with a collection view is a little bit tricky. You’d need to calculate the intrinsic height of the labels content and set that as the height of the collection view.
      It’s easier if you’re using a table view.

    • @vivekbhadane1870
      @vivekbhadane1870 3 ปีที่แล้ว

      @@EmmanuelOkwara sir i have same layout. Tableview view estimate size is good to handle automatically..can you help me with demo.

    • @vivekbhadane1870
      @vivekbhadane1870 3 ปีที่แล้ว

      @@EmmanuelOkwara can you make one video for me.

  • @letskrishjourney
    @letskrishjourney 3 ปีที่แล้ว

    Pls upload mvvm using alamofire

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว

      I would love to but MVVM has no direct influence on your Network layer.
      You can just implement your network queries using Alamofire in the NetworkService class.

  • @nguyentienuc8578
    @nguyentienuc8578 3 ปีที่แล้ว

    thanks you Emmanuel!

  • @Xunnun
    @Xunnun 3 ปีที่แล้ว

    Thanks For This Video

  • @olenamakhobei1405
    @olenamakhobei1405 2 ปีที่แล้ว

    Thank you a lot!

  • @easthastings6919
    @easthastings6919 3 ปีที่แล้ว

    quality content

  • @jarmenkell5644
    @jarmenkell5644 2 ปีที่แล้ว

    good job

  • @YourLeader350
    @YourLeader350 3 ปีที่แล้ว

    Thanks so much

  • @RanjithKumar-sx2nv
    @RanjithKumar-sx2nv 3 ปีที่แล้ว

    Bro I'm not Abel to size it

    • @RanjithKumar-sx2nv
      @RanjithKumar-sx2nv 3 ปีที่แล้ว

      Can u please reply

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว

      Hello, Ranjith. 😊
      Did you follow the steps outlined in 12:44?

  • @tahasivrioglu9648
    @tahasivrioglu9648 ปีที่แล้ว

    Thanks a lot

  • @Денис-ж3ф5р
    @Денис-ж3ф5р 3 ปีที่แล้ว

    good stuff

  • @Kalash040
    @Kalash040 8 หลายเดือนก่อน

    Great!

  • @BestTutorialsLearning
    @BestTutorialsLearning 4 ปีที่แล้ว

    thanks

  • @muradanowar2618
    @muradanowar2618 4 ปีที่แล้ว

    So Far Good

  • @daxtech-pd3nr
    @daxtech-pd3nr ปีที่แล้ว

    pl help anyone

  • @dwpalme2670
    @dwpalme2670 2 ปีที่แล้ว

    You make the number of lines 0 and its dynamic.

  • @dwpalme2670
    @dwpalme2670 2 ปีที่แล้ว

    That's stupid to set the width, you can make that dynamic dude to allow for scrolling.

  • @sindhurajan9097
    @sindhurajan9097 3 ปีที่แล้ว

    How to use json parsing in collection view

    • @EmmanuelOkwara
      @EmmanuelOkwara  3 ปีที่แล้ว

      I’m not sure I understand the question.
      Please could you explain?

    • @sindhurajan9097
      @sindhurajan9097 3 ปีที่แล้ว

      @@EmmanuelOkwara nope ..I am clr and I did that 😁 thanks for ur reply..could you please tell me how to link tabbar programatically with the storyboard view controllers