iOS Question how to add keyboard change notifications with iEventKit

Alexander Stolte

Expert
Licensed User
Here is a tutorial in objC, but i dont know objC so i dont get it work.
i tried to adapt the code from this thread to my code, but unfortunately without success.

B4X:
Sub AddListener
    Dim no As NativeObject = store
    Dim nstore As NativeObject = no.GetField("store")
    no = Me
    no.RunMethod("addStoreListener:", Array(nstore))
End Sub

Sub Store_Changed(Notification As Object)
    Log(Notification)
End Sub
#if OBJC
- (void)addStoreListener:(EKEventStore*) store {
   [[NSNotificationCenter defaultCenter] notificationCenter.addObserver(self, selector: #selector(adjustForKeyboard), name: UIResponder.keyboardWillChangeFrameNotification, object: nil)];
    NSLog(@"Store listener added"); 
}

- (void)eventStoreChangedNotification:(NSNotification *)notification {
    NSLog(@"Event store changed");
   [self.bi raiseEvent:nil event:@"store_changed:" params:@[notification]];
}
#End If
Thanks
 
Top