📅  最后修改于: 2022-03-11 15:00:58.434000             🧑  作者: Mango
enum Fruits: CaseIterable {
case apple, banana, pitahaya, cherry
mutating func loopme() {
let a = Self.allCases
self = a[(a.firstIndex(of: self)! + 1) % a.count]
}
}