jazzy 0.0.4 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -2
  3. data/.gitmodules +3 -0
  4. data/.rubocop.yml +67 -0
  5. data/.rubocop_todo.yml +16 -0
  6. data/.travis.yml +6 -0
  7. data/Gemfile +15 -7
  8. data/Gemfile.lock +62 -12
  9. data/LICENSE +0 -0
  10. data/README.md +39 -12
  11. data/Rakefile +87 -1
  12. data/bin/jazzy +10 -44
  13. data/bin/sourcekitten +0 -0
  14. data/jazzy.gemspec +16 -16
  15. data/lib/jazzy.rb +1 -159
  16. data/lib/jazzy/assets/css/jazzy.css +561 -0
  17. data/lib/{assets/Images/carat_2x.png → jazzy/assets/img/carat.png} +0 -0
  18. data/lib/jazzy/assets/img/dash.png +0 -0
  19. data/lib/jazzy/assets/img/gh.png +0 -0
  20. data/lib/jazzy/assets/js/jazzy.js +15 -0
  21. data/lib/jazzy/assets/js/jquery.min.js +4 -0
  22. data/lib/jazzy/config.rb +100 -0
  23. data/lib/jazzy/doc.mustache +46 -0
  24. data/lib/jazzy/doc.rb +23 -0
  25. data/lib/jazzy/doc_builder.rb +166 -0
  26. data/lib/jazzy/gem_version.rb +3 -0
  27. data/lib/jazzy/jazzy_markdown.rb +13 -0
  28. data/lib/jazzy/partials/footer.mustache +4 -0
  29. data/lib/jazzy/partials/nav.mustache +16 -0
  30. data/lib/jazzy/partials/parameter.mustache +12 -0
  31. data/lib/jazzy/partials/task.mustache +66 -0
  32. data/lib/jazzy/partials/tasks.mustache +7 -0
  33. data/lib/jazzy/source_declaration.rb +19 -0
  34. data/lib/jazzy/sourcekitten.rb +146 -0
  35. data/lib/jazzy/xml_helper.rb +15 -0
  36. data/screenshot.jpg +0 -0
  37. data/spec/.gitkeep +0 -0
  38. data/spec/integration_spec.rb +89 -0
  39. data/spec/integration_specs/document_alamofire/after/docs/Classes.html +266 -0
  40. data/spec/integration_specs/document_alamofire/after/docs/Classes/Manager.html +677 -0
  41. data/spec/integration_specs/document_alamofire/after/docs/Classes/Manager/SessionDelegate.html +866 -0
  42. data/spec/integration_specs/document_alamofire/after/docs/Classes/Manager/Singleton.html +246 -0
  43. data/spec/integration_specs/document_alamofire/after/docs/Classes/Request.html +1376 -0
  44. data/spec/integration_specs/document_alamofire/after/docs/Classes/Request/DataTaskDelegate.html +486 -0
  45. data/spec/integration_specs/document_alamofire/after/docs/Classes/Request/TaskDelegate.html +506 -0
  46. data/spec/integration_specs/document_alamofire/after/docs/Enums.html +266 -0
  47. data/spec/integration_specs/document_alamofire/after/docs/Enums/ParameterEncoding.html +391 -0
  48. data/spec/integration_specs/document_alamofire/after/docs/Extensions.html +641 -0
  49. data/spec/integration_specs/document_alamofire/after/docs/Extensions/Manager.html +376 -0
  50. data/spec/integration_specs/document_alamofire/after/docs/Extensions/NSURL.html +226 -0
  51. data/spec/integration_specs/document_alamofire/after/docs/Extensions/NSURLComponents.html +226 -0
  52. data/spec/integration_specs/document_alamofire/after/docs/Extensions/NSURLRequest.html +226 -0
  53. data/spec/integration_specs/document_alamofire/after/docs/Extensions/Request.html +377 -0
  54. data/spec/integration_specs/document_alamofire/after/docs/Extensions/Request/DownloadTaskDelegate.html +406 -0
  55. data/spec/integration_specs/document_alamofire/after/docs/Extensions/Request/MIMEType.html +286 -0
  56. data/spec/integration_specs/document_alamofire/after/docs/Extensions/Request/UploadTaskDelegate.html +266 -0
  57. data/spec/integration_specs/document_alamofire/after/docs/Extensions/String.html +226 -0
  58. data/spec/integration_specs/document_alamofire/after/docs/Functions.html +1001 -0
  59. data/spec/integration_specs/document_alamofire/after/docs/Global Variables.html +236 -0
  60. data/spec/integration_specs/document_alamofire/after/docs/Protocols.html +266 -0
  61. data/spec/integration_specs/document_alamofire/after/docs/Protocols/URLRequestConvertible.html +236 -0
  62. data/spec/integration_specs/document_alamofire/after/docs/Protocols/URLStringConvertible.html +236 -0
  63. data/spec/integration_specs/document_alamofire/after/docs/Typealiases.html +266 -0
  64. data/spec/integration_specs/document_alamofire/after/docs/css/jazzy.css +561 -0
  65. data/spec/integration_specs/document_alamofire/after/docs/img/carat.png +0 -0
  66. data/spec/integration_specs/document_alamofire/after/docs/img/dash.png +0 -0
  67. data/spec/integration_specs/document_alamofire/after/docs/img/gh.png +0 -0
  68. data/spec/integration_specs/document_alamofire/after/docs/index.html +194 -0
  69. data/spec/integration_specs/document_alamofire/after/docs/js/jazzy.js +15 -0
  70. data/spec/integration_specs/document_alamofire/after/docs/js/jquery.min.js +4 -0
  71. data/spec/integration_specs/document_alamofire/after/execution_output.txt +2 -0
  72. data/spec/integration_specs/misc_jazzy_features/after/docs/Classes.html +317 -0
  73. data/spec/integration_specs/misc_jazzy_features/after/docs/Classes/ImplicitlyInternalTopLevelClass.html +138 -0
  74. data/spec/integration_specs/misc_jazzy_features/after/docs/Enums.html +155 -0
  75. data/spec/integration_specs/misc_jazzy_features/after/docs/Enums/DocumentedEnum.html +128 -0
  76. data/spec/integration_specs/misc_jazzy_features/after/docs/Global Variables.html +138 -0
  77. data/spec/integration_specs/misc_jazzy_features/after/docs/css/jazzy.css +561 -0
  78. data/spec/integration_specs/misc_jazzy_features/after/docs/img/carat.png +0 -0
  79. data/spec/integration_specs/misc_jazzy_features/after/docs/img/dash.png +0 -0
  80. data/spec/integration_specs/misc_jazzy_features/after/docs/img/gh.png +0 -0
  81. data/spec/integration_specs/misc_jazzy_features/after/docs/index.html +99 -0
  82. data/spec/integration_specs/misc_jazzy_features/after/docs/js/jazzy.js +15 -0
  83. data/spec/integration_specs/misc_jazzy_features/after/docs/js/jquery.min.js +4 -0
  84. data/spec/integration_specs/misc_jazzy_features/after/execution_output.txt +2 -0
  85. data/spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures.xcodeproj/project.pbxproj +293 -0
  86. data/{parser/ASTDump.xcodeproj → spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures.xcodeproj}/project.xcworkspace/contents.xcworkspacedata +1 -1
  87. data/spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures/Classes.swift +60 -0
  88. data/spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures/Info.plist +28 -0
  89. data/spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures/MiscJazzyFeatures.h +10 -0
  90. data/spec/integration_specs/misc_jazzy_features/before/docs/Classes.html +317 -0
  91. data/spec/integration_specs/misc_jazzy_features/before/docs/Classes/ImplicitlyInternalTopLevelClass.html +138 -0
  92. data/spec/integration_specs/misc_jazzy_features/before/docs/Enums.html +155 -0
  93. data/spec/integration_specs/misc_jazzy_features/before/docs/Enums/DocumentedEnum.html +128 -0
  94. data/spec/integration_specs/misc_jazzy_features/before/docs/Global Variables.html +138 -0
  95. data/spec/integration_specs/misc_jazzy_features/before/docs/css/jazzy.css +561 -0
  96. data/spec/integration_specs/misc_jazzy_features/before/docs/img/carat.png +0 -0
  97. data/spec/integration_specs/misc_jazzy_features/before/docs/img/dash.png +0 -0
  98. data/spec/integration_specs/misc_jazzy_features/before/docs/img/gh.png +0 -0
  99. data/spec/integration_specs/misc_jazzy_features/before/docs/index.html +99 -0
  100. data/spec/integration_specs/misc_jazzy_features/before/docs/js/jazzy.js +15 -0
  101. data/spec/integration_specs/misc_jazzy_features/before/docs/js/jquery.min.js +4 -0
  102. metadata +112 -76
  103. data/DEV_README.md +0 -35
  104. data/bin/ASTDump +0 -0
  105. data/bin/generate_swift_header.sh +0 -14
  106. data/lib/assets/CSS/style-1.1.15.css +0 -3366
  107. data/lib/assets/Images/apple2.png +0 -0
  108. data/lib/assets/Images/check.png +0 -0
  109. data/lib/assets/Images/class_node_parent_and_child_2x.png +0 -0
  110. data/lib/assets/Images/class_node_subclass_last_child_2x.png +0 -0
  111. data/lib/assets/Images/class_node_subclass_with_siblings_2x.png +0 -0
  112. data/lib/assets/Images/closebox_2x.png +0 -0
  113. data/lib/assets/Images/collection_last_child_2x.png +0 -0
  114. data/lib/assets/Images/collection_last_child_orphan_grandparent_2x.png +0 -0
  115. data/lib/assets/Images/collection_last_child_orphan_parent_2x.png +0 -0
  116. data/lib/assets/Images/collection_last_child_orphan_parent_and_grandparent_2x.png +0 -0
  117. data/lib/assets/Images/collection_node_2x.png +0 -0
  118. data/lib/assets/Images/collection_node_orphan_grandparent_2x.png +0 -0
  119. data/lib/assets/Images/collection_node_orphan_parent_2x.png +0 -0
  120. data/lib/assets/Images/collection_node_orphan_parent_and_grandparent_2x.png +0 -0
  121. data/lib/assets/Images/collection_node_parent_2x.png +0 -0
  122. data/lib/assets/Images/collection_node_parent_last_child_orphan_parent_2x.png +0 -0
  123. data/lib/assets/Images/collection_node_parent_orphan_parent_2x.png +0 -0
  124. data/lib/assets/Images/collection_parent_last_child_2x.png +0 -0
  125. data/lib/assets/Images/download_2x.png +0 -0
  126. data/lib/assets/Images/left_arrow_2x.png +0 -0
  127. data/lib/assets/Images/magnify_2x.png +0 -0
  128. data/lib/assets/Images/minus_2x.png +0 -0
  129. data/lib/assets/Images/playbutton.svg +0 -15
  130. data/lib/assets/Images/plus_2x.png +0 -0
  131. data/lib/assets/Images/right_arrow_2x.png +0 -0
  132. data/lib/assets/Images/search_2x.png +0 -0
  133. data/lib/assets/Images/shortstack_2x.png +0 -0
  134. data/lib/assets/JavaScript/devpubs-1.1.15.js +0 -1293
  135. data/lib/jazzy/jazzhtml.rb +0 -7
  136. data/lib/jazzy/klass.mustache +0 -150
  137. data/lib/jazzy/klass.rb +0 -23
  138. data/lib/jazzy/partials/klass-method.mustache +0 -70
  139. data/lib/jazzy/partials/klass-overview.mustache +0 -6
  140. data/lib/jazzy/partials/klass-property.mustache +0 -41
  141. data/parser/ASTDump.xcodeproj/project.pbxproj +0 -301
  142. data/parser/ASTDump.xcodeproj/project.xcworkspace/xcshareddata/ASTDump.xccheckout +0 -41
  143. data/parser/ASTDump.xcodeproj/project.xcworkspace/xcuserdata/ta.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  144. data/parser/ASTDump.xcodeproj/xcuserdata/ta.xcuserdatad/xcschemes/ASTDump.xcscheme +0 -86
  145. data/parser/ASTDump.xcodeproj/xcuserdata/ta.xcuserdatad/xcschemes/xcschememanagement.plist +0 -22
  146. data/parser/ASTDump/main.cpp +0 -71
  147. data/parser/clang-c/BuildSystem.h +0 -148
  148. data/parser/clang-c/CXCompilationDatabase.h +0 -170
  149. data/parser/clang-c/CXErrorCode.h +0 -64
  150. data/parser/clang-c/CXString.h +0 -61
  151. data/parser/clang-c/Documentation.h +0 -554
  152. data/parser/clang-c/Index.h +0 -5454
  153. data/parser/clang-c/Platform.h +0 -45
  154. data/sample/JAZMusician.h +0 -38
  155. data/sample/JAZMusician.m +0 -19
  156. data/sample/Musician.swift +0 -37
Binary file
Binary file
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
- <svg version="1.1" id="phone" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
- width="31px" height="31px" viewBox="0 0 31 31" enable-background="new 0 0 31 31" xml:space="preserve">
6
- <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="0" y1="15.5005" x2="31" y2="15.5005">
7
- <stop offset="0" style="stop-color:#007BB5"/>
8
- <stop offset="1" style="stop-color:#57C7FF"/>
9
- </linearGradient>
10
- <circle opacity="0.65" fill="url(#SVGID_1_)" cx="15.5" cy="15.5" r="15.5"/>
11
- <path fill="#FFFFFF" d="M15.5,29.651c-7.802,0-14.15-6.349-14.15-14.151c0-7.802,6.348-14.15,14.15-14.15S29.65,7.698,29.65,15.5
12
- C29.65,23.303,23.302,29.651,15.5,29.651z M15.5,2.65C8.415,2.65,2.65,8.415,2.65,15.5c0,7.086,5.765,12.851,12.85,12.851
13
- S28.35,22.586,28.35,15.5C28.35,8.415,22.585,2.65,15.5,2.65z"/>
14
- <polygon fill="#FFFFFF" points="12,8 12,22 23,15 "/>
15
- </svg>
@@ -1,1293 +0,0 @@
1
- function h(a) {
2
- return document.querySelector(a)
3
- }
4
- function m(a) {
5
- return document.querySelectorAll(a)
6
- }
7
- HTMLElement.prototype.c = HTMLElement.prototype.querySelector;
8
- HTMLElement.prototype.l = HTMLElement.prototype.querySelectorAll;
9
- HTMLElement.prototype.index = function () {
10
- return Array.prototype.indexOf.call(this.parentNode.childNodes, this)
11
- };
12
- window.requestAnimationFrame || (window.requestAnimationFrame = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || function (a) {
13
- setTimeout(a, 1E3 / 60)
14
- });
15
- window.cancelAnimationFrame || (window.cancelAnimationFrame = window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || function (a) {
16
- clearTimeout(a)
17
- });
18
- window.matchesSelector || (HTMLElement.prototype.matchesSelector = HTMLElement.prototype.webkitMatchesSelector || HTMLElement.prototype.mozMatchesSelector || HTMLElement.prototype.Ba);
19
- window.la = function () {
20
- var a = document.body.style;
21
- return "webkitTransition" in a ? "webkitTransitionEnd" : "mozTransition" in a ? "transitionend" : "oTransition" in a ? "otransitionend" : "transitionend"
22
- };
23
-
24
- function n(a, b) {
25
- for (var c = a.parentNode; c !== document;) {
26
- if (c.matchesSelector(b)) return c;
27
- c = c.parentNode
28
- }
29
- return null
30
- }
31
- NodeList.prototype.forEach = Array.prototype.forEach;
32
- Array.prototype.contains = function (a) {
33
- for (var b = this.length; b--;) if (this[b] === a) return !0;
34
- return !1
35
- };
36
- Array.prototype.H = function () {
37
- return 0 < this.length ? this[this.length - 1] : this[0]
38
- };
39
- NodeList.prototype.H = Array.prototype.H;
40
- Array.prototype.remove = function (a) {
41
- Array.isArray(a) || (a = [a]);
42
- for (var b = a.length - 1; 0 <= b; b--) for (var c = this.length - 1; 0 <= c; c--) this[c] === a[b] && this.splice(c, 1);
43
- return this
44
- };
45
-
46
- function p(a, b) {
47
- var c = this;
48
- a.split(" ").forEach(function (a) {
49
- c.addEventListener(a, b)
50
- })
51
- }
52
- window.d = p;
53
- document.d = p;
54
- HTMLElement.prototype.d = p;
55
-
56
- function u() {
57
- this.search = this.m = this.n = this.u = void 0
58
- }
59
- u.prototype = {
60
- g: function () {
61
- this.m = document.getElementsByClassName("book-parts")[0];
62
- this.n = document.getElementById("shortstack");
63
- this.u = document.getElementsByTagName("article")[0];
64
- this.search = document.getElementById("search");
65
- this.o();
66
- window.addEventListener("orientationchange", this.ua, !0)
67
- },
68
- M: function () {
69
- var a = document.querySelectorAll("figure > img"),
70
- b = document.getElementsByClassName("inline-graphic");
71
- Array.prototype.forEach.call(a, function (a) {
72
- a.removeAttribute("height");
73
- a.removeAttribute("width")
74
- });
75
- Array.prototype.forEach.call(b, function (a) {
76
- a.removeAttribute("height");
77
- a.removeAttribute("width")
78
- })
79
- },
80
- o: function () {
81
- ipad.n.addEventListener("click", ipad.U);
82
- ipad.u.addEventListener("click", ipad.v);
83
- ipad.search.addEventListener("click", ipad.T)
84
- },
85
- T: function (a) {
86
- "FORM" === a.target.nodeName && (document.getElementById("ssi_SearchField").classList.toggle("enabled"), ipad.search.classList.toggle("enabled"))
87
- },
88
- v: function () {
89
- ipad.m.classList.remove("open");
90
- ipad.n.classList.remove("enabled")
91
- },
92
- U: function () {
93
- ipad.m.classList.toggle("open");
94
- ipad.n.classList.toggle("enabled")
95
- },
96
- ua: function () {
97
- 90 === Math.abs(window.orientation) && ipad.m.classList.contains("open") && ipad.m.classList.remove("open")
98
- }
99
- };
100
- document.addEventListener("DOMContentLoaded", function () {
101
- /(iPad).*AppleWebKit/i.test(navigator.userAgent) ? (ipad = new u, ipad.g()) : ipad = void 0
102
- });
103
-
104
- function v() {
105
- this.search = this.A = this.m = this.n = this.u = void 0
106
- }
107
- v.prototype = {
108
- g: function () {
109
- this.m = document.getElementsByClassName("book-parts")[0];
110
- this.n = document.getElementById("shortstack");
111
- this.u = document.getElementsByTagName("article")[0];
112
- this.A = document.getElementById("big_button");
113
- this.search = document.getElementById("search");
114
- this.o();
115
- this.M()
116
- },
117
- M: function () {
118
- var a = document.querySelectorAll("figure > img");
119
- Array.prototype.forEach.call(a, function (a) {
120
- a.removeAttribute("height");
121
- a.removeAttribute("width")
122
- });
123
- Array.prototype.forEach.call(document.getElementsByClassName("inline-graphic"),
124
-
125
- function (a) {
126
- a.removeAttribute("height");
127
- a.removeAttribute("width")
128
- })
129
- },
130
- o: function () {
131
- iphone.n.addEventListener("click", iphone.U);
132
- iphone.u.addEventListener("click", iphone.v);
133
- iphone.A.addEventListener("click", iphone.v);
134
- iphone.search.addEventListener("click", iphone.T)
135
- },
136
- T: function (a) {
137
- "FORM" === a.target.nodeName && (document.getElementById("ssi_SearchField").classList.toggle("enabled"), iphone.search.classList.toggle("enabled"))
138
- },
139
- v: function () {
140
- iphone.m.classList.remove("open");
141
- iphone.A.classList.remove("active");
142
- iphone.n.classList.remove("enabled");
143
- document.querySelector(".chapter").classList.remove("frozen")
144
- },
145
- U: function () {
146
- iphone.m.classList.toggle("open");
147
- iphone.A.classList.add("active");
148
- iphone.n.classList.toggle("enabled");
149
- document.querySelector(".chapter").classList.toggle("frozen")
150
- }
151
- };
152
- document.addEventListener("DOMContentLoaded", function () {
153
- /(iP(hone|opd)).*AppleWebKit/i.test(navigator.userAgent) ? (iphone = new v, iphone.g()) : iphone = void 0
154
- });
155
-
156
- function History() {
157
- this.Z = null;
158
- this.Y = !0;
159
- this.$ = this.j = this.k = null
160
- }
161
- History.prototype = {
162
- g: function () {
163
- var a = document.getElementsByClassName("book-parts");
164
- 0 < a.length && w(this, a[0].getElementsByTagName("a"));
165
- a = document.getElementById("next_previous");
166
- null !== a && (a = a.querySelectorAll('a:not([rel="external"])'), w(this, a));
167
- this.Z = document.getElementsByTagName("article")[0].innerHTML;
168
- this.$ = document.getElementsByTagName("title")[0].innerHTML
169
- },
170
- ca: function () {
171
- var a = null,
172
- b = document.querySelectorAll(".svg-container");
173
- Array.prototype.forEach.call(b, function (b) {
174
- b = b.querySelector(".svg-animation");
175
- var e = new aa(b);
176
- e.g();
177
- b.contentDocument.querySelector("svg").addEventListener("click", function () {
178
- a && e !== a && a.ba() && a.stop();
179
- e.ba() || (e.start(), a = e)
180
- })
181
- });
182
- void 0 !== iphone && iphone.M();
183
- Array.prototype.forEach.call(document.getElementsByTagName("video"), function (a) {
184
- new x(a)
185
- })
186
- },
187
- pa: function (a) {
188
- if (!a.metaKey && !a.ctrlKey) {
189
- a.preventDefault();
190
- var b = window.location.origin + window.location.pathname,
191
- c = a.target.origin + a.target.pathname;
192
- a.target.href === window.location.href ? (b = a.target.hash, "" === b && (b = "#" + a.target.getAttribute("data-id")),
193
- b = document.getElementsByName(b.substring(1, b.length)), b[0].scrollIntoView()) : c === b ? ("" !== a.target.hash ? b = document.getElementsByName(a.target.hash.substring(1, a.target.hash.length)) : (b = "#" + a.target.getAttribute("data-id"), b = document.getElementsByName(b.substring(1, b.length))), b[0].scrollIntoView()) : (b = "#" + a.target.getAttribute("data-id"), y(historian, a.target, b));
194
- b = a.target;
195
- a = document.querySelector('a[data-id="' + a.target.getAttribute("data-id") + '"]');
196
- z(a, b)
197
- }
198
- },
199
- ya: function () {},
200
- wa: function () {},
201
- xa: function () {},
202
- va: function () {}
203
- };
204
-
205
- function A(a, b, c) {
206
- null !== b ? a.innerHTML = b.getElementsByTagName("title")[0].innerHTML : void 0 !== c && (a.innerHTML = c)
207
- }
208
- function B(a, b) {
209
- var c = document.getElementsByTagName("article")[0];
210
- c.innerHTML = b;
211
- var e = document.getElementById("next_previous").querySelectorAll('a:not([rel="external"])');
212
- w(a, e);
213
- var f = [];
214
- Array.prototype.forEach.call(c.getElementsByClassName("x-name"), function (a) {
215
- f.push(a.firstChild)
216
- });
217
- w(a, f);
218
- void 0 !== mini_toc && C(mini_toc);
219
- window.setTimeout(historian.ca, 2E3)
220
- }
221
-
222
- function y(a, b, c) {
223
- var e = new XMLHttpRequest;
224
- e.addEventListener("progress", a.ya, !1);
225
- e.addEventListener("load", a.wa, !1);
226
- e.addEventListener("error", a.xa, !1);
227
- e.addEventListener("abort", a.va, !1);
228
- e.onreadystatechange = function () {
229
- if (4 === e.readyState) {
230
- var f = e.responseText,
231
- g = document.createElement("div");
232
- g.innerHTML = f;
233
- B(a, g.getElementsByTagName("article")[0].innerHTML);
234
- var f = document.getElementsByTagName("article")[0],
235
- k = document.getElementsByTagName("title")[0];
236
- A(k, g, null);
237
- g = {};
238
- g.K = f.innerHTML;
239
- g.na = historian.k.getAttribute("data-id");
240
- g.za = k.innerHTML;
241
- g.scrollY = window.scrollY;
242
- g.scrollX = window.scrollX;
243
- f = document.getElementById("partless");
244
- k = document.querySelector('a[data-id="' + b.getAttribute("data-id") + '"]');
245
- null !== f && (k = document.querySelector('li[data-id="' + b.getAttribute("data-id") + '"]'));
246
- var r = null,
247
- l = null;
248
- if (null === b.getAttribute("data-id") || void 0 === b.getAttribute("data-id")) historian.j = void 0, nav_parts.close();
249
- null !== k && (r = k.parentNode.parentNode.parentNode, l = k.parentNode.parentNode, null !== f && (r = k, l = k.getElementsByClassName("nav-chapters")[0]));
250
- null === r || -1 < r.className.split(" ").indexOf("nav-part-active") || (nav_parts.close(), nav_parts.open(l), nav_parts.i = l, historian.j = document.getElementsByClassName("nav-part-active")[0]);
251
- g.j = void 0 !== historian.j ? historian.j.getAttribute("data-id") : null;
252
- historian.Y = !1;
253
- history.pushState(g, b.innerHTML, b.href);
254
- g = b.hash.substring(1, b.hash.length);
255
- g = document.getElementsByName(g);
256
- f = document.getElementsByTagName("h2")[0];
257
- f.scrollIntoView(!1);
258
- f.focus();
259
- void 0 !== c && (g = c.substring(1, c.length), g = document.getElementsByName(g));
260
- 0 < g.length && g[0].scrollIntoView();
261
- "undefined" !== typeof PageTracker && (g = {}, document.referrer && (g.referrer = document.referrer), g.identifier = document.getElementById("identifier").content, PageTracker.logEvent("ajaxPageLoad", g))
262
- }
263
- };
264
- e.open("GET", b.href);
265
- e.send()
266
- }
267
- function w(a, b) {
268
- Array.prototype.forEach.call(b, function (b) {
269
- b.addEventListener("click", a.pa)
270
- })
271
- }
272
-
273
- function z(a, b) {
274
- if (historian.k) {
275
- historian.k.classList.remove("nav-chapter-active");
276
- historian.k.parentElement.classList.remove("nav-current-chapter");
277
- var c = b.parentElement.classList.contains("next-link"),
278
- e = b.parentElement.classList.contains("previous-link");
279
- (c || e) && historian.k.parentElement.classList.add("nav-visited-chapter")
280
- }
281
- null !== a && (a.classList.add("nav-chapter-active"), a.parentElement.classList.add("nav-current-chapter"), historian.k = a, historian.j = document.getElementsByClassName("nav-part-active")[0],
282
- D(), E(historian.j.getElementsByTagName("ul")[0]))
283
- }
284
- window.onpopstate = function (a) {
285
- if ("reference" !== document.body.id) {
286
- var b = a.state;
287
- a = document.getElementsByTagName("title")[0];
288
- if (b) null !== b.K && B(historian, b.K), A(a, null, b.title), historian.k && (historian.k.classList.remove("nav-chapter-active"), historian.k.parentElement.classList.remove("nav-current-chapter")), a = document.querySelector('a[data-id="' + b.na + '"]'), a.classList.add("nav-chapter-active"), a.parentElement.classList.add("nav-current-chapter"), historian.k = a, null !== b.j ? part_chapters = document.querySelector('li[data-id="' + b.j + '"]').children[0] : (nav_parts.close(), part_chapters = void 0), void 0 !== part_chapters && (nav_parts.close(), nav_parts.open(part_chapters), nav_parts.i = part_chapters), void 0 !== b.scrollY && null !== b.scrollY && window.setTimeout(function () {
289
- window.scrollTo(b.scrollX, b.scrollY)
290
- }, 100);
291
- else {
292
- if (historian.Y) {
293
- historian.ca();
294
- var c = [];
295
- Array.prototype.forEach.call(document.getElementsByTagName("article")[0].getElementsByClassName("x-name"), function (a) {
296
- c.push(a.firstChild)
297
- });
298
- w(historian, c)
299
- } else B(historian, historian.Z),
300
- A(a, null, historian.$);
301
- nav_parts.close();
302
- (a = document.getElementsByClassName("nav-part-active")[0]) && a.classList.remove("nav-part-active");
303
- if (a = document.getElementsByClassName("nav-chapter-active")[0]) a.classList.remove("nav-chapter-active"), a.parentElement.classList.remove("nav-current-chapter");
304
- F()
305
- }
306
- }
307
- };
308
- window.addEventListener("load", function () {
309
- "reference" !== document.body.id && (historian = new History, historian.g())
310
- });
311
-
312
- function G() {
313
- this.id = "mini_toc";
314
- this.element = void 0;
315
- this.W = 0;
316
- this.w = !1
317
- }
318
- G.prototype = {
319
- g: function () {
320
- C(this);
321
- return this
322
- },
323
- open: function () {
324
- var a = 0;
325
- Array.prototype.forEach.call(this.element.children, function (b) {
326
- a += b.clientHeight
327
- });
328
- this.element.style.height = a + 15 + "px"
329
- },
330
- close: function () {
331
- this.element.style.height = "25px"
332
- },
333
- e: function () {
334
- return -1 < (" " + this.element.className + " ").indexOf("open")
335
- },
336
- toggle: function (a) {
337
- a.preventDefault();
338
- mini_toc.e() ? (mini_toc.close(), mini_toc.element.classList.remove("open")) : (mini_toc.element.classList.add("open"), mini_toc.open())
339
- },
340
- S: function (a) {
341
- a.preventDefault();
342
- var b = document.getElementsByTagName("article")[0];
343
- mini_toc.close();
344
- mini_toc.element.classList.remove("open");
345
- var c = {};
346
- null !== history.state && (c = history.state);
347
- c.K = b.innerHTML;
348
- c.scrollY = window.scrollY;
349
- c.scrollX = window.scrollX;
350
- history.replaceState(c, b.innerHTML, window.location.href);
351
- a = a.target.getAttribute("href");
352
- var e = document.getElementsByName(a.substring(1, a.length))[0].nextSibling.nextSibling;
353
- e.scrollIntoView(!0);
354
- e.focus();
355
- c.scrollY = window.scrollY;
356
- c.scrollX = window.scrollX;
357
- history.pushState(c, b.innerHTML,
358
- a)
359
- },
360
- o: function (a) {
361
- var b = this;
362
- Array.prototype.forEach.call(a.getElementsByTagName("a"), function (a) {
363
- a.addEventListener("click", b.S)
364
- })
365
- }
366
- };
367
-
368
- function ba(a) {
369
- iphone || document.addEventListener("scroll", function () {
370
- if (!a.e()) {
371
- var b = window.pageYOffset;
372
- 0 >= b ? (a.element.classList.remove("slide-out"), a.w = !1) : !a.w && b > a.W ? (a.element.classList.add("slide-out"), a.w = !0) : a.w && b < a.W && (a.element.classList.remove("slide-out"), a.w = !1);
373
- a.W = b
374
- }
375
- })
376
- }
377
-
378
- function C(a) {
379
- var b = document.getElementById(a.id);
380
- b && (a.element = b, a.o(b), document.getElementById("mini_toc_button").addEventListener("click", a.toggle), ba(a))
381
- }
382
- window.addEventListener("load", function () {
383
- mini_toc = new G;
384
- mini_toc.g()
385
- });
386
-
387
- function Navigator() {
388
- this.className = "part-name";
389
- this.i = this.ea = null
390
- }
391
- Navigator.prototype = {
392
- g: function () {
393
- this.ea = document.getElementsByClassName(this.className);
394
- "guidance" !== document.body.getAttribute("id") && this.o();
395
- return this
396
- },
397
- open: function (a) {
398
- a && "UL" === a.nodeName && (a.parentElement.classList.add("nav-part-active"), this.i = a.parentElement, D(), a.parentElement.classList.add("open-part"), "roadmap" !== document.body.id && E(a))
399
- },
400
- close: function () {
401
- this.i && "roadmap" !== document.body.id && (this.i.parentElement.classList.remove("open-part"), this.i.style.height = "0px");
402
- this.i && null !== this.i.parentElement && this.i.parentElement.classList.remove("nav-part-active")
403
- },
404
- S: function (a) {
405
- var b = a.target,
406
- c = void 0;
407
- if ("LI" === b.nodeName) "A" === b.firstChild.nodeName && (c = b.firstChild);
408
- else if ("A" === b.nodeName && !1 === b.parentElement.classList.contains("part-name")) return;
409
- if (void 0 !== c && !0 === b.classList.contains("nav-part-active")) z(c, c);
410
- else {
411
- var e = b.getElementsByTagName("ul")[0];
412
- void 0 !== e && (nav_parts.close(), nav_parts.open(e), nav_parts.i = e, (e = e.children[0].children[0]) && e.hasAttribute("href") && e.href !== window.location.href && (void 0 !== c ? z(c, c) : z(e, a.target), y(historian, e, b.getAttribute("data-id"))), void 0 !== ipad && ipad.v())
413
- }
414
- },
415
- o: function () {
416
- var a = this;
417
- Array.prototype.forEach.call(a.ea, function (b) {
418
- b.addEventListener("click", a.S)
419
- })
420
- }
421
- };
422
-
423
- function F() {
424
- var a = nav_parts,
425
- b = document.getElementsByTagName("article")[0].getElementsByTagName("a")[1].getAttribute("name");
426
- if (b = document.querySelector('a[data-id="' + b + '"]')) {
427
- if (b.href) {
428
- var c = window.location.pathname;
429
- b.href = c.substring(c.lastIndexOf("/") + 1, c.length) + b.hash
430
- }(c = b.parentElement) && "LI" === c.nodeName && (c = c.parentElement, a.open(c), a.i = c, b.classList.add("nav-chapter-active"), b.parentElement.classList.add("nav-current-chapter"), historian.k = b, historian.j = c)
431
- }
432
- }
433
-
434
- function E(a) {
435
- var b = 0;
436
- Array.prototype.forEach.call(a.children, function (a) {
437
- b += a.clientHeight
438
- });
439
- a.style.height = b + 15 + "px"
440
- }
441
- function D() {
442
- var a;
443
- historian.j && (a = historian.j.getElementsByTagName("ul")[0]);
444
- void 0 === a && void 0 !== nav_parts.i && (a = nav_parts.i);
445
- void 0 !== a && "0px" !== a.style.height && "UL" === a.nodeName && (a.style.height = "100%")
446
- }
447
- window.addEventListener("load", function () {
448
- "reference" !== document.body.id && (nav_parts = new Navigator, nav_parts.g(), F())
449
- });
450
-
451
- function H(a) {
452
- this.fa = a;
453
- this.b = h(a);
454
- this.e = !1;
455
- this.a = {
456
- filter: this.b.c(".filter"),
457
- h: this.b.l(".item a"),
458
- matches: this.b.c("#filter_matches")
459
- };
460
- this.ja = [];
461
- this.index = -1;
462
- this.matches = this.a.h.length;
463
- this.b.c(".JavaScript") && document.body.classList.add("js");
464
- ca();
465
- this.a.h.forEach(function (a) {
466
- this.ja.push(a.textContent)
467
- }.bind(this));
468
- this.r()
469
- }
470
- H.prototype = {
471
- r: function () {
472
- I.prototype.r.call(this);
473
- this.a.filter.d("focus", function () {
474
- this.index = -1;
475
- J(this);
476
- h("#bashful").classList.remove("slide-out");
477
- this.open()
478
- }.bind(this));
479
- this.b.c(".details").d("mousewheel", function (a) {
480
- var b = a.wheelDeltaY;
481
- 0 < b && 0 === this.scrollTop ? a.preventDefault() : 0 > b && this.scrollTop === this.scrollHeight - this.clientHeight && a.preventDefault()
482
- });
483
- document.d("keydown", function (a) {
484
- if (this.e) switch (a.keyCode) {
485
- case 27:
486
- "" === this.a.filter.value && this.close();
487
- break;
488
- case 38:
489
- a.preventDefault();
490
- 0 <= this.index && (this.index--, this.focus());
491
- break;
492
- case 40:
493
- a.preventDefault();
494
- this.index < this.matches - 1 && (this.index++, this.focus());
495
- break;
496
- case 13:
497
- a.preventDefault(), this.b.c(".focused") && (a = this.b.c(".focused").getAttribute("href"), K(ref, a), this.close())
498
- }
499
- }.bind(this));
500
- this.filter()
501
- },
502
- filter: function () {
503
- this.a.filter.d("input", function () {
504
- var a = this.a.filter.value.trim().toLowerCase(),
505
- b, c = 0;
506
- this.ja.forEach(function (e) {
507
- if ("" === a) this.a.h[c].textContent = e, this.a.h[c].classList.remove("hidden");
508
- else if (/^\+( )?/.test(a)) {
509
- b = RegExp("^\\+( )?" + a.substring(1), "i");
510
- var f = this.a.h[c],
511
- g = b;
512
- g.test(e) ? L(f, g, e) : f.classList.add("hidden")
513
- } else /^-( )?/.test(a) ? (b = RegExp("^-( )?" + a.substring(1), "i"), f = this.a.h[c], g = b, g.test(e) ? L(f, g, e) : f.classList.add("hidden")) : 0 <= e.toLowerCase().indexOf(a) ? (b = RegExp(a, "gi"), L(this.a.h[c], b, e)) : this.a.h[c].classList.add("hidden");
514
- c++
515
- }.bind(this));
516
- N(this)
517
- }.bind(this))
518
- },
519
- open: function () {
520
- I.prototype.open.call(this);
521
- this.a.filter.focus();
522
- N(this)
523
- },
524
- close: function () {
525
- I.prototype.close.call(this);
526
- this.a.filter.blur();
527
- J(this);
528
- this.index = -1;
529
- J(this)
530
- },
531
- toggle: function () {
532
- I.prototype.toggle.call(this)
533
- },
534
- focus: function () {
535
- J(this);
536
- if (0 > this.index) this.a.filter.focus();
537
- else if (this.index < this.matches) {
538
- this.a.filter.blur();
539
- var a = O(),
540
- a = this.b.l(a + ".item:not(.hidden) a:not(.hidden)")[this.index];
541
- a.classList.add("focused");
542
- a.scrollIntoViewIfNeeded()
543
- }
544
- }
545
- };
546
-
547
- function J(a) {
548
- a.b.c(".focused") && a.b.c(".focused").classList.remove("focused")
549
- }
550
-
551
- function O() {
552
- return document.body.classList.contains("js") ? ".JavaScript " : document.body.classList.contains("swift") ? ".Swift " : document.body.classList.contains("obj_c") || document.body.classList.contains("both") ? ".Objective-C " : ""
553
- }
554
- function N(a) {
555
- var b = O();
556
- a.matches = a.b.l(b + ".item:not(.hidden) a:not(.hidden)").length;
557
- a.a.matches.textContent = "" === a.a.filter.value ? "" : a.matches + " match" + (1 !== a.matches ? "es" : "")
558
- }
559
-
560
- function L(a, b, c) {
561
- a.classList.remove("hidden");
562
- a.innerHTML = c.replace(b, '<span class="highlighted">$&</span>')
563
- }
564
- function ca() {
565
- m("#jump_to a").forEach(function (a) {
566
- var b = h('[name="' + a.getAttribute("href").substring(1) + '"]');
567
- if (b && (b = n(b, ".task-group-term"))) {
568
- var c = n(b, ".symbol");
569
- a.setAttribute("data-availability", c.dataset.availability);
570
- b.classList.contains("deprecated") && n(a, ".item").classList.add("deprecated")
571
- }
572
- })
573
- };
574
-
575
- function I(a) {
576
- this.fa = a;
577
- this.b = h(a);
578
- this.e = !1;
579
- this.r()
580
- }
581
- I.prototype = {
582
- r: function () {
583
- this.b.d("click", function (a) {
584
- n(a.target, ".details") || this.toggle()
585
- }.bind(this));
586
- document.d("click", function (a) {
587
- this.e && a.target !== this.b && !n(a.target, this.fa) && (a.preventDefault(), this.close())
588
- }.bind(this));
589
- this.b.d(window.la(), function () {
590
- this.e || (this.b.classList.remove("closing"), this.b.classList.add("closed"))
591
- }.bind(this))
592
- },
593
- open: function () {
594
- this.e || (this.b.classList.remove("closed"), this.b.classList.add("open"), this.e = !0)
595
- },
596
- close: function () {
597
- this.e && (this.b.classList.remove("open"),
598
- this.b.classList.add("closing"), this.e = !1)
599
- },
600
- toggle: function () {
601
- this.e ? this.close() : this.open()
602
- }
603
- };
604
-
605
- function da(a, b) {
606
- this.R = b;
607
- this.data = {};
608
- this.a = {
609
- L: h(".chapter"),
610
- f: {
611
- language: h("#language"),
612
- deployment_target: h("#deployment_target_" + b),
613
- deprecated: h("#deprecated"),
614
- auto_expand: h("#auto_expand")
615
- },
616
- h: m(".symbol"),
617
- ha: m(".task-group"),
618
- ta: m(".task-group-section"),
619
- Ea: m(".nav-parts .tasks .nav-chapter")
620
- };
621
- this.D = !1;
622
- this.ka = null;
623
- this.J = {
624
- V: -1 < navigator.userAgent.indexOf("Xcode/"),
625
- qa: -1 < navigator.userAgent.indexOf("iPad")
626
- }
627
- }
628
- da.prototype = {
629
- r: function () {
630
- this.J.qa || (ea(this), fa(this), ga(), ha());
631
- ia(this);
632
- ja(this)
633
- }
634
- };
635
-
636
- function ia(a) {
637
- window.d("resize", function () {
638
- ka()
639
- }.bind(a))
640
- }
641
- function ga() {
642
- h("nav.book-parts .tasks").d("mousewheel", function (a) {
643
- var b = a.wheelDeltaY;
644
- this.scrollHeight !== this.clientHeight && (0 < b && 0 === this.scrollTop ? a.preventDefault() : 0 > b && this.scrollTop === this.scrollHeight - this.clientHeight && a.preventDefault())
645
- })
646
- }
647
-
648
- function P(a, b) {
649
- var c = h('[name="' + b.substring(1) + '"]');
650
- if (c) {
651
- var e = n(c, ".symbol"),
652
- f = h("a").title,
653
- g = "";
654
- if (e) Q(a, e, !1), R(a, e).e || S(a, e), c = c.parentNode.l("a[href]"), c[0].getClientRects()[0] ? g = c[0].textContent + " - " : c[1].getClientRects()[0] && (g = c[1].textContent + " - "), document.title = g + f;
655
- else if (e = n(c, ".task-group")) Q(a, e, !1), g = c.parentNode.c(".section-name").textContent, document.title = g + " - " + f
656
- }
657
- }
658
-
659
- function ma() {
660
- var a = ref;
661
- h("a");
662
- var b = window.location.hash;
663
- b && (window.localStorage && "true" === localStorage.getItem("com.apple.devpubs.auto_expand") ? setTimeout(function () {
664
- P(this, b)
665
- }.bind(a), 500) : P(a, b))
666
- }
667
- function na() {
668
- var a = ref,
669
- b = h(".overview-bulk"),
670
- c = h(".overview-bulk-toggle");
671
- b && c.d("click", function () {
672
- b.classList.remove("hidden");
673
- b.classList.remove("squashed");
674
- c.parentNode.removeChild(c);
675
- T(this, b.clientHeight)
676
- }.bind(a))
677
- }
678
-
679
- function ha() {
680
- function a() {
681
- m(".active-task").forEach(function (a) {
682
- a.classList.remove("active-task")
683
- })
684
- }
685
- var b = h(".tasks"),
686
- c = m(".tasks .nav-chapter a"),
687
- e = [];
688
- c.forEach(function (a) {
689
- a = a.getAttribute("href").substring(1);
690
- a = h('a[name="' + a + '"]');
691
- e.push(a)
692
- });
693
- document.d("scroll", function () {
694
- var f = !1;
695
- 0 >= window.pageYOffset ? (a(), b.scrollTop = 0) : window.pageYOffset >= document.height - window.innerHeight ? (a(), c[c.length - 1].classList.add("active-task"), b.scrollTop = 99999) : e.forEach(function (b) {
696
- if (!f) {
697
- var c = b.getClientRects()[0].top;
698
- 25 >= Math.abs(c) && (a(), b = h('.tasks .nav-chapter a[href="#' + b.name + '"]'), b.classList.add("active-task"), 0 < window.pageYOffset && window.pageYOffset < document.height - window.innerHeight && b.scrollIntoViewIfNeeded(), f = !0)
699
- }
700
- })
701
- })
702
- }
703
- function fa(a) {
704
- document.d("keypress", function (a) {
705
- !a.metaKey || 102 !== a.keyCode && 103 !== a.keyCode || this.D || oa(this)
706
- }.bind(a))
707
- }
708
-
709
- function ea(a) {
710
- document.d("keydown", function (a) {
711
- if (!/(textarea|input)/i.test(document.activeElement.nodeName) && !a.metaKey) {
712
- if (68 === a.keyCode) return this.a.f.deprecated.checked = !this.a.f.deprecated.checked, pa(this), !1;
713
- if (65 === a.keyCode) return this.a.f.auto_expand.checked = !this.a.f.auto_expand.checked, qa(this), !1
714
- }
715
- }.bind(a))
716
- }
717
-
718
- function oa(a) {
719
- a.D = !0;
720
- var b = !1;
721
- h(".overview-bulk") && h(".overview-bulk").classList.remove("hidden");
722
- m(".symbol .height-container.hidden").forEach(function (a) {
723
- a.classList.remove("hidden")
724
- });
725
- ra(a);
726
- var c = setInterval(function () {
727
- var a = document.getSelection();
728
- if ("Range" === a.type) {
729
- b = !0;
730
- var f = a.baseNode.parentNode,
731
- g = n(f, ".squashed"),
732
- f = n(f, ".height-container");
733
- g ? h(".overview-bulk-toggle").click() : f && (g = n(f, ".item"), R(this, g).e || S(this, g));
734
- this.ka !== a.baseNode && (setTimeout(function () {
735
- window.scrollTo(0, window.pageYOffset + 1)
736
- }, 700), this.ka = a.baseNode)
737
- } else b && this.D && (clearInterval(c), this.D = !1, m(".symbol:not(.on) .height-container").forEach(function (a) {
738
- a.classList.add("hidden")
739
- }))
740
- }.bind(a), 16)
741
- }
742
- function ra(a) {
743
- var b = a.a.h.H(),
744
- b = sa(a) - U(a, b);
745
- T(a, b);
746
- h(".last-one").style.paddingBottom = b + "px"
747
- }
748
- function sa(a) {
749
- var b = 0;
750
- a.a.h.forEach(function (a) {
751
- a = R(this, a).p + U(this, a);
752
- a > b && (b = a)
753
- }.bind(a));
754
- return b
755
- }
756
-
757
- function ja(a) {
758
- m('#language input[type="radio"]').forEach(function (a) {
759
- a.d("change", function () {
760
- ta(this, a)
761
- }.bind(this))
762
- }.bind(a));
763
- h("#ssi_SearchField").d("focus", function () {
764
- this.Q.close()
765
- }.bind(a));
766
- a.a.f.deployment_target.d("change", function () {
767
- ua(this)
768
- }.bind(a));
769
- a.a.f.deprecated.d("change", function () {
770
- pa(this)
771
- }.bind(a));
772
- a.a.f.auto_expand.d("change", function () {
773
- qa(this)
774
- }.bind(a))
775
- }
776
-
777
- function ta(a, b) {
778
- var c = b.id;
779
- h("#language .selected") && h("#language .selected").classList.remove("selected");
780
- n(b, "#language").c('label[for="' + b.id + '"]').classList.add("selected");
781
- ["swift", "obj_c", "both"].forEach(function (a) {
782
- document.body.classList.remove(a)
783
- });
784
- document.body.classList.add(c);
785
- a.a.h.forEach(function (a) {
786
- var b = R(this, a);
787
- if (b.e) {
788
- var g = b.p;
789
- va(b);
790
- wa(this, a, b.p - g)
791
- } else b.O = !0;
792
- "obj_c" === c && b.G || "swift" === c && b.F ? (V(this, a), W(b)) : (!b.C || b.C && !this.a.f.deprecated.checked) && b.q <= this.a.f.deployment_target.value && b.show()
793
- }.bind(a));
794
- X(a);
795
- Y(a, b)
796
- }
797
-
798
- function xa() {
799
- var a = m(".instance-method .declaration .Swift .para, .class-method .declaration .Swift .para, .function .declaration .Swift .para");
800
- a.forEach(function (a) {
801
- var c = a.textContent.trim().split(/, /);
802
- if (1 !== c.length) {
803
- var e = a.innerHTML.split(/, /),
804
- f = 0;
805
- c.forEach(function (a) {
806
- a = a.split(c[0] !== a || /^init/.test(c[0]) ? " " : "(")[0].length;
807
- a > f && (f = a)
808
- });
809
- var g = 0;
810
- c.forEach(function (a) {
811
- e[g] = Array(f - (/:/.test(a) ? a.split(c[0] !== a || /^init/.test(c[0]) ? " " : "(")[0].length : -10) + 1).join("&nbsp;") + e[g];
812
- g++
813
- });
814
- a.innerHTML = e.join(",<br />")
815
- }
816
- });
817
- a = m(".instance-method .declaration .Objective-C .para, .class-method .declaration .Objective-C .para");
818
- a.forEach(function (a) {
819
- a.l(".parameter-name").forEach(function (a) {
820
- a.innerHTML += "<br />"
821
- });
822
- for (var c = a.l(".nl"), e = 0, e = "", f = 1; f < c.length; f++) e = a.textContent.trim().split(":")[0].length - c[f].textContent.length + 2, 0 < e && (e = Array(e).join("&nbsp;"), c[f].innerHTML = e + c[f].textContent);
823
- a = a.l(".n");
824
- for (f = 0; f < a.length; f++) /,/.test(a[f].textContent) && (e = Array(c[c.length - 1].textContent.length + 10).join("&nbsp;"), a[f].innerHTML = a[f].innerHTML.replace(/,/g, ",<br />" + e))
825
- })
826
- }
827
- function K(a, b, c) {
828
- c && c.metaKey ? (a = window.location, window.open(a.origin + a.pathname + b, "_blank")) : (P(a, b), history.replaceState(null, null, b))
829
- }
830
- function ya() {
831
- var a = ref;
832
- m(".nav-parts .tasks a, .para .x-api, .para .x-class-method, .para a.x-instance-method, #jump_to a").forEach(function (a) {
833
- a.d("click", function (c) {
834
- c.preventDefault();
835
- var e = a.getAttribute("href");
836
- K(this, e, c);
837
- return !1
838
- }.bind(this))
839
- }.bind(a))
840
- }
841
-
842
- function Y(a, b) {
843
- var c, e;
844
- switch (b.type) {
845
- case "radio":
846
- c = "language";
847
- e = b.id;
848
- break;
849
- case "checkbox":
850
- c = b.id;
851
- e = b.checked;
852
- break;
853
- case "select-one":
854
- c = b.id, e = b.value
855
- }
856
- a.J.V || !window.localStorage ? document.cookie = "com.apple.devpubs." + c + "=" + e + ";expires=" + (new Date("April 2, 2999")).toGMTString() + ";path=/" : localStorage.setItem("com.apple.devpubs." + c, e)
857
- }
858
-
859
- function za() {
860
- function a(a, b) {
861
- if (a && b && "false" !== b) {
862
- switch (a.type) {
863
- case void 0:
864
- a = a.c("#" + b);
865
- a.checked = !0;
866
- break;
867
- case "checkbox":
868
- a.checked = !0;
869
- break;
870
- case "select-one":
871
- a.value = b
872
- }
873
- var c = document.createEvent("UIEvents");
874
- c.initEvent("change", !1, !1);
875
- a.dispatchEvent(c, a)
876
- }
877
- }
878
- var b = ref;
879
- if (b.J.V || !window.localStorage) document.cookie.split(";").forEach(function (b) {
880
- if (b) {
881
- var c = b.split("=")[0].trim().replace("com.apple.devpubs.", "");
882
- c && (c = h("#" + c), a(c, b.split("=")[1].trim()))
883
- }
884
- });
885
- else for (var c in b.a.f) {
886
- var e = "deployment_target" === c ? "_" + b.R : "",
887
- f = h("#" + c + e),
888
- e = localStorage.getItem("com.apple.devpubs." + c + e);
889
- a(f, e)
890
- }
891
- }
892
- function qa(a) {
893
- var b;
894
- a.a.f.auto_expand.checked ? (b = m(".symbol:not(.on):not(.hidden)"), Aa(a, b)) : (b = m(".symbol.on"), Ba(a, b));
895
- Y(a, a.a.f.auto_expand)
896
- }
897
-
898
- function X(a) {
899
- function b(a, b, f, g) {
900
- if (0 < b) {
901
- var k = 1 === b ? "" : "s";
902
- a.textContent = b + " " + f + " symbol" + k + " hidden";
903
- a.title = "To show " + (1 === b ? "this" : "these") + " symbol" + k + ", change your " + g + ".";
904
- a.classList.remove("hidden")
905
- } else a.classList.add("hidden")
906
- }
907
- a.a.ha.forEach(function (a) {
908
- var e = 0,
909
- f = 0,
910
- g = 0,
911
- k = 0;
912
- R(this, a).h.forEach(function (a) {
913
- a = R(this, a);
914
- a.P && (a.G && document.body.classList.contains("obj_c") ? f++ : a.F && document.body.classList.contains("swift") ? e++ : a.C && this.a.f.deprecated.checked ? g++ : a.q > this.a.f.deployment_target.value && k++)
915
- }.bind(this));
916
- var r = a.c(".hiding-swift"),
917
- l = a.c(".hiding-obj-c"),
918
- q = a.c(".hiding-dep");
919
- a = a.c(".hiding-dt");
920
- r && l && q && a && (b(r, e, "Objective-C", "language setting"), b(l, f, "Swift", "language setting"), b(q, g, "deprecated", "setting in the Options menu"), b(a, k, "newer", "setting in the Options menu"))
921
- }.bind(a))
922
- }
923
-
924
- function pa(a) {
925
- m(".deprecated").forEach(function (a) {
926
- var c = n(a, ".symbol");
927
- c ? (V(this, c), a = R(this, c), this.a.f.deprecated.checked ? W(a) : a.G && document.body.classList.contains("obj_c") || a.F && document.body.classList.contains("swift") || a.q > this.a.f.deployment_target.value || a.show()) : a.classList.toggle("hidden")
928
- }.bind(a));
929
- X(a);
930
- Y(a, a.a.f.deprecated)
931
- }
932
-
933
- function ua(a) {
934
- var b = parseFloat(a.a.f.deployment_target.value, 10);
935
- a.Q.a.h.forEach(function (a) {
936
- var e = n(a, ".item");
937
- e.classList.contains("deprecated") || (a = parseFloat(a.dataset.q, 10), a > b ? e.classList.add("hidden") : a <= b && e.classList.remove("hidden"))
938
- });
939
- a.a.h.forEach(function (a) {
940
- var e = R(this, a);
941
- if (!e.C) if (e.q > b) V(this, a), W(e);
942
- else {
943
- (document.body.classList.contains("obj_c") && !e.G || document.body.classList.contains("swift") && !e.F || document.body.classList.contains("both")) && e.show();
944
- var f = a.c(".task-group-term .new");
945
- e.q === b ? f || (f = document.createElement("span"), f.className = "new", f.innerHTML = "(New in " + ("mac" === this.R ? "OS X" : "iOS") + " " + ("mac" === this.R ? "v10." : "") + b + ")", a.c(".task-group-term").appendChild(f)) : f && a.c(".task-group-term").removeChild(f)
946
- }
947
- }.bind(a));
948
- X(a);
949
- Y(a, a.a.f.deployment_target)
950
- }
951
- function U(a, b) {
952
- var c = R(a, b),
953
- e = b.offsetTop,
954
- f = c.y,
955
- g = 20;
956
- c.I && (g = R(a, c.I).y);
957
- return e + f + g + R(a, c.ia).y
958
- }
959
- function Q(a, b, c) {
960
- b = U(a, b) - 27;
961
- c ? Ca(a.ga, b) : window.scrollTo(0, b + 1);
962
- a.Q.close()
963
- }
964
-
965
- function wa(a, b, c) {
966
- var e = R(a, b).I,
967
- f = n(e, ".task-group-section");
968
- [b, e, f].forEach(function (a) {
969
- var b = c,
970
- e = a.index();
971
- a = a.parentNode.childNodes;
972
- for (var e = e + 1, f = a.length; e < f; e++) if (1 === a[e].nodeType) {
973
- var q = a[e],
974
- s = R(this, q).y || 0,
975
- s = s + b,
976
- t = q.style;
977
- "webkitTransform" in t ? q.style.webkitTransform = "translateY(" + s + "px)" : "mozTransform" in t ? q.style.Aa = "translateY(" + s + "px)" : "oTransform" in t ? q.style.Ca = "translateY(" + s + "px)" : "transform" in t && (q.style.transform = "translateY(" + s + "px)");
978
- R(this, q).y = s
979
- }
980
- }.bind(a));
981
- h(".last-one").classList.contains("fat") || (h(".last-one").classList.add("fat"), c += 750);
982
- T(a, c)
983
- }
984
- function S(a, b) {
985
- var c = R(a, b),
986
- e = c.p;
987
- c.e && (e *= -1);
988
- 0 < e && (b.c(".height-container").classList.remove("hidden"), c.O && (va(c), e = c.p, c.O = !1));
989
- wa(a, b, e);
990
- c.toggle();
991
- b.classList.toggle("on")
992
- }
993
- function V(a, b) {
994
- R(a, b).e && S(a, b)
995
- }
996
- function Ba(a, b) {
997
- b.forEach(function (a) {
998
- V(this, a)
999
- }.bind(a))
1000
- }
1001
- function Aa(a, b) {
1002
- b.forEach(function (a) {
1003
- R(this, a).e || S(this, a)
1004
- }.bind(a))
1005
- }
1006
-
1007
- function T(a, b) {
1008
- var c = 0;
1009
- 0 !== b && (b ? c = parseInt(a.a.L.style.height, 10) + b : (m(".hiding-symbol-counts").H().classList.add("last-one"), c = a.a.L.clientHeight), a.a.L.style.height = c + "px")
1010
- }
1011
- function ka() {
1012
- var a = h(".nav-parts .part-name.tasks"),
1013
- b = window.innerHeight - 70 - 32 - (h(".nav-parts").clientHeight - a.clientHeight),
1014
- b = Math.max(b, 61);
1015
- a.style.maxHeight = b + "px"
1016
- }
1017
-
1018
- function Da() {
1019
- var a = ref,
1020
- b = 0;
1021
- a.a.h.forEach(function (a) {
1022
- var e = new Ea(a),
1023
- f = "s" + b++;
1024
- e.g(f);
1025
- this.data[f] = e;
1026
- a.l(".task-group-term a[href]").forEach(function (b) {
1027
- b.d("click", function (f) {
1028
- if (!f.metaKey) {
1029
- f.preventDefault();
1030
- if (!e.e) {
1031
- var r = a.getClientRects()[0].top;
1032
- f = R(this, a).p;
1033
- var l = window.innerHeight;
1034
- r + f + 30 > l && (r = U(this, a), Ca(this.ga, f + 30 < l - 97 ? r - (l - f - 30 - 70 - 10) : r - 27));
1035
- history.replaceState(null, null, b.href)
1036
- }
1037
- S(this, a)
1038
- }
1039
- }.bind(this))
1040
- }.bind(this))
1041
- }.bind(a));
1042
- b = 0;
1043
- a.a.ha.forEach(function (a) {
1044
- var e = new Fa(a),
1045
- f = "tg" + b++;
1046
- e.g(f);
1047
- this.data[f] = e;
1048
- a.c(".section-name").d("click", function (b) {
1049
- if (!b.metaKey) {
1050
- b.preventDefault();
1051
- var f = !e.e;
1052
- f && Q(this, a, !0);
1053
- a.l(".symbol:not(.hidden)").forEach(function (a) {
1054
- var b = R(this, a).e;
1055
- (f && !b || !f && b) && S(this, a)
1056
- }.bind(this));
1057
- e.toggle()
1058
- }
1059
- }.bind(this))
1060
- }.bind(a));
1061
- b = 0;
1062
- a.a.ta.forEach(function (a) {
1063
- var e = "c" + b++;
1064
- a = new Z(a);
1065
- a.g(e);
1066
- this.data[e] = a
1067
- }.bind(a));
1068
- b = 0;
1069
- m(".hiding-symbol-counts").forEach(function (a) {
1070
- a = new Z(a);
1071
- var e = "h" + b++;
1072
- a.g(e);
1073
- this.data[e] = a
1074
- }.bind(a))
1075
- }
1076
- function R(a, b) {
1077
- return a.data[b.id]
1078
- }
1079
- document.d("DOMContentLoaded", function () {
1080
- if (h("#reference")) {
1081
- var a = h("#book-title");
1082
- a && (a.getAttribute("content"), a = h("#ios_header .header-text a").textContent.split(" ")[0].toLowerCase(), ref = new da(0, a), xa(), ref.J.V || (ref.ga = new Ga, ref.Q = new H("#jump_to"), ref.Da = new I("#options"), ka(), Da(), T(ref), ya(), ref.r(), za(), ma(), na()))
1083
- }
1084
- });
1085
-
1086
- function Ga() {
1087
- this.ra = /(iPad|iPhone|iPod).*AppleWebKit/i.test(navigator.userAgent);
1088
- this.X = null;
1089
- this.B = this.s = 0;
1090
- this.aa = !1
1091
- }
1092
- Ga.prototype = {};
1093
-
1094
- function Ca(a, b) {
1095
- var c = window.pageYOffset;
1096
- a.s = c;
1097
- a.B = b;
1098
- a.aa = c < b;
1099
- var e = Math.round((b - c) / (300 / (1E3 / 60)));
1100
- 0 !== e && function g() {
1101
- a.X = window.requestAnimationFrame(g);
1102
- a.s += e;
1103
- (a.ra ? 0 : a.aa ? a.s < a.B : a.s > a.B) ? window.scrollTo(0, a.s) : (window.scrollTo(0, a.B + 1), window.cancelAnimationFrame(a.X))
1104
- }()
1105
- };
1106
-
1107
- function Z(a) {
1108
- this.b = a;
1109
- this.P = this.e = !1;
1110
- this.y = 0;
1111
- return this
1112
- }
1113
- Z.prototype = {
1114
- g: function (a) {
1115
- this.b.setAttribute("id", a)
1116
- },
1117
- show: function () {
1118
- this.b.classList.remove("hidden");
1119
- this.P = !1
1120
- },
1121
- toggle: function () {
1122
- this.e = !this.e
1123
- }
1124
- };
1125
-
1126
- function W(a) {
1127
- a.b.classList.add("hidden");
1128
- a.P = !0
1129
- };
1130
-
1131
- function Ea(a) {
1132
- this.b = a;
1133
- this.p = a.c(".section").clientHeight + 15;
1134
- this.I = n(a, ".task-group");
1135
- this.ia = n(this.I, ".task-group-section");
1136
- this.C = !! this.b.c(".deprecated");
1137
- this.G = this.b.classList.contains("swift-only");
1138
- this.F = this.b.classList.contains("obj-c-only");
1139
- this.q = parseFloat(a.dataset.availability, 10);
1140
- this.O = !1;
1141
- a.c(".height-container").classList.add("hidden");
1142
- a.d(window.la(), function () {
1143
- this.classList.contains("on") || this.c(".height-container").classList.add("hidden");
1144
- h(".last-one").classList.contains("fat") && (h(".last-one").classList.remove("fat"), T(ref, -750))
1145
- });
1146
- return this
1147
- }
1148
- Ea.prototype = new Z;
1149
-
1150
- function va(a) {
1151
- a.p = a.b.c(".section").clientHeight + 15
1152
- };
1153
-
1154
- function Fa(a) {
1155
- this.b = a;
1156
- this.h = a.l(".symbol");
1157
- this.ia = n(a, ".task-group-section");
1158
- return this
1159
- }
1160
- Fa.prototype = new Z;
1161
-
1162
- function aa(a) {
1163
- var b = {}, c, e = function () {
1164
- return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (a) {
1165
- window.setTimeout(a, 50)
1166
- }
1167
- }(),
1168
- f = window.cancelAnimationFrame || window.cancelRequestAnimationFrame || window.webkitCancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelAnimationFrame || window.mozCancelRequestAnimationFrame || window.clearTimeout,
1169
- g, k = null,
1170
- r = a.parentNode.querySelector(".svg-play-button"),
1171
- l = 0,
1172
- q = 0,
1173
- s = 0,
1174
- t = 0,
1175
- M = !1;
1176
- return {
1177
- g: function (c) {
1178
- b = c || {
1179
- N: 50,
1180
- oa: 800,
1181
- sa: 5
1182
- };
1183
- k = a.contentDocument.querySelectorAll("svg > g");
1184
- q = k.length;
1185
- s = Math.round(b.oa / b.N);
1186
- l = q - 1
1187
- },
1188
- start: function () {
1189
- g = Date.now();
1190
- var a = this;
1191
- (function Ia() {
1192
- c = e(Ia);
1193
- a.loop()
1194
- })();
1195
- M = !0;
1196
- r.classList.add("faded")
1197
- },
1198
- loop: function () {
1199
- var a = Date.now(),
1200
- c = a - g;
1201
- c > b.N && (1 <= l && (k[l].style.display = "block", l !== q - 1 && (k[l + 1].style.display = "none")), this.next(), g = a - c % b.N)
1202
- },
1203
- next: function () {
1204
- l === -1 * s ? t === b.sa - 1 ? this.stop() : (k[1].style.display = "none", l = q - 1, k[l].style.display = "block", t++) : l--
1205
- },
1206
- stop: function () {
1207
- f(c);
1208
- for (var a = 1; a < k.length; a++) k[a].style.display = "none";
1209
- l = q - 1;
1210
- k[l].style.display = "block";
1211
- t = 0;
1212
- r.classList.remove("faded");
1213
- M = !1
1214
- },
1215
- ba: function () {
1216
- return M
1217
- }
1218
- }
1219
- };
1220
-
1221
- function x(a) {
1222
- var b = this,
1223
- c = a.parentNode;
1224
- a.addEventListener("click", function (a) {
1225
- $(b, a)
1226
- });
1227
- a.addEventListener("touchend", function (a) {
1228
- $(b, a)
1229
- });
1230
- a.addEventListener("play", function () {
1231
- b.play()
1232
- });
1233
- a.addEventListener("pause", function () {
1234
- b.pause()
1235
- });
1236
- a.addEventListener("ended", function () {
1237
- b.pause();
1238
- b.t.element.currentTime = 0
1239
- });
1240
- a.addEventListener("keypress", function (a) {
1241
- 32 === a.keyCode && (a.preventDefault(), $(b, a))
1242
- });
1243
- b.ma = 24;
1244
- b.t = {
1245
- element: a
1246
- };
1247
- b.da = c.querySelector(".playButtonOverlay");
1248
- return b.t.element
1249
- }
1250
- x.prototype = {
1251
- play: function () {
1252
- var a = this.t.element;
1253
- this.da.classList.add("hide");
1254
- a.play();
1255
- a.focus()
1256
- },
1257
- pause: function () {
1258
- var a = this.da;
1259
- this.t.element.pause();
1260
- a.classList.remove("hide")
1261
- }
1262
- };
1263
-
1264
- function $(a, b) {
1265
- b && b.offsetY > a.t.element.videoHeight - a.ma || (a.t.element.paused ? a.play() : a.pause())
1266
- };
1267
-
1268
- function Ha() {
1269
- this.version = void 0
1270
- }
1271
- Ha.prototype = {
1272
- g: function () {
1273
- var a = navigator.userAgent;
1274
- this.version = parseFloat(a.slice(a.indexOf("Xcode/") + 6, a.length));
1275
- if (5 <= this.version) {
1276
- var a = document.getElementsByTagName("head")[0],
1277
- b;
1278
- b = a.querySelector("link[rel=stylesheet]").href;
1279
- b = b.substring(0, b.lastIndexOf("/") + 1);
1280
- var c = document.createElement("link");
1281
- c.setAttribute("rel", "stylesheet");
1282
- c.setAttribute("type", "text/css");
1283
- c.setAttribute("href", b + "xcode5.css");
1284
- c.setAttribute("id", "xcode5");
1285
- a.appendChild(c)
1286
- }
1287
- }
1288
- };
1289
- document.addEventListener("DOMContentLoaded", function () {
1290
- -1 < navigator.userAgent.indexOf("Xcode/") ? (xcode = new Ha, xcode.g()) : xcode = void 0
1291
- });
1292
-
1293
- //# sourceMappingURL=./devpubs.js.map