首先來總括的一下總體的架構和功能: swift
在大概的瞭解了總體的框架以後,咱們來說講主要用到的類: 架構
界面佈局及設計 框架
第一步:完成視圖佈局及界面設計 佈局
第二步:建立頻道類並測試是否可用 學習
ChannelController.swift 測試
繼承:UIViewController 設計
UITableViewDataSource 繼承
UITableViewDelegate 教程
實現方法: 接口
Func tabaleView(tableView:UITableView!,numberOfRowslnSection section:lin)-> lnt
//顯示多少行
Func tableView(tableView:UITableView!,cellForRowAtlndexPath:NSlndexPath!)-> UITableViewCell! //選擇每一行
Func tableView(tableView:UITableView!,didSelectRowAtIndexPath indexPath:NSIndexPath!) //選擇行以後跳轉到主頁面
主界面類
第一步:主界面代碼實現
界面關聯:
繼承:
UIViewController
UITableViewDataSource
UITableViewDelegate
實現方法:
Func tableView(tableView:UITableView!,numberOfRowsInSection section:Int)->Int //顯示多行
Func tableView(tableView:UITableView!,cellForRowAtIndexPath indexPath:NSIndexPath!)->UITableViewCell! //選擇每一行
獲取遠程數據
第一步:把界面元件與代碼關聯
主界面: 圖片、進度條、時間、數據表格等
頻道界面:數據表格等
第二步:建立獲取數據類
HttpController 類
onSearch方法
HttpProtocol接口
Func didReRusults(resultData:NSDictionary)
將這些類什麼的融合一些就能夠把基本的音樂界面弄出來了,進一步的學習能夠參考e良師益友網的IOS課程Swift實戰訓練百度在線音樂案例教程