Last active
October 27, 2016 13:38
-
-
Save dannycabrera/a4cbec764a2c0ad25d151ceeaf4843c1 to your computer and use it in GitHub Desktop.
Save RTF from UITextView using NSFileWrapper on Xamarin.iOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSError error1 = null; | |
NSError error2 = null; | |
var atts = new NSAttributedStringDocumentAttributes (); | |
atts.DocumentType = NSDocumentType.RTF; | |
using (var wrapper = textView.AttributedText.GetFileWrapperFromRange (new NSRange (0, textView.Text.Length), atts, ref error1)) | |
{ | |
wrapper.Write (new NSUrl ("...Edited.rtf", false), NSFileWrapperWritingOptions.Atomic, new NSUrl ("...Sample.rtf", false), out error2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment