Thanks so much guys! This issue is now resolved. I ended up going with the AppDelegate override but both options from @gchiste and @jmcsmith.
Thanks also @jonprescott. Because I didn’t utilise the storyboard view (I built only in code) and also built iOS first, I couldn’t find the bits you referenced. Probably just due to my approach to the build. Thanks though too!
Post
Replies
Boosts
Views
Activity
Thanks so much for this. Sadly this appears to not calculate as I'd expect either.
Also, I appreciate the lack of previous context. This calculation allows the user to set a baseline pixel value (say 16px for browser default) and an object pixel value (say again, 16px) and see the relative em value. So, baseValue/pxValue = emValue.
In the case of this calculation, 16px/16px = 1em.
If I then want to multiply that by a particular scale to get the difference in result depending on my conversion scale of choice, I want to see the difference this causes. The default, in this case, is 1.000. So the result should be (16/16) * 1.000 = 1.
For me, running this code, I get an initial result of 0.000.
If I then push up the wheel, I see a pattern of 0.000, 0.666, 1.333, 2.000, 2.666, 3.333 and so on. Any thoughts/did you see different results?
I've just realised you can't edit posted replies, so to correct my previous response, the calculation is:
pxValue/baseValue * scale. Not base/px as I said.
For further examples, 16px/32px * 1.000 = 0.5em or, if using the Golden Ratio; 16px/32px * 1.618 = 0.809em
You absolute hero! Between you guys, you've resolved days of headache for me. Thanks so much!
Ahh amazing! Thank you for the reply. Glad to know it's not me being a doozy here. Probably should have read the release notes properly really!
Commenting so I can follow this. I’m getting the same issues using MusicKit in SwiftUI.