Post

Replies

Boosts

Views

Activity

How to have Codable Color?
The struct C correctly encode UIColor ... let c = C() let j = c.json ... struct C: Encodable { var mycolor: UIColor = .red enum CodingKeys: String, CodingKey { case color } func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) let colorData = try NSKeyedArchiver.archivedData(withRootObject: mycolor, requiringSecureCoding: false) try container.encode(colorData, forKey: .color) } var json: Data? {try? JSONEncoder().encode(self)} } but it's impossible, to me, the encode Color. var mycolor: Color = Color(.systemRed) I found the class UIColor is declared conforming to NSSecureCoding, but struct Color isn't and and extension to Codable isn't allowed outside of the type declaring file. Is there a way to circumvent this limitation?
1
0
3.0k
Aug ’20
NavigationView on compact/regular variation
The following code works correctly on regular variation (i.e. iPhone 11 Pro Max in landscape mode), but it fails in compact variation (i.e. iPhone 11 Pro) struct ContentView: View {     var body: some View { NavigationView { Text("Detail View") .navigationBarTitle("detail") Text("Primary View") } } } Is there a, simple, way to switch between the first and the second behaviour runtime? Otherwise this code, or spilt view code, cannot be used generically on iPhones, even on landscape mode only, because currently only iPhone 11 Pro Max is regular, while the others are compact.
0
0
463
Jul ’20
Localize TextView
I used a TExtView to display a non-editable multiline text. TextView's text is present on Main.string files (from Main.storyboard) but I'm unable to have it used. Is textView.text = NSLocalizedString(...) the correct way to translate TextView? If so, way it is present on the string file?
1
0
622
Jun ’20
ITMS-90034: Missing or invalid signature
After uploading a new App to the App Store Connect i receive an e-mail stating:ITMS-90034: Missing or invalid signature - The bundle '...' at bundle path 'Payload/...' is not signed using an Apple submission certificate.The App don't use any capability.I've used Xcode to upload, as in a previous App which now is on the App Store.All the apps use the default configuration: "Automatically manage signing", Provisioning profile "Xcode Managed Profile", Signing Certificate Apple Development: ############The requested Signing Certificate is present in the keychain in 3 versions, the last one is valid (the older 2 are revoked).What I should correct?
116
0
53k
Jun ’20
Hide StatusBar on iOS 13.5
In iOS 12 and 13, up to 13.4, few lines of codes:navigationController?.navigationBar.isTranslucent = falsenavigationController?.navigationBar.barTintColor = .blacknavigationController?.navigationBar.tintColor = .redallow to hide the status bar under the navigation bar.With swiftUI is perhaps even simpler.statusBar(hidden: hideStatusBar)but it requires to rewrite the whole app from storyboard to swiftUI.Hiding the status bar, or go to full screen, is still be possible without using swiftUI on legacy code?
11
0
9.3k
May ’20
Failed to upload screenshoots
I prepared a serie of screenshoots (4 per localizations on the required sizes), taken directly from the simulators.After some upload App Store Connect refuse to upload new images.Of course the images resolution are all the same, as all are taken from the same simulator.I tryied also to upload a screenshoto taken from my iPhone and then changed insize to adapt it to the requirements.There are requirements over the image size?
4
0
1.7k
May ’20
No ObservableObject
Studing SwiftUI in Apple's HandlingUserInput, I'm blocked in this error:No ObservableObject of type UserData found. A View.environmentObject(_:) for UserData may be missing as an ancestor of this view.The code is:final class UserData: ObservableObject { @Published var showFavoritesOnly = false @Published var landmarks = landmarkData }struct LandmarkList: View { @EnvironmentObject var userData: UserData var body: some View { NavigationView { List(landmarkData) { landmark in if !self.userData.showFavoritesOnly || landmark.isFavorite { NavigationLink(destination: LandmarkDetail(landmark: landmark)) { LandmarkRow(landmark: landmark) } } } .navigationBarTitle(Text("Landmarks")) } } } struct LandmarkList_Previews: PreviewProvider { static var previews: some View { LandmarkList() .environmentObject(UserData()) } }".environmentObject(UserData())" is present in the preview."@EnvironmentObject var userData: UserData" in the View.But the use of userData (if !self.userData.showFavoritesOnly) cause the fatal error.Can someone help me in undertanding how to proceed?
6
0
5k
May ’20
App update deadlock?
Managing my first app I'm confused with the App Store Connect workflow, pehaps I did a mistake.In AppStoreConnect/MyApp I have App version 1.0.0 only, its status is "Pending Developer Release".In "activity" there are two versions: 1.0.0 (Pending Developer Release) and 1.0.1 (no app store status).I need to update a new build correcting a bug.A new build validation on xCode fails:This bundle is invalid. The value for key CFBundleShortVersionString [1.0.0] in the Info.plist file must contain a higher version than that of the previously approved version [1.0.0]. Please find more information about CFBundleShortVersionString at https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstringCreating a new version is not allowed (the option is grayed out) perhaps because the status is not "Ready for Sale” or "Developer Removed from Sale".I would upload a new build or version to be verified by TestFlight tester before put it on sale.How can I exit from this situation?Thank you very much
4
0
919
May ’20
Create a template image
I would add a template image at a button to change its color runtime.I used Preview to draw and save it as a pdf.But it is rendered only as a uniform square color (which color I can change runtimne).How can I obtain the template pdf image?Why the pdf saved by Preview is not working?
4
0
4.0k
Jul ’18