DSRawat
DSRawat

Reputation: 103

UITableView with first character of text

My array contains: Barney Eskin, Aaron Hoe, Dale Perella, Earl Bruice, Fabian Oleski, Calvin Zinnes

Question 1 : How can I create a UITableView having an initial circle created with a different image and the first letter of the string in it. (as shown in the pic below)

enter image description here

Question 2 : How can I add a swipe gesture to open a menu and perform an action on it, like in the following image:

enter image description here

Upvotes: 0

Views: 79

Answers (1)

PinkeshGjr
PinkeshGjr

Reputation: 8680

You can use a third-party library for swipe-able cells. There are many libraries that provide this functionality, but this is the best

1.MGSwipeTableCell

2.SWTableViewCell

For the first character, you can create a custom UIView and use UILabel inside it and you can fetch the first character from the string like this:

if ([string hasPrefix:@"0"] && [string length] > 1) {
    string = [string substringFromIndex:1];
}

Upvotes: 1

Related Questions