Archive

Posts Tagged ‘cocoa touch’

SSCheckBoxView: A check box UI control for iOS apps

December 7th, 2011 Ahmet Ardal No comments

SSCheckBoxView is a check box UI control for iOS apps. It provides standard check box functionality with two states (checked and unchecked) and 5 different visual styles.
Here are some instructions on how to use it in your iOS apps:

 

Add SSCheckBoxView to your project

Read more…

SSPhotoCropperViewController: A custom ViewController that provides UI for cropping photos in iOS apps

October 17th, 2011 Ahmet Ardal 7 comments

We all sometimes do something with photos in our apps. And apps that deal with photos in some way, whether it be editing, stylishing or sharing them, are becoming more and more popular every day.

In one of my apps I was recently working on, I needed a simple UI to crop a picture into a square shape. So I wrote SSPhotoCropperViewController. It’s a custom view controller that provides a simple, configurable and easy-to-use UI for cropping and scaling photos in iPhone & iPod Touch apps.

 

Add SSPhotoCropperViewController to Your Project

Read more…

GANHelpers: A helper class for using Google Analytics in iOS apps

October 16th, 2011 Ahmet Ardal No comments

Google Analytics is a full-featured, enterprise-class web analytics service from Google for tracking web and mobile application usage statistics. It’s a good idea to track how your customers use your app. There are many benefits of knowing how your app is actually being used. You can optimize some parts of your application, make decisions on adding, dropping or improving a feature or make modifications in UI to improve the usability of your app. You don’t want to work on a feature that nobody actually uses, right?

 

Google Analytics

Google Analytics

Read more…

How to Detect and Handle HTTP Status Codes in UIWebViews

August 18th, 2011 Ahmet Ardal 1 comment

Imagine you have the following problem: You want to load a url in a UIWebView. But the resource at that url requires authentication, and if the user is not authenticated the web page responds with a “403 Not Authenticated” without showing any other instructions on how to login or where to go next etc. Ideally you’d want to redirect the user to a page where she can log in and continue to browse the url. The problem is UIWebView does not provide any properties or methods for inspecting HTTP status codes. One workaround is to intercept the UIWebView request loading process and check whether the user is authenticated or not by loading the same url using an NSURLConnection and inspecting the response, then you can behave accordingly.
Read more…

EmailableCell: A UITableViewCell Subclass for Cells w/ Email Addresses

July 3rd, 2011 Ahmet Ardal No comments

EmailableCell is a UITableViewCell subclass for making cells containing email addresses copyable and it enables users to send email to that addresses using the iPhone’s default Mail application.

This code snippet shows how to create an EmailableCell instance in “- (UITableViewCell *) tableView:cellForRowAtIndexPath:” UITableViewDelegate method:
Read more…

SSLocationManager: A Compact Obj-C Library for Location Data

May 27th, 2011 Ahmet Ardal 7 comments

As all of us knows, location-aware services/applications are becoming more popular and widespread everyday. Especially, mobile devices play a very important role in that area. So we all, in some ways, need to access the location of a specific user of our app. Most of the mobile devices provides some hardware and APIs for letting application developers to access location services of the device. iPhone has a built-in GPS module and a framework is provided in Cocoa Touch called CoreLocation that is used for accessing location services of the device.

CoreLocation can be used to obtain the latitude and longitude parameters of the location of the device. But sometimes we need some more detailed information about that specific location. Country, city, state, street, may be postal code etc.. It depends on the application. That is something iPhone or iOS platform does not provide directly. However, we can use a web service such as Yahoo! PlaceFinder to access detailed information about a location of which we know the latitude and longitude parameters.

What SSLocationManager does is as follows:

  • Ask CoreLocation services to determine current location of the device.
  • Get current position in latitude and longitude from CoreLocation.
  • Call Yahoo! PlaceFinder web service to get detailed information about the location specified with its latitude and longitude.
  • Notify the application via SSLocationManagerDelegate and supply the detailed location data.

Here is a basic diagram that shows the overall structure:

SSLocationManager Diagram

SSLocationManager Diagram

Read more…