Commit 5c8aa125 by Daniel Dahan

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

parent 736ce394
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '2.10.3' s.version = '2.10.4'
s.license = 'BSD-3-Clause' s.license = 'BSD-3-Clause'
s.summary = 'A UI/UX framework for creating beautiful applications.' s.summary = 'A UI/UX framework for creating beautiful applications.'
s.homepage = 'http://materialswift.com' s.homepage = 'http://materialswift.com'
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.10.3</string> <string>2.10.4</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -32,45 +32,34 @@ import UIKit ...@@ -32,45 +32,34 @@ import UIKit
extension NSMutableAttributedString { 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. Updates a NSAttributedStringKey for a given range.
- Parameter _ key: A NSAttributedStringKey. - Parameter _ name: A NSAttributedStringKey.
- Parameter value: Any type. - Parameter value: Any type.
- Parameter range: A NSRange. - Parameter range: A NSRange.
*/ */
open func updateAttribute(_ key: NSAttributedStringKey, value: Any, range: NSRange) { open func updateAttribute(_ name: NSAttributedStringKey, value: Any, range: NSRange) {
removeAttribute(key, range: range) removeAttribute(name, range: range)
addAttribute(key, value: value, range: range) addAttribute(name, value: value, range: range)
} }
/** /**
Updates a Dictionary of NSAttributedStringKeys for a given 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. - Parameter range: A NSRange.
*/ */
open func updateAttributes(_ keys: [NSAttributedStringKey: Any], range: NSRange) { open func updateAttributes(_ attrs: [NSAttributedStringKey: Any], range: NSRange) {
for (k, v) in keys { for (k, v) in attrs {
updateAttribute(k, value: v, range: range) updateAttribute(k, value: v, range: range)
} }
} }
/** /**
Removes a Dictionary of NSAttributedStringKeys for a given 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. - Parameter range: A NSRange.
*/ */
open func removeAttributes(_ keys: [NSAttributedStringKey], range: NSRange) { open func removeAttributes(_ attrs: [NSAttributedStringKey], range: NSRange) {
for k in keys { for k in attrs {
removeAttribute(k, range: range) 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