使用 Swift 和 MVC 模式的简单照片应用程序
照片应用
使用Swift和MVC模式
的简单照片应用程序 应用程序启动后,您将看到一个图库视图,“添加”选项可从设备图库或相机上传新照片。用户还可以通过按照片上的“删除”按钮来删除照片。
详细信息视图,用户可以在其中查看完整图像及其详细信息。有一个选项可以使用“编辑”选项更新新照片。
使用MVC的
技术和方法 – MVC代表模型,视图,控制器。它是一种结构设计模式,允许将代码分成 3 组 .
Swift 和 Storyboard – 实现功能和构建用户界面。
CocoaPods – CocoaPods 是一个依赖管理器。
The Model
Define Data Structure (photo lists and photo info), e.g Update application to reflect added photos
The View
Defines UI, e.g Add button, delete button, Imageview etc
The Controller
Contains control logic, e.g receive update from view then notifies model to add/remove objects/items
Libraries used
Swift
SnapKit
Photos
UIKit
Toast_Swift
TODO:
- Smooth loading of images without any flickering
- Capture photo using latest framework AVCam