Commit 85085f9e authored by 汪洋's avatar 汪洋

添加协议:PhobosCustomVisibleController

parent d87bcadf
...@@ -31,5 +31,5 @@ Carthage ...@@ -31,5 +31,5 @@ Carthage
# Note: if you ignore the Pods directory, make sure to uncomment # Note: if you ignore the Pods directory, make sure to uncomment
# `pod install` in .travis.yml # `pod install` in .travis.yml
# #
# Pods/ Pods/
fastlane/* fastlane/*
...@@ -321,7 +321,7 @@ ...@@ -321,7 +321,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
680392E325EDB9514EAD7BF6 /* [CP] Copy Pods Resources */ = { 680392E325EDB9514EAD7BF6 /* [CP] Copy Pods Resources */ = {
...@@ -366,7 +366,7 @@ ...@@ -366,7 +366,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
B1BE839C8D7CB38052ED84D1 /* [CP] Copy Pods Resources */ = { B1BE839C8D7CB38052ED84D1 /* [CP] Copy Pods Resources */ = {
......
PODS: PODS:
- GMCache (0.1.1): - GMCache (0.1.1):
- TMCache (~> 2.1.0) - TMCache (~> 2.1.0)
- GMPhobos (0.3.2): - GMPhobos (0.3.3):
- GMCache (~> 0.1.1) - GMCache (~> 0.1.1)
- TMCache (2.1.0) - TMCache (2.1.0)
...@@ -14,9 +14,9 @@ EXTERNAL SOURCES: ...@@ -14,9 +14,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
GMCache: 73855b613b9d7e34f4f37ad425e8b8153b760c04 GMCache: 73855b613b9d7e34f4f37ad425e8b8153b760c04
GMPhobos: de44f32d6768d15eb6664f6236bb5fb72ac3e580 GMPhobos: b8da648592cbf48e28ba1b4b79beaead236eb31b
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
PODFILE CHECKSUM: 281ed5ce2f0e8e2e49cc13b1e4726e6686ac6095 PODFILE CHECKSUM: 281ed5ce2f0e8e2e49cc13b1e4726e6686ac6095
COCOAPODS: 1.2.0 COCOAPODS: 1.2.1
{ {
"name": "GMPhobos", "name": "GMPhobos",
"version": "0.3.2", "version": "0.3.3",
"summary": "GM statistic data sdk", "summary": "GM statistic data sdk",
"description": "GM event track sdk.", "description": "GM event track sdk.",
"homepage": "http://git.gengmei.cc/gengmeiios/GMPhobos", "homepage": "http://git.gengmei.cc/gengmeiios/GMPhobos",
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
}, },
"source": { "source": {
"git": "git@git.gengmei.cc:gengmeiios/GMPhobos.git", "git": "git@git.gengmei.cc:gengmeiios/GMPhobos.git",
"tag": "0.3.2" "tag": "0.3.3"
}, },
"platforms": { "platforms": {
"ios": "8.0" "ios": "8.0"
......
PODS: PODS:
- GMCache (0.1.1): - GMCache (0.1.1):
- TMCache (~> 2.1.0) - TMCache (~> 2.1.0)
- GMPhobos (0.3.2): - GMPhobos (0.3.3):
- GMCache (~> 0.1.1) - GMCache (~> 0.1.1)
- TMCache (2.1.0) - TMCache (2.1.0)
...@@ -14,9 +14,9 @@ EXTERNAL SOURCES: ...@@ -14,9 +14,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
GMCache: 73855b613b9d7e34f4f37ad425e8b8153b760c04 GMCache: 73855b613b9d7e34f4f37ad425e8b8153b760c04
GMPhobos: de44f32d6768d15eb6664f6236bb5fb72ac3e580 GMPhobos: b8da648592cbf48e28ba1b4b79beaead236eb31b
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
PODFILE CHECKSUM: 281ed5ce2f0e8e2e49cc13b1e4726e6686ac6095 PODFILE CHECKSUM: 281ed5ce2f0e8e2e49cc13b1e4726e6686ac6095
COCOAPODS: 1.2.0 COCOAPODS: 1.2.1
This diff is collapsed.
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#import "Phobos.h" #import "Phobos.h"
#import "PhobosConfig.h" #import "PhobosConfig.h"
#import "PhobosCustomVisibleController.h"
#import "PhobosPVProtocol.h" #import "PhobosPVProtocol.h"
#import "PhobosUtil.h" #import "PhobosUtil.h"
#import "UIResponder+PhobosPV.h" #import "UIResponder+PhobosPV.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.3.2</string> <string>0.3.3</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -21,6 +21,9 @@ case "${TARGETED_DEVICE_FAMILY}" in ...@@ -21,6 +21,9 @@ case "${TARGETED_DEVICE_FAMILY}" in
3) 3)
TARGET_DEVICE_ARGS="--target-device tv" TARGET_DEVICE_ARGS="--target-device tv"
;; ;;
4)
TARGET_DEVICE_ARGS="--target-device watch"
;;
*) *)
TARGET_DEVICE_ARGS="--target-device mac" TARGET_DEVICE_ARGS="--target-device mac"
;; ;;
......
...@@ -5,4 +5,5 @@ OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/GMCache/GMCac ...@@ -5,4 +5,5 @@ OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/GMCache/GMCac
OTHER_LDFLAGS = $(inherited) -framework "GMCache" -framework "GMPhobos" -framework "TMCache" OTHER_LDFLAGS = $(inherited) -framework "GMCache" -framework "GMPhobos" -framework "TMCache"
PODS_BUILD_DIR = $BUILD_DIR PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods PODS_ROOT = ${SRCROOT}/Pods
...@@ -5,4 +5,5 @@ OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/GMCache/GMCac ...@@ -5,4 +5,5 @@ OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/GMCache/GMCac
OTHER_LDFLAGS = $(inherited) -framework "GMCache" -framework "GMPhobos" -framework "TMCache" OTHER_LDFLAGS = $(inherited) -framework "GMCache" -framework "GMPhobos" -framework "TMCache"
PODS_BUILD_DIR = $BUILD_DIR PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods PODS_ROOT = ${SRCROOT}/Pods
...@@ -21,6 +21,9 @@ case "${TARGETED_DEVICE_FAMILY}" in ...@@ -21,6 +21,9 @@ case "${TARGETED_DEVICE_FAMILY}" in
3) 3)
TARGET_DEVICE_ARGS="--target-device tv" TARGET_DEVICE_ARGS="--target-device tv"
;; ;;
4)
TARGET_DEVICE_ARGS="--target-device watch"
;;
*) *)
TARGET_DEVICE_ARGS="--target-device mac" TARGET_DEVICE_ARGS="--target-device mac"
;; ;;
......
...@@ -4,4 +4,5 @@ LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_pa ...@@ -4,4 +4,5 @@ LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_pa
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/GMCache/GMCache.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GMPhobos/GMPhobos.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/TMCache/TMCache.framework/Headers" OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/GMCache/GMCache.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GMPhobos/GMPhobos.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/TMCache/TMCache.framework/Headers"
PODS_BUILD_DIR = $BUILD_DIR PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods PODS_ROOT = ${SRCROOT}/Pods
...@@ -4,4 +4,5 @@ LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_pa ...@@ -4,4 +4,5 @@ LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_pa
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/GMCache/GMCache.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GMPhobos/GMPhobos.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/TMCache/TMCache.framework/Headers" OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/GMCache/GMCache.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/GMPhobos/GMPhobos.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/TMCache/TMCache.framework/Headers"
PODS_BUILD_DIR = $BUILD_DIR PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods PODS_ROOT = ${SRCROOT}/Pods
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#import "PhobosConfig.h" #import "PhobosConfig.h"
#import "UIResponder+PhobosPV.h" #import "UIResponder+PhobosPV.h"
#import "PhobosUtil.h" #import "PhobosUtil.h"
#import "PhobosCustomVisibleController.h"
static Phobos *sharedClient = nil; static Phobos *sharedClient = nil;
static NSString *sdkVersion = @"110"; static NSString *sdkVersion = @"110";
...@@ -101,17 +102,20 @@ static NSString *sdkVersion = @"110"; ...@@ -101,17 +102,20 @@ static NSString *sdkVersion = @"110";
} }
- (UIViewController *)visibleController { - (UIViewController *)visibleController {
id visibleController = [UIApplication sharedApplication].keyWindow.rootViewController; id target = [UIApplication sharedApplication].keyWindow.rootViewController;
if ([visibleController isKindOfClass:[UITabBarController class]]) { if ([target isKindOfClass:[UITabBarController class]]) {
UITabBarController *tabbar = (UITabBarController *)visibleController; UITabBarController *tabbar = (UITabBarController *)target;
UINavigationController *navigationController = (UINavigationController *)tabbar.selectedViewController; UINavigationController *navigationController = (UINavigationController *)tabbar.selectedViewController;
return navigationController.visibleViewController; target = navigationController.visibleViewController;
} else if ([visibleController isKindOfClass:[UINavigationController class]]) { } else if ([target isKindOfClass:[UINavigationController class]]) {
UINavigationController *navigationController = (UINavigationController *)visibleController; UINavigationController *navigationController = (UINavigationController *)target;
return navigationController.visibleViewController; target = navigationController.visibleViewController;
} else {
return visibleController;
} }
if ([target conformsToProtocol:NSProtocolFromString(@"PhobosCustomVisibleController")]) {
target = [target performSelector:@selector(phobosVisibleController)];
}
return target;
} }
#pragma mark - notification handler #pragma mark - notification handler
......
//
// PhobosCustomVisibleController.h
// Pods
//
// Created by wangyang on 2017/4/27.
//
//
#import <Foundation/Foundation.h>
/**
containerController没有pageName,而是使用不同child的pageName,那么该controller需要挂载该协议以取得正确的visibleController
参考搜索页PV的记录
*/
@protocol PhobosCustomVisibleController <NSObject>
- (UIViewController *)phobosVisibleController;
@end
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