Skip to content

Commit

Permalink
modification
Browse files Browse the repository at this point in the history
  • Loading branch information
casatwy committed Aug 24, 2018
1 parent 27c4027 commit f3cf066
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 45 deletions.
72 changes: 47 additions & 25 deletions MainProject.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
4A510BB81DFB91B0005B9DB9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4A510BB71DFB91B0005B9DB9 /* Assets.xcassets */; };
4A510BBB1DFB91B0005B9DB9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4A510BB91DFB91B0005B9DB9 /* LaunchScreen.storyboard */; };
4A510BC91DFB925E005B9DB9 /* BViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A510BC81DFB925E005B9DB9 /* BViewController.m */; };
659621CADA0A93D59DD76310 /* libPods-MainProject.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BC0B2024D7061067AECDBCA4 /* libPods-MainProject.a */; };
BE99CFD91528A7C5FC4E5535 /* Pods_MainProject.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF487BF666A511CCE0D1BDDE /* Pods_MainProject.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -35,15 +35,15 @@
4A510BBC1DFB91B0005B9DB9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4A510BC71DFB925E005B9DB9 /* BViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BViewController.h; sourceTree = "<group>"; };
4A510BC81DFB925E005B9DB9 /* BViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BViewController.m; sourceTree = "<group>"; };
BC0B2024D7061067AECDBCA4 /* libPods-MainProject.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-MainProject.a"; sourceTree = BUILT_PRODUCTS_DIR; };
BF487BF666A511CCE0D1BDDE /* Pods_MainProject.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MainProject.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
4A510BA51DFB91AF005B9DB9 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
659621CADA0A93D59DD76310 /* libPods-MainProject.a in Frameworks */,
BE99CFD91528A7C5FC4E5535 /* Pods_MainProject.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -124,7 +124,7 @@
FF6B7731E91A54EFFFEB8C06 /* Frameworks */ = {
isa = PBXGroup;
children = (
BC0B2024D7061067AECDBCA4 /* libPods-MainProject.a */,
BF487BF666A511CCE0D1BDDE /* Pods_MainProject.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -140,8 +140,7 @@
4A510BA41DFB91AF005B9DB9 /* Sources */,
4A510BA51DFB91AF005B9DB9 /* Frameworks */,
4A510BA61DFB91AF005B9DB9 /* Resources */,
F03BBC448BC84BE066021C1C /* [CP] Embed Pods Frameworks */,
BF6D1512E93C218936BD9A05 /* [CP] Copy Pods Resources */,
594378B4621C36D1312A4E3C /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand All @@ -158,7 +157,7 @@
4A510BA01DFB91AF005B9DB9 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0810;
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = casa;
TargetAttributes = {
4A510BA71DFB91AF005B9DB9 = {
Expand Down Expand Up @@ -205,43 +204,46 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-MainProject-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
BF6D1512E93C218936BD9A05 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-MainProject/Pods-MainProject-resources.sh\"\n";
showEnvVarsInLog = 0;
};
F03BBC448BC84BE066021C1C /* [CP] Embed Pods Frameworks */ = {
594378B4621C36D1312A4E3C /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MainProject/Pods-MainProject-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/A/A.framework",
"${BUILT_PRODUCTS_DIR}/A_Category/A_Category.framework",
"${BUILT_PRODUCTS_DIR}/A_Extension/A_Extension.framework",
"${BUILT_PRODUCTS_DIR}/A_swift/A_swift.framework",
"${BUILT_PRODUCTS_DIR}/B_Category/B_Category.framework",
"${BUILT_PRODUCTS_DIR}/CTMediator/CTMediator.framework",
"${BUILT_PRODUCTS_DIR}/HandyFrame/HandyFrame.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/A.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/A_Category.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/A_Extension.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/A_swift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/B_Category.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CTMediator.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HandyFrame.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-MainProject/Pods-MainProject-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MainProject/Pods-MainProject-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -290,15 +292,24 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -338,15 +349,24 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -375,6 +395,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 4732F0A38173004B46459775 /* Pods-MainProject.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = MainProject/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -387,6 +408,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 4003BDE36800E7259021C8F5 /* Pods-MainProject.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = MainProject/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>MainProject.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>6</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
Expand Down
88 changes: 72 additions & 16 deletions MainProject/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@

#import "ViewController.h"
#import <HandyFrame/UIView+LayoutMethods.h>
#import <CTMediator/CTMediator.h>
#import <A_Category/CTMediator+A.h>
#import <A_Extension/A_Extension-Swift.h>

@interface ViewController ()
@interface ViewController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UIButton *pushAViewControllerButton;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSArray *dataSource;

@end

Expand All @@ -22,34 +25,87 @@ @implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self.view addSubview:self.pushAViewControllerButton];
[self.view addSubview:self.tableView];
}

- (void)viewWillLayoutSubviews
{
[super viewWillLayoutSubviews];
[self.tableView fill];
}

#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.dataSource.count;
}

[self.pushAViewControllerButton sizeToFit];
[self.pushAViewControllerButton centerEqualToView:self.view];
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
return [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
}

#pragma mark - UITableViewDelegate
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
cell.textLabel.text = self.dataSource[indexPath.row];
}

#pragma mark - event response
- (void)didTappedPushAViewControllerButton:(UIButton *)button
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UIViewController *viewController = [[CTMediator sharedInstance] A_aViewController];
[self.navigationController pushViewController:viewController animated:YES];
if (indexPath.row == 0) {
// Objective-C -> Category -> Objective-C
UIViewController *viewController = [[CTMediator sharedInstance] A_Category_Objc_ViewControllerWithCallback:^(NSString *result) {
NSLog(@"%@", result);
}];
[self.navigationController pushViewController:viewController animated:YES];
}
if (indexPath.row == 1) {
// Objective-C -> Category -> Swift
UIViewController *viewController = [[CTMediator sharedInstance] A_Category_Swift_ViewControllerWithCallback:^(NSString *result) {
NSLog(@"%@", result);
}];
[self.navigationController pushViewController:viewController animated:YES];
}
if (indexPath.row == 2) {
// Objective-C -> Extension -> Objective-C
UIViewController *viewController = [[CTMediator sharedInstance] A_showObjcWithCallback:^(NSString * _Nonnull result) {
NSLog(@"%@", result);
}];
[self.navigationController pushViewController:viewController animated:YES];
}
if (indexPath.row == 3) {
// Objective-C -> Extension -> Swift
UIViewController *viewController = [[CTMediator sharedInstance] A_showSwiftWithCallback:^(NSString * _Nonnull result) {
NSLog(@"%@", result);
}];
[self.navigationController pushViewController:viewController animated:YES];
}
}

#pragma mark - getters and setters
- (UIButton *)pushAViewControllerButton
- (UITableView *)tableView
{
if (_tableView == nil) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
_tableView.delegate = self;
_tableView.dataSource = self;
[_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
}
return _tableView;
}

- (NSArray *)dataSource
{
if (_pushAViewControllerButton == nil) {
_pushAViewControllerButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_pushAViewControllerButton setTitle:@"push A view controller" forState:UIControlStateNormal];
[_pushAViewControllerButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
[_pushAViewControllerButton addTarget:self action:@selector(didTappedPushAViewControllerButton:) forControlEvents:UIControlEventTouchUpInside];
if (_dataSource == nil) {
_dataSource = @[
@"Objective-C -> Category -> Objective-C",
@"Objective-C -> Category -> Swift",
@"Objective-C -> Extension -> Objective-C",
@"Objective-C -> Extension -> Swift",
];
}
return _pushAViewControllerButton;
return _dataSource;
}

@end
9 changes: 6 additions & 3 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ source 'https://github.com/CocoaPods/Specs.git'

target 'MainProject' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
use_frameworks!
use_modular_headers!
#
pod 'A_Category'

# Private Pods
pod 'A_Extension'
pod 'HandyFrame'
pod 'A'
pod 'A_swift'
pod 'CTMediator'

end

0 comments on commit f3cf066

Please sign in to comment.