public void SaveToPhotosAlbum(Action <NSError> callback = null) { if (callback == null) { UIImageWriteToSavedPhotosAlbum(Handle, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); } else { UIImageDispatcher dispatcher = new UIImageDispatcher(callback); Callbacks.Subscribe(dispatcher, "__onSaveToPhotoAlbum:", delegate(IntPtr obj, IntPtr e, IntPtr ctx) { callback((e == IntPtr.Zero) ? null : Runtime.GetNSObject <NSError>(e)); dispatcher.Dispose(); }); UIImageWriteToSavedPhotosAlbum(Handle, dispatcher.Handle, ObjC.GetSelector("__onSaveToPhotoAlbum:"), IntPtr.Zero); } }
public void SaveToPhotosAlbum(Action<NSError> callback = null) { if (callback == null) { UIImageWriteToSavedPhotosAlbum(Handle, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); } else { var dispatcher = new UIImageDispatcher(callback); Callbacks.Subscribe(dispatcher, SelectorName, (IntPtr obj, IntPtr e, IntPtr ctx) => { callback(e == IntPtr.Zero ? null : Runtime.GetNSObject<NSError>(e)); dispatcher.Dispose(); }); UIImageWriteToSavedPhotosAlbum(Handle, dispatcher.Handle, ObjC.GetSelector(SelectorName), IntPtr.Zero); } }