原创 4.UIViewController

UIViewController UIViewController簡單的說就是視圖控制器, 用於view的管理, 數據的處理. 1. UIViewController的跳轉(無導航欄) 利用前面學習的知識, 我們實現下面的需求:

原创 10.UIProgressView

UIProgressView UIProgressView看名字就知道這是一個進度條了, 使用非常簡單, 下面我們學習如何使用它 1. UIProgressView創建 let progressView = UIProgressV

原创 12.UISwitch

UISwitch UISwitch就是一個開關, 用起來也非常簡單, 下面我們學習如何使用它 1. UISwitch創建 let switchView = UISwitch(frame: CGRect(x: 200, y: 20,

原创 14.UIPickerView

UIPickerView UIPickerView就是一個滑動選擇控件,下面我們學習如何使用它 1. UIPickerView的創建 let pickerView = UIPickerView(frame: CGRect(x: 0

原创 34. 多線程之NSOperation和NSOperationQueue

NSOperation NSOperation是GCD面向對象的封裝, 它有更多的特性. 文檔中說NSOperation是一個抽象類, 不要直接使用它,使用它的子類或定義一個繼承它的類.它的子類有 NSInvocationOper

原创 15.UIScrollView

UIScrollView UIScrollView用於當視圖太大時,可以滾動來瀏覽整個界面, 下面我們學習如何使用它,並實現一個引導頁. 1. UIScrollView的創建 let scrollView = UIScrollVi

原创 11.UISlider

UISlider UISlider就一滑塊,我們學習如何使用它 1. UISlider的創建 let slider = UISlider(frame: CGRect(x: 10, y: 30, width: 350, height

原创 7.UITextField

UITextField UITextField即文本框,可以輸入文本.我們將學習它的使用 1. UITextField創建 import UIKit class ViewController: UIViewController

原创 6.UITabBarController

UITabBarController UITabBarController實現底部切換的效果非常方便,如下圖 下面我們學習如何實現這種效果 1. UITabBarController的創建 AppDelegate.swift中

原创 9. UIActionSheet

UIActionSheet UIActionSheet和UIAlertView非常類似, 我們將學習如何使用它 1.UIActionSheet創建 import UIKit class ViewController: UIVie

原创 16.UISegmentedControl

UISegmentedControl UISegmentedControl怎麼說呢, 就是一個可以選擇的控件,下面運行實例的時候就知道它是什麼樣的了, 下面我們學習如何使用它 1. UISegmentedControl創建 let

原创 2.UIImageView

UIImageView UIImageView用於顯示圖片,我們將學習UIImageView的常用方法. 1. 添加一張圖片到項目中 爲什麼使用這張圖片呢? 因爲本人是射手座! 2. 創建UIImageView import U

原创 8.UIAlertView

UIAlertView UIAlertView可用來顯示提示信息,下面我們學習如何使用它 1. UIAlertView的創建 let alertView = UIAlertView() alertView.delegate = s

原创 1.UILabel

UILabel UILabel在iOS中用來顯示文本, 我們將學習UILabel的一些常用方法的使用 1. 創建UILabel import UIKit class ViewController: UIViewControlle

原创 5.UINavigationController

UINavigationController UINavigationController即有導航欄的的UIViewController.它可以非常方便的進行界面的切換. 1. UINavigationController的創建