按照此处的文档进行操作:
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
最佳答案
我将签名更改为:它开始工作了吗?什么?
+ (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
关于ios - willAnimateRotationToInterfaceOrientation 未从trigger.io 模块监听器调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20509950/