Thomas Grapperon

@tgrapperon
133 Followers
213 Following
21 Posts
Unpopular opinion: assertions are great, but should only be used for problems that cannot be detected immediately at runtime.
E.g. there’s no need to check that an Optional is non-nil before force-unwrapping it, or that an index is contained within the bounds of a Collection; the Swift runtime is _guaranteed_ to trap for these. All you’re doing is adding clutter.
@bens Ah yeah, that's true, Published only works in classes and uses the static subscript.
@bens AFAIK, yes. You won't get the property wrapper syntax with the value directly, but you can interact with `wrappedValue`/`projectedValue` (the publisher). Whether or not it's a good idea really depends on the use case though.
@bens Without effectively trying, I think that a `Published.Publisher` would bear the same idea. It is not writable, and it emits its current value on subscription by default. It doesn't have a `value` though`.
@krzyzanowskim Add more leather and some stitches!
@krzyzanowskim This is relatively easy if you use the `addArc(tangent1End: tangent2End:radius:)` method of CGPath (and Path). You'll need to do a little trigonometry to compute the angles of the arcs.
It is harder if you want continuous-style corners though.
@chockenberry Did I get lucky?

I saw a fun little question on Stack Overflow about rounding the corners of a UIBezierPath, so I wrote a little package to do it.

https://stackoverflow.com/a/75242194/77567

In Xcode CoreGraphics how to round corners of a UIPath. In Android I can simply add a cornerpatheffect

I am creating a drawing app in which I am using a custom intractable view, I am drawing an open path, I want its corners to be rounded. In android I can add cornerPathEffect but I am not able to do...

Stack Overflow
Version 1.0.0 of the Swift extension for Visual Studio Code is out. It adds support for editing, building and testing your Swift packages in VS Code. #SwiftLang https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang
Swift - Visual Studio Marketplace

Extension for Visual Studio Code - Swift Language Support for Visual Studio Code.

@ctietze Thanks! This is very impressive: it is only defined in the Preview, totally out of the feature, and it sends honest notifications when you move the slider. As far as the model is concerned, this is "business (logic) as usual".
If you run the app in a real device, you won't see these controls, but it'll show the real battery level!
This example ships with the library BTW.