                     .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,

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

                if words.count > 0 {
                    return words
                } else {
                    let text = NSAttributedString(string: " ", attributes: [NSAttributedStringKey.font : font])
                    let size = text.size()
                    return [Word(
                        text: text,
