Post

Replies

Boosts

Views

Activity

Tip always displayed with TipKit
Why a TipKit configured with a weekly frequency, on the following example, when the app is launched on the View1, the tip is displayed. I thought that going to View2 and come back to View1 should not redisplayed the tip (at least until one week). What do I miss? import SwiftUI import TipKit struct FavoriteLandmarkTip: Tip { var title: Text { Text("Save as a Favorite") } var message: Text? { Text("Your favorite landmarks always appear at the top of the list.") } var image: Image? { Image(systemName: "star") } } @main struct LandmarkTips: App { var body: some Scene { WindowGroup { TabView { View1() .tabItem { Label("View1", systemImage: "house") } View2() .tabItem { Label("View2", systemImage: "house") } } .task { do { // uncomment to reset all tips status // try? Tips.resetDatastore() try Tips.configure([ .displayFrequency(.weekly), .datastoreLocation(.applicationDefault) ]) } catch { print("Error initializing TipKit \(error.localizedDescription)") } } } } } struct View1: View { let favoriteLandmarkTip = FavoriteLandmarkTip() var body: some View { VStack { TipView(favoriteLandmarkTip, arrowEdge: .bottom) Image(systemName: "star") } } } struct View2: View { var body: some View { Text("View2") } }
1
0
39
3w
xCode localization export failed for shared framework with multiple destinations
When exporting localization in xCode for a shared framework, the localization build fails with the error "Could not choose a single platform from the supported platforms iphoneos, iphonesimulator, watchos, watchsimulator of target" Note that the shared target has multiple supported destinations = iPhone/iPad/Apple Watch.
3
0
1.5k
Nov ’22
XCode11 Failed to synthesize event
Running my UI Test in xCode 11.x (tried all) I have sometime "Failed to synthesize event: Neither element nor any descendant has keyboard focus. Event dispatch snapshot: TextField, placeholderValue: 'Your Email', value: "And the tet was working because and does not always occurs. But the fact is all my UI tests and screenshots workflow is broken.Does anyone has some issue around UI testing since 11.x ?
7
0
4.6k
Nov ’22
CIMotionBlur broken in iOS16 ?
The following code just does not behaves the same way previous to iOS 16 and with iOS 16. The blur effect does not seem to work correctly in iOS 16. class GameScene: SKScene { override func didMove(to view: SKView) { let shapeNode = SKShapeNode(circleOfRadius: 30) shapeNode.fillColor = .green shapeNode.strokeColor = .clear addChild(shapeNode) let blurredShapeNode = SKShapeNode(circleOfRadius: 30) blurredShapeNode.fillColor = .red blurredShapeNode.strokeColor = .clear let effectNode = SKEffectNode() addChild(effectNode) effectNode.addChild(blurredShapeNode) let blurAngle = NSNumber(value: 0) effectNode.filter = CIFilter( name: "CIMotionBlur", parameters: [kCIInputRadiusKey: 30, kCIInputAngleKey: blurAngle]) } }
1
0
1.1k
Oct ’22
Use embedded framework in WatchKit extension
I have a project of an iOS app with an embedded framework called TotoKit with some model classes. Now I've added a new target with the template "WatchApp for iOS App" to my project. When I try to do "import TotoKit" from the newly created WatchKit extension, no such module is found. What do I have to do ? I have tried without success to: add one dependencies to TotoKi in BuildPhase of the extension target add AppleWatch in Deployment/Target Device Families of the TotoKit target Thanks,
0
0
850
Jan ’22
UIDatePickerStyle.compact does not work on 13.7
The Apple documentation says that .compact style of a UIDatePicker is available from iOS 13.4. When I launch in the simulator in iOS 13.7 my app with deployment target to iOS 13.4 and use a UIDatePicker it is displayed a the classic wheel. That does not sound normal according to documentation! Any idea?
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
986
Jun ’21
enableBackgroundDelivery does not deliver route ?
First I prepare a long-run query to get new workouts:self.exportQuery = HKObserverQuery(sampleType: sampleType, predicate: nil, updateHandler: { query, completionHandler, error in self.queryWorkoutsToExport() { completionHandler() } }) self.healthStore.execute(self.exportQuery!)I enable the HealthStore background delivery with:self.healthStore.enableBackgroundDelivery(for: HKObjectType.workoutType(), frequency: .immediate, withCompletion: nil)Now I go outside for an outdoor running workout (with GPS trace). One my workout finished, the update handler of HKObserverQuery is called and I do a query to access the new workout:let anchoredQuery = HKAnchoredObjectQuery(type: HKObjectType.workoutType(), predicate: predicate, anchor: anchor, limit: HKObjectQueryNoLimit) { [unowned self] query, newSamples, deletedSamples, newAnchor, error inTHE PROBLEM is that the workout is correctly returned in newSamples BUT I don't have any GPS data. The resultHandler in empty. let workoutRoutesQuery = HKSampleQuery(sampleType: HKSeriesType.workoutRoute(), predicate: HKQuery.predicateForObjects(from: workout), limit: HKObjectQueryNoLimit, sortDescriptors: [sort], resultsHandler: { (query, samples, error) inAnything wrong with my process? May be .immediate is to immediate in enableBackgroundDelivery is a bit too fast and I should move to .hourly. Because when I run the same code a bit later, I have the route date.
1
0
2.0k
Mar ’21