Post

Replies

Boosts

Views

Activity

Reply to VStack adds a space when I have a ZStack with multiple items inside
The vertical spacing is set by the VStack. If the VStack's "spacing" is nil, then the stack will "choose a default distance for each pair of subviews". As you are seeing, this distance is not necessarily the same for every pair of views. It's not possible to specify the spacing within the VStack. The only way to enforce the VStack spacing of 0 is to use: VStack(alignment:.leading, spacing: 0) { ...which you can't do. So I think you are stuck.
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) }
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/
May ’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 {
May ’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!
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