Find UILabel in UIView in Swift
问题 I'm trying to find my UILabels in my superview of my UIViewControllers. This is my code: func watch(startTime:String, endTime:String) { if superview == nil {println("NightWatcher: No viewcontroller specified");return} listSubviewsOfView(self.superview!) } func listSubviewsOfView(view: UIView) { var subviews = view.subviews if (subviews.count == 0) { return } view.backgroundColor = UIColor.blackColor() for subview in subviews { if subview.isKindOfClass(UILabel) { // do something with label.. }