Ad

Our DNA is written in Swift
Jump

DTCoreText 1.6.3 + DTRichTextEditor 1.6.2

Two minor version updates are fixing issues in DTCoreText and DTRichTextEditor.

Update: If you have trouble building via CocoaPods please make sure that you have version 0.23 and also refresh your pod specs. I had to – once more – modify the spec to fix a build problem. Sorry for the inconvenience.

DTCoreText 1.6.3

  • FIXED: Some UIKit calls might be occurring on background thread in DTLazyImageView
  • FIXED: Performance problem parsing HTML that had many encoded entities
  • FIXED: Typo in DTAttributedTextView’s contentViewDidLayout
  • FIXED: DTAttributedTextCell Crash on future iOS version
  • CHANGED: CSS Attribute Parser improved to better deal with multi-value attributes
  • CHANGED: Updated DTFoundation to 1.5.1
  • CHANGED: Updated pod spec for CocoaPods 0.23

This release’s MVP is Amro Mousa for contributing the new CSS Attribute parsing.

DTRichTextEditor 1.6.2

  • FIXED: Removed unnecessary test that would prevent redrawing for “empty” contents
  • FIXED: Tapping on editor would cause incorrect scrolling on long documents if the editor was not first responder
  • CHANGED: Updated DTCoreText to 1.6.3

Both releases are tagged on their respective repositories and are also available via CocoaPods. Please note that a change in the DTCoreText pod spec requires that you updated to CocoaPods 0.23, which also was just released.

CocoaPods Update

DTCoreText builds a C-code-version of the default.css file. Before CocoaPods 0.23 this is how we did that:

spec.pre_install do |pod_representation, library_representation|
  Dir.chdir(pod_representation.root + 'Core/Source/') do
    Dir.glob('*.css') do |css_file|
      system '/usr/bin/xxd', '-i', css_file, css_file + '.c'
    end
  end
end

As of 0.23 there is no pre_install any more, instead you need to use prepare_command which runs any script or terminal command from the pod root:

spec.prepare_command = '/usr/bin/xxd -i Core/Source/default.css Core/Source/default.css.c'

Granted the previous version would compile all css files, but since there is only one in the current project, we could simplify this as shown.

Update: The above prepare command had a problem that I only saw when Russ Wetmore reported it to me. xxd uses the entire path for the symbol which caused compiling issues. So I had to fix it such:

spec.prepare_command = <<-CMD
   cd Core/Source
   /usr/bin/xxd -i default.css default.css.c
CMD

There is also change coming that will affect the way how resource bundles (used by DTLoupe) are built. But since the CocoaPods developers are still working out the edge cases I didn’t need to fix anything there for now.

Future iOS Version

There is a known crashing bug for which I have filed Radar rdar://14684188 – you see that if you activate drawing of debug frames. I have a workaround for this, but I am holding off putting it into the master branch because with this in there Apple engineers can use DTCoreText for seeing the exception occur.

One critical bug related to DTAttributedTextCell resulted from an internal change of view hierarchy. That is fixed in this release.

Apart from this there are the usual necessary adjustments to be made in the demo app for some alignment issues being the result from some changes in UIKit. But those are limited to the demo and are therefore not critical.

If somebody wants to help out and fix these for exercise then contact me by mail and I’ll specify the places where some screws need to be tightened.

Shout Outs

We like to mention apps which are using DTCoreText.

KyBook (FREE)

An extremely versatile eBook reader.

KyBook using DTCoreText KyBook using DTCoreText


Tagged as: ,

Categories: Updates

8 Comments »