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 Foundation | |
/// Provides NSRegularExpression pattern matching against strings | |
/// in `switch` expressions | |
/// | |
/// Regular expressions are expensive to construct. The built-in | |
/// class cache stores already-constructed pattern instances using | |
/// the pattern string (coerced to `NSString`) as its keys. Modify | |
/// matching options at the `match(_, options:)` call-site if needed. | |
/// |
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
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
typealias PairedConstraint = (_ view: UIView, _ otherView: UIView) -> NSLayoutConstraint | |
typealias UnpairedConstraint = (_ view: UIView) -> NSLayoutConstraint | |
enum ConstraintRelation { | |
case equal, greaterThanOrEqual, lessThanOrEqual |
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 PlaygroundSupport | |
typealias Constraint = (_ view: UIView, _ otherView: UIView?) -> NSLayoutConstraint | |
enum ConstraintRelation { | |
case equal, greaterThanOrEqual, lessThanOrEqual | |
} | |
func constraint<Anchor, AnchorType>(_ keyPath: KeyPath<UIView, Anchor>, |
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
// | |
// ScrollingStackView.swift | |
// | |
// Created by Antonio Nunes on 05/08/2018. | |
// Copyright © 2018 SintraWorks. All rights reserved. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
//: A UIKit based Playground for presenting user interface | |
import SwiftUI | |
import PlaygroundSupport | |
import Combine | |
struct ContentView: View { | |
@State var showPicker = false | |
@State var selection: String = "€1.500" | |
@State var pickerHeight: CGFloat = 0 |
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 Foundation | |
/// A `BitField` is a struct that provides storage for a set a flags, | |
/// where each flag represents a bit either being set or not set (clear). | |
/// | |
/// `BitField` is closely related to Swift's `OptionSet`, but it specializes | |
/// on treating bits as bits, rather than as abstract flags. | |
public struct BitField<T: UnsignedInteger> { | |
/// `naturalSize` represents the maximum number of bits that a `BitField` can hold, depending on the | |
/// size of the type over which it is generic. |