Posts

Post not yet marked as solved
0 Replies
374 Views
Scenario: Use code below or similar. Use Xcode simulator or physical device. Have on-screen keyboard hidden. Tap at the end of one of the lowest 5 lines of text that are visible. Using the iPad 10th gen simulator in landscape orientation, this is likely line 14 or so. The on-screen keyboard should have displayed. The text in the TextEditor may scroll up a bit. Using the bottom right key of the on-screen keyboard, dismiss the keyboard. The lines of text after the cursor position are not shown making the TextEditor about half-blank (when in landscape orientation). How do I avoid this unexpected behavior? I'm currently using Xcode 15.1. The code below is just test code to demonstrate the issue. import SwiftUI let alpha = "abcdefghijklmnopqrstuvwxyz" let araAlpha = Array(alpha).map { String($0) } struct ContentView: View { @State var text = "" var body: some View { TextEditor(text: $text) .padding(60).font(.largeTitle) .onAppear { for i in 1 ... 40 { let n = Int.random(in: 5 ... 20) text += String(i) + " " + araAlpha.shuffled() .joined().prefix(n) + "\n" } } } }
Posted
by abrevi1.
Last updated
.
Post marked as solved
3 Replies
397 Views
For the fields listed below, what are the recommended or typical values such that (1) my app can open, edit, and save any ".txt" file and (2) such that other text viewing/editing apps can open the files created by my app? If it matters, my app can view, create, edit, and save UTF-8 text. Document Types fields Name and Types and all the fields for Imported Type Identifiers. And any other important fields or other things that I should set. Also, if I upload my app to the App Store and make a mistake on some or all of these, will I be able to correct them? My knowledge in this area is close to zero, so I'm hoping for minimal technical information, just simple answers if such are possible. I hope you understand.
Posted
by abrevi1.
Last updated
.
Post not yet marked as solved
1 Replies
851 Views
My app started from the iOS Document App template. I recently tried to upload it to App Store Connect (for TestFlight) and got error messages. So, I created a new app from the iOS Document App template in Xcode 14.2, changed only 1 thing (to be like my app), tried to upload it, and get the same error messages. The one thing I changed was essentially in the info.plist. Using Xcode, in "Info", I changed Imported Type Identifiers, Extensions, from "exampletext" to "txt". My app reads and let's users edit plain-text files and saves new files with the extension ".txt". Please let me know how to fix this. I'm a newbie, so details are very helpful. If there's a document, website, or YouTube that I should review, please let me know. Here are the messages during upload: Distribution failed with errors: Asset validation failed. Disallowed UTTypes value. The Info.plist key 'LSItemContentTypes' under 'CFBundleDocumentTypes' in 'DocTemplate.app' has disallowed values '[com.example.plain-text]'. A Uniform Type Identifier starting with one of the patterns in the list '( "com.example.")' is disallowed. (ID: 80fc7e4d-9d35-4871-9684-ad7feba7b928) Asset validation failed. Disallowed UTTypes value. The Info.plist key 'UTTypeIdentifier' under 'UTImportedTypeDeclarations' in 'DocTemplate.app' has disallowed values '[com.example.plain-text]'. A Uniform Type Identifier starting with one of the patterns in the list '( "com.example." )' is disallowed. (ID: b9165f4d-0098-42bf-a25a-9dd251e4e941) Asset validation failed. This bundle is invalid. The value of the CFBundleDocumentTypes key in the Info.plist must be an array of dictionaries, with each dictionary containing at least the CFBundleTypeName key.
Posted
by abrevi1.
Last updated
.