Ios 23
News: The Next iPhone
There have been a lot of rumors circling around the internet lately about the next version of the iPhone. We won’t know for sure until Apple announces it later this year, but it’s nice to look forward to a brand new iPhone.
Here’s a list of the latest iPhone news to keep you up to date:
- iPhone 5S will have new color options – The next iPhone will reportedly be available with three or five different color options, including one to three new colors on top of the current black and white options.
- iPhone 5S will reportedly be available with ‘at least’ two screen sizes – Many Android smartphones offer different screen sizes, but Apple has always only provided one size per model. Reports suggest that Apple is considering the next-generation iPhone will have at least two sizes this summer.
- iPhone 5S Rumored To Be Fingerprint Scanning – Fingerprint identification technology could be part of the iPhone 5S and this is likely to be the major new feature used to market the iPhone 5S, similar to what Siri was to the iPhone 4S
- iPhone 5S said to feature new 12-megapixel camera – It’s reported that the new iPhone 5S will feature an upgraded 12-megapixel camera with improved image capture capabilities in low light.
- A New Entry-Level iPhone – It is looking increasingly likely that after years of rumors, Apple will finally launch a cheaper iPhone model in an effort to attack emerging markets. Apple is prepping a cheaper iPhone model that will launch in late 2013. The new iPhone may cost as little as $99 or $149.
News: New Apple Developer Provisioning Profile
Check out the new provisioning portal at developer.apple.com.
The whole portal has been redesigned and now under the “Member Center” and listed as “Certificates, Identifiers & Profiles”.
Apple has finally updated its official developer website with a new, easier-to-manage unified view for managing certificates, identifiers, devices, and provisioning profiles.
Developers were sent an email about the changes, here’s the full note:
Now it’s even easier to manage your development assets. The new Certificates, Identifiers & Profiles section in Member Center provides a unified view and intuitive interface to help you manage all your certificates, identifiers, devices, and provisioning profiles. This new section replaces the iOS Provisioning Portal and the Developer Certificate Utility.
To learn more about testing and distributing apps, read the new App Distribution Guide.
Introducing Snap Apps
For the past couple of months I have been working on a series of photo apps and they are finally in the App Store as of today! I wanted to test a couple of app strategies with this set of apps. First the use of an app network. Instead of launching just one app I decided to create a set of five apps, allowing them to promote one other. I’m hoping the variety of themes will interest certain demographics to download one app they are interested in, then with the cross promotion they’ll discover more they like. We see the power of app networks all the time with Zynga and even Facebook. Instead of just having one Facebook App, like one Facebook website, Facebook has a bunch of apps that all push traffic to each other. This way their users spend more time in their apps overall, and Facebook earns MUCH more revenue.
The second strategy I wanted to test out was building a framework to build apps. One of Facebook’s most recent apps, Poke, was built using SnapChat, a very popular social app, as a template. It’s a smart move. Some of the most popular apps, like Temple Run and Angry Birds, are template-based apps. Why try to come up with something completely original when you can make small changes to something you already know works?
Snap Apps all have the same basic functionality, you take a photo and it will add a caption, then the user can share it with their friends. Once I built one I could easily reuse the code and theme others just like it. All of the apps are available as freemium with in-app purchases for enhance features like the ability to select your caption or create your own.
Travel Bomb
★ Are you a world traveler? You could look like one with Travel Bomb! ★Big Bucket List and zero cash? Sick of seeing all your friends post their amazing vacation pictures while you toil away at home? Don’t worry – with this app you can brag all you want on Facebook about your exotic travels, without hurting your pocketbook! It’s risk-free travel! Simply choose a picture of yourself (be creative) and erase the background. Then pick one of our many travel destinations, and voila! It’s almost like you were really there.
Download Travel Bomb in the App Store

Body Bomb
★ Do you like your body? If not, try out a new one with Body Bomb! ★It’s about time you faced facts. Your body is the bomb, but wouldn’t it be great to have someone else’s body once in a while? Of course it would. Now go bomb your face onto someone else’s body and see what color the grass is on the other side of the fence.
Download Body Bomb in the App Store

Talk Show Photo
★ Do you love drama? You could be a guest on Talk Show Photo! ★What’s more ridiculous than taking your entire family on national television to announce that you’re sleeping with your boss? This app is! See what headlines you could be making, with just a click and a bomb, you could be front row at your very own talk show. Who’s the daddy??
Download Talk Show Photo in the App Store

Love Bomb!
★ Are you in love? Share it with the whole world with Love Bomb! ★We get it – you love love. And these crazy captions reflect that! Take a picture and see what passions our captions might arouse.
Download Love Bomb! in the App Store

Insult Bomb
★ Got a friend that bothers you? Get them back with Insult Bomb! ★What better way to beef up your self-esteem than to see what kind of horrible insults you can fling at yourself and others! Pictures may tell a thousand words, but with Insult Bomb, the words are funnier.
Download Insult Bomb in the App Store
Tutorial: Create Your Own iOS Web API
Most of the top apps in the App Store communicate with a server for one reason or another. An app may need to send user data such as game scores or currency to a global database to track rankings or currency. It may serve up dynamic content or even ads that the owner wishes to change without making an app update. All of this and more require an API (application programming interface) to communicate between the app and the web server. In this tutorial we’ll walk-through how to setup a script on the web server using PHP and how to communicate with that script from within an app.
Setup the PHP Web API
To start you’ll need a web server that will host the PHP script. One of the best shared hosts in the US is 1 & 1. You can host as many URLs and MySQL databases as you wish for around $100 a year. Next you need to write your PHP script that will be sending data to your app.The code below is PHP, you can cut and paste it into a text editor and save it as adAPI.php, then upload it to your server. Be sure to set the permissions of the file on the server to 0755 to make it executable. You can do that using any FTP program and right clicking on the file and selecting “Permissions”. If they are not set correctly the app will not be able to execute the PHP script on the server and it will return an error.
You’ll notice that we are passing a parameter into the script ‘AdID’, this is needed if you would like to return different ads or if you would like to use the same script for multiple apps. Most ad APIs setup ads by zones, meaning a zone is a specific place in your app where you would like the ad to show up. Above we have setup one ad. All this script does it return a single line string back to the app “1|http://images.apple.com/home/images/promo_iphone5.png|http://www.apple.com/iphone/”. This string is broken up into 3 variables that are separated by a pipe “|” character. The first variable “1” is used as a flag to turn the ad on and off. I’ve used this to turn an interstitial ad (loading screen ad) on and off. If it’s set to 1 we’ll show the ad in the app, if it’s set to 0 we’ll hide the ad. The second variable “http://images.apple.com/home/images/promo_iphone5.png” is the link to the ad image we’re going to display in the app. You’ll want to link to an image on your server, as an example I’m linking to an image on Apple.com. Lastly, the third variable “http://www.apple.com/iphone/” is where the ad links to when a user taps on it.
Communicating to the API From Your App
Now that the server side is setup we need to get the data into our app. The best way to do this is using a framework named ASIHTTPRequest. This framework allows us to send a HTTP request to the web server and listen for a response back which we’ll parse into variables.Download the framework from the ASIHTTPRequest documentation site.
First, you’ll need to integrate the framework into your project.
1. Download the source code from the link above.
2. Add all of the header and implementation files into your project.
4. Include the following header to the top of your implementation class:
– #import “ASIHTTPRequest.h”
Here is the header file to our implementation where the ad link, button and image are defined so we can use them globally within the implementation.
// AdViewController.h // Ad View #import@interface AdViewController : UIViewController @property (nonatomic, strong) NSString *adLink; @property (nonatomic, strong) IBOutlet UIView *adView; @property (nonatomic, strong) IBOutlet UIButton *adLinkButton; @property (nonatomic, strong) IBOutlet UIImageView *adImageView; - (void)callAdService; - (IBAction)adButtonPushed:(id) sender; @end
Below is the top of our implementation where we synthesize the properties and make the call to run the API in the viewDidLoad method.
// AdViewController.m // Ad View #import "AdViewController.h" #import "ASIHTTPRequest.h" @implementation AdViewController @synthesize adLink, adLinkButton, adImageView; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. [self callAdService]; }
Next, include the following method into your class to post the request to your web server. Notice that we’re setting the ‘AdID’ to 1 to match the ad that we want to receive from the API that we defined above in the PHP script. The setDidFinishSelector: defines what is the name of the method that will handle the return message from the server and setDidFailSelector: the method if an error happened and we didn’t receive a response back.
-(void)callAdService{ //this is a typical url for REST webservice, where you can specify the method that you want to call and the parameters directly with GET NSURL *url = [NSURL URLWithString:@"http://www.YOURWEBSERVER.com/api/adAPI.php?AdID=1"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDidFinishSelector:@selector(requestCompleted:)]; [request setDidFailSelector:@selector(requestError:)]; [request setDelegate:self]; [request startAsynchronous]; }
Below is the method that is called when we receive the data back from the API. Remember we are expecting to receive a single string with three variables in it separated by a pipe. 1|http://images.apple.com/home/images/promo_iphone5.png|http://www.apple.com/iphone/
The string is parsed by the pipes and fed into an array. The first element being the flag to show or hide and ad, the second is the link to the hosted ad image and the third is the link once the ad is tapped. After the data is parsed into variables we check to see if the ad should be displayed, if it should be then we animate the ad up, grab the image from the URL to display it.
- (void)requestCompleted:(ASIHTTPRequest *)request { NSString *responseString = [request responseString]; NSLog(@"API Response: %@", responseString); NSArray *valueArray = [responseString componentsSeparatedByString:@"|"]; NSString *interstitialAd = [valueArray objectAtIndex:0]; NSString *adImage = [valueArray objectAtIndex:1]; adLink = [valueArray objectAtIndex:2]; if ([interstitialAd integerValue] == 1) { [self.view bringSubviewToFront:adView]; adImageView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:interstitialAdImage]]]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.3]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; [UIView setAnimationBeginsFromCurrentState:YES]; // The transform matrix if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad && IS_IPHONE_5) { CGAffineTransform transform = CGAffineTransformMakeTranslation(0, -569); adView.transform = transform; } else { CGAffineTransform transform = CGAffineTransformMakeTranslation(0, -569); adView.transform = transform; } } }
To finish up the process, we need to handle two events, the click-thru and the close buttons. In the “clickAdButtonPushed” we take the “adLink” variable and open the URL in the Users browser if they click on it. If you are using analytics tracking, this is where you’ll place your tag to track the conversion of your ad. The other method “closeAdButtonPushed” will animate the ad down off the screen so the user can continue to use your application.
-(IBAction) clickAdButtonPushed:(id) sender { NSString *str = adLink; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]; adView.alpha = 0; } -(IBAction) closeAdButtonPushed:(id) sender { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.3]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; [UIView setAnimationBeginsFromCurrentState:YES]; // The transform matrix CGAffineTransform transform = CGAffineTransformMakeTranslation(0, 0); adView.transform = transform; // Commit the changes [UIView commitAnimations]; }
Tutorial: Collection View using Flow Layout
Note: Newer tutorial available. If you would like to learn how to implement Collection Views using Swift, read Tutorial: Collection View using Swift
One of the best features for developers that came in the iOS 6 SDK is UICollectionView. It is very similar to UITableView but you can customize it a lot more and it can scroll horizontal, goodbye scroll views! Most recently I used a collection view for a bottom navigation scroller and it worked really well.
A UICollectionView view has three main components:
1. Cells: Display your content in cells that are de-queued as they leave the screen.
2. Supplementary Views: Add labels, section headers and footers to define your content areas.
3. Decoration Views: Decorate the collection view to look like a bookshelf or a background image.
Start by adding the delegates to your header file and define your collection view.
@interface ViewController : UIViewController@property (nonatomic, strong) IBOutlet UICollectionView *collectionView; @property (nonatomic, strong) IBOutlet UICollectionViewFlowLayout *flowLayout;
The most common layout for a UICollectionView is UICollectionViewFlowLayout. Flow layout organizes items into a grid with optional header and footer views for each section. The items in the collection view flow from one row or column (depending on the scrolling direction) to the next, with each row comprising as many cells as will fit. Cells can be the same sizes or different sizes.
Define the UICollectionView & UICollectionViewFlowLayout properties in the viewDidLoad method.
- (void)viewDidLoad { [super viewDidLoad]; [self.collectionView registerClass:[CellClass class] forCellWithReuseIdentifier:@"classCell"]; self.collectionView.backgroundColor = [UIColor clearColor]; // Configure layout self.flowLayout = [[UICollectionViewFlowLayout alloc] init]; [self.flowLayout setItemSize:CGSizeMake(191, 160)]; [self.flowLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal]; self.flowLayout.minimumInteritemSpacing = 0.0f; [self.collectionView setCollectionViewLayout:self.flowLayout]; self.collectionView.bounces = YES; [self.collectionView setShowsHorizontalScrollIndicator:NO]; [self.collectionView setShowsVerticalScrollIndicator:NO]; }
Most of the properties are self explanatory but the key is to define your cell class if you are using custom cells (just like table views) and setting the size of the cells, above they are set to 191×160. Choose the scroll direction (UICollectionViewScrollDirectionHorizontal or UICollectionViewScrollDirectionVertical) and the spacing in between each cell, I have it set to 0. Lastly define the layout, we’re using self.flowLayout that was defined in the header.
- (UIEdgeInsets)collectionView: (UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section { return UIEdgeInsetsMake(0, 0, 0, 0); }
The method above sets the spacing between sections within the collection view. You might breakup your data by sections if you have artists or albums in your data.
Setting up a UICollectionView is very similar to a UITableView, so you’ll recognized a lot of the methods below.
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { return 1; } -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return [dataArray count]; }
Above we’re defining how many sections and how many items in the section for the collection view. If you have more than one section, then you’ll need to define the number of items in each section within the numberOfItemsInSection method.
Below is the real meat of the UICollectionView, defining the cells with your data. If you choose to use a custom cell you can add images or whatever you need to display.
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { Cell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"cellName" forIndexPath:indexPath]; cell.label.text = [NSString stringWithFormat:@"%d",indexPath.item]; return cell; }
Finally you can drag the UICollectionView object into your view within your NIB. Move and scale the collection view to where you want to display it and review all of the properties within the inspector. Be sure to hookup the collectionView reference outlet and dataSource and delegates so the collection view can provide all the functionality available. Do the same for the Collection View Flow Layout. (See image on the right).