DTLoupeView – Cocoanetics https://www.cocoanetics.com Our DNA is written in Swift Thu, 19 Nov 2015 08:41:44 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.3 39982308 DTRichTextEditor 1.6.12 + DTLoupe 1.5.8 https://www.cocoanetics.com/2015/11/dtrichtexteditor-1-6-12-dtloupe-1-5-8/ https://www.cocoanetics.com/2015/11/dtrichtexteditor-1-6-12-dtloupe-1-5-8/#respond Thu, 19 Nov 2015 08:41:44 +0000 https://www.cocoanetics.com/?p=9990 These updates to DTRichTextEditor and DTLoupe address some tenacious crashes occurring from invalid geometry of sublayers.

Changes

  • FIXED: Invalid Geometry Crash fix
  • FIXED: Orientation problems under iOS 9

Thanks to Hirad Motamed, Amro Mousa and Dominik Pich. They came together on GitHub to work out the fixes in concert.

The update is tagged on GitHub and also published on Cocoapods.

]]>
https://www.cocoanetics.com/2015/11/dtrichtexteditor-1-6-12-dtloupe-1-5-8/feed/ 0 9990
DTRichTextEditor Goes Open Source https://www.cocoanetics.com/2015/06/dtrichtexteditor-goes-open-source/ https://www.cocoanetics.com/2015/06/dtrichtexteditor-goes-open-source/#comments Mon, 22 Jun 2015 16:07:09 +0000 http://www.cocoanetics.com/?p=9737 Development on DTRichTextEditor had started in 2011, several years before Apple revamped the internals of UITextView to TextKit. I based it on DTCoreText – which had been open source from the start – and added a custom magnifying glass to mimic the one provided by the system. As of today, I am making it Open Source.

Back in 2011, I saw a market for a rich text editing component as there was nothing anywhere to be found to achieve that. With every passing WWDC we could be anxious to see if Apple had finally made it obsolete. But Apple only slightly revamped UITextView in iOS 6 (2012) and more thoroughly replaced the text view innards with TextKit in iOS 7 (2013). But little has changed about rich text in UIKit since then, it is still is missing important features like support for lists and floating images.

A Mild Success

When I started my component business in January 2008 I was doing pretty well selling specialized components. But for the last several years the income from components has all but subsided. DTRichTextEditor was the only component that kept selling a few licenses every now and then. I attribute this to the above mentioned shortcomings of UITextView.

Over it’s lifetime so far, 86 clients bought commercial licenses for using the rich text editor component in their app store apps, some to get support for lists, some for inline graphics. The most famous being Mailchimp who used it in their iPad app. But even those occasionally sold licenses were far in between.

Even though this number of sold licenses might sound much it is nowhere near enough to pay for the endless hours of work I spend on it. Let alone the work that came from several volunteers who received free licenses for the editor in exchange for their contributions.

The Support Problem

Supporting such a complex component would probably be enough work for a full time developer. The one-off license model for components only works if there is no ongoing support cost. Or if you have enough new sales to pay for ongoing development. Unfortunately I did never have the chutzpah to charge a support subscription, as many other vendors of commercial components do. But this apparently is the only sustainable model.

For a long time I have been wrangling with myself, going back and forth over what to do with this favorite project of mine. It does have some value still, but not enough to be viable commercially. I spent months on it, but I would never make enough to warrant any more investment into it.

So I decided to draw the line here, one week after WWDC 2015. I decided to move DTRichTextEditor and DTLoupe onto GitHub. My top component there is DTCoreText: it is getting contributions and much usage. I am hoping that the Open Source community there will also love to use and contribute to the editor.

The Logistics

Earlier today I cloned the two repos from my private GitLab server onto public GitHub repos: DTRichTextEditor, DTLoupe. The URLs for the git submodules as well as the podspecs were updated to point to the new locations.

The license was changed from a specialized commercial one to my standard 2-clause BSD license. You can use it for free in your apps with attribution, or buy a non-attribution license from me. Or you can contribute and then you can use it for free without attributing it to me. How does that sound?

There are a few pressing issues inherent in the project. DTLoupe has a crashing bug that – I think – comes from an internal racing condition in UIKit using the old-style renderInContext: methods for taking snapshots of view. It is my hope that somebody can figure this out and provide a fix. Or better yet, modernize it to use the newer, faster view snapshotting methods.

I am hoping that people whose app’s value proposition depends on the editor are willing to provide a bounty for the person who provides a fix.

]]>
https://www.cocoanetics.com/2015/06/dtrichtexteditor-goes-open-source/feed/ 3 9737
DTRichTextEditor 1.6.8 + DTLoupe 1.5.5 https://www.cocoanetics.com/2014/09/dtrichtexteditor-1-6-8-dtloupe-1-5-5/ https://www.cocoanetics.com/2014/09/dtrichtexteditor-1-6-8-dtloupe-1-5-5/#respond Thu, 18 Sep 2014 12:36:13 +0000 http://www.cocoanetics.com/?p=9274 This update for DTRichTextEditor and DTLoupe hot fixes an issue with loupe rotation under iOS 8.

DTLoupe 1.5.5 Changes

  • FIXED: Rotation problem on iOS 8

DTRichTextEditor 1.6.8 Changes

  • CHANGED: Update to DTLoupe 1.5.5

The root cause of the problem is that iOS no longer sets the transform on the root view because Apple generally wants to do away with the concept of interface orientation. DTLoupeView was updated to use the status bar orientation, root view controller’s interfaceOrientation, or if all fails calculates it from the main window aspect ration and device orientation. We might have to revisit this for iOS 9.

Known issue: DTLoupeView adds a custom UIWindow so that it is not part of the main view hierarchy. This causes the status bar to reappear if you had it hidden. Dealing with this would take some work and architectural changes. I believe that most users of DTRichTextEditor would leave the status bar visible anyway, so I won’t do anything about that.

The update is available via the private Cococapods Spec to existing customers and in the private GitLab repository.

]]>
https://www.cocoanetics.com/2014/09/dtrichtexteditor-1-6-8-dtloupe-1-5-5/feed/ 0 9274
DTRichTextEditor 1.6.6 https://www.cocoanetics.com/2013/12/dtrichtexteditor-1-6-6/ https://www.cocoanetics.com/2013/12/dtrichtexteditor-1-6-6/#respond Wed, 18 Dec 2013 13:49:55 +0000 http://www.cocoanetics.com/?p=8893 This is a maintenance release for DTRichTextEditor. It contains only updates for the involved submodules.

DTRichTextEditor 1.6.6

  • CHANGED: Updated DTLoupe to 1.5.4
  • CHANGED: Updated DTCoreText to 1.6.10
  • CHANGED: Updated DTFoundation to 1.6.1

DTLoupe 1.5.4

  • FIXED: iOS 6 compatibility issue workaround by moving loupe content delegate into separate class
  • FIXED: Warning about incorrect animation option
  • CHANGED: Improved loupe content update by using layer display method as opposed to drawing the layer
  • CHANGED: Reverted fix for status bar content mode from 1.5.2

The update is tagged on the private GitLab repo as well as available via podspec on the private Cocoanetics CocoaPods repo. 

]]>
https://www.cocoanetics.com/2013/12/dtrichtexteditor-1-6-6/feed/ 0 8893
DTRichTextEditor 1.6.5 https://www.cocoanetics.com/2013/11/dtrichtexteditor-1-6-5/ https://www.cocoanetics.com/2013/11/dtrichtexteditor-1-6-5/#respond Thu, 21 Nov 2013 15:04:42 +0000 http://www.cocoanetics.com/?p=8854 The update for DTRichTextEditor adds support for building for arm64 and fixes two bugs.

DTRichTextEditor 1.6.5

  • ADDED: support for arm64
  • FIXED: Hyperlink would continue to be extended when typing right of it
  • FIXED: Text get corrupted during Dictation on iOS 7
  • FIXED: Setting the attributed text to nil would not remove selection
  • CHANGED: Updated DTCoreText to 1.6.9
  • CHANGED: Updated DTFoundation to 1.6.0

DTLoupe 1.5.3

  • FIXED: Potential crash when presenting the editor in a modal view controller
  • CHANGED: Improved loupe smoothness when panning
  • CHANGED: Modernized method of getting loupe contents
  • ADDED: Support for arm64

Previously I had a roundf in place when setting the loupe’s frame, which caused it to be moved 2 pixels at a time on Retina displays. There was a quite noticeable difference in smoothness when I changed this round to consider the content scale. Support for arm64 was added which meant that I had to fix a few related warnings.

There were some stability issues when using the editor in some special circumstances where some changes in iOS 7 were wreaking havoc. I hope that this is now resolved by making some changes and cleaning up the way the magnified loupe content is being generated.

Curiously with iOS 7 UITextInput has started to insert 10 spaces ahead of a dictation result. This caused the positions to be off and cause the inserted dictation text to overwrite previously existing text. I also updated the way the dictation result is inserted. I don’t rely on the default calling of insertText: but instead assemble the text myself, which consists of multiple words. Only if the last character is a punctuation character I will add a space now.

Finally I also added a workaround for the reported issue that if you have a hyperlink in your text and type to the right of it it would extend the hyperlink. Now typing inside the hyperlink extends it, otherwise the hyperlink attributes are removed from the typing attributes. The text color and underline style are copied from the default text attributes.

The update is available for customers via tag on the GitLab repo and via private Cocoapod.

]]>
https://www.cocoanetics.com/2013/11/dtrichtexteditor-1-6-5/feed/ 0 8854
Rich Text Update 1.5 https://www.cocoanetics.com/2013/05/rich-text-update-1-5/ https://www.cocoanetics.com/2013/05/rich-text-update-1-5/#comments Wed, 08 May 2013 16:22:41 +0000 http://www.cocoanetics.com/?p=8145 Today we are releasing the 1.5 version of our rich text components. This marks the second unified release where several parts of our rich text eco system are maturing in lock-step.

For the most part these improvements and enhancements were funded from exceptional sales of DTRichTextEditor as well as several sponsors who stepped forward to allow me to finally get support for lists implemented.

From what I can tell the clients who licensed the editor are way more willing to contribute funds to something they have already paid for, than for enhancing the – otherwise free with attribution – DTCoreText.

Here are the collected release notes:

DTRichTextEditor 1.5

  • ADDED: Implemented Support for Ordered and Unordered Lists, editable 1 level
  • CHANGED: Improved handling of nested lists
  • ADDED: Method to set text color for range
  • ADDED: Method to set strikethrough style for range
  • ADDED: HTMLStringWithOptions methods
  • ADDED: Ability to animate between input views (custom keyboards)
  • FIXED: style information would not obey custom CSS stylesheet in textDefaults
  • CHANGED: editing delegate now uses editorView:shouldChangeTextInRange:replacementText: for image pasting
  • ADDED: [DEMO] Formatting View Controller, shown as popover on iPad and input view on iPhone

Online Documentation

DTCoreText 1.5

  • ADDED: Methods for getting glyph path for glyph runs and lines
  • CHANGED: DTTextAttachment is now a class cluster
  • ADDED: Custom text attachments can now opt to participate in inline drawing and/or HTML output
  • FIXED: Loading of font table made asynchronously
  • FIXED: Fonts that have a synthetic slant matrix cause text to disappear
  • FIXED: Shadow:none causes text to disappear
  • FIXED: CSS Attributes were not case-sensitive
  • FIXED: Issue with setting color of HR
  • FIXED: Problems with nested list parsing and DTHTMLWriter output
  • FIXED: HTTPS URLS in web video view where treated as external URLs
  • FIXED: Bug where text attributes would “bleed” into the paragraph break

Online Documentation

DTLoupe 1.5

  • ADDED: sanity check to avoid rare NAN crash

Online Documentation

There is also now a Programming Guide for DTRichTextEditor where I’m collecting guides how to implement frequently asked about things.

I especially would like to thank Lee Hericks for his work on the backend and help with polishing, as well as Daniel Phillips who helped implement the format picker in the Editor demo. Here’s a screenshot.

DTRichTextEditor 1.5

 

Of course work has already begun on the next version. If you need something specific implemented please get in touch.

]]>
https://www.cocoanetics.com/2013/05/rich-text-update-1-5/feed/ 6 8145