     ///     - text: Text that should be formatted.
     ///     - range: Segment of text which format should be toggled.
     ///
-    @discardableResult func toggle(in text: NSMutableAttributedString, at range: NSRange) -> NSRange?
+    /// - Returns: the full range where the toggle was applied
+    ///
+    @discardableResult func toggle(in text: NSMutableAttributedString, at range: NSRange) -> NSRange
 
     /// Apply or removes formatter attributes to the provided attribute dictionary and returns it.
     ///


            text.addAttributes(attributes, range: range)
        }
    }

    /// Toggles the Attribute Format, into a given string, at the specified range.
    ///
    @discardableResult
    func toggle(in text: NSMutableAttributedString, at range: NSRange) -> NSRange? {
        //We decide if we need to apply or not the attribute based on the value on the initial position of the range
        let shouldApply =  shouldApplyAttributes(to: text, at: range)

        if shouldApply {
            applyAttributes(to: text, at: range)
        } else {
            removeAttributes(from: text, at: range)
        }

        return nil
    }
}


            let attributes = apply(to: currentAttributes)
            text.addAttributes(attributes, range: range)
        }

        return rangeToApply
    }

    /// Removes the Formatter's Attributes from a given string, at the specified range.
    ///
    /// - Returns: the full range where the attributes where removed
    ///
    @discardableResult func removeAttributes(from text: NSMutableAttributedString, at range: NSRange) -> NSRange {
        let rangeToApply = applicationRange(for: range, in: text)
        text.enumerateAttributes(in: rangeToApply, options: []) { (attributes, range, stop) in
            let currentAttributes = text.attributes(at: range.location, effectiveRange: nil)
