View.animation(_:,value:) doesn't seem to work inside TabView with tabViewStyle(.page). There is no animation when the value changes. The same code works as expected without TabView.
I was able to reproduce on iOS 17.5 and iOS 17.2. iOS 16.4 is working correctly.
STEPS TO REPRODUCE:
Run the attached code
Wait for yellow to load
Wait for 2 seconds for green to load (there is no animation even though there should be)
import SwiftUI
struct ContentView: View {
@State private var loaded = false
var body: some View {
TabView {
ZStack {
if loaded {
Color.green
} else {
Color.yellow
}
}
.animation(.default, value: loaded)
.task {
do {
try await Task.sleep(for: .seconds(2))
loaded = true
} catch {
// no-op
}
}
}
.tabViewStyle(.page)
}
}
Has anyone else seen this behavior?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
In an m3u8 manifest, audio EXT-X-MEDIA tags usually contain CHANNELS tag containing the audio channels count like so:
#EXT-X-MEDIA:TYPE=AUDIO,URI="audio_clear_eng_stereo.m3u8",GROUP-ID="default-audio-group",LANGUAGE="en",NAME="stream_5",AUTOSELECT=YES,CHANNELS="2"
Is it possible to get this info from AVPlayer, AVMediaSelectionOption or some related API?
The save credentials prompt is not shown after clicking the submit button in the following setup. The prompt is shown if I move the email field before the login field.
Is it really required to have login and password fields at the end of the registration form? Or is there some API that can trigger the prompt?
struct FakeRegistrationView: View {
@State private var login = ""
@State private var password = ""
@State private var repeatPassword = ""
@State private var email = ""
var navigateBack: () -> Void
var body: some View {
VStack(spacing: 16) {
TextField("Login", text: $login)
.textFieldStyle(.roundedBorder)
.textContentType(.username)
.disableAutocorrection(true)
.autocapitalization(.none)
.frame(maxWidth: 300)
SecureField("Password", text: $password)
.textFieldStyle(.roundedBorder)
.textContentType(.newPassword)
.disableAutocorrection(true)
.autocapitalization(.none)
.frame(maxWidth: 300)
SecureField("Repeat password", text: $repeatPassword)
.textFieldStyle(.roundedBorder)
.textContentType(.newPassword)
.disableAutocorrection(true)
.autocapitalization(.none)
.frame(maxWidth: 300)
TextField("Email", text: $email)
.textFieldStyle(.roundedBorder)
.textContentType(.emailAddress)
.disableAutocorrection(true)
.autocapitalization(.none)
.frame(maxWidth: 300)
Button {
Task {
try? await Task.sleep(for: .seconds(2))
navigateBack()
}
} label: {
Text("Submit")
}
.buttonStyle(.borderedProminent)
}
}
}