.Next () enum Swift

enum Fruits: CaseIterable {
    case apple, banana, pitahaya, cherry
    
    mutating func loopme() {
        let a = Self.allCases
        self = a[(a.firstIndex(of: self)! + 1) % a.count]
    }
}
Quaint Quail