Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Glimm
Jul 27, 2005

Time is only gonna pass you by

I think viewDidLoad is fine too, though you might be replacing the root view sometimes in which case loadView makes more sense because you've got to set the root there anyway

If I've got to muck with layout after getting size information (adjusting constraint constants) I do it in viewDidLayoutSubviews, just be careful not to create a layout cycle.

Adbot
ADBOT LOVES YOU

Glimm
Jul 27, 2005

Time is only gonna pass you by

One thing that made AutoLayout a lot better to me is layout anchors and Use Your Loaf has a really good post about them:
https://useyourloaf.com/blog/pain-free-constraints-with-layout-anchors/

I haven't read through Apple's docs here in awhile but this is probably good too, though you may have already seen it:
https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/AutolayoutPG/index.html

Anything specific causing you issues?

Glimm
Jul 27, 2005

Time is only gonna pass you by

I would fail hard at concurrency-related questions in an interview. I feel like I've been cheating by using ReactiveCocoa (pre-Swift) and RxSwift (and now Combine) for so long.

Glimm
Jul 27, 2005

Time is only gonna pass you by

uncle blog posted:

Is there an overwhelming consensus for naming every viewcontroller "XxxViewController" instead of "XxxVC"?
I find the shorthand version much easier to parse at a glance, but I'm not gonna go down this path if everybody else has decided not to.

In my personal projects I do this and haven't run into issues. I pitched it to folks at work and they wanted `ViewController` so that's what we do there.

uncle blog posted:

Edit:
Also. I added som Firebase products to a project using Swift Package Manager. Now I realize I need to add one more that I didn't originally select from the available list. Is there an easy way to do this?

I'm not sure - I think I've always had to remove and add it back.

I'm pretty salty about the SPM+Xcode integration as a whole - I wish it were just a plain Swift file you could edit by hand (even if there were a graphical interface it should just generate/modify a swift file).

Glimm fucked around with this message at 22:36 on Jun 1, 2021

Glimm
Jul 27, 2005

Time is only gonna pass you by

KidDynamite posted:

kind of salty AsyncImage is SwiftUI only.

I'll complain about that in 3 years when I can finally use it, in the meantime I'll complain about the fact that I need to support completely broken iOS 13 in SwiftUI for another year.

Apple really needs the equivalent of Android's Jetpack.

Glimm
Jul 27, 2005

Time is only gonna pass you by

eschaton posted:

My understanding is that Swift Concurrency relies on significant runtime support, which is only available in the new operating systems.

Yep: https://forums.swift.org/t/will-swift-concurrency-deploy-back-to-older-oss/49370/4

quote:

That said, everyone is aware of the value of it doing so, and is something that is being explored/considered.

This bit is interesting though. I hope Apple starts taking this approach.

Glimm
Jul 27, 2005

Time is only gonna pass you by

eschaton posted:

This probably seems weird to people who insist on doing things the hard way and using code for everything

Fwiw I've spent a lot of time doing it both ways and laying out in code is easier over the long term imo.

Now most of our new stuff is SwiftUI which is even easier but also still code.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Does C23 adding '@' to its source character set have any impact on Objective-C in the future? Is it mainly a compatibility thing - ie, someone could name a function `@` which ObjC would have difficulty working with?

https://twitter.com/__phantomderp/status/1494801823949103107

Glimm
Jul 27, 2005

Time is only gonna pass you by

Ah okay, thanks!

Glimm
Jul 27, 2005

Time is only gonna pass you by

Has anyone run into an issue where an ipa created in CI has proper entitlements (e.g., push notifications) - validated by unzipping the ipa and inspecting it - but after uploading to the AppStore (TestFlight) the entitlements are gone?

We are moving from GitLab CI (and self-hosted runners) to Azure DevOps (MS runners) and for some reason, our builds in TestFlight no longer have push capability (or any entitlements). It's strange because we're able to download the ipa we create, unzip it, and can see the provisioning looks correct.

We use this Azure Extension to do the upload: https://marketplace.visualstudio.com/items?itemName=ms-vsclient.app-store which looks like it uses Fastlane, maybe folks have seen this with Fastlane, too.

Would this be worth a TSI? I've never really used it but I'm pretty lost on what to try next.

Glimm fucked around with this message at 02:21 on Apr 1, 2022

Glimm
Jul 27, 2005

Time is only gonna pass you by

pokeyman posted:

I'm feeling more sad about "looking forward to using this in a few years when I bump a min sdk requirement" than usual, which is maybe a sign that I'm more excited about what I've seen so far.

100%

SwiftUI and related libraries need to be back ported and available via SPM. The bugs from version to version are hard to deal with, so many version checks in our app.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Is there an easy way to tell if an xcframework relies on/uses HealthKit?

We rely on a 3rd party to give us a binary SDK. They have a version that uses HealthKit and one that does not. They say they've provided us the version without HealthKit, but Apple is rejecting our application because we use HealthKit or CareKit, according to their analysis.

I'm sure we (or the folks providing that SDK) are doing something that's causing HealthKit to be referenced, but I'm not sure how to test for it or validate the build beyond sending it to Apple and crossing my fingers.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Plorkyeran posted:

otool -L Foo.framework/Foo will list the libraries that a framework depends on.

Thanks!

Glimm
Jul 27, 2005

Time is only gonna pass you by

Do the Swift/C++ interop updates change anything with C? Is it possible to make a C target in an SPM project depend on a Swift target?

If not, would the best roundabout way of doing this be to "convert" the project to Objective-C (rename files to .m) and import Swift code that way?

The long-term goal is to rewrite an old C project with ~190,000 LOC in Swift, replacing small bits as we go. The project is deployed on Linux.

Adbot
ADBOT LOVES YOU

Glimm
Jul 27, 2005

Time is only gonna pass you by

I naively attempted to build the project with a C++ compiler and got a lot of build errors :negative:

I'll look into that approach more - I was hoping ObjC would be a good idea since I have a lot more experience with it (C++ I haven't used since a single university course).

Thanks!

edit:

Building with C++ wasn't too bad, now to integrate it with my Swift code using SPM

Glimm fucked around with this message at 19:17 on Jan 15, 2024

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply