iphone

How do I mirror a UIImage picture from UIImagePickerController

十年热恋 提交于 2021-02-06 15:16:25
问题 I'm trying to figure out if there is any way to mirror an image. For example, take a picture of someone's face and then cut it in half and show what their face looks like with each side mirrored. There doesn't seem to be any tricks like this in CGAffineTransform functions. Graphics experts please help!!! 回答1: The basic "trick" here is to use a scaling transform about the X or Y axis with a factor of -1. For example, you could use this to create a "flip about the horizontal axis" transform:

How are some alarm apps such as Alarmy able to play a sound on iPhone when the app is in the background and the phone is on vibrate

孤者浪人 提交于 2021-02-06 15:14:45
问题 I am working on app that can alert users for some critical things. I use local notifications to alert the user. On iOS, I find that the notifications will not ring if the phone is on vibrate. This is a deal-breaker for many users of the app but I have been putting that question off till now since I thought that iOS doesn't allow an app to play a sound if the app is in the background. Music apps are able to play songs even when the phone is on vibrate by enabling the audio background mode but

How do I mirror a UIImage picture from UIImagePickerController

孤街醉人 提交于 2021-02-06 15:14:02
问题 I'm trying to figure out if there is any way to mirror an image. For example, take a picture of someone's face and then cut it in half and show what their face looks like with each side mirrored. There doesn't seem to be any tricks like this in CGAffineTransform functions. Graphics experts please help!!! 回答1: The basic "trick" here is to use a scaling transform about the X or Y axis with a factor of -1. For example, you could use this to create a "flip about the horizontal axis" transform:

How are some alarm apps such as Alarmy able to play a sound on iPhone when the app is in the background and the phone is on vibrate

五迷三道 提交于 2021-02-06 15:11:21
问题 I am working on app that can alert users for some critical things. I use local notifications to alert the user. On iOS, I find that the notifications will not ring if the phone is on vibrate. This is a deal-breaker for many users of the app but I have been putting that question off till now since I thought that iOS doesn't allow an app to play a sound if the app is in the background. Music apps are able to play songs even when the phone is on vibrate by enabling the audio background mode but

How to crop a particular image in iphone

て烟熏妆下的殇ゞ 提交于 2021-02-06 14:20:36
问题 I am working on Camera Application user are taking a picture its fine,but i want to crop anywhere in that image and send it to server. How can I do this? 回答1: Check out this link for details: http://www.hive05.com/2008/11/crop-an-image-using-the-iphone-sdk/ Basic code: - (UIImage*)imageByCropping:(UIImage *)imageToCrop toRect:(CGRect)rect { //create a context to do our clipping in UIGraphicsBeginImageContext(rect.size); CGContextRef currentContext = UIGraphicsGetCurrentContext(); //create a

How to crop a particular image in iphone

☆樱花仙子☆ 提交于 2021-02-06 14:19:39
问题 I am working on Camera Application user are taking a picture its fine,but i want to crop anywhere in that image and send it to server. How can I do this? 回答1: Check out this link for details: http://www.hive05.com/2008/11/crop-an-image-using-the-iphone-sdk/ Basic code: - (UIImage*)imageByCropping:(UIImage *)imageToCrop toRect:(CGRect)rect { //create a context to do our clipping in UIGraphicsBeginImageContext(rect.size); CGContextRef currentContext = UIGraphicsGetCurrentContext(); //create a

How to check if the value in an NSDictionary exists in an array of dictionarys

醉酒当歌 提交于 2021-02-06 13:53:39
问题 The title is a bit confusing...I'll explain I have an NSMutableArray I am populating with NSMutableDictionary objects. What I am trying to do is before the dictionary object is added to the array, I need to check whether any of the dictionaries contain a value equal to an id that is already set. Example: Step 1: A button is clicked setting the id of an object for use in establishing a view. Step 2: Another button is pressed inside said view to save some of its contents into a dictionary, then

Unique identifier for peripheral BLE device

半世苍凉 提交于 2021-02-06 11:25:43
问题 So I have peripheral BLE device and I need some identifier for it to later share with another iPhone. Example I connect with iPhone 'A' to peripheral. iPhone 'A' saves peripheral's identifier to database and later I easily can take iPhone 'B' and connect to the peripheral found by this identifier. Now there is UUID what changes for every iPhone-peripheral connection, but MAC Address is not available. What could you suggest? 回答1: If you do not manufacture the peripheral yourself then you can

Unique identifier for peripheral BLE device

折月煮酒 提交于 2021-02-06 11:23:29
问题 So I have peripheral BLE device and I need some identifier for it to later share with another iPhone. Example I connect with iPhone 'A' to peripheral. iPhone 'A' saves peripheral's identifier to database and later I easily can take iPhone 'B' and connect to the peripheral found by this identifier. Now there is UUID what changes for every iPhone-peripheral connection, but MAC Address is not available. What could you suggest? 回答1: If you do not manufacture the peripheral yourself then you can

Check if a mobileconfig profile is installed on iOS

让人想犯罪 __ 提交于 2021-02-06 09:12:40
问题 Install mobileconfig file through (Installing a configuration profile on iPhone - programmatically) on iPhone Desktop. How to check whether this config file is installed? In iPhone Settings->General->provision file ,I can find the list. 回答1: I came across a the following approach to identify if the mobile config is installed or not,But I have not tested though so far. There is no direct API available to do this.But there is a workaround to achieve this by the means of certificate trust