Code Monkey home page Code Monkey logo

iosdev_notes's People

Contributors

sauchye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

iosdev_notes's Issues

iOS 9 Tips

iOS 9 issues

iOS 9 未受信用的企业级开发者

解决办法:进入iPhone设置->通用->描述文件->找到企业级应用(点击选择信任即可)

iOS 9 无法加载(非https解决办法)

Plist添加

NSAppTransportSecurity Dictionary
NSAllowsArbitraryLoads  YES


<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
  • 分享无法检索iPhone是否安装该App
    iOS 9 白名单限制(貌似最多只能添加50个白名单)

iOS 9 适配:https://github.com/ChenYilong/iOS9AdaptationTips

LSApplicationQueriesSchemes  Array
Item0                                           String        iosamap
Item1                                           String        baidumap
Item1                                           String        comgooglemaps

<key>LSApplicationQueriesSchemes</key>
    <array>
        <string>comgooglemaps</string>
        <string>iosamap</string>
        <string>baidumap</string>
    </array>

区分iPhone 6/6s和iPhone 6/6s Plus,方便适配(如:3D Touch)。

#define isiPhone6s @"iPhone8,1"
#define isiPhone6sp @"iPhone8,2"

// 需要#import "sys/utsname.h"
+ (NSString *)devicePlatformInfo{
    struct utsname systemInfo;
    uname(&systemInfo);
    NSString *platform = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
    return platform;
}

iPhone info:https://www.theiphonewiki.com/wiki/Models

Third party open source libraries(第三方开源类库)

ReactiveCaocoa

常见登录,当信息填写完整后,按钮可以点击

   RAC(self.loginBtn, enabled) = [RACSignal combineLatest:@[self.usernameTextField.rac_textSignal,
                                                             self.passwordTextField.rac_textSignal]
                                                    reduce:^id(NSString *userName, NSString *password) {

        if (userName.length == 11 && password.length > 0) {
            self.loginBtn.backgroundColor = kNAVIGATION_BAR_COLOR;
        }else{

            self.loginBtn.backgroundColor = kBUTTON_DEFAULT_BACKGROUND_COLOR;
        }

        return @([RAManager isVaildMobileNumber:userName]  && userName.length == 11 
 && password.length > 0 );
    }];

快速入门

参考:
http://www.raywenderlich.com/62699/reactivecocoa-tutorial-pt1
http://limboy.me/ios/2013/06/19/frp-reactivecocoa.html
http://blog.devtang.com/blog/2014/02/11/reactivecocoa-introduction/
http://tech.meituan.com/tag/ReactiveCocoa
http://www.brighttj.com/ios/ios-reactivecocoa-utility-demo.html
http://yimouleng.com/2015/12/20/ios-ReactiveCocoa/
http://bawn.github.io/ios/2015/03/26/ReactiveCocoa.html
http://www.jianshu.com/notebooks/1825095/latest

Demo

参考:
https://github.com/bawn/RAC-Demo

TTTAttributedLabel

常见用户协议,如:点击注册,即表示同意《...服务条款》

    TTTAttributedLabel *lineLabel = [[TTTAttributedLabel alloc] initWithFrame:CGRectZero];
    lineLabel.textAlignment = NSTextAlignmentCenter;
    lineLabel.font = [UIFont systemFontOfSize:12];
    lineLabel.textColor = [UIColor grayColor];
    lineLabel.numberOfLines = 0;
    lineLabel.delegate = self;
    lineLabel.linkAttributes = kLinkAttributes;
    lineLabel.activeLinkAttributes = kLinkAttributesActive;
    NSString *tipStr = @"点击注册,即表示同意《...服务条款》";
    lineLabel.text = tipStr;
    [lineLabel addLinkToTransitInformation:@{@"actionStr" : @"gotoServiceTermsVC"} withRange:[tipStr rangeOfString:@"《...服务条款》"]];
    CGRect registerBtnFrame = _registerBtn.frame;
    lineLabel.frame = CGRectMake(CGRectGetMinX(registerBtnFrame),lookBtn.frame.size.height+lookBtn.frame.origin.y+60, CGRectGetWidth(registerBtnFrame), 12);
    [self.scrollView addSubview:lineLabel];
#pragma mark TTTAttributedLabelDelegate
- (void)attributedLabel:(TTTAttributedLabel *)label didSelectLinkWithTransitInformation:(NSDictionary *)components{
    if ([[components objectForKey:@"actionStr"] isEqualToString:@"gotoServiceTermsVC"]) {

    }
}

Masonry

快速入门

参考:
http://adad184.com/2014/09/28/use-masonry-to-quick-solve-autolayout/ (基础篇)
http://adad184.com/2015/06/08/complex-cell-with-masonry/ (复杂篇)

Demo

参考:
https://github.com/adad184/DemoMasonry

RDVTabBarController

快速入门

参考:
http://sauchye.com/2015/10/09/third-party-frameworks-RDVTabBarController.html
https://github.com/sauchye/SYTipsDemo/blob/master/SYTipsDemo/SYRootViewController.m (代码)

MBProgressHUD

快速入门

参考:
http://www.ios122.com/tag/mbprogresshud/

Demo

参考:
https://github.com/sauchye/SYHUDView (封装)

AppStore Tips

申请加急入口

https://developer.apple.com/appstore/contact/appreviewteam/index.html

介绍

快速审核:
http://sauchye.com/devtips/2015/10/11/apply-app-accelerated-review.html

转移App到其他开发者账户

http://www.cnblogs.com/chebaodaren/p/4875028.html
http://www.devdiv.com/forum.php?mod=viewthread&tid=206244

App内购

http://blog.csdn.net/shenjie12345678/article/details/40978977

App Review Team

Information Needed

We began the review of your app but aren't able to continue because we need additional information about your app.

At your earliest opportunity, please review the following question(s) and provide as much detailed information as you can. The more information you can provide upfront, the sooner we can complete your review.

  • Does your app access any paid content or services?
  • What are the paid content or services, and what are the costs?
  • Who pays for the content or services?
  • Where do they pay, and what’s the payment method?
  • If users create an account to use your app, are there fees involved?

Once you reply to this message in Resolution Center with the requested information, we can proceed with your review.

修改App Store开发者名称

https://www.zhihu.com/question/22951376/answer/26706290

iOS13 Adaptation

iOS13 Adaptation

https://juejin.im/post/5d8af88ef265da5b6e0a23ac
https://www.jianshu.com/p/0da3b107f06c

UITableViewCellAccessoryDisclosureIndicator
https://blog.csdn.net/u012094456/article/details/101198974

UITableViewCell的UITableViewCellAccessoryDisclosureIndicator显示不正常,出现方框显示

原因:项目中有UIImage的catagory,且含有方法:imageWithTintColor,这个方法会和ios13新api冲突,导致出现方框

————————————————
版权声明:本文为CSDN博主「new_dev」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u012094456/article/details/101198974

Sign-in-with-Apple

https://developer.apple.com/sign-in-with-apple/
http://junshang.me/post/apple-login-jie-ru-qian-yi-ci-shen-ru-yan-jiu/

CocoaPods Tips

解决pod install 很慢问题,在终端中输入如下命令

pod install --verbose --no-repo-update
pod update --verbose --no-repo-update

Learning

题记:想成为一名靠谱的iOSer没那么简单吧...

iOS长期学习路线以及必备技能

学习资源

Swift 5.0

https://www.runoob.com/manual/gitbook/swift5

https://developer.apple.com/library/ios/navigation/
http://nshipster.com/
http://www.raywenderlich.com/
http://objc.io/
http://objccn.io/ (喵神@onevcat 组织)
http://www.cocoachina.com/ios/
...

RxSwift

https://www.jianshu.com/p/f61a5a988590

2015优秀博客

http://segmentfault.com/bookmark/1230000004250380

前言:纸上得来终觉浅,绝知此事要躬行。

源码

https://github.com/
国内,涵盖一些UI效果图
http://code4app.com/
http://code.cocoachina.com/

前言:开源是一种美德,分享是一种态度。

社区、论坛、分享

话说求人不如求自己,不到万不得已,自己还是先试试,或许关键字不对...
https://devforums.apple.com
http://stackoverflow.com
http://iphonedevsdk.com/forum
http://www.developerfeed.com/profile/ios-developer
国内资源分享
http://toutiao.io/
http://www.cocoachina.com/ios/
http://blog.fir.im/fir_im_weekly151211/
http://tech.glowing.com/cn/
http://bbs.iosre.com/
#4 (comment)

提高篇

#13
...

GitHub搜索

https://github.com/search?l=Objective-C&p=2&q=game&s=stars&type=Repositories

之前看过一篇Blog,Giter请不要鄙视SVNer,但我依然强烈建议使用、熟悉Git流程

版本管理

  • Git
    #10
  • SVN (暂时不全,有空我还会再整理整理,欢迎issuess我 :))
    #1

工欲善其身,必先利其器。

插件管理

  • Xcode插件

http://www.cocoachina.com/industry/20130918/7022.html
http://blog.devtang.com/blog/2014/03/05/use-alcatraz-to-manage-xcode-plugins/

  • Xcode调试显示UI

http://revealapp.com/ (免费30天)

  • Terminal终端

https://github.com/robbyrussell/oh-my-zsh

来自巧大推荐的iOS/Mac OS开发博客

@tangqiaoboy
https://github.com/tangqiaoboy/iOSBlogCN

前言:练就了一身本领,就等华山论剑了。

求职跳槽篇,基础补脑。


收集项目中常遇到一些UI需求

ScrollView

TableView

UILabel

UIButton

UISwitch

popView

...

WebView 加载处理

https://github.com/Roxasora/RxWebViewController (类似微信,支付宝,UC浏览器加载)
https://github.com/TransitApp/SVWebViewController
https://github.com/ninjinkun/NJKWebViewProgress
https://github.com/TimOliver/TOWebViewController

SDWebImage加载网络图片

https://github.com/JJSaccolo/UIActivityIndicator-for-SDWebImage (小菊花显示加载中)

网络图片加载框架

https://github.com/rs/SDWebImage
https://github.com/ibireme/YYImage
https://github.com/onevcat/Kingfisher (Swift)

Markdown Tips

快速入门

Intro

http://wowubuntu.com/markdown/basic.html
http://www.ituring.com.cn/article/23
http://segmentfault.com/markdown

Tools

推荐Typora,想要预览推荐Mou

添加图片

![intro png](https://github.com/sauchye/SYQRCodeDemo/raw/master/intro.PNG)
以Markdown语法如:

![Aaron Swartz](https://github.com/younghz/Markdown/raw/master/Res/Aaron_Swartz.jpg)形式添加到README文件中即可,但是需要注意的是在下面的链接中需将blob改为raw。

http://blog.csdn.net/u012150179/article/details/24605419

intro png

HealthKit Info

当你的App使用HealthKit后打包上传itunesconnect出现这样的问题
使用权限 [com.apple.developer.healthkit] 的 App 必须为[Simplified Chinese]提供隐私政策。如果您的 App 不使用这些权限,请将它们从您的 App 中移除并上传新的二进制文件。

先确定证书以及Xcode配置正确,一步一步检查原因 good luck :)

可参考:
http://blog.csdn.net/zzzzzdddddxxxxx/article/details/47722343
http://www.cocoachina.com/ios/20140915/9624.html
http://www.cnblogs.com/luoxiaofu/p/5259320.html

Xcode Tips

Xcode Update( iOS lastest SDK )

Could not find developer disk image

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

Error Tips

Run Reveal Error

A server with the specified hostname could not be found

fix :System Preferences->TCP/IP->DHCP Client ID: 4.2.2.2

http://stackoverflow.com/questions/11279491/a-server-with-the-specified-hostname-could-not-be-found

Xcode Error

Bundle display name Null

console:

alloc: *** error for object 0xfffffffffffffffc: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

fix:
Bundle display name add AppName

Sketch

http://www.jianshu.com/p/45eef5465185

在pch文件宏定义#define bundle id @"com.sauchye.SYADView" 会在CFBundle.h报错,注释掉即可,建议删除,不删除会出现坑的。


Your session has expired. Please log in.

你的账号过期,建议仔细检查快捷键cmd+,,检查账号,这是一个坑,当你有登录多个开发者账号时,可能会出现。

Your session has expired. Please log in

https://forums.developer.apple.com/thread/23674

消除Xcode警告

参考:http://my.oschina.net/joanfen/blog/493807

Build Settings - Customer Compiler Flags - Other Warning Flags添加
-Wno-shorten-64-to-32
-Wno-sizeof-array-argument
-Wno-sizeof-pointer-memaccess

Xcode Theme

https://github.com/vinhnx/Ciapre-Xcode-theme
1
2
3
4

iOS进阶(anminations、runtime、runloop、gcd)

Block

https://www.zybuluo.com/MicroCai/note/51116

https://blog.csdn.net/wtdask/article/details/76229469

https://blog.csdn.net/abc649395594/article/details/47086751

Runtime

https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ObjCRuntimeRef/

http://tech.glowing.com/cn/objective-c-runtime/

http://yulingtianxia.com/blog/2014/11/05/objective-c-runtime/

http://southpeak.github.io/blog/2014/10/25/objective-c-runtime-yun-xing-shi-zhi-lei-yu-dui-xiang

http://www.jianshu.com/p/e071206103a4#

Runloop

http://blog.ibireme.com/2015/05/18/runloop/

http://chun.tips/blog/2014/10/20/zou-jin-run-loopde-shi-jie-er-:ru-he-pei-zhi-run-loop-sources/

http://www.jianshu.com/p/549c37f60bf7#

Multithreading

http://www.saitjr.com/ios/ios-multithreading-nsoperation.html

http://www.jianshu.com/p/0b0d9b1f1f19

http://blog.devtang.com/blog/2012/02/22/use-gcd/

https://github.com/ChenYilong/ParseSourceCodeStudy

http://www.jianshu.com/p/ae786a4cf3b1#

http://chengway.in/gcd-zui-jia-shi-jian-zhi-nan/

http://www.cnblogs.com/kenshincui/p/3983982.html#NSOperation

http://www.cnblogs.com/wendingding/tag/%E5%A4%9A%E7%BA%BF%E7%A8%8B%E7%AF%87/

https://www.jianshu.com/p/2d57c72016c6

http://blog.leichunfeng.com/blog/2015/07/29/ios-concurrency-programming-operation-queues/

MVVM

http://blog.devtang.com/blog/2015/11/02/mvc-and-mvvm/

http://www.ruanyifeng.com/blog/2015/02/mvcmvp_mvvm.html

http://www.cnblogs.com/ludashi/p/4211556.html

http://www.ios122.com/2015/10/mvvm_start/

https://github.com/leichunfeng/MVVMReactiveCocoa

性能调试

https://everettjf.github.io/2018/12/12/ios-app-launch-perf-coll/

架构组件化

https://blog.cnbluebox.com/blog/2015/11/28/module-and-decoupling/

https://www.jianshu.com/p/afb9b52143d4

https://www.jianshu.com/p/f1a05a95de92

https://casatwy.com/iosying-yong-jia-gou-tan-kai-pian.html

iOS底层原理总结

https://www.jianshu.com/nb/24110540

源码分析

https://github.com/draveness/analyze

Algorithm

出自 :http://www.kuqin.com/shuoit/20150929/348338.html

说明:如有侵权请联系@sauchye,旨在分享,相互学习~

算法虐我千百遍,我待算法如初恋。

学习方法
1) 把所有经典算法写一遍
2) 看算法源码
3) 加入算法学习社区,相互鼓励学习
4) 看经典书籍

基本数据结构和算法

这些算法全部自己敲一遍:

  • 二叉树
  • 二叉树
  • 二叉查找树
  • Trie树(前缀树)
  • 后缀树
  • 最优二叉树(赫夫曼树)
  • 伸展树(splay tree 分裂树)
  • 平衡二叉树AVL
  • 红黑树
  • B树(B-),B+,B*
  • R树
  • 二叉堆 (大根堆,小根堆)
  • 二项树
  • 二项堆
  • 斐波那契堆(Fibonacci Heap)

哈希表/散列表 (Hash Table)

  • 字符串算法
  • BF算法
  • KMP算法
  • BM算法

图的算法

图的存储结构和基本操作(建立,遍历,删除节点,添加节点)
最小生成树
拓扑排序
关键路径
最短路径: Floyd,Dijkstra,bellman-ford,spfa

排序算法

交换排序算法
插入排序
选择排序
希尔排序
堆排序
快排
归并排序

线性排序算法基数排序

查找算法
顺序表查找:顺序查找
有序表查找:二分查找
分块查找: 块内无序,块之间有序;可以先二分查找定位到块,然后再到块中顺序查找 中使用顺序查找(这里之所以叫动态查找表,是因为表结构是查找的过程中动态生成的)
动态查找: 二叉排序树,AVL树,B- ,B+
哈希表: O(1)

Example

15个经典基础算法
A*寻路算法: 求解最短路径 Dijkstra:最短路径算法 (八卦下:Dijkstra是荷兰的计算机科学家,提出”信号量和PV原语“,"解决哲学家就餐问题",”死锁“也是它提出来的)
DP (动态规划 dynamic programming)
BFS/DFS (广度/深度优先遍历)
红黑树 (一种自平衡的二叉查找树)
KMP 字符串匹配算法
遗传算法
启发式搜索
图像特征提取之SIFT算法
傅立叶变换
Hash
快速排序
SPFA(shortest path faster algorithm) 单元最短路径算法
快递选择SELECT

算法设计**

为了更简洁的形式设计和藐视算法,在算法设计时又常常采用递归技术,用递归描述算法。
迭代法
穷举搜索法
递推法
动态规划
贪心算法
回溯
分治算法
http://www.chinaunix.net/old_jh/23/437639.html

推荐阅读

刷题必备
《剑指offer》
《编程之美》
《编程珠玑》Programming Pearls 偏算法理论
《编程珠玑(续)》
《More Programming Pearls》 偏算法轶事

《数据结构与算法分析》
《算法设计与分析基础》
《算法导论》 告诉你有哪些算法
《算法引论》 告诉你如何创造算法 断货

侧重经典算法的实现
《Elements of Programming》 STL代码 快 准 狠 ,写出的代码可以上层次
《C interfaces and Implementation》
《The practice of programming》 Brian Kernighan和Rob Pike

《微软的梦工厂》
《Language Implementatin patterns》
《Algorithms on Strings,Trees and Sequences》

《writing efficient programs》 优化

《Algorithm Design Manual》 红皮书

《The science of programming》 证明代码段的正确性 800块一本

高级数据结构(如元胞自动机、斐波纳契堆、线段树)

《Algorithms》 4版
《Advanced Data Structures》 各种诡异数据结构和算法 600块

《深入理解计算机系统》
《TCP/IP详解三卷》
《UNIX网络编程二卷》
《UNIX环境高级编程:第2版》

参考链接和学习网站
* @ July 博客《二之再续、Dijkstra 算法+fibonacci堆的逐步c实现》*
《数学建模十大经典算法》
《数据挖掘领域十大经典算法》
《十道海量数据处理面试题》
《数字图像处理领域的二十四个经典算法》
《精选微软等公司经典的算法面试100题》

微软面试100题http://blog.csdn.net/column/details/ms100.html
程序员编程艺术http://blog.csdn.net/v_JULY_v/article/details/6460494

https://github.com/julycoding/The-Art-Of-Programming-By-July算法题集合https://github.com/activesys/libcstl通用数据结构和算法库
https://github.com/nonstriater/Learn-Algorithm算法小组

贝叶斯:

  1. 阮一峰总结的这两篇《贝叶斯推断及其互联网应用》
    《贝叶斯推断及其互联网应用》
    《贝叶斯推断及其互联网应用》
  2. 算法杂货铺——分类算法之朴素贝叶斯分类(Naive Bayesian classification)
    http://www.cnblogs.com/leoo2sk/archive/2010/09/17/naive-bayesian-classifier.html
  3. 朴素贝叶斯(NB,Naive Bayes)简介
    http://home.cnblogs.com/group/topic/40112.html
  4. 数学之美番外篇:平凡而又神奇的贝叶斯方法
    http://mindhacks.cn/2008/09/21/the-magical-bayesian-method/

这4部分看完后,就能自己推贝叶斯、朴素贝叶斯,还能了解各种常见概率、集合论等,实际上对应用贝叶斯已经可以打好基础了。

MYSQL 背后的数据结构和算法http://blogread.cn/it/article/4088?f=wb2

基本算法演示
http://sjjg.js.zwu.edu.cn/SFXX/sf1/sfys.html
http://www.cs.usfca.edu/~galles/visualization/Algorithms.html

编程网站

http://oj.leetcode.com/
http://openjudge.cn/POJ。这有个POJ上的ACM训练方案http://www.java3z.com/cwbwebhome/article/article19/res041.html
http://ac.jobdu.com/index.php九度OJ

集成第三方服务遇到的坑

集成科大讯飞语音

  • 由于最近集成科大讯飞服务,遇到一些坑,= =,特此记录一下。
  • 语音合成的是pcm文件,pcmwav
  • 如果需要转换成MP3格式需要借助lame,第二部依然得进行~
+ (NSData *)writeWaveHead:(NSData *)audioData
               sampleRate:(long)sampleRate {
            Byte waveHead[44];
            waveHead[0] = 'R';
            waveHead[1] = 'I';
            waveHead[2] = 'F';
    waveHead[3] = 'F';
        long totalDatalength = [audioData length] + 44;
    waveHead[4] = (Byte)(totalDatalength & 0xff);
    waveHead[5] = (Byte)((totalDatalength >> 8) & 0xff);
    waveHead[6] = (Byte)((totalDatalength >> 16) & 0xff);
    waveHead[7] = (Byte)((totalDatalength >> 24) & 0xff);
    waveHead[8] = 'W';
    waveHead[9] = 'A';
    waveHead[10] = 'V';
    waveHead[11] = 'E';
    waveHead[12] = 'f';
    waveHead[13] = 'm';
    waveHead[14] = 't';
    waveHead[15] = ' ';
    waveHead[16] = 16;
    //size of 'fmt '
    waveHead[17] = 0;     waveHead[18] = 0;     waveHead[19] = 0;          waveHead[20] = 1;
    //format
    waveHead[21] = 0;          waveHead[22] = 1;
    //chanel
    waveHead[23] = 0;
    waveHead[24] = (Byte)(sampleRate & 0xff);
    waveHead[25] = (Byte)((sampleRate >> 8) & 0xff);
    waveHead[26] = (Byte)((sampleRate >> 16) & 0xff);
    waveHead[27] = (Byte)((sampleRate >> 24) & 0xff);
    long byteRate = sampleRate * 2 * (16 >> 3);;
    waveHead[28] = (Byte)(byteRate & 0xff);
    waveHead[29] = (Byte)((byteRate >> 8) & 0xff);
    waveHead[30] = (Byte)((byteRate >> 16) & 0xff);
    waveHead[31] = (Byte)((byteRate >> 24) & 0xff);
    waveHead[32] = 2*(16 >> 3);     waveHead[33] = 0;
    waveHead[34] = 16;     waveHead[35] = 0;
    waveHead[36] = 'd';     waveHead[37] = 'a';
    waveHead[38] = 't';     waveHead[39] = 'a';
    long totalAudiolength = [audioData length];
    waveHead[40] = (Byte)(totalAudiolength & 0xff);
    waveHead[41] = (Byte)((totalAudiolength >> 8) & 0xff);
    waveHead[42] = (Byte)((totalAudiolength >> 16) & 0xff);
    waveHead[43] = (Byte)((totalAudiolength >> 24) & 0xff);
    NSMutableData * pcmData = [[NSMutableData alloc]initWithBytes:&waveHead length:sizeof(waveHead)];
    [pcmData appendData:audioData];

    return pcmData;
}

集成支付宝支付

rsa_private read error : private key is NULL

1解决方法:
1)在RSADataSigner.m文件中 搜索代码 [result appendString:@"-----BEGIN PRIVATE KEY-----\n"]; 将其改成 [result appendString:@"-----BEGIN RSA PRIVATE KEY-----\n"];
2)在RSADataSigner.m文件中 搜索代码 [result appendString:@"\n-----END PRIVATE KEY-----"]; 将其改成 [result appendString:@"\n-----END RSA PRIVATE KEY-----"];

参考:http://blog.csdn.net/vkooy/article/details/47130653

Design

Mobile Design

SE(Software Engineer)也需要懂点交互设计、用户体验,好么@@

苹果官方涉及交互设计
https://developer.apple.com/ios/human-interface-guidelines/

cocoachina设计指导
http://www.cocoachina.com/special/design/

专注于分享iOS应用UI界面的细节,按照设计元素进行分类,按照iOS常用功能对各类UI进行分类展示。
http://www.patternsofdesign.co.uk/

Splashscreens / iOS UI Patterns (beta) ,整理/罗列了许多精彩的iOS 应用界面截图,并且按照分类将这些截图分类,比如Activity,Login,About,Calendar,Seeting,Share等各种类型的不同应用的实现效果。
http://pttrns.com/

优秀移动应用网站设计
http://www.appsites.com/

设计师交流和分享自己设计作品的社区。上面有很多非常棒的移动产品设计作品。
http://dribbble.com/

分享最棒的手机产品界面设计
http://www.tappgala.com/

移动设计书籍、移动原型分享的网站。
http://www.mobiledesignpatterngallery.com/

主要是展示优秀的iOS平台上应用的设计,icon及相关资源
http://www.iosinspires.me/

All iPhone Size

P、X、XS Max都是3x,XR加长版刘海P,X、XS、加长版6、7、8
http://www.tuyiyi.com/cc/

iphone_design

计算动态Label高度

动态计算Label

动态高度

- (CGFloat)heightForLabelText:(NSString *)text fontSize:(CGFloat)fontSize
{
    NSDictionary *attrbute = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize]};

    return ceilf([text boundingRectWithSize:CGSizeMake(SCREEN_WIDTH-20, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:attrbute context:nil].size.height);
}

https://github.com/sauchye/SYDynamicTextDemo

动态宽度(iOS>=7.0)

 NSDictionary *attribute = @{NSFontAttributeName: [UIFont systemFontOfSize:fontSize]};
  CGSize size = [str boundingRectWithSize:CGSizeMake(MAXFLOAT, height)
                                  options:NSStringDrawingTruncatesLastVisibleLine|NSStringDrawingUsesLineFragmentOrigin
                              attributes:attribute context:nil].size;

iOS加速审核App

前言
国庆节转眼间就过去了,想来七天的小长假也是如此的速度;想想国庆前,想来大家一般会比较忙的状态,毕竟都想在节前Release产品,尤其是能够快速审核上架,想想都是如此激动啊。其实我们也是,节前Release产品,争取快速审核完成,用户在App Store更新、下载。
小插曲
然而节后上班,App审核通过,想来是极好的,其实不然,毕竟用户体验出了八阿哥,这不有得忙了,忙是应该的,如何打造一流产品,一直是心中所追求和向往的,所以我选择加速审核我们的App(针对已上架的App),接下来请看->Next
iOS 9 新增了这样的选择发布(其实我心中窃喜🙈)ios 9 ios9_choose_release
你可以选择相对应的时间,亦可到这里申请加急审核:https://developer.apple.com/appstore/contact/appreviewteam/index.html
选择加急审核的原因(大致的意思应该可以猜到吧,可以参考:http://translate.google.cn/
reason png
填写App相关信息
appinfo png
申请加急的理由
choose png
注意:请一定真实描述,就算木有,你可以伪造,但是也得让Review Team知道这里确实存在这个问题,所以你的申请加急才有可能申请成功,申请不成功意味着你的App大概又需要一周的时间。
尽量使用英文描述;

分条描述App存在的重要问题,如:Crash,用户无法使用等;

强调自己已经解决(fixed)问题或者致命的八阿哥(bug);

别忘了,说一声谢谢。

结语
纯属开发中遇到的一些问题,欢迎纠正,探讨,如能指出,感激不尽,祝大家周末玩的开森~

Notice

转载请简信或微博@Sauchye,感激不尽。如果您觉得有些图片问题或数据(版权),请与我联系,我尽快处理,谢谢!
出自:https://www.jianshu.com/p/d8e27bdf8d0f

iOS数据持久化

Programming Style

Objective C

   [self.view addSubview:({

        UIImage *image = [CDManager doneImage];
        UIButton *doneBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        doneBtn.frame = CGRectMake(SCREEN_WIDTH - image.size.width/3.5 - 10, 25, image.size.width/3.5, image.size.height/3.5);
        [doneBtn setImage:normal forState:UIControlStateNormal];
        [doneBtn addTarget:self action:@selector(doneButtonAction) forControlEvents:UIControlEventTouchUpInside];
        [doneBtn setImage:image forState:UIControlStateNormal];
        doneBtn;
    })];

http://weibo.com/p/10080852e0242ca7393837a6ecec8009daad5a?k=iOS%E7%9F%A5%E8%AF%86%E5%B0%8F%E9%9B%86&from=501&_from_=huati_topic#_rnd1465376916474

如何优雅的获取用户授权,如:通知,定位,相册,录音等...

iOS获取系统相关权限(iOS7及以上)

获取AVAudioSession录音权限

if ([[AVAudioSession sharedInstance] respondsToSelector:@selector(requestRecordPermission:)]){
   [[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {

       if (granted) {
           //用户已允许,直接进行录制等,逻辑操作...

       }else {
           //用户拒绝,引导用户开启麦克风服务,直接跳转到该应用设置页面
       }
   }];

}

获取CLLocationManager定位权限
kCLAuthorizationStatusNotDetermined 用户没有做出选择
kCLAuthorizationStatusRestricted    无法使用定位服务,该状态用户无法改变
kCLAuthorizationStatusDenied        用户拒绝该应用使用定位服务或是定位服务总开关处于关闭状态

iOS 8
kCLAuthorizationStatusAuthorizedAlways  用户同意程序在可见时使用地理位置
kCLAuthorizationStatusAuthorizedWhenInUse 用户允许该程序运行时可以使用地理信息
kCLAuthorizationStatusAuthorized    用户允许该程序无论何时都可以使用地理信息

    if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied  ) {
        //用户已拒绝开启定位服务,处理逻辑...
        //前往 开启定位授权
            if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1) {

                UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"请在iPhone的“设置->隐私->位置”中允许访问位置信息" delegate:self cancelButtonTitle:nil otherButtonTitles:@"取消", @"设置", nil];
                [alertView show];
            }else{
                kTipsAlert(@"请在iPhone的“设置->隐私->位置”中允许访问位置信息");
            }

    }else{
        //用户已同意开启定位服务,处理逻辑...
    }
直接跳转到该App设置页面,就是这样。

   UIApplication *app = [UIApplication sharedApplication];
   NSURL *settingsURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
   if ([app canOpenURL:settingsURL]) {
       [app openURL:settingsURL];
   }

SVN Tips

svn_notes

习惯了Git命令行管理code,那一个爽,不可言语。毕竟不是所有的公司都是Git管理code,所以SVN得get,说实话一直习惯命令行操作,对于客户端操作一直是耿耿于怀,记得哪会刚开时用"猫”客户端时各种merge,各种冲突,@chenrenjie各种折腾...

来看看SVN命令行操作,其实和Git大致相似吧,即使教程无数,仅当记录下,忘记时可以时常翻阅,挺好,毕竟,好记性,不如烂笔头。

介绍:使用zsh,感兴趣的童鞋戳zsh

svn help

   add (svn add *  添加全部已修改的内容,类似git add .)

   blame (praise, annotate, ann)

   cat

   changelist (cl)

   checkout (co) (checkout工程,类似:git checkout url)

   cleanup

   commit (ci) (commit到本地库,类似:git commit -m "提交更改信息标记")

   copy (cp)

   delete (del, remove, rm) (删除,注文件得加rf,如:rm -rf fileName,删除时慎重)

   diff (di) (查看提交前后的差别,类似:git diff)

   export

   help (?, h) (帮助)

   import

   info

   list (ls)

   lock

   log (查看提交信息,类似:git log)

   merge (合并一些分支啥的,类似:git merge)

   mergeinfo

   mkdir (在工程中新建文件夹)

   move (mv, rename, ren)

   patch

   propdel (pdel, pd)

   propedit (pedit, pe)

   propget (pget, pg)

   proplist (plist, pl)

   propset (pset, ps)

   relocate

   resolve

   resolved (处理冲突)

   revert (版本回退,如:git revert version)

   status (stat, st) (当前状态,如:git status(gst),查看是否将code提交到本地仓库)

   switch (sw)

   unlock

   update (up) (更新code,ru:git pull(gl),更新前请一定将自己code提交到本地仓库,更新完后,有conflicts先解决,再同步code,不要留坑)

   upgrade

就这么多,具体的还请google或者bing或者baidu,若有不足还请指出,感激不敬!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.