国产探花免费观看_亚洲丰满少妇自慰呻吟_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教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 高唐县| 长治县| 涡阳县| 扶余县| 景德镇市| 固原市| 闽清县| 临澧县| 科技| 苍山县| 大化| 浮山县| 四子王旗| 镇原县| 德江县| 吴旗县| 彭泽县| 桦南县| 陈巴尔虎旗| 常宁市| 胶州市| 汉沽区| 萨嘎县| 沂水县| 沾益县| 凤山县| 克什克腾旗| 安乡县| 贡嘎县| 崇左市| 怀集县| 合水县| 万州区| 龙岩市| 尚志市| 定襄县| 荣昌县| 定日县| 通渭县| 蒲城县| 城市|