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
1b927ed3
Commit
1b927ed3
authored
Mar 09, 2018
by
汪洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化visibleController的获取方式
parent
7e1bb3f5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
Phobos.h
Pod/Classes/Phobos.h
+6
-0
Phobos.m
Pod/Classes/Phobos.m
+4
-10
No files found.
Pod/Classes/Phobos.h
View file @
1b927ed3
...
@@ -76,6 +76,12 @@
...
@@ -76,6 +76,12 @@
数据接收的服务器API
数据接收的服务器API
*/
*/
@property
(
copy
,
nonatomic
)
NSString
*
serverAPI
;
@property
(
copy
,
nonatomic
)
NSString
*
serverAPI
;
/**
从主项目获取当前显示的controller
*/
@property
(
nonatomic
,
copy
)
UIViewController
*
(
^
getTopController
)
(
void
);
#pragma mark - 事件采集
#pragma mark - 事件采集
/**
/**
...
...
Pod/Classes/Phobos.m
View file @
1b927ed3
...
@@ -130,15 +130,7 @@ static NSString *sdkVersion = @"110";
...
@@ -130,15 +130,7 @@ static NSString *sdkVersion = @"110";
}
}
-
(
UIViewController
*
)
visibleController
{
-
(
UIViewController
*
)
visibleController
{
id
target
=
[
UIApplication
sharedApplication
].
keyWindow
.
rootViewController
;
id
target
=
self
.
getTopController
();
if
([
target
isKindOfClass
:[
UITabBarController
class
]])
{
UITabBarController
*
tabbar
=
(
UITabBarController
*
)
target
;
UINavigationController
*
navigationController
=
(
UINavigationController
*
)
tabbar
.
selectedViewController
;
target
=
navigationController
.
visibleViewController
;
}
else
if
([
target
isKindOfClass
:[
UINavigationController
class
]])
{
UINavigationController
*
navigationController
=
(
UINavigationController
*
)
target
;
target
=
navigationController
.
visibleViewController
;
}
if
([
target
conformsToProtocol
:
NSProtocolFromString
(
@"PhobosCustomVisibleController"
)])
{
if
([
target
conformsToProtocol
:
NSProtocolFromString
(
@"PhobosCustomVisibleController"
)])
{
target
=
[
target
performSelector
:
@selector
(
phobosVisibleController
)];
target
=
[
target
performSelector
:
@selector
(
phobosVisibleController
)];
...
@@ -439,7 +431,9 @@ static NSString *sdkVersion = @"110";
...
@@ -439,7 +431,9 @@ static NSString *sdkVersion = @"110";
-
(
void
)
sendArray
{
-
(
void
)
sendArray
{
NSMutableArray
*
dataArray
=
[[
WMCacheService
sharedInstance
]
fetchObjectAtDucmentPathWithkey
:
PhobosTempCacheKey
];
NSMutableArray
*
dataArray
=
[[
WMCacheService
sharedInstance
]
fetchObjectAtDucmentPathWithkey
:
PhobosTempCacheKey
];
if
(
_logEnabled
)
{
if
(
_logEnabled
)
{
phobosLog
([
NSString
stringWithFormat
:
@"array prepare to fly --✈: %@"
,
dataArray
]);
NSData
*
data
=
[
NSJSONSerialization
dataWithJSONObject
:
dataArray
options
:
NSJSONWritingPrettyPrinted
error
:
nil
];
NSString
*
jsonString
=
[[
NSString
alloc
]
initWithData
:
data
encoding
:
NSUTF8StringEncoding
];
phobosLog
([
NSString
stringWithFormat
:
@"array prepare to fly --✈: %@"
,
jsonString
]);
}
}
@try
{
@try
{
NSData
*
JSON
=
[
PhobosUtil
encodeJSON
:
dataArray
];
NSData
*
JSON
=
[
PhobosUtil
encodeJSON
:
dataArray
];
...
...
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