{"action":"created","comment":{"url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/pulls/comments/49099184","id":49099184,"diff_hunk":"@@ -10,6 +10,71 @@ If there is anything you are looking for that is not covered here you should ref\n \n ----\n \n+### File structure ###\n+\n+You should not have multiple classes in the same file, each class should have its own file. If you want to create a private class you can either define a private class inside the same file, or create a nested class inside the file's class.\n+\n+```swift\n+class myClass {\n+\t// You can create a nested class inside the class...\n+\tclass myNeastedClass {\n+\t}\n+}\n+\n+// ...or create a private class inside the file.\n+private class myPrivateClass {\n+}\n+```\n+\n+The following list should be the standard struct/class organization of all your Swift files, in this specific order:\n+\n+Before the class declaration:\n+\n+* Enums (as private)\n+* Static variables\n+\n+Inside the class:\n+\n+* Init/Deinit\n+* Override functions (including view lifecycle functions for a view controller)\n+* Public properties","path":"README.md","position":31,"original_position":31,"commit_id":"d2bc7cd9f7dec965d5e2f37d5f357b684ebb5135","original_commit_id":"d2bc7cd9f7dec965d5e2f37d5f357b684ebb5135","user":{"login":"Haud","id":2160066,"avatar_url":"https://avatars.githubusercontent.com/u/2160066?v=3","gravatar_id":"","url":"https://api.github.com/users/Haud","html_url":"https://github.com/Haud","followers_url":"https://api.github.com/users/Haud/followers","following_url":"https://api.github.com/users/Haud/following{/other_user}","gists_url":"https://api.github.com/users/Haud/gists{/gist_id}","starred_url":"https://api.github.com/users/Haud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Haud/subscriptions","organizations_url":"https://api.github.com/users/Haud/orgs","repos_url":"https://api.github.com/users/Haud/repos","events_url":"https://api.github.com/users/Haud/events{/privacy}","received_events_url":"https://api.github.com/users/Haud/received_events","type":"User","site_admin":false},"body":"Move properties above Init/Deinit","created_at":"2016-01-07T17:23:11Z","updated_at":"2016-01-07T17:23:11Z","html_url":"https://github.com/prolificinteractive/swift-style-guide/pull/11#discussion_r49099184","pull_request_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/prolificinteractive/swift-style-guide/pulls/comments/49099184"},"html":{"href":"https://github.com/prolificinteractive/swift-style-guide/pull/11#discussion_r49099184"},"pull_request":{"href":"https://api.github.com/repos/prolificinteractive/swift-style-guide/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/pulls/11","id":55228342,"html_url":"https://github.com/prolificinteractive/swift-style-guide/pull/11","diff_url":"https://github.com/prolificinteractive/swift-style-guide/pull/11.diff","patch_url":"https://github.com/prolificinteractive/swift-style-guide/pull/11.patch","issue_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/issues/11","number":11,"state":"open","locked":false,"title":"[wip] File structure","user":{"login":"Haud","id":2160066,"avatar_url":"https://avatars.githubusercontent.com/u/2160066?v=3","gravatar_id":"","url":"https://api.github.com/users/Haud","html_url":"https://github.com/Haud","followers_url":"https://api.github.com/users/Haud/followers","following_url":"https://api.github.com/users/Haud/following{/other_user}","gists_url":"https://api.github.com/users/Haud/gists{/gist_id}","starred_url":"https://api.github.com/users/Haud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Haud/subscriptions","organizations_url":"https://api.github.com/users/Haud/orgs","repos_url":"https://api.github.com/users/Haud/repos","events_url":"https://api.github.com/users/Haud/events{/privacy}","received_events_url":"https://api.github.com/users/Haud/received_events","type":"User","site_admin":false},"body":"Owned by @ThibaultKlein and @paulmiard I'm just being a jerk and making it a PR so I can comment on it :)","created_at":"2016-01-06T15:57:21Z","updated_at":"2016-01-07T17:23:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1436239b9b1fe69da54b6b212ff3cacb26ba1ba5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/pulls/11/commits","review_comments_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/pulls/11/comments","review_comment_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/issues/11/comments","statuses_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/statuses/d2bc7cd9f7dec965d5e2f37d5f357b684ebb5135","head":{"label":"prolificinteractive:file_structure","ref":"file_structure","sha":"d2bc7cd9f7dec965d5e2f37d5f357b684ebb5135","user":{"login":"prolificinteractive","id":1280427,"avatar_url":"https://avatars.githubusercontent.com/u/1280427?v=3","gravatar_id":"","url":"https://api.github.com/users/prolificinteractive","html_url":"https://github.com/prolificinteractive","followers_url":"https://api.github.com/users/prolificinteractive/followers","following_url":"https://api.github.com/users/prolificinteractive/following{/other_user}","gists_url":"https://api.github.com/users/prolificinteractive/gists{/gist_id}","starred_url":"https://api.github.com/users/prolificinteractive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prolificinteractive/subscriptions","organizations_url":"https://api.github.com/users/prolificinteractive/orgs","repos_url":"https://api.github.com/users/prolificinteractive/repos","events_url":"https://api.github.com/users/prolificinteractive/events{/privacy}","received_events_url":"https://api.github.com/users/prolificinteractive/received_events","type":"Organization","site_admin":false},"repo":{"id":44618802,"name":"swift-style-guide","full_name":"prolificinteractive/swift-style-guide","owner":{"login":"prolificinteractive","id":1280427,"avatar_url":"https://avatars.githubusercontent.com/u/1280427?v=3","gravatar_id":"","url":"https://api.github.com/users/prolificinteractive","html_url":"https://github.com/prolificinteractive","followers_url":"https://api.github.com/users/prolificinteractive/followers","following_url":"https://api.github.com/users/prolificinteractive/following{/other_user}","gists_url":"https://api.github.com/users/prolificinteractive/gists{/gist_id}","starred_url":"https://api.github.com/users/prolificinteractive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prolificinteractive/subscriptions","organizations_url":"https://api.github.com/users/prolificinteractive/orgs","repos_url":"https://api.github.com/users/prolificinteractive/repos","events_url":"https://api.github.com/users/prolificinteractive/events{/privacy}","received_events_url":"https://api.github.com/users/prolificinteractive/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prolificinteractive/swift-style-guide","description":"The style guide for Prolific Interactive's Swift codebase.","fork":false,"url":"https://api.github.com/repos/prolificinteractive/swift-style-guide","forks_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/forks","keys_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/teams","hooks_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/hooks","issue_events_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/issues/events{/number}","events_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/events","assignees_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/assignees{/user}","branches_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/branches{/branch}","tags_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/tags","blobs_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/git/refs{/sha}","trees_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/statuses/{sha}","languages_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/languages","stargazers_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/stargazers","contributors_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/contributors","subscribers_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/subscribers","subscription_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/subscription","commits_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/commits{/sha}","git_commits_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/git/commits{/sha}","comments_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/comments{/number}","issue_comment_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/issues/comments{/number}","contents_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/contents/{+path}","compare_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/merges","archive_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/downloads","issues_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/issues{/number}","pulls_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/pulls{/number}","milestones_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/milestones{/number}","notifications_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/labels{/name}","releases_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/releases{/id}","created_at":"2015-10-20T16:15:00Z","updated_at":"2015-12-24T21:24:47Z","pushed_at":"2016-01-07T17:12:51Z","git_url":"git://github.com/prolificinteractive/swift-style-guide.git","ssh_url":"git@github.com:prolificinteractive/swift-style-guide.git","clone_url":"https://github.com/prolificinteractive/swift-style-guide.git","svn_url":"https://github.com/prolificinteractive/swift-style-guide","homepage":null,"size":17,"stargazers_count":4,"watchers_count":4,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":4,"default_branch":"master"}},"base":{"label":"prolificinteractive:master","ref":"master","sha":"8bd3541be4cb39c6602cf530bf43807cc05b3d8c","user":{"login":"prolificinteractive","id":1280427,"avatar_url":"https://avatars.githubusercontent.com/u/1280427?v=3","gravatar_id":"","url":"https://api.github.com/users/prolificinteractive","html_url":"https://github.com/prolificinteractive","followers_url":"https://api.github.com/users/prolificinteractive/followers","following_url":"https://api.github.com/users/prolificinteractive/following{/other_user}","gists_url":"https://api.github.com/users/prolificinteractive/gists{/gist_id}","starred_url":"https://api.github.com/users/prolificinteractive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prolificinteractive/subscriptions","organizations_url":"https://api.github.com/users/prolificinteractive/orgs","repos_url":"https://api.github.com/users/prolificinteractive/repos","events_url":"https://api.github.com/users/prolificinteractive/events{/privacy}","received_events_url":"https://api.github.com/users/prolificinteractive/received_events","type":"Organization","site_admin":false},"repo":{"id":44618802,"name":"swift-style-guide","full_name":"prolificinteractive/swift-style-guide","owner":{"login":"prolificinteractive","id":1280427,"avatar_url":"https://avatars.githubusercontent.com/u/1280427?v=3","gravatar_id":"","url":"https://api.github.com/users/prolificinteractive","html_url":"https://github.com/prolificinteractive","followers_url":"https://api.github.com/users/prolificinteractive/followers","following_url":"https://api.github.com/users/prolificinteractive/following{/other_user}","gists_url":"https://api.github.com/users/prolificinteractive/gists{/gist_id}","starred_url":"https://api.github.com/users/prolificinteractive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prolificinteractive/subscriptions","organizations_url":"https://api.github.com/users/prolificinteractive/orgs","repos_url":"https://api.github.com/users/prolificinteractive/repos","events_url":"https://api.github.com/users/prolificinteractive/events{/privacy}","received_events_url":"https://api.github.com/users/prolificinteractive/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prolificinteractive/swift-style-guide","description":"The style guide for Prolific Interactive's Swift codebase.","fork":false,"url":"https://api.github.com/repos/prolificinteractive/swift-style-guide","forks_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/forks","keys_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/teams","hooks_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/hooks","issue_events_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/issues/events{/number}","events_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/events","assignees_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/assignees{/user}","branches_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/branches{/branch}","tags_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/tags","blobs_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/git/refs{/sha}","trees_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/statuses/{sha}","languages_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/languages","stargazers_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/stargazers","contributors_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/contributors","subscribers_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/subscribers","subscription_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/subscription","commits_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/commits{/sha}","git_commits_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/git/commits{/sha}","comments_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/comments{/number}","issue_comment_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/issues/comments{/number}","contents_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/contents/{+path}","compare_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/merges","archive_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/downloads","issues_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/issues{/number}","pulls_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/pulls{/number}","milestones_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/milestones{/number}","notifications_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/labels{/name}","releases_url":"https://api.github.com/repos/prolificinteractive/swift-style-guide/releases{/id}","created_at":"2015-10-20T16:15:00Z","updated_at":"2015-12-24T21:24:47Z","pushed_at":"2016-01-07T17:12:51Z","git_url":"git://github.com/prolificinteractive/swift-style-guide.git","ssh_url":"git@github.com:prolificinteractive/swift-style-guide.git","clone_url":"https://github.com/prolificinteractive/swift-style-guide.git","svn_url":"https://github.com/prolificinteractive/swift-style-guide","homepage":null,"size":17,"stargazers_count":4,"watchers_count":4,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prolificinteractive/swift-style-guide/pulls/11"},"html":{"href":"https://github.com/prolificinteractive/swift-style-guide/pull/11"},"issue":{"href":"https://api.github.com/repos/prolificinteractive/swift-style-guide/issues/11"},"comments":{"href":"https://api.github.com/repos/prolificinteractive/swift-style-guide/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/prolificinteractive/swift-style-guide/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/prolificinteractive/swift-style-guide/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prolificinteractive/swift-style-guide/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/prolificinteractive/swift-style-guide/statuses/d2bc7cd9f7dec965d5e2f37d5f357b684ebb5135"}}}}