swiftui-pipify
swiftui-pipify copied to clipboard
Cannot update view
In a simple view that displays the following text, even if you change the content of the text, the content of the PiP will not be updated. The same result is if you reopen PiP or assign an .id to View.
import SwiftUI
import Pipify
struct ContentView: View {
@State var displayContent = false
@State var isPresented = false
@State var testText = "ABC"
var body: some View {
Button(action: {
testText = "DEF"
}) {
Text("Change text")
}
VStack {
Text(testText)
}
.background() {
Color.white
}
.pipify(isPresented: $isPresented)
.padding()
Button(action: {
isPresented.toggle()
}) {
Text("Start PiP")
}
}
}
