Commit 1e415d59 authored by 汪洋's avatar 汪洋

修正OCNavigatioinBar.m中关于titleView的bug;升级GMPhobos

parent 1f1dd41c
...@@ -14,9 +14,9 @@ PODS: ...@@ -14,9 +14,9 @@ PODS:
- AFNetworking/Serialization (3.1.0) - AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0): - AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession - AFNetworking/NSURLSession
- GMBase (0.0.5): - GMBase (0.0.6):
- GMNetService (= 0.1.3) - GMNetService (= 0.1.3)
- GMPhobos (= 0.2.8) - GMPhobos (= 0.2.9)
- GMRefresh (= 0.1.3) - GMRefresh (= 0.1.3)
- JSONModel (= 1.2.0) - JSONModel (= 1.2.0)
- Masonry (= 1.0.1) - Masonry (= 1.0.1)
...@@ -26,7 +26,7 @@ PODS: ...@@ -26,7 +26,7 @@ PODS:
- TMCache (~> 2.1.0) - TMCache (~> 2.1.0)
- GMNetService (0.1.3): - GMNetService (0.1.3):
- AFNetworking (= 3.1.0) - AFNetworking (= 3.1.0)
- GMPhobos (0.2.8): - GMPhobos (0.2.9):
- GMCache (~> 0.1.0) - GMCache (~> 0.1.0)
- GMRefresh (0.1.3): - GMRefresh (0.1.3):
- MJRefresh (~> 3.1.0) - MJRefresh (~> 3.1.0)
...@@ -46,10 +46,10 @@ EXTERNAL SOURCES: ...@@ -46,10 +46,10 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
GMBase: 8ad9dbe10cbbaec343243390484677e04282607c GMBase: 42660bfbb72f219ad2919dd03953722d68bd8bf4
GMCache: a7b06a2d8a5a1c7cf023055c631ba9a0cd7c39fc GMCache: a7b06a2d8a5a1c7cf023055c631ba9a0cd7c39fc
GMNetService: 2eb74ed62512078e9f00bc7006227a93c2acdf32 GMNetService: 2eb74ed62512078e9f00bc7006227a93c2acdf32
GMPhobos: 9f046f82fa806bc21cde83732fb411edac0b3d20 GMPhobos: c9a93b2bc8c977820b249c9c615204133358cc09
GMRefresh: a37fb054e758805ec2a6f9b632cf3dc861bb3cf9 GMRefresh: a37fb054e758805ec2a6f9b632cf3dc861bb3cf9
JSONModel: 12523685c4b623553ccf844bbbf7007624317b2c JSONModel: 12523685c4b623553ccf844bbbf7007624317b2c
Masonry: a1a931a0d08870ed8ae415a2ea5ea68ebcac77df Masonry: a1a931a0d08870ed8ae415a2ea5ea68ebcac77df
......
{ {
"name": "GMBase", "name": "GMBase",
"version": "0.0.5", "version": "0.0.6",
"summary": "更美iOS APP 的 Objective-C 基础Pod库", "summary": "更美iOS APP 的 Objective-C 基础Pod库",
"homepage": "http://git.gengmei.cc/gengmeiios/GMBase", "homepage": "http://git.gengmei.cc/gengmeiios/GMBase",
"license": "仅限北京更美互动信息科技有限公司内部使用", "license": "仅限北京更美互动信息科技有限公司内部使用",
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
}, },
"source": { "source": {
"git": "http://git.gengmei.cc/gengmeiios/GMBase.git", "git": "http://git.gengmei.cc/gengmeiios/GMBase.git",
"tag": "0.0.5" "tag": "0.0.6"
}, },
"platforms": { "platforms": {
"ios": "8.0" "ios": "8.0"
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
"1.0.1" "1.0.1"
], ],
"GMPhobos": [ "GMPhobos": [
"0.2.8" "0.2.9"
] ]
} }
} }
...@@ -14,9 +14,9 @@ PODS: ...@@ -14,9 +14,9 @@ PODS:
- AFNetworking/Serialization (3.1.0) - AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0): - AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession - AFNetworking/NSURLSession
- GMBase (0.0.5): - GMBase (0.0.6):
- GMNetService (= 0.1.3) - GMNetService (= 0.1.3)
- GMPhobos (= 0.2.8) - GMPhobos (= 0.2.9)
- GMRefresh (= 0.1.3) - GMRefresh (= 0.1.3)
- JSONModel (= 1.2.0) - JSONModel (= 1.2.0)
- Masonry (= 1.0.1) - Masonry (= 1.0.1)
...@@ -26,7 +26,7 @@ PODS: ...@@ -26,7 +26,7 @@ PODS:
- TMCache (~> 2.1.0) - TMCache (~> 2.1.0)
- GMNetService (0.1.3): - GMNetService (0.1.3):
- AFNetworking (= 3.1.0) - AFNetworking (= 3.1.0)
- GMPhobos (0.2.8): - GMPhobos (0.2.9):
- GMCache (~> 0.1.0) - GMCache (~> 0.1.0)
- GMRefresh (0.1.3): - GMRefresh (0.1.3):
- MJRefresh (~> 3.1.0) - MJRefresh (~> 3.1.0)
...@@ -46,10 +46,10 @@ EXTERNAL SOURCES: ...@@ -46,10 +46,10 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
GMBase: 8ad9dbe10cbbaec343243390484677e04282607c GMBase: 42660bfbb72f219ad2919dd03953722d68bd8bf4
GMCache: a7b06a2d8a5a1c7cf023055c631ba9a0cd7c39fc GMCache: a7b06a2d8a5a1c7cf023055c631ba9a0cd7c39fc
GMNetService: 2eb74ed62512078e9f00bc7006227a93c2acdf32 GMNetService: 2eb74ed62512078e9f00bc7006227a93c2acdf32
GMPhobos: 9f046f82fa806bc21cde83732fb411edac0b3d20 GMPhobos: c9a93b2bc8c977820b249c9c615204133358cc09
GMRefresh: a37fb054e758805ec2a6f9b632cf3dc861bb3cf9 GMRefresh: a37fb054e758805ec2a6f9b632cf3dc861bb3cf9
JSONModel: 12523685c4b623553ccf844bbbf7007624317b2c JSONModel: 12523685c4b623553ccf844bbbf7007624317b2c
Masonry: a1a931a0d08870ed8ae415a2ea5ea68ebcac77df Masonry: a1a931a0d08870ed8ae415a2ea5ea68ebcac77df
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#import "OCEmptyView.h" #import "OCEmptyView.h"
#import "OCNavigatioinBar.h" #import "OCNavigatioinBar.h"
#import "UIViewController+HUD.h" #import "UIViewController+HUD.h"
#import "UIViewController+Phobos.h"
#import "WMBaseListViewController.h" #import "WMBaseListViewController.h"
#import "WMBaseViewController.h" #import "WMBaseViewController.h"
#import "WMFetchDataViewModel.h" #import "WMFetchDataViewModel.h"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.0.5</string> <string>0.0.6</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#import "Phobos.h" #import "Phobos.h"
#import "PhobosConfig.h" #import "PhobosConfig.h"
#import "PhobosUtil.h" #import "PhobosUtil.h"
#import "UIViewController+Phobos.h"
FOUNDATION_EXPORT double GMPhobosVersionNumber; FOUNDATION_EXPORT double GMPhobosVersionNumber;
FOUNDATION_EXPORT const unsigned char GMPhobosVersionString[]; FOUNDATION_EXPORT const unsigned char GMPhobosVersionString[];
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.2.8</string> <string>0.2.9</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -16,5 +16,5 @@ Pod::Spec.new do |s| ...@@ -16,5 +16,5 @@ Pod::Spec.new do |s|
s.dependency 'GMNetService', '0.1.3' s.dependency 'GMNetService', '0.1.3'
s.dependency 'MBProgressHUD', '0.9.2' s.dependency 'MBProgressHUD', '0.9.2'
s.dependency 'Masonry' , '1.0.1' s.dependency 'Masonry' , '1.0.1'
s.dependency 'GMPhobos' , '0.2.8' s.dependency 'GMPhobos' , '0.2.9'
end end
...@@ -92,6 +92,7 @@ ...@@ -92,6 +92,7 @@
button.adaptiveWidth = 40; button.adaptiveWidth = 40;
} }
#pragma mark - Public
- (void)showShadow:(BOOL)show { - (void)showShadow:(BOOL)show {
_shadowView.hidden = !show; _shadowView.hidden = !show;
} }
...@@ -125,12 +126,13 @@ ...@@ -125,12 +126,13 @@
#pragma mark - Setter #pragma mark - Setter
- (void)setTitleView:(UIView * _Nullable)titleView { - (void)setTitleView:(UIView * _Nullable)titleView {
_titleView = titleView; _titleView = titleView;
[_itemView insertSubview:_titleView atIndex:0]; if (titleView == nil) {
[_titleView mas_makeConstraints:^(MASConstraintMaker *make) { [_titleView removeFromSuperview];
make.center.mas_equalTo(0); } else {
}]; [_itemView insertSubview:_titleView atIndex:0];
_titleView.center = CGPointMake(_itemView.bounds.size.width/2, _itemView.bounds.size.height/2);
}
} }
- (void)setTitle:(NSString *)title { - (void)setTitle:(NSString *)title {
_title = title; _title = title;
_titleLabel.hidden = NO; _titleLabel.hidden = NO;
......
//
// UIViewController+Phobos.h
// Pods
//
// Created by wangyang on 16/7/12.
//
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@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
NS_ASSUME_NONNULL_END
\ No newline at end of file
//
// 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
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "OCNavigatioinBar.h" #import "OCNavigatioinBar.h"
#import "UIViewController+HUD.h" #import "UIViewController+HUD.h"
#import "UIViewController+Phobos.h" #import <GMPhobos/GMPhobos-umbrella.h>
@interface WMBaseViewController : UIViewController <OCNavigatioinBarDelegate> @interface WMBaseViewController : UIViewController <OCNavigatioinBarDelegate>
@property (nonatomic, strong) OCNavigatioinBar *navigationBar; @property (nonatomic, strong) OCNavigatioinBar *navigationBar;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#import "WMBaseViewController.h" #import "WMBaseViewController.h"
#import "GMBaseUtil.h" #import "GMBaseUtil.h"
#import <GMPhobos/Phobos.h>
@interface WMBaseViewController () { @interface WMBaseViewController () {
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment