{"id":8015,"date":"2015-11-21T03:45:18","date_gmt":"2015-11-21T03:45:18","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/11\/21\/custom-edit-view-in-uitableviewcell-while-swipe-left-open-source-projects-thebird-swipe\/"},"modified":"2022-08-30T15:03:04","modified_gmt":"2022-08-30T15:03:04","slug":"custom-edit-view-in-uitableviewcell-while-swipe-left-open-source-projects-thebird-swipe","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/11\/21\/custom-edit-view-in-uitableviewcell-while-swipe-left-open-source-projects-thebird-swipe\/","title":{"rendered":"Custom edit view in UITableViewCell while swipe left-open source projects thebird\/Swipe"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/pIRbW.jpg?s=128&amp;g=1\" \/> <strong>Ram S<\/strong><\/p>\n<p>Refer this link : https:\/\/github.com\/TeehanLax\/UITableViewCell-Swipe-for-Options<\/p>\n<p>And customize your uitableviewcell with multiple button.<\/p>\n<pre><code> UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))];\nscrollView.contentSize = CGSizeMake(CGRectGetWidth(self.bounds) + kCatchWidth, CGRectGetHeight(self.bounds));\nscrollView.delegate = self;\nscrollView.showsHorizontalScrollIndicator = NO;\n\n[self.contentView addSubview:scrollView];\nself.scrollView = scrollView;\n\nUIView *scrollViewButtonView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.bounds) - kCatchWidth, 0, kCatchWidth, CGRectGetHeight(self.bounds))];\nself.scrollViewButtonView = scrollViewButtonView;\n[self.scrollView addSubview:scrollViewButtonView];\n\n\/\/ Set up our two buttons\nUIButton *moreButton = [UIButton buttonWithType:UIButtonTypeCustom];\nmoreButton.backgroundColor = [UIColor colorWithRed:0.78f green:0.78f blue:0.8f alpha:1.0f];\nmoreButton.frame = CGRectMake(0, 0, kCatchWidth \/ 3.0f, CGRectGetHeight(self.bounds));\n[moreButton setTitle:@\"More\" forState:UIControlStateNormal];\n[moreButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];\n[moreButton addTarget:self action:@selector(userPressedMoreButton:) forControlEvents:UIControlEventTouchUpInside];\n\n[self.scrollViewButtonView addSubview:moreButton];\n\nUIButton *shareButton = [UIButton buttonWithType:UIButtonTypeCustom];\nshareButton.backgroundColor = [UIColor colorWithRed:0.0f green:0.0f blue:1.0f alpha:1.0f];\nshareButton.frame = CGRectMake(kCatchWidth \/ 3.0f, 0, kCatchWidth \/ 3.0f, CGRectGetHeight(self.bounds));\n[shareButton setTitle:@\"Share\" forState:UIControlStateNormal];\n[shareButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];\n[shareButton addTarget:self action:@selector(userPressedMoreButton:) forControlEvents:UIControlEventTouchUpInside];\n[self.scrollViewButtonView addSubview:shareButton];\n\nUIButton *deleteButton = [UIButton buttonWithType:UIButtonTypeCustom];\ndeleteButton.backgroundColor = [UIColor colorWithRed:1.0f green:0.231f blue:0.188f alpha:1.0f];\ndeleteButton.frame = CGRectMake(kCatchWidth \/ 3.0f+kCatchWidth \/ 3.0f, 0, kCatchWidth \/ 3.0f, CGRectGetHeight(self.bounds));\n[deleteButton setTitle:@\"Delete\" forState:UIControlStateNormal];\n[deleteButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];\n[deleteButton addTarget:self action:@selector(userPressedDeleteButton:) forControlEvents:UIControlEventTouchUpInside];\n[self.scrollViewButtonView addSubview:deleteButton];\n\nUIView *scrollViewContentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))];\nscrollViewContentView.backgroundColor = [UIColor whiteColor];\n[self.scrollView addSubview:scrollViewContentView];\nself.scrollViewContentView = scrollViewContentView;\n\nUILabel *scrollViewLabel = [[UILabel alloc] initWithFrame:CGRectInset(self.scrollViewContentView.bounds, 10, 0)];\nself.scrollViewLabel = scrollViewLabel;\n[self.scrollViewContentView addSubview:scrollViewLabel];\n<\/code><\/pre>\n<ul>\n<li>\n<p>I have implemented this code with my app got such result. You can and number of button in cell swipe.<\/p>\n<p>Here is implemented screen shots<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/xP81Z.png\" \/>After swipe the cell 3 buttons appears &#8220;More&#8221;,&#8221;Share&#8221;,&#8221;Delete&#8221;.<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Ram S Refer this link : https:\/\/github.com\/TeehanLax\/UITableViewCell-Swipe-for-Options And customize your uitableviewcell with multiple button. UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))]; scrollView.contentSize = CGSizeMake(CGRectGetWidth(self.bounds) + kCatchWidth, CGRectGetHeight(self.bounds)); scrollView.delegate = self; scrollView.showsHorizontalScrollIndicator = NO; [self.contentView addSubview:scrollView]; self.scrollView = scrollView; UIView *scrollViewButtonView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.bounds) &#8211; kCatchWidth, 0, kCatchWidth, CGRectGetHeight(self.bounds))]; self.scrollViewButtonView = scrollViewButtonView; [self.scrollView [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8015","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8015","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=8015"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8015\/revisions"}],"predecessor-version":[{"id":8695,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8015\/revisions\/8695"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=8015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=8015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=8015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}