The JS does not work.
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 struct ReadableWidthView<Content: View>: UIViewControllerRepresentable { | |
public typealias UIViewControllerType = UIViewController | |
private let content: Content | |
init(@ViewBuilder content: () -> Content) { | |
self.content = content() | |
} | |
public func makeUIViewController(context: Context) -> UIViewController { |
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 2020 Joseph Duffy | |
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 copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE |
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 version of main.swift that is closer to https://stackoverflow.com/questions/50937765/why-does-wrapping-os-log-cause-doubles-to-not-be-logged-correctly/50942917#50942917, a linked by https://twitter.com/caseyliss/status/1268555666412765184 | |
import Foundation | |
import os.log | |
import os | |
class OSLogWrapper { | |
func logDefaultariadicArg(_ message: StaticString, _ args: CVarArg... ) { | |
os_log(message, type: .default, args) |
- Find
UIImageView
address (e.g. via view debugger) - In the console:
po [UIImagePNGRepresentation((UIImage *)[_address_ image]) base64EncodedStringWithOptions:0]
- Copy base 64 output
- In a terminal:
pbpaste | base64 -D > image.png
To install add to ~/.config/fish/functions/
. This can be done manually or via curl -o ~/.config/fish/functions/fastlane.fish https://gist.githubusercontent.com/JosephDuffy/596821c21b6810dd0c82639b1c6b8a64/raw/fastlane.fish
This function has 2 primary advantages:
- No need to remember to type
bundle exec
beforefastlane
commands - Autocomplete will work when installed via
fastlane enable_auto_complete
Disclamer: My fish scripting skills aren't exactly 💯. If you have any suggestions for improvements please tweet them at me!
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 | |
import os.log | |
public protocol StateMachineDelegate: class { | |
associatedtype StateType: Hashable | |
/// Invoked before a transition is about to occur, allowing you to reject even a valid transition. Defaults to true | |
/// | |
/// - Parameters: |
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 | |
struct Partial<Wrapped>: CustomStringConvertible, CustomDebugStringConvertible { | |
enum Error<ValueType>: Swift.Error { | |
case missingKey(KeyPath<Wrapped, ValueType>) | |
case invalidValueType(key: KeyPath<Wrapped, ValueType>, actualValue: Any) | |
} | |
private var values: [PartialKeyPath<Wrapped>: Any?] = [:] |
I hereby claim:
- I am josephduffy on github.
- I am josephduffy (https://keybase.io/josephduffy) on keybase.
- I have a public key ASBeGhM8RITtTJSpJG6YexBC2RqJkf5uaM3U5jndy8vNhwo
To claim this, I am signing this object:
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 | |
final class ExampleViewController: UViewController { | |
private var usersBrightness = UIScreen.main.brightness | |
private var willEnterForegroundWasCalled = false | |
private var viewWillDisappearWasCalled = false | |
override func viewDidLoad() { |
NewerOlder