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
Fate Accomplice
Nov 30, 2006




KidDynamite posted:

Well poo poo. That’s def an area I need more experience with. Can you to point at any resources you think would have made you ace the section?

that's the problem: I absolutely cannot. there doesn't appear to be anything that covers the depth they're looking for that's not the official docs, and those are super dry to the point of almost impracticality.

I even asked the interviewers after the second time I interviewed to please send me any resources they knew of, and got nothing back.

obviously people still pass and get jobs at Apple, I just have no idea how they pick up the skills for that one interview.

Adbot
ADBOT LOVES YOU

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.

uncle blog
Nov 18, 2012

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.

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?

uncle blog fucked around with this message at 22:23 on Jun 1, 2021

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

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
I love how there's three different ways of using SPM with Xcode (open a Package.swift file, generate a xcode project from a Package.swift file, and add SPM packages to an xcodeproj) and you get significantly different sets of features and bugs depending on which you pick.

fankey
Aug 31, 2001

Anyone have any experience with the the apparently new limitations on using mulitcast in apps? Our app both sends and receives multicast UDP in order to discover devices on the local network. It appears as though 14.6 broke this. I've found this page https://developer.apple.com/news/?id=0oi77447. That page has a link titled Request the com.apple.developer.networking.multicast entitlement which sends you to an odd page where you have to manually fill things out like App ID, App Name, Description, etc. I would have assumed Apple could have figured out most of this information since the app is registered but whatever. We've filled out the form and added the 'Privacy - Local Network Usage Description' string to the plist but then what happens? We haven't received any confirmation or additional information after submitting the form. At some point does someone wave their magic wand and our app starts working? Will we need to resubmit after they've done whatever they need to do?

awesomeolion
Nov 5, 2007

"Hi, I'm awesomeolion."

Experiencing some weird collision issues:



Here's my physicsBody code for the path-based colliders that cover the "death" areas:

code:
shape.physicsBody = SKPhysicsBody(polygonFrom: bez.cgPath)
shape.physicsBody?.affectedByGravity = false
shape.physicsBody?.categoryBitMask = CollisionTypes.obstacle.rawValue
shape.physicsBody?.collisionBitMask = CollisionTypes.ship.rawValue
shape.physicsBody?.contactTestBitMask = CollisionTypes.ship.rawValue
shape.physicsBody?.allowsRotation = false
shape.physicsBody?.usesPreciseCollisionDetection = true
And here's my physicsBody code for the ship:

code:
ship.physicsBody = .init(circleOfRadius: 15)
ship.physicsBody?.affectedByGravity = false
ship.physicsBody?.categoryBitMask = CollisionTypes.ship.rawValue
ship.physicsBody?.allowsRotation = false
ship.physicsBody?.usesPreciseCollisionDetection = true
I tried a few different combinations of the physicsBody properties, but it seems that if collisions are working between my ship and the death zones then I get some false positives in the curved path sections. Any ideas would be much appreciated.

Edit: I think it might be making a convex path out of the path I provide, which would explain why it always tends to happen at that location. Something like this:

P0PCULTUREREFERENCE
Apr 10, 2009

Your weapons are useless against me!
Fun Shoe

awesomeolion posted:

Experiencing some weird collision issues:



Here's my physicsBody code for the path-based colliders that cover the "death" areas:

code:
shape.physicsBody = SKPhysicsBody(polygonFrom: bez.cgPath)
shape.physicsBody?.affectedByGravity = false
shape.physicsBody?.categoryBitMask = CollisionTypes.obstacle.rawValue
shape.physicsBody?.collisionBitMask = CollisionTypes.ship.rawValue
shape.physicsBody?.contactTestBitMask = CollisionTypes.ship.rawValue
shape.physicsBody?.allowsRotation = false
shape.physicsBody?.usesPreciseCollisionDetection = true
And here's my physicsBody code for the ship:

code:
ship.physicsBody = .init(circleOfRadius: 15)
ship.physicsBody?.affectedByGravity = false
ship.physicsBody?.categoryBitMask = CollisionTypes.ship.rawValue
ship.physicsBody?.allowsRotation = false
ship.physicsBody?.usesPreciseCollisionDetection = true
I tried a few different combinations of the physicsBody properties, but it seems that if collisions are working between my ship and the death zones then I get some false positives in the curved path sections. Any ideas would be much appreciated

Is it the tail?

awesomeolion
Nov 5, 2007

"Hi, I'm awesomeolion."


I tried disabling the tail and got the same results. I think it might be the convex issue I posted above. Probably could have done a better job reading the physicsBody init polygonFrom docs:

quote:

A convex polygonal path with counterclockwise winding and no self intersections. The points are specified relative to the owning node’s origin.

Small White Dragon
Nov 23, 2007

No relation.
....So now you can build on iPadOS?

KidDynamite
Feb 11, 2005

Small White Dragon posted:

....So now you can build on iPadOS?

yeah they way they zoomed past that was weird.

Fate Accomplice
Nov 30, 2006




I got the sense it was only apps created in a playground and using SwiftUI, so I'm guessing it's not super complex stuff.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
I really hope Xcode Cloud is a real thing that Apple uses internally because a working CI/CD system for apple development would be so amazing.

frogbs
May 5, 2004
Well well well

KidDynamite posted:

yeah they way they zoomed past that was weird.

Why do I have the feeling it'll be hardware restricted to specific models too...

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Hello struct AttributedString!

Pulcinella
Feb 15, 2019
Probation
Can't post for 10 days!
The Metal people always seem very on the ball with lots of updates, sessions, documentation, and sample code.

Where should I start if I want to dive in and learn it?

Doc Block
Apr 15, 2003
Fun Shoe
https://metalbyexample.com is how I learned, but the dude has for some weird reason gone back and changed some of the older articles and their code samples and they no longer compile as-is (he removed some stuff that used to be in them)

TheReverend
Jun 21, 2005

Plorkyeran posted:

I really hope Xcode Cloud is a real thing that Apple uses internally because a working CI/CD system for apple development would be so amazing.

GitHub Actions holds a special place in my heart.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Plorkyeran posted:

I really hope Xcode Cloud is a real thing that Apple uses internally because a working CI/CD system for apple development would be so amazing.

It is.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Small White Dragon posted:

....So now you can build on iPadOS?

You can build SwiftUI apps in Swift Playgrounds.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

TheReverend posted:

GitHub Actions holds a special place in my heart.

The same place as Xcode 12.4? :D

KidDynamite
Feb 11, 2005

kind of salty AsyncImage is SwiftUI only.

Pulcinella
Feb 15, 2019
Probation
Can't post for 10 days!
Does this not work for your use case?

https://developer.apple.com/documentation/uikit/uiimage/3750844-preparefordisplay

KidDynamite
Feb 11, 2005


did not see that and it wasn't mentioned in What's New In UIKit. good find!

Pulcinella
Feb 15, 2019
Probation
Can't post for 10 days!

KidDynamite posted:

did not see that and it wasn't mentioned in What's New In UIKit. good find!

This has been a good overview of all the new developer focused technologies.

https://developer.apple.com/documentation/New-Technologies-WWDC-2021

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

fankey posted:

Anyone have any experience with the the apparently new limitations on using mulitcast in apps? Our app both sends and receives multicast UDP in order to discover devices on the local network. It appears as though 14.6 broke this. I've found this page https://developer.apple.com/news/?id=0oi77447. That page has a link titled Request the com.apple.developer.networking.multicast entitlement which sends you to an odd page where you have to manually fill things out like App ID, App Name, Description, etc. I would have assumed Apple could have figured out most of this information since the app is registered but whatever. We've filled out the form and added the 'Privacy - Local Network Usage Description' string to the plist but then what happens? We haven't received any confirmation or additional information after submitting the form. At some point does someone wave their magic wand and our app starts working? Will we need to resubmit after they've done whatever they need to do?

The "Privacy - Local Network Usage Description" is required when you are using Bonjour (eg via NWBrowser). This doesn't require any special entitlements and is automatically controlled by the TCC prompt for permission (and can be toggled in Settings). If at all possible I highly recommend using Bonjour. It's open source (see mDNSResponder) and built-in basically everywhere at this point.

The entitlement is if you want direct access to multicast TCP/UDP (depending on device).

KidDynamite
Feb 11, 2005

Pulcinella posted:

This has been a good overview of all the new developer focused technologies.

https://developer.apple.com/documentation/New-Technologies-WWDC-2021

Nice! will check that out today.


https://mobile.twitter.com/twannl/status/1402164871974817794

I don’t think we have account deletion anywhere… heh

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.

fankey
Aug 31, 2001

Simulated posted:

If at all possible I highly recommend using Bonjour. It's open source (see mDNSResponder) and built-in basically everywhere at this point.
We switched from Bonjour to our own discovery method over 10 years ago. It didn't really seem sufficient for modern 3 tier networks. The main issues were (1) it's not routable without an mDNS gateway and (2) the automatic query interval increase means joining 2 'steady-state' networks can mean waiting up to an hour for devices to discover each other. Couple that with the requirement to support Windows with Apples schizophrenic support of Bonjour on Windows I think we made the right choice. It's possible we either misunderstood these limitations or they have since been addressed but it's not clear to me how anyone could use Bonjour beyond a simple flat network.

We did get a response from Apple regarding our usage of multicast so hopefully we'll get a resolution soon.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

fankey posted:

We switched from Bonjour to our own discovery method over 10 years ago. It didn't really seem sufficient for modern 3 tier networks. The main issues were (1) it's not routable without an mDNS gateway and (2) the automatic query interval increase means joining 2 'steady-state' networks can mean waiting up to an hour for devices to discover each other. Couple that with the requirement to support Windows with Apples schizophrenic support of Bonjour on Windows I think we made the right choice. It's possible we either misunderstood these limitations or they have since been addressed but it's not clear to me how anyone could use Bonjour beyond a simple flat network.

We did get a response from Apple regarding our usage of multicast so hopefully we'll get a resolution soon.

Great, let me know if you have trouble getting a response and I'll see if I can find the right person to poke.

I assume your users are in corp networks where different devices are on separate VLANs and that's why normal Bonjour wasn't working for you? A lot of commercial WiFi APs, routers, etc have built-in support for Bonjour proxying and management now. You can configure the rules to decide which devices on which VLANs or subsets get shared with others on the service type level, so eg you can allow APs in a specific building to proxy AirPrint advertisements from that building's printer VLAN to the whole building (via all APs and desktop VLANs) but restrict music sharing or AirPlay to be only devices connected to the same AP.

Regarding #2: normally a new service announces itself when connecting so you shouldn't see a delay when browsing for new services and similarly a host looking for new services can query that at any time so it should fine them immediately despite the exponential backoff caching. Moving networks should automatically reset the local cache so if a device moves from one VLAN to another (eg by switching APs) it should clear its own Bonjour cache and there shouldn't be a delay in discovering devices on the new network.

If you have specific scenarios that don't work or other concerns feel free to DM me a feedback number and I can forward this to the networking team.

uncle blog
Nov 18, 2012

Is it true that I can use all the latest Swift features (like async/await) regardless of what iOS versions i support? I read somewhere that it always compiles to code supported on all iPhones, and only Cocoa Touch stuff requires related iOS version?

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
My understanding is that Swift Concurrency relies on significant runtime support, which is only available in the new operating systems.

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.

fankey
Aug 31, 2001

Simulated posted:

Great, let me know if you have trouble getting a response and I'll see if I can find the right person to poke.

I assume your users are in corp networks where different devices are on separate VLANs and that's why normal Bonjour wasn't working for you? A lot of commercial WiFi APs, routers, etc have built-in support for Bonjour proxying and management now. You can configure the rules to decide which devices on which VLANs or subsets get shared with others on the service type level, so eg you can allow APs in a specific building to proxy AirPrint advertisements from that building's printer VLAN to the whole building (via all APs and desktop VLANs) but restrict music sharing or AirPlay to be only devices connected to the same AP.

Regarding #2: normally a new service announces itself when connecting so you shouldn't see a delay when browsing for new services and similarly a host looking for new services can query that at any time so it should fine them immediately despite the exponential backoff caching. Moving networks should automatically reset the local cache so if a device moves from one VLAN to another (eg by switching APs) it should clear its own Bonjour cache and there shouldn't be a delay in discovering devices on the new network.

If you have specific scenarios that don't work or other concerns feel free to DM me a feedback number and I can forward this to the networking team.

Thanks for the offer. Hopefully they will respond in the next week or so.

Yeah, a lot of our customers are on Cisco style 3 tier networks with lots of routing. The particular job that blew up for us was a cruise ship where every room was on it's own subnet. Not sure exactly what they were trying to solve. At the time I don't think the Bonjour routing in the switches was a thing.

When a device detects a change to it it's network connectivity due to link change or AP switch it will definitely reset the interval and there aren't any issues. The problem we were seeing was due to network changes that the devices cannot detect. For example - device 1 hooked up to switch 1, device 2 hooked up to switch 2. Let that sit for an hour or so. Now connect switch 1 to switch 2. Each device will have slowed down their interval ( I think the slowest they end up at is 1 hour ) but there is nothing to inform the devices that they need to clear their cache and reset the interval.

Dirk Pitt
Sep 14, 2007

haha yes, this feels good

Toilet Rascal

Glimm posted:

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

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

The Raymond Chen approach is the superior approach and I hope apple really starts realizing the power of their devices and backwards compatibility.

uncle blog
Nov 18, 2012

I'm working on a scrollable view with cards. I want the middle cards to have bigger size than the other ones, and a set of dots indicating the total number of cards and which one is currently in focus.

Something like this:


Is there a go-to way of doing something like this? My current plan is to use a collection with with diffableDataSource, and maybe use the sizeForItemPath to check whether the item is centered or not?

uncle blog fucked around with this message at 12:50 on Jun 14, 2021

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
I still don't understand how the Xcode 12 tab system works or what the gently caress it's doing. After a few hours of work I always have a giant pile of tabs open but I have no idea what causes it to open a new tab rather than reuse the existing tab other than that it somehow always does the exact opposite of what I want. When I actually want to switch back and forth between two files then the files are consistently in the same tab, and all the files that I open once and never look at again magically get tabs.

dizzywhip
Dec 23, 2005

Plorkyeran posted:

I still don't understand how the Xcode 12 tab system works or what the gently caress it's doing. After a few hours of work I always have a giant pile of tabs open but I have no idea what causes it to open a new tab rather than reuse the existing tab other than that it somehow always does the exact opposite of what I want. When I actually want to switch back and forth between two files then the files are consistently in the same tab, and all the files that I open once and never look at again magically get tabs.

I had a lot of trouble with the new tab system when it first came out too, so I ended up spending some time studying it and tweaking settings to try to figure out a workflow I liked. The settings are pretty unintuitive, looking at them again I couldn't tell you how they work without testing out each option again. I've built up enough muscle memory with the new system that it doesn't bother me too much anymore, but I have the same problem with tabs piling up over time. You just have to be proactive about closing them out when you're done with them, but I find that hard to keep up with in practice so I usually end up with a mess of files until it gets too annoying to deal with and I close them all.

I think what's tripping you up is that when you first open a tab, it's in a special transient state indicated by an italic font for the title. If you open another file while a transient tab is open, it will replace the content of the transient tab rather than opening a new tab. Editing the file will take it out of the transient state, and it will stay open until you explicitly close it. You can also use the File > Open in Tab command (or ⌥⌘O) to do the same thing without having to edit the file. So I've gotten in the habit of running that command on each tab that I open when I know that I need to work with multiple files.

Fate Accomplice
Nov 30, 2006




dizzywhip posted:

I think what's tripping you up is that when you first open a tab, it's in a special transient state indicated by an italic font for the title. If you open another file while a transient tab is open, it will replace the content of the transient tab rather than opening a new tab.

I want to turn off this transient state completely. every thing should open in a new tab. can I do that?

Adbot
ADBOT LOVES YOU

dizzywhip
Dec 23, 2005

Fate Accomplice posted:

I want to turn off this transient state completely. every thing should open in a new tab. can I do that?

No I don't think that's possible unless I've missed something. One thing you can do is set the navigation style to "open in place", and double-click navigation to "uses separate window tab", and you'll get the old tab behavior. Then if you open everything with a double click you'll always get a separate window tab.

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