Rich Text Editing : The choices In this, my latest article on rich text editing, I will detail the many choices available to developers when planning to create a rich text editor. From UIWebView to UITextView and Core Text, all the latest techniques are here to give you a first look into the (up until recently) mysterious world of rich text editing. UIWebView plus JavaScript hackery The first option and one I have covered before is using a UIWebView with some extensive JavaScript code in order ... Read Full Article
Rich Text Editing : Sample Project As promised I have gone through all the tutorials including the bonus code and some of the requests in the comments to put together a Xcode Project of the Rich Text Editing series. If you haven’t already, check out the iOS5 Rich Text Editing Series. The features of the project include: - Bold, Italics and Underlining - Highlighting (via UIMenuController) - Font Size adjustment - Font Color adjustment - Font adjustment - Undo and Redo - Image insertion - Draggable ... Read Full Article
Rich Text Editing : Draggable Images (Part 7) Previous in the series: - Rich Text Editor : Inserting Images (Part 6) Here it is, the final tutorial in the series where we’ll attempt the most advanced feature yet! In this tutorial we’ll be subclassing UIGestureRecognizer, dealing with and using blocks but most importantly expanding our knowledge of javascript. Javascript : The next step First things first we need to add some javascript to our ‘index.html’ file. Just after the opening html tag add the following code: <script language="text/javascript"> ... Read Full Article
Rich Text Editing : Inserting Images (Part 6) Check out the previous in the series: - Rich Text Editing : Undo and Redo (Part 5) Once you’ve done that, then let’s begin. In this our sixth and penultimate tutorial I will show you how to present a UIImagePickerController in which a user can select an image of their choice and then add the users selected image into the document. Let’s get right to it, in our ‘checkSelection’ method add the following code: UIBarButtonItem *insertPhoto = [[UIBarButtonItem alloc] initWithTitle:@"Photo+" ... Read Full Article
Rich Text Editing : Undo and Redo (Part 5) Check out the previous in the series: - Rich Text Editing : Fonts (Part 4) If you have done that, then lets begin. In this our fifth tutorial we’ll be taking a look at adding undo and redo to our rich text editor. This a rather trivial matter and so should be a quick thing to do. Okay, let’s get stuck in. As we’ve done in almost all our tutorials we need to add some bar button items into the ... Read Full Article
Rich Text Editing : Fonts (Part 4) Previous in the series: - Rich Text Editing : Highlighting and UIMenuController (Part 3) If you have read the third part in this series, then lets begin. In this tutorial we’ll be looking at customising anything and everything related to the font. We’ll begin by adding an option for adjusting the font size and then move on to changing both the font its self and the font color. Before we add our bar button items and everything else we need ... Read Full Article
Rich Text Editing : Highlighting and UIMenuController (Part 3) Previous in the series: - Rich Text Editing : Validation (Part 2) If you have read the second part in this series, then lets begin. In this our third tutorial we’ll look at using execCommand to set the background color of selected text to give it the appearance of a highlight as can be seen in iBook’s. We’ll also look at using UIMenuController to display the highlight button in the menu which appears after selecting text. Let’s get straight into ... Read Full Article
Rich Text Editing : Validation (Part 2) Previous in the series: - Rich Text Editing : A Simple Start (Part 1) If you have read the first part in this series, then lets begin. In this tutorial – the second of the series – we’re going to look a validating our bar button items so the user knows when they have selected text which is bold, italic or has been underlined. note:If you haven’t already please read the previous tutorial in this series, ‘Rich Text Editing : ... Read Full Article