Post

Replies

Boosts

Views

Activity

How to disable automatic modification of struct to enum in my code
I used struct in the swift file, but once I use xcode build. It will automatically change to enum, causing build failure. But it turns out that this file can be used to build. Since upgrading to XCode16.1, it's not working anymore. I don't know where to set it up. Do not optimize or modify my code. Error message: 'Padding' cannot be constructed because it has no accessible initializers My environment is: macos sequoia 15.1 xcode 16.1(16B40) File source code: let π: CGFloat = .pi let customUserAgent: String = "litewallet-ios" let swiftUICellPadding = 12.0 let bigButtonCornerRadius = 15.0 enum FoundationSupport { static let dashboard = "https://support.litewallet.io/" } enum APIServer { static let baseUrl = "https://api-prod.lite-wallet.org/" } enum Padding { subscript(multiplier: Int) -> CGFloat { return CGFloat(multiplier) * 8.0 } subscript(multiplier: Double) -> CGFloat { return CGFloat(multiplier) * 8.0 } } enum C { static let padding = Padding() enum Sizes { static let buttonHeight: CGFloat = 48.0 static let sendButtonHeight: CGFloat = 165.0 static let headerHeight: CGFloat = 48.0 static let largeHeaderHeight: CGFloat = 220.0 } static var defaultTintColor: UIColor = UIView().tintColor Enum was originally SRTUCT. But the build has been automatically optimized
8
0
93
4d