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
62b0ef17
Commit
62b0ef17
authored
Oct 18, 2016
by
banchichen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重新加入我的
parent
549ed774
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
24 deletions
+9
-24
TZImagePickerController/TZImagePickerController/TZImageManager.m
...PickerController/TZImagePickerController/TZImageManager.m
+7
-2
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
...troller/TZImagePickerController/TZImagePickerController.m
+2
-22
No files found.
TZImagePickerController/TZImagePickerController/TZImageManager.m
View file @
62b0ef17
...
@@ -124,9 +124,15 @@ static CGFloat TZScreenScale;
...
@@ -124,9 +124,15 @@ static CGFloat TZScreenScale;
if
(
!
self
.
sortAscendingByModificationDate
)
{
if
(
!
self
.
sortAscendingByModificationDate
)
{
option
.
sortDescriptors
=
@[[
NSSortDescriptor
sortDescriptorWithKey
:
@"creationDate"
ascending
:
self
.
sortAscendingByModificationDate
]];
option
.
sortDescriptors
=
@[[
NSSortDescriptor
sortDescriptorWithKey
:
@"creationDate"
ascending
:
self
.
sortAscendingByModificationDate
]];
}
}
// 我的照片流
PHFetchResult
*
myPhotoStreamAlbum
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeAlbum
subtype
:
PHAssetCollectionSubtypeAlbumMyPhotoStream
options
:
nil
];
PHFetchResult
*
smartAlbums
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeSmartAlbum
subtype
:
PHAssetCollectionSubtypeAlbumRegular
options
:
nil
];
PHFetchResult
*
smartAlbums
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeSmartAlbum
subtype
:
PHAssetCollectionSubtypeAlbumRegular
options
:
nil
];
PHFetchResult
*
topLevelUserCollections
=
[
PHCollectionList
fetchTopLevelUserCollectionsWithOptions
:
nil
];
PHFetchResult
*
topLevelUserCollections
=
[
PHCollectionList
fetchTopLevelUserCollectionsWithOptions
:
nil
];
for
(
PHAssetCollection
*
collection
in
myPhotoStreamAlbum
)
{
PHFetchResult
*
fetchResult
=
[
PHAsset
fetchAssetsInAssetCollection
:
collection
options
:
option
];
if
(
fetchResult
.
count
<
1
)
continue
;
[
albumArr
addObject
:[
self
modelWithResult
:
fetchResult
name
:
collection
.
localizedTitle
]];
}
for
(
PHAssetCollection
*
collection
in
smartAlbums
)
{
for
(
PHAssetCollection
*
collection
in
smartAlbums
)
{
// 有可能是PHCollectionList类的的对象,过滤掉
// 有可能是PHCollectionList类的的对象,过滤掉
if
(
!
[
collection
isKindOfClass
:[
PHAssetCollection
class
]])
continue
;
if
(
!
[
collection
isKindOfClass
:[
PHAssetCollection
class
]])
continue
;
...
@@ -140,7 +146,6 @@ static CGFloat TZScreenScale;
...
@@ -140,7 +146,6 @@ static CGFloat TZScreenScale;
}
}
}
}
for
(
PHAssetCollection
*
collection
in
topLevelUserCollections
)
{
for
(
PHAssetCollection
*
collection
in
topLevelUserCollections
)
{
// 有可能是PHCollectionList类的的对象,过滤掉
if
(
!
[
collection
isKindOfClass
:[
PHAssetCollection
class
]])
continue
;
if
(
!
[
collection
isKindOfClass
:[
PHAssetCollection
class
]])
continue
;
PHFetchResult
*
fetchResult
=
[
PHAsset
fetchAssetsInAssetCollection
:
collection
options
:
option
];
PHFetchResult
*
fetchResult
=
[
PHAsset
fetchAssetsInAssetCollection
:
collection
options
:
option
];
if
(
fetchResult
.
count
<
1
)
continue
;
if
(
fetchResult
.
count
<
1
)
continue
;
...
...
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
View file @
62b0ef17
...
@@ -346,28 +346,6 @@
...
@@ -346,28 +346,6 @@
-
(
void
)
pushViewController
:(
UIViewController
*
)
viewController
animated
:(
BOOL
)
animated
{
-
(
void
)
pushViewController
:(
UIViewController
*
)
viewController
animated
:(
BOOL
)
animated
{
if
(
iOS7Later
)
viewController
.
automaticallyAdjustsScrollViewInsets
=
NO
;
if
(
iOS7Later
)
viewController
.
automaticallyAdjustsScrollViewInsets
=
NO
;
if
(
_timer
)
{
[
_timer
invalidate
];
_timer
=
nil
;}
if
(
_timer
)
{
[
_timer
invalidate
];
_timer
=
nil
;}
if
(
self
.
childViewControllers
.
count
>
0
)
{
UIButton
*
backButton
=
[[
UIButton
alloc
]
initWithFrame
:
CGRectMake
(
3
,
0
,
50
,
44
)];
[
backButton
setImage
:[
UIImage
imageNamedFromMyBundle
:
@"navi_back.png"
]
forState
:
UIControlStateNormal
];
backButton
.
imageEdgeInsets
=
UIEdgeInsetsMake
(
0
,
-
5
,
0
,
0
);
[
backButton
setTitle
:
@"返回"
forState
:
UIControlStateNormal
];
backButton
.
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
];
[
backButton
addTarget
:
self
action
:
@selector
(
popViewControllerAnimated
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
UIBarButtonItem
*
backButtonItem
=
[[
UIBarButtonItem
alloc
]
initWithCustomView
:
backButton
];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
backButtonItem
.
style
=
UIBarButtonItemStyleBordered
;
#pragma clang diagnostic pop
self
.
topViewController
.
navigationItem
.
backBarButtonItem
=
backButtonItem
;
/**
另外一种只有箭头的返回键
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStyleBordered target:nil action:nil];
self.topViewController.navigationItem.backBarButtonItem = backItem;
*/
}
[
super
pushViewController
:
viewController
animated
:
animated
];
[
super
pushViewController
:
viewController
animated
:
animated
];
}
}
...
@@ -388,6 +366,8 @@
...
@@ -388,6 +366,8 @@
self
.
navigationItem
.
title
=
[
NSBundle
tz_localizedStringForKey
:
@"Photos"
];
self
.
navigationItem
.
title
=
[
NSBundle
tz_localizedStringForKey
:
@"Photos"
];
self
.
navigationItem
.
rightBarButtonItem
=
[[
UIBarButtonItem
alloc
]
initWithTitle
:[
NSBundle
tz_localizedStringForKey
:
@"Cancel"
]
style
:
UIBarButtonItemStylePlain
target
:
self
action
:
@selector
(
cancel
)];
self
.
navigationItem
.
rightBarButtonItem
=
[[
UIBarButtonItem
alloc
]
initWithTitle
:[
NSBundle
tz_localizedStringForKey
:
@"Cancel"
]
style
:
UIBarButtonItemStylePlain
target
:
self
action
:
@selector
(
cancel
)];
[
self
configTableView
];
[
self
configTableView
];
// 1.6.10 采用微信的方式,只在相册列表页定义backBarButtonItem为返回,其余的顺系统的做法
self
.
navigationItem
.
backBarButtonItem
=
[[
UIBarButtonItem
alloc
]
initWithTitle
:[
NSBundle
tz_localizedStringForKey
:
@"Back"
]
style
:
UIBarButtonItemStylePlain
target
:
nil
action
:
nil
];
}
}
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
{
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
{
...
...
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