Swift Version of ObjectiveC macro
I used Below code in ObjectiveC and worked but in swift giving error.
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
Help me to get its Swift version.
- How to create an umbrella framework in iOS SDK?
- Converting to Swift 3 renamed my own Objective-C method
- Counting the number of lines in a UITextView, lines wrapped by frame size
- Getting location for an iOS app when it is in the background and even killed
- Saving Hebrew text to NSUserDefaults return strange encoding
- compare two arrays and get the common items
2 Solutions Collect From Internet About “Swift Version of ObjectiveC macro”
Alternative in Swift:
let isPad = UIDevice.currentDevice().userInterfaceIdiom == .Pad
let isPad = UI_USER_INTERFACE_IDIOM() == .Pad
- Cannot Connect Storyboard Unwind Segue
- Revoked certificate – iPhone Programming
- Convert float value to String in Swift
- Generic and (early?) binding in Swift 1.2
- Swift: when should I use “var” instead of “let”?
- Xcode iOS deployment target check?
- UIScrollView not updating and displaying properly
- touchesBegan, touchesEnded, touchesMoved for moving UIView
- Xcode 6.3 is crashing on Project Rename
- Autolayout height equal to MAX(multiple view heights)
- How to draw custom line on MKMapview?
- Cocoapods – Invalid symlinks (Headers) prevents submission to App Store
- Modal segue, navigation bar disappears
- string replace phone number iOS swift
- Problems with cropping a UIImage in Swift