Hi Im getting the following error on my class definition
Im getting the following error on my class definition
expected '{' in class
My define Module = Yes bridge.h is setup
embedded content contains swift = Yes
Code is as follows
class HeaderFooterView : UIView {
override init(frame: CGRect){
super.init(frame: frame)
self.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight
self.autoresizesSubviews = true
self.backgroundColor = UIColor.clearColor()
}
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight
self.autoresizesSubviews = true
self.backgroundColor = UIColor.clearColor()
}
}
有什么想法吗?
最佳答案
在类前添加@objc
@objc class HeaderFooterView : UIView {
关于ios - 将 Swift 添加到 Objective-C 项目编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33224459/