-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed emoji glyph and unicode scalar support
Added support for UTF16 ranges to UnicodeScalar ranges. Fixed incorrect UTF16 String indexes being used for parsing Substrings instead of Unicode scalar ranges. Updated Unicode scalar index ranges to be used for String parsing, and UTF16 NSRange used for AttributedText and SelectedText ranges. Fixed new text using emoji fonts if previous or next word, on detection it now defaults to using default text attributes. Improved performance by setting attributes on textStorage instead of reassignment. This may cause an animation which can be cancelled by using UIView.performWithoutAnimation(actions:). Removed String and Substring extensions for retrieving substrings. Added character extension for detecting glyphs or 3byte unicode characters. Version 1.1.0
- Loading branch information
1 parent
5be2dd2
commit 1fb086a
Showing
6 changed files
with
86 additions
and
124 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// Character.swift | ||
// AsYouTypeFormatter | ||
// | ||
// Created by Philip on 16/03/19. | ||
// Copyright © 2018 Next Generation. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
extension Character { | ||
var isUTF16: Bool { | ||
return unicodeScalars.count == 1 && !unicodeScalars.contains(where: { unicodeScalar -> Bool in | ||
unicodeScalar.value > UTF16Char.max | ||
}) | ||
} | ||
} |
Oops, something went wrong.