This file contains hidden or 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
- (void) scrollToVisible:(id)unused | |
{ | |
// Only show bottom if we are already scrolled down at/near the bottom. | |
NSScrollView *scrollView = [oLog enclosingScrollView]; | |
NSPoint currentScrollPosition=[[scrollView contentView] bounds].origin; | |
float diff = oLog.frame.size.height - (scrollView.contentSize.height + currentScrollPosition.y); | |
if (diff < 50) // Seems like it's often 39 when we're at the bottom, so give some slack. | |
{ | |
// [oLog scrollRangeToVisible:NSMakeRange([[oLog textStorage] length], 0)]; |
This file contains hidden or 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
+ (NSData *)dataWithBase64EncodedString:(NSString *)base64String | |
{ | |
NSData *retVal = nil; | |
if([base64String canBeConvertedToEncoding:NSASCIIStringEncoding]) | |
{ | |
NSData *stringData = [base64String dataUsingEncoding: NSASCIIStringEncoding]; | |
/* base64 decode | |
* in -- input data |
This file contains hidden or 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
- (void)ks_tryToMakeObjectsPerformSelector:(SEL)selector withObject:(id)object; | |
{ | |
for (id <NSObject> anObject in self) | |
{ | |
if ([anObject respondsToSelector:selector]) | |
{ | |
[anObject performSelector:selector withObject:object]; | |
} | |
} | |
} |
This file contains hidden or 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
diff -crB -x S SpotifyAPIExampleApp-main/SpotifyAPIExampleApp/Model/Spotify.swift SpotifyAPIExampleApp-PKCE/SpotifyAPIExampleApp/Model/Spotify.swift | |
*** SpotifyAPIExampleApp-main/SpotifyAPIExampleApp/Model/Spotify.swift Thu Feb 16 22:38:40 2023 | |
--- SpotifyAPIExampleApp-PKCE/SpotifyAPIExampleApp/Model/Spotify.swift Tue Jan 23 11:35:44 2024 | |
*************** | |
*** 22,35 **** | |
fatalError("Could not find 'CLIENT_ID' in environment variables") | |
}() | |
- private static let clientSecret: String = { | |
- if let clientSecret = ProcessInfo.processInfo |
This file contains hidden or 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
// | |
// EmojiRender.swift | |
// ResponsiveDesignExamples | |
// | |
// Created by Dan Wood on 7/1/24. | |
// | |
import SwiftUI | |
import CoreGraphics |
This file contains hidden or 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
// | |
// ContentView.swift | |
// ViewThatfits | |
// | |
// Created by Dan Wood on 1/13/25. | |
// | |
import SwiftUI | |
struct TextCondenser<Content: View>: View { |
This file contains hidden or 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 MultiColumnSyncedScrollDemo: View { | |
let scrollViewCount: Int = 5 | |
@State private var scrollPositions: [ScrollPosition] = [] // Initialized in onAppear, so don't use until body prematurely! | |
@State private var indexScrolledByUser: Int? | |
@State private var colors: [Color] = [] // Initially empty | |
let sampleArrayCount = 40 |