Created
June 28, 2019 06:01
-
-
Save eunjin3786/c383f7e343e7c3e90d4cee137fc1962b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let stream = Publishers.Just("is Alive?") | |
.delay(for: .seconds(5), scheduler: RunLoop.main) | |
.sink(receiveCompletion: { (completion) in | |
switch completion { | |
case .finished: print("finished") | |
case .failure(let error): print(error) | |
} | |
}, receiveValue: { | |
print($0) | |
}) | |
DispatchQueue.main.asyncAfter(deadline: .now() + 3) { | |
UIApplication.shared.keyWindow?.rootViewController = nil | |
} | |
<Output> | |
viewController deinit | |
is Alive? | |
finished |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment