sasojadrovski / SJFluidSegmentedControl

A segmented control with custom appearance and interactive animations. Written in Swift 3.0.
MIT License
973 stars 76 forks source link

Make datasource and delegate to be of the correct type. #7

Closed Sweeper777 closed 7 years ago

Sweeper777 commented 7 years ago

Currently, both the datasource property and the delegate property are of type AnyObject?. Why not change them to be of type SJFluidSegmentedControlDatasource? and SJFluidSegmentedControlDelegate? respectively? This way errors can be detected at compile time.

sasojadrovski commented 7 years ago

Hi @Sweeper777,

The dataSource and delegate properties are set to AnyObject? type because they are exposed to interface builder as @IBOutlet properties, therefore they cannot have a non-'@objc' protocol type, such as SJFluidSegmentedControlDataSource or SJFluidSegmentedControlDelegate.