{"id":1395,"date":"2011-05-17T20:53:48","date_gmt":"2011-05-17T18:53:48","guid":{"rendered":"http:\/\/blog.fh-kaernten.at\/wehr\/?p=1395"},"modified":"2012-02-02T08:10:54","modified_gmt":"2012-02-02T07:10:54","slug":"three20-use-tttableview-within-ttscrollview-addition","status":"publish","type":"post","link":"https:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/","title":{"rendered":"Three20 how to use TTTableView within TTScrollView addition"},"content":{"rendered":"<p id=\"top\" \/>In a current project I came across the situation that I wanted to implement a cool TTScrollView with a few TTTableViews in it.<\/p>\n<p>For some reason in my version of the current <a href=\"http:\/\/three20.info\/\">Three20 <\/a>branch the TableView was receiving the &#8220;up and down&#8221; touch events but the parent view (TTSscrollView) didn&#8217;t get any touch events. Googeling give me the result that some of you had the same problem but I couldn&#8217;t find any solution for the problem.<\/p>\n<p>So I came up with the following solution for the problem.<\/p>\n<p>I added a new category TTTableView+TouchesMoveAddition:<\/p>\n<pre class=\"brush:obj-c\">\/\/ UI\r\n #import \"Three20UI\/TTNavigator.h\"\r\n #import \"Three20UI\/TTStyledTextLabel.h\"\r\n #import \"Three20UI\/UIViewAdditions.h\"\r\n\r\n\/\/ UICommon\r\n #import \"Three20UICommon\/UIWindowAdditions.h\"\r\n\r\n\/\/ Style\r\n #import \"Three20Style\/TTStyledNode.h\"\r\n #import \"Three20Style\/TTStyledButtonNode.h\"\r\n #import \"Three20Style\/TTStyledLinkNode.h\"\r\n\r\n\/\/ Core\r\n #import \"Three20Core\/TTCorePreprocessorMacros.h\"\r\n\r\n#import \"TTTableView+TouchesMovedAddition.h\"\r\n\r\n@implementation TTTableView (TTTableViewDataSourceNIBCapAddition)\r\n\r\n- (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event {\r\n [super touchesBegan:touches withEvent:event];\r\n\r\nif ([self.delegate respondsToSelector:@selector(tableView:touchesMoved:withEvent:)]) {\r\n id&lt;TTTableViewDelegate&gt; delegate = (id&lt;TTTableViewDelegate&gt;)self.delegate;\r\n [delegate tableView:self touchesMoved:touches withEvent:event];\r\n }\r\n\r\nif (_highlightedLabel) {\r\n UITouch* touch = [touches anyObject];\r\n _highlightStartPoint = [touch locationInView:self];\r\n }\r\n }\r\n@end<\/pre>\n<p>So if you implement the UITableView protocol in your ViewController which holds, for example, your TTScrollView:<\/p>\n<pre class=\"brush:obj-c\">- (void)tableView:(UITableView*)tableView touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event{\r\n tableView.scrollEnabled = NO;\r\n [_scrollView touchesBegan:touches withEvent:event];\r\n\r\n}\r\n\r\n- (void)tableView:(UITableView*)tableView touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event{\r\n\r\n [_scrollView touchesMoved:touches withEvent:event];\r\n\r\n}\r\n\r\n- (void)tableView:(UITableView*)tableView touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event{\r\n tableView.scrollEnabled = YES;\r\n [_scrollView touchesEnded:touches withEvent:event];<\/pre>\n<p>}<\/p>\n<p>The touch events will be forwarded to the TTScrollView.<\/p>\n<p>Focus on the scrollEnable calls !!!&#8230; \ud83d\ude42<\/p>\n<p>have fun \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a current project I came across the situation that I wanted to implement a cool TTScrollView with a few TTTableViews in it. For some reason in my version of the current Three20 branch the TableView was receiving the &#8220;up and down&#8221; touch events but the parent view (TTSscrollView) didn&#8217;t get any touch events. Googeling &hellip; <a href=\"https:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Three20 how to use TTTableView within TTScrollView addition<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"ngg_post_thumbnail":0,"footnotes":""},"categories":[13],"tags":[],"class_list":["post-1395","post","type-post","status-publish","format-standard","hentry","category-iphone"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Three20 how to use TTTableView within TTScrollView addition - Mario&#039;s TinyLab<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Three20 how to use TTTableView within TTScrollView addition - Mario&#039;s TinyLab\" \/>\n<meta property=\"og:description\" content=\"In a current project I came across the situation that I wanted to implement a cool TTScrollView with a few TTTableViews in it. For some reason in my version of the current Three20 branch the TableView was receiving the &#8220;up and down&#8221; touch events but the parent view (TTSscrollView) didn&#8217;t get any touch events. Googeling &hellip; Continue reading Three20 how to use TTTableView within TTScrollView addition &rarr;\" \/>\n<meta property=\"og:url\" content=\"http:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/\" \/>\n<meta property=\"og:site_name\" content=\"Mario&#039;s TinyLab\" \/>\n<meta property=\"article:published_time\" content=\"2011-05-17T18:53:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-02-02T07:10:54+00:00\" \/>\n<meta name=\"author\" content=\"Mario Wehr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mario Wehr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2011\\\/05\\\/17\\\/three20-use-tttableview-within-ttscrollview-addition\\\/#article\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2011\\\/05\\\/17\\\/three20-use-tttableview-within-ttscrollview-addition\\\/\"},\"author\":{\"name\":\"Mario Wehr\",\"@id\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/#\\\/schema\\\/person\\\/8761b4d788b13b547de9ccd6504ce62d\"},\"headline\":\"Three20 how to use TTTableView within TTScrollView addition\",\"datePublished\":\"2011-05-17T18:53:48+00:00\",\"dateModified\":\"2012-02-02T07:10:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2011\\\/05\\\/17\\\/three20-use-tttableview-within-ttscrollview-addition\\\/\"},\"wordCount\":138,\"commentCount\":11,\"articleSection\":[\"iPhone\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2011\\\/05\\\/17\\\/three20-use-tttableview-within-ttscrollview-addition\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2011\\\/05\\\/17\\\/three20-use-tttableview-within-ttscrollview-addition\\\/\",\"url\":\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2011\\\/05\\\/17\\\/three20-use-tttableview-within-ttscrollview-addition\\\/\",\"name\":\"Three20 how to use TTTableView within TTScrollView addition - Mario&#039;s TinyLab\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/#website\"},\"datePublished\":\"2011-05-17T18:53:48+00:00\",\"dateModified\":\"2012-02-02T07:10:54+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/#\\\/schema\\\/person\\\/8761b4d788b13b547de9ccd6504ce62d\"},\"breadcrumb\":{\"@id\":\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2011\\\/05\\\/17\\\/three20-use-tttableview-within-ttscrollview-addition\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2011\\\/05\\\/17\\\/three20-use-tttableview-within-ttscrollview-addition\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2011\\\/05\\\/17\\\/three20-use-tttableview-within-ttscrollview-addition\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Three20 how to use TTTableView within TTScrollView addition\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/#website\",\"url\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/\",\"name\":\"Mario&#039;s TinyLab\",\"description\":\"About cool\\\/interesting Projects and Technologies\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/#\\\/schema\\\/person\\\/8761b4d788b13b547de9ccd6504ce62d\",\"name\":\"Mario Wehr\",\"url\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/author\\\/wehr\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Three20 how to use TTTableView within TTScrollView addition - Mario&#039;s TinyLab","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/","og_locale":"en_US","og_type":"article","og_title":"Three20 how to use TTTableView within TTScrollView addition - Mario&#039;s TinyLab","og_description":"In a current project I came across the situation that I wanted to implement a cool TTScrollView with a few TTTableViews in it. For some reason in my version of the current Three20 branch the TableView was receiving the &#8220;up and down&#8221; touch events but the parent view (TTSscrollView) didn&#8217;t get any touch events. Googeling &hellip; Continue reading Three20 how to use TTTableView within TTScrollView addition &rarr;","og_url":"http:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/","og_site_name":"Mario&#039;s TinyLab","article_published_time":"2011-05-17T18:53:48+00:00","article_modified_time":"2012-02-02T07:10:54+00:00","author":"Mario Wehr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Mario Wehr","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/#article","isPartOf":{"@id":"http:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/"},"author":{"name":"Mario Wehr","@id":"https:\/\/blog.fh-kaernten.at\/wehr\/#\/schema\/person\/8761b4d788b13b547de9ccd6504ce62d"},"headline":"Three20 how to use TTTableView within TTScrollView addition","datePublished":"2011-05-17T18:53:48+00:00","dateModified":"2012-02-02T07:10:54+00:00","mainEntityOfPage":{"@id":"http:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/"},"wordCount":138,"commentCount":11,"articleSection":["iPhone"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/","url":"http:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/","name":"Three20 how to use TTTableView within TTScrollView addition - Mario&#039;s TinyLab","isPartOf":{"@id":"https:\/\/blog.fh-kaernten.at\/wehr\/#website"},"datePublished":"2011-05-17T18:53:48+00:00","dateModified":"2012-02-02T07:10:54+00:00","author":{"@id":"https:\/\/blog.fh-kaernten.at\/wehr\/#\/schema\/person\/8761b4d788b13b547de9ccd6504ce62d"},"breadcrumb":{"@id":"http:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/blog.fh-kaernten.at\/wehr\/2011\/05\/17\/three20-use-tttableview-within-ttscrollview-addition\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.fh-kaernten.at\/wehr\/"},{"@type":"ListItem","position":2,"name":"Three20 how to use TTTableView within TTScrollView addition"}]},{"@type":"WebSite","@id":"https:\/\/blog.fh-kaernten.at\/wehr\/#website","url":"https:\/\/blog.fh-kaernten.at\/wehr\/","name":"Mario&#039;s TinyLab","description":"About cool\/interesting Projects and Technologies","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.fh-kaernten.at\/wehr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.fh-kaernten.at\/wehr\/#\/schema\/person\/8761b4d788b13b547de9ccd6504ce62d","name":"Mario Wehr","url":"https:\/\/blog.fh-kaernten.at\/wehr\/author\/wehr\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/posts\/1395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/comments?post=1395"}],"version-history":[{"count":0,"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/posts\/1395\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/media?parent=1395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/categories?post=1395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/tags?post=1395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}