Commit c79e034c authored by yuzheng.tz's avatar yuzheng.tz

合并代码

parents a6334e47 d6fdd457
...@@ -94,11 +94,11 @@ A:考虑下,优先级低 ...@@ -94,11 +94,11 @@ A:考虑下,优先级低
最近更新 最近更新
2.0.0.6 优化自定义languageBundle的支持,加入使用示例 2.0.0.6 优化自定义languageBundle的支持,加入使用示例
2.0.0.5 优化性能,提高选择器打开速度,新增越南语支持 2.0.0.5 优化性能,提高选择器打开速度,新增越南语支持
2.0.0.2 新增繁体语言,可设置首选语言,国际化支持更强大;优化一些细节 2.0.0.2 新增繁体语言,可设置首选语言,国际化支持更强大;优化一些细节
1.9.8 支持Carthage,优化一些细节 1.9.8 支持Carthage,优化一些细节
1.9.6 优化视频预览和gif预览页toolbar在iPhoneX上的样式 1.9.6 优化视频预览和gif预览页toolbar在iPhoneX上的样式
1.9.5 优化视频导出API,和其它一些细节 1.9.5 优化视频导出API,和其它一些细节
1.9.4 适配iPhoneX     1.9.4 适配iPhoneX    
1.9.0 移除"prefs:root="的调用,这个API已经被列为私有API,请大家尽快升级 1.9.0 移除"prefs:root="的调用,这个API已经被列为私有API,请大家尽快升级
... ...
......
...@@ -257,6 +257,8 @@ ...@@ -257,6 +257,8 @@
@interface TZCommonTools : NSObject @interface TZCommonTools : NSObject
+ (BOOL)tz_isIPhoneX; + (BOOL)tz_isIPhoneX;
+ (CGFloat)tz_statusBarHeight; + (CGFloat)tz_statusBarHeight;
// 获得Info.plist数据字典
+ (NSDictionary *)tz_getInfoDictionary;
@end @end
......
...@@ -182,10 +182,8 @@ ...@@ -182,10 +182,8 @@
_tipLabel.numberOfLines = 0; _tipLabel.numberOfLines = 0;
_tipLabel.font = [UIFont systemFontOfSize:16]; _tipLabel.font = [UIFont systemFontOfSize:16];
_tipLabel.textColor = [UIColor blackColor]; _tipLabel.textColor = [UIColor blackColor];
NSDictionary *infoDict = [NSBundle mainBundle].localizedInfoDictionary;
if (!infoDict || !infoDict.count) { NSDictionary *infoDict = [TZCommonTools tz_getInfoDictionary];
infoDict = [NSBundle mainBundle].infoDictionary;
}
NSString *appName = [infoDict valueForKey:@"CFBundleDisplayName"]; NSString *appName = [infoDict valueForKey:@"CFBundleDisplayName"];
if (!appName) appName = [infoDict valueForKey:@"CFBundleName"]; if (!appName) appName = [infoDict valueForKey:@"CFBundleName"];
NSString *tipText = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Allow %@ to access your album in \"Settings -> Privacy -> Photos\""],appName]; NSString *tipText = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Allow %@ to access your album in \"Settings -> Privacy -> Photos\""],appName];
...@@ -793,6 +791,18 @@ ...@@ -793,6 +791,18 @@
return [self tz_isIPhoneX] ? 44 : 20; return [self tz_isIPhoneX] ? 44 : 20;
} }
// 获得Info.plist数据字典
+ (NSDictionary *)tz_getInfoDictionary {
NSDictionary *infoDict = [NSBundle mainBundle].localizedInfoDictionary;
if (!infoDict || !infoDict.count) {
infoDict = [NSBundle mainBundle].infoDictionary;
}
if (!infoDict || !infoDict.count) {
NSString *path = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
infoDict = [NSDictionary dictionaryWithContentsOfFile:path];
}
return infoDict ? infoDict : @{};
}
@end @end
......
...@@ -549,9 +549,12 @@ static CGFloat itemMargin = 5; ...@@ -549,9 +549,12 @@ static CGFloat itemMargin = 5;
- (void)takePhoto { - (void)takePhoto {
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if ((authStatus == AVAuthorizationStatusRestricted || authStatus ==AVAuthorizationStatusDenied) && iOS7Later) { if ((authStatus == AVAuthorizationStatusRestricted || authStatus ==AVAuthorizationStatusDenied) && iOS7Later) {
NSDictionary *infoDict = [TZCommonTools tz_getInfoDictionary];
// 无权限 做一个友好的提示 // 无权限 做一个友好的提示
NSString *appName = [[NSBundle mainBundle].infoDictionary valueForKey:@"CFBundleDisplayName"]; NSString *appName = [infoDict valueForKey:@"CFBundleDisplayName"];
if (!appName) appName = [[NSBundle mainBundle].infoDictionary valueForKey:@"CFBundleName"]; if (!appName) appName = [infoDict valueForKey:@"CFBundleName"];
NSString *message = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\""],appName]; NSString *message = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\""],appName];
if (iOS8Later) { if (iOS8Later) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSBundle tz_localizedStringForKey:@"Can not use camera"] message:message delegate:self cancelButtonTitle:[NSBundle tz_localizedStringForKey:@"Cancel"] otherButtonTitles:[NSBundle tz_localizedStringForKey:@"Setting"], nil]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSBundle tz_localizedStringForKey:@"Can not use camera"] message:message delegate:self cancelButtonTitle:[NSBundle tz_localizedStringForKey:@"Cancel"] otherButtonTitles:[NSBundle tz_localizedStringForKey:@"Setting"], nil];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment