Post

Replies

Boosts

Views

Activity

Compiling the JPEG-XL reference for iOS, or, "Is compiling C++ for iOS really this difficult!?"
I'm trying to add JPEG-XL encoding/decoding capabilities to my app and haven't been able to find a trustworthy pre-compiled version. The only one I've found is in https://github.com/awxkee/jxl-coder-swift. As a result I've been trying to compile my own iOS version from the reference implementation (https://github.com/libjxl/libjxl), having done virtually no compiling before. When I started out, my gut said, "Compiling for a different platform should be easy since it's not like I'm actually writing or modifying the implementation", but the more I research and try, the more doubtful I've become. So far I've figured out it means compiling all the dependencies (brotli, highway, libpng, skcms, etc.) too, but I've also gotten nowhere with them, having tried my hand at modifying cmake toolchains and CMakeList.txt files. As a novice, am I biting off more than I can chew with this? Is the seemingly simple task, "Compile this C++ library for iOS" actually something that freelancers charge huge amounts for? (If so, this makes the free compiled version mentioned above even more questionable) Any help or pointers would be greatly appreciated.
5
0
1.5k
Jun ’24
How do I stop Tasks from choking up animations?
I'm making a loading screen, but I can't figure out how to make the loading indicator animate smoothly while work is being performed. I've tried a variety of tactics, including creating confining the animation to a .userInitiated Task, or downgrading the loading Task to .background, and using TaskGroups. All of these resulted in hangs, freezes, or incredibly long load times. I've noticed that standard ProgressViews work fine when under load, but the documentation doesn't indicate why this is the case. Customized ProgressViews don't share this trait (via .progressViewStyle()) also choke up. Finding out why might solve half the problem. Note: I want to avoid async complications that come with using nonisolated functions. I've used them elsewhere, but this isn't the place for them.
9
0
1.3k
Aug ’24
How would you make a View that magnifies the View(s) beneath it?
I need a magnifying glass function for one of my SwiftUI Views, but can't find a way to implement it as needed. I found a Youtube video where the author renders the view twice, overlaying the second over the first, then scaling and masking it to create the illusion of magnification, but this is expensive and doesn't work in many cases where more complex views are presented (e.g. a LazyVGrid). I've also explored continually capturing partial screenshots and scaling them up to create the illusion of magnification, but there's no straightforward way to achieve this with SwiftUI without getting into the messiness of UIViewRepresentables. Any help would be greatly appreciated
2
0
514
Oct ’24
How to limit RealityKit's framerate?
I'm currently weighing moving my project from SpriteKit to RealityKit as a way to future proof it. An important part of the project involves limiting the framerate sprites are displayed at. While RealityKit seems to be set at 60FPS, my project demands a much lower framerate. I should note that I'm not using RealityKit for AR, so there's no camera passthrough to worry about. Is there a way to limit RealityKit's rendering framerate?
4
1
1.8k
Aug ’22
CloudKit Request - CKAsset size limit and public database storage per active user
Hello, I had a WWDC Lab with two CloudKit engineers who asked me to file a "Feedback Request" for critical information regarding CloudKit. I've filed the FB and have also decided to post a forum post to increase my chances of having these critical questions answered. If allowed, I will also post responses to my FB here. CKAssets I would like to know how large assets attached to a CKAsset can get before being rejected by the system. If the figure differs for private and public databases, please also let me know. CloudKit pricing information There used to be pricing information available on the website, but there's basically no information now. This makes it hard to calibrate user upload limits for my app in order to avoid overage fees. I'm not looking to game the system, (something this strange opaqueness is likely meant to prevent); I'm just looking to avoid a situation where competitors and vandals abuse my the content upload system so I get smacked by large bills out of nowhere. A rough figure of how many GB of data each active user adds to my app's CloudKit public database would suffice. While we're at it, if I have two apps that share a public database (if that's possible), do the active user counts of both contribute to the public database's free threshold?
0
1
566
Jun ’24
Is it possible to use App Attest to protect an app's CloudKit databases?
I'm a new developer who is looking to make my first app easier to manage on my end by staying in the Apple ecosystem. My ideal backend is just pure and simple CloudKit. This should help me cut down on costs and increase my security, or so I thought. The more I looked into the issue of mobile app security --more specifically, preventing fraudulent access to backend APIs-- the more it seems like CloudKit is a disaster waiting to happen. While data in transit is encrypted and there's even end-to-end encryption for private DBs, securing an app's public DB in the presence of modified apps is a daunting, if not impossible task. My assumption is that a modified app cannot be trusted to make honest assertions about itself, the device, or its iCloud account, and can potentially lie its way into restricted areas of the DB. If an app is compromised, CloudKit queries from that app can be used to make malicious queries or even changes to the databases. I'm hoping App Attest, even with its potentially circular logic, can at least make life harder for fraudsters, competitors, and vandals (when combined with other security measures like jailbreak, debugging, hooking, and tampering detections), but I have not found a single mention on how App Attest might be used to protect CloudKit. There doesn't even seem to be a verified way for me to build a third party server that can handle App Attest and then tell CloudKit to allow a user through (with all the security hazards a new developer faces when configuring an authentication server). The message seems to be: App Attest is important, but you can't use it with CloudKit, so build your own server. Questions Is my assumption that a compromised app can make malicious queries or changes to an app's CloudKit DB correct? Can App Attest be made to protect a CloudKit public DB, with or without the involvement of a third-party server to handle attestations?
0
1
666
Jun ’24
New in SF Symbols 7: ipod.and.vision.pro.
Why? Why stop there? (Why not ipod.and.imacg3? applenewton.and.vision.pro?) I get why the older ipod symbols exist but these new pairings are odd. If anyone ever sees these restricted symbols in the wild, or even just someone using a Vision Pro and an iPod (Touch) together in a way that's not contrived, please do let me know!
Topic: Design SubTopic: General Tags:
1
0
776
Oct ’25
[WatchOS 11, Xcode 16] Can't get watch to appear in Xcode
This morning I bought my first-ever Apple Watch for the sole purpose of development and proceeded to spend six hours failing at the first step of development: getting the device to enter developer mode and connect to Xcode. Since I'm not seeing any WatchOS 11 posts on this issue, it might just be me. This is why I'm making a new thread that's specific to WatchOS 11, Xcode 16, and maybe Series 10. Some particulars for my case: Overall __Followed Xcode 16.0 documentation On a watchOS device that you use for development, go to Settings > Privacy > Developer Mode. To toggle Developer mode, use the Developer Mode switch. To pair an Apple Watch to a Mac, connect its companion iPhone to the Mac with a cable, and ensure that the iPhone is paired for development. After this step, follow any instructions on the Apple Watch to trust the Mac. When paired through an iPhone running iOS 17 or later, Xcode connects to the Apple Watch over Wi-Fi __Tried all the folk remedies listed in the (many) previous posts on enabling development mode and connecting to Xcode iOS 18.0 __In developer mode __Connected to macOS via USB, trusts computer WatchOS 11.0 __Prompt to trust computer appears and trust is established __‘Developer Mode’ list item never appears at end of the ‘Privacy’ menu under ‘Settings’ __‘Developer’ item sometimes appears at the end of ‘Settings’ Despite never having seen or toggled ‘Developer Mode’ under ‘Privacy’ Persists across reboots Possible that WatchOS 11 eliminated the item under Settings > Privacy? If so, documentation not up to date Xcode 16.0 __Watch never appears under ‘Manage Run Destinations’ After installing sample app to phone, then attempting to install WatchOS app via iOS Watch app, “Cannot install at this time” alert appears App icon appears on watch, and tapping on it leads to an alert with, “This app cannot be installed because its integrity could not be verified”, despite wi-fi working Watch apps for other apps (e.g. Apple Store) can be successfully installed via iOS Watch app Above suggests the watch isn't truly in developer mode despite Settings > Developer appearing and persisting across reboots __The network path from Xcode to WatchOS should be clear Reconfigured router such that devices on the same network can talk to each other iPad and iPhone appear with network icon when not connected via cable and Xcode can run code on them Watch on same network as iPad and iPhone macOS 15.0 __Due to security policy, cannot use Wi-Fi (disabled both physically and via sudo /usr/sbin/networksetup -setnetworkserviceenabled 'Wi-Fi' off) Possible that Xcode can only establish a connection to WatchOS via Wi-Fi and not via ethernet bridged to wifi. If so, a confirmation would be hugely helpful. This is currently my prime suspect. Wi-fi cannot be re-enabled, so I'm trying workarounds like connecting watch to phone's hotspot (doesn't work) and somehow using phone to provide network to the Mac. __Due to security policy, firewall configured to block all incoming connections Shouldn't be an issue since Xcode doesn't need incoming connections to see non-watch devices __Due to security policy, mDNSResponder and mDNSResponderHelper disabled Also shouldn't be an issue, but including just in case
2
2
2.3k
Sep ’24
[iOS 26] Can no longer detect whether iPhone has notch
I'm currently using the extension below to determine whether an iPhone has a notch so I can adjust my UI accordingly. extension UIDevice { var hasNotch: Bool { if userInterfaceIdiom == .phone, let window = (UIApplication.shared.connectedScenes .compactMap { $0 as? UIWindowScene } .flatMap { $0.windows } .first { $0.isKeyWindow }) { return window.safeAreaInsets.bottom > 0 } return false } } (Adapted from https://stackoverflow.com/questions/73946911/how-to-detect-users-device-has-dynamic-island-in-uikit) This no longer works in iOS 26, and I have yet to find a similar method that works. Does anyone have any fixes?
4
0
194
Oct ’25
Controlling a SwiftUI view's refresh rate without TimelineView
Hello, I have an @EnvironmentObject variable that publishes 30 times per second but the view that depends on that data must be limited to 20 frames per second. The publishing rate cannot be controlled, so I must control the rate at which SwiftUI refreshes that view in order to achieve the desired effect. I tried using TimelineView(.periodic(from: .now, by: 1/20)), but the restriction gets ignored due to the published data; I also considered Combine's timer, but it isn't based on real time. Are there any other methods I can use to force SwiftUI to refresh certain views at certain real time intervals, in essence controlling its FPS?
0
1
1.3k
Jun ’22