#Hello Edgerunners, welcome to the Night-City.

Welcome!

iOS : HealthKit 牛刀小试

HealthKit 发布已经很久了,最近有机会用到,小试一把。 Framework 首先要导入 HealthKit.framework 框架,在 Build Phases 下 Link Binary with Libraries 中添加即可。 Capabilities 与 iCloud 等功能类似,也需要在 Capabilities 中开启后才能使用。 System Version HealthKit 是与 iOS 8 一同推出的,仅有运行 iOS 8 以上版本系统的 iPhone 与 Apple Watch 可以使用。你可以通过这句代码来判断设备是否支持 HealthKit: HKHealt...

Download the Xcode Documentations

由于 Xcode 中的自带的文档为在线文档,不包含离线 HTML 文件,然而 Xcode 中的下载速度又实在让人无奈,所以本文主要介绍如何加速下载 Xcode 文档的问题。 首先需要访问苹果官网的 XML 文件来获取下载路径: https://developer.apple.com/library/downloads/docset-index.dvtdownloadableindex 在这份 XML 中,依据更新时间的先后排序,越新的文档在越靠后的位置。 每一个 Docset 文档文件都有单独的注释,例如 <!-- START OS X doc set --> 和 <!-- ...

Work with CocoaPods and Gemfile

工作在一个 iOS 开发团队中,可能会有很多关于安装 CocoaPods 的问题。团队成员拥有不同的 cocoapods gem 的安装版本,并且当有人运行 pod install 时,会将事情搞得一团糟。解决方案是, 使用 Gemfile。你可以在 Gemfile 中指定 cocoapods gem 的使用版本。 gem source 'https://rubygems.org' #gem source 'https://ruby.taobao.org' gem 'cocoapods', '0.39.0' 当你更新了 G...

ADB 常用指令

调试Android程序有时需要adb shell 命令,adb全称Android Debug Bridge ,就是起到调试桥的作用。通过adb我们可以在Eclipse中通过DDMS来调试Android程序,说白了就是debug工具。adb通过监听Socket TCP 5554等端口让IDE和Qemu通讯。默认情况下当我们运行Eclipse时adb进程就会自动运行。adb是一个C/S模式的程序,由三个部分组成:a client,a server and a daemon。其中client和server运行在的development machine上,daemon运行在emulator或设备上。 ...

Swift : Changing the Value of Struct in an Array

今天帮朋友看了这样一个问题: import UIKit struct A { var a:Bool } struct B { var b : String var ba : A } struct C { var c : [B] } var cc = C(c: [ B(b: "1", ba: A(a: true)), B(b: "2", ba: A(a: true)), B(b: "3", ba: A(...

怎样验证 Xcode 来源

由于 Xcode Ghost 肆虐,苹果提供了验证 Xcode 来源的方法,需要使用终端: spctl --assess --verbose /Applications/Xcode.app 其中 /Applications/Xcode.app 是你系统中 Xcode 的路径,你也可能与这里的不同。 如果你得来源是 App Store: /Applications/Xcode.app: accepted source=Mac App Store 开发者网站: /Applications/Xcode.app: accepted source=Apple 开发者网站: /Applicat...

MacGap: Web App 生成工具

MacGap 是一个生成 WebApp 的终端工具, 安装很容易: gem install macgap 使用起来也很简单, 随意在什么路径下创建一个 app, 例如我在 ~ 目录新建一个叫 MyBlog 的 app: $ cd ~ $ macgap new MyBlog 本例中, MacGap 会在 ~ 下创建 MyBlog 文件夹, 包含 index.html 文件。 修改 MyBlog/index.html 甚至添加其它资源到 Blog/ 中, 然后开始构建: macgap build MyBlog 构建完成后会生成 MyBlog.app 文件。...

AsciiDoc

轻量级的标记语言已经有很多(Wikipedia),例如我用来写博客的 Markdown 就是目前十分流行的一种轻量级标记语言,包括 Github、StackOverflow 等很多网站以及个人都在使用。 Markdown 还不够吗 Markdown 语法简介,即便阅读未经渲染的源文件也有不错的可读性。但它对于较为复杂的格式例如表格的支持始终遭人诟病,许多网站使用各自不同的扩展语法来实现,也从而导致了各种方言的滋生。这也是为何会出现 Standard Markdown 项目的原因,虽然因为种种原因又更名为 Common Markdown,然而整个 Markdown 社区依然缺乏创建者的支持,Co...

OS X: Launch At Login

To have the app launch start at login you just need to call SMLoginItemSetEnabled with your bundle ID and bool value. SMLoginItemSetEnabled ((__bridge CFStringRef)@"com.domain.example", YES) // NO to cancel launch at login You need ServiceManagement framework to access this API. This is ...

Android: ScrollView 顶部图片下拉放大

先写布局 <LinearLayout xmlns:android="<https://schemas.android.com/apk/res/android>" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ScrollView android:id="@+id...

The best way to create constants in Objective-C

The first question is what scope you want your constants to have, which is really two questions: Are these constants specific to a single class, or does it make sense to have them all over the application? If they are class-specific, are they for use by clients of the class, or only within the clas...

iOS: WKWebView Useage

iOS8以后, 苹果推出了新框架Wekkit, 提供了替换UIWebView的组件WKWebView。各种UIWebView的问题没有了, 速度更快了, 占用内存少了, 一句话, WKWebView是App内部加载网页的最佳选择! 先看下 WKWebView的特性: 在性能、稳定性、功能方面有很大提升 允许JavaScript的Nitro库加载并使用; 支持了更多的HTML5特性; 高达60fps的滚动刷新率以及内置手势; 将UIWebViewDelegate与UIWebView重构成了14类与3个协议 (查看苹果官方文档) ; 然后从以下几个方面说下WKWebView的基本用法: 加载...

What's this?

The Night-City version of Hotodogo inspired by Cyberpunk 2077. Not finished yet.

Pinned Message

The Founder and CEO of Infeca Technology.

Developer, Designer, Blogger.

Big fan of Apple, Love of colour.

Feel free to contact me.

反曲点科技创始人和首席执行官。

开发、设计与写作皆为所长。

热爱苹果、钟情色彩。

随时恭候 垂询

Outer Square Inner Square