Changing value of a variable in an "IF" Condition

Hello,

i am trying to change the value of a variable (called dowweights.apu) in an if statement but I get error: Type ‘()’ cannot conform to ‘View’

The variable dowweights.apu is at first declared to 0 and now I want to declare it to 250.

Do I need a function or is my syntax wrong ?

@ObservedObject var dowweights = DowWeights(apu: 0)

if (firestoreManager.checkmarkapu == true) {

 self.dowweights.apu = 250 
// I am trying to set a new value to the variable "apu"
       
    }
    else {
       
        firestoreManager.updateStatecheckmarkapu(checkmarkapu: false)
        
    }

@pat1984

Hi Pat,

Can you show the code for your entire swift file that you are working on so that we can see the context in which you are using the If statement? I think I know what you might be trying to do but without all of the code it’s a bit hard to explain to you why that it happening.