View options, video details screen

This commit is contained in:
Arkadiusz Fal
2021-07-08 00:39:18 +02:00
parent 6d35394ffd
commit 4a733f5a30
27 changed files with 652 additions and 108 deletions

View File

@@ -1,8 +1,15 @@
extension CaseIterable where Self: Equatable {
func next() -> Self {
func next(nilAtEnd: Bool = false) -> Self! {
let all = Self.allCases
let index = all.firstIndex(of: self)!
let next = all.index(after: index)
if nilAtEnd == true {
if next == all.endIndex {
return nil
}
}
return all[next == all.endIndex ? all.startIndex : next]
}
}

View File

@@ -0,0 +1,6 @@
import Siesta
import SwiftyJSON
extension TypedContentAccessors {
var json: JSON { typedContent(ifNone: JSON.null) }
}