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
enum AsyncError: Error { | |
case finishedWithoutValue | |
} | |
extension AnyPublisher { | |
func async() async throws -> Output { | |
try await withCheckedThrowingContinuation { continuation in | |
var cancellable: AnyCancellable? | |
var finishedWithoutValue = true | |
cancellable = first() |
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 | |
public struct ChangeObserver<V: Equatable>: ViewModifier { | |
public init(newValue: V, action: @escaping (V) -> Void) { | |
self.newValue = newValue | |
self.newAction = action | |
} | |
private typealias Action = (V) -> Void |
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
enum JSON: Decodable, CustomStringConvertible { | |
var description: String { | |
switch self { | |
case .string(let string): return "\"\(string)\"" | |
case .number(let double): | |
if let int = Int(exactly: double) { | |
return "\(int)" | |
} else { | |
return "\(double)" | |
} |
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
#if DEBUG | |
/** | |
Toggles assertion of Core Data managed object contexts. Only available when DEBUG is defined. | |
When enabled, your application will throw an exception when accessing or modifying entities in a context other than their own. | |
*/ | |
void TCBToggleAssertingContextQueues(); | |
#endif |
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
#if DEBUG | |
/** | |
Toggles assertion of Core Data managed object contexts. Only available when DEBUG is defined. | |
When enabled, your application will throw an exception when accessing or modifying entities in a context other than their own. | |
*/ | |
void TCBToggleAssertingContextQueues(); | |
#endif |
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
// NSManagedObjectContext+DebugSwizzling.h | |
#import <CoreData/CoreData.h> | |
#if DEBUG | |
/** | |
* Toggles debugging of Core Data managed object contexts. | |
* | |
* When enabled, will fire NSLogs in the following cases: |
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
// | |
// RVNReceiptValidation.m | |
// | |
// Created by Satoshi Numata on 12/06/30. | |
// Copyright (c) 2012 Sazameki and Satoshi Numata, Ph.D. All rights reserved. | |
// | |
// This sample shows how to write the Mac App Store receipt validation code. | |
// Replace kRVNBundleID and kRVNBundleVersion with your own ones. | |
// | |
// This sample is provided because the coding sample found in "Validating Mac App Store Receipts" |
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
Pod::Spec.new do |s| | |
s.name = "ReactiveCocoaIO" | |
s.version = "0.0.1" | |
s.summary = "Reactive file management framework built on top of ReactiveCocoa." | |
s.homepage = "https://github.com/ReactiveCocoa/ReactiveCocoaIO" | |
s.author = { "ReactiveCocoa" => "ReactiveCocoa" } | |
s.source = { :git => "https://github.com/zakdances/ReactiveCocoaIO.git", :commit => "7088c256fa55afe98dd60c880fa755fb4dc8265b" } | |
s.license = 'Simplified BSD License' | |
s.description = "ReactiveCocoaIO is a framework for accessing and manipulating a file system through signals, based on ReactiveCocoa." |
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/UIKit.h> | |
#import "ViewController.h" | |
@interface Peekaboo : UIView | |
@property (nonatomic, retain) ViewController *parentView; | |
- (void) show; | |
@end |
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 "NASpinSegue.h" | |
@implementation NASpinSegue | |
- (void)perform{ | |
UIViewController *sourceViewController = (UIViewController *)self.sourceViewController; | |
UIViewController *destinationViewController = (UIViewController *)self.destinationViewController; | |
NewerOlder