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 | |
/** | |
### Exercises for the viewer | |
- Phase interrupt handling. | |
- Use Swift concurrency. | |
- Color scheme awareness. | |
- Rework animations to be more spring-like à la what shipped in `0.90.0`. |
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 Parsing | |
import Foundation | |
// [SubRip file format spec.](https://en.wikipedia.org/wiki/SubRip#File_format) | |
let sampleSRTString = | |
""" | |
1 | |
00:00:00,540 --> 00:00:00,960 | |
Yo-yo |
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 | |
struct Preference<PreferenceKey: SwiftUI.PreferenceKey, Content: View>: View | |
where PreferenceKey.Value: Equatable { | |
private let content: (PreferenceKey.Value) -> Content | |
@State private var value: PreferenceKey.Value = PreferenceKey.defaultValue | |
init( | |
_ key: PreferenceKey.Type, |
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
final class ReplaySubject<Output, Failure: Error>: Subject { | |
typealias Output = Output | |
typealias Failure = Failure | |
private let bufferSize: Int | |
private var completion: Subscribers.Completion<Failure>? | |
private var isActive: Bool { /* … */ } |
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 Combine | |
postfix operator ^ | |
postfix func ^ <Publisher: Combine.Publisher>(_ publisher: Publisher) | |
-> AnyPublisher<Publisher.Output, Publisher.Failure> { | |
publisher.eraseToAnyPublisher() | |
} |
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 | |
enum AppDefault { | |
case APIServer, runMode, homeDirectory, reactHost | |
var stringValue: String? { | |
get { | |
return NSUserDefaults.standardUserDefaults().stringForKey(String(self)) | |
} | |
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
"Sometimes when I find myself comparing myself to others and losing | |
steam mentally/emotionally, I have to remind myself where I started, the | |
attitude I had when I began, and how I have already achieved things I never | |
thought possible and that there is no reason for that to change so long as I | |
stay committed, balanced, consistent and hungry." |
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
class CustomCell: UITableViewCell, Reusable { | |
class var reuseIdentifier: String { | |
return "customCell" | |
} | |
} | |
class SupaHotCustomCell: CustomCell { | |
override class var reuseIdentifier: String { | |
return "supaHotCustomCell" | |
} |
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
class Operation: NSOperation { | |
override var asynchronous: Bool { | |
return true | |
} | |
private var _executing = false { | |
willSet { | |
willChangeValueForKey("isExecuting") | |
} |
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 | |
public protocol FoundationErrorWrapper: ErrorProtocol { | |
static func wrappingError(_ error: NSError) -> Self | |
} | |
enum SomeError: ErrorProtocol, FoundationErrorWrapper { | |
case a | |
case wrappingError(NSError) | |
} |
NewerOlder