|
dizzywhip posted:Editing the file will take it out of the transient state, and it will stay open until you explicitly close it. Well I guess that explains the behavior but that's certainly not something I ever would have guessed and it's trying way too hard to be clever.
|
# ? Jun 17, 2021 20:23 |
|
|
# ? May 15, 2024 06:25 |
|
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. 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. You can also double-click an italic tab to keep it open. I've been doing that when I know I'll need a few files to stay open. I also tend to close all tabs when I'm done with the current task, which I inefficiently do by right-clicking a tab and choosing "Close Other Tabs" then command-W the last tab. Also each split can have its own italic tab.
|
# ? Jun 17, 2021 21:46 |
|
I am curious about something. Unless I really plan to do a deep dive and want to be an Apple specific developer, is there any benefit to me learning Swift/UIKit etc. as opposed to sticking with something like React Native (Expo)? I had done a lot of Apple development some years ago (2010-2013 maybe) and wonder if I really need to learn the Apple specific stack or if sticking with something like RN will do everything I need?
|
# ? Jun 25, 2021 19:20 |
|
I think you hit the nail on the head, it depends on whether React Native has everything you need. If some component is missing (e.g. iOS 15 has some new thing and RN is slow to support it), you'll be diving into SwiftUI or UIKit pretty quick. iOS-specific knowledge might help evaluate whether some random third party RN component is worth using. And it might be relevant when debugging or profiling a RN app? All three of those circumstances seem like a decent place to start/resume learning about iOS specifics, and if they never come up then all the better! edit: There's maybe some bits that RN doesn't support at all, like home screen widgets or watch apps? I have no idea what the story is there but it seems like it would be complicated.
|
# ? Jun 25, 2021 21:39 |
|
I just got owned for like 3 hours by UIStackView.removeArrangedSubview(_:) you have to call removeFromSuperview() on the view as well to prevent it from actually appearing on the screen I'm going to get chewed up and spit out during this Apple interview. ModeSix posted:I am curious about something. Only learn as much as you need if you don't plan on being an iOS developer. tbh i feel like it's more of a pain being an iOS dev when it comes to job search time.
|
# ? Jun 29, 2021 21:24 |
|
KidDynamite posted:I just got owned for like 3 hours by UIStackView.removeArrangedSubview(_:) you don't need to call both though, calling removeFromSuperview is sufficient
|
# ? Jun 30, 2021 19:26 |
|
Also stack views now draw their background color. Just in case stack view trivia forms a core component of the interview gauntlet
|
# ? Jun 30, 2021 19:31 |
|
Just a friendly heads-up that Swift is one of the languages now officially supported in the recently-updated [code=thing] tags. Enjoy! Full list of supported languages/language aliases available here.
|
# ? Jul 2, 2021 07:17 |
|
got got by the concurrency question even though Fate Accomplice warned me. RIP
|
# ? Jul 2, 2021 20:41 |
|
KidDynamite posted:got got by the concurrency question even though Fate Accomplice warned me. RIP My condolences, but also spill the beans! I imagine I would crash and burn as well. We don’t really do any concurrency outside of the standard “REST API call on a background thread, then update the UI with the results in the main thread).”
|
# ? Jul 3, 2021 16:15 |
|
KidDynamite posted:got got by the concurrency question even though Fate Accomplice warned me. RIP rough! Pulcinella posted:My condolences, but also spill the beans! it boggles the mind that a) people clearly still get jobs at apple writing iOS and b) no one is able to point to a single resource to learn this stuff practically than https://developer.apple.com/library.../uid/TP40008091
|
# ? Jul 3, 2021 20:55 |
|
You would think Apple would hire good developers and then train them in iOS details vs expecting people to be iOS experts in areas that no one outside Apple is too concerned about. I guess everyone wants to work for Apple though so you can hire whoever you want.
|
# ? Jul 4, 2021 01:04 |
|
smackfu posted:You would think Apple would hire good developers and then train them in iOS details vs expecting people to be iOS experts in areas that no one outside Apple is too concerned about. maybe it's like with those exclusive clubs, you have to know someone who's already in (to give you hints on what gotchas to look out for) or you end up repeating the process so many times the sunk cost will make you appreciate the job more and demand less
|
# ? Jul 4, 2021 11:33 |
|
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.
|
# ? Jul 4, 2021 15:17 |
|
KidDynamite posted: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. i guess that's expecting you to know about DispatchGroups, which i would totally have to reach for the manual for, i don't think i've ever had to use them in anger. reasonably well documented tho, afaik.
|
# ? Jul 4, 2021 15:24 |
|
Sounds like OperationQueue to me. Set the max concurrent operations property and toss BlockOperations on to the queue. (Guessing the next question would be "ok pretend you don't have OperationQueue", at which point I think to myself "ah, because we're working on the Apple platform that doesn't have Foundation available".)
|
# ? Jul 4, 2021 15:47 |
|
They’re probably not expecting you to know specific concurrency APIs, just to have some idea of what it takes to do those things.
|
# ? Jul 5, 2021 01:11 |
|
pokeyman posted:Sounds like OperationQueue to me. Set the max concurrent operations property and toss BlockOperations on to the queue. Or because they're hiring you to work on OperationQueue. Even if the position is for just normal iOS app development, a decent rule of thumb is that you should be reasonably familiar with one level of abstraction below the one where you're working. Modern computing is way too complicated for anyone to master the entire stack that we build applications on, but the layer that you're building on top of is inevitably going to have bugs and quirks that you need to deal with. It's a lot easier to understand how to use an OperationQueue correctly if you know enough to be able to implement a naive version of it yourself using lower-level threading APIs. I don't have any particular insight into what Apple specifically is looking for, but one thing I've observed in both developing iOS apps and in looking at code that our customers send to us is that benign concurrency related bugs are nigh omnipresent. It's very rare to look at some code using GCD and not spot at least one race condition, usually because they don't actually matter in that specific scenario. If there's a one in a billion chance of an app displaying the wrong text in a cell for a few frames, that's just not a bug worth thinking about. However, this means that it's possible to write a great app that makes heavy use of GCD where concurrency-related bugs aren't causing problems for users, but still not have a great grasp on how to write correct concurrent code (if anyone can truly be said to be great at that). I suspect that Apple thinks they need those developers who have a decent shot at writing correct threaded code rather than threaded code which is merely free of important bugs. It could also just be a dumb question where they think that people good at threading must be good at everything that matters, of course.
|
# ? Jul 5, 2021 01:47 |
|
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.
|
# ? Jul 5, 2021 02:22 |
|
Plorkyeran posted:Or because they're hiring you to work on OperationQueue. Yeah I know. It'd still be my first answer! Well, no, my first answer would be "can we not?" and run the blocks synchronously with a lock because that's "up to five".
|
# ? Jul 5, 2021 05:23 |
|
I'm trying to do something that my webdev brain thinks should be really simple, but somehow I'm not sure how best to do this. I want to pass a function from a vc to a child vc as a paramter when initialising the child vc. I want to use it like this code:
code:
|
# ? Jul 6, 2021 15:05 |
|
I would expect that to work. Are you getting an error? The child doesn't have an objc-visible method called action, so maybe the button isn't doing anything? Finally, be careful about a strong reference cycle, as the parent passing in action is actually passing in self.action. You're ok here so long as the child gets dismissed somehow, but it's the kind of thing I've messed up many times so I thought I'd mention it .
|
# ? Jul 6, 2021 16:33 |
|
Made a few changes to make it buildSwift code:
Swift code:
|
# ? Jul 6, 2021 16:41 |
|
Either I've been missing out or that button action still won't do anything. Gotta make a method that calls the passed-in block.
|
# ? Jul 6, 2021 19:04 |
|
pokeyman posted:Either I've been missing out or that button action still won't do anything. Gotta make a method that calls the passed-in block. Yeah I just quickly mocked it up with some xibs and you'll need something like Swift code:
|
# ? Jul 6, 2021 19:30 |
|
Yeah, one of the fundamentals of Cocoa’s target-action model is using a method for the action rather than a closure; it lets you loosely rather than tightly couple actions, and allow “the same” commands to be used easily with multiple code paths via the responder chain. This probably seems weird to people who insist on doing things the hard way and using code for everything, since we designed everything to be used with Interface Builder from practically day one (Bill Parkhurst and Jean-Marie Hullot worked together on the AppKit-IB design at NeXT).
|
# ? Jul 6, 2021 21:32 |
|
iPadOS 14.2's focus stuff changed the responder chain when Full Keyboard Access is enabled and it made me mad because I was trying to use the responder chain like a good boy. No idea if this was an intentional change. FB8944717 if anyone is curious.
|
# ? Jul 6, 2021 22:53 |
|
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.
|
# ? Jul 7, 2021 19:08 |
|
Is there a good primer to C++/Metal Shading Language syntax for someone largely used to Swift style syntax? Trying to learn Metal but reading C++ is a pain. Also, mandatory semicolons were a mistake.
|
# ? Jul 9, 2021 18:16 |
|
The Metal Shading Language from Apple Also try Metal by Example Also Apple’s Metal sample code.
|
# ? Jul 9, 2021 18:32 |
|
I have structs which include variable which is enum of a new struct. I would like to filter out instances with a certain enum. This is a simplified example of the struct: code:
code:
VVVV Well that works, so thanks! uncle blog fucked around with this message at 18:18 on Jul 28, 2021 |
# ? Jul 28, 2021 14:37 |
|
uncle blog posted:I have structs which include variable which is enum of a new struct. I would like to filter out instances with a certain enum. I think you're stuck with an if case or a switch, e.g. Swift code:
|
# ? Jul 28, 2021 16:27 |
|
If you only care about state:code:
code:
|
# ? Jul 29, 2021 01:04 |
|
Does anyone know of a way to overcome this Xcode13 error without adjusting the target version? It appears to have been immediately closed as wontfix and I'm stumped. From googling, it seems to have caught people by surprise. https://bugs.swift.org/browse/SR-14878 posted:Enum cases with associated values cannot be marked potentially unavailable with '@available'
|
# ? Aug 2, 2021 13:23 |
|
Anyone have ideas for how to prep for an iOS system design interview? My ideas so far are going through the objc io architecture book and reading random medium articles that show up when i google ios system design interview.
|
# ? Aug 4, 2021 06:29 |
|
I created a new universal SwiftUI app, Xcode gave me iOS and MacOS folders with separate Info.plist files. Is there a way to share values between them, or do I need to add to both?
|
# ? Aug 26, 2021 05:44 |
|
You need to add to both, as iOS and macOS use different underlying UI frameworks (UIKit and AppKit).
|
# ? Aug 26, 2021 06:24 |
|
With Xcode 13, there’s Info.plist generation, so you can put stuff to share between them in the project’s build settings or in an xcconfig file (for supported Info.plist keys, it’s not an open-ended system).
|
# ? Aug 26, 2021 06:25 |
|
eschaton posted:With Xcode 13, there’s Info.plist generation, so you can put stuff to share between them in the project’s build settings or in an xcconfig file (for supported Info.plist keys, it’s not an open-ended system). Is interpolation via $(…) no longer recommended? Works well if you're ok specifying the key everywhere, as you can define the value once in a project-wide build setting. OP, you can also run the C preprocessor over your Info.plist but that is kinda gross.
|
# ? Aug 26, 2021 07:49 |
|
|
# ? May 15, 2024 06:25 |
|
You can do interpolation via $() as well, it can be useful in an Info.plist source file used with just the non-build setting keys
|
# ? Aug 26, 2021 09:24 |