Comment by Cykelero on How to hide the letters on a .numberPad keyboard?
Thanks for the thorough answer! It's a shame that you have to make your own entire view, but at least it looks like it's well-supported by iOS. Could you comment on how well this does, accessibility-wise?
View ArticleComment by Cykelero on Firefox text gradient
This is backed up by the MDN background-clip page, which includes an example; and seems to indeed work in practice.
View ArticleComment by Cykelero on Preload responsive images in a tag
These are currently not supported in Safari: developer.mozilla.org/en-US/docs/Web/HTML/Element/…
View ArticleComment by Cykelero on Open any folder with NSDocument
2022 update: this basically still works, with a few minor differences: - Some of the changes you need to make in the Document Types section are now in the Imported Type Identifiers section. Looks like...
View ArticleComment by Cykelero on Convert import() to synchronous
Interesting! The downside here, though, is that the deasync dependency is partially implemented in C++ code.
View ArticleComment by Cykelero on Proper way to use selectors in Swift
At least in Swift 5, you can use #selector for selectors from other classes; for example: #selector(NSSplitViewController.toggleSidebar(_:))
View ArticleComment by Cykelero on You don't have write permissions for the...
This worked well for me; I just needed to also add the bin path (~/.gem/ruby/2.6.0/bin in my case) to my $PATH. Didn't need to install an extra Ruby or pay for the current top answer's installation...
View ArticleComment by Cykelero on Set the placeholder string for NSTextView
A variation on that solution worked for me (instead of creating a subclass, call theTextView.perform(Selector(("setPlaceholderAttributedString:")), with: someAttributedString)) but the...
View ArticleComment by Cykelero on How to tell when user selects text in NSTextView
Of note, this delegate method is called even if the selection is done programmatically: after a selectAll() call, for example, or if the text view's string if changed.
View ArticleComment by Cykelero on Safari iPhone - How to detect zoom level and offset?
This seems to work, in macOS Safari, for computing the amount of Page Zoom (i.e. zooming in and out with ⌘+ and ⌘-). However, it seems to always return 1 in Firefox.
View ArticleComment by Cykelero on cocoa + context sensitive menu on NSTableView with...
In a nutshell: assign a delegate to your NSMenu, and implement a delegate method such as menuNeedsUpdate(_:). It'll allow you to set the menu's items to whatever you'd like, anytime the menu is shown....
View ArticleAnswer by Cykelero for tableView.selectRow has no effect when called within a...
One makeshift way to have the selection operation succeed is to use a timer, in order to call selectRow() after the deletion animation is finished:override func tableView(_ tableView: UITableView,...
View ArticletableView.selectRow has no effect when called within a UIContextualAction...
When calling selectRow(at:animated:scrollPosition:) inside a UIContextualAction callback, nothing changes: the specified row doesn't turn gray.Here's the simplest code I could write that exhibits the...
View ArticleAnswer by Cykelero for tableView.selectRow has no effect when called within a...
In the specific case of a delete action, you can implement the tableView(tableView: cell: indexPath:) delegate method, and perform the selection there; make sure to check that the cell didn't simply...
View ArticleHow to hide the letters on a .numberPad keyboard?
By default, when using a .numberPad keyboard on iPhone, the number keys also feature letters at the bottom of each key.The letters are purely cosmetic, to help people with number input; but in my case...
View ArticleAnswer by Cykelero for Is there a way to view the undo stack?
You can print your undo manager's _undoStack private property:let undoStack = object_getIvar(undoManager, class_getInstanceVariable(UndoManager.self,...
View ArticleAnswer by Cykelero for How can I preview a Gist in GitHub?
As of November 2021, there is a preview tab when editing a Markdown Gist.The Gist's file extension has to be set to .md for the tab to be displayed.
View ArticleAnswer by Cykelero for Why is accessing CustomStringConvertible’s description...
As a hint, a previous version of that same piece of documentation reads:Note: String(instance) will work for an instance of any type, returning its description if the instance happens to be...
View ArticleAnswer by Cykelero for In AutoLayout can you combine both horizontal and...
Riffing off of Shehata's answer, with different code formatting:NSLayoutConstraint.activate( ["H:|-0-[view]-0-|","V:|-0-[view]-0-|" ].flatMap { NSLayoutConstraint.constraints( withVisualFormat: $0,...
View ArticleAnswer by Cykelero for Swift Codable struct recursively containing itself as...
Here's Sweeper's Box class, reworked as a property wrapper, to make it even nicer to use:@propertyWrapperclass Boxed<Wrapped: Codable> { var wrappedValue: Wrapped init(wrappedValue: Wrapped) {...
View Article
More Pages to Explore .....