-1
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let a = UITextView(frame: CGRect(x: 50, y: 50, width: 200, height: 50))
view.addSubview(a)
a.backgroundColor = UIColor.redColor()
let b = c()
a.delegate = b
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
class c:NSObject, UITextViewDelegate {
func textViewDidChange(textView: UITextView) {
print("A")
}
}
textViewDidChange不行swift2:設置TextView的委託不行
請澄清您的問題以及您需要哪些方面的幫助。它可以幫助您獲得更簡潔的答案 – shrmn