Skip to content

Commit

Permalink
Merge pull request #1 from tilltue/master
Browse files Browse the repository at this point in the history
swift 4.0
  • Loading branch information
inkyfox authored Oct 9, 2017
2 parents e494290 + 6d64840 commit 40b7141
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/KRWordWrapLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ import UIKit
.map { s -> NSAttributedString? in
return s == "" ? nil :
NSAttributedString(string: s,
attributes: [NSFontAttributeName : font, NSForegroundColorAttributeName: self.textColor])
attributes: [NSAttributedStringKey.font : font, NSAttributedStringKey.foregroundColor: self.textColor])
}
.flatMap { t -> Word? in
if let text = t {
let size = text.size()
let spaceWidth = NSAttributedString(string: String(repeating: " ", count: w), attributes: [NSFontAttributeName : font]).size().width
let spaceWidth = NSAttributedString(string: String(repeating: " ", count: w), attributes: [NSAttributedStringKey.font : font]).size().width
w = 1
return Word(
text: text,
Expand All @@ -125,7 +125,7 @@ import UIKit
if words.count > 0 {
return words
} else {
let text = NSAttributedString(string: " ", attributes: [NSFontAttributeName : font])
let text = NSAttributedString(string: " ", attributes: [NSAttributedStringKey.font : font])
let size = text.size()
return [Word(
text: text,
Expand All @@ -137,7 +137,7 @@ import UIKit

do {
let text = NSAttributedString(string: self.ellipsis,
attributes: [NSFontAttributeName : font, NSForegroundColorAttributeName: self.textColor])
attributes: [NSAttributedStringKey.font : font, NSAttributedStringKey.foregroundColor: self.textColor])
let size = text.size()

self.ellipsisWord = Word(
Expand Down

0 comments on commit 40b7141

Please sign in to comment.