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
d67e4477
Commit
d67e4477
authored
May 09, 2017
by
汪洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重写referrerId的get方法,会自动获取
parent
1a948f13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
UIResponder+PhobosPV.h
Pod/Classes/UIResponder+PhobosPV.h
+4
-0
UIResponder+PhobosPV.m
Pod/Classes/UIResponder+PhobosPV.m
+15
-1
No files found.
Pod/Classes/UIResponder+PhobosPV.h
View file @
d67e4477
...
...
@@ -9,5 +9,9 @@
#import <UIKit/UIKit.h>
#import "PhobosPVProtocol.h"
@interface
UIResponder
(
PhobosPV
)
<
PhobosPVProtocol
>
/**
只适用于controller自动初始化referer
*/
-
(
void
)
initReferer
;
@end
Pod/Classes/UIResponder+PhobosPV.m
View file @
d67e4477
...
...
@@ -78,7 +78,21 @@
-
(
NSString
*
)
referrerId
{
NSString
*
referrerId
=
objc_getAssociatedObject
(
self
,
@selector
(
referrerId
));
return
referrerId
==
nil
?
@""
:
referrerId
;
if
(
referrerId
==
nil
)
{
if
([
self
isKindOfClass
:[
UIViewController
class
]])
{
NSArray
*
navigationPool
=
((
UIViewController
*
)
self
).
navigationController
.
viewControllers
;
NSInteger
refererIdIndex
=
navigationPool
.
count
-
2
;
if
(
refererIdIndex
<
0
)
{
return
@""
;
}
else
{
UIViewController
*
controller
=
navigationPool
[
refererIdIndex
];
NSString
*
preBusinessId
=
controller
.
businessId
;
objc_setAssociatedObject
(
self
,
@selector
(
referrerId
),
preBusinessId
,
OBJC_ASSOCIATION_COPY
);
return
preBusinessId
;
}
}
}
return
referrerId
;
}
-
(
BOOL
)
needLogPV
{
...
...
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