- Начать писать логику непосредственно в
mapEventToState,
он у вас быстренько превратится в нечитаемую портянку и придете жаловаться на бойлерплейт.
Если правильно готовить блок, то бойлерплейтом там и не пахнет,
эвенты + стейты + блок умещаются все вместе на 1-2 экранах.
Все запредельно воздушно, даже не надо создавать отдельные файлы под эвенты и стейты.
Все ультра емко получается.
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
| 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 |
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
| 1) Потокобезопасное свойство @SynchronizedLock | |
| https://habr.com/ru/articles/774890/ | |
| 2) Упрощаем работу с UserDefaults. Обертки | |
| https://habr.com/ru/articles/774888/ | |
| 3) Работа с Динамическими Цветами | |
| https://habr.com/ru/articles/774884/ |
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
| import UIKit | |
| import UserNotifications | |
| final class SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
| private let pushAppLaunchRule = PushAppLaunchRule() | |
| var window: UIWindow? | |
| func sceneDidBecomeActive(_ scene: UIScene) { |
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
| import Foundation | |
| /// Про многопоточность 2. GCD | |
| /// https://habr.com/ru/post/578752/ | |
| /// Работа с DispatchGroup в Swift | |
| /// https://supereasydev.medium.com/работа-с-dispatchgroup-в-swift-a2969aeca7c | |
| let dispatchGroup = DispatchGroup() | |
| let queue1 = DispatchQueue(label: "queue1", qos: .background , attributes: [.initiallyInactive, .concurrent]) | |
| let queue2 = DispatchQueue(label: "queue2", qos: .utility, attributes: [.initiallyInactive, .concurrent]) |
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
| // Разное интересное по многопоточности: | |
| // Featured-секция, для любителей архивной документации от Apple: | |
| 1. https://developer.apple.com/library/archive/technotes/tn/tn2028.html#//apple_ref/doc/uid/DTS10003065 - про внутренности потоков в MAC OS X в сравнении с MAC OS 9 | |
| 2. https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/About/About.html - Kernel Programming guide, вы же понимаете, что там будет, да :D | |
| // Для любителей WWDC: | |
| 1. https://developer.apple.com/videos/play/wwdc2015/718/ - GCD раз. |
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
| protocol ViewCode { | |
| func buildLayout() | |
| func buildViewHierarchy() | |
| func buildConstraints() | |
| func configureView() | |
| } | |
| extension ViewCode { | |
| func buildLayout() { | |
| buildViewHierarchy() |
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 TouchesPassView: UIView { | |
| override func hitTest(_ point: CGPoint, | |
| with event: UIEvent?) -> UIView? | |
| { | |
| let view = super.hitTest(point, with: event) | |
| if view === self { | |
| return nil | |
| } | |
| return view |
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 point(inside point: CGPoint, | |
| with event: UIEvent?) -> Bool | |
| { | |
| let inside = super.point(inside: point, with: event) | |
| if !inside { | |
| for subview in subviews { | |
| let pointInSubview = subview.convert(point, from: self) | |
| if subview.point(inside: pointInSubview, with: event) { | |
| return true | |
| } |
NewerOlder