We are missing ENABLE_PREVIEWS also.
Our use case is:
When builds run we also run tools like SwiftGen, SwiftFormat, SwiftLint.
This is not wanted while working on SwiftUI previews as it just stretches building times and SwiftFormat can alter your code while editing it. Which is quite annoying.
It's not so much a matter of runtime, more about knowing the build configuration in run scripts during a build.
Post
Replies
Boosts
Views
Activity
I tried the solution from and observed that on some changes of the tab the background of my tabbar vanished, letting me fully see underneath content for a split second and then restored to it's previous state.
Also I had issues with NavigationControllers where the NavigationBar is hidden on some of the ViewControllers. Hiding and unhiding them in view lifecycle methods become visible and animated although the transitionDuration (code from ) was .zero.
So I came up with something else.
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
if let targetIndex = tabBarController.viewControllers?.firstIndex(where: { $0 == viewController }) {
UIView.performWithoutAnimation {
tabBarController.selectedIndex = targetIndex
}
}
return false
}
Basically I'm intercepting normal tab changes by pressing on them and then programmatically perform them instead and suppress the animations.
Just that works great and I couldn't find any issues with it, yet.