     ///
     func remove(from attributes: [String: Any]) -> [String: Any]
 
+    /// Checks if the attribute is present in a dictionary of attributes.
+    ///
+    func present(in attributes: [String: AnyObject]) -> Bool
+
+    /// Checks if the attribute is present in a given Attributed String at the specified index.
+    ///
+    func present(in text: NSAttributedString, at index: Int) -> Bool
+
     /// The range to apply the attributes to.
     ///
     /// By default, this returns the passed `range`, but implementations of this

/// defined style.
///
protocol AttributeFormatter {
    /// Checks if the attribute is present in a dictionary of attributes.
    ///
    func present(in attributes: [String: AnyObject]) -> Bool

    /// Apply the compound attributes to the provided attributes dictionary
    ///

        return string.paragraphRange(for: range)
    }

    func toggle(in text: NSMutableAttributedString, at range: NSRange) {
        let applicationRange = self.applicationRange(for: range, in: text)

        if applicationRange.length == 0 || text.length == 0 {
            insertEmptyAttribute(in: text, at: applicationRange.location)
        }

        toggleAttributes(in: text, at: applicationRange)
    }
}
