概述
自學(xué) iOS 和 Swift 也有一段時間了,最早嘗試寫Demo時都是向著相對較完整的App方向進行的,至此這樣“相對完整的App”也只完成了三個,但是到頭來學(xué)到的最大干貨只有 CoreData 和 JSON解析,大部分時間用在不斷重復(fù)的布局設(shè)置等方面,甚至有時為了畫一些圖標(biāo)都要對著PS扣一晚上。所以對自己的學(xué)習(xí)安排做了一些改變,半個月前開始盡量保證每天寫一個簡單的Demo,當(dāng)然這也是受到一些大佬們的啟發(fā),在網(wǎng)上有不少類似于《自學(xué) iOS - 三十天三十個 Swift 項目 》這樣的文章。
這次練習(xí)計劃的目的完全是為了掌握一些新的知識和技巧,省去了”為了讓Demo看上去更完整“而浪費的時間。
所有的Demo我都已經(jīng)開源——GitHub鏈接 ,我沒有把這些練習(xí)放在一個工程里面所以在下面的每一個Demo的記錄中都會單獨附上鏈接。
因為是自學(xué)所以代碼規(guī)范方面一直有一些問題,但是做練習(xí)的同時也需要不斷參考其他大佬們的代碼,所以整個學(xué)習(xí)計劃其實也是見證自己的代碼逐漸規(guī)范化的一個過程。Demo我會堅持寫,寫這篇文章的目的一方面是希望給有緣看到這篇文章的初學(xué)者們一些幫助,另一方面堅持更新也是對自己學(xué)習(xí)過程的監(jiān)督。
Demo
1.自定義導(dǎo)航欄透明漸變

使用的是自定義導(dǎo)航欄,設(shè)置系統(tǒng)導(dǎo)航欄為透明的方法網(wǎng)上有很多但是在iOS 11中透明的導(dǎo)航欄默認(rèn)為白色還不知道怎么解決,所以先用自定義的代替了。透明漸變的功能在scrollViewDidScroll 這個方法中實現(xiàn),根據(jù)滾動偏移量計算百分比數(shù)值并將其作為導(dǎo)航欄透明度。
2.MapKit簡單使用

MapKit的簡單使用,import前需要進行下面的設(shè)置:

添加地點時我是使用了CoreData,如果只是單純的練習(xí)MapKit是沒必要這樣做的所以也算是對之前的知識做了復(fù)習(xí)。左劃刪除則是iOS 11里的新方法,代替以前的editActionsForRowAtIndexPath 方法:
override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let actionDel = UIContextualAction(style: .destructive, title: "刪除") { (action, view, finished) in
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let context = appDelegate.persistentContainer.viewContext
context.delete(self.fc.object(at: indexPath))
appDelegate.saveContext()
finished(true)
}
actionDel.backgroundColor = UIColor.red
return UISwipeActionsConfiguration(actions: [actionDel])
}
3.圖片無限輪播

使用scrollView實現(xiàn)圖片無限輪播的功能,在scrollView中添加左、中、右三個imageView。使用下面的方法設(shè)置三個imageView的image:
func setImg() {
if index == 0 {
leftImg?.image = UIImage(named: imgs.last!)
midImg?.image = UIImage(named: imgs.first!)
rightImg?.image = UIImage(named: imgs[1])
} else if index == imgs.count - 1 {
leftImg?.image = UIImage(named: imgs[index - 1])
midImg?.image = UIImage(named: imgs.last!)
rightImg?.image = UIImage(named: imgs.first!)
} else {
leftImg?.image = UIImage(named: imgs[index - 1])
midImg?.image = UIImage(named: imgs[index])
rightImg?.image = UIImage(named: imgs[index + 1])
}
}
自動滾動則是通過設(shè)置定時器實現(xiàn)。
4.兩個tableView聯(lián)動

這次的練習(xí)是參考了一位大佬的文章【Swift聯(lián)動】:兩個TableView之間的聯(lián)動,TableView與CollectionView之間的聯(lián)動
在眾多電商類App中都有用到聯(lián)動tableView的形式。
5.新聞點擊展開預(yù)覽

tableView自動行高的使用,設(shè)置行高為 UITableViewAutomaticDimension ,默認(rèn)設(shè)置新聞內(nèi)容label的行高為2,點擊后變?yōu)?(即全部顯示)
需要注意的是使用storyBoard進行約束時,必須將 tableViewCell 的 ContentView 從上到下填滿,否則無法計算出當(dāng)前行高。
6.AVKit簡單使用

系統(tǒng)自帶播放器的簡單使用,點擊cell中的播放按鈕調(diào)用下面的方法:
@objc func playAction(_ sender: UIButton) {
let path = Bundle.main.path(forResource: "清醒夢", ofType: "mp3")
videoPlayer = AVPlayer(url: NSURL(fileURLWithPath: path!) as URL)
playVideoController.player = videoPlayer
self.present(playVideoController, animated: true) {
self.playVideoController.player?.play()
}
}
這里因為我電腦里沒有現(xiàn)成的視頻文件所以偷懶用音頻文件代替了...
7.自定義轉(zhuǎn)場動畫

這個練習(xí)感覺是至今為止寫過最實用的一個??,這次練習(xí)是分成兩次做的。
- 自定義轉(zhuǎn)場動畫,創(chuàng)建跳轉(zhuǎn)和返回的兩個動畫類并分別實現(xiàn)UIViewControllerAnimatedTransitioning協(xié)議,具體的動畫寫在animateTransition()方法里,在fromView(也就是present方法的view)中實現(xiàn)UIViewControllerTransitioningDelegate協(xié)議。這里我是實現(xiàn)了類似于添加導(dǎo)航欄后系統(tǒng)自帶的push動畫。
- 手勢交互,同樣是模仿系統(tǒng)push動畫的拖動返回手勢,在toView中添加pan手勢,創(chuàng)建UIPercentDrivenInteractiveTransition屬性并實現(xiàn)手勢百分比更新,感謝大佬的文章關(guān)于自定義轉(zhuǎn)場動畫,我都告訴你。:
var secondViewController = SecondViewController()
@objc func panAction(panGesture: UIPanGestureRecognizer) {
let panPercent = panGesture.translation(in: self.view).x / self.view.frame.width
switch panGesture.state {
case .began:
self.percentDrivenTransition = UIPercentDrivenInteractiveTransition()
self.dismiss(animated: true, completion: nil)
case .changed:
self.percentDrivenTransition?.update(panPercent)
case .ended, .cancelled:
if panPercent > 0.5 {
self.percentDrivenTransition?.finish()
} else {
self.percentDrivenTransition?.cancel()
}
self.percentDrivenTransition = nil
default:
break
}
}
8.tabBar簡單使用

tabBar的簡單使用,主要是storyBoard上面的用法,前兩個view都是之前的練習(xí)復(fù)制過來的,第三個view則是簡單copy了一下微信的個人信息界面......
(大紅色的導(dǎo)航欄可以說是很蠢了)
9.WKWebView簡單使用

使用WKWebView進行網(wǎng)頁訪問:
let webView = WKWebView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height))
self.view.addSubview(webView)
if let exUrl = URL(string: "https://www.baidu.com") {
let request = URLRequest(url: exUrl)
webView.load(request)
}
注意,蘋果現(xiàn)在要求App內(nèi)訪問的網(wǎng)絡(luò)必須使用HTTPS協(xié)議,但是很多網(wǎng)頁是使用HTTP協(xié)議的,所以需要在 Info.plist 文件內(nèi)做添加圖中的內(nèi)容:

同時復(fù)習(xí)了使用storyboard中的segue進行傳值。
(tableView和網(wǎng)頁訪問的內(nèi)容,可以無視...)
10.拖動手勢&圖片放大

這個練習(xí)是在 自定義動畫第二部分-交互手勢 之前進行的,重點有兩個:
- 練習(xí)pan拖拽手勢的使用,根據(jù)拖拽偏移量計算一些相關(guān)數(shù)值以實現(xiàn)實時的動畫效果,同時也復(fù)習(xí)了動畫的簡單使用
- 將imageView嵌套在ScrollView中,以此實現(xiàn)圖片放大的效果
有兩個小知識點需要注意:
- 實現(xiàn)父視圖半透明而子試圖不透明的效果,可以通過設(shè)置
view.backgroundColor = UIColor.black.withAlphaComponent(0.9)
來實現(xiàn) - 如果要對UIImageView添加點擊、拖拽等手勢,需要先設(shè)置
imageView.isUserInteractionEnabled = true
11.仿聊天界面

這個練習(xí)耗費的時間比較多。
- 最開始的時候我對發(fā)送和接受氣泡的處理是寫在同一個cell里,判斷是發(fā)送消息還是接受消息后將另外一組氣泡圖片和label隱藏,但是仍然需要寫兩個cell(時間cell 和 消息cell),所以我沒有使用storyboard而是想純代碼布局。因為涉及到了自動行高需要做約束,所以使用了SnapKit,但是由于個人能力有限不知道哪里出了錯,失敗了...不能設(shè)置自動行高。所以簡單了解了xib的使用后用xib設(shè)置tableViewCell,同時對發(fā)送接收的處理換了方法——發(fā)送和接收設(shè)置兩個tableViewCell,判斷后返回相應(yīng)的cell,達到了目的效果。
- 信息發(fā)送欄隨鍵盤的彈出和隱藏而改變高度,在viewDidLoad中設(shè)置鍵盤彈出和隱藏的通知并在方法中獲取到鍵盤高度,使用動畫改變發(fā)送欄的高度。
12.仿QQ個人資料頁下拉背景圖放大效果

實現(xiàn)了類似于QQ個人資料頁下拉背景圖放大的效果,依然是在scrollViewDidScroll這個方法里做文章,當(dāng)y方向偏移量<= 0 時,讓圖片的高度等于偏移量也就是將圖片的高度固定不動,計算偏移量和屏幕寬度的比值,增加imageView的寬和高。同時為了整體效果我把第一個練習(xí)里的透明漸變導(dǎo)航欄也加進來了。
13.tableView中嵌入collectionView

實現(xiàn)tableViewCell中嵌入collectionView,點擊collectionView中的圖片,將值傳給tableView后單獨刷新第一行的數(shù)據(jù)實現(xiàn)改變圖片效果。同樣是在電商類App中較常見。
單獨刷新指定的
某個cell或某個section:
let index = IndexPath.init(row: 0, section: 0)
tableView.reloadRows(at: [index], with: .fade)
14.仿登錄界面但實質(zhì)是關(guān)鍵幀動畫練習(xí)



- 昨天本來是想做個模仿Twitter啟動動畫的練習(xí),看了一些成品的Demo后發(fā)現(xiàn),關(guān)鍵幀動畫真的,無敵好玩!??!所以花了點時間看了看有關(guān)關(guān)鍵幀動畫的東西。簡單寫了個動畫但是時間太晚了沒有上傳。
所以今天連同昨天的練習(xí)一起,寫了一個動畫效果勉強還算好看(大概吧)的模擬登錄界面 - duration 設(shè)置動畫時間,在 values 中設(shè)置關(guān)鍵幀,keytimes 中設(shè)置對應(yīng)的時間百分比。timingFunctions中設(shè)置對應(yīng)的速度控制。因為設(shè)置了layer.cornerRadius切割成圓角,所以為了保持按鈕等組件的圓角不變在使用關(guān)鍵幀動畫的同時也混用了基礎(chǔ)動畫。
- 在ListViewController中,模仿大佬的demo做了一個tableViewCell背景顏色梯度變化的效果,并且設(shè)置visibleCells將cell藏在屏幕底部,使用Spring動畫實現(xiàn)彈性效果。
15.本地推送

使用UserNotifications實現(xiàn)本地推送通知,代碼均寫在AppDelegate中。參考自大神故胤道長的 Swift30Projects
16.實現(xiàn)用戶更改頭像操作

調(diào)用系統(tǒng)的相機和相冊,模擬應(yīng)用中用戶更改頭像的操作。使用 UIImagePickerControllerDelegate 和 UINavigationControllerDelegate 這兩個代理,并調(diào)用完成圖片選擇的代理方法實現(xiàn)頭像更改:
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
imgView.image = info[UIImagePickerControllerOriginalImage] as? UIImage
dismiss(animated: true, completion: nil)
}
-
注意:調(diào)用相冊和相機需要獲得訪問權(quán)限,在 Info.plist 文件中設(shè)置:
16-2.jpg
17.tableView設(shè)置索引

給tableView添加索引功能,使用其代理方法 sectionForSectionIndexTitle:
func tableView(_ tableView: UITableView, sectionForSectionIndexTitle title: String, at index: Int) -> Int {
var indexSection : Int = 0
for i in sections {
if i == title {
return indexSection
}
indexSection += 1
}
return 0
}
18.搜索欄使用

搜索欄的使用,定義一個UISearchController,使用UISearchResultsUpdating并實現(xiàn)其代理方法:
func updateSearchResults(for searchController: UISearchController) {
if var text = searchController.searchBar.text {
text = text.trimmingCharacters(in: .whitespaces)
searchFilter(text: text)
marvelTableView.reloadData()
}
}
使用數(shù)組的filter函數(shù)對原始數(shù)據(jù)進行篩選以實現(xiàn)搜索功能:
func searchFilter(text: String) {
self.searchResults = movies.filter({ (movie) -> Bool in
return movie.name.localizedCaseInsensitiveContains(text)
})
}
19.仿微博界面 實現(xiàn)字?jǐn)?shù)限制功能

- 模仿發(fā)微博界面,實現(xiàn)發(fā)微博時字?jǐn)?shù)限制為140字的功能,超出后右下角字?jǐn)?shù)統(tǒng)計label會變?yōu)殚偕?/li>
- 使用通知來實現(xiàn)字?jǐn)?shù)限制功能。在viewDidLoad中添加通知:
NotificationCenter.default.addObserver(self, selector: #selector(textViewNotificationAction(notification:)), name: NSNotification.Name.UITextViewTextDidChange, object: nil)
該通知調(diào)用方法 textViewNotificationAction :
@objc func textViewNotificationAction(notification: Notification) {
let limit: Int = 140
let text = self.textView.text as NSString
if text.length >= limit {
let str = text.substring(to: limit)
self.textView.text = str
self.limitLabel.text = "\(limit)"
self.limitLabel.textColor = UIColor.orange
} else {
self.limitLabel.textColor = UIColor.darkGray
self.limitLabel.text = "\(text.length)"
}
self.weiboDetail = String(text)
}
- 同時復(fù)習(xí)使用通知監(jiān)聽鍵盤的彈出和隱藏,相關(guān)方法參考自簡書 swift實現(xiàn)ios類似微信輸入框跟隨鍵盤彈出的效果
20.幾個自己不常用的控件練習(xí)合集

幾個以前沒用怎么用過的控件的練習(xí)合集,包括選擇器UISegmentedControl、滑塊UISlider、數(shù)字UIStepper、開關(guān)UISwitch。
21.tableView編輯、cell移動、左右側(cè)滑

- 右劃置頂:
func tableView(_ tableView: UITableView, leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let actionTop = UIContextualAction(style: .normal, title: "置頂") { (action, view, finished) in
let first = IndexPath(row: 0, section: 0)
tableView.moveRow(at: indexPath, to: first)
finished(true)
}
actionTop.backgroundColor = UIColor.orange
return UISwipeActionsConfiguration(actions: [actionTop])
}
- 左劃刪除:
func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let actionDel = UIContextualAction(style: .destructive, title: "刪除") { (action, view, finished) in
self.ints.remove(at: indexPath.row)
tableView.deleteRows(at: [indexPath], with: .fade)
finished(true)
}
actionDel.backgroundColor = UIColor.red
return UISwipeActionsConfiguration(actions: [actionDel])
}
- 編輯:
需要先設(shè)置實現(xiàn)代理方法canEditRowAt,返回值為true,練習(xí)中因為需要移動cell所以也需要實現(xiàn)canMoveRowAt,并實現(xiàn)moveRowAt方法:
func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) {
let fromRow = (sourceIndexPath as NSIndexPath).row
let toRow = (destinationIndexPath as NSIndexPath).row
let int = ints[fromRow]
ints.remove(at: fromRow)
ints.insert(int, at: toRow)
}
22.使用截圖完成動畫

使用截屏實現(xiàn)一些動畫效果:
let snapshotView = selectedCell?.snapshotView(afterScreenUpdates: false)!
比如在demo中,CollectionView中的每一個Cell都有一個ImageView,動畫開始前使用上面的代碼給點擊的cell截圖,將其frame設(shè)置與原cell一致,并將原cell隱藏。接下來的位移及大小動畫則均是以該截圖為操作對象。
這種方法在自定義轉(zhuǎn)場動畫時更實用。
23.UIPageViewController的使用

- 練習(xí)中 PageViewController 的子視圖是動態(tài)的,重復(fù)調(diào)用 WebViewController 每一頁只是改變了 WKWebView 加載的url。在 PageViewController 中需要實現(xiàn)UIPageViewControllerDataSource的兩個方法,返回當(dāng)前頁VC的前一個和后一個VC:
func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? {
var index = (viewController as! WebViewController).index
index -= 1
return setViewController(index: index)
}
func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? {
var index = (viewController as! WebViewController).index
index += 1
return setViewController(index: index)
}
在 setViewController 方法中為 WebViewController 設(shè)置相應(yīng)的url和索引并返回
func setViewController(index: Int) -> WebViewController? {
if case 0..<urls.count = index {
let main = UIStoryboard.init(name: "Main", bundle: Bundle.main)
if let webVC = main.instantiateViewController(withIdentifier: "webView") as? WebViewController {
webVC.url = urls[index]
webVC.index = index
return webVC
}
}
return nil
}
- 練習(xí)中使用的url均選自簡書-7日熱門。簡書網(wǎng)址使用HTTP協(xié)議所以需要在 Info.plist 文件中設(shè)置 App Transport Security Settings - Allow Arbitrary Loads 為 YES
24.使用UIPickerView模擬老虎機

- 使用pickerView模擬“老虎機”,模仿概述中提及的大佬的文章中的第14項。
- 使用 arc4random() 方法生成隨機數(shù),在代理方法viewForRow中返回一個UILabel,以隨機數(shù)作為下標(biāo)選擇emojiArray中的Emoji表情并分別賦值給給每一行的label.text:
func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
let pickerLabel = UILabel()
pickerLabel.font = UIFont(name: "Apple Color Emoji", size: 70)
pickerLabel.textAlignment = .center
switch component {
case 0:
pickerLabel.text = emojiArray[Int(arrayOne[row])]
case 1:
pickerLabel.text = emojiArray[Int(arrayTwo[row])]
case 2:
pickerLabel.text = emojiArray[Int(arrayThree[row])]
default:
break
}
return pickerLabel
}
25.簡單的畫板功能

- 思路參考自:swift3.0 CoreGraphics繪圖-實現(xiàn)畫板
- 無視我的丑字 (其實用筆的話我的字還是可以的。。。(自我感覺良好))
- 創(chuàng)建一個DrawView類,重寫draw方法:
override func draw(_ rect: CGRect) {
super.draw(rect)
let context = UIGraphicsGetCurrentContext()
context?.setLineCap(.round)
context?.setLineJoin(.round)
if allLines.count > 0 {
for i in 0..<allLines.count {
let linePoints = allLines[i]
if linePoints.count > 0 {
context?.beginPath()
context?.move(to: linePoints[0])
for j in 0..<linePoints.count {
context?.addLine(to: linePoints[j])
}
context?.setLineWidth(self.lineWidth)
context?.setStrokeColor(strokeColors[i])
context?.strokePath()
}
}
}
if currentPoints.count > 0 {
context?.beginPath()
context?.setLineWidth(self.lineWidth)
context?.setStrokeColor(self.strokeColor.cgColor)
context?.move(to: currentPoints[0])
for i in 0..<currentPoints.count {
context?.addLine(to: currentPoints[i])
}
context?.strokePath()
}
}
26.下拉刷新UIRefreshControl基本使用

- 下拉刷新控件UIRefreshControl的基本使用。
- 設(shè)置兩個保存Emoji表情的數(shù)組:
var emojiArray = ["","","","","","","","??","",""]
let refreshEmojiArray = ["","","","",""]
其中第一個數(shù)組是tableView默認(rèn)顯示的數(shù)據(jù),第二個則是提供給刷新方法使用:
@objc func refreshAction() {
let arcCount = UInt32(self.refreshEmojiArray.count)
let arc = Int(arc4random() % arcCount)
self.emojiArray.insert(refreshEmojiArray[arc], at: 0)
self.tableView.reloadData()
self.refreshControl.endRefreshing()
}
使用arc4random()方法生成隨機數(shù)作為數(shù)組2的下標(biāo),并將對應(yīng)的字符串添加到數(shù)組1的最開始位置(方便觀察刷新效果)。
- 用虛擬機做拖拽的動作真的有點不自在無論是鼠標(biāo)還是觸控板的三只拖拽...所以演示圖片里好多次沒有拖好...
27.通過簡單的單詞翻譯功能Demo練習(xí)JSON解析

- 使用第三方庫:SwiftyJSON進行JSON解析,接口來自扇貝單詞
- 主要目的還是,練習(xí)JSON,所以一些會導(dǎo)致程序崩潰的情況都沒有做處理 比如搜索欄的單詞必須正確不能有空格(好吧我承認(rèn)其實是因為想偷懶了。。。)
- 使用CAGradientLayer做了一個漸變的背景色,顏色提取自iPhone一張內(nèi)置壁紙:
func gradientColors() -> CAGradientLayer {
let topColor = UIColor(named: "topColor")!
let bottomColor = UIColor(named: "bottomColor")!
let gradientColors = [topColor.cgColor, bottomColor.cgColor]
let gradientLocations: [NSNumber] = [0.0, 1.0]
let gradientLayer = CAGradientLayer()
gradientLayer.colors = gradientColors
gradientLayer.locations = gradientLocations
return gradientLayer
}
28.計算最大公約數(shù)和最小公倍數(shù)

老實說,這不算是個練習(xí)。至于為啥寫了這么個東西,是因為前兩天考研的室友,專業(yè)課考C語言,他做的題里有計算這倆東西的題,讓我拿Swift寫一下。然后昨天晚上等球賽的時候,把在playground上寫給他演示的代碼寫成了這個工程。。。
29.tableView分組折疊/展開效果

- 實現(xiàn)tableView分組折疊/展開的效果。
- 參考項目的鏈接我找不到了。。。
- 創(chuàng)建TableViewHeaderViewDelegate協(xié)議,給headerView添加tap點擊手勢并實現(xiàn)協(xié)議方法 tableViewHeaderClick
func tableViewHeaderClick(_ headerView: TableViewHeaderView, section: Int) {
let show = itemData[section].isShow
itemData[section].isShow = !show!
let index = IndexSet(integer: section)
self.tableView.reloadSections(index, with: .fade)
}
- 其實demo中只有一個headerView寫協(xié)議是有點多余了的但是畢竟Swift核心是面向協(xié)議,平時多用協(xié)議對以后的學(xué)習(xí)也有好處
30.Swift 自定義UICollectionViewLayout

- 自定義UICollectionViewLayout 和 UICollectionViewFlowLayout,demo中的兩個效果的教程分別來自UICollectionView自定義布局(二) 和 Swift之用CollectionViewFlowLayout實現(xiàn)LOL皮膚選擇動畫。
- 三個重要方法:prepare(基本數(shù)據(jù))、 shouldInvalidateLayout(允許更新位置)、 layoutAttributesForElements(返回所有UICollectionViewLayoutAttributes)
寫在最后
由于偶爾偷懶,最后用了40天左右的時間寫了這30個小練習(xí),雖然難度都不大但是我通過這30個練習(xí)確實學(xué)到了不少東西。下一步打算開通開發(fā)者賬號,試著以上架App Store為目的寫一個完整的App。
