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
8b22435a
Commit
8b22435a
authored
Jun 03, 2017
by
yuzheng.tz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复bug:当pushPhotoPickerVc设置为NO,第一次授权时相册列表不显示
parent
78ec6750
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
40 deletions
+63
-40
TZImagePickerController/TZImagePickerController/TZImageManager.h
...PickerController/TZImagePickerController/TZImageManager.h
+1
-0
TZImagePickerController/TZImagePickerController/TZImageManager.m
...PickerController/TZImagePickerController/TZImageManager.m
+42
-28
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
...troller/TZImagePickerController/TZImagePickerController.h
+1
-0
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
...troller/TZImagePickerController/TZImagePickerController.m
+16
-9
TZImagePickerController/ViewController.m
TZImagePickerController/ViewController.m
+3
-3
No files found.
TZImagePickerController/TZImagePickerController/TZImageManager.h
View file @
8b22435a
...
@@ -69,6 +69,7 @@
...
@@ -69,6 +69,7 @@
/// Get video 获得视频
/// Get video 获得视频
-
(
void
)
getVideoWithAsset
:(
id
)
asset
completion
:(
void
(
^
)(
AVPlayerItem
*
playerItem
,
NSDictionary
*
info
))
completion
;
-
(
void
)
getVideoWithAsset
:(
id
)
asset
completion
:(
void
(
^
)(
AVPlayerItem
*
playerItem
,
NSDictionary
*
info
))
completion
;
-
(
void
)
getVideoWithAsset
:(
id
)
asset
progressHandler
:(
void
(
^
)(
double
progress
,
NSError
*
error
,
BOOL
*
stop
,
NSDictionary
*
info
))
progressHandler
completion
:(
void
(
^
)(
AVPlayerItem
*
_Nullable
,
NSDictionary
*
_Nullable
))
completion
;
/// Export video 导出视频
/// Export video 导出视频
-
(
void
)
getVideoOutputPathWithAsset
:(
id
)
asset
completion
:(
void
(
^
)(
NSString
*
outputPath
))
completion
;
-
(
void
)
getVideoOutputPathWithAsset
:(
id
)
asset
completion
:(
void
(
^
)(
NSString
*
outputPath
))
completion
;
...
...
TZImagePickerController/TZImagePickerController/TZImageManager.m
View file @
8b22435a
...
@@ -509,6 +509,7 @@ static CGFloat TZScreenScale;
...
@@ -509,6 +509,7 @@ static CGFloat TZScreenScale;
if
([
asset
isKindOfClass
:[
PHAsset
class
]])
{
if
([
asset
isKindOfClass
:[
PHAsset
class
]])
{
PHImageRequestOptions
*
option
=
[[
PHImageRequestOptions
alloc
]
init
];
PHImageRequestOptions
*
option
=
[[
PHImageRequestOptions
alloc
]
init
];
option
.
networkAccessAllowed
=
YES
;
option
.
networkAccessAllowed
=
YES
;
option
.
resizeMode
=
PHImageRequestOptionsResizeModeFast
;
[[
PHImageManager
defaultManager
]
requestImageForAsset
:
asset
targetSize
:
PHImageManagerMaximumSize
contentMode
:
PHImageContentModeAspectFit
options
:
option
resultHandler
:^
(
UIImage
*
_Nullable
result
,
NSDictionary
*
_Nullable
info
)
{
[[
PHImageManager
defaultManager
]
requestImageForAsset
:
asset
targetSize
:
PHImageManagerMaximumSize
contentMode
:
PHImageContentModeAspectFit
options
:
option
resultHandler
:^
(
UIImage
*
_Nullable
result
,
NSDictionary
*
_Nullable
info
)
{
BOOL
downloadFinined
=
(
!
[[
info
objectForKey
:
PHImageCancelledKey
]
boolValue
]
&&
!
[
info
objectForKey
:
PHImageErrorKey
]);
BOOL
downloadFinined
=
(
!
[[
info
objectForKey
:
PHImageCancelledKey
]
boolValue
]
&&
!
[
info
objectForKey
:
PHImageErrorKey
]);
if
(
downloadFinined
&&
result
)
{
if
(
downloadFinined
&&
result
)
{
...
@@ -598,8 +599,21 @@ static CGFloat TZScreenScale;
...
@@ -598,8 +599,21 @@ static CGFloat TZScreenScale;
/// Get Video / 获取视频
/// Get Video / 获取视频
-
(
void
)
getVideoWithAsset
:(
id
)
asset
completion
:(
void
(
^
)(
AVPlayerItem
*
_Nullable
,
NSDictionary
*
_Nullable
))
completion
{
-
(
void
)
getVideoWithAsset
:(
id
)
asset
completion
:(
void
(
^
)(
AVPlayerItem
*
_Nullable
,
NSDictionary
*
_Nullable
))
completion
{
[
self
getVideoWithAsset
:
asset
progressHandler
:
nil
completion
:
completion
];
}
-
(
void
)
getVideoWithAsset
:(
id
)
asset
progressHandler
:(
void
(
^
)(
double
progress
,
NSError
*
error
,
BOOL
*
stop
,
NSDictionary
*
info
))
progressHandler
completion
:(
void
(
^
)(
AVPlayerItem
*
_Nullable
,
NSDictionary
*
_Nullable
))
completion
{
if
([
asset
isKindOfClass
:[
PHAsset
class
]])
{
if
([
asset
isKindOfClass
:[
PHAsset
class
]])
{
[[
PHImageManager
defaultManager
]
requestPlayerItemForVideo
:
asset
options
:
nil
resultHandler
:^
(
AVPlayerItem
*
_Nullable
playerItem
,
NSDictionary
*
_Nullable
info
)
{
PHVideoRequestOptions
*
option
=
[[
PHVideoRequestOptions
alloc
]
init
];
option
.
networkAccessAllowed
=
YES
;
option
.
progressHandler
=
^
(
double
progress
,
NSError
*
error
,
BOOL
*
stop
,
NSDictionary
*
info
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
if
(
progressHandler
)
{
progressHandler
(
progress
,
error
,
stop
,
info
);
}
});
};
[[
PHImageManager
defaultManager
]
requestPlayerItemForVideo
:
asset
options
:
option
resultHandler
:^
(
AVPlayerItem
*
_Nullable
playerItem
,
NSDictionary
*
_Nullable
info
)
{
if
(
completion
)
completion
(
playerItem
,
info
);
if
(
completion
)
completion
(
playerItem
,
info
);
}];
}];
}
else
if
([
asset
isKindOfClass
:[
ALAsset
class
]])
{
}
else
if
([
asset
isKindOfClass
:[
ALAsset
class
]])
{
...
...
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
View file @
8b22435a
...
@@ -204,6 +204,7 @@
...
@@ -204,6 +204,7 @@
@interface
TZAlbumPickerController
:
UIViewController
@interface
TZAlbumPickerController
:
UIViewController
@property
(
nonatomic
,
assign
)
NSInteger
columnNumber
;
@property
(
nonatomic
,
assign
)
NSInteger
columnNumber
;
-
(
void
)
configTableView
;
@end
@end
...
...
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
View file @
8b22435a
...
@@ -280,6 +280,13 @@
...
@@ -280,6 +280,13 @@
_didPushPhotoPickerVc
=
YES
;
_didPushPhotoPickerVc
=
YES
;
}];
}];
}
}
if
(
!
_pushPhotoPickerVc
)
{
TZAlbumPickerController
*
albumPickerVc
=
(
TZAlbumPickerController
*
)
self
.
visibleViewController
;
if
([
albumPickerVc
isKindOfClass
:[
TZAlbumPickerController
class
]])
{
[
albumPickerVc
configTableView
];
}
}
}
}
-
(
void
)
showAlertWithTitle
:(
NSString
*
)
title
{
-
(
void
)
showAlertWithTitle
:(
NSString
*
)
title
{
...
...
TZImagePickerController/ViewController.m
View file @
8b22435a
...
@@ -200,7 +200,7 @@
...
@@ -200,7 +200,7 @@
if
(
self
.
maxCountTF
.
text
.
integerValue
<=
0
)
{
if
(
self
.
maxCountTF
.
text
.
integerValue
<=
0
)
{
return
;
return
;
}
}
TZImagePickerController
*
imagePickerVc
=
[[
TZImagePickerController
alloc
]
initWithMaxImagesCount
:
self
.
maxCountTF
.
text
.
integerValue
columnNumber
:
self
.
columnNumberTF
.
text
.
integerValue
delegate
:
self
pushPhotoPickerVc
:
YES
];
TZImagePickerController
*
imagePickerVc
=
[[
TZImagePickerController
alloc
]
initWithMaxImagesCount
:
self
.
maxCountTF
.
text
.
integerValue
columnNumber
:
self
.
columnNumberTF
.
text
.
integerValue
delegate
:
self
pushPhotoPickerVc
:
NO
];
#pragma mark - 四类个性化设置,这些参数都可以不传,此时会走默认设置
#pragma mark - 四类个性化设置,这些参数都可以不传,此时会走默认设置
...
...
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