     /// Checks if the specified font trait exists at the specified character index.
     ///
     /// - Parameters:
-    ///     - trait: A font trait.
+    ///     - traits: A font trait.
     ///     - index: A character index.
     ///
     /// - Returns: True if found.
     ///
-    public func fontTrait(_ trait: UIFontDescriptorSymbolicTraits, existsAtIndex index: Int) -> Bool {
+    public func fontTrait(_ traits: UIFontDescriptorSymbolicTraits, existsAtIndex index: Int) -> Bool {
         guard let attr = attribute(NSFontAttributeName, at: index, effectiveRange: nil) else {
             return false
         }
         if let font = attr as? UIFont {
-            return font.fontDescriptor.symbolicTraits.contains(trait)
+            return font.fontDescriptor.symbolicTraits.contains(traits)
         }
         return false
     }

    /// Adds or removes the specified font trait within the specified range.
    ///
    /// - Parameters:
    ///     - trait: A font trait.
    ///     - range: The NSRange to inspect
    ///
    public func toggle(_ fontTrait: UIFontDescriptorSymbolicTraits, inRange range: NSRange) {
        // Bail if nothing is selected
        if range.length == 0 {
            return
        }

        let enable = !self.fontTrait(fontTrait, spansRange: range)

        modify(fontTrait, range: range, enable: enable)
    }

    fileprivate func modify(_ fontTrait: UIFontDescriptorSymbolicTraits, range: NSRange, enable: Bool) {

        enumerateAttribute(NSFontAttributeName,
                           in: range,

    /// Checks if the specified font trait spans the specified NSRange.
    ///
    /// - Parameters:
    ///     - traits: A font trait.
    ///     - range: The NSRange to inspect
    ///
    /// - Returns: True if the trait spans the entire range.
    ///
    public func fontTrait(_ traits: UIFontDescriptorSymbolicTraits, spansRange range: NSRange) -> Bool {
        var spansRange = true

        // Assume we're removing the trait. If the trait is missing anywhere in the range assign it.
