ios8

Get image file type programmatically in swift

好久不见. 提交于 2019-12-18 10:56:35
问题 I am downloading images from parse with file totes PNG and JPEG. When image is downloaded to the app I need to determine what the file type is so I can handle image accordingly. Had a look at API for uiimageview and did a search but can't find any solution in swift. Any input appreciated Trying to get url from PFFIle §: let imageURLFromParse = NSURL(string : caseImageFile2.url); // Error here: 'NSURL?' does not have a member named 'pathExtension' if(imageURLFromParse.pathExtension!

iPhone 6/6 Plus: UITableView separator flickering and different thickness

心不动则不痛 提交于 2019-12-18 10:54:17
问题 I've got a UITableView with separator set to Single Line. On iPhones <= 5s everything looks fine, but on 6 and 6 Plus (device as well as simulator) the separators have a different thickness. It's even worse as they're flickering while scrolling which looks pretty bad. I don't set the height manually, so I have no idea what's causing this. As you can see, the first two lines are a little bit thicker than the next two. Now if I scroll, they change from thick to thin and back, so it looks like

How to correctly set application badge value in iOS 8?

你离开我真会死。 提交于 2019-12-18 10:39:25
问题 Old method [[UIApplication sharedApplication] setApplicationIconBadgeNumber:count]; is now gives error Attempting to badge the application icon but haven't received permission from the user to badge the application . Then I tried to use new API (that I'm think is related to badge value) CKModifyBadgeOperation * operation = [[CKModifyBadgeOperation alloc] initWithBadgeValue:50]; [operation setModifyBadgeCompletionBlock:^(NSError *error) { NSLog(@"%@", error); }]; [operation start]; But I'm

How do I get the return key to perform the same action as a button press in Swift?

五迷三道 提交于 2019-12-18 10:27:08
问题 I want to know how you allow an action to be made by either pressing the return key on the software keyboard or by tapping a UIButton. The UI button is already set up to perform an IBAction. How do I also allow users to press the return key on the keyboard to perform the same action? 回答1: Make sure your class extends the UITextFieldDelegate protocol SomeViewControllerClass : UIViewController, UITextFieldDelegate You can perform action as follows: override func viewDidLoad() { super

iOS 8 NavigationBar BackgroundImage

二次信任 提交于 2019-12-18 10:18:04
问题 With iOS 8 the concept of just iPhone and iPad sizes along with portrait and landscape have changed and therefor setting the navigation bars background image isn't working the same. Currently i'm using the following code: UIImage *NavigationPortraitBackground = [[UIImage imageNamed:@"nav-image-portrait"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; UIImage *NavigationLandscapeBackground = [[UIImage imageNamed:@"nav-image-landscape"] resizableImageWithCapInsets:UIEdgeInsetsMake(0

Xcode Obj - C - retrieve user inputed text from Alert Box IOS8

被刻印的时光 ゝ 提交于 2019-12-18 09:47:33
问题 i have the following code which will allow a user to input their full name into an alert box; //Creates the alert box UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Congratulations" message:@"You Have The High Score, Enter Your Name" preferredStyle:UIAlertControllerStyleAlert]; //Adds a text field to the alert box [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) { textField.placeholder = NSLocalizedString(@"Enter Full Name", @

Integrate iAd pre-roll video integration in my app?

痴心易碎 提交于 2019-12-18 09:39:20
问题 I want to integrate an iAd Pre-Roll video Ad to my application. When I run this application, it gives me this error: Domain=ADErrorDomain Code=0 "The operation couldn’t be completed. (ADErrorDomain error 0.) I want to know if this code is correct or incorrect. Thanks for your help. import UIKit import MediaPlayer import iAd class ViewController: UIViewController { var moviePlayer : MPMoviePlayerController! override func viewDidLoad() { super.viewDidLoad() let url = NSBundle.mainBundle()

Overlapping cells in static tableview built using storyboard

一笑奈何 提交于 2019-12-18 09:16:20
问题 All, I'm using the Xcode 6 beta to build an iOS8 project using storyboard and swift. In the storyboard, I've created a Table View Controller as my primary view when the application loads and have added a label to the first cell and a label to the second cell. The table looks fine in the storyboard, but when I run the application, the cells overlap. This is a brand new project with no other changes made or code added. You can see both the storyboard and the running application in the photo

Running tests on Xcode 6 and device

和自甴很熟 提交于 2019-12-18 08:56:37
问题 I am trying to run unit tests on Xcode 6 if I run them on the simulator (and 7.1 at that) they run fine other conditions yield this message: 2014-10-10 01:39:56.190 MyApp[493:173988] Error loading /private/var/mobile/Containers/Data/Application/A6C42E86-0147-4447-A605- FF864C5BD0F7/tmp/MyAppTests.xctest/MyAppTests: dlopen(/private/var/mobile/Containers/Data/Application/A6C42E86-0147-4447-A605- FF864C5BD0F7/tmp/MyAppTests.xctest/MyAppTests, 262): no suitable image found. Did find: /private/var

In iOS 8, how to add Row Action Buttons to the left side of a UITableViewCell

妖精的绣舞 提交于 2019-12-18 08:48:28
问题 Apple shows these images on their product page for iOS 8. I am interested in adding buttons to the left side of a table row as shown in the first image. Is this a public API? Note that I am already aware of the delegate method for adding buttons to the right side. I've looked through the WWDC session videos and documentation to no avail. Thanks in advance. Pic: buttons on left Pic: buttons on right 回答1: You can use the tableview delegate method: leadingSwipeActionsConfigurationForRowAt See