欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Swift開發(fā)之UITableView狀態(tài)切換效果

 更新時間:2016年08月07日 13:48:04   作者:YouXianMing  
這篇文章主要介紹了Swift開發(fā)之UITableView狀態(tài)切換效果的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下

效果

源碼

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

//
// TableViewTapAnimationController.swift
// Swift-Animations
//
// Created by YouXianMing on 16/8/7.
// Copyright © 2016年 YouXianMing. All rights reserved.
//
import UIKit
class 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開發(fā)之UITableView狀態(tài)切換效果,希望對大家有所幫助,如果大家有任何疑問歡迎給我留言,小編會及時回復(fù)大家的,再此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

  • Swift自定義UITableViewCell背景色

    Swift自定義UITableViewCell背景色

    這篇文章主要為大家詳細(xì)介紹了Swift自定義UITableViewCell背景色,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-01-01
  • swift 3.0 實(shí)現(xiàn)短信驗(yàn)證碼倒計時功能

    swift 3.0 實(shí)現(xiàn)短信驗(yàn)證碼倒計時功能

    這篇文章主要介紹了swift 3.0 實(shí)現(xiàn)短信驗(yàn)證碼倒計時功能的相關(guān)資料,需要的朋友可以參考下
    2017-02-02
  • 蘋果公司編程語言Swift語言簡介

    蘋果公司編程語言Swift語言簡介

    這篇文章主要介紹了蘋果公司編程語言Swift語言簡介,Swift 是一門新的編程語言,兼容Objective-C代碼,是用來代替Objective-C的蘋果主力開發(fā)語言,需要的朋友可以參考下
    2014-07-07
  • Swift5中從原始文本創(chuàng)建字符串的方法

    Swift5中從原始文本創(chuàng)建字符串的方法

    這篇文章主要給大家介紹了關(guān)于Swift5中從原始文本創(chuàng)建字符串的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用Swift5具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-06-06
  • Swift 4中一些實(shí)用的數(shù)組技巧小結(jié)

    Swift 4中一些實(shí)用的數(shù)組技巧小結(jié)

    這篇文章主要給大家分享了關(guān)于Swift 4中一些實(shí)用的數(shù)組技巧,文中通過示例代碼介紹的介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用swift具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧。
    2018-03-03
  • Swift可選值優(yōu)化示例詳解

    Swift可選值優(yōu)化示例詳解

    這篇文章主要為大家介紹了Swift可選值優(yōu)化示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-06-06
  • Swift免費(fèi)短信驗(yàn)證碼實(shí)現(xiàn)及動態(tài)倒計時功能

    Swift免費(fèi)短信驗(yàn)證碼實(shí)現(xiàn)及動態(tài)倒計時功能

    這篇文章主要介紹了Swift免費(fèi)短信驗(yàn)證碼實(shí)現(xiàn)及動態(tài)倒計時功能的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下
    2017-02-02
  • Swift map和filter函數(shù)原型基礎(chǔ)示例

    Swift map和filter函數(shù)原型基礎(chǔ)示例

    這篇文章主要為大家介紹了Swift map和filter函數(shù)原型基礎(chǔ)示例,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-07-07
  • Swift實(shí)現(xiàn)簡單計算器

    Swift實(shí)現(xiàn)簡單計算器

    這篇文章主要為大家詳細(xì)介紹了Swift實(shí)現(xiàn)簡單計算器,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-01-01
  • Swift 3.1聊天界面鍵盤效果的實(shí)現(xiàn)詳解

    Swift 3.1聊天界面鍵盤效果的實(shí)現(xiàn)詳解

    這篇文章主要給大家介紹了Swift 3.1聊天界面鍵盤效果實(shí)現(xiàn)的相關(guān)資料,文中介紹的非常詳細(xì),相信對大家的學(xué)習(xí)或者工作具有一定的參考價值,需要的朋友們下面來一起看看吧。
    2017-04-04

最新評論