I want to be able to create an object of this struct without having to initialize the 2 optional doubles enter image description here
Asked
Active
Viewed 42 times
1 Answers
0
you can use default value for the properties.
init(presentValue: Double, rate: Double, time: Double, frequency: Double = 0.0) {
...
}
Oscar Cardona
- 36
- 1
- 5
-
thank you. Needed to add the argument "futureValue : Double = 0.0" though – Omar d Feb 26 '20 at 20:01