             }
         }
         
-        if linkDetectionTypes & .UserHandle != nil {
+        if linkDetectionTypes.intersect(.UserHandle) != [] {
             rangesForLinks += getRangesForUserHandlesInText(attributedString.string)
         }
 
-        if linkDetectionTypes & .Hashtag != nil {
+        if linkDetectionTypes.intersect(.Hashtag) != [] {
             rangesForLinks += getRangesForHashtagsInText(attributedString.string)
         }
 
-        if linkDetectionTypes & .URL != nil {
+        if linkDetectionTypes.intersect(.URL) != [] {
             rangesForLinks += getRangesForURLsInAttributedString(attributedString)
         }
 

        if characterIndex <= textStorage?.length {
            if let linkRangeResults = contextLabelData?.linkRangeResults {
                for linkRangeResult in linkRangeResults {
                    let rangeLocation = distance(text.startIndex, linkRangeResult.linkRange.startIndex)
                    let rangeLength = distance(linkRangeResult.linkRange.startIndex, linkRangeResult.linkRange.endIndex)
                    
                    if rangeLocation <= characterIndex &&
                        (rangeLocation + rangeLength - 1) >= characterIndex {

    }
    
    private func addLinkAttributesToLinkRangeResultWithTouches(touches: NSSet!, highlighted: Bool) {
        if let linkRangeResult = getLinkRangeResultWithTouches(touches), attributedText = attributedText {
            self.attributedText = addLinkAttributesToAttributedString(attributedText, withLinkRangeResults: [linkRangeResult], highlighted: highlighted)
        }
    }
    
