A Simple Web Browser for iPhone

In this blog, we’ll learn how to use a UITextField in conjunction with a UIWebView to create a very simple web browser application. Using this technique as a foundation, you can build rather powerful web – based applications. So, let’s get started!

Open Xcode, and choose “Create a new Xcode project” from the welcome screen. In the next screen, choose the Single View Application template. Name your project “SimpleBrowser” and choose options as shown:

Click Next, choose a location to save the project, and Click Create. Once the project has been created, select the MainStoryboard.storyboard file. Drag a UILabel, UITextField, and UIWebView to the View as shown:

Open the ViewController.h file, and make the changes as shown:

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController

@property (nonatomic, strong) IBOutlet UITextField *address;
@property (nonatomic, strong) IBOutlet UIWebView *browser;

– (IBAction)addressEntered:(UITextField *)sender;

@end

We’ve added two properties, a UITextField named address, and a UIWebView named browser. Both of these properties are designated as IBOutlets, which means that they will be wired up to controls in our view. We’ve also added an action method (addressEntered:) that will also be wired up to a control.

Next, open up the ViewController.m file, and make the following changes:

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

@synthesize address;
@synthesize browser;

– (IBAction) addressEntered:(UITextField *)sender
{
    NSURL *url = [NSURL URLWithString:sender.text];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [self.browser loadRequest:request];
    self.browser.scalesPageToFit = YES;
    [sender resignFirstResponder];
}

– (void)viewDidLoad
{
    [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.
}
…

As is usually the case with properties declared in the .h file, we first synthesize them here. Next comes the implementation of the addressEntered: method. Notice that the sender of the event that triggers this method is a UITextField: the same text field we dragged to the view in the MainStoryboard.storyboard file earlier. In this method, we obtain the text from the sender, and make it into an NSURL object called url. Then we create an NSURLRequest object called request, using the url we just created.

The next step is to load the NSURLRequest into the browser using the loadRequest: method of UIWebView. This will load the web site specified into the web view. We make an attempt to scale the page to fit in the browser view; some pages can be scaled, others cannot. If the page cannot be scaled, this line will fail silently.

The last step in the method is to call resignFirstResponder on the sender. This will hide the keyboard associated with the text field, so the browser will not be obscured. All that now remains is to wire up the properties and the method to their corresponding controls.

Re – open the MainStoryboard.storyboard file, and right – click the View Controller object. Drag from the circle to the right of the address outlet to the UITextField, and from the circle to the right of the browser outlet to the UIWebView. Also drag from the circle to the right of the addressEntered received action to the UITextField; in the resulting popup, choose Did End On Exit. Finally, in the Attributes inspector for the text field, set the Return Key type to “Done,” as shown:


With all of the controls wired up, we should now be able to run the application successfully. Do so, and in the text field, enter http://www.google.com (for example). Note that this simple browser requires a well formed URL to be entered: we cannot just enter “google.com” for example: the full string must be present.

Since a UIWebView is scrollable, it is possible to use drag and swipe gestures to scroll a web page both horizontally and vertically with no additional coding. Also, if the web page is resizable, pinch gestures may be used to do so.

Take a look at the class reference for the UIWebView, and have fun enhancing this very simple browser application.




Daily iPhone App: Air Mail flies high in the sky

I saw several of Chillingo‘s upcoming titles at the Game Developers Conference in May. The most impressive one was Air Mail, an exploration-based flying game for the iPhone and the iPad. Not only are the graphics beautiful, but the controls must be experienced to be believed. They’re precise and complex, providing a real sense of flying through the air.

The production values are nice and high as well, featuring a great story, with plenty of varied missions and extra game modes. You can follow a mission mode with the story, take on a scoring mode to try and fly as expertly as possible, or just casually explore the great environments in an Explore mode.

The excellent game is US$4.99. I’m at E3 today, planning another visit to see what Chillingo has on tap for the future. If it can drum up more titles like Air Mail, their future will be bright indeed.

Daily iPhone App: Air Mail flies high in the sky originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 05 Jun 2012 08:40:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Apple store is down, what lies ahead? (Back up)

The Apple Store is down in the U.S., and most likely around the world as well. With it being a week away from WWDC, we wouldn’t be surprised if Apple did a few quiet bumps to existing product lines to get that excitement out of the way and the focus shifted to even bigger announcements next week. We’ll let you know what’s changed as soon as it’s back up!

…And it’s back up, with no obvious changes. Did you spot any differences? Let us know in the comments.

Apple store is down, what lies ahead? (Back up) originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 05 Jun 2012 03:03:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Instapaper update introduces automatic background updating

The latest Instapaper update contains a pretty nifty new feature: the ability to update automatically in the background; the app uses geofencing to turn updates on and off.

The Instapaper blog describes how the app will download articles whenever you enter a pre-set location, such as your home or work. You can add up to 10 locations using this feature.

Developer Marco Arment gives credit to News.me, which was first released in April 2011, for introducing the feature.

Arment reassures users that location data is only stored within the app and not shared with anyone. Arment also said there is no noticeable drain on battery life.

Instapaper also now has an Android version of the app, introduced today at a lower price point than the iOS app.

[Via The Verge]

Instapaper update introduces automatic background updating originally appeared on TUAW – The Unofficial Apple Weblog on Mon, 04 Jun 2012 18:30:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Daily Update for June 4, 2012

It’s the TUAW Daily Update, your source for Apple news in a convenient audio format. You’ll get all the top Apple stories of the day in three to five minutes for a quick review of what’s happening in the Apple world.

You can listen to today’s Apple stories by clicking the inline player (requires Flash) or the non-Flash link below. To subscribe to the podcast for daily listening through iTunes, click here.

No Flash? Click here to listen.

Subscribe via RSS

Daily Update for June 4, 2012 originally appeared on TUAW – The Unofficial Apple Weblog on Mon, 04 Jun 2012 17:15:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Fu-design Super Robot MacBook Air Sleeve: Review and giveaway

Last November I had the pleasure of reviewing an iPad case featuring a whimsical design created by Taiwanese-born graphic artist Keng-Fu Chu, AKA “Fu”. Now Fu has teamed up again with Echo Creative to bring Super Robot to the front of a cool envelope-like MacBook Air sleeve.

The Super Robot MacBook Air Sleeve (US$53.99 for 11″ or 13″ sizes) is a lightweight polyurethane sleeve that looks a lot like an interoffice envelope, but with a colorful rendition of one of Fu’s latest creations — Super Robot — zooming high above the Earth. Even the packaging is fun; see the gallery below for details.

The sleeve features a soft leather lining and a combination closure that includes a pair of strong magnets and an elastic band that imitates the look of those button-and-string closures you used to see on reusable envelopes. There’s also a soft “luggage tag” that attaches to the buttons and can be used to clean smudges off of your MacBook Air screen.

There’s just enough padding to keep your MacBook Air protected, but not so much as to make this sleeve fat and unwieldy. If you’re like me and throw your MBA into a backpack full of other tech gear, you’ll appreciate the way that the Super Robot Sleeve protects your laptop from scratches and bumps without taking up much more room than the naked laptop.

The Robot 99 iPad cases are sold out and appear to now be a collector’s item, so if you want one of these MacBook Air sleeves you’d better act quickly. Alternatively, you can enter our giveaway of an 11″ MacBook Air Sleeve from Fu-design today!

Here are the rules for the giveaway:
  • Open to legal US residents of the 50 United States, the District of Columbia and Canada (excluding Quebec) who are 18 and older.
  • To enter, fill out the form below completely and click or tap the Submit button.
  • The entry must be made before June 7, 2012 11:59PM Eastern Standard Time.
  • You may enter only once.
  • One winner will be selected and will receive a Fu-design Super Robot 11″ MacBook Air Sleeve valued at US$53.99)
  • Click Here for complete Official Rules.

Loading…

Fu-design Super Robot MacBook Air Sleeve: Review and giveaway originally appeared on TUAW – The Unofficial Apple Weblog on Mon, 04 Jun 2012 17:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

First issue of WIRED re-released as an iPad app

Are you a fan of WIRED Magazine? The first issue of the Condé Nast tech magazine appeared back in January of 1993 with futurist Bruce Sterling talking about war and MIT Media Lab’s Nicholas Negroponte pontificating about “What’s wrong with HDTV.” WIRED fans who want to relive the past of the future (think about it…) can now get a free iPad version of that first issue.

To read WIRED 1.1.1, you’re going to need to have the existing WIRED Magazine app (free), which is loaded into the iOS Newsstand. Look for an icon for “The Premiere Issue Revisited” to download the material, but make sure that you have a lot of free space on your iPad to hold the 1.3GB file. You’ll also need a lot of time to download that issue.

The first issue has been replicated, annotated, and includes a full photo archive and a 12,000 word oral history. For WIRED readers or those curious about a tech magazine that has survived almost 20 years when others have gone by the wayside, it’s an awesome read. The two-page Apple PowerBook advertisement is worth the download time alone!

[via The Verge]

First issue of WIRED re-released as an iPad app originally appeared on TUAW – The Unofficial Apple Weblog on Mon, 04 Jun 2012 16:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Fotor CameraBag — Get this super iOS photo app while it’s free

I’m always on the prowl for great photo apps, so let me tell you about Fotor CameraBag. It’s free for a limited time, usually selling in the App Store for US$1.99.

There are a lot of iPhoneography apps that try to do everything, but many of them perform their functions poorly. Fotor CameraBag, on the other hand, does a lot of things and does them very well.

First, it has excellent HDR imaging. Take a photo from within the app, and you can make final adjustments and tweaks before you save. I put it to the test with a darkened interior room with bright morning sun in the windows and the results were excellent.

Next, for non-HDR imaging you get a variety of filters, a one-tap enhance option, frames, and something rare in an all-in-one app — the ability to make collages.

There’s also a tilt-shift option called Big Aperture that simulates the effect of a tilt-shift lens. Fotor CameraBag also includes the usual social sharing options, including Facebook, Twitter, Flickr and email.

With all of those features, there are a few annoyances. The work flow can be convoluted. You can’t save directly to the camera roll of your iOS device; you save to the app’s own library, and then export to the camera roll. That’s just not necessary, and it should be an option you can turn off. The Color Splash tool, which allows you to selectively add or erase color, is a bit confusing. The icon to adjust brush size is simply called ‘brush’. Until I clicked on it, I had no idea what it was for.

Don’t let these mild criticisms put you off. Fotor CameraBag is a very powerful app, and if you want just one app for editing that includes excellent HDR, I’d give this app serious consideration. The fact that it is currently free is the icing on the cake.

The app is a 22 MB download, and works on the iPhone, iPod touch and the iPad. It requires iOS 4.3 or greater. This app has no relationship to the similarly named CameraBag, which has received positive reviews. It is an excellent filter collection, but not an image creation app.

I’ve got an example HDR and some screen shots in the gallery below.

Fotor CameraBag — Get this super iOS photo app while it’s free originally appeared on TUAW – The Unofficial Apple Weblog on Mon, 04 Jun 2012 15:30:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Microsoft introduces SmartGlass

20120605-144759.jpgEach year everyone eagerly awaits the E3, waiting to see what gami companies will bring to the plate, well this year Microsoft brought something pretty amazing. Using the Xbox 360 as the main focal point Microsoftmade several announcements, among thee was theintroduction of the SmartGlass, a new wireless technology that is essentially a two-way Airplay-like standard that allows users to push content from their mobile devices to their TVs via the Xbox but also allows mobile devices to act as second screens for content being displayed on TV from an Xbox.

Engadget reports:

SmartGlass brings AirPlay-style wireless technology to Xbox and Windows 8 by letting you send video from your tablet or phone to your TV. It then turns that second screen into an information window giving you data of the content you’re watching. Plus, it updates the info on your mobile device as the content on the TV changes. The app also enables peripheral controls for games you’re playing — so you can scroll through different plays on your tablet while playing Madden on your big screen, for example.

The SmartGlass companion app will be available this fall on a variety of platforms, including iOS, Android, Windows Phone, and Windows 8 for tablets.

The SmartGlass app will arrive alongside a significant increase in the amount of content accessible through the Xbox 360, with Microsoft making a number of other announcements including a version of Internet Explorer for Xbox, a new Xbox Music streaming service, and access to streaming sports services such as WatchESPN, and live streams from the NBA and NHL.

11 Awesome Digital Tools To Make Your Life Easier

This bundle of productivity tools is one of the best values you’ll find on the web. It includes seven top mac apps PLUS another 4 amazing creative resources that will save you time and money. You get $570 worth of apps and resources for only $50. That’s 91% off! This deal will only be around for a short time, so don’t miss out!

PhoneView 
Access Your iPhone’s Voicemail, SMS, and More

Medium_phoneviewdisk_500x300

Save iPhone, iPad and iPod Touch app data, voicemail, text messages, iMessages, call log, notes, contacts, music and photos to your Mac.

Master Calling and Messaging with These Powerful Features:

  • Always Have Your SMS and iMessages on hand
  • Archive Your iPhone Voicemail
  • Call History Instant Access
  • Search Your Mobile Life

    System Requirements:

  • Any iPhone, iPad or iPod Touch
  • Mac OS X 10.5 or newer
  • Tunes v9.2 or newer

Square_keyboardmaestro-128

Keyboard Maestro 
Increase Your Productivity Using Keyboard Maestro

Medium_keyboardmaestro2

Keyboard Maestro 5 is now available with control flow, variables, calculations, file actions, image manipulation, macro library and more.

Keyboard Maestro is a productivity enhancer with four main functions, allowing you to record and design your own macro shortcuts and activate them at any time, navigate through running applications with Application Switcher and open windows with Window Switcher, work with an unlimited number of clipboards using Clipboard Switcher and with clipboard history using Clipboard History Switcher.

Keyboard Maestro organizes your macros into Macro Groups. Think of them as folders of macros. Each Macro Group controls when the macros it contains are active. A Macro is made of two parts: a set of Triggers you choose to determine when the macro is executed and a list of Actions that define what the macro does when it is executed.

System Requirements:

  • Mac OS X Lion and Snow Leopard

Square_typinator-iconnoshadow

Typinator 
Typinator “Types” Frequently Used Text For You

Medium_typinator_300x500

Typinator BOOSTS your productivity by automating the process of inserting frequently used text and graphics and auto-correcting typing errors.

Set up custom abbreviations for frequently needed text items, and Typinator automatically replaces the abbreviations with the corresponding expansions as you type. Saves a lot of your time.

With THOUSANDS of predefined corrections for common typos and misspelled words for US and British English, German and French, Typinator is not only a typing assistant that speeds repetitive typing tasks, but also a system-wide auto-correction tool that automatically fixes typing errors and misspelled words.

Setup Is Easy

You just define an abbreviation along with its replacement text or picture.

Usage Is Even Easier

Whenever you type one of your abbreviations in any application, Typinator inserts the corresponding replacement.

System Requirements:

  • Mac OS X 10.5.8 or newer
  • Compatible with OS X Lion

Square_defaultfolderx

Default Folder X 
Save Your Files Effortlessly & Open Your Folders Instantly

Medium_default_folderx

Save your files effortlessly and open your folders instantly. Default Folder X makes Mac OS X’s Open and Save dialogs work as quickly as you do.

Custom keyboard shortcuts put your favorite and recent folders at your fingertips. Pop-up menus let you navigate your folders and open Finder windows.

System Requirements:

  • Intel or PowerPC Mac running Mac OS X version 10.5 or higher

Square_totalfinder-small

TotalFinder 
Brings tabs to your native Finder and more

Medium_totalfinder1

TotalFinder adds tabs, hotkeys, and other tweaks to the Mac OS X Finder in 10.6 Snow Leopard or 10.7 Lion.

Implemented features:

  • Tabs like in Google Chrome!
  • Add a dual-panel mode (like in good old Norton Commander)
  • Make Finder available system-wide on a hot-key (like Visor)
  • Stop creating .DS_Store litter
  • Show the folders always on top

    System Requirements

  • Intel, Mac OS X 10.6 or later

Square_istopmotion_finale_512x512

iStopMotion 2 
The easy way to tell your story

Medium_istop_500x300

If you want to make your own movie telling a story on a shoestring budget, stop motion animation (also sometimes called claymation) with iStopMotion is the way to go.

Just bring your toys and your imagination, hook up your camera to your Mac and have a go. It is so easy, your kids can do it. Stop Motion animation with iStopMotion is fun for everyone!

Tilt Shift Filter – Use this popular optical effect to make you scene look like a miniature. Especially appealing with time lapse movies. (Not with Intel GMA graphics)

Send to iMovie – Directly transfer your clips to iMovie ’08 (or newer) and add cool intros, transitions, effects, sounds and more.

Camera Support – Added support for more recent Canon DSLR models and HDV cameras (when Logic Studio or Final Cut Studio is installed).

See why scores of teachers think that stop motion animation is excellent for learning story-telling skills. Feel the enthusiasm, energy and fun that make your kids learn like never before.

System Requirements

  • PPC / Intel
  • Mac OS X 10.5.8 or later (Mac OS X 10.6.8 or later recommended)
  • QuickTime 7.6.3 or later
  • Quartz Extreme compatible graphics
    Supported camera

Square_littlesnapper

LittleSnapper 
Picture Perfect Screenshots

Medium_littlesnapper

LittleSnapper is built to be the designer’s digital scrapbook, allowing creatives to snap, organise, edit and share screenshots and webpages that interest them.

LittleSnapper is the ideal choice for anyone looking for a beautifully crafted application built to make managing screen and websnaps easy.

From the comprehensive capture tools for the desktop and web, the powerful organisation options to curate your library, and the vector-based non-destructive annotations through to the Ember Flickr and SFTP sharing, LittleSnapper has all the tools a designer needs to cultivate their own design library.

System Requirements:

  • OS X 10.6.6 or later

Square_smashing

Smashing E-book Bundle
Super Bundle for Web Development (6 eBooks)

Medium_smash_500x300

Smashing Magazine publishes eBooks on a regular basis in the field of Web design and development. Now you can get all Web development related Smashing eBooks in one swoop and benefit from 20% discount!

Smashingmagazine best coding articles give shape to this set of contemporary programming languages eBooks: CSS, JavaScript, jQuery, WordPress and HTML. This bundle will help you develop great websites by applying trendy plug-ins, techniques for responsive design and many other nifty coding usages.

This Smashing eBooks Bundle contains the following 6 eBooks:
– Mastering CSS, Vol. 1 (344 Pages)
– JavaScript Essentials (142 Pages)
– Mastering jQuery (122 Pages)
– WordPress Essentials (157 Pages)
– Mastering WordPress (166 Pages)
– WordPress Tutorials (183 Pages)

Formats: PDF, EPUB, Kindle (DRM-free)
Language: English
Publisher: Smashing Media GmbH

Square_picons_small

Picons Ultimate+
Royalty-free Vector Icons for Designers

  • Version: Basic 1,2, & 3
  • Genre: Graphics & Design
  • by Picons

Medium_picons_500x300

New Ultimate+ Bundle now including Basic 1, 2 & 3 sets (600 premium royalty-free icons).

Picons Basic 3 set is a brand new and long-awaited upgrade, containing 160 vector icons. Again fully compatible with previous sets and optimized to be used on your websites, blogs, print media or mobile apps.

Picons Basic 2 set contains 300 hand-crafted vector icons, built on a grid and sharing the same visual language. It is an essential source of icons and symbols for every web, interface and print designer. The icons are also optimized for your iPad, iPhone or Android app interface.

Picons Basic 1 set contains 140 royalty-free vector icons for graphic designers and design enthusiasts. All icons are hand-crafted, with great detail and unlimited scalable. This bundle is a must-have for all interface designers and is including some special icons for websites, mobile apps and other interfaces.

Square_theme_small

ThemeFuse
4 Premium WordPress Themes of Your Choice

Medium_themefuse

Give your blog a fresh, professional look using our powerful, yet simple to use premium themes which are easy to setup and customize with no coding knowledge whatsoever.

ThemeFuse designs WordPress themes are all so attractive that it can be hard to choose.

The amazing selection of 21 original, unique, and professionally designed themes range from corporate and product to portfolio and blogging. All include one-click auto install making installation practically instant and definitely pain free

Square_glyph_small

Glyph Ocean 
1,500 Royalty-Free Vector Icons in 7 different file types

Medium_glyphocean_500x300_v2

GlyphOcean icons are royalty-free vector icons, designed and specially optimized for website navigation, user interfaces, mobile and GUI interfaces. These icons include multimedia player controls, file management, ecommerce, and a bunch of other useful topics.

Package includes 4,500 monochromatic
vector icons available in 3 different sizes:24×24 / 32×32 / 48×48.with supportive file typespng. pdf. eps. ai. jpg. csh. and cdr.

Example: Creating A Magnifying Glass Effect In Cocos2D

I’ve mentioned a number of great Cocos2D examples and today’s example demonstrates how to create a magnifying glass in Cocos2D.

This is relatively easy to do with UIKit, and this example source code from Rombos grabs the image data from the OpenGL Buffer, and uses UIKit to perform the magnifying effect.

As you can see from this image of the article on that the magnifying effect works extremely well:


You can download the source code and read more about the technique used on the Rombos blog here.

A nice and simple solution to what can be a challenging effect to implement. Included are the graphics so you can give it the same look as in the image.

via @purplelilgirl, @mariozullo

©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.

.

DeliciousTwitterFacebookLinkedInEmail


ButtonHide Example in iPhone

In this application we will see how to hide button from the iPhone application. So let see how it will worked.

Step 1: Open the Xcode, Create a new project using Single View Application. Give the application
“ButtonHide”.

Step 2: Need to add new viewController class in the project. Select project -> New file ->
UIViewController subclass -> next -> Give the application name “ButtonHideView”.

Step 3: Now open the AppDelegate.h file and make the following changes:

#import <UIKit/UIKit.h>

@class ButtonHideView;

@interface AppDelegate : UIResponder <UIApplicationDelegate>
{
ButtonHideView *buttonHideView;
}
@property (nonatomic, retain)IBOutlet ButtonHideView *buttonHideView;
@property (strong, nonatomic) UIWindow *window;

@end

Step 4: In the AppDelegate.m file make the following changes:

#import "AppDelegate.h"
#import "ButtonHideView.h"

@implementation AppDelegate

@synthesize window = _window,buttonHideView;

– (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary
*)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];

buttonHideView = [[ButtonHideView alloc]
initWithNibName:@"ButtonHideView"
bundle:nil];
[_window addSubview:buttonHideView.view];

return YES;
}

@end

Step 5: Now open the “ButtonHideView.h” file and make the following changes:

#import <UIKit/UIKit.h>

@interface ButtonHideView : UIViewController
{
IBOutlet UIButton *button1;
IBOutlet UITextField *textfield1;

}
@property (nonatomic, retain) IBOutlet UIButton *button1;
@property (nonatomic, retain) IBOutlet UITextField *textfield1;

–(IBAction) ButtonHide:(id)sender;
//}

@end

Step 6: Double click the ButtonHideView.xib file and open it to the Interface Builder. First drag the
UIButton and UITextField from the library and place it to the view window. Select the button from
the view window and bring up connection inspector and connect touch up inside to the File’s Owner
icon and select “ButtonHide:” method and connect the File’s owner icon to the textfield and select
“textfield1”. Now save the .xib file, close it and go back to the Xcode.

Step 7: In the ButtonHideView.m file make the following changes:

#import "ButtonHideView.h"

@implementation ButtonHideView

@synthesize button1,textfield1;

– (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}

–(IBAction) ButtonHide:(id)sender
{
if([textfield1.text isEqualToString: @""]){
button1.hidden = YES;

} else {
button1.hidden = NO;

}
NSLog( @"%@", textfield1.text );
}

@end

Step 8: Now Compile and run the application on the Simulator

A Simple Web Browser for iPhone

In this blog, we’ll learn how to use a UITextField in conjunction with a UIWebView to create a very simple web browser application. Using this technique as a foundation, you can build rather powerful web – based applications. So, let’s get started!

Open Xcode, and choose “Create a new Xcode project” from the welcome screen. In the next screen, choose the Single View Application template. Name your project “SimpleBrowser” and choose options as shown:

Click Next, choose a location to save the project, and Click Create. Once the project has been created, select the MainStoryboard.storyboard file. Drag a UILabel, UITextField, and UIWebView to the View as shown:

Open the ViewController.h file, and make the changes as shown:

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController

@property (nonatomic, strong) IBOutlet UITextField *address;
@property (nonatomic, strong) IBOutlet UIWebView *browser;

– (IBAction)addressEntered:(UITextField *)sender;

@end

We’ve added two properties, a UITextField named address, and a UIWebView named browser. Both of these properties are designated as IBOutlets, which means that they will be wired up to controls in our view. We’ve also added an action method (addressEntered:) that will also be wired up to a control.

Next, open up the ViewController.m file, and make the following changes:

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

@synthesize address;
@synthesize browser;

– (IBAction) addressEntered:(UITextField *)sender
{
    NSURL *url = [NSURL URLWithString:sender.text];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [self.browser loadRequest:request];
    self.browser.scalesPageToFit = YES;
    [sender resignFirstResponder];
}

– (void)viewDidLoad
{
    [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.
}
…

As is usually the case with properties declared in the .h file, we first synthesize them here. Next comes the implementation of the addressEntered: method. Notice that the sender of the event that triggers this method is a UITextField: the same text field we dragged to the view in the MainStoryboard.storyboard file earlier. In this method, we obtain the text from the sender, and make it into an NSURL object called url. Then we create an NSURLRequest object called request, using the url we just created.

The next step is to load the NSURLRequest into the browser using the loadRequest: method of UIWebView. This will load the web site specified into the web view. We make an attempt to scale the page to fit in the browser view; some pages can be scaled, others cannot. If the page cannot be scaled, this line will fail silently.

The last step in the method is to call resignFirstResponder on the sender. This will hide the keyboard associated with the text field, so the browser will not be obscured. All that now remains is to wire up the properties and the method to their corresponding controls.

Re – open the MainStoryboard.storyboard file, and right – click the View Controller object. Drag from the circle to the right of the address outlet to the UITextField, and from the circle to the right of the browser outlet to the UIWebView. Also drag from the circle to the right of the addressEntered received action to the UITextField; in the resulting popup, choose Did End On Exit. Finally, in the Attributes inspector for the text field, set the Return Key type to “Done,” as shown:


With all of the controls wired up, we should now be able to run the application successfully. Do so, and in the text field, enter http://www.google.com (for example). Note that this simple browser requires a well formed URL to be entered: we cannot just enter “google.com” for example: the full string must be present.

Since a UIWebView is scrollable, it is possible to use drag and swipe gestures to scroll a web page both horizontally and vertically with no additional coding. Also, if the web page is resizable, pinch gestures may be used to do so.

Take a look at the class reference for the UIWebView, and have fun enhancing this very simple browser application.




Disney taps indie studio for Temple Run Brave

Disney Mobile has made a number of really smart moves over the past few years (starting with acquiring Tapulous, all the way up to allowing a game tester to make them a great game). Now here’s another brilliant move: they’ve signed a deal with developers Keith Shepherd and Natalia Luckynova (also known as the very nice married couple behind Imangi Studios) to help them make a Brave-branded version of Temple Run.

The game itself is actually being put together by a third-party game developer, but Imangi had input on the finished product, and the deal has actually been in the works for quite a while, even before Imangi saw all of its astronomical success with the golden idol running game. Imangi told me at GDC this year that they were being careful about choosing partnerships, but apparently this partnership with Disney met with their approval.

Temple Run Brave should be in the App Store for 99 cents on June 14 (though my guess is that given how popular Temple Run has been as a free game, it’ll drop to free soon after that). Disney has shown a lot of insight into the App Store in the past, and this latest deal with a very hot indie studio is no exception.

Disney taps indie studio for Temple Run Brave originally appeared on TUAW – The Unofficial Apple Weblog on Mon, 04 Jun 2012 15:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

iPads help airline shed two tons of in-flight entertainment gear

Singapore-based airline Scoot Pte saved itself a lot of money by ripping out the TV-based entertainment systems from its planes and replacing them with iPads. The airliner removed more than two tons of equipment and managed to shave 7 percent off the weight of its planes, says a report in Bloomberg.

The biggest savings, though, will be in fuel costs as the lighter planes consume less jet fuel. Fuel makes up about 35 percent of airline operating costs, so the savings could be significant for this upstart airline. Scoot will recoup some of the cost of the iPads by charging customers S$22 (US$17) to rent the tablets during a flight. Business-class customers will receive an in-flight iPad for free. Each iPad will include pre-loaded movies, music, TV shows and games.

iPads help airline shed two tons of in-flight entertainment gear originally appeared on TUAW – The Unofficial Apple Weblog on Mon, 04 Jun 2012 14:30:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments