I am having trouble creating an outlet collection in Xcode 6. Outlet collections in Xcode 6 now function as regular IBOutlets, and you use the same @IBOutlet attribute to de
You've got it right, you just need to define the array more formally:
@IBOutlet var cardButtons: Array
Now you'll be able to connect the buttons from IB.
The above should work, but still doesn't in Xcode 6 beta 3. A workaround is to use an NSArray until Xcode and Swift can handle this properly:
class ViewController: UIViewController {
@IBOutlet strong var labels: NSArray!
override func viewDidLoad() {
super.viewDidLoad()
for label in self.labels as [UILabel] {
label.textColor = UIColor.redColor()
}
}
}