I was working on one of my previous app that was done on Objective C. I need to add a new module to it and I decided to use Swift for that particular module.
I have a class called HomePage
in Objective C, I wanted to add some new IBAction
s and IBOutlet
s in it. For that I added a new swift file and extended the existing class like:
// MARK: IBOutlets and IBActions
extension HomePage
{
@IBOutlet var image : UIImageView!
...
/*!
* Loads the application support webpage
*/
@IBAction func loadSupportURL(sender : UIButton)
{
}
...
}
If I add only the IBActions everything is working perfectly. But when I add an IBOutlet, the compiler throws an error like:
Extensions may not contain stored properties
For fixing it I have two ways,
- Declare the outlet in my Objective C class itself
- Convert the whole Objective C class to Swift and declare the property there
Is there any other way to fix this issue ?