Skip to content

Instantly share code, notes, and snippets.

@adajos
Last active August 29, 2015 14:24
Show Gist options
  • Save adajos/47253ddba9f5b4bdc830 to your computer and use it in GitHub Desktop.
Save adajos/47253ddba9f5b4bdc830 to your computer and use it in GitHub Desktop.
//: Playground - noun: a place where people can play
import UIKit
let scaleValues = ["10 feet", "100 feet", "100 yards", "400 yards", "800 yard", "1200 yards", "1 mile"]
var scaleLabels = [UILabel]()
for index in 0..<scaleValues.count {
var label = UILabel(frame: CGRectMake((CGFloat(index) + 1 * 100), 10, 100, 25))
label.text = scaleValues[index]
label.backgroundColor = UIColor.yellowColor()
label.textColor = index % 2 == 0 ? UIColor.redColor() : UIColor.blackColor()
scaleLabels.append(label)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment