Search code examples
iosswiftuikitapple-watch

Cannot find 'UIDevice' in scope


I want to get the Device Id of my device and I read about UIDevice but for some reason it's not working in my project, even if I import UIKit. Maybe someone knows why? Thanks in advance. enter image description here


Solution

  • UIDevice is not available on Apple Watch. https://developer.apple.com/documentation/uikit/uidevice

    Please check this: https://developer.apple.com/forums/thread/25529

    There's WKInterfaceDevice for Watches.