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 ViewProvider: Identifiable { | |
var id: AnyHashable | |
var type: Any | |
var view: AnyView | |
init<ViewType>(view: ViewType) where ViewType: View & Identifiable { | |
self.id = view.id | |
self.type = ViewType.self |
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
// | |
// Montonic.swift | |
// Created by Andrew Eades on 01/04/2020. | |
// Copyright © 2020 Andrew Eades. All rights reserved. | |
// | |
import Foundation | |
public struct Monotonic { |
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
#!/bin/bash | |
# Written in respond to https://twitter.com/simonbs/status/1437678815866654723 | |
DIR="$(echo "$XcodeProjectPath" | cut -f 1 -d '.')" | |
if which /opt/homebrew/bin/swiftlint >/dev/null; then | |
/opt/homebrew/bin/swiftlint $DIR/Sources > $DIR/lint-log.txt | |
else | |
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint" | |
fi |
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
// | |
// How to make Codable versioning tolerable | |
// | |
// Watch the video: https://youtu.be/BOiFrlii13 | |
// | |
// Created by Andrew Eades on 25/05/2021. | |
// | |
// Run as a test in XCode | |
import XCTest |
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
// How to Index String by Int | |
// Andrew Eades | |
// https://www.youtube.com/channel/UC2kOJKUGXfC01YEKH4QjFRA | |
// Paste this into an Xcode Playground | |
import Cocoa | |
var str = "Hello, playground" |
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 UIKit | |
import CloudKit | |
import RealmSwift | |
/// Handles common methods for subscriptions across multiple databases | |
enum CloudKitDatabaseSubscription: String { | |
case `private` | |
case `public` | |
} |