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);
}
}
}