Skip to content

Instantly share code, notes, and snippets.

View IuriiIaremenko's full-sized avatar
✌️

iurii iaremenko IuriiIaremenko

✌️
View GitHub Profile
@IuriiIaremenko
IuriiIaremenko / ImageLoader.swift
Created March 3, 2021 13:15
Example of simple and lightweight service for image caching without any 3rd party dependencies. UIKit + SwiftUI usage example
//
// ImageLoader.swift
//
// Created by Iurii Iaremenko on 05.02.2021.
//
import Foundation
import Combine
import class UIKit.UIImage
@IuriiIaremenko
IuriiIaremenko / ConcurrentSafe.swift
Last active September 13, 2022 06:55
ConcurrentSafe view Property Wrapper
//
// ConcurrentSafe.swift
//
// Created by Iurii Iaremenko on 01.02.2021.
//
import Foundation
/// Property wrapper for safe access and modification of the value across multiple thread/queues.
@propertyWrapper
//
// Logger.swift
//
// Created by Iurii Iaremenko on 7/1/19.
//
import Foundation
import os
import FirebaseCrashlytics
@IuriiIaremenko
IuriiIaremenko / UserDefault.swift
Last active November 3, 2020 08:02
UserDefaults with Property Wrapper
//
// UserDefault.swift
//
// Created by Iurii Iaremenko on 24.10.2019.
//
import Foundation
@propertyWrapper
struct UserDefault<T> {
let key: String
@IuriiIaremenko
IuriiIaremenko / View+DismissKeyboard.swift
Created September 24, 2020 15:52
SwiftUI dismiss keyboard on sroll
#if canImport(UIKit)
extension View {
func dismissKeyboard() {
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
}
}
#endif
extension View {
@IuriiIaremenko
IuriiIaremenko / Inject.swift
Last active September 4, 2022 10:56
Swift Dependency Injection via Property Wrapper
//
// Inject.swift
//
// Created by Iurii Iaremenko on 11.01.2020.
//
import Foundation
@propertyWrapper
public class Inject<Value> {
@IuriiIaremenko
IuriiIaremenko / Mobius 2019
Created October 2, 2019 11:12 — forked from katleta3000/Mobius 2019
Список материалу к докладу "Работаем с сетью эффективно" Ртищев Евгения для Mobius 2019 22-23 мая
1. Очень крутая книжка по сетям (стек OSI) – Charles Severance “Introduction to Network: How the Internet works”
2. URLCache – https://nshipster.com/nsurlcache/
3. Ресёрч HTTP-кеширования с использованием URLCache https://qnoid.com/2016/04/10/A-primer-in-HTTP-caching-and-its-native-support-by-iOS.html
4. Анализ доступности сети:
* SimplePing – https://developer.apple.com/library/archive/samplecode/SimplePing/Introduction/Intro.html
* https://github.com/dustturtle/RealReachability
* https://github.com/ankitthakur/SwiftPing
* https://github.com/lmirosevic/GBPing
* https://github.com/rwbutler/Connectivity
* Баг с 2009 года – https://lists.apple.com/archives/macnetworkprog/2009/May/msg00056.html