I hereby claim:
- I am joeltrew on github.
- I am minispecs (https://keybase.io/minispecs) on keybase.
- I have a public key ASDjr5A5QRd8qkOKdW1xQ1FkcFwuR2d9dVyQH9hSU3Jw4Qo
To claim this, I am signing this object:
struct AccessibilityScrollModifier: ViewModifier { | |
@Environment(\.sizeCategory) private var sizeCategory | |
var axis: Axis.Set | |
var shouldScroll: (ContentSizeCategory) -> Bool | |
func body(content: Content) -> some View { | |
if shouldScroll(sizeCategory) { |
// | |
// Combine+Helpers.swift | |
// | |
import Foundation | |
import Combine | |
public extension Publisher { | |
func asResult<S, E: Error>() -> AnyPublisher<Result<S, E>, Never> where Self.Output == S, Self.Failure == E { |
public extension Publisher where Failure == Never { | |
func sinkResult<U, E>( | |
receiveSuccess: @escaping ((U) -> Void), | |
receiveFailure: @escaping ((E) -> Void) | |
) -> AnyCancellable where Output == Result<U, E> { | |
let subscriber = Subscribers.Sink<Output, Failure>( | |
receiveCompletion: { _ in }, | |
receiveValue: { result in | |
switch result { | |
case .success(let value): |
extension UIColor { | |
convenience init(hex: StaticString) { | |
let hex = String(hex.description) | |
guard let rgb = UIColor.rgbValue(from: hex) else { | |
preconditionFailure("Invalid hex color string provided") | |
} | |
self.init( |
I hereby claim:
To claim this, I am signing this object:
var results = [NSDictionary]() | |
if let path = NSBundle.mainBundle().pathForResource("output", ofType: "json") { | |
do { | |
let jsonData = try NSData(contentsOfFile: path, options: NSDataReadingOptions.DataReadingMappedIfSafe) | |
do { | |
let jsonResult: NSDictionary = try NSJSONSerialization.JSONObjectWithData(jsonData, options: NSJSONReadingOptions.MutableContainers) as! NSDictionary | |
if let londonEvents = jsonResult["WALES"] as? [[String: AnyObject]] { | |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
actions: { | |
transition: function() { | |
this.transitionToRoute('newroute', {id: 1, model: 123}); | |
} | |
} |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNames: ['apps-page'], | |
sortProperty: ['name'], | |
sortedApps: Ember.computed.sort('apps', 'sortProperty'), | |
actions: { |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
tree: { | |
value1: 234, | |
valueOptions: { | |
subOption1: 123, | |
subOption2: 133, | |
subOption3: 7432, |