Skip to content

Commit

Permalink
Fix full range value (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricky-choi authored May 4, 2021
1 parent 9d77afc commit 6f231be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AttributedStringSugar/Classes/AttributedStringSugar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public extension NSMutableAttributedString {
if let range = range {
self.addAttribute(key, value: value, range: range)
} else {
let range = NSRange(location: 0, length: self.string.count)
let range = NSRange(location: 0, length: length)
self.addAttribute(key, value: value, range: range)
}

Expand All @@ -86,7 +86,7 @@ public extension NSMutableAttributedString {
if let range = range {
self.addAttributes(attrs, range: range)
} else {
let range = NSRange(location: 0, length: self.string.count)
let range = NSRange(location: 0, length: length)
self.addAttributes(attrs, range: range)
}

Expand Down

0 comments on commit 6f231be

Please sign in to comment.