This problem is solved. I finally noticed I was getting the message that the application crashed because I did not have in my P-List the right key to give the user the reason why the app needs to access the Photo Library. I thought the key: "Privacy - Camera Usage Description" was sufficient. After adding also the keys: "Privacy - Photo Library Usage Description", and for good measure "Privacy - Photo Library Additions Usage Description", the app no longer crashed.
Post
Replies
Boosts
Views
Activity
I solved this problem by manually creating the controlling file for the scene. It appears the creation of these is not automatic with the creation of a scene in the story board.
This problem is solved. I was using the wrong event. The event needs to be "Did End On Exit".
I found the answer:
In the "Adjust Editor Options" menu (the 5 uneven horizontal line icon to the upper right, just to the left of the "Add Editor on Right" icon) uncheck the menu items:
Layout Rectangles
Bounds Rectangles
Never mind. I understand now. All the code inside the DispatchQueue's brackets is the thread, not the individual functions in it.
This problem is solved.
I first corrected all outstanding syntax errors in the project.
Then I right clicked on each user interface object in the screen, and in the black dialog that appears deleted all erroneous linkages to functions in the screen's controlling file that no longer exist. Each linkage has a little x icon in its upper right corner to do this with. There was also an out of date function name that happened because I had neglected to use refactor to rename it. So in the Assistant text edited (did NOT use the refactor function) to rename that function to the out of date name, and then used refactor to change that name to the currently intended name.
I found my answer here:
https://help.apple.com/xcode/mac/current/#/devc06f7ee11
There are at least two ways to do it. The simplest way takes more memory, but it is quick and easy. This is to put an outlet in the class that defines the view the switch is in. The outlet is placed there in the same way the handler method is, namely by control dragging the switch from the Storyboard into its class's code shown in the Assistant. In the dialog that appears when the switch is dropped into the code, instead of selecting "Action" select "Outlet", and enter a variable name. The result will be a line of code of the form:
@IBOutlet weak var mySwitch: UISwitch!
Where in place of "mySwitch" will be the variable name entered into the dialog box, and the class member name the switch's state can be accessed by.
I found out that iPhone camera hardware has a fixed aperture. No hardware to adjust its aperture exists.
As far as exposure time goes I found out that information here:
https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624646-setexposuremodecustom
And the camera functions have to be locked to do these by using the methods:
.lockForConfiguration()
.unlockForConfiguration()
I found the answer here:
https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_device-information_user-assigned-device-name
It should have been simple, and easy, but now it is made too difficult.
The problem is the View Controllers I added buttons to were added to the file: "LaunchScreen.storyboard". They needed instead to be added to the file: "Main.storyboard". Once this is done I was able to add segues without those errors appearing.
I see now that NWEndpoint is not a class, or struct, and .service is not a method. NWEndpoint is an enumeration defined in the file Network.h, and that .service is a case element in the NWEndpoint struct. Now I can see the pattern matching. It is testing whether the name is the same in both NWEndpoint.service, and browseResult.endpoint.
Thanks everyone for your help.
So if "browseResult.enpoint" is equal the value returned by the method call to " NWEndpoint.service(name: name, type: _, domain: _, interface: _)" the variable "title" is set equal to "Join (name)".
I am accustomed to "==" being used for a Boolean equality test, and "=" being used to change value of something. Why does Swift break with that tradition from C, and C++, here?
Another point of confusion for me are the underlined characters used as parameter values in the method call. What does that mean? Does it mean default values are to be used?
And what of
if let browseResult = browseResult,
?
Does this test whether "browseResult" has a nil value?
Is there no way then to tell the high level functions to reconfirm, or cause Bonjour to handle this for me in any way when it has failed to and I need it to?
Are the functions used in the TicTacToe example high level?
Suppose a host that has advertised its service goes offline. If it comes back online before its DNS record's TTL expires should that record remain a valid one that can be used to connect with?
In systems where IP addresses are dynamically allocated will the DNS record remain valid if the IP address for the DNS record's host device has changed?
Does a host that has advertised a service have a means of erasing its DNS record in the WiFi router?
When the host advertises can it set the TTL time?
I found the answer to this in Question #4 no this webpage:
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/NetServices/Articles/faq.html
4. When I disconnect a device from a network, does it remain visible?
Yes, for a while. Eventually, the DNS record reaches its time-to-live interval and disappears. As an app developer, if you connect to a host using Bonjour and the connection fails, you can ask the Bonjour to reconfirm the record. This process is described further in NSNetServices and CFNetServices Programming Guide.
What I saw as phantom were the remaining DNS records. They eventually disappeared as their TTL (Time To Live) expired.
I changed the listener initialization line to:
listener?.service = .init(name: "iPhone1", type: "_ssh._tcp", domain: "BRDF" )
That got rid of of the NoAuth error. The message I get now is:
listener will start
listener did change state, new: ready
[L1 ready, local endpoint: <NULL>, parameters: tcp, local: ::.62862, definite, attribution: developer, server, port: 62862, path satisfied (Path is satisfied), interface: en0[802.11], ipv4, dns, service: iPhone1._ssh._tcp.BRDF txtLength:0]
But advertisement still fails. It does not show up as a server in the Terminal program. The message shows local endpoint is still: . Could that have something to do with it?
Is there a tutorial somewhere about how to do this by using Bluetooth instead of the Lighting Cable USB? Plan B is to use Bluetooth.