自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

jichw的专栏

不忘初心,方得始终。

  • 博客(157)
  • 资源 (17)
  • 收藏
  • 关注

原创 使用Carthage 错误 xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH

xcrun: error: unable to find utility “xcodebuild”, not a developer tool or in PATHhttps://stackoverflow.com/questions/40743713/command-line-tool-error-xcrun-error-unable-to-find-utility-xcodebui...

2018-04-26 09:30:20 1929

原创 DZNEmptyDataSet 在Swift4.1 中使用

特点效果图使用方法DZNEmptyDataSet协议DZNEmptyDataSetSource设置默认空白界面处理视图的标题title.设置默认空白界面处理视图的描述description文本。设置默认空白界面布局的图片。设置默认空白界面布局图片的前景色,默认为nil.设置默认空白界面图片的动画效果。设置默认空白界面响应按钮的标题,通常我们可以设置为”重新加载”等文本。...

2018-04-26 09:27:00 2945

原创 CocoaPods 出现 Unable to find a pod with name, author, summary, or description matching

其他问题[!] Unable to find a pod with name, author, summary, or description matching `AF`执行 pod setup 其实在你安装 CocoaPods 执行 pod install 时,系统会默认操作 pod setup ,然而由于墙可能会 pod setup 不成功。这时就需要手动执行 po...

2018-04-26 09:24:42 12687

原创 oh-my-zsh终端用户名设置(PS1)

zsh安装,参考 oh-my-zsh默认的 PS1 为PS1='[\u@\h \w]\$' 网上对这个的处理大多是打开.bashrc然后修改PS1或者重新定义修改PS1 但 oh-my-zsh 的 shell 是 zsh,明显不能在 .bashrc 中改不信可以在终端输入echo $PS1或者echo $PROMPT可以看到其定义为...

2018-04-26 09:22:35 13497 1

原创 Swift条件判断中逗号的使用方法示例

在Swift语言中,Bool 值是用来进行条件判断的,可以进行 && 以及 || 的操作,从而实现多个表达式共同判断。但是由于Swift中存在可选项绑定,或者说是用 let 展开可选项的原因,有些地方条件判断中不能够使用 && 来进行处理。比如,我们要在变量 hasValue 确实有值,且参数个数 paramCount 大于 0 的时候,执行代码,一般我们可以这...

2018-04-26 09:19:44 750

原创 iOS获取设备型号和App版本号等信息(OC & Swift)

获取设备名称OC代码NSString *deviceName = [[UIDevice currentDevice] name];Swift代码let deviceName = UIDevice.currentDevice().name获取系统版本号OC代码NSString *sysVersion = [[UIDevice currentDevice...

2018-04-26 09:16:15 1745

原创 Swift - typealias

typealias用来为已存在的类型重新定义名称的。通过命名,可以使代码变得更加清晰。使用的语法也很简单,使用 typealias 关键字像普通的赋值语句一样,可以将某个在已经存在的类型赋值为新的名字。重新定义闭包类型或者说 block Swift的闭包书写虽然好看了不少,但是如果大批量的书写闭包还是很累的而且还影响可读性和美观,所以不妨试试 typealias。// 声...

2018-04-26 09:14:19 3515

原创 Linux Cmake源码安装

这里下载Cmake源码这里下载的是cmake-3.5.2.tar.gztar -xzvf cmake-3.5.2.tar.gzcd cmake-3.5.2然后执行./bootstrapmakemake installcmake 会默认安装在 /usr/local/bin 下面

2016-04-25 16:40:26 2625

原创 Linux LAMP 之 mysql源码安装

mysql-5.6.28.tar.gz 在这里下载该源码使用Cmake 安装Cmake 安装传送门安装脚本tar xvzf mysql-5.6.28.tar.gz cd mysql-5.6.28cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/cp-mysql-5.6.28 -DMYSQL_DATADIR=/usr/local/cp-mysql-5.6.28/

2016-04-25 16:22:04 440

原创 Linux tar

# tar -cvf /usr/local/auto_bak/test.tar /usr/local/test仅打包,不压缩 # tar -zcvf /usr/local/auto_bak/test.tar.gz /usr/local/test打包后,以gzip压缩 在参数f后面的压缩文件名是自己取的,习惯上用tar来做,如果加z参数,则以tar.gz 或tgz来代表gzip压缩过的tar file

2016-04-25 16:14:03 382

原创 Linux rzsz上传与下载

安装yum install lrzsz

2016-04-25 15:33:45 1331

原创 iOS应用程序生命周期

iOS的应用程序的生命周期,还有程序是运行在前台还是后台,应用程序各个状态的变换,这些对于开发者来说都是很重要的。 iOS系统的资源是有限的,应用程序在前台和在后台的状态是不一样的。在后台时,程序会受到系统的很多限制,这样可以提高电池的使用和用户体验。 开发app,我们要遵循apple公司的一些指导原则,原则如下:1、应用程序的状态状态如下: code 状态 说明 Not runni

2016-03-14 15:16:58 403

原创 iOS-UIWebView

关于UIWebView的一些事传送门1.禁止UIWebView有拖动惯性[(UIScrollView *)[[self.webView subviews] objectAtIndex:0] setBounces:NO];以下适用于iOS5.0以上[detailPaperWebView.scrollView setBounces:NO];2.设置UIWebView是按 WebView自适应大小显示,还

2016-03-14 14:24:33 512

原创 iOS多线程GCD

Grand Central Dispatch (GCD)是Apple开发的一个多核编程的解决方法。dispatch queue分成以下三种:1)运行在主线程的Main queue,通过dispatch_get_main_queue获取。/*!* @function dispatch_get_main_queue** @abstract* Returns the default queue t

2016-03-14 13:39:36 382

原创 UITableViewCell的选中时的颜色设置

1.系统默认的颜色设置//无色 cell.selectionStyle = UITableViewCellSelectionStyleNone; //蓝色 cell.selectionStyle = UITableViewCellSelectionStyleBlue; //灰色 cell.selectionStyle = UITableViewCellSelectionStyleGr

2016-03-14 13:29:42 590

原创 CocoaPods安装和使用教程

pod install --verbose --no-repo-updatepod update --verbose --no-repo-updateCocoaPods是什么?当你开发iOS应用时,会经常使用到很多第三方开源类库,比如JSONKit,AFNetWorking等等。可能某个类库又用到其他类库,所以要使用它,必须得另外下载其他类库,而其他类库又用到其他类库,“子子孙孙无穷尽也”,这也许

2016-03-04 17:12:54 399

原创 iOS消息推送

转自丰俊文的博客经常有同学问我们,iOS上推送究竟怎么做啊,为什么我的设备总收不到推送呢,这里跟大家集中讨论一下iOS上推送的实现细节。APNS的推送机制与Android上我们自己实现的推送服务不一样,Apple对设备的控制非常严格,消息推送的流程必须要经过APNs: 这里 Provider 是指某个应用的Developer,当然如果开发者使用AVOS Cloud的服务,把发送消息的请求委托给

2016-03-04 16:36:41 677

原创 统计Crash的工具Crashlytics

转自:http://www.infoq.com/cn/articles/crashlytics-crash-statistics-tools简介Crashlytic 成立于2011年,是专门为移动应用开者发提供的保存和分析应用崩溃信息的工具。Crashlytics的使用者包括:支付工具Paypal, 点评应用Yelp, 照片分享应用Path, 团购应用GroupOn等移动应用。 2013年1月,C

2016-03-04 16:21:19 525

原创 iOS获取当前地理位置文本

以下内容摘抄自网络,著作权属于原作者方法1:使用ios自带联网查询功能断网会报 PBRequester failed with Error Error Domain=NSURLErrorDomain Code=-1009 “似乎已断开与互联网的连接。” UserInfo=0x1e2ea840 {NSErrorFailingURLStringKey=https://gsp4-cn.ls.apple.

2016-03-04 16:10:13 468

原创 正则表达式说明

匹配模式匹配模式指得是正则表达式引擎将以何种模式匹配字符串。 模式名称 启用,禁用 缺省启用 说明 UNIX_LINES (?d)启用,(?-d)禁用 是 启用Unix行模式。在此模式下,只有 ‘\n’被认为是行结束符。它会影响., ^, 和 $ 的行为。 CASE_INSENSITIVE (?i)启用,(?-i)禁用 否 启用忽略大小写模式。缺省时,忽

2016-03-04 16:02:25 442

原创 iOS开发资源汇总

如何用Facebook graphic api上传视频:http://developers.facebook.com/blog/post/532/Keychain保存数据封装:https://github.com/carlbrown/PDKeychainBindingsController对焦功能的实现:http://www.clingmarks.com/?p=612自定义圆角Switch按件:ht

2016-03-04 14:56:28 665

原创 AutoLayout 中使用 UIScrollView (多个ContentView)

原文链接http://codehappily.wordpress.com/2013/11/14/ios-how-to-use-uiscrollview-with-autolayout-pure-autolayout-approach-multiple-smaller-views/ 本帖演示如何在AutoLayout 下使用 UIScrollView 。在ScrollView 中还会包含多个子视图

2016-03-04 14:37:11 318

原创 tableView:cellForRowAtIndexPath:

通常在创建完UITableViewController后,会看到UITableViewDataSource的一个实现函数如下- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier

2016-03-04 14:33:07 808

原创 CentOs上搭建git服务器

首先安装setuptoolswget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gztar zxvf setuptools-0.6c11.tar.gzcd setuptools-0.6c11python setup.py buildpython setup.py install在服务

2016-03-04 14:29:31 460

原创 SQLite学习资源

SQLite 教程

2016-03-04 14:17:51 415

原创 iOS数组按中文关键字以字母序排序

iOS数组按中文关键字以字母序排序iOS项目中会用到对通讯录的联系人或是会员按姓名为关键字排序,因为NSArray并不直接支持对汉字的排序,这就要通过将汉字转换成拼音完成按A~Z的排序,这看起来是个头疼的问题,因为牵扯到汉字转为拼音,kmyhy给出一个较易实现的方法,获取汉字的首字的首字母,如将“王”变成“W”,完整文章(传送门)。 其中他通过pinyinFirstLetter函数获取中文拼音,函

2016-03-04 14:14:55 732

原创 iOS 中修改导航默认标题颜色、字体

self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor], NSForegroundColorAttributeName : [UIFont boldSystemFontOfSize:18]};self.navigation

2015-03-24 17:54:56 758

原创 iOS UICollectionView

UICollectionView基础初始化部分:UICollectionViewFlowLayout *flowLayout= [[UICollectionViewFlowLayout alloc]init];self.myCollectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(20, 20, 250, 350) co

2015-03-24 15:00:38 1271

原创 iOS CocoaPods pod install/pod update更新慢的问题

最近使用CocoaPods来添加第三方类库,无论是执行pod install还是pod update都卡在了Analyzing dependencies不动 原因在于当执行以上两个命令的时候会升级CocoaPods的spec仓库,加一个参数可以省略这一步,然后速度就会提升不少。加参数的命令如下:pod install --verbose --no-repo-updatepod update --

2015-03-18 13:22:08 889

原创 iOS 开发者必不可少的75个工具

原文出处: Ben Scheirman 译文出处: Njuxjy如果你去到一位熟练的木匠的工作室,你总是能发现他/她有一堆工具来完成不同的任务。软件开发同样如此。你可以从软件开发者如何使用工具中看出他水准如何。有经验的开发者精于使用工具。对你目前所使用的工具不断研究,同时了解一些替代品的使用,当你目前所用的工具无法满足你的需要时可以填补空缺。记住了这些,我将向你展示一份关于各种工具的长长的列表。其

2015-03-14 22:51:57 1086

原创 iOS 多线程编程之Grand Central Dispatch(GCD)

介绍:Grand Central Dispatch 简称(GCD)是苹果公司开发的技术,以优化的应用程序支持多核心处理器和其他的对称多处理系统的系统。这建立在任务并行执行的线程池模式的基础上的。它首次发布在Mac OS X 10.6 ,iOS 4及以上也可用。设计:GCD的工作原理是:让程序平行排队的特定任务,根据可用的处理资源,安排他们在任何可用的处理器核心上执行任务。一个任务可以是一个函数(fu

2015-03-13 16:07:15 735

原创 iOS 2015年3月苹果新的审核标准(中文)

请阅读以下许可协议的条款和条件之前仔细下载或使用Apple软件。这些条款和条件构成了您与苹果的法律协议。iOS开发者计划许可协议目的你想用苹果软件(定义见下文)制定的一个或多个应用程序(定义见​​下文),运行iOS和OS关注的苹果品牌产品。苹果愿意给你一个有限的许可使用苹果软件开发和对本协议规定的条款和条件,测试应用程序。本协议项下开发的应用程序可以分布在四个方面:(1)通过App Store,如果

2015-03-11 18:12:58 7507

原创 iOS UITableView简单用法

ViewController.h代码:#import <UIKit/UIKit.h>@interface ViewController : UIViewController<UITableViewDataSource,UITableViewDelegate>@property (nonatomic, retain) NSArray *dataList;@end ViewController.

2015-03-11 15:22:07 539

原创 iOS 清空缓存(递归计算沙盒目录大小)

简单代码://// ViewController.m// sandBoxSize//// Created by Brother on 15/2/10.// Copyright (c) 2015年 com.ccloveyy. All rights reserved.//#import "ViewController.h"@interface ViewController ()@en

2015-03-11 15:18:13 1499

原创 iOS 打开系统相册和使用相机

使用相机 添加系统相册照片 ViewController.h代码:#import <UIKit/UIKit.h>@interface ViewController : UIViewController<UITextViewDelegate,UIActionSheetDelegate,UINavigationControllerDelegate,UIImagePickerController

2015-03-11 15:12:08 2269

原创 iOS 滚动视图

实现一个UIScrollView 上的滚动视图未实现自动滚动 ViewController.h代码:#import <UIKit/UIKit.h>@interface ViewController : UIViewController<UIScrollViewDelegate>{ UIScrollView *_scrollView; NSMutableArray *slideI

2015-03-11 15:09:14 733

原创 iOS 地图(Map)与地理信息反编码

首先导入CoreLocation.framework ViewController.h#import <UIKit/UIKit.h>#import <CoreLocation/CoreLocation.h>#import <corelocation/CLLocationManagerDelegate.h>@interface ViewController : UIViewControlle

2015-03-11 14:49:11 767

原创 iOS 捕获长按事件,跟踪滑动轨迹

ViewController.m代码:#import "ViewController.h"@interface ViewController (){ UIView *touchView;}@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // Do any addi

2015-03-11 14:39:33 3127

原创 iOS 判断网络类型(3G,4G,Wi-Fi)

简单快捷的判断网络类型 ViewController.m代码:#import "ViewController.h"@interface ViewController ()@end@implementation ViewControllertypedef enum { NETWORK_TYPE_NONE= 0, NETWORK_TYPE_2G= 1, NETWORK_T

2015-03-11 14:36:21 1557

原创 iOS 苹果官方文档

苹果中国 提交App Store审批文档说明:App Store Review Guidelines iOS开发者文档:iOS Developer Library 注释书写规范说明:HeaderDoc User Guide iOS 人机交互指南: UI Design Basics iOS 7人机交互指南译文汇总 IconHandBook

2015-03-11 13:57:02 956

iOS 手势密码 源码

iOS 手势密码 源码 纯代码 页面切换 适配 仍有一些未完成的bug 基本功能实现了

2015-03-11

xz-5.2.2.tar.gz源码

xz-5.2.2.tar.gz 安装源码

2016-04-26

4s~6plus 代码适配 仅供参考

4s~6plus 代码适配(非xib) 仅供参考 详细说明 看一下代码内注释,用用就习惯了

2015-03-11

类似美团的下拉菜单

ios 纯代码 源码 美团 下拉菜单 只有下拉菜单。简单源码分享

2015-03-11

开源中国 完整客户端 源码

开源中国 iOS 客户端完整源码,Github 不断维护中的项目 欢迎下载参考

2015-03-11

iOS-2048-master

2048游戏源码 # 2048 This is a derivative and the iOS version of the game 2048. In the very unlikely case that you don't know what it is, you can check it out [here](https://github.com/gabrielecirulli/2048). Made just for fun! You can find it on the [App Store](https://itunes.apple.com/us/app/2048-and-more!/id848859070?ls=1&mt=8). <p align="center"> <img src="http://a4.mzstatic.com/us/r30/Purple4/v4/a4/f8/af/a4f8af1d-3878-0817-859d-de76bae169c7/screen568x568.jpeg" alt="Screenshot"/> </p> ## AI An AI is added, thanks to [DJBen](https://github.com/DJBen)! Tap "Hint" to show hint (e.g. Move left/right/up/down); tap "Auto Run" to run AI automatically. Check it out in the `AI` branch. You can also check out [this demo video on YouTube](https://www.youtube.com/watch?v=GF0ANNPpF8E). Thanks to [ov3y](https://github.com/ov3y/2048-AI)'s Javascript version that gave me (DJBen, that is) inspiration. ### Issues and pending improvements Currently the searching depth is 2 and it fails sometimes. You can increase the number to 3 or more by changing the return value of `- (NSInteger)maximumSearchingDepth` in `M2GlobalState+AI.h`. Ideally, the AI should search from 0 depth to infinity and have a time out, it records the current best move when finish searching the current depth and stops immediately when timed out and return the best move so far. However, I have a little bit of trouble when dealing with `NSOperationQueue` so I didn't do it this way. Now the AI only searches at the specified `-maximumSearchingDepth`. ## The Game Since it is a *derivative* of the original 2048, it is not the *same*. More explicitly, it has the following additions: * **Three board sizes**: 3x3, 4x4 and 5x5. The smaller the board is, the fewer cells you have, and the harder the game is.* * **Three game modes**: The original Power of 2, i.e. combining two tiles of the same value to produce their sum. The Power of 3, i.e. combining *three* consecutive tiles of the same value to produce their sum. Not surprisingly, this is pretty hard with the 3x3 board, although I found it pretty easy to get 81. 243 is a different story... And the Fibonacci sequence, i.e. combining two adjacent numbers in the sequence 2, 3, 5, 8, 13... (I omitted the two 1's in the beginning) to produce the one next to the larger value. This is pretty tricky. Try it out and you will know what I mean. * **Three themes**: I made a bright theme and a 'joyful' theme in addition to the original one. In case you wonder how to do themes in iOS. (There may be a better way, but themes are verbose in nature, because you *have to* specify all the colors, fonts, etc.) ## The Technology This version of 2048 is built using SpriteKit, the new 2-D game engine Apple introduced to iOS 7. As a result, it requires iOS 7 to run. On the other hand, this app has the following two great properties: * It does not rely on *any* third-party library. Not that Cocos-2D is not great, but the fact it's using SpriteKit means that it does not have any dependencies. * It does not have any images. That's right. The entire UI is done either via UIKit, or by Core Graphics. Check out the related files to see how that is done, if you are curious. You should be able to download the source, and build and run without problem. However, please note that you may not want to run it in the simulator unless you don't have an Apple Developer account. SpriteKit does use OpenGL, and simulating that using CPU will cause your computer to take off. ## The Code First off, the best thing about the code is that it's pretty well documented. Most methods have the Apple-style documentation, which means that you can triple-click on the method name to get its documentation. The code started to resemble the structure of the original 2048. So for example, it has a game manager, a board class, a tile class, etc. I at least *tried* to stick to MVC as much as possible. Here is a brief summary to get you started: * The `M2GameManager` class controls the game logic. There is only one action in the game: move. So the majority of that class is handling the move. The rest is checking whether you've won or died, etc. * The `M2Grid` class is the data structure for the board. The original 2048 used a 1-D array, but heck, 2-D array doesn't seem to be too bad here! ...except looping it is a bit ugly, so I made a `forEach` helper function. * The `M2Cell` class is the "slot"s. They are not the tiles themselves. The benefit of having this class is that the cells never move, so they are good references and they don't mess stuff up. * The `M2Tile` class is the actual tile, and **this** is the actual SpriteKit class. If all you want is some sample code for SpriteKit, here it is. I believe my animations are smoother than the other 2048 on the App Store, and are closer to the original animation. * The `M2GlobalState` class is a global class accessible from anywhere in the universe. Well, global stuff is evil, right? At least so we are told. But, it is at least better to encapsulate the global stuff into one single object (namespace), and that's a singleton right there. * The `M2Theme` class and its subclasses control the theme. * There are also some controller classes and view classes. It's probably a better idea to do the Game Over scene in SpriteKit, but I was lazy so I faked it using a view. The `M2GridView` class is the one that draws the board, btw. ### Contributing If you'd like to contribute, great! That's more than welcome. If you do make improvements to it, remember to put yourself in the "About 2048" page to get yourself credit. If you'd like to fork and make your own version, that's also great! Feel free to tinker with it however you'd like. It may not be a terribly good idea to change the font, add some ads, and submit to Apple, though. #### Contributors * Danqing Liu (me) * [Scott Matthewman](https://github.com/scottmatthewman) * [Sihao Lu](https://github.com/DJBen) ## Licence and Other 2048 for iOS is licenced under the MIT license. If you find the source code somewhat useful, all I ask is to download it from the [App Store](https://itunes.apple.com/us/app/2048-and-more!/id848859070?ls=1&mt=8), so I know that *someone* has seen it. Relax: It is free; it does not have any ads or weird stuff; it does not send you push notifications to ask you to go back and play it. You may also consider to [donate](https://github.com/gabrielecirulli/2048) to the maker of the original 2048 if you'd like, of course. (:

2015-03-11

iOS 私有API iphone-private-frameworks

iOS 私有API iphone-private-frameworks git上的貌似很久没维护了

2015-03-11

iOS 酒店app 餐饮类app 源码

iOS 餐饮类app 源码 酒店app 简单实现源码

2015-03-11

关东升iOS开发指南 随书源码下载(2)

关东升iOS开发指南 随书源码下载完整版 文件太大 分三次上传

2015-03-11

关东升iOS开发指南 随书源码下载(3)

关东升iOS开发指南 随书源码下载(3) 完整随书代码 文件太大分三次上传

2015-03-11

关东升iOS开发指南 随书源码下载(1)

关东升iOS开发指南 随书源码下载(1) 随书源码第二版下载

2015-03-11

mysql-5.6.28源码

mysql5.6 源码

2016-04-25

twitter启动页动画

类似twitter启动页的动画源码 先将启动图片换成一张静态图片,之后再加载动画

2015-03-11

2048源码分享

2048源码分享,看看这种算法吧 完整版

2015-03-11

纯代码控件 包含大部分控件

纯代码控件 包含1LWindow,2LUIView,3LUIViewController,4LUIViewUIImageViewUILabel,5LUIButtonUITextFieldUITextView,6LUIScrollView,7LUITableView,8LUITableViewCustomCell,9VCNavDemo,10LUITabBarViewController

2015-03-11

动画 删除view 页面切换

多个方式的页面切换实例,参考方便集成 删除view

2015-03-11

UITableView

UITableView 的简单实例 便于理解

2015-03-11

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除