{"id":110,"date":"2025-10-04T09:17:48","date_gmt":"2025-10-04T00:17:48","guid":{"rendered":"https:\/\/devserver.kr\/blog\/?p=110"},"modified":"2025-10-04T09:17:48","modified_gmt":"2025-10-04T00:17:48","slug":"ios-actionsheet","status":"publish","type":"post","link":"https:\/\/devserver.kr\/blog\/ios\/ios-actionsheet\/","title":{"rendered":"iOS ActionSheet"},"content":{"rendered":"\n<div class=\"wp-block-jetpack-markdown\"><pre><code class=\"language-swift\">func showActionSheet() {\n    let alert = UIAlertController(title: &quot;Add&quot;.localized, message: &quot;ADD_ITEM_MESSAGE&quot;.localized, preferredStyle: .actionSheet)\n\n    let addWorkoutAction = UIAlertAction(title: &quot;\uc6b4\ub3d9&quot;, style: .default, handler: { (action) in\n            self.startAddAction()\n        })\n    let imgWorkout = UIImage(named: &quot;add_workout&quot;)!.withRenderingMode(.alwaysOriginal)\n    \/\/okImage.tintColor = ThemeManager.o.colorOf(&quot;Theme_blue&quot;)\n    addWorkoutAction.setValue(imgWorkout, forKey: &quot;image&quot;)\n    \/\/addWorkoutAction.setValue(UIColor.red, forKey: &quot;imageTintColor&quot;)\n    addWorkoutAction.setValue(UIColor.white, forKey: &quot;titleTextColor&quot;)\n    addWorkoutAction.setValue(CATextLayerAlignmentMode.left, forKey: &quot;titleTextAlignment&quot;)\n    alert.addAction(addWorkoutAction)\n\n    let addProgramAction = UIAlertAction(title: &quot;\ud504\ub85c\uadf8\ub7a8&quot;, style: .default, handler: { (action) in\n        self.startAddProgram()\n    })\n    let imgProgram = UIImage(named: &quot;add_program&quot;)!.withRenderingMode(.alwaysOriginal)\n    \/\/okImage.tintColor = ThemeManager.o.colorOf(&quot;Theme_blue&quot;)\n    addProgramAction.setValue(imgProgram, forKey: &quot;image&quot;)\n    addProgramAction.setValue(UIColor.white, forKey: &quot;titleTextColor&quot;)\n    addProgramAction.setValue(CATextLayerAlignmentMode.left, forKey: &quot;titleTextAlignment&quot;)\n    alert.addAction(addProgramAction)\n\n    let cancelAction = UIAlertAction(title: &quot;Cancel&quot;.localized, style: .cancel, handler: { (action) in\n\n        })\n        cancelAction.setValue(UIColor.white, forKey: &quot;titleTextColor&quot;)\n        alert.addAction(cancelAction)\n\n        self.present(alert, animated: true, completion: { () in\n            print(&quot;completion&quot;)\n        })\n    }\n<\/code><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,7],"tags":[],"class_list":["post-110","post","type-post","status-publish","format-standard","hentry","category-ios","category-swift"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/posts\/110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/comments?post=110"}],"version-history":[{"count":1,"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/posts\/110\/revisions"}],"predecessor-version":[{"id":111,"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/posts\/110\/revisions\/111"}],"wp:attachment":[{"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/media?parent=110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/categories?post=110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/tags?post=110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}