Returns a reference to the preferred default Metal device object.
SDKs
- iOS 8.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- Metal
Declaration
func MTLCreateSystemDefaultDevice() -> MTLDevice?
Return Value
A device object.
Discussion
In macOS, in order for the system to provide a default Metal device object, you must link to the CoreGraphics framework. You usually need to do this explicitly if you are writing apps that don't use graphics by default, such as command line tools.