Where are system images in SwiftUI macOS App?

Since Xcode Beta2, I been waiting and hoping that Image View with system images will be working for macOS App, as it does for iOS Apps.


To be more precise:


In a macOS App project, this line of code


Image(systemName: "star.fill")


produces the error: Extraneous argument label 'systemName:' in call


I just upgraded to latest Catalina and Xcode beta4.


I wonder, if anyone knows a workaround to this problem or know other information about when it will be possible to use system images in macOS Apps as it is possible in iOS Apps.

Accepted Reply

Doc announces it for IOS13, but nothing for MacOS


init(systemName:)


Creates an image object containing a system symbol image.



SDKs

  • iOS 13.0+Beta
  • tvOS 13.0+Beta
  • watchOS 6.0+Beta
Framework

UIKit


Declaration

init?(systemName name: String)


For MacOS, could you use NSImage(named:) and provide one of the system names as defined here :

https://developer.apple.com/documentation/appkit/nsimage/name

Replies

Doc announces it for IOS13, but nothing for MacOS


init(systemName:)


Creates an image object containing a system symbol image.



SDKs

  • iOS 13.0+Beta
  • tvOS 13.0+Beta
  • watchOS 6.0+Beta
Framework

UIKit


Declaration

init?(systemName name: String)


For MacOS, could you use NSImage(named:) and provide one of the system names as defined here :

https://developer.apple.com/documentation/appkit/nsimage/name

Thanks for informing me.


I looked much forward to see the SF symbols in my macOS app. That they were not scheduled was not considered.