wtfSwiftUI

@wtfSwiftUI@iosdev.space

Chronicling (mis-)adventures in software development using, the allegedly multi-platform, SwiftUI (and related technologies).

Happy to share your rants, tips, and discoveries along the way…

(Admin: Grant Neufeld)

This profile is from a federated server and may be incomplete. Browse more on the original instance.

wtfSwiftUI, to SwiftUI

How to specfiy file/directory in file open dialog in a UI test using XCTest?

Using for UI testing a app, is it possible to specify a file/directory to be selected in a file open dialog? (Specifically, the one from a fileImporter call in SwiftUI; on both iOS and macOS.)

wtfSwiftUI, to random

Is there a way for an external process (script, app, Shortcut, whatever) to “send” warnings/errors to #Xcode (that will be displayed inline like normal errors/warnings)?

I know how to get it to work when Xcode does a Run Script in the Build Phase, but I’m trying to setup a process outside of Run Script.

wtfSwiftUI,

@matadan How were you getting Xcode to show the warnings/errors from that “special error file” inline?

The only way I’ve found so far, is to return the warnings/errors in a Run Script during the Build Phases when doing a build within the Xcode app (which doesn’t address what I’m trying to do—I want a process external to Xcode to be able to send warnings/errors to Xcode to display inline).

wtfSwiftUI,

@matadan Where are you writing that? Are you adding a file to your project just to write those errors to?

wtfSwiftUI,

@matadan Thank-you for this potential workaround 👍

I still wish Xcode just had a way to receive warnings/errors as inter-process messages, without having to add a message log file to the project. 🤷

MuseumShuffle, to SwiftUI
@MuseumShuffle@mastodon.social avatar

I hit a nasty bug because I didn't realize that Logger was truncating my latitude and longitude values I was having it display. print does not does this.

Is there a way to configure Logger to not do this and act like print does? I didn't see anything in the documentation.

#SwiftUI

wtfSwiftUI,

@MuseumShuffle I don’t know if it’ll apply to your specific case, but I’ve found that pre-converting values to strings bypasses formatting done in interpolation. E.g.,
let x = 1234.56
let s = “x: (String(x))”

JTostitos, to swift
@JTostitos@techhub.social avatar

Is there something I am missing here? Whenever I try to run either my AppShortcut or just a regular shortcut that includes one of my actions, it gives me an error.

Also of note, the AppShortcut is not blue like I tell the system with the ShortcutTileColor.

image/jpeg

wtfSwiftUI,

@JTostitos Something I learned the hard way is to frequently do a “Clean Build Folder” in Xcode, when working on AppIntents.

The system caches your AppIntents, so any changes you make (and then build) get ignored unless you delete the app first (which the clean command does, unless you’ve installed the app outside the build folder).

davidbures, to swift
@davidbures@mstdn.social avatar

I’ve been trying to learn about the MVVM model in Swift/SwiftUI and there’s one thing I don’t get, so please help:

Doesn’t injecting a massive view model everywhere it’s needed lead to performance problems? It doesn’t seem intuitive to me, but I know I’m not getting something about it 😅

#swift #swiftui

wtfSwiftUI,

@davidbures If it’s a class, rather than a struct, it’s passed by reference—so no it’s not duplicated in memory. Just one instance.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • khanakhh
  • magazineikmin
  • tacticalgear
  • GTA5RPClips
  • thenastyranch
  • everett
  • ngwrru68w68
  • Youngstown
  • slotface
  • InstantRegret
  • kavyap
  • DreamBathrooms
  • ethstaker
  • provamag3
  • rosin
  • cubers
  • modclub
  • cisconetworking
  • Durango
  • osvaldo12
  • mdbf
  • tester
  • Leos
  • normalnudes
  • anitta
  • megavids
  • lostlight
  • All magazines