ios8

Using UILexicon to implement autocorrect in iOS 8 Keyboard Extension

六月ゝ 毕业季﹏ 提交于 2019-12-22 03:48:54
问题 I've seen that this question has been asked a few times, but no one seems to have an answer. I am trying to create an autocorrect feature on a custom keyboard, but I am completely lost as to how to do so. Apple gives some documentation, but it's not very detailed. I know it has something to do with UILexicon data, but I'm not sure what to do with it and how to use it to correct strings of text the user is typing. Any help would be greatly appreciated. What I have found so far: let controller

Can't use Swift classes inside Objective-C unit test

﹥>﹥吖頭↗ 提交于 2019-12-22 03:40:10
问题 I have followed this recipe in order to use a Swift class in an existing Objective-C project MyProject . That works fine. However, I'm still not able to use the same Swift class in the same project's unit tests. The compiler marks the line where my Objective-C unit test says #import "MyProjectTests-Swift.h" with file not found . If tried changing the test target's Product Module Name from its default MyProjectTests to MyProject as suggested in a comment to this (unanswered) question. However

resignFirstResponder in Swift

痞子三分冷 提交于 2019-12-22 03:21:44
问题 How can I implement it in the new language of Apple: Objective-C code: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { for (UIView *view in self.view.subviews) [view resignFirstResponder]; } I have tried to do so. But the keyboard does not disappear: Swift code: override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { super.touchesBegan(touches, withEvent: event) self.view.resignFirstResponder() } 回答1: You could probably go with: self.view.endEditing(true) 回答2

How to debug javascript code inside a WKWebView

廉价感情. 提交于 2019-12-22 03:19:10
问题 I'm having some trouble with running a webapp in a WKWebView (specifically: some buttons are not responding). I used this tutorial as a guide and did succeed in having the webview display my webapp. So now I want to debug the javascript code. I know the webapp works, since I've tried it in both an android webview as well as countless browsers (including safari on the iPad simulator I'm using). After some quick googling, I found out how to debug javascript inside a UIWebView using Safari.

Reposition legal label ( MKAttributionLabel )

爷,独闯天下 提交于 2019-12-22 02:00:42
问题 I'd want to move the Legal label to the right side. On iOS 6 and 7 the below solution was working fine, however on iOS 8.3 it seems to not work. I get the label, then with a timer (0.1 sec) in viewDidLayoutSubviews I call this method : -(void)moveLegalLabel { UIView * legalLink = [self attributionView]; legalLink.frame = CGRectMake(self.mapView.frame.size.width - legalLink.frame.size.width - 10, self.mapView.frame.size.height - legalLink.frame.size.height - 10 , legalLink.frame.size.width,

Can I Animate an image iOS8 LaunchScreen.xib

这一生的挚爱 提交于 2019-12-22 01:51:00
问题 Question: Are there ways to animate anything within the LaunchScreen.xib file of an Xcode 6 Project targeted to deploy for iOS 8.1+ ? Context: I'm looking to make simple animations to convey activity or serve as a distraction to the user while they wait... Examples: A Loading Bar Activity Indicator Animated GIF Move a UIImage across the Screen Rotate an Image 回答1: Nope. The Launch Image is shown only during the time period between when the user chooses to launch your app and when your app has

How to listen for notification dismissed event in iOS?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 01:43:43
问题 I am listneing to actions pressed for my local notifications, but is there a way to determine when the user dismisses a notification? Here is how I'm listening to my actions in my AppDelegate, but the dismiss doesn't fire this: func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forLocalNotification notification: UILocalNotification, completionHandler: () -> Void) { var actionName: String? = nil if let identifier = identifier { switch identifier { case

Open local PDF file in iBooks

坚强是说给别人听的谎言 提交于 2019-12-22 00:56:19
问题 I am trying to open a PDF file that I have stored locally within my app in iBooks. The app currently has a list of "literature" in a table view and when each cell is tapped the app segues to a webView that displays the PDF file (works great). I have made a BarButton at the top right in navBar to allow the user to open the PDF in iBooks (so they can store it on his/her device). So far the button will open a UIDocumentInteractionController that displays all apps on the device that can open the

How to rotate sprite in sprite kit with swift

本小妞迷上赌 提交于 2019-12-21 22:20:57
问题 Hi my problem is regarding the rotation of two sprites. When I touch the right half of the screen the rotation starts and moving sprite2 and sprite3. If I touch the left half of the screen the rotation stops because velocity-velocity = 0. If I touch the left half again the rotation begins. However, if I touch the half of the screen corresponding with the current rotational-direction the velocity is duplicated. I want to be able to change the direction of the rotation, but for the speed to

ios 8.4.1 webview black screen

╄→гoц情女王★ 提交于 2019-12-21 21:51:21
问题 I need to make an application in ios in a simple webview. I use example recently upgraded ios 8.4.1. After the upgrade, the application stops working, displays a black screen. import UIKit import WebKit class ViewController: UIViewController, WKNavigationDelegate { var webView: WKWebView? /* Start the network activity indicator when the web view is loading */ func webView(webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation){ UIApplication.sharedApplication()