Search and Filter Table View Swift Xcode Tutorial - Search Bar and Scope Buttons

Поделиться
HTML-код
  • Опубликовано: 5 ноя 2024

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

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

    Thanks a lot mate, was facing issue with navcontroller this helped a lot

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

    Hey Cal, just wanted to let you know that your content is great! Keep it coming!

  • @MitalP-t6q
    @MitalP-t6q Год назад

    Thank you 🙂 It helps me a lot👍

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

    Great video cal !
    I think the tempo is little bit fast

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

    Hey Cal, I'm new to iOS. I have one question. How can it be that you haven't put your Search bar nowhere in your storyboard, but it still shows up and works?

  • @dzondzula2908
    @dzondzula2908 3 года назад +2

    Just play it on 0.25 and you will understand everything

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

    Great stuff thanks

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

    Hi Cal! Thanks for this. Its been very useful. Just wanted to check, if i wanted the search bar to search through more than one labels, which is now only filtering for shapes.name i.e i want to add description labels and let it search through as well. Many thanks in advance!

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

      Hello,
      At 04:30 create another variable exactly the same as our searchTextMatch but instead of name call description.
      Then I imagine you would want to return true if (name matches or description matches) and scope matches.

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

      @@CodeWithCal Hi Cal! right now my code is let searchTextMatch = shape.name.lowercased().contains(searchText.lowercased() - how do i add another variable say shape.description.lowercased (which is another label i want it to be search through? many tahnks in advance!

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

      @@yenghow
      Something like this is what I was imagining
      let searchTextMatch = shape.name.lowercased().contains(searchText.lowercased())
      let descSearchTextMatch = shape.description.lowercased().contains(searchText.lowercased())
      return scopeMatch && (searchTextMatch || descSearchTextMatch)

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

      @@CodeWithCal that works like magic. Thank you Cal!

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

    Great Tutorial and thank you for the source code, is there a way to select more than one scope button ?

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

      I don't believe so.
      I could be wrong. If you do find a way please let me know :)

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

      @@CodeWithCal Will do.. thank you 💐

  • @ロペスジョンマーク
    @ロペスジョンマーク 3 года назад +1

    tnx