Post

Replies

Boosts

Views

Activity

Comment on SwiftUI struct var declaration problem
Yes, that would be a simple way. But the question was asking for 2 specific types. So it depends on what Trialenzo intends to do exactly. The test would not be on nil value, but on the type of use to get the expected value in result: if useAsInt { result = Int(value) ?? 0 } else { result = value }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’22