Home Loop for variables (Xcode 9 - swift 4)
Reply: 0

Loop for variables (Xcode 9 - swift 4)

user572
1#
user572 Published in May 24, 2018, 4:00 pm

I have I think a stupid question for you, but I start Xcode just one week ago and I have a problem with a loop condition.

for index in 1...4 {
    AvatarPlayer1.layer.borderWidth = 4
    AvatarPlayer1.layer.cornerRadius = 8
    AvatarPlayer1.layer.borderColor = UIColor.white.cgColor
    AvatarPlayer1.layer.masksToBounds = false
    AvatarPlayer1.clipsToBounds = true //Mask for picture
}

How can I change the 1 value by for number in the loop. I have try + , + \(index), + index.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.344235 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO