{"id":512,"date":"2012-05-22T22:32:55","date_gmt":"2012-05-23T04:32:55","guid":{"rendered":"http:\/\/fidgetware.com\/WPBlog\/page14.php\/?p=512"},"modified":"2012-05-22T22:34:13","modified_gmt":"2012-05-23T04:34:13","slug":"ccpickerview","status":"publish","type":"post","link":"https:\/\/fidgetware.com\/wordpress\/?p=512","title":{"rendered":"CCPickerView"},"content":{"rendered":"<div id=\"attachment_516\" style=\"width: 310px\" class=\"wp-caption alignright\"><a href=\"http:\/\/fidgetware.com\/blog\/wp-content\/uploads\/2012\/05\/Screen-Shot-2012-05-22-at-10.28.30-PM.png\"><img aria-describedby=\"caption-attachment-516\" loading=\"lazy\" class=\"size-medium wp-image-516\" title=\"CCpickerView\" src=\"http:\/\/fidgetware.com\/blog\/wp-content\/uploads\/2012\/05\/Screen-Shot-2012-05-22-at-10.28.30-PM-300x159.png\" alt=\"CCpickerView Screenshot\" width=\"300\" height=\"159\" srcset=\"https:\/\/fidgetware.com\/wordpress\/wp-content\/uploads\/2012\/05\/Screen-Shot-2012-05-22-at-10.28.30-PM-300x159.png 300w, https:\/\/fidgetware.com\/wordpress\/wp-content\/uploads\/2012\/05\/Screen-Shot-2012-05-22-at-10.28.30-PM.png 744w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-516\" class=\"wp-caption-text\">CCpickerView<\/p><\/div>\n<p>I have had a few weeks of being able to work on my Math Explosion App, which is in serious need of an update. It was the first app that wrote way back in 2009 and has not been updated since then. \u00a0I always keep expecting it to break when Apple releases a new version of iOS. \u00a0I am doing more than an update, I am doing a complete rewrite. The original app was written using UIKit and Core Animation but I have felt for a very long time that the app needs to be more gamey to get the kids more interested in playing. As a result I am doing a complete rewrite using Cocos2d. I have dabbled with Cocos2d in the past but have never been able to spend much time using it until now. One of the first things I missed from UIKit was the UIPickerView. I also noticed quite a few other people out there also looking for a UIPickerView equivalent but with no success. In the end I wrote my own CCPickerView with the desire to make it as similar as UIPickerView, but for Cocos2d. \u00a0If you know how to use UIPickerView you will have no problem finding your way around setting up CCPickerView.<\/p>\n<p>I want to mention some of the differences. \u00a0Firstly CCPickerView does not create a picker like UIPickerView. It simply creates the components, you have to supply your own &#8220;overlay&#8221;. I did this deliberately for two reasons. Firstly it was way simpler for me to code and secondly I figured everyone would want to have their own picker image that matched their app. \u00a0The CCPickerView can be as big or as small as you like, which is not true for UIPickerView unless you incorporate some tricks.<\/p>\n<p>I also added some extras like continuous components. \u00a0With UIPickerView you add your rows, but if you want the last row to appear to be next to the first row as if the component has been rotated through 360 degrees you had to do the extra coding yourself. \u00a0I also needed the components to spin. \u00a0This was a bit tricky for me as I wanted something that was flexible as I could see many possible uses. \u00a0As a result you can configure settings like the speed of the spin, how many times the components spin and if the components ease in and out when starting and stopping. \u00a0You also get to control the stop row. \u00a0How else are you going to have a winner.<\/p>\n<p>You can find the code on GitHub\u00a0<a title=\"CCpickerView\" href=\"https:\/\/github.com\/fidgetware\/CCPickerView\" target=\"_blank\">\u00a0https:\/\/github.com\/fidgetware\/CCPickerView<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have had a few weeks of being able to work on my Math Explosion App, which is in serious need of an update. It was the first app that wrote way back in 2009 and has not been updated since then. \u00a0I always keep expecting it to break when Apple releases a new version [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,1],"tags":[32,31,34,9],"_links":{"self":[{"href":"https:\/\/fidgetware.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/512"}],"collection":[{"href":"https:\/\/fidgetware.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fidgetware.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fidgetware.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fidgetware.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=512"}],"version-history":[{"count":6,"href":"https:\/\/fidgetware.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/512\/revisions"}],"predecessor-version":[{"id":519,"href":"https:\/\/fidgetware.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/512\/revisions\/519"}],"wp:attachment":[{"href":"https:\/\/fidgetware.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fidgetware.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fidgetware.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}