ios8

How to transition scenes in Swift

大兔子大兔子 提交于 2019-12-17 15:57:16
问题 In Objective-C, using Sprite-Kit, I would successfully use something like the following code in Objective-C to bring up a new scene if ([touchedNode.name isEqual: @"Game Button"]) { SKTransition *reveal = [SKTransition revealWithDirection:SKTransitionDirectionDown duration:1.0]; GameScene *newGameScene = [[GameScene alloc] initWithSize: self.size]; // Optionally, insert code to configure the new scene. newGameScene.scaleMode = SKSceneScaleModeAspectFill; [self.scene.view presentScene:

Get Device Token in iOS 8

一笑奈何 提交于 2019-12-17 15:39:58
问题 I need device token to implement push notification in my app. How can I get device token since didRegisterForRemoteNotificationsWithDeviceToken method is not working on iOS 8. I tried this code in app delegate but it is not giving me device token. [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]]; [[UIApplication

Exposing an app's ubiquitous container to iCloud Drive in iOS 8

余生颓废 提交于 2019-12-17 15:34:28
问题 I'm developing an iCloud-enabled app where users will be able to import and export files via iCloud Drive. When browsing iCloud Drive, either using the UIDocumentPickerViewController (iOS 8) or the Finder (OS X Yosemite), I can see directories created/owned by other iCloud-Drive-enabled apps, such as, Automator, Keynote, or TextEdit. I want our app to expose its ubiquitous documents directory in iCloud Drive, too, but haven't been able to figure it out yet. Within some of the aforementioned

Rendering PDF in UIWebView iOS 8, causes a black border around PDF

妖精的绣舞 提交于 2019-12-17 15:34:25
问题 In iOS 8, when rendering a .PDF into a UIWebview there is a black border and background around the PDF displayed (not the whole background view). Note this is not the UIWebview background which is set to: myWebView.opaque = NO; myWebView.backgroundColor = [UIColor clearColor]; This is not present in < iOS8, (no black bordering coloured background around the .PDF) Anyone else experienced this who could shed some light on this? Im loading my PDF into the Web view like so.. - (void

iOS 8 requestWhenInUseAuthorization no Popup

 ̄綄美尐妖づ 提交于 2019-12-17 15:34:09
问题 I tried to make my AppProject iOS 8 ready. I had read a lot about [_locationManager requestWhenInUseAuthorization]; and the entry in plist NSLocationWhenInUseUsageDescription So I changed all the necessary code lines. It works fine, but now I have copied my project again from my iOS 7 base to include new features. But when I make the changes for the iOS8 Location Privacy the Popup doesn't appear anymore. My code worked until I copied. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist

Xcode: Using custom fonts inside Dynamic framework

时光总嘲笑我的痴心妄想 提交于 2019-12-17 15:33:21
问题 I added custom font to a framework. I followed all the steps, but it doesn't work. I am able to set the font in Interface Builder, but when I build the project it doesn't show this font on the simulator/device. 回答1: I'm here a bit late, but I took PetahChristian's solution and created a Swift version in the form of an extension. This is working for me. I've found that when you try to get a font using a font name and a size using the regular way that it always looks in the main bundle for the

NavigationBar bar, tint, and title text color in iOS 8

一笑奈何 提交于 2019-12-17 14:59:22
问题 The background text in the status bar is still black. How do I change the color to white? // io8, swift, Xcode 6.0.1 override func viewDidLoad() { super.viewDidLoad() self.navigationController?.navigationBar.barTintColor = UIColor.blackColor() self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.orangeColor()] } 回答1: In AppDelegate.swift , in application(_:didFinishLaunchingWithOptions:) I put the following: UINavigationBar.appearance()

Failed to import bridging header

℡╲_俬逩灬. 提交于 2019-12-17 10:44:42
问题 I've read a lot of questions and answers that deal with a similar issue, but I have yet to find a solution. If anyone could shed some light, that would be wonderful. I created a Swift project and now I want to combine it with some Objective-C. My "failed to import bridging header" only occurs when I attempt to #import my Chartboost.h file. So, as long as I don't have anything in my bridging header file, Xcode finds it and gives me no issue. But once I add this: #import <Chartboost/Chartboost

UITableView dynamic cell heights only correct after some scrolling

北城以北 提交于 2019-12-17 10:12:16
问题 I have a UITableView with a custom UITableViewCell defined in a storyboard using auto layout. The cell has several multiline UILabels . The UITableView appears to properly calculate cell heights, but for the first few cells that height isn't properly divided between the labels. After scrolling a bit, everything works as expected (even the cells that were initially incorrect). - (void)viewDidLoad { [super viewDidLoad] // ... self.tableView.rowHeight = UITableViewAutomaticDimension; } -

launch containing app from iOS8 Custom Keyboard

守給你的承諾、 提交于 2019-12-17 08:53:24
问题 I want to launch my containing app. I tried using URL schemes. The URL scheme launched the app from other places - so the problem is not there. Looks like this object is nil: self.extensionContext thus i can't run this method: [self.extensionContext openURL:url completionHandler:nil]; Can I launch my app? Do URL Schemes work in a custom keyboard? thanks! 回答1: Try this code UIResponder* responder = self; while ((responder = [responder nextResponder]) != nil) { NSLog(@"responder = %@",