UIButton Image + Text IOS

I see very complicated answers, all of them using code. However, if you are using Interface Builder, there is a very easy way to do this: Select the button and set a title and an image. Note that if you set the background instead of the image then the image will be resized if it … Read more

Animate text change in UILabel

I wonder if it works, and it works perfectly! Objective-C [UIView transitionWithView:self.label duration:0.25f options:UIViewAnimationOptionTransitionCrossDissolve animations:^{ self.label.text = rand() % 2 ? @”Nice nice!” : @”Well done!”; } completion:nil]; Swift 3, 4, 5 UIView.transition(with: label, duration: 0.25, options: .transitionCrossDissolve, animations: { [weak self] in self?.label.text = (arc4random()() % 2 == 0) ? “One” : “Two” }, … Read more

How to detect total available/free disk space on the iPhone/iPad device?

UPDATE: Since a lot of time has passed after this answer and new methods/APIs have been added, please check the updated answers below for Swift etc; Since I’ve not used them myself, I can’t vouch for them. Original answer: I found the following solution working for me: -(uint64_t)getFreeDiskspace { uint64_t totalSpace = 0; uint64_t totalFreeSpace … Read more

Detect iPad users using jQuery?

iPad Detection You should be able to detect an iPad user by taking a look at the userAgent property: var is_iPad = navigator.userAgent.match(/iPad/i) != null; iPhone/iPod Detection Similarly, the platform property to check for devices like iPhones or iPods: function is_iPhone_or_iPod(){ return navigator.platform.match(/i(Phone|Pod))/i) } Notes While it works, you should generally avoid performing browser-specific detection … Read more

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