Skip to content

Instantly share code, notes, and snippets.

View artem-shmatkov's full-sized avatar
🏠
Working from home

Art Shmatkov artem-shmatkov

🏠
Working from home
View GitHub Profile
@artem-shmatkov
artem-shmatkov / COW-Impl.swift
Last active March 27, 2021 08:22 — forked from LucianoPAlmeida/COW-Impl.swift
Swift example of How to implement COW for custom value types.
final class Ref<T> {
var val : T
init(_ v : T) {val = v}
}
struct Box<T> {
var ref : Ref<T>
init(_ x : T) { ref = Ref(x) }
var value: T {
@artem-shmatkov
artem-shmatkov / COW.swift
Created March 27, 2021 07:55 — forked from LucianoPAlmeida/COW.swift
Copy-on-Write
import Foundation
func print(address o: UnsafeRawPointer ) {
print(String(format: "%p", Int(bitPattern: o)))
}
var array1: [Int] = [0, 1, 2, 3]
var array2 = array1
//Print with just assign
@artem-shmatkov
artem-shmatkov / simulator.apns
Created June 11, 2020 14:06
Testing push notifications in Xcode simulator. Just donwload and drag the file to simulator window.
{
"Simulator Target Bundle": "<your app's bundle id>",
"aps": {
"alert": {
"title": "Push Notification",
"subtitle": "Test Push Notifications",
"body" : "Testing Push Notifications on iOS Simulator",
}
}
}
@artem-shmatkov
artem-shmatkov / simulator.apns
Created June 11, 2020 14:06
Testing push notifications in Xcode simulator. Just donwload and drag the file to simultor window.
{
"Simulator Target Bundle": "com.testapp.TestPushNotifications",
"aps": {
"alert": {
"title": "Push Notification",
"subtitle": "Test Push Notifications",
"body" : "Testing Push Notifications on iOS Simulator",
}
}
}