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 SwiftUI | |
import SUIObject | |
extension View { | |
var object: SUIObject { | |
SUIObject(self) | |
} | |
func navigate(to: Self) -> SUIObject { | |
to.object.configure { |
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
// | |
// ContentView.swift | |
// MetalSwiftUI | |
// | |
// Created by Zach Eriksen on 9/8/20. | |
// Copyright © 2020 oneleif. All rights reserved. | |
// | |
// Inspired [MetalUI](https://github.com/0xLeif/MetalUI) | |
import SwiftUI |
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
iOS: | |
runs-on: macOS-latest | |
steps: | |
- name: Select latest available Xcode | |
uses: maxim-lobanov/[email protected] | |
with: | |
xcode-version: latest | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Since we want to be running our tests from Xcode, we need to |
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 Combine | |
var bag = [AnyCancellable]() | |
struct Color { | |
let name: String | |
let hex: String | |
} | |
extension Color: CustomStringConvertible { |
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
func switched<T: Hashable, O>(_ value: T, | |
cases: [T: O?], | |
default defaultCase: O? = nil) -> O? { | |
guard let switchCase = cases[value] else { | |
return defaultCase | |
} | |
return switchCase | |
} |
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
// | |
// ContentView.swift | |
// Shared | |
// | |
// Created by Zach Eriksen on 6/24/20. | |
// | |
import SwiftUI | |
import SF |
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 SwiftUIKit | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
view.embed { | |
TableView().register(cells: [DataCell.self]) |
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
find -path "./.*" -prune -o -name "*.swift" | grep -i ".swift" | xargs swift format -in-place |
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 | |
import UIKit | |
import Combine | |
extension AnyPublisher { | |
func value(_ closure: @escaping ((Output) -> Void)) -> AnyCancellable { | |
sink(receiveCompletion: { _ in }, receiveValue: closure) | |
} | |
} |
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 BrandedLoadingView: UIView { | |
fileprivate var spinnerView = View() | |
fileprivate var topLeftSpinnerView = View() | |
.layer { $0.addSublayer(dotLayer()) } | |
fileprivate var bottomRightSpinnerView = View() | |
.configure { | |
$0.transform = $0.transform.rotated(by: .pi) | |
} | |
.layer { $0.addSublayer(dotLayer()) } | |