A SwiftUI tip everyone needs to know: Automatic Grammar Agreement

Sdílet
Vložit
  • čas přidán 7. 03. 2023
  • Automatic grammar agreement makes it easy to handle plurals in your app app across six different languages, and it's baked right into SwiftUI. See how to use it with this simple code example!
  • Věda a technologie

Komentáře • 81

  • @joevero4568
    @joevero4568 Před rokem +140

    I was expected to be underwhelmed but HOLY THAT'S AMAZING

    • @alexandersereno
      @alexandersereno Před 8 měsíci +3

      Commenting so those asking can see easily - supported languages are English, Spanish, Portuguese, French, Italian, and German

  • @jconstant
    @jconstant Před rokem +39

    Mind officially blown! I’d love more of these!

  • @joee8227
    @joee8227 Před rokem +19

    I hope this video gets liked by a lot of person.

    • @ericnail1
      @ericnail1 Před 12 dny

      I see what you did there 😆

  • @TheOnlyTripo
    @TheOnlyTripo Před rokem +30

    This is so great!
    How were we supposed to know about this one if it wasn’t for you? Thank you!

    • @alejmc
      @alejmc Před 10 měsíci

      Exactly, so many golden nuggets sprinkled absolutely everywhere all over the place 😮

  • @nigelhamilton6359
    @nigelhamilton6359 Před rokem +9

    That was so good. Please keep doing this 😀

  • @TsiriniainaRakotonirina
    @TsiriniainaRakotonirina Před rokem +2

    Paul, Paul, where has this been long long time ago!??? This is purely amazing 😃🤩🙌

  • @TheiTE
    @TheiTE Před rokem +5

    OH MY GOD LOL, this is AMAZING.
    This means... I have been writing long functions to do this for no reason all this time... T-T

  • @gabrielf111
    @gabrielf111 Před 10 měsíci

    Thanks! I had this problem recently and I’m surprised that the solution is this simple.

  • @Pseudonaym
    @Pseudonaym Před rokem +1

    Damn all these days I've been comparing values! Amazing tip!

  • @juliansha2590
    @juliansha2590 Před 10 měsíci +3

    And I’ve been using ternary operators lol . Good to know!

    • @zetrix6277
      @zetrix6277 Před 5 měsíci

      It's basically doing the same thing, only behind the scenes ...
      The localization process is still one of the biggest pains ...

  • @nonyabidness5784
    @nonyabidness5784 Před rokem

    Oh man I love this. Saves having to manually code it.

  • @ninelostsouls
    @ninelostsouls Před rokem

    Incredible.
    You should definitely do more of these. !!

  • @flora6465
    @flora6465 Před rokem

    Super cool tip! Definitely need more of these👍

  • @jcut
    @jcut Před rokem +1

    Very cool tip!

  • @flymanhawaii
    @flymanhawaii Před 9 měsíci

    So cool, gotta try this out for your example of country flags game.

  • @vrplayz4601
    @vrplayz4601 Před rokem

    Awesome work! Paul as always

  • @haineux
    @haineux Před rokem

    A little mysterious but very cool! Do more!

  • @thriveflourishmotivate
    @thriveflourishmotivate Před 9 měsíci

    Best swift teacher!!

  • @richardalbury
    @richardalbury Před rokem +1

    Mind blown: wow, thanks!

  • @JakeLovesSteak
    @JakeLovesSteak Před rokem

    I had no idea that was possible!

  • @Johnged15
    @Johnged15 Před rokem

    This is a nice piece of code.

  • @marcellerusu
    @marcellerusu Před 26 dny

    Amazing!

  • @yariva2
    @yariva2 Před rokem

    Wow, thanks! Please keep doing shorts!

  • @jim.haungs
    @jim.haungs Před rokem

    Rails has been doing inflection for over a decade.

  • @joenaveau
    @joenaveau Před rokem

    This is awesome! 🤯

  • @_Half_Byte_
    @_Half_Byte_ Před 11 měsíci

    Ohh that's really beautiful

  • @NyxAndrew
    @NyxAndrew Před 10 měsíci

    Thanks.

  • @jessielinden2961
    @jessielinden2961 Před rokem +2

    @twostraws thank you so much for this! In my use case, I sometimes use fractions, so I've been using a string, which I've found doesn't work with this approach. Any advice for leveraging this for my case?

  • @user-ic2tx9sb1m
    @user-ic2tx9sb1m Před rokem

    Thank you so much❤

  • @patgarner
    @patgarner Před rokem

    Super cool!

  • @carlosswiftdev2703
    @carlosswiftdev2703 Před rokem

    You weren't wrong 🤯 amazing! Paul is this a new feature of has it been around a while?

  • @GregT-gf9ny
    @GregT-gf9ny Před rokem +2

    Wow! How did you find this?

  • @ralfboernemeier9724
    @ralfboernemeier9724 Před rokem

    Cool … never heard about it 😮

  • @user-ib4wj9nf2c
    @user-ib4wj9nf2c Před 9 měsíci

    Super Cool

  • @devayz9305
    @devayz9305 Před rokem

    AGA.. interesting. thank you

  • @enoch8835
    @enoch8835 Před 5 měsíci

    woah this is cool

  • @vasilbaramidze4185
    @vasilbaramidze4185 Před rokem

    Nice!

  • @user-rs3pf3bt7m
    @user-rs3pf3bt7m Před rokem

    Amazing🎉🎉

  • @joenaveau
    @joenaveau Před rokem +2

    Quick question - what’s up with this syntax? What does inflect mean? It seems kind of random. 😅

    • @chocomilkfps1264
      @chocomilkfps1264 Před 3 měsíci

      Think it’s short for “inflection” which means: “a change in the form of a word (typically the ending) to express a grammatical function or attribute such as tense, mood, person, number, case, and gender.”

  • @pawekoaczynski4505
    @pawekoaczynski4505 Před rokem

    That is very nice

  • @seccat
    @seccat Před 7 měsíci +1

    What 6 Languages are supported?

  • @mathesonstep
    @mathesonstep Před rokem

    That is amazing

  • @ahikmatf
    @ahikmatf Před 7 měsíci

    HOLY MOLY GUACAMOLE

  • @mmoriarty
    @mmoriarty Před 2 měsíci

    Accurate. 🤯

  • @casperes0912
    @casperes0912 Před rokem +1

    Is there a compile-time checked version of this not relying on string literals in the Text constructor? Like Text("\(count) [person]").inflect(true)
    or something like that?

    • @casperes0912
      @casperes0912 Před rokem

      @hydro1337x I mean sure, but that is a less ideal setup I think

  • @sebasyanni1258
    @sebasyanni1258 Před 4 měsíci

    What is inflex?im just beginning with swift.. thanks for your help

  • @Deadpool25mm
    @Deadpool25mm Před rokem

    Cool!

  • @angelmanuel727
    @angelmanuel727 Před 9 měsíci

    💪🏼🙌🏼💪🏼

  • @dskygn
    @dskygn Před měsícem

    I have so many questions about how does it actually work.

  • @VladislavVaz
    @VladislavVaz Před 10 měsíci

    can someone help me please ..
    i have a SWIFTUI application with a flow as follows: A(landscape orientation)->B(landscape)-C(portrait)->D(portrait). also when I navigate back from C to B it should turn back to landscape as B is in landscape. (I am using NavigationLink in my application to navigate)How do I achieve the portrait lock in swiftUI.
    i tried the .onAppear{} and .onDisappear{} method.. (firstly it is no longer available on ios 16 and secondly it gives a choppy animation where the view does not expand fully to take the new rotated screen size; there is white space after it rotates)

  • @Deadlineru
    @Deadlineru Před rokem

    Really non-obvious feature...)) And which languages are supported? I consider, English only, or some bunch of Eu languages. But that's cool, maybe, it will be more convenient to use in future releases)

  • @danvilela
    @danvilela Před 9 měsíci +1

    What 6 languages? Also.. is this a runtime thing?

  • @EdmundTrujillo
    @EdmundTrujillo Před 8 měsíci

    What does it do when the count is 0?

  • @bobthemagicmoose
    @bobthemagicmoose Před 9 měsíci

    What if you support other languages? How does it handle fallback?

  • @tdrg_
    @tdrg_ Před rokem

    Does it work with iOS 15?

  • @ihwan_id
    @ihwan_id Před rokem

    🎉🎉🎉

  • @akar._.J
    @akar._.J Před 9 měsíci

    Swift is a great programming language. However, the problem is that it is less popular in Asia and third-world countries.

  • @chriswaco
    @chriswaco Před rokem +1

    This does not seem to work. Do I have to put the singular and plural versions into a localizable.strings file too?

    • @ColeDano
      @ColeDano Před rokem

      Same for me. Changing the String type to LocalizedStringKey fixes it however.

    • @chriswaco
      @chriswaco Před rokem +1

      @@ColeDano Bingo. Thank you.

  • @rondamon4408
    @rondamon4408 Před 9 měsíci +1

    I'm flipping

  • @alanwill
    @alanwill Před 10 měsíci

    😮

  • @30guarino
    @30guarino Před rokem

    so I'm the only one that can't get that 'carrot sign' by tapping 'shift' + 'control'?

    • @AlexCrocker
      @AlexCrocker Před rokem

      It's the carot sign above the number 6 key, not the one above control

    • @30guarino
      @30guarino Před rokem

      @@AlexCrocker thank you lol

  • @AlanW
    @AlanW Před rokem +2

    This is cool, but the short format is awful, you can't scrub the video if you want to go forward or back.

  • @xingzhexin8843
    @xingzhexin8843 Před rokem

    I'm sorry I've programmed for so long in UIKit and SwiftUI that nothing really sur...
    IM SORRY WHAT DID YOU JUST DO?

  • @alan.otoole
    @alan.otoole Před 10 měsíci

    Woah what

  • @plskz
    @plskz Před rokem

    whaaat

  • @jorge1869
    @jorge1869 Před 8 měsíci

    Go flutter

  • @androidfanatic6528
    @androidfanatic6528 Před rokem

    Still needs work at 0

  • @orihpt
    @orihpt Před rokem

    bro?

  • @pedro8769
    @pedro8769 Před 10 měsíci

    wtf

  • @christianremboldt1557
    @christianremboldt1557 Před 7 měsíci

    This shouldn't be a thing in my opinion

  • @matthewdolan720
    @matthewdolan720 Před rokem

    😮