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
lord funk
Feb 16, 2004


Hmm seems like I should just be able to read into the package like a directory, no? And I guess I don't mind too much to waste the extra time allocating the UIImage during the save operation. Could be worse.

Adbot
ADBOT LOVES YOU

brand engager
Mar 23, 2011

Is there a type wildcard for generics? I want to check if a view's concrete class is ModifiedContent<Image, *>. I tried with <Image, Any> as the type constraints but that didn't match when I passed in some Image("something).scaleEffect(number).
I'm trying to figure out how tabView is able to tell whether to display the view you pass for the tab buttons even when it's been modified (so it wouldn't be an instance of Image anymore).

lord funk
Feb 16, 2004

Is it possible to set a file's icon from an app? I'm saving user documents, and would like each one's icon to use a screenshot of the doc (that is already part of the document). So, not a single icon, but each file gets its own?

Dog on Fire
Oct 2, 2004

lord funk posted:

Is it possible to set a file's icon from an app? I'm saving user documents, and would like each one's icon to use a screenshot of the doc (that is already part of the document). So, not a single icon, but each file gets its own?

Maybe this method? I’ve never done this so I don’t know which ... limitations it has.

lord funk
Feb 16, 2004

Dog on Fire posted:

Maybe this method? I’ve never done this so I don’t know which ... limitations it has.

Ooh, I'll look into that, thanks. Searching for 'custom file icons xcode' gets a million links about app icons, not files.

Doctor w-rw-rw-
Jun 24, 2008
https://twitter.com/xenadu02/status/1283531972401180672?s=21

https://twitter.com/xenadu02/status/1283532318032883712?s=21

Hah. That’s a very suggestive req. I have a feeling I know exactly what it’s going for, having gone down that route.

lord funk
Feb 16, 2004

Doctor w-rw-rw- posted:

Hah. That’s a very suggestive req. I have a feeling I know exactly what it’s going for, having gone down that route.
Fill us in for those of us who don't know? I'm just curious.

awesomeolion
Nov 5, 2007

"Hi, I'm awesomeolion."

Using CloudKit and Apple Sign In for the first time and I've got a dumb question. I've got CloudKit mirroring my Core Data records, so local data is synced to a private database in CloudKit. Let's say I use the app for a bit, then delete and reinstall it. After I sign in with Apple, I want to sync my Core Data to CloudKit and pull down all my data I saved before. Since CloudKit did its syncing automatically in the first place I'm not really sure how to "reconnect" Core Data with the same CloudKit private database.

Edit: Never mind it does work as you'd expect

awesomeolion fucked around with this message at 03:07 on Jul 19, 2020

lord funk
Feb 16, 2004

Okay this gets me every time. Why does load(fromContents:type:) call in a UIDocument when you first create the document with save(to:for:completionHandler:)? It's like, you create this blank document, and then a second later it tries to load its contents?

edit: hmmm nope maybe there is something going on in my document that's causing this

edit 2: double nope, I am confused as hell. I made a blank test document class, and in my app it calls load(fromContents:type:) after save(to:for:completionHandler:). But in a new blank project, the same thing doesn't happen :confused:

solution: okay figured it out. If the file already exists at the fileURL, and you call save(to: fileURL for: .forCreating), it will load the contents. But if it's actually a new file, it won't.

lord funk fucked around with this message at 17:02 on Jul 19, 2020

lord funk
Feb 16, 2004

Finally got tired of SF Mono not having the U+203E 'overscore' character so I edited the font:

Before:


After:

CeciPipePasPipe
Aug 18, 2004
This pipe not pipe!!
So it seems that macOS 10.15.6 has a new kernel memory leak in the sandbox extension, as described here https://www.macrumors.com/2020/07/27/vmware-confirms-macos-virtualization-bug-causes-crashes/ . This is really ruining my day/week/month.

Any chance someone here knows someone that could escalate this internally for a quick fix?

Edit: I downgraded to macOS 10.15.5 because 10.15.6 was unbearable. They don't make it easy to downgrade, good thing I managed to dig up a 10.15.5 installer somehow.

CeciPipePasPipe fucked around with this message at 16:16 on Aug 1, 2020

SaTaMaS
Apr 18, 2003
Has anyone used coremltools to generate a model? I'd really like for the resulting bounding boxes to be normalized the same standard way as other VNImageBasedRequest results are, however all that seems to be visible on the Python side is the scaled input image in pixels, nothing about the screen size or the original size of the input image, which would be necessary in order to normalize.

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

CeciPipePasPipe posted:

So it seems that macOS 10.15.6 has a new kernel memory leak in the sandbox extension, as described here https://www.macrumors.com/2020/07/27/vmware-confirms-macos-virtualization-bug-causes-crashes/ . This is really ruining my day/week/month.

Any chance someone here knows someone that could escalate this internally for a quick fix?

Edit: I downgraded to macOS 10.15.5 because 10.15.6 was unbearable. They don't make it easy to downgrade, good thing I managed to dig up a 10.15.5 installer somehow.

They didn't provide a feedback number so that makes it about 100x more difficult for anyone to figure out what issue they reported.

brand engager
Mar 23, 2011

brand engager posted:

We're redoing our app's UI and swapping to swiftUI since most of the old UI code will be rewritten. Hope this isn't going to turn out to be a nightmare to code.

We're still working on this lmao

KidDynamite
Feb 11, 2005

brand engager posted:

We're still working on this lmao

any pitfalls you can recommend avoiding? I'm re-doing one of our views in SwiftUI for our next iteration. I'm the lone iOS dev so I can't rewrite the whole thing before Black Friday(ecomm.)

brand engager
Mar 23, 2011

Can't really think of any right now. I've had to reimplement the model and viewmodel classes a few times for reasons not really related to the swiftUI framework, and I'm about to have to do it again.

brand engager
Mar 23, 2011

Is debounce broken in views? I'm trying to do something when a variable in the viewmodel changes.
This works but seems to fire before the value has actually changed
code:
.onreceive(viewmodel.objectWillChange) {
 //do thing here
}
but if I try adding debounce the closure never runs. like
code:
.onreceive(viewmodel.objectWillChange.debounce(for: 1, scheduler: DispatchQueue.main) {
 //do thing here
}
code:
.onreceive(viewmodel.objectWillChange.debounce(for: 1, scheduler: RunLoop.Main) {
 //do thing here
}
code:
.onreceive(viewmodel.objectWillChange.debounce(for: 1, scheduler: DispatchQueue.global()) {
 //do thing here
}
also tried with .seconds(1) instead of just the 1

Edit: looks like the same thing happens with .delay, maybe these publisher modifiers just dont work inside views

brand engager fucked around with this message at 18:53 on Aug 12, 2020

Doc Block
Apr 15, 2003
Fun Shoe
objectWillChange notifying you before it’s changed is the correct behavior.

Kinda mystifying why there’s no corresponding objectDidChange, but whatever.

Pulcinella
Feb 15, 2019
Probation
Can't post for 11 days!
It was changed from didChange to willChange during the Xcode11 betas.


https://twitter.com/luka_bernardi/status/1151633281982406656?s=21

Doc Block
Apr 15, 2003
Fun Shoe
Would’ve been nice if they’d kept didChange, and added willChange for anyone who cares. Having to do it this way is awkward at best...

brand engager
Mar 23, 2011

Spent 2+ hours trying to figure out why my builds started hanging. if you have a class using @dynamicMemberLookup you might be able to reference variable names that don't exist in the code, and instead of failing the build just never finishes. That also broke syntax highlighting in xcode so I wasn't able to spot what the mistake was.

KidDynamite
Feb 11, 2005

In a similar vein I spent a lot of time trying to fix previews.

https://twitter.com/dannypier/status/1190312160557068293

one god drat check box.

Glimm
Jul 27, 2005

Time is only gonna pass you by

KidDynamite posted:

In a similar vein I spent a lot of time trying to fix previews.

https://twitter.com/dannypier/status/1190312160557068293

one god drat check box.

oh yeah that got me last week too

Now I'm just not measuring code coverage

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Glimm posted:

Now I'm just not measuring code coverage

Same. Didn't even need to get an error!

lord funk
Feb 16, 2004

3D people, some advice.

I would like to draw 'letterbox' black bars on the top and bottom of my scene. One way I could do this is just do another render pass, and draw the black boxes on top of the already rendered 3D scene.

However, I think it would be better to simply stencil out the top and bottom. This would leave it black (yay!) and also skip any rendering underneath (performance!). And, I wouldn't have to load up another render encoder to draw the black bars (performance!).

My question is: how do I draw directly on the depth texture / stencil texture? In Metal, they are the same texture (which confuses me... why does the stencil texture show up black in the inspector?). I could blit copy in from another texture, but I'm not really sure how to do that if I also clear the depth texture on load.

Doc Block
Apr 15, 2003
Fun Shoe
They’re “together” because of legacy reasons (Depth24Stencil8 hardware formats), but people use 32-bit float depth buffers now with stencil existing in a separate texture and so it’s just done for convenience.

Anyway, the stencil test happens at the rasterization stage, so instead try to use scissor rects or a smaller viewport, so that geometry in those parts of the screen will just get clipped instead (skipping rasterization entirely).

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Any guesses why an uppercase sigma is Xcode's Breakpoint navigator icon for a breakpoint? None of the mathy uses for Σ that I can think of seem to fit.

Only registered members can see post attachments!

lord funk
Feb 16, 2004

Doc Block posted:

They’re “together” because of legacy reasons (Depth24Stencil8 hardware formats), but people use 32-bit float depth buffers now with stencil existing in a separate texture and so it’s just done for convenience.

Anyway, the stencil test happens at the rasterization stage, so instead try to use scissor rects or a smaller viewport, so that geometry in those parts of the screen will just get clipped instead (skipping rasterization entirely).

👍🏻👍🏻👍🏻 scissor rects is exactly what I needed.

awesomeolion
Nov 5, 2007

"Hi, I'm awesomeolion."

pokeyman posted:

Any guesses why an uppercase sigma is Xcode's Breakpoint navigator icon for a breakpoint? None of the mathy uses for Σ that I can think of seem to fit.



Google and Wikipedia are saying sigma symbol helps you remember symbolic breakpoint and also:

quote:

In linguistics, Σ represents the set of symbols that form an alphabet

🤷‍♂️ Maybe it's like "symbol for symbolic" and that's as much thought as they put into it.

awesomeolion fucked around with this message at 03:09 on Sep 4, 2020

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?

awesomeolion posted:

🤷‍♂️ Maybe it's like "symbol for symbolic" and that's as much thought as they put into it.

This is it.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Mystery solved!

abraham linksys
Sep 6, 2010

:darksouls:
Anyone here have any success shipping a an app that's primarily a webview wrapper to the iOS App Store? I've got a little personal project - a social media web app for sharing songs with your friends and listening back to them through Spotify/Apple Music - that I'd like to make a native app for, but I don't really have the time to make iOS and Android versions of my app from scratch. I would be using several native features: native Spotify/Apple Music SDKs (instead of their JS equivalents), native share target for posting songs, and push notifications.

Apple's guidelines for this have been more or less the same for the past few years, from what I can tell:

quote:

4.2 Minimum Functionality

Your app should include features, content, and UI that elevate it beyond a repackaged website.

I like to think these new features would, uh, "elevate it" (god they really do use the most vague and obnoxious language for these guidelines huh), but I'm not sure what Apple reviewers would think.

So, I'm curious if any of y'all have had any experience with shipping (or trying to ship) a mostly-webview app in the past couple years, and how that's gone. I guess I could build a mostly webview version for iOS and Android, get it out on Android since that's easy, and if it gets rejected by Apple, learn... React Native or some poo poo to build a cross-platform app?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I'm not sure push notifications will be convincing as they're also available to websites. The other bits sound more convincing, but I dunno if it'll satisfy app review.

You probably know this already, but you can add a bookmark to your home screen, and you get a bit more control there than you do in a browser. No push notifications though.

Fundamentally, the Awful app scrapes a website and dumps it into a webview, but it seems to meet the bar set by app review. There's nothing wrong with using a webview to render 90% of the area of the screen. So what's the difference between Awful and simply pointing a webview at a url?

No idea what app review's answer would be, but I bet you could get there without too much pain. One approach might be to pull components out of the webview. No idea what your site looks like, but maybe you pull the navigation menu out and use a proper tab bar controller, with each tab simply loading the relevant webpage (and then hide the navigation bits when you render the webpage). That's probably not enough on its own, so now maybe one of the tabs is a list that you could make into a proper table view.

We're probably getting pretty close, and I'd send it off for review to see what happens. Do the same for Android and you've got two apps that are more than just a webview, but hopefully aren't a massive amount of work? And you've got the scaffolding in place if you wanna pull more out of the webview.

I assume you can do the above in something like react native too, but I haven't tried.

duck monster
Dec 15, 2004

Does anyone know if Microsoft has quietly dropped the Xamarin cross platform stuff. Got asked to use it for an app that runs on android and ios, but it just isn't in there on Visual studio for mac anymore. Theres references online to installing it from the VS installer, but theres just nothing in there. Its still got the option to do libraries, but the ability to do cross platform apps seems to have been removed :/ Or somethings broken.

edit: No, apparently not dropped. Just broken. Goddamn it xamarin

Super useful error too: "The project could not be created". In the logs theres a stack trace about a null ref. Doesnt seem to be something I can fix.

duck monster fucked around with this message at 07:53 on Sep 8, 2020

TheReverend
Jun 21, 2005

All cross platform sucks, but Flutter is the least sucky imo.

Froist
Jun 6, 2004

TheReverend posted:

All cross platform sucks, but Flutter is the least sucky imo.

I've recently shipped a hobby app with Flutter and while some aspects of it were great, others are still biting me. I'd generally just stick to native iOS but this app relies on a wider community so skipping Android would hurt the iOS users.

Granted the problems I've had with it are around the Google Maps component (fundamental to this app) which is still in "developer preview", but it has been for 2+ years. I also found that one of the bugs my users reported after release had been raised on the Github issues (with a one line workaround in the plugin) last September and still hasn't been addressed officially. Aside from quite a lot of missing features, these bugs make it feel like they're not really in a rush to "mature" the framework.

Overall it's great for doing quick UI development and hitting both platforms from a single codebase, but a nightmare when bugs crop up and only affect certain devices. Though I feel that's any kind of Android development in a nutshell.

frogbs
May 5, 2004
Well well well
I realize i'm just getting started with Swift, so everything is going to have a learning curve, but i'll be damned if I can't wrap my head around using Codable to parse even moderately complicated/nested JSON.

lord funk
Feb 16, 2004

frogbs posted:

I realize i'm just getting started with Swift, so everything is going to have a learning curve, but i'll be damned if I can't wrap my head around using Codable to parse even moderately complicated/nested JSON.

Yeah good luck. I just went through this a few weeks ago, and was surprised at how difficult heterogenous arrays were to encode / decode.

101
Oct 15, 2012


Vault Dweller

frogbs posted:

I realize i'm just getting started with Swift, so everything is going to have a learning curve, but i'll be damned if I can't wrap my head around using Codable to parse even moderately complicated/nested JSON.

This can be a big help for creating your data models

lord funk posted:

Yeah good luck. I just went through this a few weeks ago, and was surprised at how difficult heterogenous arrays were to encode / decode.

Yeah I recently had to deal with an endpoint that spat out a bunch of different variations and it was a nightmare

Adbot
ADBOT LOVES YOU

frogbs
May 5, 2004
Well well well

101 posted:

This can be a big help for creating your data models

Thanks! I did try this already, and laughed heartily at how much code it spit out just to deal with what I thought was a pretty simple feed. For some reason Xcode throws warnings with the recommended 'use this to parse' stuff line, which I think could be because i'm still on Mojave? Either way, i'll figure it out.

code:
let welcome = try? newJSONDecoder().decode(Welcome.self, from: jsonData)
I also found this app called 'SmartBaby', which some people say is better at dealing with nested JSON, but am not sure if I want to pay $4 just yet: https://apps.apple.com/us/app/smartbaby/id1438971945

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