Post

Replies

Boosts

Views

Activity

Reply to Problem linking to another post on the forum
Thanks Quinn, that's interesting, but now the plot thickens... I can directly enter this url (and it works as a link): https://kirkville.com/intego-mac-podcast-episode-236-install-macos-monterey-on-a-15-year-old-mac/ ...but if I try to add it as a "link", I get the errors: "Please fix the following URL related errors:" "This domain is not a permitted domain on this forums."
Apr ’22
Reply to Camera does not work with Xocde13.3.1
The Simulator does not have a camera! Only real device have cameras. Your code may well be fine. Try running it on a real iPhone or iPad, and see if it works. Note: Your code checks "isSourceTypeAvailable(camera)", but you don't take any action if the sourceType is not available. If you (for example) logged an error message to the console, then you would have noticed that your app was not detecting a camera.
Apr ’22
Reply to Mapkit Type
The native SwiftUI Map is quite limited, it can't display a satellite view. You will have to use a UIKit MKMapView, and wrap it in UIViewRepresentable. (There are plenty of articles on the web explaining how to do this.)
Apr ’22
Reply to Working with Contractors
I'm very wary of {sharing my apple dev credentials} Rightly so! Is your Apple Developer account as an Individual or an Organization? "Individual" accounts cannot add external team members. See https://developer.apple.com/support/roles/ If you have signed up as an Individual, you will either have to do some of the work yourself (certificates, app upload, etc), or trust your developers.
Apr ’22
Reply to Expected declaration
You have added your last two lines as part of the class definition, which is an error. Try putting them in a method, like this: func test() { let myInfo = AboutMe(firstName: "NAME", lastName: "NAME", age: 10) print(myInfo) } Note: That will compile okay... But it will probably not print what you are expecting, as you have not conformed "AboutMe" to CustomStringConvertible, but that's a different question!
Topic: Business & Education SubTopic: General Tags:
Apr ’22
Reply to Issue with split(or at least I think so)
You use: r = Int(key[0].split(",")[0]) * key[1] You could try breaking that line down into smaller components, to better understand why it doesn't work. For example: let x = key[0] No exact matches in call to subscript Oopsies! It's much easier to debug smaller statements. What you are calling "key" (bad name!) is actually a Dictionary<String, Double> So if you said: for dictionary in self { That would iterate through the dictionaries in your array... ...then you could action the values in the dictionary: for key in dictionary.keys {
Topic: Programming Languages SubTopic: Swift Tags:
May ’22
Reply to Mac Mini M1 Hardware without case.
It's an interesting question! Apple will not sell you a Mac Mini without a case. I doubt anyone else would either: It's a very limited/specialist market They can't source such a product Your best option is to buy a Mac Mini, remove the innards, and recycle the case. That's all anyone else could do, and they would charge you extra for it. Perhaps when the "Self Service Repair" is more common, it will be easier/possible to source such components? https://www.apple.com/newsroom/2021/11/apple-announces-self-service-repair/
Topic: App & System Services SubTopic: Hardware Tags:
May ’22
Reply to Unexpected non-void return value in void function
In getData(), you "return dumm" within a closure which executes asynchronously. That is, it can execute after getData() has returned. So getData cannot return it's Double value there. The closure itself does not return a value (hence the error message). And since you only retrieve "dumm" within the closure, you cannot use getData's return value to return dumm. You should probably remove the return value from getData, and handle the closure's result somehow (e.g. by passing a completion closure to getData, which can then process "dumm"). By the way, it would be easier to help you if you could use (instead of your mass of code, and a screenshot) a Code Block for your code, and use "Paste and Match Style". Like this: //MARK : HealthStore func getData() -> Double { //Get Authorization let stepType = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.stepCount)! let heartRate = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.heartRate)! let spo2 = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.respiratoryRate)! healthStore.requestAuthorization(toShare: [], read: [stepType,heartRate,spo2]) { (chk, error) in if (chk){ print("Permission Granted") var dumm = 0.0 //currentHeartRate(completion: nil) self.getSteps(currentDate: Date()) { result in globalString.todayStepsCount = result dumm = result print(result) } return dumm } } } //getData func getSteps(currentDate: Date, completion: @escaping (Double) -> Void) { guard let sampleType = HKCategoryType.quantityType(forIdentifier: .stepCount) else { print("Get Steps not executed as is null") return } let now = currentDate //Date() let startDate = Calendar.current.startOfDay(for: now) let predicate = HKQuery.predicateForSamples(withStart: startDate, end: now, options: .strictEndDate) let query = HKStatisticsQuery(quantityType: sampleType, quantitySamplePredicate: predicate, options: .cumulativeSum) { _, result, _ in guard let result = result, let sum = result.sumQuantity() else { completion(0.0) return } completion(sum.doubleValue(for: HKUnit.count())) } healthStore.execute(query) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’22