{"id":5672,"date":"2016-12-20T18:36:00","date_gmt":"2016-12-21T02:36:00","guid":{"rendered":"https:\/\/blog.mhvt.net\/?p=5672"},"modified":"2016-12-20T18:36:00","modified_gmt":"2016-12-21T02:36:00","slug":"ios-swift-making-a-custom-dial-menu","status":"publish","type":"post","link":"https:\/\/blog.mhvt.net\/?p=5672","title":{"rendered":"iOS &#038; Swift \u00e2\u20ac\u201c Making a Custom Dial Menu"},"content":{"rendered":"<p><a href=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"mac\/mac_shareware\/iphoneImage.jpg\" width=\"120\" height=\"120\" alt=\"iPhone custom slider\" \/><\/a><br \/>\n<br \/><\/br><br \/>\n<br \/><\/br><br \/>\nTOKYO (MacHouse) &#8211; These days, I&#8217;ve been looking for a design challenge for an <strong>iOS<\/strong> application as I have plenty of free time.  And I went to <strong>dribble.com<\/strong> yesterday again to see if there is anything interesting.  What caught my eyes is <a href=\"https:\/\/dribbble.com\/shots\/801609-Concept-Idea-Radial-Menu-UI-animated\">this design<\/a>.  Whoa&#8230;  Quite amazing&#8230;  I don&#8217;t know how they make that kind of control.  So I launched <strong>Xcode 8<\/strong> and started writing code in Swift last night. <!--more--><br \/>\n<br \/><\/br><\/p>\n<table width=\"464\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n<td width=\"220\" valign=\"top\"><a href=\"mac\/mac_shareware\/radialmania\/radialmaniaImage.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"mac\/mac_shareware\/radialmania\/thumbnail_radialmaniaImage.jpg\" width=\"220\" height=\"406\" alt=\"iOS Swift\"\/><\/a><\/a><\/p>\n<div align=\"center\">Screenshot 1<\/div>\n<\/td>\n<td width=\"20\">&nbsp;<\/td>\n<td width=\"220\" valign=\"top\"><a href=\"mac\/mac_shareware\/radialmania\/radialmaniaXcode.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"mac\/mac_shareware\/radialmania\/thumbnail_radialmaniaXcode.jpg\" width=\"220\" height=\"127\" alt=\"iOS Swift\"\/><\/a><\/a><\/p>\n<div align=\"center\">Screenshot 2<\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p><\/br><br \/>\nWell, my work (See Screenshot 1.) isn&#8217;t terribly bad although they&#8217;ve done a way better job.  I wasn&#8217;t sure if I could rotate a view (UIView).  When I first touched this dial control, the blue segment was jumpy.<\/p>\n<p>In order to create this dial control, I have gathered nine images.  You certainly need to use the <strong>touchesMoved<\/strong> method.  I&#8217;ve actually created a subclass of <strong>UIView<\/strong> and embedded <strong>touchesBegan<\/strong>, touchesMoved and <strong>touchesEnded<\/strong> methods in it.  (See Screenshot 2.)  The user is able to touch and move the small blue segment, which is not an image, actually.  It&#8217;s the result of an arc with <strong>UIBezierPath<\/strong>.<br \/>\n<br \/><\/br><br \/>\nClick <a href=\"mac\/mac_shareware\/radialmania\/radialmaniaVideo.mov\">here<\/a> to watch a quick iPhone Simulator QuickTime movie.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TOKYO (MacHouse) &#8211; These days, I&#8217;ve been looking for a design challenge for an iOS application as I have plenty of free time. And I went to dribble.com yesterday again to see if there is anything interesting. What caught my &hellip; <a href=\"https:\/\/blog.mhvt.net\/?p=5672\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":342,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[504,507],"tags":[],"class_list":["post-5672","post","type-post","status-publish","format-standard","hentry","category-ios","category-swift"],"_links":{"self":[{"href":"https:\/\/blog.mhvt.net\/index.php?rest_route=\/wp\/v2\/posts\/5672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mhvt.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mhvt.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mhvt.net\/index.php?rest_route=\/wp\/v2\/users\/342"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mhvt.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5672"}],"version-history":[{"count":4,"href":"https:\/\/blog.mhvt.net\/index.php?rest_route=\/wp\/v2\/posts\/5672\/revisions"}],"predecessor-version":[{"id":5676,"href":"https:\/\/blog.mhvt.net\/index.php?rest_route=\/wp\/v2\/posts\/5672\/revisions\/5676"}],"wp:attachment":[{"href":"https:\/\/blog.mhvt.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mhvt.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mhvt.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}