Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMPhobos
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMPhobos
Commits
4a03ac18
Commit
4a03ac18
authored
Mar 02, 2018
by
汪洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化initReferer
parent
8ffe8b37
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
UIResponder+PhobosPV.m
Pod/Classes/UIResponder+PhobosPV.m
+8
-1
No files found.
Pod/Classes/UIResponder+PhobosPV.m
View file @
4a03ac18
...
...
@@ -25,7 +25,14 @@
// 分present与navigation两种情况
UIViewController
*
me
=
(
UIViewController
*
)
self
;
if
(
me
.
presentingViewController
!=
nil
)
{
objc_setAssociatedObject
(
self
,
@selector
(
referer
),
me
.
presentingViewController
.
pageName
,
OBJC_ASSOCIATION_COPY
);
// app全局只有一个navigation,发现此时用navigation.topViewController presentViewController时,最终使用的是navigation弹出的
// 所以此处要判断,如果是navigation弹出,最后还是要定位到topViewController
if
([
me
.
presentingViewController
isKindOfClass
:[
UINavigationController
class
]])
{
UIViewController
*
top
=
((
UINavigationController
*
)
me
.
presentingViewController
).
topViewController
;
objc_setAssociatedObject
(
self
,
@selector
(
referer
),
top
.
pageName
,
OBJC_ASSOCIATION_COPY
);
}
else
{
objc_setAssociatedObject
(
self
,
@selector
(
referer
),
me
.
presentingViewController
.
pageName
,
OBJC_ASSOCIATION_COPY
);
}
}
else
{
NSArray
*
navigationPool
=
((
UIViewController
*
)
self
).
navigationController
.
viewControllers
;
NSInteger
refererIndex
=
navigationPool
.
count
-
2
;
...
...
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