the navigationBarTitle string var I was using was not private , I make it private, and now the navigationBarTitle don't pass to the root view, when I am not using the timer. Now im fighting with a countodown timer I have as a navigationBarItems trailing, and that one is getting fuzzy, and all the bar appears on the root view.
thanks
Post
Replies
Boosts
Views
Activity
I don't know how to edit the question again, sorry. The private var resolution was a false alarm, the counter is the problem, when I do the left-edge,i see more of the root vies, the counter immediately stops, and if I stays on the destination view then timer becomes blurry, and if I tap on < Back, the root view appears with the navigationBar of the destination view. If I go all the way to the right, the root view appears fine, without the destination view bar.
it only happens when the timer is working .
I don't know how to edit the question again, sorry again.
when I begin the left-edge scrolling, that I see the root view, the navigationBarItems(trailing), stop to upgrade the counter, but the timer continue working, (I print my var onBarRighTitle, and continue upgrading), when I stop the scrolling and stay in the destination view, the text receive again the output, and becomes blurry.
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
NavigationLink(destination: SecondCounter()){
Text("Show Second Counter View")}
.navigationBarTitle("RootView")
}
}
struct SecondCounter : View {
@State var timer: Timer? = nil
@State private var secCounter = 0
var body: some View {
Text("")
.navigationBarTitle("Second Counter View" ,displayMode:.inline)
.navigationBarItems(trailing:Text("\(secCounter)"))
.onAppear {
self.secondCounter()
}
.onDisappear {
self.timer?.invalidate()
self.timer = nil
}
}
func secondCounter () {
timer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true, block: { _ in
self.secCounter += 1
})
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
}
this is the whole program where I get the errors
Resolved !!!!
I use .toolbar IOS 14, and now the problem is not happening. I'm very happy
Your total silence did not help with this question, but I hope somebody, somewhere learned something from it.
Same issue with Xcode 13.2.1, I downloaded from the Application Store, I downloaded from the Developers website, the same error, I cannot enter info on a TextField in Preview, the cursor appear, I can paste, but not enter data from the keyboard. I can enter data when I run the sample in my phone.
I got this answer from : Ioannis Diamantidis - How to fix Xcode Playground getting stuck on "Running".
I am using Xcode version 13.2.1 with a Mac Mini M1.
I went to the playground icon on the top right corner - Hide or show the Inspectors, it says Playground Settings ,
I select in Platform macOs.
now my playground is running perfect, I see the results everywhere
Same problem with Mac Mini M1 , and Xcode 13.2.1(13C100)
The same problem happens to me for a long time, I submitted an issue, and Apple recommend to download Xcode 13.3.1, and macOs 12.4 Beta, now is working perfect, I can enter values with the physical keyboard in any TextField preview.
I don't know if downloading only Xcode 13.3.1 will resolve the problem, I had before 13.2.1 I think