Post

Replies

Boosts

Views

Activity

Reply to Push notifcation-driven live activity not starting
Yeah well the live activity is not starting at all in the sense that nothing is ever received on my device and the live activity UI is not triggered despite it working locally which I verified through testing. before the log show the “unable to update live activity”, ill get logs showing the push token successfully going through aswell as my test payload. but Then after that these logs appear
Sep ’25
Reply to depreciated methods
@eskimo @Polyphonic UPDATE: here is my updated code that some of you were requesting. I have the updated methods implemented but im getting the error "Cannot convert return expression of type 'Double' to return type 'String?'" import Foundation class RAMUsage { let processInfo = ProcessInfo.processInfo func getRAM() { let physicalMemory = processInfo.physicalMemory let formatter = ByteCountFormatter() formatter.countStyle = .memory let formattedMemoryUsage = formatter.string(fromByteCount: Int64(physicalMemory)) parseAndPrint(formattedMemoryUsage: formattedMemoryUsage) } func parseAndPrint(formattedMemoryUsage: String) { print("Formatted RAM usage: \(formattedMemoryUsage)") if let gigsOfRAM = parseFormattedRAMUsage(formattedUsage: formattedMemoryUsage) { print("RAM Usage in Gigabytes: \(gigsOfRAM) GB") } else { print("Could not retrieve or parse RAM usage") } } func parseFormattedRAMUsage(formattedUsage: String) -> Double? { let scanner = Scanner(string: formattedUsage) var value: Double = 0.0 var unit: NSString? if let scannedValue = scanner.scanDouble(representation: .decimal) { value = scannedValue func scanCharacters(from set: CharacterSet) -> String? { if let unitString = unit as String?, unitString.lowercased() == "GB" { print("Parsed RAM Usage: \(value) GB") return value } else { print("could not parse and return value") } } return nil } } }
Topic: App & System Services SubTopic: General Tags:
Dec ’23
Reply to Push notifcation-driven live activity not starting
Yeah well the live activity is not starting at all in the sense that nothing is ever received on my device and the live activity UI is not triggered despite it working locally which I verified through testing. before the log show the “unable to update live activity”, ill get logs showing the push token successfully going through aswell as my test payload. but Then after that these logs appear
Replies
Boosts
Views
Activity
Sep ’25
Reply to refreshed/updated data on widgets
Thank you that is very helpful! Yeah I am using a lot of the default code that is included with WidgetKit and didn’t even bother to check that out. I’ll definitely get rid of the excess example widget default code aswell 👍
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to List Closure not displaying retrieved data in Simulator UI
@Claude31 so My .onAppear should be called in the same place as my List()? since it’s in my ZStack?
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Jul ’24
Reply to Xcode 15 beta 5 – iOS 17 Simulator runtime not available
Hi friends, I was able to fix this issue by going to Xcode, settings, platforms, and simply un installing iOS 17.4 runtime and reinstalling it then re-launching Xcode and cleaning the build folder, it solved the issue.
Replies
Boosts
Views
Activity
May ’24
Reply to unknown type errors, failed to emit precompiled header errors
thank you!
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’24
Reply to Unknown Type Issue
im running into the exact same issue. I'm on Sonoma and on Xcode 15
Replies
Boosts
Views
Activity
Feb ’24
Reply to depreciated methods
@eskimo @Polyphonic UPDATE: here is my updated code that some of you were requesting. I have the updated methods implemented but im getting the error "Cannot convert return expression of type 'Double' to return type 'String?'" import Foundation class RAMUsage { let processInfo = ProcessInfo.processInfo func getRAM() { let physicalMemory = processInfo.physicalMemory let formatter = ByteCountFormatter() formatter.countStyle = .memory let formattedMemoryUsage = formatter.string(fromByteCount: Int64(physicalMemory)) parseAndPrint(formattedMemoryUsage: formattedMemoryUsage) } func parseAndPrint(formattedMemoryUsage: String) { print("Formatted RAM usage: \(formattedMemoryUsage)") if let gigsOfRAM = parseFormattedRAMUsage(formattedUsage: formattedMemoryUsage) { print("RAM Usage in Gigabytes: \(gigsOfRAM) GB") } else { print("Could not retrieve or parse RAM usage") } } func parseFormattedRAMUsage(formattedUsage: String) -> Double? { let scanner = Scanner(string: formattedUsage) var value: Double = 0.0 var unit: NSString? if let scannedValue = scanner.scanDouble(representation: .decimal) { value = scannedValue func scanCharacters(from set: CharacterSet) -> String? { if let unitString = unit as String?, unitString.lowercased() == "GB" { print("Parsed RAM Usage: \(value) GB") return value } else { print("could not parse and return value") } } return nil } } }
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to Cannot find ContentVIew() in scope
The error doesn’t get generated in this file aka the ContentView.swift file but instead xcode brings up the default App.swift file(in my case its Mac_GPTApp.swift) and shows a “Cannot find ContentView() in scope” error for the line ContentView().
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to Cannot find ContentVIew() in scope
this is already how my code is structured. I got this same response from chat gpt it still doesn't solve the contentview() scope error that I get in the App.swift file
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to UI Button if else statement
you can use a process class
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’23