Posts

Post not yet marked as solved
1 Replies
758 Views
Reading the HIG on buttons, it says: As a general rule, a button needs a hit region of at least 44x44 pt — in visionOS, 60x60 pt — to ensure that people can select it easily, whether they use a fingertip, a pointer, their eyes, or a remote. However, I don't see anything similar for a macOS application. I know that in older versions of the HIG, Apple did include this information. If I create a simple application, with a SwiftUI button like: Button("" ) { print( "hello" ) } and measure the size in pixels, it works out to be ~22x22 pixels or ~17x17 pt. So, I am assuming for now that is the minimum size for buttons.
Posted
by MrLinear.
Last updated
.
Post not yet marked as solved
1 Replies
625 Views
DocC is a documentation compiler. Being a compiler, it would make sense that when moving from the Markdown representation to a HTML representation there would be some intermediate output -- an AST, etc. I am wondering if and how one could get access to the AST, for example, representation of the documentation...?
Posted
by MrLinear.
Last updated
.
Post not yet marked as solved
2 Replies
6.8k Views
I can create an unsigned .xcarchive easily enough with the following command:xcodebuild archive -project myproj.xcodeproj -scheme 'the scheme' -archivePath unsigned.xcarchive -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NOHowever, the exportOptionsPlist requires a 'method' and each method it accepts appears to sign the actual ipa.I can manually remove the signature from the IPA after it is exported, but I was hoping there was a feature in xcodebuild that would all me to do this out-of-the-box.Is this possible? If so, how?
Posted
by MrLinear.
Last updated
.
Post not yet marked as solved
1 Replies
806 Views
If I connect my phone to my computer, I can select the phone in the finder (Catalina) or in iTunes (pre-Catalina). Once selected, I can copy files from my Mac to the document folder of an app I have installed on my phone.My question is whether or not there are APIs that allow me to do this programmatically...?
Posted
by MrLinear.
Last updated
.
Post not yet marked as solved
2 Replies
7.3k Views
After doing a lot of searching, as best as I can determine, the SwiftUI TextField does not support multiline editing.Everything I have found suggests that one must wrap a NSTextView inside of a NSViewRepresentable. However, I have yet to find a working solution. What little progress I have made in getting this to work has at least few problems:1. When resizing the window vertically, the text jumps from the top of the view to the bottom of the view and back again.2. If I edit the text and then resize the view, the altered text reverts back to the initial string. It is unclear how to get the variable binding to update when the text is changed.3. if I change the background of the multiline text view to red and resize the window vertically, there is a lot of flicker as stuff is redrawn.If the SwiftUI TextField does support multiline editing, understanding how to configure it properly would resolve this issue as well.I have some test code at:https://github.com/ericg-xcode-questions/multiline_text_view
Posted
by MrLinear.
Last updated
.
Post not yet marked as solved
0 Replies
445 Views
I have a simple, sample test project located at:https://github.com/ericg-xcode-questions/Compass.gitIn the project there is an ObservableObject which acquires GPS location data. In the SwiftUI part, it observes changes to this object and displays the current location.One can easily disable the ability to acquire locations and the:func locationManager(_ manager: CLLocationManager, didFailWithError error: Error)delegate function will be called.What I am not sure about is the better patterns to propagate this error to the SwiftUI layer and inform the user that the locations are not updating.I suppose one could go through the notification center.Are there better or recommended ways of handling such situations?
Posted
by MrLinear.
Last updated
.
Post not yet marked as solved
0 Replies
822 Views
I have a sample test project at [grdb_test](https://github.com/EricG-Personal/grdb_test.git)This project uses GRDB and GRDBCombine which are SQLite related frameworks supporting SwiftUI and Combine.On the interface, I have two lists. The first list displays a complete list of strings. The second list displays only the unique strings.In Tests.swift, I have two publishers which work and support both of those lists: func allTheTestsPublisher() -> DatabasePublishers.Value<[Test]> { ValueObservation .tracking(value: { db in let bestTests = try Test.fetchAll( db ) return bestTests }) .publisher( in: database ) } func allTheUniqueTestsPublisher() -> DatabasePublishers.Value<[Test]> { ValueObservation .tracking(value: { db in let bestTests = try Test.fetchAll( db ) return bestTests }) .map { (theTests: [Test]) -> [Test] in var uniqueTests: [Test] = [] for aTest in theTests { var found = false for uniqueTest in uniqueTests { if uniqueTest.name == aTest.name { found = true break } } if found == false { uniqueTests.append( aTest ) } } return uniqueTests } .publisher( in: database ) }The primary problem I would like to solve is that I am doing two complete queries for all of the Tests in the database when only one should be necessary.I have tried variants of: func allTheUniqueTestsPublisher() -> DatabasePublishers.Value<[Test]> { let publisher = allTheTestsPublisher().map { (theTests: [Test]) -> [Test] in var uniqueTests: [Test] = [] for aTest in theTests { var found = false for uniqueTest in uniqueTests { if uniqueTest.name == aTest.name { found = true break } } if found == false { uniqueTests.append( aTest ) } } return uniqueTests } return publisher }but that generates the compile error:Cannot convert return expression of type 'Publishers.Map<DatabasePublishers.Value<[Test]>, [Test]>' to return type 'DatabasePublishers.Value<[Test]>'which I am not sure how to resolve.I would appreciate any thoughts people might have.(As a side note, I would have liked to be able to use Set() to do the unique test for me, but I have not figured out if that is possible since Set considers the id as well as the name when only the name matters.)
Posted
by MrLinear.
Last updated
.
Post not yet marked as solved
1 Replies
702 Views
I have a sample test project at https://github.com/EricG-Personal/grdb_test.gitIn ContentView.swift, I currently have one list that shows all of the items in the Database.Below that, I would like another list that shows all of the unique 'names' from the test table.I am getting lost in the details between GRBD, Combine, and SwiftUI and am not sure what the code would look like to provide the second list with the data it needs from the database while using GRDBCombine.
Posted
by MrLinear.
Last updated
.
Post not yet marked as solved
2 Replies
6.8k Views
After I generate an App Store Connect API key and download it, I would like to be able to keep this p8 key in the keychain to keep it secure.How can I do that?It does not appear that the Keychain Access application can import these keys directly.If this is not recommended, what is the standard practice for keeping these keys secure?
Posted
by MrLinear.
Last updated
.
Post not yet marked as solved
1 Replies
2.0k Views
I go to:App Store Connect->Users and Access->Keysand click onGenerate API KeyI enter a name for the key which should have admin rights and click on the Generate button.I get an error message which says:An error has occurred. Try again later.Is the system down? If so, when will it be back up?Or, what I am doing wrong?
Posted
by MrLinear.
Last updated
.