[UITableViewCell] < - [genericCell] < - [Cell1],[Cell2],[Cell3]
你好.请想象上面的等级.在我的代码中,我没有完全类型的对象genericCell,但是这个类共享一些属性.
我的代码应该包含哪些设计?我有genericCell的以下结构:
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
//my stuff (initializing shared properties)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
Run Code Online (Sandbox Code Playgroud)
但那怎么样Cell1?我怎样才能调用init(style: UITableViewCellStyle, reuseIdentifier: String?)中genericCell通过的初始化"我的东西"的操作Cell1实例?现在他们没有表演.
编辑
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let typeOfCell = FbDataManager.sharedInstance.posts[indexPath.row][FbDataManager.sharedInstance.typeParameter] as! String
switch typeOfCell {
case self.linkTypeOfPost:
var cell = tableView.dequeueReusableCellWithIdentifier(self.linkCellIdentifier) as? FbLinkPostViewCell
if cell == nil { …Run Code Online (Sandbox Code Playgroud) 通过 YouTube 数据 API 通过频道 ID 确定授权用户何时订阅 YouTube 频道的最佳方法是什么?我假设通过“Subscriptions.list”API 方法可以以某种方式实现。但具体如何?