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
KidDynamite
Feb 11, 2005

got got by the concurrency question even though Fate Accomplice warned me. RIP

Adbot
ADBOT LOVES YOU

KidDynamite
Feb 11, 2005

ask was to design a function that accepts closures as the arguments and will execute up to 5 of them on concurrently and store any others to execute them as the closures complete.

KidDynamite
Feb 11, 2005

The way I understood it is that an Apple iOS dev isn’t programming with the same rules as regular iOS devs. You have access to more background and low level apis and also be writing your own so they want to see how you think about concurrency because you will be writing daemons that get used by more than just your app.

KidDynamite
Feb 11, 2005

I was looking for a solutions to asynchronous image loading in table views for an interview take home where you can’t use frameworks and came across an apple solution to it. https://developer.apple.com/documentation/uikit/views_and_controls/table_views/asynchronously_loading_images_into_table_and_collection_views

I’m entirely confused by the table view code. When did that shift come about? I feel like I need to go back and learn some things.

Also good lord is there a lot of stuff you don’t really think about when you’re in an already built app with an established code base and use frameworks.

Do y’all keep like an architecture skeleton repo around to help with setting up new apps? I don’t really make apps from scratch often.

KidDynamite
Feb 11, 2005

only 5 warnings though!

KidDynamite
Feb 11, 2005

Pulcinella posted:

. Also I don’t believe it has source control!

lol. teaching young devs bad habits.

KidDynamite
Feb 11, 2005

holefoods posted:

Thanks for the recommendations everyone, Advent of Code looks great as I had been trying to find a website with problems but Swift specific stuff is rare. I know that I am still very early on in the learning process, so it's great to get some pointers and see what people think would have been beneficial.

Apple's curriculum seems a bit odd because it seems to indicate that you should go Explorations -> Fundamentals -> Data Collections but the first two books seem to largely cover the same things, but Fundamentals looks a bit more in-depth and has less guided portions/Playgrounds. So, it's possible I'm jumping the gun a bit with the things I think I should have a better grasp on. Either way, it's all really clicking a lot better than other books I had tried for C so I'm looking forward to becoming a thread regular.

I don't know if you're planning to learn Swift for iOS development. If you are I want to recommend the Stanford iOS development course. You will learn a ton of poo poo in there that I think most average entry level iOS devs don't know.

The course tells you what you need to read from the Swift Programming Language so that's a pretty good guide of where you should be at.





Also very thankful Apple pushed the delete account in-app requirement. That was kinda stressing me out.

KidDynamite
Feb 11, 2005

anyone familiar with getting swiftyjson to work on a m1 mac? one of my coworkers wants to make a small pr to our app but can't get it to build on his machine due to errors with swiftyjson and m1 architecture. I'm still on an intel mac and have been avoiding thinking about this situation and i can't find anything worthwhile via googling.

this might finally give me the coverage to rewrite the app's networking layer.

KidDynamite
Feb 11, 2005

pokeyman posted:

Have you looked through the issues on the repo? e.g. https://github.com/SwiftyJSON/SwiftyJSON/issues/1095

I'm not sure how a swift library for parsing json that is distributed as source manages to have architecture dependencies, but I realize you're playing the hand you were dealt :)

Thanks for this! We tried that and failed. I'm gonna try a few more things and if not use it as a reason to pull swiftyjson and rewrite networking stuff.

KidDynamite
Feb 11, 2005

Plorkyeran posted:

Well I guess build tool plugins being seemingly abandoned is a complaint I can scratch off the list.

What makes you say that?

KidDynamite
Feb 11, 2005

managed to secure another on-site with apple. I’m studying the concurrency stuff, but system design is impossible to find resources on. Help me secure the bag goons.

KidDynamite
Feb 11, 2005

https://twitter.com/johnsundell/status/1492896330003492865

i'm loving slackin.

KidDynamite
Feb 11, 2005

Fate Accomplice posted:

can you share the concurrency resources you're using?

It's this(which is obv old but the concepts still apply) and the official docs unfortunately. I think I asked you for resources last time haha.

Also just reading the async docs and thinking about how the issues async solves were dealt with when it wasn't available. Stuff about writing daemons does not seem available at all.

KidDynamite
Feb 11, 2005

does nsviewrepresentable need a coordinator like uiviewrepresentable as well?

KidDynamite
Feb 11, 2005

Pulcinella posted:

I finally have a chance to use async/await for the project I’m on and…I don’t like it? I know it’s supposed to be simpler and more straightforward than the old method, but I’m so, so used to nested callbacks that it’s been hard to wrap my brain around async await. Like async seems to have this viral quality where when one thing is async, all of a sudden everything around it has to be async and it spreads from there. I just want to wait for one asynchronous data to be retrieved and push a view controller configured with that data but I’m trapped in async world! I just want to get back on the main thread! Give me a pyramid of doom any day.

This is mostly just griping. I should probably go re-watch those WWDC videos.

are you creating a Task to make your async calls in? otherwise async will definitely virally spread.

KidDynamite
Feb 11, 2005

commie kong posted:

the point free fellas have released a video showing off some new helpers they've built.

it's relatively short (33 mins :v:) for anyone interested in swiftui, testing, api mocks, etc.

seems cool but where is the work to create your models and routes? how do you get that for free with their library? or is this just a suggestion for how to structure your networking code?

i guess this is how they hook you into paying for episodes.

edit: oh this was the last video in a 5 part tour of the technique and library. I will have to get back to this.

I'm actually interested in the point free guys work. someone mentioned composable architecture in an interview i had. it's swiftui only though right?

KidDynamite fucked around with this message at 17:55 on May 26, 2022

KidDynamite
Feb 11, 2005

am i burnt out or was wwdc kind of meh this year?

KidDynamite
Feb 11, 2005

do you need the timer to be in the view model?

could try placing the timer in ChildView, put an .onReceive on your ForEach, and expose a function from your ChildVM that lets ChildView ask for an update.

KidDynamite
Feb 11, 2005

hey I have 3k I can spend and get reimbursement from work. What swift resources would y’all spend this money on? Bonus points if it will help land a new job.

Already have objcio and pointfree on the list.

KidDynamite
Feb 11, 2005

if i have a UICollectionView using UICollectionViewCompositionalLayout is it possible to place a header vertically above some horizontally scrolling cells?

i want
code:
  [Header]
  [Cell]<->[Cell]<->[Cell]
what i currently get when i add the header to NSCollectionLayoutSection.boundarySupplementaryItems
code:
[Header]<->[Cell]<->[Cell]<->[Cell]

KidDynamite
Feb 11, 2005

figured this out right after hitting post by setting UICollectionViewCompositionalLayoutConfiguration.scrollDirection to vertical and NSCollectionLayoutSection.orthogonalScrollingBehavior to continuous

spacing is wacky so if anyone has experience there I'd appreciate it. if not back to digging tomorrow.

KidDynamite
Feb 11, 2005

uncle blog posted:

Are there any well-known examples of iOS apps that to a large extent use a lot of webviews? Both successful or unsuccessful examples are most welcome!

old netflix app was all webview. i can't think of any others.

KidDynamite
Feb 11, 2005

where do you get dsyms now? they're not on appstoreconnect and the archiver's download dsym button errors out(because i'm assuming it's trying to download from appstoreconnect.)

KidDynamite
Feb 11, 2005

so I am working to change work.app over to Codable.

when encoding a parameter to be sent over i add it to a dictionary like so

Swift code:
var params: [String: Any] = [:]
params["foo"] = JSONEncoder().encode(bar)
for some reason the parameter's value is set to it's size in bytes rather than the json it prints when i do

Swift code:
po String(decoding: JSONEncoder().encode(bar)!, as:  UTF8.self)
results in a JSON string

Swift code:
po params["foo"] 
results in

code:
&#9663; Optional<Any>
  &#9663; some : 1228 bytes
    - count : 1228
    &#9663; pointer : 0x0000000159937000
      - pointerValue : 5797801984
i'm real confused as to what the hell is going on. encoding works fine for certain models and then shits itself like this for others. any suggestions?

KidDynamite
Feb 11, 2005

open source Foundation preview has been put up. going to enjoy poking around that code base. json decoding is improved 200-500%

https://github.com/apple/swift-foundation

KidDynamite
Feb 11, 2005

do you all have a way of handling strong password suggestion for uitests? i keep running into issues when i try to disable it via settings.

Adbot
ADBOT LOVES YOU

KidDynamite
Feb 11, 2005

viewIsAppearing, xcode test recordings, and push notifications console are my wwdc mvps

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