目前,我们正在使用我们的项目该库只读属性... https://github.com/OliverLetterer/SLExpandableTableView如何符合Objective-C的协议与斯威夫特
一个如何去符合在雨燕UIExpandingTableViewCell
协议?
这里有一个副本...
typedef enum {
UIExpansionStyleCollapsed = 0,
UIExpansionStyleExpanded
} UIExpansionStyle;
@protocol UIExpandingTableViewCell <NSObject>
@property (nonatomic, assign, getter = isLoading) BOOL loading;
@property (nonatomic, readonly) UIExpansionStyle expansionStyle;
- (void)setExpansionStyle:(UIExpansionStyle)style animated:(BOOL)animated;
@end
我试过以下,但仍表示,它不符合它...
class SectionHeaderCell: UITableViewCell, UIExpandingTableViewCell {
@objc var loading: Bool
@objc private(set) var expansionStyle: UIExpansionStyle
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
}
required init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setExpansionStyle(style: UIExpansionStyle, animated: Bool) {
}
}
是否因为路UIExpansionStyle是在不使用NS_ENUM的情况下定义的?
混淆
相关http://stackoverflow.com/questions/24151197/getter-and-setter-variable-in-swift – Mats
任何人的任何想法? – kaylanx