Post

Replies

Boosts

Views

Activity

Reply to Mac book air m1 2020 carshed
Oh noes! These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
Nov ’24
Reply to Store SwiftUI Color in SwiftData
I store Strings, and have no issue. Try this function and extension, and confirm that they encode and decode your colours correctly: func colorToHex(_ colour: Color) -> String { guard let components: [CGFloat] = colour.cgColor?.components else { return "#FFFFFFFF" } if(components.count == 2) { return String(format: "#%02lX%02lX%02lX", lroundf(Float(components[0]) * 255.0), lroundf(Float(components[0]) * 255.0), lroundf(Float(components[0]) * 255.0)) } return String(format: "#%02lX%02lX%02lX%02lX", lroundf(Float(components[0]) * 255.0), lroundf(Float(components[1]) * 255.0), lroundf(Float(components[2]) * 255.0), lroundf(Float(components[3]) * 255.0)) } extension UIColor { public convenience init?(fromHex: String) { if(!fromHex.hasPrefix("#")) { return nil; } let r, g, b, a: CGFloat let start = fromHex.index(fromHex.startIndex, offsetBy: 1) let hexColor = String(fromHex[start...]) if(hexColor.count == 8) { let scanner = Scanner(string: hexColor) var hexNumber: UInt64 = 0 if(scanner.scanHexInt64(&hexNumber)) { r = CGFloat((hexNumber & 0xff000000) >> 24) / 255 g = CGFloat((hexNumber & 0x00ff0000) >> 16) / 255 b = CGFloat((hexNumber & 0x0000ff00) >> 8) / 255 a = CGFloat(hexNumber & 0x000000ff) / 255 self.init(red: r, green: g, blue: b, alpha: a) return } } return nil; } } Note, the extension is on UIColor, but it's trivial to convert to Color.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’24
Reply to iOS 18 videos corrupt
These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
Nov ’24
Reply to IOS18
These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. This isn't the place for your product issues. The fact that you randomly picked a couple of tags for your post, which obviously have nothing to do with your issue, should've suggested you were in the wrong place. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
Nov ’24
Reply to Update for whatsapp or possible
WhatsApp is nothing to do with Apple. And you are in the wrong place, again. If you have suggestions, raise them in the appropriate place. This is NOT the appropriate place. Your first point is rubbish, anyway. If WhatsApp loses your messages, then that's WhatsApp's fault, and not something Apple can fix. Second point: Why should Apple make it easy for third-party messaging apps to backup chats easier? It's up to them to do their job, not Apple. Honestly, I can't go on. You're in the wrong place, and your post seems like it was written by some mad AI engine.
Topic: Community SubTopic: Apple Developers Tags:
Nov ’24
Reply to Update for MESSAGES
These are the Developer Forums, where developers of third-party apps for Apple's platforms ask each other for hints and tips on coding. These forums are not where Apple's actual developers chat about new features. If you have a suggestion, you should raise it at: https://www.apple.com/feedback/
Topic: Community SubTopic: Apple Developers Tags:
Nov ’24
Reply to can't install cocoaPods
We can't help you because you've given us the bare minimum of information. This is like saying, "A bit of my car is broken", but not telling us what bit is broken. What macOS version are you on? How are you installing CocoaPods, etc.?
Topic: UI Frameworks SubTopic: SwiftUI
Nov ’24
Reply to Mac book air m1 2020 carshed
Oh noes! These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
Replies
Boosts
Views
Activity
Nov ’24
Reply to Store SwiftUI Color in SwiftData
I store Strings, and have no issue. Try this function and extension, and confirm that they encode and decode your colours correctly: func colorToHex(_ colour: Color) -> String { guard let components: [CGFloat] = colour.cgColor?.components else { return "#FFFFFFFF" } if(components.count == 2) { return String(format: "#%02lX%02lX%02lX", lroundf(Float(components[0]) * 255.0), lroundf(Float(components[0]) * 255.0), lroundf(Float(components[0]) * 255.0)) } return String(format: "#%02lX%02lX%02lX%02lX", lroundf(Float(components[0]) * 255.0), lroundf(Float(components[1]) * 255.0), lroundf(Float(components[2]) * 255.0), lroundf(Float(components[3]) * 255.0)) } extension UIColor { public convenience init?(fromHex: String) { if(!fromHex.hasPrefix("#")) { return nil; } let r, g, b, a: CGFloat let start = fromHex.index(fromHex.startIndex, offsetBy: 1) let hexColor = String(fromHex[start...]) if(hexColor.count == 8) { let scanner = Scanner(string: hexColor) var hexNumber: UInt64 = 0 if(scanner.scanHexInt64(&hexNumber)) { r = CGFloat((hexNumber & 0xff000000) >> 24) / 255 g = CGFloat((hexNumber & 0x00ff0000) >> 16) / 255 b = CGFloat((hexNumber & 0x0000ff00) >> 8) / 255 a = CGFloat(hexNumber & 0x000000ff) / 255 self.init(red: r, green: g, blue: b, alpha: a) return } } return nil; } } Note, the extension is on UIColor, but it's trivial to convert to Color.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to iOS 18 videos corrupt
These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
Replies
Boosts
Views
Activity
Nov ’24
Reply to IOS18
These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. This isn't the place for your product issues. The fact that you randomly picked a couple of tags for your post, which obviously have nothing to do with your issue, should've suggested you were in the wrong place. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
Replies
Boosts
Views
Activity
Nov ’24
Reply to Update for whatsapp or possible
WhatsApp is nothing to do with Apple. And you are in the wrong place, again. If you have suggestions, raise them in the appropriate place. This is NOT the appropriate place. Your first point is rubbish, anyway. If WhatsApp loses your messages, then that's WhatsApp's fault, and not something Apple can fix. Second point: Why should Apple make it easy for third-party messaging apps to backup chats easier? It's up to them to do their job, not Apple. Honestly, I can't go on. You're in the wrong place, and your post seems like it was written by some mad AI engine.
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to Update for MESSAGES
These are the Developer Forums, where developers of third-party apps for Apple's platforms ask each other for hints and tips on coding. These forums are not where Apple's actual developers chat about new features. If you have a suggestion, you should raise it at: https://www.apple.com/feedback/
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to can't install cocoaPods
We can't help you because you've given us the bare minimum of information. This is like saying, "A bit of my car is broken", but not telling us what bit is broken. What macOS version are you on? How are you installing CocoaPods, etc.?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Nov ’24