Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Swift Demo #30

Open
anasqadrei opened this issue Oct 3, 2016 · 1 comment
Open

Swift Demo #30

anasqadrei opened this issue Oct 3, 2016 · 1 comment

Comments

@anasqadrei
Copy link

Hello,

Could you please provide a demo app in Swift that handles crashes. I couldn't figure it out. There is no main() in swift. I tried le_handle_crashes() with no luck. Any quick help would be appreciated.

@guptatarun84
Copy link

guptatarun84 commented Oct 19, 2016

Create a ObjC wrapper SomeClass.h & .m and bridge that class in swift. Define function handleCrash() and call it as under

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
SomeClass.handleCrash()
}

//SomeClass.m

  • (void)handleCrash {
    le_handle_crashes();
    }

All you need to take care of bridging the ObjC header to swift class.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants