1、protocol声明时不指出base class:

protocol ZXSegmentControlDelegate {
    func didSelect(index:NSInteger)


self.segmentCtl?.delegate = nil

2、protocol声明时指出base class:

protocol ZXSegmentControlDelegate: UIViewController {
    func didSelect(index:NSInteger)

class ZXSegmentControl: UIView {
    weak var delegate:ZXSegmentControlDelegate?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s