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
brap
Aug 23, 2004

Grimey Drawer
So, updating my app for iOS 13 has been flummoxing me. I have a Today extension which uses a white text color and a colored background for a label--not unlike the Stocks app extension in the screenshot in this article.

But ever since I updated the app to iOS 13, I just can't get it to use a white text color. It is always black no matter what I specify in interface builder (the label is in a table view cell defined in a .xib file). I have tried using named colors that you can define in the asset catalog, I have tried overriding UILabel (lol) and implementing textColor to always return white, etc. It still shows as black. I actually don't seem to be able to customize label colors at all.

I am reusing the same .xib between my main app and the extension--the colors get respected in the main app but not in the extension. And it worked back when I was using iOS 12.

Does anyone have any suggestions about what to do here?

edit: never mind, after trying everything I decided to set the textColor redundantly in code and it worked. It makes me wonder if the today extension host just ignores/overwrites certain attributes from the .xib for ...reasons?

brap fucked around with this message at 06:38 on Oct 12, 2019

Adbot
ADBOT LOVES YOU

KidDynamite
Feb 11, 2005

is dark mode on?

That's my first thought. Had to disable that poo poo ASAP as it totally borked many pages in our app.

duck monster
Dec 15, 2004

KidDynamite posted:

is dark mode on?

That's my first thought. Had to disable that poo poo ASAP as it totally borked many pages in our app.

Yeah that hit us in the nuts too. That and the drat Nav controller thing. Thankfully the nav controller thing only seems to affect new builds, not existing builds.

brap
Aug 23, 2004

Grimey Drawer
It was actually happening in the App Store build of my app as well as fresh builds produced by Xcode 11.

I just find that iOS does weird stuff with widgets, when the conventions change from OS version to OS version (are widget backgrounds dark or light, etc.) some janky stuff can happen.

lord funk
Feb 16, 2004

this is why i stopped using uikit

Serious, though, I wish that opaque changes to underlaying UI behavior were opt-in rather than default for existing projects. It's annoying as gently caress when you build an app with a new OS and half your UI is broken because navigation bar transparency suddenly affects your view size.

Doctor w-rw-rw-
Jun 24, 2008
Doing that would require rearchitecting the thing to be a self contained library so you could load different versions of it. UIKit is anything but so the best they can do is include a mess of logic branches in the code to act differently if the app was compiled against a different SDK. At least, I think that was the case around iOS 4 or 5 - it’s been a long time since then and practices may have evolved significantly since then.

Good Sphere
Jun 16, 2018

I've experimented a bit in ARKit, but a potential client wants something enterprise for their hotel. What are my best options for tracking position of a device localized to a building accurately? Would it be most viable to used marker-based tracking, or could I use some kind of wifi or otherwise to triangulate the position accurately?

Stringent
Dec 22, 2004


image text goes here

Good Sphere posted:

I've experimented a bit in ARKit, but a potential client wants something enterprise for their hotel. What are my best options for tracking position of a device localized to a building accurately? Would it be most viable to used marker-based tracking, or could I use some kind of wifi or otherwise to triangulate the position accurately?

Is Core Location not precise enough or something?

Good Sphere
Jun 16, 2018

Stringent posted:

Is Core Location not precise enough or something?

Thank you, I think using iBeacon proximity is what I want in this situation.

Dirk Pitt
Sep 14, 2007

haha yes, this feels good

Toilet Rascal
Apple has an indoor mapping tool you can try as well. I think it uses WiFi to try. Beacons are problematic in ios13 after Apple wised up to the creepiness.

Supersonic
Mar 28, 2008

You have used 43 of 300 characters allowed.
Tortured By Flan
I have an MBP, iPad pro, and iPhone and since the release of Arkit 3 I've been interested in dipping my toes in the water with AR. Can anyone recommend a good jumping off point to get started? I have a bit of experience with Python and am familiar with the basics of programming, but have no experience with graphics or GUIs. I'm a bit confused as it seems like a few paths exist (Arkit 3, RealityKit) and I'm not sure which one I should be starting out with.

go play outside Skyler
Nov 7, 2005


Supersonic posted:

I have an MBP, iPad pro, and iPhone and since the release of Arkit 3 I've been interested in dipping my toes in the water with AR. Can anyone recommend a good jumping off point to get started? I have a bit of experience with Python and am familiar with the basics of programming, but have no experience with graphics or GUIs. I'm a bit confused as it seems like a few paths exist (Arkit 3, RealityKit) and I'm not sure which one I should be starting out with.

Not sure this will be a popular opinion here, but we recently did an AR app with react-native and its react-native-arkit bindings.

Performance is rather good, and I have to say that not having to learn a new language was a nice touch for us!

Good Sphere
Jun 16, 2018

Dirk Pitt posted:

Apple has an indoor mapping tool you can try as well. I think it uses WiFi to try. Beacons are problematic in ios13 after Apple wised up to the creepiness.

Thank you. Security isn't a huge concern for me, since this is an enterprise app, and they will be using on-site devices that will have no other purpose except to run this app. Most likely will be iPads in a case, with the home button blocked and locked into the app. We've done it before roughly 10 years ago (!!!) when the iPad first came out, but it didn't use AR of course.

Good Sphere
Jun 16, 2018

Can I use AVAssetWriter to record a changing CIImage in real time? I'm not using the device's cameras. I can't seem to get anything working without having the AVAssetWriter's status failing.

e: Never mind. I wasn't offsetting my CMTime. Before with video input, I was getting that from CMSampleBufferGetOutputPresentationTimeStamp. Now, I just simply offset it:

quote:

guard let currentSampleTime = self.currentSampleTime else {
return
}

let sampleTimeOffset = CMTimeMakeWithSeconds(0.1, preferredTimescale: 1000000000)
self.currentSampleTime = CMTimeAdd(currentSampleTime, sampleTimeOffset)
print("currentSampleTime = \(String(describing: currentSampleTime))")

The offset isn't accurate, but it just goes to show I need to do that.

Good Sphere fucked around with this message at 17:47 on Nov 7, 2019

Head Bee Guy
Jun 12, 2011

Retarded for Busting
Grimey Drawer
If any of you guys are based in NYC and need a job, the public-safety app Citizen recently posted some openings for iOS (and Android) engineers. If you're interested, pm me, and I can forward your info along.

https://jobs.lever.co/citizen/38dea578-b6db-4386-9b0a-dadb7a76b250

hyphz
Aug 5, 2003

Number 1 Nerd Tear Farmer 2022.

Keep it up, champ.

Also you're a skeleton warrior now. Kree.
Unlockable Ben
Is there a good current tutorial example that combines the reactive UI and persistent data on iOS? Too many examples are written to dodge around persistent data (even Pragmatic Programmers which I usually like)

Supersonic
Mar 28, 2008

You have used 43 of 300 characters allowed.
Tortured By Flan
I've been trying to learn Swift for the past few weeks, having a tiny bit of experience with Python, and I've been working on building a simple console based music synthesizer using AudioKit. So far I think I've been getting a general idea on how to use classes and structs and the like, but now I'm interested in seeing how I could transfer the project over to SwiftUI. In order to do so, I assume I would need to remove any print references from my code, as well as hook the functionality in to the UI. Where I'm a bit confused is in terms of program structure. I assume I would keep all my existing class files, but then call their functions from within the ContentView?

lord funk
Feb 16, 2004

Supersonic posted:

I've been trying to learn Swift for the past few weeks, having a tiny bit of experience with Python, and I've been working on building a simple console based music synthesizer using AudioKit. So far I think I've been getting a general idea on how to use classes and structs and the like, but now I'm interested in seeing how I could transfer the project over to SwiftUI. In order to do so, I assume I would need to remove any print references from my code, as well as hook the functionality in to the UI. Where I'm a bit confused is in terms of program structure. I assume I would keep all my existing class files, but then call their functions from within the ContentView?

You want to keep your synth code very separate from your UI code. Your synth is your 'model'. It should be blind to the outside world, and have the interface elements exposed that you want to control (things like setting parameter values, starting / stoping notes, etc.). But remember: it should not have anything to do with the UI.

Then you want to create your UI code however you want, and have it control / react to changes in your synth model. So, when you load your UI view, you may want to query your synth to find out what parameter values are. Then adjust your sliders to match. Finally, when you move your slider, you send the new value to your synth model.

Gotta keep 'em separated.

Stringent
Dec 22, 2004


image text goes here
Is it my imagination or is xcode 11 a bit buggy still?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
I haven't really had any issues with Xcode 11 specifically (unlike everything else released this year).

Stringent
Dec 22, 2004


image text goes here
I keep getting weird stuff like the project navigator going blank and errors about class members not existing persisting even after a clean and successful rebuild. Quitting and restarting always fixes it, and some of it's just business as usual, but it seems to be happening pretty frequently.

Still not worth nailing down well enough to file a radar. :kiddo:

KidDynamite
Feb 11, 2005

Yeah xcode fails to find one of my pods sometimes, and fails to find my project when i run my uitests(rarely actually failing to build) but the error is persistent. It's very annoying and the pod issue only goes away after restarting the computer.

Stringent
Dec 22, 2004


image text goes here
Wow, I haven't had to restart the computer yet, that sucks.

Dirk Pitt
Sep 14, 2007

haha yes, this feels good

Toilet Rascal
So someone in our team really wants to implement Kotlin native. This is a bad idea right?

Stringent
Dec 22, 2004


image text goes here
Depends, do you care enough about it to rewrite it in Swift if it ends up sucking?

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
Can iOS developers find out if a push notification has been seen?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Dirk Pitt posted:

So someone in our team really wants to implement Kotlin native. This is a bad idea right?

Yes. It’s been a year since I’ve seen it attempted, but at the time literally nothing worked and would’ve required building the world. You’d be better off with C++ if you’re that desperate to share code.

Boris Galerkin posted:

Can iOS developers find out if a push notification has been seen?

What are you trying to do?

The general answer is: not really, no. You can tell when it’s in the Notification Center (if you get a chance to run for some reason (and you can’t be sure you will)). And you can abuse a notification service extension to usually find out when it’s arrived at the device. Finally, you can of course find out when the user taps it or an action associated with it.

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

pokeyman posted:

Yes. It’s been a year since I’ve seen it attempted, but at the time literally nothing worked and would’ve required building the world. You’d be better off with C++ if you’re that desperate to share code.


What are you trying to do?

The general answer is: not really, no. You can tell when it’s in the Notification Center (if you get a chance to run for some reason (and you can’t be sure you will)). And you can abuse a notification service extension to usually find out when it’s arrived at the device. Finally, you can of course find out when the user taps it or an action associated with it.

I wanna know if I pull down on my notifications if it’ll let the other person know I read their messages in whatever chat app I’m using at the time. I’m not talking about long pressing it to get actions but just pulling it down and maybe tapping the “show more” button to unfold multiple notifications.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Boris Galerkin posted:

I wanna know if I pull down on my notifications if it’ll let the other person know I read their messages in whatever chat app I’m using at the time. I’m not talking about long pressing it to get actions but just pulling it down and maybe tapping the “show more” button to unfold multiple notifications.

There is also a notification content extension which implements the custom interface you sometimes see when pulling a notification down or long-pressing/3D Touching it. For example, this is probably how Mail shows you a preview of the email message. The app knows when iOS has requested that custom interface, and it could turn that into a read receipt.

Other than that, I’m not aware of any way for the chat app to know for sure. It can see that a notification is in Notification Center, and I believe it can check next time it launches to see when it’s disappeared from Notification Center, but it can’t know for sure why it disappeared (maybe you cleared all notifications without seeing or reading that particular one).

edit: I realize this isn’t a very definitive answer, sorry. The tl;dr is "an app can make a decent guess at whether a notification has been seen, but can’t always know for sure".

pokeyman fucked around with this message at 17:44 on Nov 28, 2019

TheReverend
Jun 21, 2005

Dirk Pitt posted:

So someone in our team really wants to implement Kotlin native. This is a bad idea right?

The Android lead promoted to mobile lead at work tried to get this going and I stopped it dead in the tracks (as just a lonely iOS dev) by making a big stink of it.

I think he's a little mad at me for it, but I rest easy knowing I did the right thing.

Doctor w-rw-rw-
Jun 24, 2008
As someone who has written both the iOS and Android apps for a couple of companies, there really isn't that much that using the same language will buy you unless you've got tons and tons of infrastructure above it.

The apps tend to converge on similar network -> model -> ??? -> view -> ??? -> network stacks, but use different libraries and unless you're going to reimplement all of that yourself you end up being better served mirroring the general architecture and general design than /literal/ code sharing.

Dirk Pitt
Sep 14, 2007

haha yes, this feels good

Toilet Rascal

pokeyman posted:

Yes. It’s been a year since I’ve seen it attempted, but at the time literally nothing worked and would’ve required building the world. You’d be better off with C++ if you’re that desperate to share code.

Yeah, I argued to him and the CTO that C++ is the better choice. I don’t understand what we ‘gain’ by this. We’re 10 iOS and 10 Android devs so speed isn’t really something we struggle with.

I don’t want to use Kotlin native as an academic exercise in a venture funded company.

TheReverend posted:

The Android lead promoted to mobile lead at work tried to get this going and I stopped it dead in the tracks (as just a lonely iOS dev) by making a big stink of it.

I think he's a little mad at me for it, but I rest easy knowing I did the right thing.

This is my strategy.

brand engager
Mar 23, 2011

Anyone used the NEPacketTunnelProvider stuff before? I started on it last week, and didn't get it to start up the provider class until today. The docs for the network extension stuff feel super "1)draw some circles 2) draw the rest of the owl"

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I haven’t, but as general "inadequate Apple docs" advice I suggest looking for relevant WWDC sessions from the last few years and watching those. They’ll get you up to speed and probably tell you things you’d never otherwise find out because, well, inadequate Apple docs.

Something like https://developer.apple.com/wwdc15/717 maybe?

brand engager
Mar 23, 2011

Spent all day trying to figure out how to pass some datagrams through. Although writeDatagram is async it won't wait until the socket is fully up, so if you try sending stuff too early it will call the completionHandler with nil error as if it had succeeded
https://developer.apple.com/documentation/networkextension/nwudpsession

lord funk
Feb 16, 2004

God I want to punch whoever at Apple keeps loving with scrollview auto insets / safe areas / layout margins / adjustment behaviors gently caress YOU JUST LEAVE IT ALONE FOR CHRISTS SAKE.

Stringent
Dec 22, 2004


image text goes here

lord funk posted:

God I want to punch whoever at Apple keeps loving with scrollview auto insets / safe areas / layout margins / adjustment behaviors gently caress YOU JUST LEAVE IT ALONE FOR CHRISTS SAKE.

Lol yeah, I just got caught by that one.

lord funk
Feb 16, 2004

I'm... just done about it. My app is 9 years old and every update since iOS 7 has needed unfucking.

I cannot get this navigation bar to stop doubling in size on devices with the notch. I have been swimming in every possible property I can think of all morning and I can't figure it out.

Only registered members can see post attachments!

Stringent
Dec 22, 2004


image text goes here
For me it was just setting automaticallyAdjustsScrollIndicatorInsets to false (iOS 13+), but it looks like you might have a bit more going on there than I did.

Adbot
ADBOT LOVES YOU

lord funk
Feb 16, 2004

Stringent posted:

For me it was just setting automaticallyAdjustsScrollIndicatorInsets to false (iOS 13+), but it looks like you might have a bit more going on there than I did.

Yeah, I've tried setting every one of those view controllers' / nav controller's automaticallyAdjustsScrollViewInsets to NO and it's still there.

Remember when iOS didn't have hidden bullshit like _UIBarBackground everywhere?

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