ios8

How to handle remote notification in background IOS 8? [closed]

主宰稳场 提交于 2019-12-12 02:25:58
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I've searched the answer for 2 days, and still not getting the answer. The requirement is our server sends a APNS to my APP with some data, and I should right the data into userDefaults for further use. what I've done so far is making the didReceiveRemoteNotification work. So that

How to Save Image to Application Folder from UIImagePickerController?

可紊 提交于 2019-12-12 02:12:57
问题 I've a question in mind that driving me crazy. I've searched a lot to solve it, but all the answers that I found were old and not helped. I'm currently working on application with that uses UIImagePickerControllerDelegate and with didFinishPickingMediaWithInfo I want to save the selected image to application folder. Until now I'm able to select the image with this; - (IBAction)btnPressed:(UIButton *)sender { if ([UIImagePickerController isSourceTypeAvailable

All UITextField in a View

十年热恋 提交于 2019-12-12 02:07:27
问题 In viewDidLoad I would scan all UITextField and a set addTarget with the code below. I have 3 UITextField but only 1 of that is found. for subview in self.view.subviews { println(subview) if (subview.isKindOfClass(UITextField)) { var textField = subview as UITextField textField.addTarget(self, action: "textFieldDidReturn:", forControlEvents: UIControlEvents.EditingDidEndOnExit) textField.addTarget(self, action: "textFieldDidBeginEditing:", forControlEvents: UIControlEvents.EditingDidBegin) }

UITableViewAutomaticDimension return -1

Deadly 提交于 2019-12-12 01:57:40
问题 Hi I make tableviewcontroller class and I want to get cell height dynamicly so i use UITableViewAutomaticDimension but it always return me -1. tableView.rowHeight = UITableViewAutomaticDimension println("\(tableView.rowHeight)") tableView.estimatedRowHeight = 44 when I do tableView.rowHeight = 44 everything works great. My superclass is UIViewController. 回答1: You can only use UITableViewAutomaticDimension for footer/header height and only if you implement: - tableView:titleForHeaderInSection:

Establish synchronous connection with the sever in swift

吃可爱长大的小学妹 提交于 2019-12-12 01:54:03
问题 I have the following function to establish the connection synchronously with the sever on a particular IP and port, send a JSON request to sever and return the server's response to the calling function. func connserv(jsonString:NSDictionary){ var abc: NSDictionary? // This is the action performed when clicked on the Connect button on the connectivity screen println("------------------Function connserv") let prefs = NSUserDefaults.standardUserDefaults() var IP: AnyObject = prefs.objectForKey(

What is the name of this background app notice?

旧巷老猫 提交于 2019-12-12 01:53:56
问题 If I start a Voice Memo on iOS 8, and go to another app (e.g. Notes) then a red notice appears on the top of the screen (see below, "Recording 00:16"). What is the name of this notice? Where is the relevant iOS documentation? 回答1: You are talking about double-high status bar, this is caused when some other app is recording audio , fetching background locations , etc in background , the double height status bar suggests user that the app is using the resource. You can find relevant docs here

How to add InputTextView and UIButton to Navigation Controller's toolbar in iOS8?

本秂侑毒 提交于 2019-12-12 01:53:17
问题 Here's what I have so far: toolBar = self.navigationController?.toolbar textView = InputTextView(frame: CGRectZero) textView.backgroundColor = UIColor(white: 250/255, alpha: 1) textView.delegate = self textView.font = UIFont.systemFontOfSize(messageFontSize) textView.layer.borderColor = UIColor(red: 200/255, green: 200/255, blue: 205/255, alpha:1).CGColor textView.layer.borderWidth = 0.5 textView.layer.cornerRadius = 5 //textView.placeholder = "Message" textView.scrollsToTop = false textView

Get Page View to pop off on last screen

一个人想着一个人 提交于 2019-12-12 01:49:15
问题 I have a functional tutorial intro implemented into my app, but i just can't seem to get the page view to pop off when i swipe the screen for the last time. I thought dismissViewControllerAnimated:completion: would work - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController { NSUInteger index = ((PageContentViewController*) viewController).pageIndex; if (index == NSNotFound) { return nil; } index

Location alerts using Core Data to get around CLRegion 20 region cap

こ雲淡風輕ζ 提交于 2019-12-12 01:47:49
问题 I have an app that stores points of interest (POIs) in a Core Data managedObjectContext . My objective is to have alerts go off if currentLocation is within a specified range of a POI in the managedObjectContext . In reading about CLRegion , it seems the amount of regions that can be monitored is capped at 20. To get around the region monitoring cap, my game plan is to skim my managedObjectContext for latitude/longitude coordinates and compute distances between POIs every time my location

How to adapt or custom the shape of a IBOutlet button as the inner button's image in Swift iOS8

二次信任 提交于 2019-12-12 01:24:41
问题 I have an IBOutlet button dragged from Interface Builder (it's easier to play with it in auto layout ) I rotated it by 45° in code as learned here var transform = CGAffineTransformMakeTranslation(0.5, 0.5) var angle = CGFloat(M_PI / 3.9) // degress rotation 3.9 transform = CGAffineTransformRotate(transform, angle) button.transform = transform button.layer.rasterizationScale = UIScreen.mainScreen().scale button.layer.shouldRasterize = true button.setNeedsDisplay() now, I have diamond, triangle