Post

Replies

Boosts

Views

Activity

How do I implement low-latency streaming between two local iOS devices?
Hello, I'd like to know whether Multipeer Connectivity (MPC) between two modern iOS devices can support cross-streaming of video content at low latency and relatively high resolution. I learned from Ghostbusters that crossing the streams is a bad idea, but I need this for my app so I'm going to ignore their sage advice. The application I have in mind involves one iOS device (A) live-streaming a feed to another iOS device  (B) running the same app. At the same time, B is live streaming its own feed to A. Both feeds don't need to be crystal clear, but there has to be low latency. The sample code for "Streaming an AR Experience" seems to contain some answers, as it's based on MPC (and ARKit), but my project isn't quite AR and the latency seems high. If MPC isn't suitable for this task (as my searches seem to indicate), is it possible to have one device set up a hotspot and link the two this way to achieve my cross-streaming ambitions? This seems like a more conservative method, assuming the hotspot and its client behave like they're wifi peers (not sure). I might start a new thread with just this question if that's more appropriate. A third idea that's not likely to work (for various reasons) is data transfer over a lightning-lightning or lightning-usb-c connection. If I've missed any other possible solutions to my cross-streaming conundrum, please let me know. I've been reading around this subject on this forum as well and would be hugely grateful if Eskimo would grace me with his wisdom.
6
0
3k
Jan ’22
Questions from a dev with plans to move to a different region
Hello, I'm a Canadian living in Hong Kong who has attempted to enroll in the developer program. After submitting my Canadian passport as identification, I was told it's not valid ID for the region (Hong Kong) and that I should submit something else.  I have several concerns that I would like answers to so I can figure out how to proceed: I'm very likely to move back to Canada in the near future and would like to know if there are any issues associated with switching between App Store regions? Issues like having to pay for enrollment twice, or legal/regulatory problems, or anything else? Another concern I have is my app being somehow subjected to censorship or some regulation that escapes my common sense, since Hong Kong is part of China.  My apps are not political but this is still a point of concern given the recent crackdowns on its tech and education sectors--it's not entirely unthinkable that something will strike down my app out of the blue, for no fault of my own. My app is intended for a global audience, but I fear having my developer account tied to Hong Kong (China) will come back to haunt me in some way. Am I fretting over nothing? There's also the payment issue--can payouts from my app be sent to an bank account of my choosing, or does it have to be in the region I'm tied to? Thank you in advance for your time.
0
0
634
Jan ’22
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?
3
0
1.5k
Apr ’22
How to display sprites in RealityKit?
My project involves no camera passthrough and relies heavily on sprites, but I've been discouraged from using the aging (and possibly dying) SpriteKit or SceneKit as my rendering engine by Apple engineers (here) so I'm exploring other options. Is it possible to display 2D sprites fluidly using this framework in a non-AR context? Is it possible to create, say, a 2D platformer using just RealityKit?
1
0
1.2k
Apr ’22
Ultra-large texture atlases in SpriteKit
I'm looking to use high-quality and large images as animated sprites via SpriteKit. Right now the default maximum size of a texture atlas is 4096*4096, which is at least an order of magnitude below what I need. There's an option to create custom maximum sizes, but the tiny default and the age of the SpriteKit framework is giving me second thoughts even though I'd very much like to stick with an Apple framework and not have to rely on another party like Unity. Before I invest my time and energy into SpriteKit I'd like to know whether the decade-old framework, running on modern hardware (A11 and newer), can support massive texture atlases while maintaining decent performance (~30 FPS). If not, is it possible to implement something similar in less antiquated frameworks, such as RealityKit (non-AR). Thanks in advance for your time.
0
0
780
Apr ’22
Using the Rec. 2020 color gamut in SpriteKit
About a month ago I asked whether I could use HDR in SpriteKit. This wasn't a well-phrased question since HDR seems to mean different things in different questions, which probably led to my question going unanswered. What I meant to ask was whether it's possible to use assets that have a color gamut that many modern devices are capable of displaying (XDR is somewhat standard among mid- to high-end devices). In other words: Is SpriteKit keeping up with the hardware? If not, what framework options do I have that can quickly display large Rec. 2020 images? Do any of the Core frameworks offer this capability?
1
0
1.1k
May ’22
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.1k
Jun ’22
Are user-to-user token transactions, with the ability to cash-out, allowed?
I’m trying to build a simple app that will allow users to create items in-app and buy/sell access to them. Users can buy tokens from the App Store that can be used to fund these purchases (e.g. 1 token = 100 coins), and can also be used support the development of these items (e.g. give creator 1 coin a week). The creators can then cash out the coins once a certain amount is reached, via Stripe or some other external payment provider. Is this allowed under the current rules of the app store? Is it possible to implement using CloudKit? If this isn’t allowed, is it possible to allow users to share content on the app’s “store” for other users to browse and download, and can that be done just using CloudKit? This is my first-ever app and I don’t know left from right when it comes to back-ends. I will greatly appreciate any pointers.
0
0
607
May ’23
Is there a way to save SKTextureAtlas(dictionary) sprite sheets to disk to read later?
My app uses SpriteKit and requires the use of SKTextureAtlas for performance. However, it uses user-generated content, which means that atlases don’t initialize using bundled images, but instead have to recreate all sprite sheets, leading to long loading times. Is it possible to save the sprite sheets made from user-generated content to disk so that SKTextureAtlas can load them instead of recreating all sprite sheets upon every initialization? Is there any alternative solution to this problem? For example, is there a way to dump a bunch of images into memory to use as a texture pool and keep them there until deallocated?
0
0
675
May ’23
CloudKit for storage of gated user content and account profiles?
I'm a new developer and I can't decide whether CloudKit or Firebase is more suited to my app's needs. The general vibe I'm getting from multiple sources is that CloudKit is purely for storage, but that seems off to me, so I'm hoping to find some hints or answers with regard to my specific use-cases. My app allows users to create multimedia objects that are stored somewhere and displayed in the app's marketplace, with use access granted to those who decide to spend tokens on them. These multimedia objects can go up to a few gigabytes. Ownership of these objects are tracked via a user account database. Am I correct in assuming that my app's CloudKit public database can be used to store, check user request validity, and distribute these multimedia objects? Can it also be used for the management of user accounts and overall token counts? Additionally, is it possible for the app's administrators to pipe data out of the public database for analysis and to payment processor APIs? Any help would be greatly appreciated
0
0
490
Jun ’23
Is the ability to make in-app currency purchases of creator content a violation of app store rules?
Hello, I'm making an app where users can create a multimedia object and other users can use in-app currency (purchased via in-app purchase) to gain access to the object. They can also choose to subscribe to a creator to encourage and support their content creation. Tokens can be converted to cash and sent to creators. It is unclear to me whether this violates app store rules. After reading through the App Store Guidelines and searching through the forums (this thread was close to what I was looking for), I have yet to arrive at a clear answer. The Guidelines state that "tipping" content creators is acceptable, but this isn't exactly what I'm looking for in a creator marketplace. The Business section doesn't contain anything else that seems relevant, and this makes it seem like only voluntary tipping of content creators is accepted. The commerce engineer in the thread linked above discourages using in-app currency, but that doesn't seem to work for my use case (the thread's creator wants to use the IAP mechanism). Furthermore, IAP cannot be created programmatically (i.e. by users) and is error-prone. It must be stressed that I'm not trying to deny giving Apple its 15-30% share, since users must buy in-app currency using Apple's IAP (this is not a multi-platform app). Cash in the app's economy has only one entry point, and that is via Apple's IAP. I have asked a similar question recently, but received no response. This is probably because I didn't phrase it well enough and didn't attach the correct tags. Creating the infrastructure for a creator marketplace app is a lot of grueling work, and I would very much like to know whether my app will be rejected for it before I embark on this quest. Any help would be greatly appreciated. tl;dr - Is the ability to make in-app currency purchases of creator content a violation of app store rules?
1
0
696
Jun ’23
How do I detect whether an iPad's camera location is landscape or portrait?
The 10th-Gen iPad differs from its predecessors by having a camera that's located at the top of its landscape orientation. This is a headache for me since my app needs to know the rough camera location given the device's orientation for AR purposes. I can find out whether the device is a tablet or not, but I can't find out whether it's an iPad 10. Are there any direct or indirect ways for me to find out whether a camera is placed for portrait or landscape use?
0
0
569
Aug ’23
Is it possible to compile images into an APNG using Swift?
Hello, I'm wondering if there is a way to programmatically write a series of UIImages into an APNG, similar to what the code below does for GIFs (credit: https://github.com/AFathi/ARVideoKit/tree/swift_5). I've tried implementing a similar solution but it doesn't seem to work. My code is included below I've also done a lot of searching and have found lots of code for displaying APNGs, but have had no luck with code for writing them. Any hints or pointers would be appreciated. func generate(gif images: [UIImage], with delay: Float, loop count: Int = 0, _ finished: ((_ status: Bool, _ path: URL?) -> Void)? = nil) { currentGIFPath = newGIFPath gifQueue.async { let gifSettings = [kCGImagePropertyGIFDictionary as String : [kCGImagePropertyGIFLoopCount as String : count]] let imageSettings = [kCGImagePropertyGIFDictionary as String : [kCGImagePropertyGIFDelayTime as String : delay]] guard let path = self.currentGIFPath else { return } guard let destination = CGImageDestinationCreateWithURL(path as CFURL, __UTTypeGIF as! CFString, images.count, nil) else { finished?(false, nil); return } //logAR.message("\(destination)") CGImageDestinationSetProperties(destination, gifSettings as CFDictionary) for image in images { if let imageRef = image.cgImage { CGImageDestinationAddImage(destination, imageRef, imageSettings as CFDictionary) } } if !CGImageDestinationFinalize(destination) { finished?(false, nil); return } else { finished?(true, path) } } } My adaptation of the above code for APNGs (doesn't work; outputs empty file): func generateAPNG(images: [UIImage], delay: Float, count: Int = 0) { let apngSettings = [kCGImagePropertyPNGDictionary as String : [kCGImagePropertyAPNGLoopCount as String : count]] let imageSettings = [kCGImagePropertyPNGDictionary as String : [kCGImagePropertyAPNGDelayTime as String : delay]] guard let destination = CGImageDestinationCreateWithURL(outputURL as CFURL, UTType.png.identifier as CFString, images.count, nil) else { fatalError("Failed") } CGImageDestinationSetProperties(destination, apngSettings as CFDictionary) for image in images { if let imageRef = image.cgImage { CGImageDestinationAddImage(destination, imageRef, imageSettings as CFDictionary) } } }
3
0
1.3k
Dec ’23
Navigating between sticker browsers and messages extensions and the main app
Happy new year! My app has the ability to generate stickers so I'm trying to connect two separate Messages extensions: The sticker browser and the app extension. The former is a repository and the latter is where stickers are made. It would be easy to create these two extensions and have them stand separately, like Apple's Memoji, but I'm trying to find a way to better streamline the user experience, such that they can navigate from the browser to the extension and back seamlessly. As far as I can tell, there's no indication that this is possible, but also nothing to indicate that it isn't. Similarly, are there ways to navigate from the main app to a messages extension, or go the other way? From what I've read, there's no known way to do the former but there was a way to do the latter that no longer works. tl;dr - Is it possible for users to press a button to go from a MSStickerBrowserViewController to a MSMessagesAppViewController (both belonging to the same app group) or back? Or go from the main app to either or back?
0
0
479
Jan ’24