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 observable = Observable.of(1, 2, 3, 4, 5) | |
let observable2 = Observable.of([1, 2, 3, 4, 5]) | |
------------------------------------------------------------------ | |
let disposeBag = DisposeBag() | |
let apple = "apple" | |
let orange = "orange" | |
let kiwi = "kiwi" |
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
🌞 Morning 100 commits ██▍░░░░░░░░░░░░░░░░░░ 11.4% | |
🌆 Daytime 272 commits ██████▍░░░░░░░░░░░░░░ 30.9% | |
🌃 Evening 331 commits ███████▉░░░░░░░░░░░░░ 37.7% | |
🌙 Night 176 commits ████▏░░░░░░░░░░░░░░░░ 20.0% |
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
test |
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 url = URL(string: "https://httpbin.org/post")! | |
var request = URLRequest(url: url) | |
request.httpMethod = "POST" | |
let task = URLSession.shared.dataTask(with: request) { (data, response, error) in | |
if let error = error { | |
print("error: \(error)") | |
} else { | |
if let response = response as? HTTPURLResponse { | |
print("statusCode: \(response.statusCode)") | |
} |
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 url = URL(string: "https://httpbin.org/get")! | |
let task = URLSession.shared.dataTask(with: url) { (data, response, error) in | |
if let error = error { | |
print("error : "\(error.localizedDescription)") | |
} else { | |
if let response = response as? HTTPURLResponse { | |
print("statusCode : \(response.statusCode)") | |
} | |
if let data = data, let dataString = String(data: data, encoding: .utf8) { |
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
test |
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
class A : CustomStringConvertible { | |
var description: String { | |
return "Class A" | |
} | |
} | |
func someMethod() { | |
let a = A() | |
DispatchQueue.main.async { | |
print(a) // <- referenced by strongly |