Posts

Post not yet marked as solved
6 Replies
3.8k Views
Is this a bug or why does "white" get printed to console twice but "black" only once in the below code? If I take out the Text() call then it works like I expect (both onAppear modifiers only called once).import SwiftUIstruct ContentView: View { var body: some View { ZStack { Group { Rectangle().fill(Color.black) } .onAppear() {print("black")} Group { Rectangle().fill(Color.white) Text("black on white").foregroundColor(.black) } .onAppear() { print("white")} } }}struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() }}
Posted
by lablodge.
Last updated
.
Post not yet marked as solved
4 Replies
3.1k Views
I am developing a PWA app that includes playing HTML5 audio with voice prompts. Including the visible HTML5 audio play controls distract the user from the visual prompts on the screen and is an unacceptable user experience for our app.On MacOS, Android and Windows we can educate our users to enable autoplay for our app (site) if they want the voice prompts. But does not appear there is such a setting to enable autoplay on iOS and HTML5 audio play is only allowed in a click handler.If a user has installed a PWA app does that signal their intent to treat the site as a native app? If so, coudl this intent be accepted as an explicit opt-in for allowing audio play for that app (site) in the case of iOS?Further, PWA apps also cache their audio using a serviceworker. Thus, for a PWA app intended to function offline like a native app, the audio will only be downloaded once with a corresponding reduced data use on a Cellular network when online.Bottom line - it woudl be appreciated if Apple could please comment on this suggestion - must we design our audio play back to only ever occur in a click handler or would it be possible at some point for the autoplay blocker on iOS to accomodate the case of PWA apps that the user has installed to the device?
Posted
by lablodge.
Last updated
.
Post not yet marked as solved
1 Replies
4.1k Views
I am developing a PWA app and cannot get my serviceworker to register in Chrome, Firefox or Edge on iOS. It registers successfully in Safari on iOS. I am testing on a physical iPhone 7 with iOS v12.4.1.I am not sure what I could be doing wrong, my registration code works as expected on Windows, MacOS and Android with Chrome, Firefox and Edge, same as on iOS in Safari.Does Safari on iOS not use WKWebView like the 3rd parties have to?
Posted
by lablodge.
Last updated
.