Post

Replies

Boosts

Views

Activity

Reply to Sorting Contacts
Just by looking at the current Contacts API, I don't think this is possible. The CNContact class doesn't have a value for interaction, and the CNContactSortOrder class doesn't give that option either. Apple doesn't let apps see iMessage history or call logs (for privacy reasons). Maybe adding an option for the user to favorite contacts they interact with the most would give a similar function?
Aug ’22
Reply to can I hide Action sheet bar?
Do you mean the home indicator for devices that don't have home button? It's better to use the safe area margins provided by UIKit or in the Storyboard to create views that won't overlap the home indicator. If you really need to, though, you can override a specific view controller's prefersHomeIndicatorAutoHidden property like this: override var prefersHomeIndicatorAutoHidden: Bool { return true }
Aug ’22
Reply to How to make SKSpriteNode (with png texture) be touchable only on pixels and not on alpha?
Hi, I would try making a CGMutable path that has the best estimation of the border of the image and using the CGPath's .containsPoint() method to test if the location the user tapped is contained in the point. I know that you can create an SKPhysicsBody from a texture that uses a specific alpha threshold, but I couldn't find a way to get a path from that or test to see if a point is contained in the physics body. Here are some links that might help: https://developer.apple.com/documentation/spritekit/skphysicsbody/shaping_a_physics_body_to_match_a_node_s_graphics https://developer.apple.com/documentation/coregraphics/cgmutablepath Good luck!
Aug ’22
Reply to SpriteKit Game
Hi, You might want to try using an SKEmitterNode. This is a specialized SpriteKit node that will emit particles. You can create a new emitter node in Xcode by going to File > New > File... (or with the keyboard shortcut ⌘N) and selecting the "SpriteKit Particle File". Xcode will ask you what you want to use as a template - you can select whichever one you think sounds most like the effect you're trying to achieve. After creating your particle file, you can use the inspector area to tweak the emitter. Make sure you have your "Energy" texture selected. After you've finished editing your particle file, you can easily use the emitter in your code. First, initialize an SKEmitterNode from the file you just created. let emitterNode = SKEmitterNode(fileNamed: "YourFileName")! emitterNode.position = .zero addChild(emitterNode) If an SKEmitterNode won't work in your case, though, I would review your code. First of all, the function touchDown(atPoint pos: CGPoint) isn't called anywhere. What is the difference between this function and the SpriteKit touchesBegan() function? Also, I might try adding your energyBall to the scene before changing its position and running the fly action. Finally, using SKAction.run() just runs a block of code, which wouldn't make sense in this context. Try using SKAction.sequence() to run SKActions in order. This might look like this: let moveAction = SKAction.move(to: location, duration: 1) let scaleAction = SKAction.scale(to: 0, duration: 0.125) let fly = SKAction.sequence([moveAction, scaleAction, .removeFromParent()]) SKAction.sequence() will run actions in order, waiting for each action to finish before running the next one. For example, the scaleAction in this case will run after the moveAction is finished, meaning it will run 1 second after. Good luck finding the solution to your problem, and remember it's best practice to not capitalize the beginnings of your variable and constant names. (let Emitter should be let emitter and let EnergyBall should be let energyBall)
Aug ’22
Reply to LiDAR Required Device Capability
I don't think there is, but you can show users with devices that don't support lidar a view saying your app won't work on their device. You can check if the user's device supports lidar like this: import ARKit let supportLiDAR = ARWorldTrackingConfiguration.supportsSceneReconstruction(.mesh) guard supportLiDAR else { print("LiDAR isn't supported here") return } https://stackoverflow.com/questions/66383288/check-if-ios-device-has-lidar-in-swift
Aug ’22