|
Re: Swift with NSDocument and Revert To... browse all versions.
Well, things get more complicated when you use non-Obj-C types, but it’s not necessarily true that you can’t use Swift types. In the case of the model, it may be sufficient that your “model"
Well, things get more complicated when you use non-Obj-C types, but it’s not necessarily true that you can’t use Swift types. In the case of the model, it may be sufficient that your “model"
|
By
Quincey Morris
·
#607
·
|
|
Re: Swift with NSDocument and Revert To... browse all versions.
Thank you,
You are spot on with explaining the problem and I understand your answer and concerns. Sending up a NotificationCenter rocket in read(from:ofType:) confirms your explanation.
Unless I’m
Thank you,
You are spot on with explaining the problem and I understand your answer and concerns. Sending up a NotificationCenter rocket in read(from:ofType:) confirms your explanation.
Unless I’m
|
By
Bill Pitcher
·
#606
·
|
|
Re: Swift with NSDocument and Revert To... browse all versions.
Well, you’re Doing It Wrong™, but it’s not entirely your fault. This is one of NSDocument’s big messes that we’ve been stuck with for the last 10 years or so.
What’s actually going wrong
Well, you’re Doing It Wrong™, but it’s not entirely your fault. This is one of NSDocument’s big messes that we’ve been stuck with for the last 10 years or so.
What’s actually going wrong
|
By
Quincey Morris
·
#605
·
|
|
Re: Swift with NSDocument and Revert To... browse all versions.
Firstly I’ve uploaded a very cut down project which shows the problem.
https://www.ilike.co.nz/downloads/testDocument.zip
"Propagate the data reversion to your window controller and view
Firstly I’ve uploaded a very cut down project which shows the problem.
https://www.ilike.co.nz/downloads/testDocument.zip
"Propagate the data reversion to your window controller and view
|
By
Bill Pitcher
·
#604
·
|
|
Re: Swift with NSDocument and Revert To... browse all versions.
Propagate the data reversion to your window controller and view controllers can be difficult, because any setup you did in windowDidLoad/viewDidLoad is not automatically redone. It can be especially
Propagate the data reversion to your window controller and view controllers can be difficult, because any setup you did in windowDidLoad/viewDidLoad is not automatically redone. It can be especially
|
By
Quincey Morris
·
#603
·
|
|
Swift with NSDocument and Revert To... browse all versions.
I've been trying track the correct path from document to Control and back again.
Document automatically loads WindowController.document I use didSet to loop down the ViewControllers and set there
I've been trying track the correct path from document to Control and back again.
Document automatically loads WindowController.document I use didSet to loop down the ViewControllers and set there
|
By
Bill Pitcher
·
#602
·
|
|
WkWebView delegates
macOS 13.5
I made a WkWebView and added navigationDelegate and uiDelegate and implemented (almost) all delegate methods, each containing a print().
1. I never see any prints (running in Xcode)
2.
macOS 13.5
I made a WkWebView and added navigationDelegate and uiDelegate and implemented (almost) all delegate methods, each containing a print().
1. I never see any prints (running in Xcode)
2.
|
By
Gerriet M. Denkmann
·
#601
·
|
|
Re: lazy variables in Swift - should be read-only
You can do something like this:
It’s settable from within its class or struct, but not from outside, which is as close as you can get to ‘lazy let’ AFAIK.
You can do something like this:
It’s settable from within its class or struct, but not from outside, which is as close as you can get to ‘lazy let’ AFAIK.
|
By
Quincey Morris
·
#600
·
|
|
lazy variables in Swift - should be read-only
This works:
lazy var session = makeSession()
func makeSession() -> URLSession
{
let sessionConfig = URLSessionConfiguration.ephemeral
return URLSession( configuration: sessionConfig )
}
First: is
This works:
lazy var session = makeSession()
func makeSession() -> URLSession
{
let sessionConfig = URLSessionConfiguration.ephemeral
return URLSession( configuration: sessionConfig )
}
First: is
|
By
Gerriet M. Denkmann
·
#599
·
|
|
Re: How to get DOMDocument from WkWebView
AFAIK, there are no documented limits and I believe you aren’t subject to a number of same-origin policies, but this is Apple so who knows. Anyway, you inject JavaScripts using a
AFAIK, there are no documented limits and I believe you aren’t subject to a number of same-origin policies, but this is Apple so who knows. Anyway, you inject JavaScripts using a
|
By
Keary Suska
·
#598
·
|
|
Re: How to get DOMDocument from WkWebView
If the web-page I am interested in is *not* under my control, could I still "write the DOM stuff in JavaScript” ?
If so: how would I start doing this?
Currently I am doing stuff like:
get
If the web-page I am interested in is *not* under my control, could I still "write the DOM stuff in JavaScript” ?
If so: how would I start doing this?
Currently I am doing stuff like:
get
|
By
Gerriet M. Denkmann
·
#597
·
|
|
Re: How to get DOMDocument from WkWebView
I do the same thing (in an app I've been tinkering with for years), but it's a dead end. WkWebView runs the WebView in a separate process, for security reasons, which means its DOM objects are
I do the same thing (in an app I've been tinkering with for years), but it's a dead end. WkWebView runs the WebView in a separate process, for security reasons, which means its DOM objects are
|
By
Jens Alfke
·
#596
·
|
|
Re: How to get DOMDocument from WkWebView
In short, you can’t. WkWebView does not permit direct access to the DOM or expose how the DOM is parsed internally. You have some limited access by being able to inject JavaScript and execute
In short, you can’t. WkWebView does not permit direct access to the DOM or expose how the DOM is parsed internally. You have some limited access by being able to inject JavaScript and execute
|
By
Keary Suska
·
#595
·
|
|
How to get DOMDocument from WkWebView
WebView is sort of deprecated.
“In apps that run in OS X 10.10 and later, use the WKWebView class instead of using WebView”
But: how can I get the DOMDocument of a WkWebView?
I navigate (using
WebView is sort of deprecated.
“In apps that run in OS X 10.10 and later, use the WKWebView class instead of using WebView”
But: how can I get the DOMDocument of a WkWebView?
I navigate (using
|
By
Gerriet M. Denkmann
·
#594
·
|
|
Handling of (shift-)cmd-backquote
Applications on macOS respond to command-backquote and
shift-command-backquote by bringing one of the application's non-frontmost
windows to the front. I have these questions about how this works:
1.
Applications on macOS respond to command-backquote and
shift-command-backquote by bringing one of the application's non-frontmost
windows to the front. I have these questions about how this works:
1.
|
By
Richard Kennaway
·
#593
·
|
|
Re: Can I advantage of Swift availability features in a UITableVIewDelegate?
Thank you, Bernie; you're absolutely right.
All that is actually needed is to implement tableView(_:editActionsForRowAt:) and tableView(_:trailingSwipeActionsConfigurationForRowAt:) [and the
Thank you, Bernie; you're absolutely right.
All that is actually needed is to implement tableView(_:editActionsForRowAt:) and tableView(_:trailingSwipeActionsConfigurationForRowAt:) [and the
|
By
Rick Aurbach
·
#592
·
|
|
Re: Can I advantage of Swift availability features in a UITableVIewDelegate?
Rick Aurbach:
If I understand you correctly, you are asking whether you can wrap entire function implementations inside availability guards, vs just a section of code within a function.
I suspect
Rick Aurbach:
If I understand you correctly, you are asking whether you can wrap entire function implementations inside availability guards, vs just a section of code within a function.
I suspect
|
By
Bernie Maier
·
#591
·
|
|
Can I advantage of Swift availability features in a UITableVIewDelegate?
I am working on an app which I would like to support 10.x for the next release. The problem I have is in a UITableViewDelegate:
I have two actions which I'd like to implement for cells. In 10.x, I
I am working on an app which I would like to support 10.x for the next release. The problem I have is in a UITableViewDelegate:
I have two actions which I'd like to implement for cells. In 10.x, I
|
By
Rick Aurbach
·
#590
·
|
|
Re: Can I Generate a Segue This Way?
You might need to verify that “user interaction” is enabled for the label (which, if I recall correctly, it is not by default).
b
You might need to verify that “user interaction” is enabled for the label (which, if I recall correctly, it is not by default).
b
|
By
Ben Kennedy
·
#589
·
|
|
Can I Generate a Segue This Way?
I have a situation where I want a user tap on a UILabel to generate a segue. (Yes, it sounds a bit strange, but it makes sense in context.)
Working with a storyboard, I add a Tap Gesture Recognizer,
I have a situation where I want a user tap on a UILabel to generate a segue. (Yes, it sounds a bit strange, but it makes sense in context.)
Working with a storyboard, I add a Tap Gesture Recognizer,
|
By
Rick Aurbach
·
#588
·
|