I am writing a Swift application and have difficulty adding a member variable of type Int.
I created a variable with
let index:Int
then in the initializer I created it using
self.index = 0
Later, when I try to increase it in function using any of
self.index++
or
self.index = self.index + 1
In the first case, I said that "cannot call" ++ "with an argument of type" Int ", and in the second case," cannot assign "pos" to "I".
I have not been able to find information about the ++ operator, except that you can write your own versions, but I assume that it is at least built into an integer type. If this is not so, then this answers this question.
Another question that I do not know about.
Thanks!
ios swift
NumberOneRobot
source share