Skip to content

Instantly share code, notes, and snippets.

@katleta3000
katleta3000 / gist:6478752b49860553cdb23846992a234f
Created July 30, 2023 19:34
iOS application push launch processing
import UIKit
import UserNotifications
final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
private let pushAppLaunchRule = PushAppLaunchRule()
var window: UIWindow?
func sceneDidBecomeActive(_ scene: UIScene) {
import PackageDescription
let package = Package(
name: "Core3000",
platforms: [.iOS(.v14)],
products: [
.library(
name: "Core",
targets: ["Core"]
),
1. Apple Guides
https://developer.apple.com/documentation/
2. Интернет ресурсы и рассылки:
MBLT Diggest – https://digest.mbltdev.ru/digests/226
iOS Good Reads – https://t.me/iosgr
https://iosdevweekly.com/
https://www.mikeash.com/
https://nshipster.com/
https://www.natashatherobot.com/
@katleta3000
katleta3000 / Mobius 2019
Last active February 29, 2024 22:08
Список материалу к докладу "Работаем с сетью эффективно" Ртищев Евгения для 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
func compareVersion(version1: String, version2: String) {
let result = version1.compare(version2, options: .numeric)
if result == .orderedDescending {
print("\(version1) > \(version2)")
} else if result == .orderedAscending {
print("\(version1) < \(version2)")
} else {
print("\(version1) == \(version2)")
}
}
@katleta3000
katleta3000 / gist:de3664b6d5d05d948be1605876f78776
Created September 17, 2018 10:14
Capture video in iOS simulator
xcrun simctl io booted recordVideo appvideo.mov
# to interrupt press Ctrl + C