对应WinFrom 或者 MFC 或者 C#
1. Model->Delegate->Controller(IBAction,IBOutlet….等)->Delegate->View(Storyboard)
2. Model(UIXXXXDataSource+UIXXXXDelegate) Interface
3. IB Action IB Outlet 事件
4. FirstResponder, resign 辞职 焦点
5. 第四章P165 如何使用plist作为数据库,使用NSCoding 序列化,NSArray,NSDictionary都实现了该协议 XML序列化
6. 导航栏,视图栈,navigationController.pushView
7. iOS也有模式对话框的概念 模式对话框
8. NSNotificationCenter Message Queue
9. NSSortDescriptor 排序接口
10. Core Data LINQ DataSet
以下CoreData内容太古老 iOS4,简单了解一下结构
11. NSFetch:查找 NSManageObject:实体
12. NSPersistentContainer CoreData 栈
13. 数据迁移:Add Model Version菜单
14. NSFetch LINQ SQL
15. 照相机/Alert
class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
@IBOutlet weak var imageView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func pickImage(_ sender: Any) {
let action = UIAlertController(title: "赶紧选", message: nil, preferredStyle: UIAlertControllerStyle.actionSheet);
let cameraAction = UIAlertAction(
title: "照相机呗!",
style: UIAlertActionStyle.default) { (action) in
let picker = UIImagePickerController();
picker.sourceType = UIImagePickerControllerSourceType.camera;
picker.delegate = self;
picker.allowsEditing = true;
self.present(picker, animated: true, completion: nil);
}
let cancelAction = UIAlertAction(
title: "Cancel",
style: UIAlertActionStyle.default) { (action) in
// ...
}
action.addAction(cameraAction);
action.addAction(cancelAction);
self.present(action, animated: true, completion: nil);
}
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
self.dismiss(animated: true, completion: nil);
}
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
imageView.image = info[UIImagePickerControllerEditedImage] as! UIImage?;
self.dismiss(animated: true, completion: nil);
}
}
16.