|
Hey guys, just finished the first project and back with a couple of questions. When using ForEach, i get an error when I type ForEach(0...100) instead of ForEach(0..<101). What is the reasoning behind this? In the WeSplit app, I am having a hard time understanding why do we need to add 2 to numberOfPeople when we calculate peopleCount. Paul has talked about how the picker shows 4 but I do not understand the thinking behind. First question of the WeSplit review, option 1 states that SwiftUI allows no more than 10 child views inside each parent. we are then told that if we want to add more, we should place the views inside groups. Are groups here Section? Thanks guys and happy friday :) |
|
You probably understand that The same is true with a I can't really remember the reasoning behind why the
The reason we add 2 to the number of people when calculating the total is becuase the picker basically has an array of options with indeces You can get around this default behavior of the picker by using the If you want to try using the
Then, it will set
Yes, a |
|
I would like to add to
In new version of Xcode 15. You can have more then ten
Would just say that if you have more then 10 views in your code you should start to look at refactoring in to smaller chucks of |
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.