IBAction with switch statement (scaleIndex is the same as sender.tag, so the user selects the scale (basic, rhythm, suppleness))
				switch scaleIndex {
				case 0:
						currentTraining = \.basicTraining
				case 1:
						currentTraining = \.rhythm
				case 2:
						currentTraining = \.suppleness
but this doesn't work What do you mean "doesn't work" ? What do you get ? A compiler error ? A crash ?
Could you show the complete code, with definition of all types, so that we can test ?
Topic:
Programming Languages
SubTopic:
Swift
Tags: