自定义博客皮肤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的专栏

不忘初心,方得始终。

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

原创 iOS 苹果开发者注册 和 App Store问题咨询

苹果开发者账号申请与iTunesconnect中心问题联系电话 打这个电话可以咨询注册进度,注册要求,app审批进度,催app审批进度等等。。。 邮件原文: 我们恳请您主动跟我们联系。我们的电话号码是86 4006 701 855。 同时,您亦可以访问以下苹果网页查询各地区开发者支援的电话号码。 http://developer.apple.com/contact

2015-01-23 09:41:09 1063

原创 iOS 控件点击效果 手势效果 UITapGestureRecognizer用法

在需要给图片,图标等控件添加 点击效果,手势效果的UITapGestureRecognizer用法 直接看代码示例: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. UIImageView

2015-01-20 10:15:37 2288

原创 iOS 键盘类型设置

iOS 弹出键盘类型 1,UIKeyboardTypeDefault 2,UIKeyboardTypeASCIICapable 3,UIKeyboardTypeNumbersAndPunctuation 4,UIKeyboardTypeURL 5,UIKeyboardTypeNum

2015-01-07 11:37:14 1320

原创 iOS 按钮设置

设置按钮为不可按:setEnable [button setEnable:NO]; 设置变灰:setAlpha [button setAlpha:0.4]; 设置按钮图像:setImage [button setImage:[UIImage imageNamed:@"choice"] forState:UIControlStateNormal]; 设置按钮标题:setTit

2015-01-06 18:07:21 736

xz-5.2.2.tar.gz源码

xz-5.2.2.tar.gz 安装源码

2016-04-26

mysql-5.6.28源码

mysql5.6 源码

2016-04-25

iOS 私有API iphone-private-frameworks

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

2015-03-11

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

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

2015-03-11

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

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

2015-03-11

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

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

2015-03-11

iOS 酒店app 餐饮类app 源码

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

2015-03-11

UITableView

UITableView 的简单实例 便于理解

2015-03-11

twitter启动页动画

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

2015-03-11

iOS 手势密码 源码

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

2015-03-11

动画 删除view 页面切换

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

2015-03-11

类似美团的下拉菜单

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

2015-03-11

开源中国 完整客户端 源码

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

2015-03-11

2048源码分享

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

2015-03-11

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

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

2015-03-11

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

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

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

空空如也

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

TA关注的人

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