Skip to content

Instantly share code, notes, and snippets.

View zhangkn's full-sized avatar
❣️
https://kunnan.blog.csdn.net/

公众号:iOS逆向 zhangkn

❣️
https://kunnan.blog.csdn.net/
View GitHub Profile
@zhangkn
zhangkn / exitStaticLib.m
Created April 25, 2018 11:28
iOS判断当前ViewController是push还是present方式显示的
- (void)exit{
// NSLog(@"presentingViewController :%@",self.presentingViewController);
//iOS判断当前ViewController是push还是present方式显示的
if (self.presentingViewController) {
[self dismissViewControllerAnimated:YES completion:nil];
@zhangkn
zhangkn / lipo.sh
Created April 25, 2018 11:55
lipo -create,合并.a文件
#!/bin/bash
#用lipo合并模拟器Framework与真机Framework
DATE=$(date +%Y%m%d-%T)
mkdir -p /Users/devzkn/Desktop/lib/lib_$DATE/lib_real_iphonesimulator
#合并文件
lipo -create /Users/devzkn/Library/Developer/Xcode/DerivedData/iPos-bzjkdluhflvvnmgjldfubxpmrdrj/Build/Products/Debug-iphoneos/libiPxxxosLib.a /Users/devzkn/Library/Developer/Xcode/DerivedData/iPos-bzjkdluhflvvnmgjldfubxpmrdrj/Build/Products/Debug-iphonesimulator/libiPxxxosLib.a -output /Users/devzkn/Desktop/lib/lib_$DATE/lib_real_iphonesimulator/libiPxxxxosLib.a
#rm -r /Users/devzkn/Desktop/lib/
@zhangkn
zhangkn / KNCocoaTouchStaticLibrary.podspec
Created April 25, 2018 13:10
pod spec create KNCocoaTouchStaticLibrary
#
# Be sure to run `pod spec lint KNCocoaTouchStaticLibrary.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#
Pod::Spec.new do |s|
@zhangkn
zhangkn / .gitignore
Created April 26, 2018 03:58
The Pod Lib Create Template
# OS X
.DS_Store
# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
@zhangkn
zhangkn / KNResourceTool.m
Last active April 26, 2018 10:09
需要带上 .bundle 文件的路径,获取图片
#define MYBUNDLE_NAME @"KNPodlib.bundle"
//#define MYBUNDLE_PATH [[NSBundle bundleForClass:NSClassFromString(@"Const")].resourcePath stringByAppendingPathComponent:MYBUNDLE_NAME]
#define MYBUNDLE_PATH [[NSBundle bundleForClass:[self class]].resourcePath stringByAppendingPathComponent:MYBUNDLE_NAME]
#define mainBundle_PATH [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent: MYBUNDLE_NAME]
#define knmainBundle [NSBundle bundleWithPath: mainBundle_PATH]
#define knpngBUNDLE [NSBundle bundleWithPath: MYBUNDLE_PATH]
@zhangkn
zhangkn / KNPodlib.podspec.json
Created April 27, 2018 02:40
KNPodlib Improve feedback interface and customize webview functionality
{
"name": "KNPodlib",
"version": "0.1.3",
"summary": "KNPodlib Improve feedback interface and customize webview functionality",
"description": "TODO: Add long description of the pod here.",
"homepage": "https://github.com/zhangkn/KNPodlib",
"license": {
"type": "MIT",
"file": "LICENSE"
},
@zhangkn
zhangkn / trunkMe.md
Last active April 27, 2018 02:53
pod trunk me
@zhangkn
zhangkn / podPackage.md
Created April 27, 2018 05:55
Package a podspec into a static library.

Options:

--force                                                         Overwrite existing
                                                                files.
--no-mangle                                                     Do not mangle
                                                                symbols of
                                                                depedendant Pods.
--embedded                                                      Generate embedded
                                                                frameworks.

--library Generate static

@zhangkn
zhangkn / NOPodpackageTree.md
Created April 27, 2018 06:06
没有执行打包类库这个步骤,直接deploy to the public的效果

├── Podfile ├── Podfile.lock ├── Pods │   ├── Headers │   ├── KNPodlib │   │   ├── Assets │   │   │   ├── deleteX.png │   │   │   ├── hebaoGrayPoint.png │   │   │   ├── hebaoWhitePoint.png │   │   │   └── store_add.png

@zhangkn
zhangkn / knxcodeipa.sh
Created May 2, 2018 03:51
xcodebuild -exportArchive
function knxcodeipa() {
echo "**************************开始导出ipa文件....*********************************"
# Xcode9需要加上 -allowProvisioningUpdates
xcodebuild -exportArchive \
-archivePath ${export_archive_path} \
-exportPath ${export_ipa_path} \
-exportOptionsPlist ${ExportOptionsPlistPath} \
-allowProvisioningUpdates