a = ( a + b ) - ( b = a );
或者使用异或运算
a = a ^ b; b = a ^ b; a = a ^ b;
a^=b^=a^=b;
代码测试成功
int a = 123, b = 678;
//交换值
a = ( a + b ) - ( b = a );
NSLog(@"a=%d, b = %d",a,b);
测试结果:
2019-07-24 17:56:09.002894+0800 test[42881:5910344] a=678, b = 123
给view同时加上圆角和阴影
使用 maskedCorners,CACornerMask
网友评论