我试图将project从objective-c转换为swift。我在转换#define时遇到了一些问题。Swift 2 - 将objective-C#define转换为swift
我所拥有的是:
#define Mask8(x) ((x) & 0xFF)
#define R(x) (Mask8(x))
#define G(x) (Mask8(x >> 8))
#define B(x) (Mask8(x >> 16))
UInt32 color = *currentPixel;
printf("%3.0f ", (R(color)+G(color)+B(color))/3.0);
我怎样才能将它转换为变量迅速?
你见过这个线程吗? http://stackoverflow.com/questions/24325477/how-to-use-a-objective-c-define-from-swift –
嗨,谢谢我已经看到了这一步,但我不明白为什么这个Objective-C宏为'Mark8 '以及如何转换它 – SNos