WhatsNewKit icon indicating copy to clipboard operation
WhatsNewKit copied to clipboard

`AttributedString` example broken

Open tillkruss opened this issue 9 months ago • 1 comments

What happened?

This code: https://github.com/SvenTiigi/WhatsNewKit/blob/6157c77e8be9b3d2310bc680681b61a8d9e290ac/Example/Example/ExamplesView.swift#L162-L170

Does not build with iOS 17.x in a SwiftUI app:

Cannot infer contextual base in reference to member 'cyan'
Type 'AttributeContainer' has no member 'foregroundColor'

Is there a way to highlight a word using the latest version?

What are the steps to reproduce?

Build with iOS 17.x

What is the expected behavior?

It to build.

tillkruss avatar Apr 30 '24 22:04 tillkruss

Hi @tillkruss,

the example application is building successfully with iOS 17.X with this action run.

If you are using the code snippet included in your issue description outside the example application of the WhatsNewKit you need to ensure that the following extension is included since this extension adds a foregroundColor static function on an AttributeContainer

https://github.com/SvenTiigi/WhatsNewKit/blob/6157c77e8be9b3d2310bc680681b61a8d9e290ac/Example/Example/ExamplesView.swift#L213-L227

SvenTiigi avatar May 03 '24 17:05 SvenTiigi

Closing due inactivity. Please feel free to re-open the issue at any time.

SvenTiigi avatar Jun 16 '24 07:06 SvenTiigi