public static NSObject observeChanged(UIPasteboard object, final VoidBlock2<UIPasteboard, UIPasteboardChangedNotification> block) { return NSNotificationCenter.getDefaultCenter().addObserver(ChangedNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSDictionary<?, ?> userInfo = a.getUserInfo(); UIPasteboardChangedNotification data = null; if (userInfo != null) { data = new UIPasteboardChangedNotification(userInfo); } block.invoke((UIPasteboard)a.getObject(), data); } }); }
public static NSObject observeChanged(UIPasteboard object, final VoidBlock2<UIPasteboard, UIPasteboardChangedNotification> block) { return NSNotificationCenter.getDefaultCenter().addObserver(ChangedNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSDictionary<?, ?> userInfo = a.getUserInfo(); UIPasteboardChangedNotification data = null; if (userInfo != null) { data = new UIPasteboardChangedNotification(userInfo); } block.invoke((UIPasteboard)a.getObject(), data); } }); }
public static NSObject observeChanged(UIPasteboard object, final VoidBlock2<UIPasteboard, UIPasteboardChangedNotification> block) { return NSNotificationCenter.getDefaultCenter().addObserver(ChangedNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSDictionary<?, ?> userInfo = a.getUserInfo(); UIPasteboardChangedNotification data = null; if (userInfo != null) { data = new UIPasteboardChangedNotification(userInfo); } block.invoke((UIPasteboard)a.getObject(), data); } }); }