Skip to content

Instantly share code, notes, and snippets.

View cooler333's full-sized avatar
๐Ÿ˜Š

Dmitrii Cooler cooler333

๐Ÿ˜Š
View GitHub Profile
import Foundation
var array = [1, 2, 3]
for number in array {
print(number) // 1
array = [4, 5, 6]
}
print(array) // 2
import Foundation
class A: NSObject {
weak var delegate: B?
}
class B: NSObject {
weak var delegate: A?
}
import Foundation
class Object {
let identifier: String
init(identifier: String) {
self.identifier = identifier
}
}
protocol MutableCollectionProtocol {
import Foundation
var count = 0
let group = DispatchGroup()
group.enter()
let thread1 = Thread {
for _ in 0...9999 {
count += 1
}
// Swift Playground example of Redux JS framework
import Foundation
import PlaygroundSupport
// MARK: Action
public protocol Action {
associatedtype T = Any
import Foundation
import PlaygroundSupport
import Combine
PlaygroundPage.current.needsIndefiniteExecution = true
let queue = DispatchQueue(label: "some")
_ = Future<String, Never> { promise in
queue.asyncAfter(deadline: .now() + 2, execute: {
print(Thread.current)
import Foundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
// 1
struct User: Equatable {
// 2
struct Address: Equatable {