Post

Replies

Boosts

Views

Activity

Reply to Is it possible to animate a path similar to how StrokeEnd works in SpriteKit ?
One technique that I've seen used successfully elsewhere is to use dashed lines where the 'draw' segment length is what's animated and covers the entire stroke. The 'don't draw' segment is set to be excessively long (i.e. at least as long as the overall stroke length itself.) Then by animating the length of the 'draw' segment between zero and whatever the stroke length is, it emulates 'drawing' the stroke as if it were a pen. Hope that makes sense.
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Jan ’23
Reply to Check if character in character set?
Here's my approach. Handles both single- and multi-scalar characters equally thanks to allSatisfy. public extension CharacterSet { func contains(_ character: Character) -> Bool { character.unicodeScalars.allSatisfy(contains) } func containsAll(in string: String) -> Bool { string.unicodeScalars.allSatisfy(contains) } } Some other useful/helpful operators... public extension CharacterSet { static func + (lhs: CharacterSet, rhs: CharacterSet) -> CharacterSet { lhs.union(rhs) } static func - (lhs: CharacterSet, rhs: CharacterSet) -> CharacterSet { lhs.subtracting(rhs) } }
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’22
Reply to Widget not available on developer iPhone
This may not be related to you having two different versions. One thing that an Apple engineer at WWDC pointed out to me is any time you do a new install of an app, you have to manually launch that app at least once before they make its widgets available in the widget browser. This apparently does not include launching it from Xcode (which they said is an issue that they are working on.) As such, in our case, when debugging our app, we had to minimize (i.e. go back to the home screen) the app, then manually tap on the icon to bring it right back to the front. Once we did that, our widgets would show up in the browser again. Again, make sure to minimize, not close the app or you'll kill your debug session. Minimize, tap the icon to open it back up again and you should be good to go. Their reasoning is they only want things to appear in the browser that you have explicitly accessed, not simply installed, and since you're basically doing new installs throughout the dev process, that can cause the issue.
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’21