Skip to content

Instantly share code, notes, and snippets.

View kruperfone's full-sized avatar

Sergei Nikolaev kruperfone

  • Emesa
  • Amsterdam, Netherlands
View GitHub Profile
@kruperfone
kruperfone / Sources.txt
Last active March 20, 2026 09:35
Spy Macro example
Docs
https://docs.swift.org/swift-book/documentation/the-swift-programming-language/macros/
https://docs.swift.org/swift-book/documentation/the-swift-programming-language/attributes/
https://developer.apple.com/documentation/swift/applying-macros
Examples
https://github.com/Matejkob/swift-spyable/tree/0d031775bcc90d6a39f43479d4fe55f7e6a7673f
https://github.com/krzysztofzablocki/Swift-Macros
https://github.com/apple/swift-syntax/blob/main/Examples/Sources/ExamplePlugin/Macros.swift#L92
@kruperfone
kruperfone / StackNavigation.swift
Last active April 1, 2023 18:38
Experiment to adapt SwiftUI navigation stack
// Created by Sergei Nikolaev on 31/03/2023.
//
import SwiftUI
import UIKit
/*
# Navigation plan
## View 1 Routes
#!/usr/bin/swift
/* Git commit hook. Place it into your .git/hooks folder with 'prepare-commit-msg' name
#!/bin/sh
echo "Start prepare-commit-msg hook"
COMMIT_MSG_FILE=$1
COMMIT_SOURCE=$2
#SHA1=$3
#!/usr/bin/xcrun --sdk macosx swift
/*
Create `test.plist` file in project dir
Add `PlistCodeGenerator.swift` file to project dir
Add to build phases: ${PROJECT_DIR}/PlistCodeGenerator.swift
Add output.swift to project target
*/
import Foundation
import UIKit
extension UIViewController
{
// Storyboard identifier from class name
class var storyboardId: String {
var storyboardId = ""
let components = String(describing: self).components(separatedBy: ".")