iwontchill
iwontchill
TSDThe Swift Den
Created by iwontchill on 9/4/2023 in #swift-development
How to Rename a Project/App in Xcode
I'm not sure what's the best way in doing this. 👀
3 replies
TSDThe Swift Den
Created by iwontchill on 8/27/2023 in #swift-development
View Changing in Simulator not Preview
I've noticed that these lines of code, whenever I run them in the simulator, it would preview the changes in view. However, whenever I run them in the Xcode preview, it wouldn't change the view at all? I'm quite confused about this.
import SwiftUI

struct IntroductionView: View {

@State private var showSplashScreen = true

var body: some View {
if showSplashScreen {
SplashScreenView(showSplashScreen: $showSplashScreen)
} else {
WelcomeView()
}
}
}

struct IntroductionView_Previews: PreviewProvider {
static var previews: some View {
IntroductionView()
}
}
import SwiftUI

struct IntroductionView: View {

@State private var showSplashScreen = true

var body: some View {
if showSplashScreen {
SplashScreenView(showSplashScreen: $showSplashScreen)
} else {
WelcomeView()
}
}
}

struct IntroductionView_Previews: PreviewProvider {
static var previews: some View {
IntroductionView()
}
}
7 replies