I want to display selected contacts on a label which could be scrolled like in Snapchat. After going through lot of questions on stackoverflow I have used Textview since it is scrollable.
@IBOutlet weak var selectedContactsDisplay: UITextView!
selectedContactsDisplay.delegate = self
selectedContactsDisplay.backgroundColor = UIColor.appColor()
selectedContactsDisplay.textColor = UIColor.white
selectedContactsDisplay.textContainer.maximumNumberOfLines = 1
selectedContactsDisplay.textContainer.lineBreakMode = NSLineBreakMode.byTruncatingHead
let stringOne = selectedContactName.joined(separator: ",")
selectedContactsDisplay.text = stringOne
func textViewDidBeginEditing(_ textView: UITextView) {
textView.resignFirstResponder()
}
But, the horizontal scrolling is still not possible. Can someone help me on how can the enable the scrolling.