Skip to content
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

Introduce the id type equivalent #6

Closed
wants to merge 1 commit into from
Closed

Introduce the id type equivalent #6

wants to merge 1 commit into from

Conversation

gabrielf
Copy link

@nickoneill
Copy link
Owner

Hi @gabrielf, while I agree that id was the accepted way to do this in Objc and AnyObject is a good direct translation into Swift, the point of these posts is to discover the "right" way to do this in Swift.

In this case, a cast in the method signature makes more sense to me here than just using id and then requiring a line of let sender = sender as UIButton in the function before you use it.

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