|
I vote for the option that doesn’t make me wish that ABI stability never happened.
|
# ? Jun 7, 2019 01:24 |
|
|
# ? Jun 4, 2024 22:07 |
|
Has anyone had a chance to try out Metal in Simulator yet? Or observed faster boot times (excluding the first time that sim starts up)?
|
# ? Jun 7, 2019 06:04 |
|
On my 2014 mbp the simulator only ever repaints when the window gains focus so I have to spend a lot of time cmd-tabbing between it and xcode. I have no idea if that's due to it using metal though.
|
# ? Jun 7, 2019 06:29 |
|
Does anyone know any best practices or examples or anything for Core Data and SwiftUI? I watched all the lectures and they were like "you don't need controllers any more" but I'm not seeing a way to hook up core data poo poo to SwiftUI without painstakingly building a bunch of controllers for all this poo poo. There was like one slide about integrating it in the Core Data preso and that was it. Are they all shut up about it because they've got a replacement for Core Data in the works that is actually Swifty, did they just forget about it, or are they just abandoning it because it seems like Core Data does a lot of boring tricky things that I would very much like to not have to do.
|
# ? Jun 10, 2019 01:57 |
|
There isn’t “integration” in the sense of having things in Swift UI or Core Data specifically to make using them together trivial, there’s no equivalent to NSFetchedResultsController for example. Can you describe a little more what you feel integration between Swift UI and Core Data would look like? Core Data objects are just objects and you can use them from Swift just fine; as such, making them fit in with Swift UI (like conforming to Identifiable) is quite straightforward. For example, it wouldn’t be a stretch at all to switch the RoomStore used in the first Swift UI session on Tuesday out for one that uses Core Data and where Room is a subclass of NSManagedObject. It might even be a good exercise to go through.
|
# ? Jun 10, 2019 03:10 |
|
Update I needed to pass an option to allow user interaction on both animation calls: code:
Anyone know how to prevent a UIButton's animation ignoring calling the target's selector while animating? It's a short animation, but I want to let users touch the button rapidly if they wanted. To clarify, this is at the end of a function that's called when touching the button, and while it is animating, the function is completely ignored. code:
Good Sphere fucked around with this message at 20:21 on Jun 14, 2019 |
# ? Jun 14, 2019 19:47 |
|
Simulated posted:Has anyone had a chance to try out Metal in Simulator yet? Or observed faster boot times (excluding the first time that sim starts up)? Oh poo poo is this a thing now? I hope my machines are supported.
|
# ? Jun 17, 2019 10:59 |
|
lord funk posted:Oh poo poo is this a thing now? I hope my machines are supported. Indeed it is. If your machine can run 10.15 then it is supported. Also disregard the Metal docs statement about ATSC not being supported; that’s a doc bug. We transparently decompress ATSC textures on the CPU. We also simulate memoryless and shared texture support in some cases (others require a workaround).
|
# ? Jun 18, 2019 05:24 |
|
I've been having trouble with this for a while. I'm trying to mask a UIPickerView, so that it does not show the squished words outside the bounds of the background layer, which you can see on the left and right: I tried masking it with a CAShapeLayer, but it removes all the text in the UIPickerView instead: (ignore the beige color; that is just what the camera is picking up) To make sure my CAShapeLayer was the right size and shape, I added it as a layer and commented out the mask: Just as I expected, the CAShapeLayer is the right size and in the correct position. What is wrong with my code? BG is the background layer. filterSelection is the UIPickerView. code:
Good Sphere fucked around with this message at 21:37 on Jun 19, 2019 |
# ? Jun 18, 2019 15:12 |
|
I spent some time trying to figure out some of my old code, and I found two versions of a project, one is a bit newer. I'm guessing converting CGImageRef to NSImage is less efficient but if it's the better way to do it for some reason, I'm all ears. Which is the more efficient way of drawing an image? They're rendering pop-up thumbnails of a sort. code:
code:
|
# ? Jun 19, 2019 01:42 |
|
If you already have the CGImage, and you’re doing custom drawing anyway, might as well skip converting it to an NSImage. But if you’re only doing this once in a while, it probably won’t matter.
|
# ? Jun 19, 2019 18:36 |
|
Xcode 2FA question: My dev phone has my own account, but I use another account for development. Xcode is now giving me an error message upon building:quote:You currently don't have access to this membership resource. To resolve this issue, your team's Account Holder, [person's name], must agree to the latest Program License Agreement. I logged into the Developer Portal with the dev account, and it says "Your Apple ID needs to be updated" and a red exclamation point for "Two-factor Authentication". My dev phone has 2FA enabled, but it's my own account. As far as I know, there's no iOS device associated with the dev account. How to proceed?
|
# ? Jul 1, 2019 17:12 |
|
Ran into this recently as well. You need to add your dev account with 2FA to your phone or computer. https://developer.apple.com/support/account/authentication/
|
# ? Jul 1, 2019 22:43 |
|
NoDamage posted:Ran into this recently as well. You need to add your dev account with 2FA to your phone or computer. Thank you! I'm so relieved I'm able to use the 2FA on my computer. I thought I'd have to log out of the account on my phone or something.
|
# ? Jul 2, 2019 15:55 |
|
Are there any good articles about migration from UIKit to SwiftUI? I am thinking of rewriting my app's UI (moving from Storyboards and xibs) and would like to know if I need to basically start from scratch or if there's a way to recreate the UI one view controller at a time.
|
# ? Jul 7, 2019 18:09 |
|
brap posted:Are there any good articles about migration from UIKit to SwiftUI? I am thinking of rewriting my app's UI (moving from Storyboards and xibs) and would like to know if I need to basically start from scratch or if there's a way to recreate the UI one view controller at a time. The approach is quite different so there isn’t really the concept of “porting”. However you can mix and match, which makes it easy to replace things over time rather than throwing everything out.
|
# ? Jul 8, 2019 02:54 |
|
Got my new home dev machine up and running and I've been going through the SwiftUI tutorials - pretty interesting so far. The old soul in me is wary of this level of abstraction but it is quite nice. Anyone else been playing around with it? brap posted:Are there any good articles about migration from UIKit to SwiftUI? I am thinking of rewriting my app's UI (moving from Storyboards and xibs) and would like to know if I need to basically start from scratch or if there's a way to recreate the UI one view controller at a time. Rewriting this early on with something as nascent as SwiftUI sounds scary to me.
|
# ? Jul 11, 2019 03:25 |
|
Doh004 posted:Rewriting this early on with something as nascent as SwiftUI sounds scary to me. It's Apple so it probably baked in their special projects group or some team like that for a couple of years, and it's conceptually similar to stuff that's been around for a while. I think it's less risky than most things you could choose.
|
# ? Jul 11, 2019 04:18 |
|
The backwards compatibility is the only reason I'm not messing with it yet. I like what I've seen just playing with it though.
|
# ? Jul 11, 2019 04:54 |
|
Doh004 posted:Rewriting this early on with something as nascent as SwiftUI sounds scary to me. Yeah, I'm probably punting on it until the designer is available in a non-beta macOS, and it's a personal project so not a ton of risk.
|
# ? Jul 11, 2019 07:30 |
|
Is there something in Xcode that automatically makes other pixel density images for different devices by dragging and dropping in the highest resolution image?
|
# ? Jul 11, 2019 16:42 |
|
Apple doesn’t really do framework ADD so I don’t think there’s any chance of SwiftUI just being abandoned, but it’d still be crazy to port a real app to it before there’s even a non-beta release of it.
|
# ? Jul 11, 2019 18:19 |
|
SwiftUI doesn’t have a CollectionView equivalent yet so I won’t be using it for a real app anytime soon, but I am very excited about the possibilities. I’m hoping that it will make tons of interface builder and auto layout style problems just go away. I say that as someone who actually like IB, storyboards, and autolayout. When they work it’s amazing, but after awhile XIB files seem to get crusty and IB gets cranky and will just fail to render them and throw IB errors no matter what you do.
|
# ? Jul 11, 2019 19:53 |
|
Good Sphere posted:Is there something in Xcode that automatically makes other pixel density images for different devices by dragging and dropping in the highest resolution image? Not that I’ve found. I usually search for some site that will do it because I’ve totally failed to actually solve the problem for myself There’s always sips
|
# ? Jul 11, 2019 20:13 |
|
Good Sphere posted:Is there something in Xcode that automatically makes other pixel density images for different devices by dragging and dropping in the highest resolution image? Put it in the asset catalog cataloged at the correct resolution and enable auto scaling:
|
# ? Jul 11, 2019 20:35 |
|
Does that actually work on iOS? I had no idea. Does it work for app icons?
|
# ? Jul 11, 2019 21:29 |
|
Family Values posted:Put it in the asset catalog cataloged at the correct resolution and enable auto scaling: That's cool. Doesn't that require the device to do some extra work on resizing a large image possibly, instead of loading the right size for the right device? Smaller app file size; more work on the hardware. Also, my app is suddenly giving me a greeting when I preview all the apps that are open! I didn't even update the OS. How is this happening. i.e., It says "Good afternoon" at the bottom of my screen. No other app is doing this.
|
# ? Jul 12, 2019 17:52 |
|
Good Sphere posted:That's cool. Doesn't that require the device to do some extra work on resizing a large image possibly, instead of loading the right size for the right device? Smaller app file size; more work on the hardware. No, the resizing happens at build (and the unnecessary resolutions are thinned by the Store when it’s downloaded to a device)
|
# ? Jul 12, 2019 18:15 |
|
Family Values posted:No, the resizing happens at build (and the unnecessary resolutions are thinned by the Store when it’s downloaded to a device) That is amazing. Thank you.
|
# ? Jul 12, 2019 21:38 |
|
Good Sphere posted:Also, my app is suddenly giving me a greeting when I preview all the apps that are open! I didn't even update the OS. How is this happening. i.e., It says "Good afternoon" at the bottom of my screen. No other app is doing this. This is from handoff or something I think. We got a support case from a customer that had set their name to “dumb head” in some Apple settings and then they were mad that our app was suddenly showing a “Good morning dumb head!” message
|
# ? Jul 13, 2019 14:41 |
|
Is there any reason I can't/shouldn't detect whether a user has a particular app installed, like this? I want to show a link to some company's website, but if the user has that company's app installed, offer that as an option instead/also. Facebook acts like it's doing that, but it's not; I don't have the NYTimes app, so that link just takes me to the app store. Which is weird. I'd like to offer that link if they have the app, but remove it if they don't.
|
# ? Jul 15, 2019 06:32 |
|
Apple does not want you to be able to detect if a user has an app installed because that would be a violation of their privacy.
|
# ? Jul 15, 2019 07:10 |
|
jackpot posted:Is there any reason I can't/shouldn't detect whether a user has a particular app installed, [URL=https://stackoverflow.com/questions/22156042/detect-if-some-other-is-app-installed-on-ios-device]like this? Note that the question/answer is from early 2014, and I think the behaviour has changed since then - I’ve had trouble getting similar functionality working. Having just checked the docs quickly, it seems since iOS9 you have to specify the url schemes you’ll query in your info.plist. I can’t see any documentation on the limits of what you can specify in that list (e.g. whether the schemes need to be owned by another app on your developer account), but there is presumably some additional restriction. Plorkyeran posted:Apple does not want you to be able to detect if a user has an app installed because that would be a violation of their privacy. Basically this.
|
# ? Jul 15, 2019 10:25 |
|
jackpot posted:Is there any reason I can't/shouldn't detect whether a user has a particular app installed, like this? I want to show a link to some company's website, but if the user has that company's app installed, offer that as an option instead/also. Facebook acts like it's doing that, but it's not; I don't have the NYTimes app, so that link just takes me to the app store. Which is weird. I'd like to offer that link if they have the app, but remove it if they don't. I think the general idea is just open the website URL, and if the user has the app installed and the app has Universal Links set up correctly then it’ll open in the app or in Safari as appropriate without you doing anything special. This has the additional benefit of avoiding URL scheme collisions. If life is more complicated, you may find openURL with UIApplicationOpenExternalURLOptionsKey useful? The completion handler is told whether the open succeeded, and if it fails you can open the website instead. Finally, for things like “open in Chrome”, I think the working theory is share the URL using UIActivityViewController and let Chrome add its own activity. If you want something more direct then you can add Chrome’s URL scheme to your Info.plist and call canOpenURL.
|
# ? Jul 15, 2019 14:54 |
|
pokeyman posted:I think the general idea is just open the website URL, and if the user has the app installed and the app has Universal Links set up correctly then itll open in the app or in Safari as appropriate without you doing anything special.
|
# ? Jul 15, 2019 16:13 |
|
Chamook posted:This is from handoff or something I think. We got a support case from a customer that had set their name to “dumb head” in some Apple settings and then they were mad that our app was suddenly showing a “Good morning dumb head!” message lol Thanks I'll look into it. I never remembered setting anything differently, but my app is still showing this message, so it must be somewhere.
|
# ? Jul 15, 2019 16:34 |
|
Any word on whether Swift will support async/await at some point in the future? EDIT: after some research I came upon https://gist.github.com/lattner/429b9070918248274f25b714dcfc7619 (btw, "Proposal: SE-XXXX"? <_<) - but it's not an official one. Doctor w-rw-rw- fucked around with this message at 07:43 on Jul 18, 2019 |
# ? Jul 18, 2019 07:18 |
|
Doctor w-rw-rw- posted:Any word on whether Swift will support async/await at some point in the future? I asked in the PL thread a little while back and the answer was "yes, but it’s complicated so not as soon as you might hope, maybe 2020". Also the limitations of the proposal you linked were acknowledged (turn the page at the PL thread link for more info).
|
# ? Jul 18, 2019 13:44 |
|
pokeyman posted:I asked in the PL thread a little while back and the answer was "yes, but it’s complicated so not as soon as you might hope, maybe 2020". Also the limitations of the proposal you linked were acknowledged (turn the page at the PL thread link for more info). drat, this is a great explanation I missed skipping through that thread. I don't get the feeling that most people realize how much codegen C#-et-al do to make those keywords work, and the tradeoffs that need to be considered implementing them.
|
# ? Jul 18, 2019 15:53 |
|
|
# ? Jun 4, 2024 22:07 |
|
and that they’re not something you can just sprinkle around your codebase like fairy dust to make faster kind of like people discovered about dispatch, that it’s something you have to think about (also as long as there’s a sane memory model I’ve never found myself actually wanting async/await)
|
# ? Jul 18, 2019 21:06 |