Post

Replies

Boosts

Views

Activity

Reply to Xcode 16 no longer sets ENABLE_PREVIEWS=YES for preview builds
I have a couple of use cases here. UseCase1: Detect "Preview Build" so I can skip the linter. As many have already mentioned, having the linter auto-correcting sources while a PreviewBuild confuses Xcode. Xcode complains that source was modified by another application and does not know what to save. Most of use have the linter hooked as a build script. UseCase2: Make the app lighter/simpler for previews. In my large project, some views have really complicated logic and depend on several other components. In the real app those views will render using a special font based on location, language, even the text in it is parsed. I want to be able to detect "Preview Builds" to make it as faster as possible so preview is usable. If I build everything each change will take 10 or more seconds to rebuild so it is not really live for me. I understand the new shiny build is basically the same type as a normal build. That is great!. However the origin of the build is different (Person triggered vs Auto triggered). The target is also different(Real simulator/device that runs the entire logic vs a little environment that shows only the current view) that is why there are valid/real use cases. I hope we get a proper flag/environment variable in the future Duped FB16424982.
Apr ’25