func getName(){ #if os(iOS) print("我是") #elseif os(watchOS) print("我是手表") #endif print("我是电脑") } #if os(iOS) || os(watchOS) || os(tvOS) import MobileCoreServices #elseif os(macOS) import CoreServices #endif