Pregunta

Following the docs here:

https://trigger.io/docs/current/api/native_modules/native_events.html#ios

That reference:

https://trigger.io/docs/current/api/native_modules/native/ios/Classes/ForgeEventListener.html#//api/name/willRotateToInterfaceOrientation:duration:

I've tried to implement willRotateToInterfaceOrientation I'me setting debug break points within both the method and conditions and none are being triggered. Testing this this in iOS7 and iOS6 simulators I've seen some posts that say willRotateToInterfaceOrientation is no longer supported in newer versions of iOS. What am I missing?

//mymodule_EventListener.m

#import "mymodule_EventListener.h"

@implementation mymodule_EventListener

//
// Here you can implement event listeners.
// These are functions which will get called when certain native events happen.
//

+ (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInt duration:(NSTimeInterval)duration {
    if (UIInterfaceOrientationIsLandscape(toInt)) {
        [[ForgeApp sharedApp] event:@"mymodule.orientation_is_landscape" withParam:nil];
    } else {
        [[ForgeApp sharedApp] event:@"mymodule.orientation_is_portriat" withParam:nil];

    }
}


@end
¿Fue útil?

Solución

I changed the signature to: and it started working? what?

+ (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top