Skip to content

Conversation

dkun7944
Copy link

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.


public protocol TwicketSegmentedControlDelegate: class {
func didSelect(_ segmentIndex: Int)
func twicketSegmentedControl(_ segmentedControl: TwicketSegmentedControl, didSelect segmentIndex: Int)
Copy link
Owner

@polqf polqf Feb 20, 2017

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

Copy link
Author

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)?

Copy link
Owner

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

Copy link
Author

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.

@polqf
Copy link
Owner

polqf commented Jun 6, 2017

@dkun7944 are you going to do the changes we talked about 😄 ?

@dkun7944
Copy link
Author

@polqf Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants