按照这里的文档:
https://trigger.io/docs/current/api/native_modules/native_events.html#ios
那个参考:
我试图实现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
答案 0 :(得分:1)
我将签名更改为:并且它开始工作了吗?什么?
+ (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{