Hi. Quick question. How do you do the opposite? How do you convert NSAttributedString into AttributedString. For instance, in case you want to add more attributes to the text of a UITextView.
Post
Replies
Boosts
Views
Activity
Hi. Quick question. How do you do the opposite? How do you convert an NSAttributedString into an AttributeString? For instance, in case you want to add attributes to the text of a UITextView.
Thanks! I found the solution after posting the message, but instead of a key path I was using the data type directly, as in AttributeScopes.UIKitAttributes.self. This is a better implementation.
Hi, Rincewind. Quick question. How do you change the Navigation Bar's tint color? The classes UINavigationBarAppearance, UIBarAppearance, and UIBarButtonItemAppearance do not include any tintColor property. The only way I found is with the tintColor property of the UINavigationBar, but this is a Legacy property and we are supposed to use appearances objects. For instance, how do you change the color of the image for the Back button? Thanks!
This website has all the links. I'm downloading Beta 5 right now https://xcodereleases.com/
It's been two days for me LOL. I tried everything until I found this. Unfortunately, they still didn't fix it in Beta 3.
Thanks. This worked for me.
Oh, wow. That's a weird workaround. Thanks.
Thanks for the suggestions. Very useful. One question: do you know if it is possible to perform a case-insensitive search with the Predicate macro? I tried using lowercased() but it is not allowed.
Hi, thanks, but unfortunately I tried that before and get the error "Fatal error: Couldn't find \Book.title.localizedLowercase on Book" (title is a String property in the Book class)
var predicate = #Predicate {
$0.title.localizedLowercase.contains(search)
}
Hi, thanks for your time. I asked you because someone already posted about this issue a few days ago but nobody answered (link below). It looks like it is not possible to perform a case-insensitive search with the Predicate macro, which kind of invalidates SwiftData for professional use (unless I'm missing something)
https://developer.apple.com/forums/thread/733215
Thanks. I had this problem today and your old post was helpful.
Thanks! Actually, manually updating the container view's id() is the best solution for my case, the other options make the view extremely more complex than it should be. I will have to check the SwiftData issues later because they all appeared with Xcode 16 and some may be fixed later.
Hi. Thanks. I can't show you the image here, but If I go to Settings > General > Software Update it says "iOS 18.0, iOS is up to date". I drag the screen down, but it never updates to 18.1. Both devices show the same screen, although of course on iPad says "iPadOS 18.0, iPadOS is up to date". That's why I posted this message. It is really weird that it stop updating as soon as the Beta 1 of 18.1 became available. My guess is that it is because of Apple Intelligence, but I don't know.
That shouldn't be necessary. SwiftData was designed to automatically save the context. Unfortunately, they changed something and now we have to do it manually. Maybe when they release the final version of iOS 18 this is fixed.