Given an enumeration such as MPMusicShuffleMode, which has 4 cases, what's the best way *cycle* through them?

So you are doing this en masse not just for one or three types? :thinking: What exactly is your app doing?

Ideally we could add CaseIterable on Obj-C imported types, but there must be a (good?) reason it is currently impossible.

I'm rather curious what you app is doing. If O(n) behaviour is a potential concern, that means either N is big, or next is called frequently, (or both); what is it you are using "cycling through enums" for?

One possible solution - during the first call next may iterate through all items in O(n) time and construct "array of next elements", so the subsequent next calls work in O(1) time.

See this thread.