This file contains hidden or 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 ScrollableView<Content: View>: UIViewControllerRepresentable, Equatable { | |
| // MARK: - Coordinator | |
| final class Coordinator: NSObject, UIScrollViewDelegate { | |
| // MARK: - Properties | |
| private let scrollView: UIScrollView | |
| var offset: Binding<CGPoint> |
This file contains hidden or 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 | |
| #if canImport(SwiftUI) && DEBUG | |
| import SwiftUI | |
| struct UIViewControllerPreview<ViewController: UIViewController>: UIViewControllerRepresentable { | |
| let viewController: ViewController | |
| init(_ builder: @escaping () -> ViewController) { | |
| viewController = builder() | |
| } |
This file contains hidden or 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
| #!/bin/zsh | |
| # pkgAndNotarize.sh | |
| # 2019 - Armin Briegel - Scripting OS X | |
| # place a copy of this script in in the project folder | |
| # when run it will build for installation, | |
| # create a pkg from the product, | |
| # upload the pkg for notarization and monitor the notarization status |
This file contains hidden or 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 UIBezierPath { | |
| /** | |
| Draws the super-elliptic analog of a rounded rect. Unlike the regular rounded rect, the rounded corners | |
| are the quadrants of a superellipse (i.e., parabolic segments), _not_ circular arcs. | |
| If `rect` is a square and `cornerRadius` is equal to half the length or more, and actual superellipse is | |
| drawn (no straight sections along its boundary) just like doing the same with a rounded rect results in a | |
| circle being drawn. |
This file contains hidden or 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
| /// An extension to provide conversion to and from CIELCh° colors. | |
| extension UIColor { | |
| /// The CIELCh° components of a color - lightness (L), chroma (C), and hue (h). | |
| struct CIELCh: Hashable { | |
| /// The lightness component of the color, in the range [0, 100] (darkest to brightest). | |
| var L: CGFloat | |
| /// The chroma component of the color. | |
| var C: CGFloat |
This file contains hidden or 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; | |
| NS_ASSUME_NONNULL_BEGIN | |
| FOUNDATION_EXTERN NSString * const RingerSwitchDidChangedNotification; | |
| @interface RingerSwitchObserver : NSObject | |
| @property (nonatomic, readonly, getter=isSlient) BOOL silent; |
This file contains hidden or 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
| // | |
| // Switch.swift | |
| // Re-Engineering UISwitch | |
| // | |
| // Created by Nathan Tannar on 15/12/18. | |
| // Copyright © 2018 Nathan Tannar. All rights reserved. | |
| // | |
| import UIKit |
This file contains hidden or 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
| https://statici.icloud.com/fmipmobile/deviceImages-9.0/iPhone/iPhone9,4-2-3-0/online-infobox__3x.png | |
| A B C D E F G | |
| A: deviceImages version seems to determine the format of the image specifier (C, D, E, F) | |
| B: device marketing name | |
| C: device model identifier | |
| D: front color (DeviceColor) | |
| E: back color (DeviceEnclosureColor) (missing on very old devices) | |
| F: color (device cover/backing/housing)?? (missing on older devices) | |
| G: image variant |
This file contains hidden or 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
| on setDarkMode(shouldBeDark) | |
| set paneID to "com.apple.preference.general" | |
| tell application "System Events" | |
| if dark mode of appearance preferences is shouldBeDark then return | |
| end tell | |
| set paneWasOpen to false | |