Posts

Post marked as solved
2 Replies
1.5k Views
Since Xcode 11 setting iPad and Mac in General / Deployment Info fo a target enable it to run in iPad as well as in iMac. When I try to run on the iMac a document app, even the very simple one created by the Xcode on its template, it fails with the error: If the app is a document app running it in a Mac fails with the error: [OpenSavePanels] ERROR: Unable to display open panel: your app is missing the User Selected File Read app sandbox entitlement. Please ensure that your app's target capabilities include the proper entitlements. What have to be added in the project to let a document app running on iPad as well as on iMac?
Posted
by Luca_65.
Last updated
.
Post not yet marked as solved
0 Replies
509 Views
I'd have a speech at a begin of a long pressure: class Cell: UITableViewCell { override func awakeFromNib() { ... let willSpeech = UILongPressGestureRecognizer(target: self, action: #selector(longPress(gesture:))) button.addGestureRecognizer(willSpeech) } @objc func longPress(gesture: UILongPressGestureRecognizer) { switch gesture.state { case .began: let utterance = AVSpeechUtterance(string: "hello") let speechSynthesizer = AVSpeechSynthesizer() speechSynthesizer.speak(utterance) ... } } } But the speech start only when the button is released. Is there a way to let the speech start immediately even during a long pressure gesture recogniser?
Posted
by Luca_65.
Last updated
.
Post not yet marked as solved
0 Replies
414 Views
DoubleColumnNavigationViewStyle, on iPad, left an unusable space at the top. It seems to be a navigation bar's title, but the navigation bar code apply to the main navigation bar. Is there a way to hide, or at least use, the inner navigation bar? The sample code below reveals part of the screen unused by the App. import UniformTypeIdentifiers @main struct RugbyTimeApp: App { @SceneBuilder var body: some Scene { DocumentGroup( newDocument: {() -> ReferenceDocument in ReferenceDocument()}, editor: {_ -> MainView in MainView()} ) } } struct MainView: View { var body: some View { NavigationView { Text("Side View") .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.green) Text("Hello world") .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.red) } .navigationViewStyle(DoubleColumnNavigationViewStyle()) .navigationTitle("Nav Title") .toolbar { ToolbarItem(placement: .navigation, content: {Button("Next page", action: {})}) } } } class ReferenceDocument: ReferenceFileDocument { static var readableContentTypes = [UTType.plainText] init() {} required init(configuration: ReadConfiguration) throws {} func snapshot(contentType: UTType) throws -> Int {return 0} func fileWrapper(snapshot: Int, configuration: WriteConfiguration) throws -> FileWrapper { let data: Data = try JSONEncoder().encode(snapshot) return FileWrapper(regularFileWithContents: data) } }
Posted
by Luca_65.
Last updated
.
Post not yet marked as solved
0 Replies
352 Views
A simple storyboard picker isn't anymore correctly displayed in iOS14 (Xcode 12.0 beta 6), but it is is in iOS13. The components are aligned out to the window so that the selected component has its first character cut away. Can a constraint be added to realign the txt to be visible also in iOS14?
Posted
by Luca_65.
Last updated
.
Post marked as solved
1 Replies
2.7k Views
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?
Posted
by Luca_65.
Last updated
.
Post marked as solved
1 Replies
400 Views
Sometimes it comes back. SourceKitService is never-ending reading gigabytes from the disk. There is a so much disk use that Xcode and other application suffer and are sometimes stalled. I don't think killing it is a good idea but I hope to find a solution to avoid this penalty.
Posted
by Luca_65.
Last updated
.
Post not yet marked as solved
0 Replies
385 Views
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.
Posted
by Luca_65.
Last updated
.
Post not yet marked as solved
1 Replies
565 Views
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?
Posted
by Luca_65.
Last updated
.
Post marked as solved
4 Replies
1.6k Views
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?
Posted
by Luca_65.
Last updated
.
Post marked as solved
2 Replies
460 Views
In the App Store section the app version is in Prepare for submission.The build in it is number 3.I loaded build 4.The "+" sign on the left of the "Build" Label is missing.Have I to delete the build 3 from the App store section before set the build 4?
Posted
by Luca_65.
Last updated
.
Post marked as solved
1 Replies
872 Views
I signed in the "App Store Connect" as individual, not as a company. Working on an update of an app, already on the App store, I noticed that in the "App Store Connect", section "Manage Agreements, Tax and Banking", the status for app for a price is active but yellow waiting to set up contacts.Which contact forms have I to fill in with my data? Admin? Finance? Legal?
Posted
by Luca_65.
Last updated
.
Post marked as solved
4 Replies
765 Views
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
Posted
by Luca_65.
Last updated
.
Post not yet marked as solved
0 Replies
377 Views
By default UITextField became first responder, so the keyboard appears on iOS, on tap.This behaviour can be too sensitive, a unwanted tap activate the keyboard.How can be configured UITextField to be sensible only on a long tap?
Posted
by Luca_65.
Last updated
.
Post not yet marked as solved
8 Replies
5.2k Views
I would add a header, UITableViewHeaderFooterView, to a table, UITableView.I would design it in IB and then use dequeueReusableHeaderFooterView, but any attempt failed for various reasons.Have I to add a UIView in the main Storyboard, o prepare a new dedicated storyboard, or a xib file?How to connect it to the swift code?Thanks
Posted
by Luca_65.
Last updated
.