Commit 5c8aa125 by Daniel Dahan

issue-891: Fixed conflict with addAttributes method in the NSMutableAttributedString extension

parent 736ce394
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '2.10.3'
s.version = '2.10.4'
s.license = 'BSD-3-Clause'
s.summary = 'A UI/UX framework for creating beautiful applications.'
s.homepage = 'http://materialswift.com'
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.10.3</string>
<string>2.10.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -32,45 +32,34 @@ import UIKit
extension NSMutableAttributedString {
/**
Adds a Dictionary of NSAttributedStringKeys for a given range.
- Parameter _ keys: A Dictionary of NSAttributedStringKey type keys and Any type values.
- Parameter range: A NSRange.
*/
open func addAttributes(_ keys: [NSAttributedStringKey: Any], range: NSRange) {
for (k, v) in keys {
addAttribute(k, value: v, range: range)
}
}
/**
Updates a NSAttributedStringKey for a given range.
- Parameter _ key: A NSAttributedStringKey.
- Parameter _ name: A NSAttributedStringKey.
- Parameter value: Any type.
- Parameter range: A NSRange.
*/
open func updateAttribute(_ key: NSAttributedStringKey, value: Any, range: NSRange) {
removeAttribute(key, range: range)
addAttribute(key, value: value, range: range)
open func updateAttribute(_ name: NSAttributedStringKey, value: Any, range: NSRange) {
removeAttribute(name, range: range)
addAttribute(name, value: value, range: range)
}
/**
Updates a Dictionary of NSAttributedStringKeys for a given range.
- Parameter _ keys: A Dictionary of NSAttributedStringKey type keys and Any type values.
- Parameter _ attrs: A Dictionary of NSAttributedStringKey type keys and Any type values.
- Parameter range: A NSRange.
*/
open func updateAttributes(_ keys: [NSAttributedStringKey: Any], range: NSRange) {
for (k, v) in keys {
open func updateAttributes(_ attrs: [NSAttributedStringKey: Any], range: NSRange) {
for (k, v) in attrs {
updateAttribute(k, value: v, range: range)
}
}
/**
Removes a Dictionary of NSAttributedStringKeys for a given range.
- Parameter _ keys: An Array of attributedStringKeys.
- Parameter _ attrs: An Array of attributedStringKeys.
- Parameter range: A NSRange.
*/
open func removeAttributes(_ keys: [NSAttributedStringKey], range: NSRange) {
for k in keys {
open func removeAttributes(_ attrs: [NSAttributedStringKey], range: NSRange) {
for k in attrs {
removeAttribute(k, range: range)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment