Search code examples
swiftjsqmessagesviewcontroller

How to disable links in Swift


I have built a simple messaging app using jsqmessagesviewcontroller and I was wondering if there would be any way to disable a user from sharing a website url? Thanks


Solution

  • Maybe you can try using 'UIDataDetectorTypes'. Here are the data types it can detect:

    struct UIDataDetectorTypes : OptionSetType {
    init(rawValue rawValue: UInt)
    static var PhoneNumber: UIDataDetectorTypes { get }
    static var Link: UIDataDetectorTypes { get }
    static var Address: UIDataDetectorTypes { get }
    static var CalendarEvent: UIDataDetectorTypes { get }
    static var None: UIDataDetectorTypes { get }
    static var All: UIDataDetectorTypes { get }
    

    }