Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7199

Swift app crashes when I call method from dependecy project (framework)

$
0
0

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!


Viewing all articles
Browse latest Browse all 7199

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>