gonzalezreal / swift-markdown-ui

Display and customize Markdown text in SwiftUI
MIT License
2.24k stars 266 forks source link

refactor: prefer checking module availability over the os check #268

Closed MojtabaHs closed 8 months ago

MojtabaHs commented 8 months ago

In addition to this merged PR, using canImport() is an improvement because it lets you focus on what functionality you want rather than what operating system.

So, for example, if UIKit becomes available on macOS tomorrow you won’t need to change your code to use it.

P.S.: Something similar happened for the visionOS already.