ios8

How to get Original Image and media type from PHAsset?

这一生的挚爱 提交于 2019-12-19 08:29:07
问题 My **GMImagePickerController** returns the list of selected images from photos app. The code are as follows. - (void)assetsPickerController:(GMImagePickerController *)picker didFinishPickingAssets:(NSArray *)assetArray { NSLog(@"%@",assetArray); NSLog(@"GMImagePicker: User ended picking assets. Number of selected items is: %lu", (unsigned long)assetArray.count); } The assetArray return result like this, I selected 3 images from photos app ( "<PHAsset: 0x7fa39e02e840> 1AEEF04A-F8AB-4019-AAB5-

iOS 8 Orientation change: Keyboard frame does not display correctly

末鹿安然 提交于 2019-12-19 08:17:11
问题 This is only an iOS 8 problem, the keyboard displays correctly in iOS 7 with device orientation change. My application supports both portrait and landscape orientation and uses autolayout. If I push a UIViewController subclass that contains a UITextField subclass onto a navigation stack and the UITextField becomes the first responder in portrait orientation then the default keyboard displays correctly. However, if I rotate the device to landscape orientation then the UIViewController subview

iOS get Keyboard Window

戏子无情 提交于 2019-12-19 07:17:09
问题 So in iOS 7 I always got the Keyboard Window like this: - (UIView *)keyboardView { UIWindow* tempWindow; //Because we cant get access to the UIKeyboard throught the SDK we will just use UIView. //UIKeyboard is a subclass of UIView anyways UIView* keyboard; NSLog(@"windows %d", [[[UIApplication sharedApplication]windows]count]); //Check each window in our application for(int c = 0; c < [[[UIApplication sharedApplication] windows] count]; c ++) { //Get a reference of the current window

How to List discoverable Bluetooth devices and already paired devices in iOS, which method to use in swift?

孤街浪徒 提交于 2019-12-19 06:59:52
问题 I would like to include Bluetooth feature on my app using swift. I want to list all nearby/discoverable peripheral devices including those devices are already paired Which method i should use for listing the paired devices. Im using CoreBlutooth framework for implementing Bluetooth availability check. If Bluetooth works fine i would like to list out paired devices. And if possible please provide the method for connecting the device directly from the listed paired devices func

Swift – Using popViewController and passing data to the ViewController you're returning to

北战南征 提交于 2019-12-19 06:42:05
问题 I have an optional bool variable called showSettings on my first view controller which is called ViewController , and I'm popping from SecondViewController back to ViewController . Before I pop, I want to set the bool to true. Seems wrong to instantiate another view controller since ViewController is in memory. What's the best way to do this? I'm not using storyboards, if that's important for your answer. Thanks for your help 回答1: So I figured it out, based mostly from this post – http:/

iOS8 Location: How should one request Always Authorization after user has granted “When In Use” Authorization?

早过忘川 提交于 2019-12-19 06:30:41
问题 When my app launches the map view, I request the iOS8 "When In Use" location permission. Assume user grants that. I would like to request the Always permission only when user opts-in to my geofencing feature. But calling CLLocationManager.requestAlwaysAuthorization has no effect because the current authorization status is no longer kCLAuthorizationStatusNotDetermined. How would one go about requesting the Always permission AFTER user has granted When In Use permission? I would think this is a

UIPopoverController not presenting in iPad iOS 8

社会主义新天地 提交于 2019-12-19 06:28:49
问题 I am using UIPopoverController in iOS 8 iPad for imagepicker .Its working in iOS 7 but not in iOS 8.The popover is not displayed and popoverControllerDidDismissPopover is called immediately.Please suggest a solution.. Here the code am using: UIPopoverController *popVC= [[UIPopoverController alloc] initWithContentViewController:pickerController]; _pop = popVC; _pop.delegate = self; [_pop presentPopoverFromRect:attachBtnFrame inView:_sender permittedArrowDirections:UIPopoverArrowDirectionAny

In iOS8 Safari, readonly inputs are handled incorrectly

被刻印的时光 ゝ 提交于 2019-12-19 06:17:10
问题 In Safari, iOS8, focusing in a date or a time input opens up the date or time picker and allows editing the content of the readonly input. When focusing in a text input, a toolbar appears at the bottom with previous, next and Done buttons, and not going away until Done is tapped, or another input on the page is tapped. When the input is focused programatically from Javascript, nothing is happening, but: if a touchstart event listener is added to some part of the page, touching anywhere will

Counting unique items in array. (Swift)

拟墨画扇 提交于 2019-12-19 06:04:30
问题 How do you count the amount of unique items in an Array? Example: let array:Array<Int> = [1,3,2,4,6,1,3,2] Count function: array.count will give 8 but I want to count unique items and this will give 5 回答1: You can use NSSet to throw away duplicates: let array:Array<Int> = [1,3,2,4,6,1,3,2] let count = NSSet(array: array).count println(count) This prints: 5 回答2: As of Swift 1.2 , Swift has a native Set type. Use the Set constructor to create a set from your array, and then the count property

UIAlertView changes to landscape when App is locked in portrait only in iOS8

时间秒杀一切 提交于 2019-12-19 05:58:21
问题 I have an app and its orientation is locked as portrait mode, but when I have a UIAlertView and turn the iPhone to landscape, the alert changes the orientation and crops the alert's overlay. Only in iOS8. Anyone had this error? 回答1: Yes I did get this issue. I have developed my code in iOS7 but had to do compatible with iOS 8 also. So I came across This link. I got my solution as follows: When you are working with iOS7 UIAlertView works fine but if you are working with iOS8 you have to use