如何将数据从父视图控制器传递到Swift中的分段控件视图?

时间:2016-10-03 09:45:06

标签: swift uiview uiviewcontroller uisegmentedcontrol

我有一个带有三个分段视图段的视图控制器。每个部分都有容器。我想将数据从父视图传递到其分段视图..

class UserDetails: UIViewController {
@IBOutlet weak var segmentedControl: UISegmentedControl!
@IBOutlet weak var view1: UIView!
@IBOutlet weak var view2: UIView!
@IBOutlet weak var view3: UIView!
var id = "120"

我想将此变量“id”传递给view1

override func viewDidLoad() {
    super.viewDidLoad()

    // Do any additional setup after loading the view.
    view1.hidden = false
    view2.hidden = true
    view3.hidden = true

    print(self.id)
 }
override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
}

}

我想将变量id传递给view1 ..

0 个答案:

没有答案