{"action":"created","comment":{"url":"https://api.github.com/repos/NSHipster/articles/pulls/comments/48433377","id":48433377,"diff_hunk":"@@ -0,0 +1,185 @@\n+---\n+title: RawOptionSetType\n+author: Mattt Thompson\n+translator: Chester Liu\n+category: Swift\n+tags: swift\n+excerpt: \"Swift 的枚举类型和 Objective-C 中的 `NS_ENUM` 宏相比是一种显著的进步。不幸的是， `NS_OPTIONS` 就没有那么令人愉快了\"\n+status:\n+    swift: 1.2\n+---\n+\n+在 Objective-C 中，[`NS_ENUM` & `NS_OPTIONS`](http://nshipster.com/ns_enum-ns_options/)被用于注释 C 语言中的 `enum` 类型，它实现的很漂亮，给编译器和开发者都设置了清晰的期望。自从在 Xcode 4.5 中被引进以后，这两个宏已经成为了系统框架中的标准规范，也是社区公认的最佳实践。\n+\n+在 Swift 中，枚举类型成了和 `struct` 与 `class` 一样的一等语言结构，包含了很多富于表现力的新特性，例如原始类型(raw types)和关联值(associated values)。枚举非常适合于封装一组固定值的封闭集合，开发者们在代码中都很积极地尝试去使用它。","path":"2014-09-08-rawoptionsettype.md","position":14,"original_position":14,"commit_id":"493b3e9a8bc0bd6b6018daca4d9737f1b92e6983","original_commit_id":"493b3e9a8bc0bd6b6018daca4d9737f1b92e6983","user":{"login":"rickytan","id":1250207,"avatar_url":"https://avatars.githubusercontent.com/u/1250207?v=3","gravatar_id":"","url":"https://api.github.com/users/rickytan","html_url":"https://github.com/rickytan","followers_url":"https://api.github.com/users/rickytan/followers","following_url":"https://api.github.com/users/rickytan/following{/other_user}","gists_url":"https://api.github.com/users/rickytan/gists{/gist_id}","starred_url":"https://api.github.com/users/rickytan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickytan/subscriptions","organizations_url":"https://api.github.com/users/rickytan/orgs","repos_url":"https://api.github.com/users/rickytan/repos","events_url":"https://api.github.com/users/rickytan/events{/privacy}","received_events_url":"https://api.github.com/users/rickytan/received_events","type":"User","site_admin":false},"body":"括号用中文括号吧","created_at":"2015-12-25T06:32:07Z","updated_at":"2015-12-25T06:32:07Z","html_url":"https://github.com/NSHipster/articles/pull/362#discussion_r48433377","pull_request_url":"https://api.github.com/repos/NSHipster/articles/pulls/362","_links":{"self":{"href":"https://api.github.com/repos/NSHipster/articles/pulls/comments/48433377"},"html":{"href":"https://github.com/NSHipster/articles/pull/362#discussion_r48433377"},"pull_request":{"href":"https://api.github.com/repos/NSHipster/articles/pulls/362"}}},"pull_request":{"url":"https://api.github.com/repos/NSHipster/articles/pulls/362","id":53699211,"html_url":"https://github.com/NSHipster/articles/pull/362","diff_url":"https://github.com/NSHipster/articles/pull/362.diff","patch_url":"https://github.com/NSHipster/articles/pull/362.patch","issue_url":"https://api.github.com/repos/NSHipster/articles/issues/362","number":362,"state":"open","locked":false,"title":"translate 2014-09-08-rawoptionsettype.md","user":{"login":"skyline75489","id":4710575,"avatar_url":"https://avatars.githubusercontent.com/u/4710575?v=3","gravatar_id":"","url":"https://api.github.com/users/skyline75489","html_url":"https://github.com/skyline75489","followers_url":"https://api.github.com/users/skyline75489/followers","following_url":"https://api.github.com/users/skyline75489/following{/other_user}","gists_url":"https://api.github.com/users/skyline75489/gists{/gist_id}","starred_url":"https://api.github.com/users/skyline75489/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skyline75489/subscriptions","organizations_url":"https://api.github.com/users/skyline75489/orgs","repos_url":"https://api.github.com/users/skyline75489/repos","events_url":"https://api.github.com/users/skyline75489/events{/privacy}","received_events_url":"https://api.github.com/users/skyline75489/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-15T12:54:11Z","updated_at":"2015-12-25T06:32:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"630ad4c98a2070a6504cfde101cfd3259e067775","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NSHipster/articles/pulls/362/commits","review_comments_url":"https://api.github.com/repos/NSHipster/articles/pulls/362/comments","review_comment_url":"https://api.github.com/repos/NSHipster/articles/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NSHipster/articles/issues/362/comments","statuses_url":"https://api.github.com/repos/NSHipster/articles/statuses/493b3e9a8bc0bd6b6018daca4d9737f1b92e6983","head":{"label":"skyline75489:rawoptionsettype-translation","ref":"rawoptionsettype-translation","sha":"493b3e9a8bc0bd6b6018daca4d9737f1b92e6983","user":{"login":"skyline75489","id":4710575,"avatar_url":"https://avatars.githubusercontent.com/u/4710575?v=3","gravatar_id":"","url":"https://api.github.com/users/skyline75489","html_url":"https://github.com/skyline75489","followers_url":"https://api.github.com/users/skyline75489/followers","following_url":"https://api.github.com/users/skyline75489/following{/other_user}","gists_url":"https://api.github.com/users/skyline75489/gists{/gist_id}","starred_url":"https://api.github.com/users/skyline75489/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skyline75489/subscriptions","organizations_url":"https://api.github.com/users/skyline75489/orgs","repos_url":"https://api.github.com/users/skyline75489/repos","events_url":"https://api.github.com/users/skyline75489/events{/privacy}","received_events_url":"https://api.github.com/users/skyline75489/received_events","type":"User","site_admin":false},"repo":{"id":47229118,"name":"articles","full_name":"skyline75489/articles","owner":{"login":"skyline75489","id":4710575,"avatar_url":"https://avatars.githubusercontent.com/u/4710575?v=3","gravatar_id":"","url":"https://api.github.com/users/skyline75489","html_url":"https://github.com/skyline75489","followers_url":"https://api.github.com/users/skyline75489/followers","following_url":"https://api.github.com/users/skyline75489/following{/other_user}","gists_url":"https://api.github.com/users/skyline75489/gists{/gist_id}","starred_url":"https://api.github.com/users/skyline75489/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skyline75489/subscriptions","organizations_url":"https://api.github.com/users/skyline75489/orgs","repos_url":"https://api.github.com/users/skyline75489/repos","events_url":"https://api.github.com/users/skyline75489/events{/privacy}","received_events_url":"https://api.github.com/users/skyline75489/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/skyline75489/articles","description":"Weekly articles for NSHipster.com","fork":true,"url":"https://api.github.com/repos/skyline75489/articles","forks_url":"https://api.github.com/repos/skyline75489/articles/forks","keys_url":"https://api.github.com/repos/skyline75489/articles/keys{/key_id}","collaborators_url":"https://api.github.com/repos/skyline75489/articles/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/skyline75489/articles/teams","hooks_url":"https://api.github.com/repos/skyline75489/articles/hooks","issue_events_url":"https://api.github.com/repos/skyline75489/articles/issues/events{/number}","events_url":"https://api.github.com/repos/skyline75489/articles/events","assignees_url":"https://api.github.com/repos/skyline75489/articles/assignees{/user}","branches_url":"https://api.github.com/repos/skyline75489/articles/branches{/branch}","tags_url":"https://api.github.com/repos/skyline75489/articles/tags","blobs_url":"https://api.github.com/repos/skyline75489/articles/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/skyline75489/articles/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/skyline75489/articles/git/refs{/sha}","trees_url":"https://api.github.com/repos/skyline75489/articles/git/trees{/sha}","statuses_url":"https://api.github.com/repos/skyline75489/articles/statuses/{sha}","languages_url":"https://api.github.com/repos/skyline75489/articles/languages","stargazers_url":"https://api.github.com/repos/skyline75489/articles/stargazers","contributors_url":"https://api.github.com/repos/skyline75489/articles/contributors","subscribers_url":"https://api.github.com/repos/skyline75489/articles/subscribers","subscription_url":"https://api.github.com/repos/skyline75489/articles/subscription","commits_url":"https://api.github.com/repos/skyline75489/articles/commits{/sha}","git_commits_url":"https://api.github.com/repos/skyline75489/articles/git/commits{/sha}","comments_url":"https://api.github.com/repos/skyline75489/articles/comments{/number}","issue_comment_url":"https://api.github.com/repos/skyline75489/articles/issues/comments{/number}","contents_url":"https://api.github.com/repos/skyline75489/articles/contents/{+path}","compare_url":"https://api.github.com/repos/skyline75489/articles/compare/{base}...{head}","merges_url":"https://api.github.com/repos/skyline75489/articles/merges","archive_url":"https://api.github.com/repos/skyline75489/articles/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/skyline75489/articles/downloads","issues_url":"https://api.github.com/repos/skyline75489/articles/issues{/number}","pulls_url":"https://api.github.com/repos/skyline75489/articles/pulls{/number}","milestones_url":"https://api.github.com/repos/skyline75489/articles/milestones{/number}","notifications_url":"https://api.github.com/repos/skyline75489/articles/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/skyline75489/articles/labels{/name}","releases_url":"https://api.github.com/repos/skyline75489/articles/releases{/id}","created_at":"2015-12-02T01:38:11Z","updated_at":"2015-12-01T09:56:09Z","pushed_at":"2015-12-18T00:58:34Z","git_url":"git://github.com/skyline75489/articles.git","ssh_url":"git@github.com:skyline75489/articles.git","clone_url":"https://github.com/skyline75489/articles.git","svn_url":"https://github.com/skyline75489/articles","homepage":null,"size":2359,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"NSHipster:zh-Hans","ref":"zh-Hans","sha":"6c57f94331bb1a8e500664ad5cb2364974bcfb30","user":{"login":"NSHipster","id":3135314,"avatar_url":"https://avatars.githubusercontent.com/u/3135314?v=3","gravatar_id":"","url":"https://api.github.com/users/NSHipster","html_url":"https://github.com/NSHipster","followers_url":"https://api.github.com/users/NSHipster/followers","following_url":"https://api.github.com/users/NSHipster/following{/other_user}","gists_url":"https://api.github.com/users/NSHipster/gists{/gist_id}","starred_url":"https://api.github.com/users/NSHipster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NSHipster/subscriptions","organizations_url":"https://api.github.com/users/NSHipster/orgs","repos_url":"https://api.github.com/users/NSHipster/repos","events_url":"https://api.github.com/users/NSHipster/events{/privacy}","received_events_url":"https://api.github.com/users/NSHipster/received_events","type":"Organization","site_admin":false},"repo":{"id":7414142,"name":"articles","full_name":"NSHipster/articles","owner":{"login":"NSHipster","id":3135314,"avatar_url":"https://avatars.githubusercontent.com/u/3135314?v=3","gravatar_id":"","url":"https://api.github.com/users/NSHipster","html_url":"https://github.com/NSHipster","followers_url":"https://api.github.com/users/NSHipster/followers","following_url":"https://api.github.com/users/NSHipster/following{/other_user}","gists_url":"https://api.github.com/users/NSHipster/gists{/gist_id}","starred_url":"https://api.github.com/users/NSHipster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NSHipster/subscriptions","organizations_url":"https://api.github.com/users/NSHipster/orgs","repos_url":"https://api.github.com/users/NSHipster/repos","events_url":"https://api.github.com/users/NSHipster/events{/privacy}","received_events_url":"https://api.github.com/users/NSHipster/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NSHipster/articles","description":"Weekly articles for NSHipster.com","fork":false,"url":"https://api.github.com/repos/NSHipster/articles","forks_url":"https://api.github.com/repos/NSHipster/articles/forks","keys_url":"https://api.github.com/repos/NSHipster/articles/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NSHipster/articles/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NSHipster/articles/teams","hooks_url":"https://api.github.com/repos/NSHipster/articles/hooks","issue_events_url":"https://api.github.com/repos/NSHipster/articles/issues/events{/number}","events_url":"https://api.github.com/repos/NSHipster/articles/events","assignees_url":"https://api.github.com/repos/NSHipster/articles/assignees{/user}","branches_url":"https://api.github.com/repos/NSHipster/articles/branches{/branch}","tags_url":"https://api.github.com/repos/NSHipster/articles/tags","blobs_url":"https://api.github.com/repos/NSHipster/articles/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NSHipster/articles/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NSHipster/articles/git/refs{/sha}","trees_url":"https://api.github.com/repos/NSHipster/articles/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NSHipster/articles/statuses/{sha}","languages_url":"https://api.github.com/repos/NSHipster/articles/languages","stargazers_url":"https://api.github.com/repos/NSHipster/articles/stargazers","contributors_url":"https://api.github.com/repos/NSHipster/articles/contributors","subscribers_url":"https://api.github.com/repos/NSHipster/articles/subscribers","subscription_url":"https://api.github.com/repos/NSHipster/articles/subscription","commits_url":"https://api.github.com/repos/NSHipster/articles/commits{/sha}","git_commits_url":"https://api.github.com/repos/NSHipster/articles/git/commits{/sha}","comments_url":"https://api.github.com/repos/NSHipster/articles/comments{/number}","issue_comment_url":"https://api.github.com/repos/NSHipster/articles/issues/comments{/number}","contents_url":"https://api.github.com/repos/NSHipster/articles/contents/{+path}","compare_url":"https://api.github.com/repos/NSHipster/articles/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NSHipster/articles/merges","archive_url":"https://api.github.com/repos/NSHipster/articles/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NSHipster/articles/downloads","issues_url":"https://api.github.com/repos/NSHipster/articles/issues{/number}","pulls_url":"https://api.github.com/repos/NSHipster/articles/pulls{/number}","milestones_url":"https://api.github.com/repos/NSHipster/articles/milestones{/number}","notifications_url":"https://api.github.com/repos/NSHipster/articles/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NSHipster/articles/labels{/name}","releases_url":"https://api.github.com/repos/NSHipster/articles/releases{/id}","created_at":"2013-01-02T22:04:00Z","updated_at":"2015-12-25T04:39:57Z","pushed_at":"2015-12-24T06:12:53Z","git_url":"git://github.com/NSHipster/articles.git","ssh_url":"git@github.com:NSHipster/articles.git","clone_url":"https://github.com/NSHipster/articles.git","svn_url":"https://github.com/NSHipster/articles","homepage":null,"size":2472,"stargazers_count":530,"watchers_count":530,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":214,"mirror_url":null,"open_issues_count":17,"forks":214,"open_issues":17,"watchers":530,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NSHipster/articles/pulls/362"},"html":{"href":"https://github.com/NSHipster/articles/pull/362"},"issue":{"href":"https://api.github.com/repos/NSHipster/articles/issues/362"},"comments":{"href":"https://api.github.com/repos/NSHipster/articles/issues/362/comments"},"review_comments":{"href":"https://api.github.com/repos/NSHipster/articles/pulls/362/comments"},"review_comment":{"href":"https://api.github.com/repos/NSHipster/articles/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NSHipster/articles/pulls/362/commits"},"statuses":{"href":"https://api.github.com/repos/NSHipster/articles/statuses/493b3e9a8bc0bd6b6018daca4d9737f1b92e6983"}}}}