I'm trying to create a modular architecture in my project but I came across a very strange error.
I have a project called Application and another called Core.
In "Application" I have a storyboard that has a HomeViewController which imports Core.
In the ViewDidLoad of HomeViewController I have a custom button called btnLater of type RGButton which is declared inside of the Core project.
Xcode's Autocomplete recognizes the public methods when I type "self.btnLater." or "RGButton."
RGButton class on Core proejct:
public class RGButton: UIButton {
// corner radius
public func borderRadius(radius : CGFloat) {
self.layer.cornerRadius = radius
}
...
HomeViewController ViewDidLoad() on Application project
...
self.btnLater.layer.cornerRadius = 4
self.btnLater.borderRadius(radius: 4.0)
...
So when I run the project... on the line
self.btnLater.layer.cornerRadius = 4
there is no crash... But on the line
self.btnLater.borderRadius(radius: 4.0)
it crashes with the following error:
Thread 1: EXC_BAD_ACCESS (code=257, address=0x1a258656e61)
I fear that some project configuration may be causing this.. but I need some light to help me figure out what the aliens are doing to my project...
Thanks in advance!