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 extension UIColor { | |
private static let rzl_swizzleImplementation: Void = { | |
let instance: UIColor = UIColor.red // This is a `UICachedDeviceRGBColor` instance. For some reason you have to use red. | |
let _class: AnyClass! = object_getClass(instance) | |
let originalMethod = class_getInstanceMethod(_class, #selector(getter: cgColor)) | |
let swizzledMethod = class_getInstanceMethod(_class, #selector(rzl_randomCGColor)) |
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 extension UIColor { | |
private struct StaticVars { | |
// Names of classes to swizzle. Derived from dumped private headers. | |
static let classesToSwizzle: [String] = [ | |
"UIColor", | |
"UIDeviceRGBColor", | |
"NSColor", | |
"UIDisplayP3Color", | |
"UIPlaceholderColor", |
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 | |
/* | |
██████╗ █████╗ ███╗ ██╗ ██████╗ ███████╗██████╗ ███████╗ ██████╗ ███╗ ██╗███████╗ | |
██╔══██╗██╔══██╗████╗ ██║██╔════╝ ██╔════╝██╔══██╗ ╚══███╔╝██╔═══██╗████╗ ██║██╔════╝ | |
██║ ██║███████║██╔██╗ ██║██║ ███╗█████╗ ██████╔╝ ███╔╝ ██║ ██║██╔██╗ ██║█████╗ | |
██║ ██║██╔══██║██║╚██╗██║██║ ██║██╔══╝ ██╔══██╗ ███╔╝ ██║ ██║██║╚██╗██║██╔══╝ | |
██████╔╝██║ ██║██║ ╚████║╚██████╔╝███████╗██║ ██║ ███████╗╚██████╔╝██║ ╚████║███████╗ | |
╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝ | |
*/ |
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
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */ | |
/* Hide all tabs (but not tab bar) when windowed. Preserves area for window controls (tested on macOS). */ | |
/*#TabsToolbar { | |
visibility: collapse !important; | |
}*/ | |
/* Hide the whole tab bar in fullscreen */ | |
#TabsToolbar[inFullscreen] { | |
visibility: collapse !important; |
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
əˈkɔrdɪŋ tu ɔl noʊn lɔz | |
ʌv ˌeɪviˈeɪʃən, | |
ðɛr ɪz noʊ weɪ ə bi | |
ʃʊd bi ˈeɪbəl tu flaɪ. | |
ɪts wɪŋz ɑr tu smɔl tu gɛt | |
ɪts fæt ˈlɪtəl ˈbɑdi ɔf ðə graʊnd. |
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
echo "Building for iOS..." | |
xcodebuild archive \ | |
-sdk iphoneos IPHONEOS_DEPLOYMENT_TARGET=9.0 \ | |
-arch armv7 -arch arm64 \ | |
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ | |
-scheme "ExampleLibrary" \ | |
-archivePath "./build/iphoneos/ExampleLibrary.xcarchive" SKIP_INSTALL=NO |
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
.SFUI-Black | |
.SFUI-BlackItalic | |
.SFUI-Bold | |
.SFUI-BoldItalic | |
.SFUI-Heavy | |
.SFUI-HeavyItalic | |
.SFUI-Light | |
.SFUI-LightItalic | |
.SFUI-Medium | |
.SFUI-MediumItalic |
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
/// Embeds its content between two horizontal dividers. | |
struct Davider<Content: View>: View { | |
let content: Content | |
init(@ViewBuilder content: () -> Content) { | |
self.content = content() | |
} | |
var body: some View { | |
HStack { |
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
// | |
// PinningToCorner.swift | |
// No license, go wild. | |
// | |
import SwiftUI | |
struct PinningToCorner<Content: View>: View { | |
enum Corner { | |
case topLeading |
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
extension View { | |
/** | |
From here: https://www.youtube.com/watch?v=3a7tuhVpoTQ | |
More discussion here: https://stackoverflow.com/a/73590189 | |
This method synchronizes two bindings so that updates to one | |
result in updates to the other. | |
**Why do this?** | |
Have you ever gotten this error? `Publishing changes from within view updates is not allowed, this will cause undefined behavior.` |
OlderNewer