brew install rustup
rustup-init
# new shell for env (or source .cargo/env), then:
rustup target add wasm32-wasi
This file contains 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
// | |
// Created by Helge Heß. | |
// Copyright © 2023 ZeeZide GmbH. | |
// | |
import XCTest | |
import UIKit | |
import SwiftData | |
import SwiftUI |
This file contains 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
func isEqual(_ lhs: Any, _ rhs: Any) -> Bool { | |
guard let lhs = lhs as? any Equatable else { return false } | |
func isEqual<T: Equatable>(lhs: T, rhs: Any) -> Bool { | |
guard let rhs = rhs as? T else { return false } | |
return lhs == rhs | |
} | |
return isEqual(lhs: lhs, rhs: rhs) | |
} |
This file contains 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 SwiftUI | |
struct Item: Identifiable { | |
let id = UUID() | |
let title = "Hello" | |
} | |
let items = [ | |
Item(), Item(), Item(), Item(), Item(), Item(), Item(), Item(), Item(), Item(), Item(), | |
Item(), Item(), Item(), Item(), Item(), Item(), Item(), |
This file contains 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
// Created by Helge Heß on 06.04.21. | |
// Also available as a package: https://github.com/ZeeZide/SVGWebView | |
import SwiftUI | |
import WebKit | |
/** | |
* Display an SVG using a `WKWebView`. | |
* | |
* Used by [SVG Shaper for SwiftUI](https://zeezide.de/en/products/svgshaper/) |
This file contains 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 SwiftUI | |
import SwiftData | |
@Model final class Address { | |
let street = "Am Geldspeicher 1" | |
var contact : Contact? | |
init() {} | |
} | |
@Model final class Contact { |
This file contains 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
/** | |
* An Observable property wrapper that only creates the observable | |
* value once. | |
* | |
* Example: | |
* ```swift | |
* @Observable class Item { | |
* } | |
* | |
* struct MyView: View { |
This file contains 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 SwiftUI | |
@Observable class Tester { | |
init() { print("INIT:", ObjectIdentifier(self)) } | |
deinit { print("DEINIT:", ObjectIdentifier(self)) } | |
} | |
struct ContentView: View { | |
struct Nested: View { |
This file contains 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
// | |
// SparkleCommands.swift | |
// Past for iChat | |
// | |
// Created by Helge Heß on 08.04.21. | |
// | |
import SwiftUI | |
#if SPARKLE && canImport(Sparkle) |
This file contains 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
#!/usr/bin/swift sh | |
import MacroExpress // @Macro-swift | |
// MARK: - Parse Commandline Arguments & Usage | |
func usage() { | |
let tool = path.basename(process.argv.first ?? "servedocc") | |
print( | |
""" |
NewerOlder