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 ContentView: View { | |
@UseCounter | |
var counter: Int = 0 | |
@UseCounterEffect(initialCount: 1, onUpdate: { count in | |
print("===> update: \(count)") | |
}) | |
var counterEffect: 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
import XCTest | |
import Combine | |
import RxSwift | |
final class PlaygroundTests: XCTestCase { | |
private let input = stride(from: 0, to: 10_000_000, by: 1) | |
override class var defaultPerformanceMetrics: [XCTPerformanceMetric] { | |
return [ | |
XCTPerformanceMetric("com.apple.XCTPerformanceMetric_TransientHeapAllocationsKilobytes"), |
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
extension NSImage { | |
/// Returns the height of the current image. | |
var height: CGFloat { | |
return self.size.height | |
} | |
/// Returns the width of the current image. | |
var width: CGFloat { | |
return self.size.width |