willAnimateRotationToInterfaceOrientation未从trigger.io模块侦听器调用

时间:2013-12-11 03:27:14

标签: ios ios7 uiinterfaceorientation trigger.io

按照这里的文档:

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

那个参考:

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

我试图实现willRotateToInterfaceOrientation我在方法和条件中设置调试断点,但没有触发。在iOS7和iOS6模拟器中对此进行测试我已经看到一些帖子说新版本的iOS不再支持willRotateToInterfaceOrientation。我错过了什么?

//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

1 个答案:

答案 0 :(得分:1)

我将签名更改为:并且它开始工作了吗?什么?

+ (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{