在故事板中添加UISegmentedControl
具體添加步聚如下:
選擇Xcode的View菜單下的Show Library (或者Shift+Common+L)
打開控件庫如下
在控件庫中輸入seg搜索控件,在出現Segmented Control后,將其拖到View Controller Scene中
到這里,添加分段控件UI已完成,
接下來將控件與變量關聯:
在ViewController.m中的 @interface ViewController()中添加一個*colorSeg指針
回到故事板,點擊View Controller Scene 下的 View Co