Posts

Post marked as solved
3 Replies
0 Views
I found this WWDC video which explains exactly what I needed to do to make my Intent an in-app Intent, and so far it seems to be behaving perfectly as I need... https://developer.apple.com/videos/play/wwdc2020/10073/
Post marked as solved
3 Replies
0 Views
Thanks for your reply! I'm trying to enable a CLLocationManager with background tracking, amongst lots of other things (CoreData with iCloud etc), but it seems that when the location manager is started off from within the Intent, it doesn't then pick up the background location updates once the Intent has finished and exited. But the same code works when being used from the main app itself. It currently works if I make the Intent respond with a .continueInApp, because the app then starts up and it enables the location manager there and it does the background tracking. But I don't want it to bring the app to the foreground. To give some background about the overall task I'm trying to achieve, I want to... be able to plug my iPhone into my CarPlay unit and it fire of a shortcut (which is possible with Shortcuts app) that then tells my own app to start tracking the route (i.e. locations). So I have an Intent in my app which is "start route recording" which stores some data (CoreData) to tell my app that a route is being recorded, and then a CLLocationManager is started up to accept background updates. It all works, just not from my Intent. If I enable the CLLocationManager from the Intent, it seems happy enough (no obvious errors) but it just doesn't seem to fire off the background updates and store the tracking data. So how do I move my Intent code to my main app and have it fired off from the Shortcuts app?
Post not yet marked as solved
5 Replies
0 Views
Thanks for the reply, I was beginning to think I was alone lolI've used something similar to your suggestion as a workaround. The annoying part of my particular usage problem is that I am using the TileSet sks editor in Xcode to create a long list of SKTileGroup SKTileGroupRule / SKTileDefinition / SKTextures, which are then being used to design my game levels upon a SKTileMapNode, again all in Xcode. So the SKTexture objects are all created for me. I have no choice as to how the SKTexture objects get created, unless I actually construct my game levels using code and none of WYSIWYG features that are available. If I had to do that, tbh, I'd abandon the whole project.Even getting the image name from the SKTexture was problematic, but I ended up using this hacky way for now...public extension SKTexture { func GetImageName() -> String { return description.components(separatedBy: "'")[1]; } }Then for each SKTileDefinition in my TileSet I had to do this... var TextureList : [SKTexture] = [SKTexture](); TextureList.append(contentsOf: TileDef.textures); TileDef.textures.removeAll(); for Texture : SKTexture in TextureList { let Image : CGImage = UIImage(named: Texture.GetImageName())!.cgImage!; let NewTexture : SKTexture = SKTexture(cgImage: Image); TileDef.textures.append(NewTexture); }...which basically removes all the textures from the SKTileDefinition called TileDef, and recreates them by loading a UIImage using the image name retrieved by my GetImageName() extension above. Feels really hacky and wrong because I know the images have already been loaded for me, but can't figure out any alternatives.I've also tried updating my device (an iPad mini) to iOS 12.3 beta in case it's just an iOS 12.2 thing, but unfortunately the normal way of doing this is still broken in that.I do hope they fix it soon, because I've little confidence in my hacky solution always working as it depends on parsing thet description.
Post not yet marked as solved
5 Replies
0 Views
It would seem that updating my devices to iOS 12.2 broke this. SKTexture.cgImage() used to return an image the same size as the texture, but now it only returns the visible size of the image. So infuriating!!!Can anybody please tell me how I now get the full size image?
Post marked as solved
12 Replies
0 Views
Hi, I don't know if this is ideal for what you want, but I was trying to do a similar thing, except the entire background would be blurred. I found the following things key to helping reduce frame rate hit...1. I think the higher the blur inputRadius, the slower it is. 4 blurs it enough for my situation.2. Lower resolution is quicker. My scene is only 200x200 and then scaled to fit, etc. Luckily it suits the graphics style I'm doing.3. I rendered the entire scene to a texture (view.texture(from: myscene)) and then applied that texture to a SKSpriteNode which was a child of an SKEffectNode which has the blur filter applied.With those things applied, I'm still seeing a frame rate of at least 60fps.