I do not know what I did to make it so, but somehow I accidentally got Xcode Interface Builder to display a storyboard file in an undesired mode which displays the UI buttons, and text fields, in rectangles as shown in the screenshot below. How do I reverse what I did to get it out of this mode?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I am not able drag a reference object from a Storyboard screen to code in the Assistant. The expected blue line appears as the screenshot shows, but no code is created in the Assistant. This reference object is not in the Launch Screen. When the the screen this object is in is highlighted, the correct file opens in the Assistant. Dragging this object from the "Content View" folder also does not work, even though the blue line also appears.
I was recently able to do this. Something changed. What might have changed?
I am attempting to follow this example of how to create a camera app:
https://www.appcoda.com/avfoundation-swift-guide/
It describes a sequence of 4 steps, and these steps are embodied in four functions:
func prepare(completionHandler: @escaping (Error?) -> Void) {
func createCaptureSession() { }
func configureCaptureDevices() throws { }
func configureDeviceInputs() throws { }
func configurePhotoOutput() throws { }
DispatchQueue(label: "prepare").async {
do {
createCaptureSession()
try configureCaptureDevices()
try configureDeviceInputs()
try configurePhotoOutput()
}
catch {
DispatchQueue.main.async {
completionHandler(error)
}
return
}
DispatchQueue.main.async {
completionHandler(nil)
}
}
}
What is confusing me is that it appears these four steps need to be executed sequentially, but in the Dispatch Queue they are executed simultaneously because .async is used. For example farther down that webpage the functions createCaptureSession(), and configureCaptureDevices(), and the others, are defined. In createCaptureSession() the member variables self.frontCamera, and self.rearCamera, are given values which are used in configureCaptureDevices(). So configureCaptureDevices() depends on createCaptureSession() having been already executed, something that it appears cannot be depended upon if both functions are executing simultaneously in separate threads.
What then is the benefit of using DispatchQueue()? How is it assured the above example dependencies are met?
What is the label parameter of the DispatchQueue()'s initializer used for?
I added a scene to an existing story board that already has other scenes. I put focus on the new scene, and in the Identity Inspector's "Class" field I gave it a class name. The "Storyboard ID" field did not show in this inspector. Why would it not?
No file named after the class name I gave it appeared in the "Project navigator". Is this supposed to happen automatically? Or must I create this Swift file that contains the class definition for the scene manually?
I have a UITextField object on a storyboard's scene. Its "Editing Did End" event is connected to the view controller's "actIPhoneName()" event handler method as shown in this screenshot.
I configured the keyboard to show its "Done" key. I expected that when this Done button is touched, that the keyboard would disappear, and the actIPhoneName() method would be called. But neither of these happen, nor does anything else. The UITextField object remains in edit mode. The breakpoint is never reached.
What must I do to make the Done keyboard key work to make the UITextField object lose its First Responder status, and call its "Editing Did End" event handler method?
I have a UITextField object in a storyboard's scene where the user is make numeric entries. Because this field is for numbers only I set the keyboard type to "Number Pad" in attributes. But this keyboard does not have a return key which leaves the user unable to signal when the entry is complete, the keyboard should be put away, and the entered value processed. I tried all the other numeric keyboards also, and found that none of them has a return key. The default keyboard does, but it is a full alphanumeric keyboard which is undesirable for that field.
How can I cause the return key, done key, or whichever does that function, appear on a numeric only keyboard?
There is a crash on the closing brace of the photo capture completion handler where commented below.
// Initiate image capture:
cameraController.captureImage(){ ( image: UIImage?, error: Error? ) in
// This closure is the completion handler, it is called when
// the picture taking is completed.
print( "camera completion handler called." )
guard let image = image else {
print(error ?? "Image capture error")
return
}
try? PHPhotoLibrary.shared().performChangesAndWait {
PHAssetChangeRequest.creationRequestForAsset(from: image)
} // crash here
}
When step through pauses on that closing brace, and the next step is taken, there is a crash. Once crashed what I see next is assembly code as shown in the below disassembly:
libsystem_kernel.dylib`:
0x1e7d4a39c <+0>: mov x16, #0x209
0x1e7d4a3a0 <+4>: svc #0x80
-> 0x1e7d4a3a4 <+8>: b.lo 0x1e7d4a3c4 ; <+40> Thread 11: signal SIGABRT
0x1e7d4a3a8 <+12>: pacibsp
0x1e7d4a3ac <+16>: stp x29, x30, [sp, #-0x10]!
0x1e7d4a3b0 <+20>: mov x29, sp
0x1e7d4a3b4 <+24>: bl 0x1e7d3d984 ; cerror_nocancel
0x1e7d4a3b8 <+28>: mov sp, x29
0x1e7d4a3bc <+32>: ldp x29, x30, [sp], #0x10
0x1e7d4a3c0 <+36>: retab
0x1e7d4a3c4 <+40>: ret
Obviously I have screwed up picture taking somewhere. I would much appreciate suggestions on what diagnostics will lead to the resolution of this problem. I can make the entire picture taking code available on request as an attachment. It is too lengthy to post here.
I listed the AVCapturePhotoSettings.availablePhotoPixelFormatTypes array in my iPhone 14 during a running photo session and I got these type numbers:
875704422
875704438
1111970369
I have no idea what these numbers mean. How can I use these numbers to look up a human readable string that can tell me what these types are in a way I am familiar with, such as jpeg, tiff, png, bmp, dng, etc, so I know which of these numbers to choose when I instantiate the class: AVCaptureSession?
The MacStudio has only one account on it, and that is of course an admin account. The password to this account is lost. The MacStudio has an association with my AppleID I log into developer.apple.com with. To recover, this procedure was followed:
The recovery mode was entered by holding down the power key for 15 seconds.
In the options that appeared the "Forgot all passwords" option was clicked on.
I entered the same credentials I log into developer.apple.com with. The credentials were accepted.
The shell was launched, and the in the shell the command "resetpasswords" entered.
The message: "If you don't know the password for any user on your Mac, you can deactivate your Mac and set new passwords for all users. An internet connection will be required to reactivate your Mac". Beneath this message there was in blue text: "Deactivate Mac".
I did not proceed after this because I was not sure what deactivation would mean for the files on the computer. On it there is code written in Swift that needs to be preserved. If the deactivation is done will the files be preserved, and be accessible? Or does a deactivation remove all files?
Topic:
Community
SubTopic:
Apple Developers