This file contains hidden or 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
func fetchWeatherHistory(completion: @escaping ([Double]) -> Void) { | |
// 복잡한 네트워크 로직수행. 여기서는 단순하게 100,000개의 온도배열 생성 | |
DispatchQueue.global().async { | |
let results = (1...100_000).map { _ in Double.random(in: -10...30) } | |
completion(results) | |
} | |
} | |
func calculateAverageTemperature(for records: [Double], completion: @escaping (Double) -> Void) { | |
// fetchWeatherHistory에서 넘어온 온도배열의 평균값을 구함 |
This file contains hidden or 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
func fetchWeatherHistory(completion: @escaping ([Double]) -> Void) { | |
// 복잡한 네트워크 로직수행; 여기에서는 단순히 100,000개의 온도배열을 랜덤생성함 | |
DispatchQueue.global().async { | |
let results = (1...100_000).map { _ in Double.random(in: -10...30) } | |
completion(results) | |
} | |
} | |
func calculateAverageTemperature(for records: [Double], completion: @escaping (Double) -> Void) { | |
// Sum our array then divide by the array size |
This file contains hidden or 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
func fetchBookShop(bookShopName: String) async -> [String] { | |
// fetch book shop logic... | |
return ["fetch Book Shop Result"] | |
} | |
func fetchBooks(bookName: String) async -> [String] { | |
// fetch books logic... | |
return ["fetch Books Result"] | |
} |
This file contains hidden or 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
func fetchBookShop(bookShopName: String, completion: @escaping (_ matchBookShopList: [String]) -> Void) { | |
DispatchQueue.global().async { | |
// fetch book shop logic... | |
completion(["fetch Book Shop Result"]) | |
} | |
} | |
func fetchBooks(bookName: String, completion: @escaping (_ books: [String]) -> Void) { | |
DispatchQueue.global().async { | |
// fetch books logic... |
This file contains hidden or 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
func fetchBookShop(bookShopName: String, completion: @escaping (_ matchBookShopList: [String]) -> Void) { | |
DispatchQueue.global().async { | |
// fetch book shop logic... | |
completion(["fetch Book Shop Result"]) | |
} | |
} | |
func fetchBooks(bookName: String, completion: @escaping (_ books: [String]) -> Void) { | |
DispatchQueue.global().async { | |
// fetch books logic... |
This file contains hidden or 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
func fetchBookShop(bookShopName: String, completion: @escaping (_ matchBookShopList: [String]) -> Void) { | |
DispatchQueue.global().async { | |
// fetch book shop logic ... | |
completion(["fetch Book Shop Result"]) | |
} | |
} |
This file contains hidden or 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
func fetchBookShop(bookShopName: String, completion: @escaping (_ matchBookShopList: [String]) -> Void) { | |
DispatchQueue.global().async { | |
completion(["fetch Book Shop Result"]) | |
} | |
} |
This file contains hidden or 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
func fetchBookShop(bookShopName: String, completion: @escaping (_ bookShop: [String]) -> Void) { | |
let result: [String] = fetch logic ... | |
completion(result) | |
} |
This file contains hidden or 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
override func viewDidAppear(_ animated: Bool) { | |
super.viewDidAppear(animated) | |
setupUI() | |
connectUIControls() | |
createDataSource() | |
listenForChanges() | |
} |
This file contains hidden or 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
class MainStepper: Stepper { | |
let steps = PublishRelay<Step>() | |
private let disposeBag = DisposeBag() | |
var initialStep: Step { | |
return FlowSteps.mainSearchIsRequired | |
} | |
} |
NewerOlder