質問

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
役に立ちましたか?

解決

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

+ (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top