Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
dz_TZImagePickerController
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shuijing
dz_TZImagePickerController
Commits
42869898
Commit
42869898
authored
Feb 06, 2018
by
zcxy1234
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GL][抽取获得Info.plist方法到TZCommonTools]
parent
c77ab1ea
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
16 deletions
+20
-16
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
...troller/TZImagePickerController/TZImagePickerController.h
+2
-0
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
...troller/TZImagePickerController/TZImagePickerController.m
+17
-8
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
...troller/TZImagePickerController/TZPhotoPickerController.m
+1
-8
No files found.
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
View file @
42869898
...
...
@@ -253,6 +253,8 @@
@interface
TZCommonTools
:
NSObject
+
(
BOOL
)
tz_isIPhoneX
;
+
(
CGFloat
)
tz_statusBarHeight
;
// 获得Info.plist数据字典
+
(
NSDictionary
*
)
tz_getInfoDictionary
;
@end
...
...
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
View file @
42869898
...
...
@@ -182,15 +182,8 @@
_tipLabel
.
numberOfLines
=
0
;
_tipLabel
.
font
=
[
UIFont
systemFontOfSize
:
16
];
_tipLabel
.
textColor
=
[
UIColor
blackColor
];
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
];
}
NSDictionary
*
infoDict
=
[
TZCommonTools
tz_getInfoDictionary
];
NSString
*
appName
=
[
infoDict
valueForKey
:
@"CFBundleDisplayName"
];
if
(
!
appName
)
appName
=
[
infoDict
valueForKey
:
@"CFBundleName"
];
NSString
*
tipText
=
[
NSString
stringWithFormat
:[
NSBundle
tz_localizedStringForKey
:
@"Allow %@ to access your album in
\"
Settings -> Privacy -> Photos
\"
"
],
appName
];
...
...
@@ -792,6 +785,22 @@
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
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
View file @
42869898
...
...
@@ -550,14 +550,7 @@ static CGFloat itemMargin = 5;
AVAuthorizationStatus
authStatus
=
[
AVCaptureDevice
authorizationStatusForMediaType
:
AVMediaTypeVideo
];
if
((
authStatus
==
AVAuthorizationStatusRestricted
||
authStatus
==
AVAuthorizationStatusDenied
)
&&
iOS7Later
)
{
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
];
}
NSDictionary
*
infoDict
=
[
TZCommonTools
tz_getInfoDictionary
];
// 无权限 做一个友好的提示
NSString
*
appName
=
[
infoDict
valueForKey
:
@"CFBundleDisplayName"
];
if
(
!
appName
)
appName
=
[
infoDict
valueForKey
:
@"CFBundleName"
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment