I want to convert to Swift from Objective-C code like following;
int sum = 0;
x = 1;
for (int i = 0; i < 100; i++) {
sum += x;
}
x is ac
If you want to use x from anywhere, then you need to write this variable like this, var x = 0
Updated code :
Let us know if any confusion here.