class StateAnimatorGroup { func add(_ animator: T) where T.State == State {} func set(_ state: State) {} } extension StateAnimatorGroup: StateAnimator where State == String {} protocol StateAnimator { associatedtype State func set(_ state: State) }