Skip to main content

Posts

Showing posts from October, 2011

Xcode from scratch for scaredy cats: Your first line of code (UIColor)

In the previous 'Xcode from scratch for scaredy cats' post I showed you how to create an app without any code at all. This time we're going to modify that app using some actual code. For this you'll need to open the project file from last time: "StaticImage.xcodeproj" (return to point 5 of the previous post if you've forgotten how to view the project files in Xcode).

I'm going to approach this gently and only use one line of code in this entire post. Here's what the line of code looks like:
self.view.backgroundColor = [UIColor yellowColor];
The question is:
What does it do and where does it go?
It changes (or "sets") the background colour of our view to yellow and it goes in the "StaticImageViewController.m" file right beneath the comment "// Do any additional setup after loading the view, typically from a nib."


This comment is inside something called a "method". The method "viewDidLoad" looks like this:

Xcode from scratch for scaredy cats: Ten easy steps to an iOS app (UIImageView)

You'll need to install Xcode from the Mac App Store or Apple Developer Connection if you haven't done so already. After which follow these ten easy steps to your first iOS app.

(1) Open Xcode



(2) From the welcome screen select "Create a new Xcode project"



(3) Choose type of app: "iOS -> Application -> Single View Application"



(4) Choose a name for your app, here we'll use "StaticImage". Insert this name in two places: "Product Name" and "Class Prefixes" boxes. Then select device family: choose iPad for this example (although iPhone would do equally well).



(5) Click to expand "StaticImage" project in left-hand column, so everything looks like this



(6) Go to Finder and find an image on your system, then drag and drop it into the "StaticImage" folder inside Xcode app. Here I use one called "crow.png". On the dialogue box that appears simply click on "Finish".



(7) Next select the file &qu…

Google ebookstore: UK launch

Google launched its ebookstore in the UK yesterday (6 October 2011). The advantages of which are that its eBooks (even when DRM protected by the publisher) run on most eInk Readers (with the major exception of the Kindle) thanks to the adoption of the ePUB format alongside Adobe's DRM. You can also view your books on the web, or in a web app using the Google Chrome browser. In addition to which there are iPad/iPhone and Android apps to access your content.
Pages sync between devices, and the interface is clean and simple on the web and in the apps. Also, Google incorporates the PDF alongside the ePUB, so that you can check how the page rendered in the print book very easily by selecting the settings menu (which is denoted by "Aa") and changing from "Flowing text" to "Scanned pages" (where the publisher has enabled this feature).

One thing that isn't present at the moment is the ability to take notes or highlight text inside the app, but no doubt thi…