sasojadrovski / SJFluidSegmentedControl

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

updates for Swift 4 #17

Open mathbeat opened 6 years ago

mathbeat commented 6 years ago

This commit fixes the build errors associated with Swift 4.

lucaventura commented 6 years ago

@mathbeat Instead of returning a duplicate colors array to resolve the overlapping access error you can simply force unwrap colors since it is already force unwrapped in the if check:

 if colors!.count == 1 {
 -            colors!.append((colors?.first)!)
}

Can confirm this doesn't cause any crashes.