国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Swift > 正文

Swift開發之UITableView狀態切換效果

2020-03-09 17:47:37
字體:
來源:轉載
供稿:網友

swift,uitableview狀態切換

效果

swift,uitableview狀態切換

源碼

https://github.com/YouXianMing/Swift-Animations

//// TableViewTapAnimationController.swift// Swift-Animations//// Created by YouXianMing on 16/8/7.// Copyright © 2016年 YouXianMing. All rights reserved.//import UIKitclass TableViewTapAnimationController: NormalTitleViewController, UITableViewDelegate, UITableViewDataSource { var adapters : NSMutableArray! var tableView : UITableView! override func setup() {  super.setup()  // TableView.  tableView    = UITableView(frame: (contentView?.bounds)!)  tableView.dataSource  = self  tableView.delegate  = self  tableView.separatorStyle = .None  contentView?.addSubview(tableView!)  // Register cell.  TableViewTapAnimationCell.registerToTableView(tableView, cellReuseIdentifier: nil)  // Data source.  adapters = NSMutableArray()  adapters.addObject(TableViewTapAnimationCell.dataAdapterWithData(TapAnimationModel(name: "YouXianMing", selected: false), cellHeight: 80))  adapters.addObject(TableViewTapAnimationCell.dataAdapterWithData(TapAnimationModel(name: "Animations", selected: false), cellHeight: 80))  adapters.addObject(TableViewTapAnimationCell.dataAdapterWithData(TapAnimationModel(name: "YoCelsius", selected: false), cellHeight: 80))  adapters.addObject(TableViewTapAnimationCell.dataAdapterWithData(TapAnimationModel(name: "iOS-Progrommer", selected: false), cellHeight: 80))  adapters.addObject(TableViewTapAnimationCell.dataAdapterWithData(TapAnimationModel(name: "Design-Patterns", selected: false), cellHeight: 80))  adapters.addObject(TableViewTapAnimationCell.dataAdapterWithData(TapAnimationModel(name: "Arabia-Terra", selected: false), cellHeight: 80))  adapters.addObject(TableViewTapAnimationCell.dataAdapterWithData(TapAnimationModel(name: "Swift", selected: false), cellHeight: 80)) } // MARK: UITableView's delegate & dataSource. func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {  return adapters.count } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {  return tableView.dequeueAndLoadContentReusableCellFromAdapter(adapters[indexPath.row] as! CellDataAdapter, indexPath: indexPath) } func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {  tableView.selectedEventWithIndexPath(indexPath) } func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {  return (adapters[indexPath.row] as! CellDataAdapter).cellHeight! }}

以上所述是小編給大家介紹的Swift開發之UITableView狀態切換效果,希望對大家有所幫助,如果大家有任何疑問歡迎給我留言,小編會及時回復大家的,再此也非常感謝大家對VEVB武林網網站的支持!


注:相關教程知識閱讀請移步到swift教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 鹿泉市| 丹棱县| 抚顺县| 道真| 荣成市| 安塞县| 大石桥市| 杂多县| 太原市| 喀什市| 兴宁市| 五大连池市| 蓝田县| 忻城县| 宁化县| 安宁市| 大兴区| 金溪县| 永胜县| 贡嘎县| 广平县| 石嘴山市| 荔波县| 紫阳县| 望江县| 嘉荫县| 清苑县| 当阳市| 师宗县| 开平市| 虞城县| 景东| 宁津县| 永寿县| 宣武区| 安国市| 邻水| 江津市| 来宾市| 万载县| 叶城县|