Posts

Post not yet marked as solved
0 Replies
478 Views
I am switchingt to the new WWDC 2023 SwiftUI map with user location and a few map annotations. I find if I use .mapStyle(.imagery(elevation: .flat)) as the map style, the map will be loaded with a reasonably zoomed area. However, if I use .mapStyle(.imagery(elevation: .realistic)) on the same map, the simulator will give me a view of the entire planet. I have to manually zoom in everytime to find the user location and annotations, which is not very convenient. This is the only map style configuration that does this. I am not very sure if this is a feature or a inconsistency bug. If this is a feature, I cannot see the purpose of it.
Posted
by mylaluna.
Last updated
.
Post not yet marked as solved
1 Replies
660 Views
I am developing an iOS app which uses swift-gRPC services. Following the official xcode documentation, I imported the swift-gRPC package from its github repository. When creating tests for the gRPC code in view model, I realised the moment I write @testable import ViewModel in a blank XCTest file, and build the unit test target, I get an error Missing required module "CNIOAtomics". I checked the missing module is from the swift-gRPC package. I also checked the Unit Tests are correctly pointing to the main app target. It is very strange that this dependency problem does not happen in my main app target and all the code builds correctly. Is this a bug? How do I fix it?
Posted
by mylaluna.
Last updated
.
Post not yet marked as solved
1 Replies
1.1k Views
Hi Apple MapKit team, I am a new iOS developer and recently learned SwiftUI. This WWDC is my first one. I noticed that although Apple is moving towards SwiftUI, the new features released for MapKit is still largely UIKit based. I am not very familiar with UIKit. I wondered that if MapKit team is going to mainly develop in MapKit space instead of the SwiftUI space. Cheers,
Posted
by mylaluna.
Last updated
.
Post marked as solved
4 Replies
2.1k Views
I am trying to add a confirm button to the top-right of a text editor screen by using the SwiftUI toolbar. I realised that the text in the button cannot be centered as long as the ToolbarItem placement is configured to set the item to the top-right of the screen. Is this a bug? Here is a sample code: import SwiftUI struct TestView: View {   var body: some View {           NavigationView {       ZStack {         Color(.black)           .ignoresSafeArea()         Text("Hello World")           .foregroundColor(.white)           .toolbarRole(.editor)           .toolbar {             ToolbarItem(placement: .confirmationAction) {               Button(action: {print("confirm.")}) {                 Text("confirm")               }               .background(.yellow)               .foregroundColor(.white)               .cornerRadius(20.0)             }           }       }     }   } } struct TestView_Previews: PreviewProvider {   static var previews: some View {     TestView()   } } code-block
Posted
by mylaluna.
Last updated
.