Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMBase
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
GMBase
Commits
4ff5b89b
Commit
4ff5b89b
authored
Jul 19, 2016
by
汪洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正OCNavigatioinBar.m中关于titleView的bug;升级GMPhobos
parent
1e415d59
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
0 deletions
+88
-0
UIViewController+Phobos.h
Example/Pods/GMPhobos/Pod/Classes/UIViewController+Phobos.h
+37
-0
UIViewController+Phobos.m
Example/Pods/GMPhobos/Pod/Classes/UIViewController+Phobos.m
+51
-0
No files found.
Example/Pods/GMPhobos/Pod/Classes/UIViewController+Phobos.h
0 → 100644
View file @
4ff5b89b
//
// UIViewController+Phobos.h
// Pods
//
// Created by wangyang on 16/7/12.
//
//
#import <UIKit/UIKit.h>
@interface
UIViewController
(
Phobos
)
/**
* @author 翟国钧, 16-02-24 17:02:22
*
* @brief 埋点的时候,有些埋点都需要业务id,比如DoctorId,针对那些只能在父类中埋点的业务,要在子类中设置当前id,然后在父类中取到
* 在一些详情页的分享和收藏的时候,由于分享、收藏的方法在basewebview里,所以,统一在里面做处理,但是需要在子类中把想要的参数传过去。包括:type(类型)、from(来自哪)、businessId(对应业务id)
* @since 5.9.1
*/
@property
(
nonatomic
,
copy
,
nonnull
)
NSString
*
businessId
;
/**
* @author 翟国钧 in 16-02-25 19:02:32
*
* @brief 获取前一个页面的pageName
*
* @since 5.9.1
*/
@property
(
nonatomic
,
strong
,
readonly
,
nonnull
)
NSString
*
referer
;
/**
* @author 翟国钧 in 16-02-25 19:02:32
*
* 埋点pv事件中当前页面的别名
* @since 5.9.1
*/
@property
(
nonatomic
,
copy
,
nonnull
)
NSString
*
pageName
;
@end
Example/Pods/GMPhobos/Pod/Classes/UIViewController+Phobos.m
0 → 100644
View file @
4ff5b89b
//
// UIViewController+Phobos.m
// Pods
//
// Created by wangyang on 16/7/12.
//
//
#import "UIViewController+Phobos.h"
#import <objc/runtime.h>
@implementation
UIViewController
(
Phobos
)
/**
* @author 翟国钧, 16-03-01 15:03:24
*
* @brief 取当前导航栈中当前VC的上级VC,如果该VC存在,就获取他的pageName
*
* @return 前一页的pageName
*
* @since 5.9.1
*/
-
(
NSString
*
)
referer
{
NSArray
*
navigationPool
=
self
.
navigationController
.
viewControllers
;
NSInteger
refererIndex
=
navigationPool
.
count
-
2
;
if
(
refererIndex
<
0
)
{
return
@""
;
}
UIViewController
*
controller
=
navigationPool
[
refererIndex
];
return
controller
.
pageName
==
nil
?
@""
:
controller
.
pageName
;
}
-
(
NSString
*
)
pageName
{
NSString
*
name
=
objc_getAssociatedObject
(
self
,
@selector
(
pageName
));
return
name
==
nil
?
@""
:
name
;
}
-
(
void
)
setPageName
:
(
NSString
*
)
pageName
{
objc_setAssociatedObject
(
self
,
@selector
(
pageName
),
pageName
,
OBJC_ASSOCIATION_COPY
);
}
-
(
NSString
*
)
businessId
{
NSString
*
businessId
=
objc_getAssociatedObject
(
self
,
@selector
(
businessId
));
return
businessId
==
nil
?
@""
:
businessId
;
}
-
(
void
)
setBusinessId
:
(
NSString
*
)
businessId
{
objc_setAssociatedObject
(
self
,
@selector
(
businessId
),
businessId
,
OBJC_ASSOCIATION_COPY
);
}
@end
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