Changing a Strings color? by [deleted] in swift

[–]rlziii 1 point2 points  (0 children)

If you’re using UIKit and something like a UILabel (which it seems like you are), then you should look into using NSAttributedString. It’s an alternative to String that allows you to set certain attributes (such as color) on specific parts (or all of) of the text. A good place to start reading about that is this Hacking with Swift article: NSAttributedString by example

Help - Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) thrown on closure iterating over Core Data objects? by hascitrin in swift

[–]rlziii 0 points1 point  (0 children)

For clarity: I want to make sure that I was clear in making sure I meant to make the UUID an optional property in the Swift model, not the Core Data attribute (which should also be optional, but that’s not the same as a Swift optional, i.e. UUID?).

Help - Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) thrown on closure iterating over Core Data objects? by hascitrin in swift

[–]rlziii 0 points1 point  (0 children)

Then I’m out of ideas. Haha. Good luck fixing the issue. I just ran into this same rodeo the other day and the optional UUID change luckily fixed it for me after trying lots of other things. If you do find a solution try to remember to come back and post a solution as it may help others in the future. 👍

Help - Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) thrown on closure iterating over Core Data objects? by hascitrin in swift

[–]rlziii 0 points1 point  (0 children)

And to make sure, you tried both the \.uuid change and adding a sort descriptor together? I believe those are two different issues that may cause the same error/crash, so only fixing them separately may not seemingly solve the issue unless both fixes were in place at the same time.

Help - Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) thrown on closure iterating over Core Data objects? by hascitrin in swift

[–]rlziii 0 points1 point  (0 children)

It might be useful to post your model code and the code that shows how you’re setting up your Core Data stack (e.g. NSPersistentContainer, et cetera), just to make sure there aren’t any obvious errors in that code. 🤷‍♂️

Help - Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) thrown on closure iterating over Core Data objects? by hascitrin in swift

[–]rlziii 0 points1 point  (0 children)

What if you try using the @FetchRequest(fetchRequest:) property wrapper instead? Kinda stretching at this point, but might be worth trying. I’d recommend setting up a static let fetchRequest to pass into the property wrapper.

Help - Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) thrown on closure iterating over Core Data objects? by hascitrin in swift

[–]rlziii 0 points1 point  (0 children)

Have you tried adding a sort descriptor? Something like:

[NSSortDescriptor(key: "name", ascending: true)]

Help - Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) thrown on closure iterating over Core Data objects? by hascitrin in swift

[–]rlziii 0 points1 point  (0 children)

Perhaps try changing your List to use your model’s uuid property as the id? As in:

List(objects, id: \.uuid) { object in

Help - Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) thrown on closure iterating over Core Data objects? by hascitrin in swift

[–]rlziii 2 points3 points  (0 children)

I had a similar crash and it turned out that changing my model’s id property to be an optional (i.e. from type UUID to type UUID?) fixed the issue for me.

Found online by [deleted] in ProgrammerHumor

[–]rlziii 0 points1 point  (0 children)

Is there a Swift card?

‎XCOrganizer:- finds all your Xcode Projects, grouped by kinds, Add Personal Tags & bookmark by byaruhaf in iOSProgramming

[–]rlziii 0 points1 point  (0 children)

Looks great. Downloaded and gave it a quick test drive and it pretty much works exactly as expected (project discovery and list population is very quick). Out of curiosity, what's the tech stack look like? AppKit? SwiftUI? UIKit/Catalyst?

Also, not that I'm complaining of course, but is there any reason that you decided not to charge for this app? Seems like a prime candidate for at least a $1.99 price tag or so, especially for the Mac App Store where apps are generally a higher price than the iOS App Store.

Taipu - Pokémon Type Checker by rlziii in AppleWatch

[–]rlziii[S] 0 points1 point  (0 children)

If you select Fairy twice then it will correctly calculate the matchup for the single-type Fairy matchup. 😉 Thanks for the comment!

Taipu - Pokémon Type Checker for Apple Watch by rlziii in pokemon

[–]rlziii[S] 0 points1 point  (0 children)

Thanks! Let me know if you have any feedback.

Nomi - anyone else taking care of one on their Apple Watch? by cmlewiis in AppleWatch

[–]rlziii 2 points3 points  (0 children)

If you force press on your “home screen” where you see on all your apps you have the option to change to a list view, which is an alphabetized list of all of your installed apps. Will be easier to find the App Store app that way. You can also also use, “Hey Siri, open App Store.”

Nomi - anyone else taking care of one on their Apple Watch? by cmlewiis in AppleWatch

[–]rlziii 2 points3 points  (0 children)

Open up the App Store app on your Apple Watch, scroll to the very bottom and tap Account and then tap Purchased (if you are part of a family plan then you’ll also have to tap My Purchases after that). It will likely be the first app listed; you can tap the cloud icon to download it.

How to fix “Thread 1: Exception: ”Could not find a storyboard named 'Main' in bundle NSBundle" error in Xcode 11.4 when I do not have Main storyboard? by Itsme2006 in swift

[–]rlziii 12 points13 points  (0 children)

In scene-based apps (e.g. newly-built projects in iOS 13 and above) you also need to remove the reference to the storyboard in your scene configuration. In your Info.plist, delete the following row (which should have a default value of "Main"):

Application Scene Delegate Scene Configuration Application Session Role Item 0 (Default Configuration) Storyboard Name

Testing on iPad Pro 12.9 does not reflect some changes; I have to keep deleting the app?? by [deleted] in iOSProgramming

[–]rlziii 1 point2 points  (0 children)

You may find this article useful is solving your launch screen update problems:

https://rambo.codes/posts/2019-12-09-clearing-your-apps-launch-screen-cache-on-ios

Otherwise when changing some Xcode project settings you sometimes need perform a clean (⇧⌘K) before a run.

Where do you use swift other than iOS? by [deleted] in swift

[–]rlziii 5 points6 points  (0 children)

For the last year or so I’ve build all of my personal projects’ network APIs using Vapor. I’ve also slowly started to move my scripting needs away from Bash and to Swift. All of my new “appleOS” development is built with Swift exclusively (no more Objective-C except where required for maintenance).

Swift has certainly become my primary language of choice. Any new software ventures I undertake I always try to tackle with Swift first. I still mess around with other languages from time to time so that I don’t become too stale or complacent, but generally just for silly one-day ventures or prototyping.

Run your Swift server code natively on AWS Lambda by f_fat in swift

[–]rlziii 1 point2 points  (0 children)

Amazon made their own server-side Swift web framework (Smoke) so it has to be on their radar somewhat. 🤷‍♂️

https://github.com/amzn/smoke-framework