How to Set UITableViewCellStyleSubtitle and dequeueReusableCell in Swift?

前端 未结 13 1051
攒了一身酷
攒了一身酷 2020-12-01 05:03

I\'d like a UITableView with subtitle-style cells that use dequeueReusableCellWithIdentifier.

My original Objective-C code was

13条回答
  •  广开言路
    2020-12-01 05:46

    Perfect as suggested by Michael G. Emmons, but in Xcode 6.1 using

    if !cell { .....
    

    I get this error:

    Optional type '@|value UITableViewCell?' cannot be used as boolean ; test for '!= nil' instead

    The accepted syntax is:

    if cell == nil { ...
    

提交回复
热议问题