Post

Replies

Boosts

Views

Activity

Reply to How can I get the text of a label using the new UIContentConfiguration
I jumped to the definition in Xcode and found the following:     @available(iOS 14.0, tvOS 14.0, *)     public var contentConfiguration: UIContentConfiguration?     @available(iOS 14.0, tvOS 14.0, *)     public func defaultContentConfiguration() -> UIListContentConfiguration So I tried a casting the contentConfiguration as a UIListContentConfiguration and it works. While it works, I would appreciate it if someone would tell me if I am still somehow doing it incorrectly. Perhaps I am configuring the cell incorrectly to begin with? Here is the following working code: let cell = myClientList.cellForRow(at: myInvsList.indexPathForSelectedRow!) let config = cell?.contentConfiguration as? UIListContentConfiguration dbClass.curMasterinvList = config?.text ?? ""
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’22
Reply to Where can I call register(_:forCellReuseIdentifier:) if I am not using a UITableViewController?
So now, when I create the table I am registering it as such func createTblView() -> UITableView { let myTable = MyTableView(frame: CGRect(x: 0, y: 0, width: 0, height: 0 )) myTable.register(UITableViewCell.self, forCellReuseIdentifier: "reuse") myTable.backgroundColor = .white return myTable } And within: func tableView( tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell_ func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { // let cell = UITableViewCell() let cell = tableView.dequeueReusableCell(withIdentifier: "reuse") var config = cell!.defaultContentConfiguration() ... additional config code below } This is just a quick sample, obviously I have to add code because cell is now optional, "reuse" is just a test, etc. When I look at cell in the debugger I do see: _reuseIdentifier NSTaggedPointerString * "reuse" 0x84c7f8963e3e2abe It all appears correct, but since the return cell is an optional, and it wasn't without using the tableView.dequeueReusableCell, just want to make sure I am implementing this correctly. Thanks for all your help.
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’22
Reply to Can I calculate the bufferSize on .installTap to equal X seconds
All that being said, for your high-level goal of recording 10-15 seconds of audio you might find this api simpler to use: https://developer.apple.com/documentation/avfaudio/avaudiorecorder/1389378-record As I will be recoding unknown lengths, and trying to use "background" samples to remove background noise, I am guessing that using the same functions to record would be the wiser? The size of the incoming buffers. The implementation may choose another size. Does this also apply to the same instance call of .installTap ? In other words, once running, will I start getting different buffer sizes in the same instance?
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’22
Reply to Do I have to build in support for user scrolling through a UITextView object?
Here's my problem: I built a sample project to paste here. In it, everything works (scrolling wise). In my large bloated project it doesn't. I copied and pasted the UITextView code, so I know it's the same. So now I am really thrown. Could this have anything to do with the UIViewController? My large project has a UIView within the UIViewController, the sample does not. I constrain the UIView to the UIViewController's safeAreaLayoutGuide, then I place all my buttons within the UIView. But everything is a subview of the UIVewController, so not sure how that might be affecting this. Any clues where to look would be so appreciated.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’22
Reply to How can I stop Xcode from indenting on hitting return
Well there are braces everywhere, but it happens EVERYTIME I hit return
Replies
Boosts
Views
Activity
Mar ’22
Reply to Not sure why Swift is giving me a "Cannot find 'xFile' in scope" error
Oh geez! The ‘f’! I kept looking at the ‘x’! Thank you. I seriously think I have a reading disorder sometimes.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Apr ’22
Reply to Am unable to receive HTTP responses with UIViewController set as URLSessionDelegate
Oh you.....I see what you did there. I'm going to start calling what you did "Passive/Aggressive teaching." And I mean that as a compliment. Thank you.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to Seriously, we need a delete button in this forum
Do not read
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to Changing my entities in CoreData gave me a NSCocoaErrorDomain Code=134140 and I can't go back
So it appears that I was misunderstanding where the fault/error lied. I had changed an attribute in CoreData from String to Int. Since I had no data yet, I assumed that the existing entity would be over written. That was not the case. So essentially I just have to delete the app from any device I am running them on, then rebuild.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Failed to prepare device for development
I just started getting this error, and I know it worked yesterday on my iPhone 13 Max Pro, iOS 15.4.1 My Xcode app is set for a minimum deployment of 14.x. But even changing it to match the iPhone doesn't solve this problem. Would love to know what happened all of a sudden.
Replies
Boosts
Views
Activity
Jul ’22
Reply to This operation can fail if the version of the OS on the device is incompatible with the installed version of Xcode.
This is what worked for me. I went to this answer, which had a few answers. The one that worked for me was: restart the iPhone. Which I am a little ashamed I didn't try on my own.
Replies
Boosts
Views
Activity
Jul ’22
Reply to Failed to prepare device for development
I thought I replied, but anyway: I found this answer, and it has many solutions. The one that worked for me was "doing a hard restart of my iPhone." Ashamed I didn't think of trying that first.
Replies
Boosts
Views
Activity
Jul ’22
Reply to How can I find my app created log on my iPhone?
For anyone running into this problem, it's a permission issue. Answer is here.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to How can I get the text of a label using the new UIContentConfiguration
No, let config = cell?.contentConfiguration dbClass.curMasterinvList = config?.text Value of type 'UIContentConfiguration' has no member 'text'
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to How can I get the text of a label using the new UIContentConfiguration
I jumped to the definition in Xcode and found the following:     @available(iOS 14.0, tvOS 14.0, *)     public var contentConfiguration: UIContentConfiguration?     @available(iOS 14.0, tvOS 14.0, *)     public func defaultContentConfiguration() -> UIListContentConfiguration So I tried a casting the contentConfiguration as a UIListContentConfiguration and it works. While it works, I would appreciate it if someone would tell me if I am still somehow doing it incorrectly. Perhaps I am configuring the cell incorrectly to begin with? Here is the following working code: let cell = myClientList.cellForRow(at: myInvsList.indexPathForSelectedRow!) let config = cell?.contentConfiguration as? UIListContentConfiguration dbClass.curMasterinvList = config?.text ?? ""
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Where can I call register(_:forCellReuseIdentifier:) if I am not using a UITableViewController?
So now, when I create the table I am registering it as such func createTblView() -> UITableView { let myTable = MyTableView(frame: CGRect(x: 0, y: 0, width: 0, height: 0 )) myTable.register(UITableViewCell.self, forCellReuseIdentifier: "reuse") myTable.backgroundColor = .white return myTable } And within: func tableView( tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell_ func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { // let cell = UITableViewCell() let cell = tableView.dequeueReusableCell(withIdentifier: "reuse") var config = cell!.defaultContentConfiguration() ... additional config code below } This is just a quick sample, obviously I have to add code because cell is now optional, "reuse" is just a test, etc. When I look at cell in the debugger I do see: _reuseIdentifier NSTaggedPointerString * "reuse" 0x84c7f8963e3e2abe It all appears correct, but since the return cell is an optional, and it wasn't without using the tableView.dequeueReusableCell, just want to make sure I am implementing this correctly. Thanks for all your help.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Can I calculate the bufferSize on .installTap to equal X seconds
All that being said, for your high-level goal of recording 10-15 seconds of audio you might find this api simpler to use: https://developer.apple.com/documentation/avfaudio/avaudiorecorder/1389378-record As I will be recoding unknown lengths, and trying to use "background" samples to remove background noise, I am guessing that using the same functions to record would be the wiser? The size of the incoming buffers. The implementation may choose another size. Does this also apply to the same instance call of .installTap ? In other words, once running, will I start getting different buffer sizes in the same instance?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Is there a method to close files in Swift? Specifically AVAudioFile files?
There is not, the file closes once the AVAudioFile is deinitialized if I use the same handle to create a second file, would that close the first?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Do I have to build in support for user scrolling through a UITextView object?
Here's my problem: I built a sample project to paste here. In it, everything works (scrolling wise). In my large bloated project it doesn't. I copied and pasted the UITextView code, so I know it's the same. So now I am really thrown. Could this have anything to do with the UIViewController? My large project has a UIView within the UIViewController, the sample does not. I constrain the UIView to the UIViewController's safeAreaLayoutGuide, then I place all my buttons within the UIView. But everything is a subview of the UIVewController, so not sure how that might be affecting this. Any clues where to look would be so appreciated.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’22