define('DISALLOW_FILE_EDIT', true); define('DISALLOW_FILE_MODS', true); Blog | WP Hosting

Blog

How to display a “spinning wheel” indicator in the centre of your screen

Posted by on 9:01 pm in Knowledge Base | Comments Off on How to display a “spinning wheel” indicator in the centre of your screen

Sometimes you want to tell the user that something’s happening behind the scenes and that there’s no need to panic. While your process is happening you can display a “spinning gear” in the middle of your screen. One way of doing this is via a UIActivityIndicatorView. You can create them in Interface Builder, but it’s very easy to create one and show it if and when necessary. Here’s how: - (UIActivityIndicatorView *)indicator { if (!_indicator) { _indicator = [[UIActivityIndicatorView...

read more

How to load a different storyboard depending on screen size in iOS

Posted by on 2:00 pm in Knowledge Base | Comments Off on How to load a different storyboard depending on screen size in iOS

As much as I appreciate the idea of Auto Layout, I don’t think it likes me very much. In turn, I don’t like Auto Layout very much. The pain and hassle it takes to make several UI elements fit well on a 4 inch screen as well as a 3.5 inch screen regularly drives me crazy. On paper it’s a great idea – but in reality not fit for prime time. It’s not a coincidence that we can choose completely different storyboards for iPads and iPhones. Let’s take the same approach when dealing with the two different iPhone...

read more

How to dismiss the iOS Keyboard when the done button is pressed

Posted by on 11:03 am in Knowledge Base | Comments Off on How to dismiss the iOS Keyboard when the done button is pressed

It has puzzled many generations how to get rid of the keyboard when the user is done entering text into an iOS text field. There doesn’t seem to be an obvious action we can attach to make this happen. That’s because rather than looking at the keyboard itself, we need to look at what actually brought it up in the first place: the UITextField. Even though the text field can trigger an action, we don’t want to touch that for dismissing the keyboard. All we need to do is to implement the following method from its delegate...

read more

Links to the latest Social Icons

Posted by on 10:51 pm in Knowledge Base | Comments Off on Links to the latest Social Icons

Facebook, Twitter & Co. change their brandings every now and again, and every time I need them for a project I keep scrambling to find the official links. Well no more – here’s a list of them all: Twitter: https://about.twitter.com/press/brand-assets Facebook: https://www.facebookbrand.com LinkedIn: http://developer.linkedin.com/documents/branding-guidelines Apple and App Store: https://developer.apple.com/app-store/marketing/guidelines/

read more

How to increase your Build Number automatically every time you build your Xcode Project

Posted by on 5:21 pm in Knowledge Base | Comments Off on How to increase your Build Number automatically every time you build your Xcode Project

Xcode includes something rather magical called the Apple Generic Versioning Tool. With this tool you can increase your Build Number automatically every time you hit “Build and Run” in Xcode. Here’s how you can add it to your project. I’m using Xcode 5.1 here with a new Single View iOS project. But this will work just fine in other versions of Xcode. By default, Version and Build are set to 1.0 (in your app target, under the General tab). We want to leave Version alone and only increase Build. Head over to the Build...

read more

How to read you App Version and Build from the Main Bundle

Posted by on 4:52 pm in Knowledge Base | Comments Off on How to read you App Version and Build from the Main Bundle

The required Version and Build numbers you add to Xcode make it into your app’s Main Bundle. You can retrieve those values from the Main Bundle and use them in your app. Here’s how: - (void)viewDidLoad { [super viewDidLoad]; // set version and build fields from bundle NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; NSString *build = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]; // display in your own labels...

read more

What are the button indexes in a three-button UIAlertView

Posted by on 3:12 pm in Knowledge Base | Comments Off on What are the button indexes in a three-button UIAlertView

The cancel button is always index 0, and all other buttons in the array start at index 1 counting up. For completion, here’s how to create it: - (IBAction)showAlert:(id)sender { // create an alert view with three buttons UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"Three Button Alert" message:@"This is an alert view with more than two buttons. Will it work?" delegate:self cancelButtonTitle:@"No Way (0)" otherButtonTitles:@"Perhaps (1)",...

read more

P2 Header Ad – Version 1.1 released

Posted by on 5:55 pm in Knowledge Base, Plugins | 0 comments

I’ve just released a quick update for my P2 Header Ad plugin for WordPress: http://wordpress.org/plugins/p2-header-ad/ I’ve added a tickbox which allows you do disable the add for logged-in users so the ad will only be shown to visitors. The release is also available on GitHub: https://github.com/versluis/P2-Header-Ad Here’s a quick peek at the admin interface:

read more

How to use your own random header images in TwentyThirteen

Posted by on 1:17 am in Knowledge Base, Themes | 0 comments

I really wanted to use the new WordPress TwentyThirteen theme over on my other site http://www.versluis.com. But I didn’t like the idea of using the default header images. Since my previous theme had random header images, I thought it would be great to tap into the now built-in function and prepare a child theme that overrides those existing header images with my own. Here’s how I did it: first we’ll create a child theme then we’ll remove the existing header images and add our own images As a final touch I’ve...

read more

How to remove __MACOSX from zip archives

Posted by on 12:16 am in Knowledge Base | 0 comments

Creating a ZIP file on your Mac is really easy: select a few files in Finder, right-click on those and select “Compress…”. It’s the equivalent of selecting “Send to ZIP Folder” under Windows. But Mac OSX does something rather bizarre when creating ZIP files: it adds several unnecessary, unwanted and un-called-for files starting with __MACOSX. This drives PC users nuts – and believe me, it drives Mac users nuts too. Thankfully there is a relatively easy way to remove those files. This may not always be...

read more