Post

Replies

Boosts

Views

Activity

How to show SwiftUI PhotosPicker programatically
Hi I would like to show the PhotosPicker programatically the same way we can do with sheet(isPresented: Binding<Bool>) and fullScreenCover(isPresented: Binding<Bool>), i.e. I would like: photosPicker(isPresented: Binding<Bool>, selectedItem: Binding<PhotosPickerItem?>). This would allow me to have multiple buttons that show the picker and would make all my code that shows sheets consistent, thanks for reading.
2
1
2.9k
Jan ’23
How to fix the issue in the code shown at 21:40
At 21:40 in the video the following code is shown: (sorry for the screenshot but this talk doesn't have code copy enabled) Luca points out this results in new view and storage every time dayTime changes. Say you wanted to fix it so it doesn't create a new view and storage every time, how would you do that? Like this maybe? var body: some View { let cr = CatRecorder() if dayTime { return cr.nightTimeStyle() } else { return cr } } But this code doesn't look very declarative. I've seen many struggle with applying modifiers conditionally (especially .hidden()) so thought I'd ask.
1
0
1.5k
Jun ’21
Please fix the "remember me" feature
Every day I visit the forums I have to sign in again despite having ticked the "remember me" check box on the login form. Having to sign in again to make the simplest action of upvoting an answer makes me not want to bother. Safari Version 13.1.1 (15609.2.9.1.2) macOS Catalina 10.15.5 (19F101)
Replies
4
Boosts
0
Views
2.2k
Activity
Dec ’21
How to show SwiftUI PhotosPicker programatically
Hi I would like to show the PhotosPicker programatically the same way we can do with sheet(isPresented: Binding<Bool>) and fullScreenCover(isPresented: Binding<Bool>), i.e. I would like: photosPicker(isPresented: Binding<Bool>, selectedItem: Binding<PhotosPickerItem?>). This would allow me to have multiple buttons that show the picker and would make all my code that shows sheets consistent, thanks for reading.
Replies
2
Boosts
1
Views
2.9k
Activity
Jan ’23
How to fix the issue in the code shown at 21:40
At 21:40 in the video the following code is shown: (sorry for the screenshot but this talk doesn't have code copy enabled) Luca points out this results in new view and storage every time dayTime changes. Say you wanted to fix it so it doesn't create a new view and storage every time, how would you do that? Like this maybe? var body: some View { let cr = CatRecorder() if dayTime { return cr.nightTimeStyle() } else { return cr } } But this code doesn't look very declarative. I've seen many struggle with applying modifiers conditionally (especially .hidden()) so thought I'd ask.
Replies
1
Boosts
0
Views
1.5k
Activity
Jun ’21
More detail on .backgroundTask(.urlSession("isStormy")) shown at 11:50
In the slides at 11:50 the following code snippet is shown: .backgroundTask(.urlSession("isStormy")) { // ... } Please could you explain what should be done in this block? The video just cuts off right after and seems like the explanation is missing. Thanks.
Replies
3
Boosts
4
Views
2.2k
Activity
Jul ’22