sample codes for iOS7