Will Apple accept my app if I tamper with hueRotation and colorRotate of the MKMapView?

I'd like to change the appearance of the map to the dark colors however it's not possible with the swift's WKMapView from MapKit framework. Some people said it was possible with viewDidLoad and overrideUserInterfaceStyle = .dark but that doesn't work for me.

If I change the .hueRotation and apply .colorInvert of the parent view like so

MapParentView()
                .hueRotation(.degrees(79))
                .colorInvert()

to make it look like so

would that be a violation of the app store guidelines as it's hacking onto apple's app aesthetics?

I haven't tried submitting yet but I'd like to know in advance.

Replies

As you are calling public API, I cannot see any reason it would be a guideline violation.

But that could be disturbing for enduser: what happens if he/she has selected dark mode already ?

Could you show the code (where is viewDidLoad) ? Is it UIKit or SwiftUI ? If SwiftUI I would first try to change,

overrideUserInterfaceStyle = .dark

in .onAppear

no because they will argue that it might be bad image on apple trademark because there's an apple logo at the bottom so if it doesn't look good won't pass and colours is subjective


//
//  MapViewUI.swift
//  ios
//
//  Created by Anton on 09/07/2023.
//  Copyright © 2023 Base. All rights reserved.
//

import SwiftUI
import MapKit

@available(iOS 14.0, *)
struct MapViewUI: UIViewRepresentable {
    @EnvironmentObject var mapState: MapState

    var baseCenter: BaseCenter
    
    init () {
        baseCenter = BaseCenter(
            title: String.localizedStringWithFormat(NSLocalizedString("BASE", comment: "base")),
            coordinate: CLLocationCoordinate2D(latitude: BaseCenter.BASE_CENTER_X, longitude: BaseCenter.BASE_CENTER_Y),
            info: "The basecamp. Open 10AM-10PM.")
    }
    
    func makeUIView(context: Context) -> MKMapView {
        MKMapView(frame: .zero)
    }
    func updateUIView(_ view: MKMapView, context: Context) {
        let region = MKCoordinateRegion(center: mapState.center, span: mapState.span)
        view.setRegion(region, animated: true)
        view.addAnnotation(baseCenter)
    }
}

@available(iOS 14.0, *)
struct MapViewUI_Previews: PreviewProvider {
    static var previews: some View {
        MapViewUI()
    }
}
 

I can't seem to set the overrideUserInterfaceStyle for some reason as on the screenshot it's the swifty way there's no instructions how to do it for swift only view controller

also do you happen to know how i can NOT have to annotate all text with @available for ios 14? i'm building for ios 14 anyhow so what's the actual point?