Post

Replies

Boosts

Views

Activity

Reply to Invalid Numeric Value (NaN) Error in SwiftUI's TextField on Long-Press
I'm getting a similar message in the console but doing something completely unrelated. I am using the latest API of SwiftCharts with .ChartScrollableAxes(). On My chart, I'm adding a .annotation() that appears when tapping on a point in the chart. If I have the annotation showing and then I change the scale of my chart (say tapping 'year' scale instead of 'month' scale, then I get the console message. Very weird and unrelated but I'll file a report too. Console message: "[Unknown process name] Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem. [Unknown process name] If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable."
Nov ’23
Reply to Swift Chart RuleMark annotation not respecting overflow resolution when using chartScrollableAxis
Same issue here, trying to reproduce the example used in the WWDC 23 Presentation "Explore Pit Charts and Interactivity in SwiftCharts" and the annotation doesn't appear. I worked around that issue by setting: y: .fit(to: .chart) in the init of the overflowResolution, like: .annotation(position: .top, spacing: 0, overflowResolution: .init(x: .fit(to: .chart), y: .fit(to: .chart))) Probably a SwiftUI bug given this API is only a few months old.
Nov ’23
Reply to Missing parameter error in the first couple of steps
Hi, I'm having a similar issue, the using MapKit the way it's done in the WWDC23 tutorial does not work (I'm using Xcode 14.3.1 also). I tried to solve my code using the answers above but using the deprecated initializers doesn't not work either. After looking for hours on blogs and tutorial, it looks like the MapKit API got changed and possibly only working for iOS 17 using Xcode 15 Beta. But how on earth is anyone using MapKit to show a map for iOS 16 and previous versions now? Here is my code below, along with the error messages I get: import SwiftUI import MapKit struct MapView: View { @State private var userTrackingMode: MapUserTrackingMode = .follow @State private var region = MKCoordinateRegion( center: CLLocationCoordinate2D( latitude: 42.7878, longitude: -74.9323), span: MKCoordinateSpan( latitudeDelta: 0.1, longitudeDelta: 0.1)) var body: some View { Map(coordinateRegion: $region, interactionModes: MapInteractionModes.all, showsUserLocation: true, userTrackingMode: $userTrackingMode) } } struct MapView_Previews: PreviewProvider { static var previews: some View { MapView() } } Errors related to the the use of 'Map()': Extra arguments at positions #1, #2, #3, #4 in call Static method 'buildExpression' requires that 'Map' conform to 'View' Can someone help to find a way to use MapKit on iOS 16, looks like all resources online are outdated or referring to iOS 17. Thanks!
Aug ’23