SwiftUI Button Basics (2024)

SdĂ­let
VloĆŸit
  • čas pƙidĂĄn 18. 05. 2024
  • 👋 Our "Launch Your First App" program will help you build up your iOS skills to publish your very own feature rich app even if you’re a beginner starting from scratch. codewithchris.com/plus
    In this SwiftUI Button tutorial, we’ll cover:
    00:00 Intro
    00:24 A basic usage example
    02:13 buttonStyle modifier for preset button styles
    04:27 Examples of different custom buttons
    08:17 Font modifiers
    09:57 Button accessibility
    Download sample code for all SwiftUI components here:
    codewithchris.com/swiftui-cod...
    How to use custom fonts in your app:
    Article - codewithchris.com/swiftui/swi...
    Video - ‱ How to Use Custom Font...
    For tutorials of other SwiftUI components, check out our playlist here:
    ‱ SwiftUI Components

Komentáƙe • 9

  • @CodeWithChris
    @CodeWithChris  Pƙed dnem

    👋 Our "Launch Your First App" program will help you build up your iOS skills to publish your very own feature rich app even if you’re a beginner starting from scratch. codewithchris.com/plus

  • @goldenpantherstudio
    @goldenpantherstudio Pƙed 2 měsĂ­ci

    Amazing job, great explanation, you are the coding hero!

  • @georgekopadze791
    @georgekopadze791 Pƙed 3 měsĂ­ci

    Great video series. thank you for your effort. One quick question, what theme do you use, can you share it to us? Thanks a lot

  • @Thachosenone40
    @Thachosenone40 Pƙed 3 měsĂ­ci

    Great video Chris! Is there a way to combine two sf symbols into one? I am trying to make a custom back button with the chevron.left and house.fill into one backBarButton
thanks!

    • @CodeWithChris
      @CodeWithChris  Pƙed 3 měsĂ­ci

      Hello, thank you for taking the time to comment, I'm not sure if this is possible. Personally I haven't tried it yet. But maybe a custom icon will be a much better approach?
      -- Joash

    • @Thachosenone40
      @Thachosenone40 Pƙed 3 měsĂ­ci

      @@CodeWithChris thank you so much for the response, the custom symbol approach is my next approach. I was able to get it to work in UIKit by placing the symbols into a container and assigning them to a button. SwiftUI is proving to be a bit more difficult

  • @danielcrompton7818
    @danielcrompton7818 Pƙed měsĂ­cem +1

    Hey Chris, very confusing... When I try to autocomplete the .bordered and others, nothing appears! However it does actually work saying this property may not be available in the context... Any reason why?
    HStack {
    TextField("What are you looking for?", text: $query)
    .textFieldStyle(.roundedBorder)
    Button("Go") {
    // TODO
    }
    .buttonStyle(.borderedProminent) // Defaults to autocompleting `_ style: PrimitiveButtonStyle`
    }

    • @JOAO-bv4pe
      @JOAO-bv4pe Pƙed měsĂ­cem

      Same happens to mine, any idea of what it could be?

    • @Stevefrdnt
      @Stevefrdnt Pƙed 28 dny

      Yeah this also happen to me, and somehow I can't find any solution for the issue although force typing it wont give any error to the app, but please reply this comment if anyone know what causing the issue