iOS SDK开发汇总
一、新建名称为JFSDKDemo的单控制器工程,设置最低系统版本号,设置目标设备。
二、新建名称为JFSDKFramework的静态库,具体为file—new—target—cocoatouch framework。设置最低系统版本号,设置目标设备


- (IBAction)pushXib:(UIButton *)sender {
SDKVCtest01 *vc = [[SDKVCtest01 alloc]init];
[self presentViewController:vc animated:YES completion:nil];
}
- (IBAction)pushStoryboard:(UIButton *)sender {
SDKVCtest02 *vc = [[SDKVCtest02 alloc]init];
[self presentViewController:vc animated:YES completion:nil];
}
三、bundle资源包:把静态库中的资源文件封装到bundle包中。资源文件包括图片、storyboard,xib文件、plist文件以及mp3等。

- (instancetype)init{
SDKVCtest01 *testVC = [[SDKVCtest01 alloc]initWithNibName:@"SDKVCtest01" bundle:[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"JFSDKSources" ofType:@"bundle"]]];
return testVC;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.view.backgroundColor = [UIColor whiteColor];
self.imageView1.image = [UIImage imageNamed:@"iconjf.png" inBundle:[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"JFSDKSources" ofType:@"bundle"]] compatibleWithTraitCollection:nil];
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
// Do any additional setup after loading the view.
self.imageView1.image = [UIImage imageNamed:@"iconjf.png" inBundle:[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"JFSDKSources" ofType:@"bundle"]] compatibleWithTraitCollection:nil];
}
- (instancetype)init{
SDKVCtest02 *testVC = [[UIStoryboard storyboardWithName:@"SDKVCtest02" bundle:[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"JFSDKSources" ofType:@"bundle"]]] instantiateViewControllerWithIdentifier:@"SDKVCTest02"];
return testVC;
}
四、新建aggregate:实现脚本合并静态库支持的设备,生成通用静态库。
FMK_NAME="JFSDKFramework"
# Install dir will be the final output to the framework.
# The following line create it in the root folder of the current project.
SDK_DIR=${SRCROOT}/Products/${FMK_NAME}
INSTALL_DIR=${SRCROOT}/Products/${FMK_NAME}/${FMK_NAME}.framework
# Working dir will be deleted after the framework creation.
WRK_DIR=build
DEVICE_DIR=${WRK_DIR}/Release-iphoneos/${FMK_NAME}.framework
SIMULATOR_DIR=${WRK_DIR}/Release-iphonesimulator/${FMK_NAME}.framework
# -configuration ${CONFIGURATION}
# Clean and Building both architectures.
xcodebuild -configuration "Release" -target "${FMK_NAME}" -sdk iphoneos
xcodebuild -configuration "Release" -target "${FMK_NAME}" -sdk iphonesimulator
# Cleaning the oldest.
if [ -d "${SDK_DIR}" ]
then
rm -rf "${SDK_DIR}"
fi
mkdir -p "${INSTALL_DIR}"
cp -R "${DEVICE_DIR}/" "${INSTALL_DIR}/"
# Uses the Lipo Tool to merge both binary files (i386 + armv6/armv7) into one Universal final product.
lipo -create "${DEVICE_DIR}/${FMK_NAME}" "${SIMULATOR_DIR}/${FMK_NAME}" -output "${INSTALL_DIR}/${FMK_NAME}"
rm -r "${WRK_DIR}"
#mv "${INSTALL_DIR}/${FMK_NAME}.bundle" "${SDK_DIR}"
open "${SDK_DIR}"
//图片
UIImage *image = [UIImage imageNamed:@"iconjf.png" inBundle:[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"JFSDKSources" ofType:@"bundle"]] compatibleWithTraitCollection:nil];
//storyboard
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"SDKVCtest02" bundle:[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"JFSDKSources" ofType:@"bundle"]]];
//xib
SDKVCtest01 *testVC = [[SDKVCtest01 alloc]initWithNibName:@"SDKVCtest01" bundle:[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"JFSDKSources" ofType:@"bundle"]]]; NSArray *array = [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"JFSDKSources" ofType:@"bundle"]] loadNibNamed:@"nibname" owner:nil options:nil];
//mp3
NSString *path = [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"JFSDKSources" ofType:@"bundle"]] pathForResource:@"test" ofType:@"mp3"]; NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: path];
//plist
NSString *filePath = [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"JFSDKSources" ofType:@"bundle"]] pathForResource: @"test" ofType: @"plist"];
NSDictionary *plistDic = [NSDictionary dictionaryWithContentsOfFile:filePath];
5、Build Active Architecture Only,设置为NO的时候,会编译支持的所有的版本;设置为YES的时候,是为Debug的时候速度更快,它只编译当前的architecture 版本
iOS SDK开发汇总的更多相关文章
- ios项目开发汇总
UI界面 iOS和Android 界面设计尺寸规范 http://www.alibuybuy.com/posts/85486.html iPhone app界面设计尺寸规范 http://www. ...
- 转载-iOS SDK开发
最近帮兄弟公司的做支付业务sdk,积累了 sdk 封装的经验!下面我会从零开始把我的 sdk 封装和调试经历分享给大家,希望能给看到这篇文章的人有所帮助! 本文我会从以下几个方面来讲述: Framew ...
- 【转】使用Xcode中的iOS SDK给iphone开发出第一个App程序
之前已经折腾过用Xcode开发OS X的程序了,现在继续折腾,用iOS SDK开发移动设备(iphone/ipad/ipod touch)的程序. 1.从iOS Developer Library中找 ...
- XE6移动开发环境搭建之IOS篇(9):配置XE6的IOS SDK(有图有真相)
网上能找到的关于Delphi XE系列的移动开发环境的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 1.开启PAServ ...
- 百度VS高德:LBS开发平台ios SDK对比评测
随着iPhone6手机的热销,目前的iOS应用开发市场也迎来了全盛时期.据了解,目前市面上已有的iOS应用基本覆盖了购物.上门服务.用车服务.娱乐等行业.而在这些iOS应用中,内置LBS服务的应用占大 ...
- 【视频教学】如何利用高德地图IOS SDK进行开发?
Step1:使用IOS SDK可以做什么高德地图 iOS SDK 是一套基于 iOS 5.1.1 及以上版本的地图应用程序开发接口.通过该接口,用户可使用高德地图数据和服务轻松构建功能丰富.交互性强的 ...
- iOS开发之引用百度地图SDK(一)-----------SDK开发指南
(void)viewWillAppear:(BOOL)animated { [_mapView viewWillAppear]; _mapView.delegate = self; // 此处记得不用 ...
- 浅谈iOS视频开发
浅谈iOS视频开发 这段时间对视频开发进行了一些了解,在这里和大家分享一下我自己觉得学习步骤和资料,希望对那些对视频感兴趣的朋友有些帮助. 一.iOS系统自带播放器 要了解iOS视频开发,首先我们从 ...
- iOS 学习资料汇总
(适合初学者入门) 本文资料来源于GitHub 一.视频教程(英文) Developing iOS 7 Apps for iPhone and iPad斯坦福开放教程之一, 课程主要讲解了一些 iOS ...
随机推荐
- Paper | Batch Normalization
目录 1. PROBLEM 1.1. Introduction 1.2. Analysis 2. SOLUTION 2.1. Batch Normalization 及其问题 2.2. 梯度修正及其问 ...
- 前端之html表单
html表单 用于搜集不同类型的用户输入 表单由不同类型的标签组成 1.<form>标签 定义整体的表单区域 * action属性 定义表单数据提交地址 * metho ...
- windows基于vs2017的opencv安装
1.opencv下载与安装 1.下载地址:官网下载地址https://opencv.org/releases.html opencv为开源软件,可直接在官网下载最新版本. 2.软件安装:openc ...
- git 删除本地分支、远程分支、本地回滚、远程回滚
一. git 删除分支 1. git 删除本地分支 git branch -D branchname 2. git 删除远程分支 git push origin :branchname (origin ...
- Real World Parsec --- 一个简便易学的 解释器
学习链接如下: http://bms.tratao.com/desktop/doc/0c3802e4ee404a71407f34996eff98ef 另外的解析器 ANTLR,学过一阵子,比较难,没应 ...
- 微服务ServiceMesh及三种模式介绍
1. 前言 今年,ServiceMesh(服务网格)概念在社区里头非常火,有人提出2018年是ServiceMesh年,还有人提出ServiceMesh是下一代的微服务架构基础.作为架构师,如果你现在 ...
- [UWP]在UWP平台中使用Lottie动画
最近QQ影音久违的更新了,因为记得QQ影音之前体验还算不错(FFmepg的事另说),我也第一时间去官网下载体验了一下,结果发现一些有趣的事情. 是的,你没看错,QQ影音主界面上这个动画效果是使用Lot ...
- poj1149构图题
引题解: 这道题目的大意是这样的:⦁ 有 M 个猪圈(M ≤ 1000),每个猪圈里初始时有若干头猪.⦁ 一开始所有猪圈都是关闭的.⦁ 依次来了 N 个顾客(N ≤ 100),每个顾客分别会打开指定 ...
- struts2框架学习笔记7:struts2标签
三大标签: 1.JSP:脚本,为了替代servlet,已过时 2.JSTL:标准标签库(core.format.sql.xml),还未淘汰的只有core库 3.Struts2标签库:由Struts2开 ...
- sublime text 3中安装ctags支持函数跳转,安装convertToUtf8支持中文步骤[工具篇]
sublime text x是个很不错的编辑器,但是各种插件都需要自己安装,有时也有点不方便,尤其是自己还不不知道怎么安装的时候.开发中经常用到的,函数跳转,就是一个比较难安装的东西,记录如下(系统为 ...