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 SpreadsheetView<ColumnView: View, RowView: View, ContentView: View, Column: Hashable, Row: Hashable>: View { | |
init( | |
columns: [Column], | |
rows: [Row], | |
columnWidth: CGFloat, | |
columnHeight: CGFloat, | |
rowWidth: CGFloat, | |
rowHeight: CGFloat, |
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
public protocol LayoutItem { // `UIView`, `UILayoutGuide` | |
var superview: UIView? { get } | |
} | |
extension UIView: LayoutItem {} | |
extension UILayoutGuide: LayoutItem { | |
public var superview: UIView? { owningView } | |
} | |
public struct Alignment { |
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 | |
/// Represents a single `NSLayoutConstraint` | |
enum LayoutAnchor { | |
case constant(attribute: NSLayoutConstraint.Attribute, | |
relation: NSLayoutConstraint.Relation, | |
constant: CGFloat) | |
case relative(attribute: NSLayoutConstraint.Attribute, | |
relation: NSLayoutConstraint.Relation, |
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
// | |
// UIView+TinyConstraints.swift | |
// CommonSwift | |
// | |
// Created by Sebastien on 2020-08-21. | |
// Copyright © 2020 Powerband Exchange. All rights reserved. | |
// | |
import Foundation | |
import TinyConstraints |
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 | |
extension UIStackView { | |
@discardableResult | |
func removeAllArrangedSubviews() -> [UIView] { | |
return arrangedSubviews.reduce([UIView]()) { $0 + [removeArrangedSubViewProperly($1)] } | |
} | |
func removeArrangedSubViewProperly(_ view: UIView) -> UIView { | |
removeArrangedSubview(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
// | |
// TurnipCalculator | |
// | |
// Translated from https://gist.github.com/Treeki/85be14d297c80c8b3c0a76375743325b#file-turnipprices-cpp | |
// | |
// TODO: Calculation is slightly off from C++ impl still | |
import Foundation |
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
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
// munged from https://github.com/simontime/Resead | |
namespace sead | |
{ | |
class Random | |
{ |
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
// | |
// RecordAudio.swift | |
// | |
// This is a Swift class (updated for Swift 5) | |
// that uses the iOS RemoteIO Audio Unit | |
// to record audio input samples, | |
// (should be instantiated as a singleton object.) | |
// | |
// Created by Ronald Nicholson on 10/21/16. | |
// Copyright © 2017,2019 HotPaw Productions. All rights reserved. |
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
// | |
// ObjectMapperRealmHelper.swift | |
// | |
// Created by Santiago Bustamante on 07/27/18. | |
// | |
// | |
import ObjectMapper | |
import RealmSwift |
NewerOlder