{"id":1213,"date":"2026-09-10T02:12:34","date_gmt":"2026-09-10T02:12:34","guid":{"rendered":"https:\/\/x.sheep-mine.ts.net\/index.php\/52032923-kodebits-day-89-enum-raw-values\/"},"modified":"2026-09-10T02:12:34","modified_gmt":"2026-09-10T02:12:34","slug":"52032923-kodebits-day-89-enum-raw-values","status":"publish","type":"post","link":"https:\/\/x.sheep-mine.ts.net\/index.php\/52032923-kodebits-day-89-enum-raw-values\/","title":{"rendered":"Kodebits Day 89: Enum Raw Values"},"content":{"rendered":"<p><br \/>\n<\/p>\n<div>\n<h2 id=\"toc-anchor-001\">What is the output?<\/h2>\n<pre lang=\"swift\">\r\nenum Status: Int {\r\n  case pending = 1\r\n  case active = 5\r\n  case done = 10\r\n}\r\nlet s = Status.active\r\nprint(s.rawValue)\r\nprint(Status.done.rawValue)\r\n<\/pre>\n<p>\n  <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/swiftfiddle.com\/acc9bdba8b3c757b8c4a6a5133363dbb\" target=\"_blank\" rel=\"noopener noreferrer\"><br \/>Try it in the online Swift Playground \u2192<br \/><\/a>\n<\/p>\n<p>[spoiler title=&#8221;Solution&#8221;]<\/p>\n<h3 id=\"toc-anchor-002\">Answer:<\/h3>\n<pre>\r\n5\r\n10\r\n<\/pre>\n<h3 id=\"toc-anchor-003\">Explanation:<\/h3>\n<p>Raw values provide underlying primitive values for enum cases.<\/p>\n<p>[\/spoiler]<\/p>\n<hr\/>\n<h3 id=\"toc-anchor-004\">Further Reading<\/h3>\n<\/p><\/div>\n<p><br \/>\n<br \/><a href=\"https:\/\/www.kodeco.com\/52032923-kodebits-day-89-enum-raw-values\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is the output? enum Status: Int { case pending = 1 case active =&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1214,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1322,1321],"tags":[],"class_list":["post-1213","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-article","category-free"],"_links":{"self":[{"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/posts\/1213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/comments?post=1213"}],"version-history":[{"count":0,"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/posts\/1213\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/media\/1214"}],"wp:attachment":[{"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/media?parent=1213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/categories?post=1213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/tags?post=1213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}