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

'WorkoutStoreProtocol' should not be only for classes #1

Open
indisoluble opened this issue Feb 16, 2017 · 0 comments
Open

'WorkoutStoreProtocol' should not be only for classes #1

indisoluble opened this issue Feb 16, 2017 · 0 comments

Comments

@indisoluble
Copy link
Member

'WorkoutStoreProtocol' defines the interface for a store, so it will be more likely implemented by a class given that a struct would be copied on each assignment instead of being shared by reference. However, the reason why I forced this protocol to be conformed only by classes is because I pass a 'WorkoutStoreProtocol' instance to 'ListWorkoutsModuleConfigurator' where I set the property 'delegate' to a value. Unless I specify this protocol is only for classes, Swift assumes it could be a struct passed as a parameter to a function, in which case (and unless I also specify it is a inout param) I am not allowed to modify 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

No branches or pull requests

1 participant