ios - willAnimateRotationToInterfaceOrientation 未从trigger.io 模块监听器调用

标签 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

最佳答案

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

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

关于ios - willAnimateRotationToInterfaceOrientation 未从trigger.io 模块监听器调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20509950/

相关文章:

ios - 防止 UINavigationBar 的 TitleView 动画

ios - 删除 iOS7 中的后退箭头

iphone - 将铃声分配给 iPhone 中的联系人或联系人组

ios - 设置ZBar iOS SDK界面方向?

ios - supportedInterfaceOrientationsForWindow 未在 iPad 中调用

ios - Metal Compute 管道不适用于 MacOS,但适用于 iOS

ios - 从字典数组中删除键值的重复项

ios - 你如何判断 UIImagePickerController cameraOverlayview 是否会旋转?

objective-c - nsdictionary问题

ios - iPhone 5s Touch ID 传感器 API