View ErasedSubjects.swift
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 canImport(Combine) | |
import Combine | |
@propertyWrapper | |
/// Provides a property wrapper whose projected value is a `PassthroughSubject`, but | |
/// the wrapped value is just an `AnyPublisher`. This allows you to make a property with | |
/// availability declared for only iOS 13+ and hide the actual publisher. | |
public struct ErasedPassthroughSubject<Output, Failure: Error> { | |
private var value: Any? |
View AllComponentPreviews.swift
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 2019 Kyle Sherman | |
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 |
View allComponentPreviews.swift
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
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
Group { | |
ContentView(title: "Short String") | |
ContentView(title: """ | |
This is a super long title \ | |
spread across a single line | |
""") | |
}.allComponentPreviews() |
View multiplePreviews.swift
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
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
Group { | |
ContentView() | |
.environment(\.sizeCategory, | |
.accessibilityLarge) | |
ContentView() | |
.environment(\.sizeCategory, | |
.accessibilityExtraExtraLarge) |
View simplePreview.swift
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
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
Group { | |
ContentView(title: "Small Title") | |
ContentView(title: "Longer Title to Make Sure It Works") | |
} | |
} | |
} |
View cleanup_files.sh
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
#!/bin/bash | |
rm "compile_commands.json" | |
rm "xcodebuild.log" |
View usage.h
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
#ifndef usage_h | |
#define usage_h | |
#import <mach/mach.h> | |
double cpu_usage(int64_t *count); | |
float mem_usage(); | |
#endif /* usage_h */ |
View KSScrollPerformanceDetector.h
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/Foundation.h> | |
/** | |
These methods will not be called on the main thread. So, | |
if you will be doing anything with UIKit, ensure you dispatch back | |
to the main thread. | |
*/ | |
@protocol KSScrollPerformanceDetectorDelegate<NSObject> | |
@optional | |
- (void)framesDropped:(NSInteger)framesDroppedCount cumulativeFramesDropped:(NSInteger)cumulativeFramesDropped cumulativeFrameDropEvents:(NSInteger)cumulativeFrameDropEvents; |
NewerOlder