Cannot compile the project because of getting SwiftUI errors

I have a project with an iOS deployment target of 10.0.

When I add some SwiftUI views to the project, I can build only debug configuration of it. But when I'm trying to compile the Release configuration, I see the errors like Cannot find type 'View' in scope, or Unknown attribute 'Binding', etc.

As the project has an iOS 10 deployment target, I use the @available(iOS 13.0, *) attribute, like this:
Code Block
import SwiftUI
@available(iOS 13.0, *)
struct GiftView: View { ... }


There is an interesting fact: when I increase the deployment target to iOS 11.0 the Release configuration compiles correctly.

Additional details:
  • the project is only the iPhone iOS deployment target (not iPadOS, macOS).

  • the project uses CocoaPods (probably it somehow affects).

Cannot compile the project because of getting SwiftUI errors
 
 
Q