\r\n\u661f\u671f\u56db<\/pre>\n\u679a\u4e3e\u4e2d\u5b9a\u4e49\u7684\u503c\uff08\u5982 Sunday\uff0cMonday\uff0c\u2026\u2026\u548cSaturday\uff09\u662f\u8fd9\u4e2a\u679a\u4e3e\u7684\u6210\u5458\u503c\uff08\u6216\u6210\u5458\uff09\u3002case\u5173\u952e\u8bcd\u8868\u793a\u4e00\u884c\u65b0\u7684\u6210\u5458\u503c\u5c06\u88ab\u5b9a\u4e49\u3002<\/p>\n
\u6ce8\u610f\uff1a \u548c C \u548c Objective-C \u4e0d\u540c\uff0cSwift \u7684\u679a\u4e3e\u6210\u5458\u5728\u88ab\u521b\u5efa\u65f6\u4e0d\u4f1a\u88ab\u8d4b\u4e88\u4e00\u4e2a\u9ed8\u8ba4\u7684\u6574\u578b\u503c\u3002\u5728\u4e0a\u9762\u7684DaysofaWeek\u4f8b\u5b50\u4e2d\uff0cSunday\uff0cMonday\uff0c\u2026\u2026\u548cSaturday\u4e0d\u4f1a\u9690\u5f0f\u5730\u8d4b\u503c\u4e3a0\uff0c1\uff0c\u2026\u2026\u548c6\u3002\u76f8\u53cd\uff0c\u8fd9\u4e9b\u679a\u4e3e\u6210\u5458\u672c\u8eab\u5c31\u6709\u5b8c\u5907\u7684\u503c\uff0c\u8fd9\u4e9b\u503c\u662f\u5df2\u7ecf\u660e\u786e\u5b9a\u4e49\u597d\u7684DaysofaWeek\u7c7b\u578b\u3002<\/p>\n
\r\nvar weekDay = DaysofaWeek.THURSDAY <\/pre>\nweekDay\u7684\u7c7b\u578b\u53ef\u4ee5\u5728\u5b83\u88abDaysofaWeek\u7684\u4e00\u4e2a\u53ef\u80fd\u503c\u521d\u59cb\u5316\u65f6\u63a8\u65ad\u51fa\u6765\u3002\u4e00\u65e6weekDay\u88ab\u58f0\u660e\u4e3a\u4e00\u4e2aDaysofaWeek\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a\u7f29\u5199\u8bed\u6cd5\uff08.\uff09\u5c06\u5176\u8bbe\u7f6e\u4e3a\u53e6\u4e00\u4e2aDaysofaWeek\u7684\u503c\uff1a<\/p>\n
\r\nvar weekDay = .THURSDAY <\/pre>\n\u5f53weekDay\u7684\u7c7b\u578b\u5df2\u77e5\u65f6\uff0c\u518d\u6b21\u4e3a\u5176\u8d4b\u503c\u53ef\u4ee5\u7701\u7565\u679a\u4e3e\u540d\u3002\u4f7f\u7528\u663e\u5f0f\u7c7b\u578b\u7684\u679a\u4e3e\u503c\u53ef\u4ee5\u8ba9\u4ee3\u7801\u5177\u6709\u66f4\u597d\u7684\u53ef\u8bfb\u6027\u3002<\/p>\n
\u679a\u4e3e\u53ef\u5206\u4e3a\u76f8\u5173\u503c\u4e0e\u539f\u59cb\u503c\u3002<\/p>\n
\u76f8\u5173\u503c\u4e0e\u539f\u59cb\u503c\u7684\u533a\u522b<\/strong><\/div>\n<\/p>\n
\u76f8\u5173\u503c<\/strong><\/div>\n\u4ee5\u4e0b\u5b9e\u4f8b\u4e2d\u6211\u4eec\u5b9a\u4e49\u4e00\u4e2a\u540d\u4e3a Student \u7684\u679a\u4e3e\u7c7b\u578b\uff0c\u5b83\u53ef\u4ee5\u662f Name \u7684\u4e00\u4e2a\u5b57\u7b26\u4e32\uff08String\uff09\uff0c\u6216\u8005\u662f Mark \u7684\u4e00\u4e2a\u76f8\u5173\u503c\uff08Int\uff0cInt\uff0cInt\uff09\u3002<\/p>\n
\r\nimport Cocoa\r\n\r\nenum Student{\r\n case Name(String)\r\n case Mark(Int,Int,Int)\r\n}\r\nvar studDetails = Student.Name(\"Runoob\")\r\nvar studMarks = Student.Mark(98,97,95)\r\nswitch studMarks {\r\ncase .Name(let studName):\r\n print(\"\u5b66\u751f\u7684\u540d\u5b57\u662f: \\(studName)\u3002\")\r\ncase .Mark(let Mark1, let Mark2, let Mark3):\r\n print(\"\u5b66\u751f\u7684\u6210\u7ee9\u662f: \\(Mark1),\\(Mark2),\\(Mark3)\u3002\")\r\n}<\/pre>\n\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n
\r\n\u5b66\u751f\u7684\u6210\u7ee9\u662f: 98,97,95\u3002<\/pre>\n\u539f\u59cb\u503c<\/strong><\/div>\n\u539f\u59cb\u503c\u53ef\u4ee5\u662f\u5b57\u7b26\u4e32\uff0c\u5b57\u7b26\uff0c\u6216\u8005\u4efb\u4f55\u6574\u578b\u503c\u6216\u6d6e\u70b9\u578b\u503c\u3002\u6bcf\u4e2a\u539f\u59cb\u503c\u5728\u5b83\u7684\u679a\u4e3e\u58f0\u660e\u4e2d\u5fc5\u987b\u662f\u552f\u4e00\u7684\u3002<\/p>\n
\u5728\u539f\u59cb\u503c\u4e3a\u6574\u6570\u7684\u679a\u4e3e\u65f6\uff0c\u4e0d\u9700\u8981\u663e\u5f0f\u7684\u4e3a\u6bcf\u4e00\u4e2a\u6210\u5458\u8d4b\u503c\uff0cSwift\u4f1a\u81ea\u52a8\u4e3a\u4f60\u8d4b\u503c\u3002<\/p>\n
\u4f8b\u5982\uff0c\u5f53\u4f7f\u7528\u6574\u6570\u4f5c\u4e3a\u539f\u59cb\u503c\u65f6\uff0c\u9690\u5f0f\u8d4b\u503c\u7684\u503c\u4f9d\u6b21\u9012\u589e1\u3002\u5982\u679c\u7b2c\u4e00\u4e2a\u503c\u6ca1\u6709\u88ab\u8d4b\u521d\u503c\uff0c\u5c06\u4f1a\u88ab\u81ea\u52a8\u7f6e\u4e3a0\u3002<\/p>\n
\r\nimport Cocoa\r\n\r\nenum Month: Int {\r\n case January = 1, February, March, April, May, June, July, August, September, October, November, December\r\n}\r\n\r\nlet yearMonth = Month.May.rawValue\r\nprint(\"\u6570\u5b57\u6708\u4efd\u4e3a: \\(yearMonth)\u3002\")<\/pre>\n\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n
\r\n\u6570\u5b57\u6708\u4efd\u4e3a: 5\u3002<\/pre>\n","protected":false},"excerpt":{"rendered":"\u679a\u4e3e\u7b80\u5355\u7684\u8bf4\u4e5f\u662f\u4e00\u79cd\u6570\u636e\u7c7b\u578b\uff0c\u53ea\u4e0d\u8fc7\u662f\u8fd9\u79cd\u6570\u636e\u7c7b\u578b\u53ea\u5305\u542b\u81ea\u5b9a\u4e49\u7684\u7279\u5b9a\u6570\u636e\uff0c\u5b83\u662f\u4e00\u7ec4\u6709\u5171\u540c\u7279\u6027\u7684\u6570\u636e\u7684\u96c6\u5408\u3002 S […]<\/p>\n","protected":false},"author":1470,"featured_media":175141,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-175223","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/175223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1470"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=175223"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/175223\/revisions"}],"predecessor-version":[{"id":175228,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/175223\/revisions\/175228"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/175141"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=175223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=175223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=175223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}