IG
Size: a a a
IG
IG
IG
M
M
IG
M
M
IG
M
M
M
IG
IG
M
IG
func popTo(type: Protocol, _ callback: (() -> ())? = nil) {
let currentView = self.views.last!
let foundIndex = self.views.firstIndex {
return $0.conforms(to: type)
}
guard let index = foundIndex else { return}
let views = self.views[0...index]
print(views)
M
func popTo(type: Protocol, _ callback: (() -> ())? = nil) {
let currentView = self.views.last!
let foundIndex = self.views.firstIndex {
return $0.conforms(to: type)
}
guard let index = foundIndex else { return}
let views = self.views[0...index]
print(views)
M
M
extension Array {
@discardableResult
mutating func pop<T>(to type: T.Type) -> Self {
if let index = firstIndex(where: { $0 is T }) {
removeLast(count - index - 1)
}
return self
}
}
IG
self.navigation.popTo(type: TRChoiceEmailOrPhoneViewProtocolType.self)
{}func popTo<T>(type: T.Type, _ callback: (() -> ())? = nil) {
}