Skip to content

Instantly share code, notes, and snippets.

View 中文转拼音
NSMutableString *pinyin = [name mutableCopy];
if (!CFStringTransform((__bridge CFMutableStringRef)pinyin, 0, kCFStringTransformMandarinLatin, NO)) {
DDLogWarn(@"拼音转换[步骤1]失败: %@ -> %@", name, pinyin);
}
if (!CFStringTransform((__bridge CFMutableStringRef)pinyin, 0, kCFStringTransformStripDiacritics, NO)) {
DDLogWarn(@"拼音转换[步骤2]失败: %@ -> %@", name, pinyin);
}
View UIView_rotate_method
- (void)rotateView:(UIView*)view ToAngle:(CGFloat)angle animated:(BOOL)animated
{
NSParameterAssert(angle <= 360 && angle >= 0);
CGFloat radians = atan2f(view.transform.b, view.transform.a);
CGFloat degrees = radians * (180 / M_PI);
if ( fabs( degrees - angle ) < FLT_MIN) {
return;
}
@revolc
revolc / delete_at_2x_resource.py
Last active Dec 17, 2015
python script that keep @2x file with the name of low definition file
View delete_at_2x_resource.py
#!/usr/bin/env python
import os
image_file_types = ['.jpg', '.png']
def is_image_file(file_name):
fileName, fileExt = os.path.splitext(file_name)
for type in image_file_types:
You can’t perform that action at this time.