View ContentView.swift
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 ContentView: View { | |
var body: some View { | |
NicerButton(action: {}, label: { isPressed in | |
Text("Rabbit Season") | |
.foregroundColor(Color.white) | |
.frame(width: 200) | |
.padding() | |
.background(Color.blue.brightness(isPressed ? -0.3 : 0)) |
View TypedMutableCopying.swift
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 | |
protocol TypedMutableCopying { | |
associatedtype ConstantVersion | |
associatedtype MutableVersion | |
var typedCopy: ConstantVersion { get } | |
var typedMutableCopy: MutableVersion { get } | |
} |
View XCTestCase+Extensions.swift
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
// | |
// XCTestCase+Unwrapping.swift | |
// Created by Zev Eisenberg on 6/2/19. | |
// Feel free to use, share, etc. No need to credit, but a link back to this page would be nice. | |
// | |
import XCTest | |
extension XCTestCase { |
View File_1.json
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
{ | |
"some key": "some value" | |
} |
View RxSignpost.swift
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
// RxSwift signposts | |
import os.signpost | |
import RxSwift | |
func signpost<T>(log: OSLog, name: StaticString, value: String, _ thing: () throws -> T) rethrows -> T { | |
let signpostID = OSSignpostID(log: log) | |
os_signpost( | |
.begin, |
View License
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
Copyright 2019 Zev Eisenberg | |
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 copies | |
of the Software, and to permit persons to whom the Software is furnished to do | |
so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
View .lldbinit
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
command script import ~/.lldbscripts/break_unsatisfiable.py |
View guard.swift
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
let foo: Int? = nil | |
let bar: Int? = nil | |
let baz: Int? = nil | |
func x() { | |
guard | |
let foo = foo, | |
let bar = bar, | |
let baz = baz | |
else { return } |
View gist:8b09604250cc903daa6a92b7c930f688
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
hello, world |
View SectionedArray.swift
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
struct SectionedArray<GroupKey, Item> where GroupKey: Comparable & Hashable { | |
struct Section { | |
let key: GroupKey | |
var items: [Item] | |
} | |
var sections: [Section] | |
var count: Int { |
NewerOlder