In Objective-C, we use this code to set RGB color codes for views:
#define UIColorFromRGB(rgbValue)
[UIColor colorWithRed:((float)((rgbValue & 0x
You cannot use a complex macros like #define UIColorFromRGB(rgbValue) in swift. The replacement of simple macro in swift is global constants like
let FADE_ANIMATION_DURATION = 0.35
Still the complex macros that accept parameters are not supported by swift. you could use functions instead
Complex macros are used in C and Objective-C but have no counterpart in Swift. Complex macros are macros that do not define constants, including parenthesized, function-like macros. You use complex macros in C and Objective-C to avoid type-checking constraints or to avoid retyping large amounts of boilerplate code. However, macros can make debugging and refactoring difficult. In Swift, you can use functions and generics to achieve the same results without any compromises. Therefore, the complex macros that are in C and Objective-C source files are not made available to your Swift code.
Excerpt from Using swift with cocoa and objective C
Check @Nate Cooks answer for the Swift version of that function to be used here