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
1de0c0f9
Unverified
Commit
1de0c0f9
authored
Dec 04, 2019
by
谭真
Committed by
GitHub
Dec 04, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1238 from kinarobin/optimize_request_operation
[Enhancements] Optimize request operation
parents
c78fbae1
969a1dc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
19 deletions
+17
-19
TZImagePickerController/TZImagePickerController/TZImageRequestOperation.m
...troller/TZImagePickerController/TZImageRequestOperation.m
+17
-19
No files found.
TZImagePickerController/TZImagePickerController/TZImageRequestOperation.m
View file @
1de0c0f9
...
...
@@ -26,26 +26,24 @@
-
(
void
)
start
{
self
.
executing
=
YES
;
dispatch_async
(
dispatch_get_global_queue
(
0
,
0
),
^
{
[[
TZImageManager
manager
]
getPhotoWithAsset
:
self
.
asset
completion
:
^
(
UIImage
*
photo
,
NSDictionary
*
info
,
BOOL
isDegraded
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
if
(
!
isDegraded
)
{
if
(
self
.
completedBlock
)
{
self
.
completedBlock
(
photo
,
info
,
isDegraded
);
}
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
0
.
1
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
self
done
];
});
[[
TZImageManager
manager
]
getPhotoWithAsset
:
self
.
asset
completion
:
^
(
UIImage
*
photo
,
NSDictionary
*
info
,
BOOL
isDegraded
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
if
(
!
isDegraded
)
{
if
(
self
.
completedBlock
)
{
self
.
completedBlock
(
photo
,
info
,
isDegraded
);
}
});
}
progressHandler
:^
(
double
progress
,
NSError
*
error
,
BOOL
*
stop
,
NSDictionary
*
info
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
if
(
self
.
progressBlock
)
{
self
.
progressBlock
(
progress
,
error
,
stop
,
info
);
}
});
}
networkAccessAllowed
:
YES
];
});
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
0
.
1
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
self
done
];
});
}
});
}
progressHandler
:^
(
double
progress
,
NSError
*
error
,
BOOL
*
stop
,
NSDictionary
*
info
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
if
(
self
.
progressBlock
)
{
self
.
progressBlock
(
progress
,
error
,
stop
,
info
);
}
});
}
networkAccessAllowed
:
YES
];
}
-
(
void
)
done
{
...
...
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