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 PresentedSheet: String, Identifiable { | |
case sticky, standard | |
var id: String { | |
return self.rawValue | |
} | |
} | |
extension String: Identifiable { | |
public var id: String { |
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 <Cocoa/Cocoa.h> | |
@interface NSColor (isLight) | |
- (BOOL)isLight; | |
@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
SwiftUI Headers | |
#snippets | |
import Combine | |
import CoreData | |
import CoreFoundation | |
import CoreGraphics | |
import CoreText | |
import Darwin |
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 PhotosUI | |
import CoreTransferable | |
import SwiftUI | |
struct ContentView: View { | |
@ObservedObject var viewModel: FilterModel = .shared | |
var body: some View { | |
NavigationStack { | |
Gallery() |
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> | |
@interface UIColor (isLight) | |
- (CGFloat)lightness; | |
- (CGFloat)perceivedLightness; | |
- (CGFloat)perceivedLightnessW3C; | |
- (BOOL)isLight; | |
- (BOOL)isPerceivedLightW3C; | |
- (BOOL)isPerceivedLight; |
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 NSView { | |
var snapshot: NSImage { | |
guard let bitmapRep = bitmapImageRepForCachingDisplayInRect(bounds) else { return NSImage() } | |
bitmapRep.size = bounds.size | |
cacheDisplayInRect(bounds, toBitmapImageRep: bitmapRep) | |
let image = NSImage(size: bounds.size) | |
image.addRepresentation(bitmapRep) | |
return image | |
} | |
} |
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
NSLog(@"%@",[NSByteCountFormatter stringFromByteCount:data.length countStyle:NSByteCountFormatterCountStyleFile]); |
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
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSExceptionDomains</key> | |
<dict> | |
<key>redalemeden.com</key> | |
<dict> | |
<key>NSIncludesSubdomains</key> | |
<true/> | |
<key>NSTKemporaryExceptionAllowsInsecureHTTPLoads</key> | |
<true/> |
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
NSLog([NSThread currentThread] == [NSThread mainThread] ? @"❇️ Main thread, it is." : @"♒️ Doesn't look like main thread around here..."); |
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
UIWindow *statusBar = [[UIApplication sharedApplication] performSelector:@selector(statusBarWindow)]; |
NewerOlder