digitalservicebund / useid-app-ios

iOS client for BundesIdent
MIT License
5 stars 1 forks source link

Add underline for links (+ new link style for buttons) #201

Closed ovejka closed 1 year ago

ovejka commented 1 year ago

Considering the second point: Initially I tried more SwiftUI-y way with BundLinkButtonStyle (see https://github.com/digitalservicebund/useid-app-ios/pull/201/commits/1c628266e02fa101fa18a26c202117c6224337d0), but because underline() for View is only supported in iOS 16 we needed a workaround for iOS 15. This workaround had multiple downsides: only 1-line text would be supported (overlay is added to the whole view), the line wouldn’t grow with text size, so this fine adjustment to make it look exactly like links in other places wouldn’t be possible (or would require to much effort). So I changed the implementation to separate LinkButton that looks the same on all supported systems and doesn’t require fine tuning.

Before After
Screenshot 2023-05-19 at 12 43 57 Screenshot 2023-05-19 at 12 43 23
(example of usage, not actually applied ⬇️)
Screenshot 2023-05-19 at 12 43 12