一、APP国际化
先上效果图:

①、添加需要支持的语言种类,如下图

②、新建File文件

③、按照第②步分别创建2个.strings的文件,文件名必须为InfoPlist.strings和最好为Localizable.strings。如下图:

④点击上图3中右边视图中绿色框内的Localizable,会弹出下图所示:,然后选择对应的语言文件,Base是默认的语言文件!分别对InfoPlist.strings和Localizable.strings做上述处理!

⑤、如下图,然后分别在不同的语言文件中创建同一key,不同Value的字符串,如图



⑥忘了说了:InfoPlist.strings文件里面主要存的是配置文件信息的不同语言键值对,如“CFBundleDisplayName”是APP的名字;Localizable.strings主要存的是自定义的一些字符串;(本人自己的理解,欢迎指教)
//NSLocalizedString(<#key#>, <#comment#>) 文件名默认为Localizable时
// NSLocalizedStringFromTable(<#key#>, <#tbl#>, <#comment#>)文件名不为Localizable时取字符串的方法
NSString * string = NSLocalizedString(@"woLabel", @"找不到key时默认的字符串")
二、跳转到系统设置
首先在项目中的info.plist中添加 URL types 并设置一项URL Schemes为prefs,如下图:

通过URL Scheme的方式打开内置的Settings,代码如下
//iOS10之前
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=General&path=ACCESSIBILITY"]];
//iOS10
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
APP权限设置 — UIApplicationOpenSettingsURLString
//以下在iOS10无效
About — prefs:root=General&path=About
Accessibility — prefs:root=General&path=ACCESSIBILITY
Airplane Mode On — prefs:root=AIRPLANE_MODE
Auto-Lock — prefs:root=General&path=AUTOLOCK
Brightness — prefs:root=Brightness
Bluetooth — prefs:root=General&path=Bluetooth
Date & Time — prefs:root=General&path=DATE_AND_TIME
FaceTime — prefs:root=FACETIME
General — prefs:root=General
Keyboard — prefs:root=General&path=Keyboard
iCloud — prefs:root=CASTLE
iCloud Storage & Backup — prefs:root=CASTLE&path=STORAGE_AND_BACKUP
International — prefs:root=General&path=INTERNATIONAL
Location Services — prefs:root=LOCATION_SERVICES //定位服务
Music — prefs:root=MUSIC
ACCOUNT — prefs:root=ACCOUNT_SETTINGS
Music Equalizer — prefs:root=MUSIC&path=EQ
Music Volume Limit — prefs:root=MUSIC&path=VolumeLimit
Network — prefs:root=General&path=Network
Nike + iPod — prefs:root=NIKE_PLUS_IPOD
Notes — prefs:root=NOTES
Notification — prefs:root=NOTIFICATIONS_ID
Phone — prefs:root=Phone
Photos — prefs:root=Photos
Profile — prefs:root=General&path=ManagedConfigurationList
Reset — prefs:root=General&path=Reset
Safari — prefs:root=Safari
Siri — prefs:root=General&path=Assistant
Sounds — prefs:root=Sounds
Software Update — prefs:root=General&path=SOFTWARE_UPDATE_LINK
Store — prefs:root=STORE
Twitter — prefs:root=TWITTER
Usage — prefs:root=General&path=USAGE
VPN — prefs:root=General&path=Network/VPN
Wallpaper — prefs:root=Wallpaper
Wi-Fi — prefs:root=WIFI
三、[iOS10通知、正则表达式] 通知带图片,支持自定义弹窗样式(https://github.com/wslcmk/iOS10NotificationAndRegularExpression.git)


直接上iOS10通知和正则表达式 Demo,具体就不再详述了,网上资料比较多,也挺详细的,想了解的可以去看看!
iOS10通知
正则表达式
之前的简书文章:
仿简书分享-UIActivityViewController系统原生分享
iOS技术网站和常用软件
Xcode炫酷插件
iOS后台音频播放及锁屏歌词

欢迎扫描下方二维码关注——iOS开发进阶之路——微信公众号:iOS2679114653
本公众号是一个iOS开发者们的分享,交流,学习平台,会不定时的发送技术干货,源码,也欢迎大家积极踊跃投稿,(择优上头条) _分享自己开发攻城的过程,心得,相互学习,共同进步,成为攻城狮中的翘楚!

网友评论