Post

Replies

Boosts

Views

Activity

Reply to Animation does not work with List, while works with ScrollView + ForEach
@Claude31 so what should I do to fix it? Regarding your issue: https://stackoverflow.com/questions/74253108/why-is-animation-not-working-in-a-list-but-is-working-in-vstack This has nothing to do with my question. Also this is not true for me: "// ❌ Not animating " – it animates perfectly. Regarding https://stackoverflow.com/questions/76418666/swiftui-list-animations-are-not-smooth-when-adding-elements-to-a-vstack-in-a-lis : Adding .animation modifier did not help.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’26
Reply to Keyboard Notification UIKit magic.
up. Also curious in how to override this value. Claude Code offered these two solutions: @objc private func reactOnKeyboardShowing() { DispatchQueue.main.async { UIView.animate(withDuration: 3) { [weak self] in self?.rectangleHeightConstraint.constant = 20 self?.layoutIfNeeded() } } } @objc private func reactOnKeyboardShowing() { let animator = UIViewPropertyAnimator(duration: 3, curve: .easeInOut) { [weak self] in self?.rectangleHeightConstraint.constant = 20 self?.layoutIfNeeded() } animator.startAnimation() } But it feels like the animation happens after the keyboard appears, not after it started launching...
Topic: UI Frameworks SubTopic: UIKit Tags:
Nov ’25
Reply to Sending messages from Google Chrome extension to macOS app
Seems like you can access $HOME/Library/Application\ Support/Google/Chrome/NativeMessagingHosts using this approach: func requestAccess() { let chromeNativeMessagingPath = NSString(string: "~/Library/Application Support/Google/Chrome/NativeMessagingHosts").expandingTildeInPath let openPanel = NSOpenPanel() openPanel.canChooseDirectories = true openPanel.canChooseFiles = false openPanel.allowsMultipleSelection = false openPanel.directoryURL = URL(fileURLWithPath: chromeNativeMessagingPath) openPanel.message = "Please grant access to the Chrome NativeMessagingHosts folder" openPanel.prompt = "Grant Access" openPanel.begin { [weak self] (result) in if result == .OK, let selectedURL = openPanel.url { // Bookmark the URL for persistent access do { let bookmarkData = try selectedURL.bookmarkData(options: .withSecurityScope, includingResourceValuesForKeys: nil, relativeTo: nil) UserDefaults.standard.set(bookmarkData, forKey: "ChromeNativeMessagingHostsBookmark") self?.accessDirectory(selectedURL) } catch { print("Failed to create security-scoped bookmark: \(error)") } } } } func accessDirectory(_ url: URL) { // Example of how to access the directory later using the bookmark do { // Start accessing the security-scoped resource guard url.startAccessingSecurityScopedResource() else { print("Failed to access security-scoped resource") return } // Now you have access to the directory, you can read/write files let fileManager = FileManager.default let contents = try fileManager.contentsOfDirectory(at: url, includingPropertiesForKeys: nil) print("Contents of directory: \(contents)") // When done, release the access url.stopAccessingSecurityScopedResource() } catch { print("Error accessing directory: \(error)") url.stopAccessingSecurityScopedResource() } }
Topic: Safari & Web SubTopic: General Tags:
Apr ’25
Reply to How can I change the background color of a focused item of a NSTableView?
Here is a solution i found: Remove the highlight style of your tableView like this: tableView.selectionHighlightStyle = .none Set different background in  tableViewSelectionDidChange method like this: func tableViewSelectionDidChange(_ notification: Notification) { guard let tableView = notification.object as? NSTableView else { return } guard tableView.selectedRow >= 0 else { for i in 0..<tableView.numberOfRows { guard let rowView = tableView.rowView(atRow: i, makeIfNecessary: false) else { return } rowView.backgroundColor = .clear } return } guard let rowView = tableView.rowView(atRow: tableView.selectedRow, makeIfNecessary: false) else { return } rowView.backgroundColor = .red.withAlphaComponent(0.1) } The full code can be found here.
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’25
Reply to How can I change the background color of a focused item of a NSTableView?
Another thing that I could do – is change AccentColor in project's Assets.xcassets. But it does not address the issue from this topic, because setting a color with 0.10% opacity gives an unexpected result :( Here i set the same brown color, but set the slider at the very left (1%) in the Assets.xcassets making the color barely visible: As you can see instead of giving me a barely brown color it gave me almost white...
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’25
Reply to How to keep sidebar always open on macOS 12.0 in SwiftUI?
Figured it out with AppKit: https://github.com/kopyl/appkit-settings-sidebar/blob/main/sidebar/main.swift
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’26
Reply to Provisioning profile failed qualification. Profile doesn't support App Groups.
@DTS Engineer my app has nothing to do with iOS and their app groups. The issue started happening out of nowhere without me doing anything. So you're just wrong.
Replies
Boosts
Views
Activity
Jan ’26
Reply to Add background.js to Safari App Extension
@Systems Engineer any way to do it without the conversion?
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’26
Reply to Animation does not work with List, while works with ScrollView + ForEach
@Claude31 so what should I do to fix it? Regarding your issue: https://stackoverflow.com/questions/74253108/why-is-animation-not-working-in-a-list-but-is-working-in-vstack This has nothing to do with my question. Also this is not true for me: "// ❌ Not animating " – it animates perfectly. Regarding https://stackoverflow.com/questions/76418666/swiftui-list-animations-are-not-smooth-when-adding-elements-to-a-vstack-in-a-lis : Adding .animation modifier did not help.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’26
Reply to Safari Web Extension: This extension can read ... including passwords...
..
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’26
Reply to Safari Web Extension: This extension can read ... including passwords...
That is because you are using the "tabs" permission. Another extension also has the "tabs" permission, but does not have this warning. @stefanvd
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’26
Reply to Keyboard Notification UIKit magic.
up. Also curious in how to override this value. Claude Code offered these two solutions: @objc private func reactOnKeyboardShowing() { DispatchQueue.main.async { UIView.animate(withDuration: 3) { [weak self] in self?.rectangleHeightConstraint.constant = 20 self?.layoutIfNeeded() } } } @objc private func reactOnKeyboardShowing() { let animator = UIViewPropertyAnimator(duration: 3, curve: .easeInOut) { [weak self] in self?.rectangleHeightConstraint.constant = 20 self?.layoutIfNeeded() } animator.startAnimation() } But it feels like the animation happens after the keyboard appears, not after it started launching...
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Nov ’25
Reply to Animation does not work with List, while works with ScrollView + ForEach
@DTS Engineer I opened a few bug reports and none was answered. Let me know if you want to hire me as a QA Engineer. Otherwise go create the report yourself.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’25
Reply to Sending messages from Google Chrome extension to macOS app
Seems like you can access $HOME/Library/Application\ Support/Google/Chrome/NativeMessagingHosts using this approach: func requestAccess() { let chromeNativeMessagingPath = NSString(string: "~/Library/Application Support/Google/Chrome/NativeMessagingHosts").expandingTildeInPath let openPanel = NSOpenPanel() openPanel.canChooseDirectories = true openPanel.canChooseFiles = false openPanel.allowsMultipleSelection = false openPanel.directoryURL = URL(fileURLWithPath: chromeNativeMessagingPath) openPanel.message = "Please grant access to the Chrome NativeMessagingHosts folder" openPanel.prompt = "Grant Access" openPanel.begin { [weak self] (result) in if result == .OK, let selectedURL = openPanel.url { // Bookmark the URL for persistent access do { let bookmarkData = try selectedURL.bookmarkData(options: .withSecurityScope, includingResourceValuesForKeys: nil, relativeTo: nil) UserDefaults.standard.set(bookmarkData, forKey: "ChromeNativeMessagingHostsBookmark") self?.accessDirectory(selectedURL) } catch { print("Failed to create security-scoped bookmark: \(error)") } } } } func accessDirectory(_ url: URL) { // Example of how to access the directory later using the bookmark do { // Start accessing the security-scoped resource guard url.startAccessingSecurityScopedResource() else { print("Failed to access security-scoped resource") return } // Now you have access to the directory, you can read/write files let fileManager = FileManager.default let contents = try fileManager.contentsOfDirectory(at: url, includingPropertiesForKeys: nil) print("Contents of directory: \(contents)") // When done, release the access url.stopAccessingSecurityScopedResource() } catch { print("Error accessing directory: \(error)") url.stopAccessingSecurityScopedResource() } }
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to .onTapGesture does not work when SwiftUI component sits in a flipped NSVIew
Found a dirty fix: flippedView.frame = CGRect(origin: .zero, size: stackView.fittingSize) flippedView.autoresizingMask = [.width]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to Animation does not work with List, while works with ScrollView + ForEach
List: I uploaded this Gif with the post, but for some reason it's not in the published post.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to How to get tab/url's favicon in safari web extension natively?
Has anything changed since then?
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to How can I change the background color of a focused item of a NSTableView?
Here is a solution i found: Remove the highlight style of your tableView like this: tableView.selectionHighlightStyle = .none Set different background in  tableViewSelectionDidChange method like this: func tableViewSelectionDidChange(_ notification: Notification) { guard let tableView = notification.object as? NSTableView else { return } guard tableView.selectedRow >= 0 else { for i in 0..<tableView.numberOfRows { guard let rowView = tableView.rowView(atRow: i, makeIfNecessary: false) else { return } rowView.backgroundColor = .clear } return } guard let rowView = tableView.rowView(atRow: tableView.selectedRow, makeIfNecessary: false) else { return } rowView.backgroundColor = .red.withAlphaComponent(0.1) } The full code can be found here.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Seeking KeyboardLayout ID for All Native Keyboards in iOS and macOS
@qcx5 hey. Where you able to solve it?
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to How can I change the background color of a focused item of a NSTableView?
Another thing that I could do – is change AccentColor in project's Assets.xcassets. But it does not address the issue from this topic, because setting a color with 0.10% opacity gives an unexpected result :( Here i set the same brown color, but set the slider at the very left (1%) in the Assets.xcassets making the color barely visible: As you can see instead of giving me a barely brown color it gave me almost white...
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Mar ’25