문제

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