iOS - Adding funrction to SDLUIKitDelegate |
iOS - Adding funrction to SDLUIKitDelegate |
Alex Szpakowski
Guest
|
You can create a subclass of SDLUIKitDelegate and implement it there. I believe it should work as long as you create a SDLUIKitDelegate category to override +(NSString *)getAppDelegateClassName to return the class name of your subclass.
(This is according to comments in SDL_uikitappdelegate.m – I haven’t tried it myself.)
|
|||||||||||||
|
Starg
|
Hi Alex, thanks for the info.
I've successfully added the new call to the SDL appDelegate. Here's how for anyone else interested:
I had to copy SDL_uikitappdelegate.h to the SDL include files so it can be imported and for the class to be found. Not sure if there's a better way round this. But the above works fine. I didn't need to override the getAppDelegateClassName though. |
|||||||||||||
|
Starg
|
Oh, one other thing. I renamed my main.cpp to main.mm and added this code to the top. I'll move it so somewhere more 'proper', but I thought I'd mention it if anyone else is trying to get this up and running quickly.
|
|||||||||||
|