小编dre*_*pts的帖子

迅速.正确初始化UITableViewCell层次结构

[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)

xcode uitableview ios swift

8
推荐指数
2
解决办法
3万
查看次数

YouTube API。检查用户是否已订阅

通过 YouTube 数据 API 通过频道 ID 确定授权用户何时订阅 YouTube 频道的最佳方法是什么?我假设通过“Subscriptions.list”API 方法可以以某种方式实现。但具体如何?

youtube api google-api youtube-api

5
推荐指数
1
解决办法
4856
查看次数

标签 统计

api ×1

google-api ×1

ios ×1

swift ×1

uitableview ×1

xcode ×1

youtube ×1

youtube-api ×1