ios8

UILocalNotification not showing in the lock screen

夙愿已清 提交于 2019-12-13 00:41:10
问题 Is there any special parameters an UILocalNotification has to have in order to show on the lock screen like the Facebook Messenger messages? My notification does appear on the notification center under "notifications". I think the behaviour is similar to the AppStore notifications in where they are only shown as a notification but the user is never alerted. 回答1: You probably didn't add .Badge when you did your registerUserNotificationSettings . You should have let settings =

How do I extend a NSManagedObject to contain MKAnnotation in Swift?

爱⌒轻易说出口 提交于 2019-12-13 00:40:47
问题 I have a Photo class class Photo: NSManagedObject { } I want to extend it to provide MKAnnotation I tried doing it so by extension Photo: MKAnnotation { var coordinate: CLLocationCoordinate2D However the compiler complains that extensions cannot have stored properties. Is there a better way of accomplishing this? Thanks. 回答1: You cannot have stored properties, but you can have calculated properties! I.e: var coordinate : CLLocationCoordinate2D { get { return CLLocationCoordinate2D(latitude:

launch Youtube channel on your App Swift Code

余生长醉 提交于 2019-12-12 21:19:40
问题 I have spent some days to find the Swift code for youtube Channel to open from my app. but i couldn't find At all, can some one help me please!! i need the Code in Swift. 回答1: Update for Swift 3 and iOS 10+ OK, here is how to do it in Swift 3. Basically, there are two easy steps to achieve this: First, you have to modify Info.plist to list Youtube with LSApplicationQueriesSchemes . Simply open Info.plist as a Source Code, and paste this: <key>LSApplicationQueriesSchemes</key> <array> <string

IOS8 Text in TextField Bounces on Focus

我的未来我决定 提交于 2019-12-12 18:33:06
问题 There is a weird bug where I switch to a screen in my app. This causes the first textfield to become first responder and the cursor is inside the textfield. Then type some text into the field and switch focus to the next textfield, this causes the text in the first box to bounce up and come back down. This happens only on the first time of coming to the screen in question. In order to replicate I need to back out of the screen and go back to it. Any ideas what would cause the text to bounce

iOS8 simulators error

不打扰是莪最后的温柔 提交于 2019-12-12 15:47:00
问题 Try to start my project on one iOS8 simulator and Xcode shows error: An error was encountered while running (Domain = NSMachErrorDomain, Code = 5) No one of iOS8 simulator can't be started. What to do? 回答1: "iOS Simulator" -> "Reset Content And Settings..." ^ this helps. 回答2: I ran into the same error just this morning, and I haven't completely figured it out, but I have observed something which might help you (or both of us, if anyone else stumbles across this and has more information). I

Xcode 8 beta 6 - App image broken in iOS 8

删除回忆录丶 提交于 2019-12-12 13:16:51
问题 I have Installed Xcode 8 beta 6 and deployed the app into iOS 8 - 10 device to test. I found some app images are broken in iOS 8 device (Please refer to the image shown below) It works perfectly fine in iOS 9 and iOS 10 Is it a bug from Apple? Anyone having the same problem? Many thanks. Possible duplicate to : Xcode 8 simulator ios 8 image get distorted Update: Xcode 8 GM build fixed this problem 回答1: I'm having the same issues too. I found that the same image on iPhone 4s was distorted but

Blue banner “Your app is using your location” is not showing after exiting my app

一曲冷凌霜 提交于 2019-12-12 11:26:04
问题 My application is using core location in background mode, when app is in background mode and sending GPS coordinates periodically, the blue banner "Your app is using your location" is not showing (like google map app for example). Any idea of what I could have missed ? 回答1: To show blue bar, you should 1: Enable Background Location Updates in target Capabilities. Then set locationManager allowsBackgroundLocationUpdates to YES; 2: Add NSLocationWhenInUseUsageDescription in info.plist file (8.0

Debug view hierarchy does not render UI

亡梦爱人 提交于 2019-12-12 10:38:59
问题 i'm trying to use the view hierarchy feature on xcode 6 to see the draggable layout of my app, but all i get is a blank area where it should be. after trying out lots of suggestions from SO and other places, nothing works. I have had the sim running with or without break points, different sim devices, different apps, but nothing works. I know you're just supposed to click on the button while the app is being simulated and it's supposed to pop up, but when i do it the main interface with the

How should I present a UISearchController using a UISplitView adaptive user interface?

匆匆过客 提交于 2019-12-12 10:34:10
问题 Using a universal storyboard with an adaptive UISplitViewController user interface. I want to present a search controller on the primary (master) side, using the following code (from the master view controller): static NSString * const kCGISearchViewControllerID = @"SearchViewControllerID"; - (IBAction)searchButtonClicked:(UIBarButtonItem *)__unused sender { SearchViewController *searchResultsController = [self.storyboard instantiateViewControllerWithIdentifier:kCGISearchViewControllerID];

How can I download datas from multiple URL in concurrency mode?

时光总嘲笑我的痴心妄想 提交于 2019-12-12 10:18:16
问题 I have tried this link for download only one URL. Successfully working for pause and resume too. Now I am trying for multiple URL (i.e, for 5 URL). If 2nd URL is progressing, on that time if I start third URL means, 2nd is stopped. I don't know to run all url in concurrency. I have tried with NSOperationQueue. But I don't know exact syntax and also I don't know how to add task in Queue. There should not be any interruption between my URL links. How to do that? My code: var dict =