ios8

Detect iPhone Volume Button Hold? (iOS 8)

廉价感情. 提交于 2019-12-21 12:22:57
问题 Is there a way to detect if any of the volume buttons on the iPhone are being held? I know you can detect if one has been pressed, but I specifically need to know if one is being held down. 回答1: That's not really possible, but you can have an approximation starting a timer every time you get a volume button pressed event, since you'll receive multiple events in succession when the button is hold. If every time you restart the timer, when the button is released the timer will get triggered and

UIActionSheet with swift

断了今生、忘了曾经 提交于 2019-12-21 07:56:22
问题 I created an action sheet, but the problem is that the delegate method is not called myActionSheet = UIActionSheet() myActionSheet.addButtonWithTitle("Add event") myActionSheet.addButtonWithTitle("close") myActionSheet.cancelButtonIndex = 1 myActionSheet.showInView(self.view) /// UIActionSheetDelegate func actionSheet(myActionSheet: UIActionSheet!, clickedButtonAtIndex buttonIndex: Int){ if(myActionSheet.tag == 1){ if (buttonIndex == 0){ println("the index is 0") } } } I used another way

UIBarButtonItems shift position when UINavigationController is presented modally

时光总嘲笑我的痴心妄想 提交于 2019-12-21 07:55:15
问题 I'm presenting a UINavigationController modally, from within an iOS app extension: UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc]; nav.modalPresentationStyle = UIModalPresentationFormSheet; nav.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentViewController:nav animated:YES completion:nil]; When the navigation controller appears, its root view controller's UIBarButtonItems jump position: I'm creating and adding the buttons

Xcode 6.1 Swift issue - 'init()' is unavailable: superseded by import of -[NSObject init]

荒凉一梦 提交于 2019-12-21 07:09:14
问题 I have just upgraded my Xcode to 6.1 an am now getting a strange compilation error. 'init()' is unavailable: superseded by import of -[NSObject init] I am subclassing SCNNode and have a optional references to other classes of the same type I am defining. i.e. import UIKit import SceneKit class BayNode: SCNNode { var leftBay:BayNode? var rightBay:BayNode? func addLeftBay() { leftBay = BayNode() // 'init()' is unavailable: superseded by import of -[NSObject init] } } Does anybody know how I can

CLLocationManager.authorizationStatus() always CLAuthorizationStatus.NotDetermined with swift&objC app

折月煮酒 提交于 2019-12-21 07:07:03
问题 I just can get my CLLocationManager to authorise. (swift under ios8) I even add an explicit requestAlwaysAuthorization call (which I don't need with objC under ios7) func finishLaunch() { //ask for authorization let status = CLLocationManager.authorizationStatus() if(status == CLAuthorizationStatus.NotDetermined) { self.locationManager.requestAlwaysAuthorization(); } else { self.startMonitoring() } ... } the callback never gets anything but NotDermined and there is no UIAlertView shown to the

Snapshot methods broken on iPhone 6 device and simulator

旧街凉风 提交于 2019-12-21 06:58:50
问题 For some unknown reason there seems to be a possible bug with all screenshot methods on the iPhone 6 simulator (and device). Whenever I call any of the screenshot methods including: snapshotViewAfterScreenUpdates: resizableSnapshotViewFromRect: drawViewHierarchyInRect: with afterScreenUpdates set to YES, the screen flickers. If set to NO, then no flicker occurs, but I am unable to get the functionality that I need. These methods work fine with both iOS7.1 and iOS8 in all other simulators

iOS 8 3rd party keyboards don't register javascript/jQuery keyup, keypress, keydown etc

风流意气都作罢 提交于 2019-12-21 06:51:12
问题 When using a 3rd party keyboard like Swiftkey javascript events like keypress don't register. For example Google maps autocomplete won't work https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete Seems like an iOS bug but any ideas on how I can get around this? 回答1: Would this work? jQuery('#text_box').on('input propertychange paste', function() { // text has changed... }); JSFIDDLE 回答2: You can just manually fire keypress events. $textBox = $('#text_box') /

Local notification sound not working

若如初见. 提交于 2019-12-21 06:18:34
问题 I'm trying to make an alarm app but when I try to make a local notification I am unable to play the sound. I got this error: [user info = (null)} with a sound but haven't received permission from the user to play sounds] Here is the code: @IBOutlet var setAlaram: UIDatePicker! @IBAction func setAlarmButton(sender: AnyObject) { var dateformater = NSDateFormatter() dateformater.timeZone = NSTimeZone .defaultTimeZone() dateformater.timeStyle = NSDateFormatterStyle.ShortStyle dateformater

Handoff not working from native app to website

a 夏天 提交于 2019-12-21 05:15:22
问题 My devices: iPad Mini (latest), iOS 8 dp5. Macbook Air, Yosemite dp5. I have Handoff working between the two above devices. Safari, Mail, Messages, Calendar, etc. all handoff with no problems. I can even handoff between my website on the Air and my native app on the iPad. What I can't do yet is go from my native app on the iPad to my website in Safari on my Air. For the first view controller that loads in my native app, I have this: - (void)viewDidLoad { [super viewDidLoad]; NSUserActivity

iOS 8: Remove sensitive information from views before moving to the background

拥有回忆 提交于 2019-12-21 05:13:10
问题 In iOS 7 my app presented an authentication screen when the app went into the background (by subscribing to UIApplicationDidEnterBackgroundNotification ). The authentication controller removed sensitive information so the background screenshot did not show any user info. In iOS 8 this does not work anymore. The background screenshot now shows the view the user was last working in and not the authentication controller... even though when the app comes back into the foreground the