在iOS中有三类事件:

  • 触控事件(单点、多点触控以及各种手势操作)
  • 传感器事件(重力、加速度传感器等)
  • 远程控制事件(远程遥控iOS设备多媒体播放等)

这里要讨论的是触控事件的机制。

iOS中主要有两种触控事件:

  • 手势识别类定义的触控事件
  • UIResponder中定义的触控事件
Read on →

For basic configuration of octopress blog, go to official site for references.

Issue with OS EI Caption (10.11)

After updating OS to EI Caption (10.11), there is some bugs when we run rake preview. You need to update your ruby version, and reinstall dependencies of octopress.

Refer to Errno::ENOENT: No Such File or Directory - Jekyll ~ Octopress and El Capitan post for more details.

If you can still not update your ruby version using the way in the above post, try the following commands (Refer to Using Rbenv to Manage Multiple Versions of Ruby for more details.) before install new ruby version:

  • Add rbenv init to your shell to enable shims and autocompletion:
1
2
$ echo 'eval "$(rbenv init -)"' >> $HOME/.bash_profile
$ source ~/.bash_profile
  • Restart shell as a login shell so that the PATH changes take effect:
1
$ exec $SHELL -l

Themes

Go to here to choose the theme you like. Personally, I like the boldandblue theme. It is simple and elegant.

Read on →

Google Maps Android API utility library (the github repo and the documentation) supplies multiple cool features, including

  • Marker clustering — handles the display of a large number of points
  • Heat maps — display a large number of points as a heat map
  • IconGenerator — display text on your Markers
  • Poly decoding and encoding — compact encoding for paths, interoperability with Maps API web services
  • Spherical geometry — for example: computeDistance, computeHeading, computeArea
  • KML — displays KML data (Caution: Beta!)
  • GeoJSON — displays and styles GeoJSON data
Read on →

Description

A .dSYM file is a debug symbols file. It is generated when in xcode:

  • Generate Debug Symbols setting is enabled
  • Debug Infomation Format is set to DWARF with dSYM File in the build settings of your project.
Read on →

Contents:

Description

In Cocoa, the Model-View-Controller pattern, a controller’s responsibility is to keep the view and the model synchronized. There are two parts to this: when the model object changes, the views have to be updated to reflect this change, and when the user interacts with controls, the model has to be updated accordingly.

Key-Value Observing helps us update the views to reflect changes to model objects. The controller can observe changes to those property values that the views depend on.

For more details, refer Key-Value Coding and Observing from objc.io;

Read on →

All the attributes of a property defines how the compiler generate the getter and setter accessors.

  • atomic / nonatomic
  • strong / weak: used for ARC.
  • assign / retain / copy: go to here for reference. These properties define how the compiler generate the setter accessor.
  • readonly / readwrite: if a property is declared as readonly, the compiler will only declare the getter accessor, so that you can not call setter accessor.
Read on →
ios

Location Service Authorization

1. Set info.plist

For iOS SDK 8.0 and later, we need to set NSLocationWhenInUseUsageDescription and ‘NSLocationAlwaysUsageDescription’ in info.plist file. A sample case is:

1
2
3
4
<key>NSLocationWhenInUseUsageDescription</key>
<string>Do you allow the app to use your location?</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Are you willing to allow the app to use your location?</string>

The string will appear in the popup dialog. You can leave it as empty, and only the system message will appear in the popup.

Read on →