Hardy
Hardy

Reputation: 4796

Xcode 11 beta 4: SwiftUI Preview & Build Phase agvtool incompatible?

I have a project with a variety of views running. All of them can be previewed.

When adding xcrun agvtool next-version -all as run script build phase, the preview breaks.

This is really strange - can this be workaround somehow?

Upvotes: 1

Views: 517

Answers (1)

Sake
Sake

Reputation: 645

A bit late to the party but I just had the same problem,

Xcode exposes an ENABLE_PREVIEWS variable which is set to YES when building for live previews. In other cases it is NO

if [ $ENABLE_PREVIEWS = NO ]; then
   xcrun agvtool next-version -all
fi

Upvotes: 4

Related Questions