Post

Replies

Boosts

Views

Activity

Reply to How to link multiple text views to a single text storage in TextKit 2
Thanks! I have another question now: how can I link multiple NSTextContentStorage to the same NSTextStorage? The documentation for NSTextContentStorage reads: By default, the framework initializes the NSTextContentStorage with NSTextStorage as the backing store. But I don't see any way of accessing or setting the NSTextStorage. If I'm not supposed to do so, then how can I programmatically change the text?
Topic: App & System Services SubTopic: General Tags:
Apr ’24
Reply to URL.checkResourceIsReachable() throws error if file is on FTP server and name contains special characters
FTP is fundamentally broken at the protocol level. You won’t be able to make non-ASCII file names work with FTP in the general case. Thanks for your comments. Regarding your link "On FTP", I was wondering about this: FTPS is FTP over TLS (aka SSL). While FTPS adds security to the protocol, which is very important, it still inherits many of FTP’s other problems. Personally I try to avoid this protocol. in particular the part "it still inherits many of FTP’s other problems". What are these other problems? At the beginning of the post you only mentioned privacy and security, but these are already fixed with FTPS according to you. Also do you have any clue why open(source.path, O_RDONLY) returns a valid file descriptor if source is a directory and if it's a regular file it returns -1 (see my previous post)?
Topic: App & System Services SubTopic: General Tags:
Apr ’24
Reply to iPad Pro 13" screenshots for the App Store
The App Store Connect API documentation still doesn't list the new iPads: https://developer.apple.com/documentation/appstoreconnectapi/screenshotdisplaytype When adding screenshots to 13" iPads on the website, they still seem to use the display type APP_IPAD_PRO_3GEN_129 when listed by the API, and uploading to that same type uploads them to the 13" display type instead, and then there is the requirement that one still has to upload screenshots for 12.9" display type, without an apparent way of doing so. I would expect to have an option to upload to 13" display type that is also used for 12.9" display type as well.
May ’24
Reply to NSProgressIndicator bindings don't do anything
But according to Progress documentation:: Each of the properties of a progress object, including totalUnitCount, completedUnitCount, and fractionCompleted, support key-value observing (KVO). This makes it extremely easy for a view or window controller object to observe the properties, and update UI elements, such as progress indicators, when the values change.
Topic: UI Frameworks SubTopic: AppKit Tags:
Jun ’24
Reply to Share settings from SwiftUI in-app settings view to other views
I have more than 10 variables, of different types. Your suggestion of multiplexing doesn't work in this case. I have something like this, where I want to bind ContentView.var1 to SettingsView.var1, for each of the var listed in SettingsView, and possibly to other views as well. struct ContentView: View { var body: some View { VStack { if var1 { Text("Text") } } SettingsView() } } struct SettingsView: View { @AppStorage("var1") private var var1 = false @AppStorage("var2") private var var2 = true @AppStorage("var3") private var var3 = false @AppStorage("var4") private var var4 = MyType.Nested.value @AppStorage("var5") private var var5: Double? @AppStorage("var6") private var var6 = 0.0 @AppStorage("var7") private var var7 = 0.0 @AppStorage("var8") private var var8: String? @AppStorage("var9") private var var9: Data? @AppStorage("var10") private var var10 = true @AppStorage("var11") private var var11 = 0 var body: some View { Toggle("Var 1", isOn: $var1) ... } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’24
Reply to NSTableView - How can the background color of the row views be changed dynamically?
NSTableRowView has a property backgroundColor, but this is also used by AppKit when you set tableView.usesAlternatingRowBackgroundColors = true. The only way I could make it work was by returning a custom row view subclass and dynamically returning a custom background color. class MyRowView: NSTableRowView { var myBackgroundColor: NSColor? override var backgroundColor: NSColor { get { return myBackgroundColor ?? super.backgroundColor } set { super.backgroundColor = newValue } } } and in the delegate func outlineView(_ outlineView: NSOutlineView, didAdd rowView: NSTableRowView, forRow row: Int) { if myCondition { (rowView as! MyRowView).myBackgroundColor = myColor } }
Topic: UI Frameworks SubTopic: AppKit Tags:
Jun ’24
Reply to Getting inode number from URL
I just wanted to add that for some reason the order of imports inside the test files is important in some cases. I have to write: @testable import MyApp import XCTest Inverting those two lines causes several compiler errors inside the bridging header file: Redefinition of 'vtype' Redefinition of enumerator 'VBAD' Redefinition of enumerator 'VBLK' ... I have no idea why this happens, as in another project with the exact same bridging header file the order of imports seems to be irrelevant and doesn't cause any compiler errors.
Topic: App & System Services SubTopic: General Tags:
Jun ’24