Posts

Showing posts from 2013

How to set Custom Section Header in UITableView for ios sdk version greater than 6

Image
Dear Friends, As we know, that to set a custom Section Header in a TableView we need to call the following. Here we pass our own custom View. But, remember the view which we returned was never reusable, hence not memory efficient. -( UIView *) tableView:( UITableView *)tableView viewForHeaderInSection:( NSInteger )section Later version of iOS , starting from iOS 6, helps to make our code Memory efficient with few lines of code. Still here the delegate method remains the same. With the help of this tutorial we will be able achieve a Custom Header implementation using iOS 6 or greater sdk. We will be creating a app. which would look like as shown below. Please use the following steps to achieve this: Step 1: Create a .xib file for the custom header 1. Press command + N 2. Select User Interface in Left Pane. 3. Then Select a View and name it as TableHeader. Step 2: Create a Custom class for the custom header in Step 1 1. Press command

Custom Editing Control for UITableViewCell , like iPhone Mail Appliation

Image
Dear Friends, Today, while I was developing a application, I found that I am in need to a custom Editing control. Custom Editing Control are displayed on the left side of the screen. IOS sdk provides two of such kind which we use most of the time UITableViewCellEditingStyleDelete & UITableViewCellEditingStyleInsert  . I will be now discussing the third one, UITableViewCellEditingStyleNone. This can be used to design our own Editing control. How this is going to look like can be fond from below screen shot. Steps to achieve this can be found below: STEP 1: Create A subclass of UITabelViewCell First create a subclass of UITableViewCell, where when the cell object is initialised we will have to add a UIButton to its view. You will also need a offset variable, whose value will be 32.0 in all iPhones. -( id ) initWithCoder:( NSCoder *)aDecoder{          self =[ super initWithCoder :aDecoder];          if ( self ){         offset =32.0;