Currently you can initialise a class instance variable from a closure: let textView : UITextView = { let t = UITextView() t.translatesAutoresizingMaskIntoConstraints = false t.autocapitalizationType = .none t.autocorrectionType = .no t.spellCheckingType = .no return t }()
However, it doesn’t seem to be possible to return and initialise multiple variables from a closure: let (toolbar : UIToolbar, aButton : UIBarButtonItem) = { // ERROR: Type of expression is ambiguous without more context let toolbar = UIToolbar() let aButton = UIBarButtonItem() return (toolbar, aButton) }() Is this something which, in theory should be supported? Thanks Karl _______________________________________________ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users