With swift 4.2 I have begun to see a lot of issues, and one of them i'm not really sure how to resolve, since my getter method should be returning the value itself.
I imagine what is happening is that the getter will attempt to access the getter when calling self.type
How can i resolve this issue?
Here is a screenshot of the code with the error.
Thanks in advance
Here is the written code
@objc var type: DecisionType {
set {
if(newValue == DecisionType.DecisionDouble){
//Yes button and NO button should be showing
okButton.isHidden = true;
yesButton.isHidden = false;
noButton.isHidden = false;
}
else {
//Only Ok button should be showing
okButton.isHidden = false;
yesButton.isHidden = true;
noButton.isHidden = true;
}
}
get {
return self.type;
}
};
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…