-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
232 lines (210 loc) · 9.75 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<!DOCTYPE html>
<html lang="en">
<head>
<title> Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
</head>
<body>
<a title=" Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html"> Docs</a> (11% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html"> Reference</a>
<img id="carat" src="img/carat.png" />
Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/AppDelegate.html">AppDelegate</a>
</li>
<li class="nav-group-task">
<a href="Classes/Cache.html">Cache</a>
</li>
<li class="nav-group-task">
<a href="Classes/HeaderView.html">HeaderView</a>
</li>
<li class="nav-group-task">
<a href="Classes/HistoryRateCell.html">HistoryRateCell</a>
</li>
<li class="nav-group-task">
<a href="Classes/MainViewController.html">MainViewController</a>
</li>
<li class="nav-group-task">
<a href="Classes/MainViewModel.html">MainViewModel</a>
</li>
<li class="nav-group-task">
<a href="Classes/NibSettable.html">NibSettable</a>
</li>
<li class="nav-group-task">
<a href="Classes/WatchSessionManager.html">WatchSessionManager</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Enums/BRError.html">BRError</a>
</li>
<li class="nav-group-task">
<a href="Enums/HTTPMethod.html">HTTPMethod</a>
</li>
<li class="nav-group-task">
<a href="Enums/Router.html">Router</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Extensions/HTTPURLResponse.html">HTTPURLResponse</a>
</li>
<li class="nav-group-task">
<a href="Extensions/String.html">String</a>
</li>
<li class="nav-group-task">
<a href="Extensions/UITableView.html">UITableView</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Protocols.html#/s:11BitcoinRate18EasyRegisteredCellP">EasyRegisteredCell</a>
</li>
<li class="nav-group-task">
<a href="Protocols/MainViewModelDelegate.html">MainViewModelDelegate</a>
</li>
<li class="nav-group-task">
<a href="Protocols/NetworkRessource.html">NetworkRessource</a>
</li>
<li class="nav-group-task">
<a href="Protocols/NibLoadableView.html">NibLoadableView</a>
</li>
<li class="nav-group-task">
<a href="Protocols/ReusableView.html">ReusableView</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Structs/CachedWebservice.html">CachedWebservice</a>
</li>
<li class="nav-group-task">
<a href="Structs/Currency.html">Currency</a>
</li>
<li class="nav-group-task">
<a href="Structs/CurrentRateResponse.html">CurrentRateResponse</a>
</li>
<li class="nav-group-task">
<a href="Structs/HeaderViewModel.html">HeaderViewModel</a>
</li>
<li class="nav-group-task">
<a href="Structs/HistoryRate.html">HistoryRate</a>
</li>
<li class="nav-group-task">
<a href="Structs/HistoryRateCellModel.html">HistoryRateCellModel</a>
</li>
<li class="nav-group-task">
<a href="Structs/HistoryRateResponse.html">HistoryRateResponse</a>
</li>
<li class="nav-group-task">
<a href="Structs/Keys.html">Keys</a>
</li>
<li class="nav-group-task">
<a href="Structs/NetworkManager.html">NetworkManager</a>
</li>
<li class="nav-group-task">
<a href="Structs/NetworkMockErrorTest.html">NetworkMockErrorTest</a>
</li>
<li class="nav-group-task">
<a href="Structs/NetworkMockTest.html">NetworkMockTest</a>
</li>
<li class="nav-group-task">
<a href="Structs/ResponseTime.html">ResponseTime</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Typealiases.html">Type Aliases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Typealiases.html#/s:11BitcoinRate14FailureHandlera">FailureHandler</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1 id='bitcoinrate' class='heading'>BitcoinRate</h1>
<p>Hi, fellow Reviewer,</p>
<p>This document will help you build the project and walk you through into some of the specifics of the project. I hope you’ll enjoy reviewing my code.</p>
<p>Cheers !</p>
<h2 id='requirements' class='heading'>Requirements</h2>
<ul>
<li>Xcode 9.3+</li>
<li>iOS 11.0+</li>
<li>Swift 4.0+</li>
</ul>
<h2 id='building-the-project' class='heading'>Building the project</h2>
<p>This project use <a href="https://cocoapods.org">Cocoapods</a>. Tap the following commands in the root directory </p>
<pre class="highlight plaintext"><code>$> sudo gem install cocoapods
$> pod install
</code></pre>
<p>It will generate a file <strong>BitcoinRate.xcworkspace</strong>. Open the project with it (not with BitcoinRate.xcodeproj)</p>
<h2 id='project-architecture' class='heading'>Project Architecture</h2>
<p>The architecture evolves around “Stories” where, in the future, whenever the project grows, we can separate different screen logic that represent a new story (ex: Login screens, User Settings screens).</p>
<p>A Story is composed of a Storyboard, ViewControllers, ViewModels and Views directories. This way, it is easy to navigate between classes that are linked inside a same story.</p>
<p><img src="documentation/doc_stories.png" alt="GitHub Logo"></p>
<p>When possible, MVVM is used.</p>
<h2 id='watch-extension' class='heading'>Watch Extension</h2>
<p>The extension uses WatchConnectivity framework to communicate with the iPhone.
When the watch opens the app, it will wake up the iOS app with an Interactive message. The iOS app then will fetch the new data (cache and/or network) and returns it with the <em>updateApplicationContext</em> method.</p>
<p>Note:</p>
<p>We could also have used <em>URLSession</em> within the watch app. But, in order to not over complicate the project, we will stick with this process for now. </p>
<pre class="highlight plaintext"><code>Watch -> sendMessage -> iOS
| Fetch new data
<- updateApplicationContext <-
</code></pre>
<h2 id='known-issues' class='heading'>Known issues</h2>
<p>//TODO</p>
<h2 id='cocoapods' class='heading'>Cocoapods</h2>
<p>Two framework are used with Cocoapods:</p>
<h4 id='a-href-https-github-com-adela-chang-stringextensionhtml-stringextensionhtml-a' class='heading'><a href="https://github.com/adela-chang/StringExtensionHTML">StringExtensionHTML</a></h4>
<p>Small helper to nicely convert html code to formatted string. (Coindesk api returns symbols’ codes)</p>
<h4 id='a-href-https-github-com-mxcl-promisekit-promisekit-a' class='heading'><a href="https://github.com/mxcl/PromiseKit">PromiseKit</a></h4>
<p>This pod is used in WatchSessionManager to combine nicely two network calls before returning both results to the Watch</p>
<h2 id='testing' class='heading'>Testing</h2>
<p>To test different parts of the project, I use the Xcode test framework.</p>
<p>There’s not a lot to test in UI. But you will find one that demonstrate the use of Mock ressources using <em>launchEnvironment</em> a the beginning of the test.</p>
</section>
</section>
<section id="footer">
<p>© 2018 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2018-05-10)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>