mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Change trending category button behavior
This commit is contained in:
8
Extensions/CaseIterable+Next.swift
Normal file
8
Extensions/CaseIterable+Next.swift
Normal file
@@ -0,0 +1,8 @@
|
||||
extension CaseIterable where Self: Equatable {
|
||||
func next() -> Self {
|
||||
let all = Self.allCases
|
||||
let idx = all.firstIndex(of: self)!
|
||||
let next = all.index(after: idx)
|
||||
return all[next == all.endIndex ? all.startIndex : next]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user