-
Notifications
You must be signed in to change notification settings - Fork 176
Delegate callback now returns instance of TwicketSegmentedControl #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| public protocol TwicketSegmentedControlDelegate: class { | ||
| func didSelect(_ segmentIndex: Int) | ||
| func twicketSegmentedControl(_ segmentedControl: TwicketSegmentedControl, didSelect segmentIndex: Int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about didSelect(_ segmentIndex: Int, on segmentedControl TwicketSegmentedControl) ?
Not a big fan of how UIKit delegate methods are called
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be consistent with the rest of the UIKit delegate methods (even if they're not the best)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should write stuff like UIKit just for consistency when we know they are not correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, makes sense. In that case let's go with the method you suggested.
|
@dkun7944 are you going to do the changes we talked about 😄 ? |
…x: Int, on segmentedControl: TwicketSegmentedControl)
|
@polqf Done! |
The current delegate callback makes it impossible to have multiple TwicketSegmentedControls within one class. This commit fixed this by adding the TwicketSegmentedControl instance to the delegate callback parameters.