Skip to content

Instantly share code, notes, and snippets.

Erica Sadun erica

Block or report user

Report or block erica

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ModalDetail.swift
import PlaygroundSupport
import SwiftUI
struct LiveView: View {
@State var isPresented = false
var modalPresentation: some View {
NavigationView {
Text("Hello World")
.font(.caption)
View Touch.swift
import PlaygroundSupport
import SwiftUI
extension View {
public func offset(by offset: CGPoint) -> Self.Modified<_OffsetEffect> {
self.offset(x: offset.x, y: offset.y)
}
}
struct LiveView : View {
View micestocksrounded.swift
import PlaygroundSupport
import SwiftUI
struct MouseState {
var corded = 0
var cordless = 0
var magic = 0
var total: Int {
return corded + cordless + magic
}
View micestocks.swift
import PlaygroundSupport
import SwiftUI
struct MouseState {
var corded = 0
var cordless = 0
var magic = 0
var total: Int {
return corded + cordless + magic
}
View tests.swift
//-----------------------------------------------------------------------------
// MARK: Time Test
//-----------------------------------------------------------------------------
import Foundation
/// Prints the elapsed time to execute a block under whatever optimization
/// conditions are currently in use by the compiler
public func timetest(_ note: String, block: () -> Void) {
print("Starting Test:", note)
View modernizing.swift
/// Unconditionally prints a given message and stops execution.
///
/// - Parameters:
/// - reason: The string to print.
/// - function: The name of the calling function to print with `reason`. The
/// default is the calling scope where `fatalError(because:, function:, file:, line:)`
/// is called.
/// - file: The file name to print with `reason`. The default is the file
View invariant.swift
extension Never {
/// A developer facing statement explaining how program correctness has failed.
public struct Reason: CustomStringConvertible {
public let description: String
public init(_ rationale: String) {
self.description = rationale
}
}
}
View error.md
View fold.md
View keypath.md

Keypath Literal Getter Promotion

  • Proposal: SE-nnnn
  • Authors: TBD
  • Review Manager: TBD
  • Status: Awaiting implementation
You can’t perform that action at this time.