Skip to content

'WorkoutStoreProtocol' should not be only for classes #1

Description

@indisoluble

'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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions