我已经完成了以下工作.创建自定义接口(.xib)视图和类(在我的示例中称为"CustomView")
func koloda(kolodaNumberOfCards koloda:KolodaView) -> UInt {
return UInt(self.run.count)
}
func koloda(koloda: KolodaView, viewForCardAtIndex index: UInt) -> UIView {
let cell = NSBundle.mainBundle().loadNibNamed("CustomView", owner: self, options: nil).first as? CustomView
let runs = self.run[Int(index)]
cell!.textLabel!.text = runs.type
return cell!
}
Run Code Online (Sandbox Code Playgroud)
数据来源方法
func kolodaViewForCardAtIndex(koloda: KolodaView, index: UInt) -> UIView
Run Code Online (Sandbox Code Playgroud)
接受任何 UIView。因此,只需创建您需要的视图(例如来自 xib)并在此方法中返回它。
| 归档时间: |
|
| 查看次数: |
1127 次 |
| 最近记录: |