Check if Local Notifications are enabled in IOS 8

You can check it by using UIApplication ‘s currentUserNotificationSettings if ([[UIApplication sharedApplication] respondsToSelector:@selector(currentUserNotificationSettings)]){ // Check it’s iOS 8 and above UIUserNotificationSettings *grantedSettings = [[UIApplication sharedApplication] currentUserNotificationSettings]; if (grantedSettings.types == UIUserNotificationTypeNone) { NSLog(@”No permiossion granted”); } else if (grantedSettings.types & UIUserNotificationTypeSound & UIUserNotificationTypeAlert ){ NSLog(@”Sound and alert permissions “); } else if (grantedSettings.types & UIUserNotificationTypeAlert){ NSLog(@”Alert … Read more

iOS 8 / Safari 8 not working with ASP.NET AJAX-Extensions

Beware that this solution is only applicable to .NET version < 4.0 So here it is… Working UA: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36 Not working UA: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.1.17 (KHTML, like Gecko) Version/7.1 Safari/537.85.10 The problem lies in the major version-change to AppleWebKit/600. ASP.NET … Read more

Load image from iOS 8 framework

While @Renatus answer is perfectly valid and addresses the core issue (bundle for framework needs to be specified), I wanted to post the solution I went with since it’s slightly more direct: Swift 3.0/4.0/5.0 let image = UIImage(named: “YourImage”, in: Bundle(for: YOURFRAMEWORKCLASS.self), compatibleWith: nil) Alternatively, you can use this pattern for non-class, aka non-“static”, functions: … Read more

How can I pause and resume NSTimer.scheduledTimerWithTimeInterval in swift?

You need to invalidate it and recreate it. You can then use an isPaused bool to keep track of the state if you have the same button to pause and resume the timer: var isPaused = true var timer = NSTimer() @IBAction func pauseResume(sender: AnyObject) { if isPaused{ timer = NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector: Selector(“somAction”), … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)