Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Mode offline Cocoaheads
Search
Mathieu Hausherr
May 17, 2018
Technology
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Mode offline Cocoaheads
Mathieu Hausherr
May 17, 2018
More Decks by Mathieu Hausherr
See All by Mathieu Hausherr
Mobilis In Mobile 2024 - iOS, Android et la voiture - État des lieux
mhausherr
0
110
FrenchKit - Contact Tracing & Exposure Notification
mhausherr
0
240
FRAUG StopCovid19 : Le point sur les applications de tracing Bluetooth
mhausherr
1
300
Swift Lille - CoreML / CreateML
mhausherr
0
120
Image classification in real world : Car rental damage report
mhausherr
0
120
Les surcouches constructeur sur Android
mhausherr
1
910
Mode offline : Notre application Android fonctionne au niveau -5 d’un parking
mhausherr
0
1.5k
Mode offline : Notre application mobile fonctionne au niveau -5 d’un parking
mhausherr
1
160
CocoaHeads : Apple Pay
mhausherr
0
100
Other Decks in Technology
See All in Technology
20260930_Gemma4_Hands-on
tsho
0
230
おそらく日本で唯一のDevRelインターン生として
husengs7
0
170
契約書画像からの情報抽出に特化した視覚接地モデルを育てる話
sansantech
PRO
1
140
HacobuにおけるFDEとは/登壇資料(戸井田 裕貴)
hacobu
PRO
1
780
私の推しは「聞いてから進む」AIです -AI-DLCに一人でアプリを作らせた話
yama3133
1
180
転んだ話が背中を預ける理由になる / A_story_about_falling_down_gives_you_a_reason_to_watch_each_other_s_backs.pdf
pauli
3
250
いちAWSエンジニアのAI活用を振り返る #devio2026 / devio osaka 2026 kawahara
masahirokawahara
2
390
組み立てて楽しむ AWS Blocks 入門
kmiya84377
0
220
[2026 Oracle Technical Deep Dive] AI時代のアプリケーションを支えるCloud NativeとJava EEモダナイゼーション (2026年9月17日開催)
oracle4engineer
PRO
0
120
ファミコンでPHPを動かす / PHP on the Famicom side b
tomzoh
0
140
メルペイ 会計システム概要と歴史
mewuto
0
160
AIアプリを使い分けるための共通ツール基盤を考えてみる#devio2026
osawa
0
260
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
1.5k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
350
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Believing is Seeing
oripsolob
1
240
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
How to Talk to Developers About Accessibility
jct
2
560
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Designing for Timeless Needs
cassininazir
1
520
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
320
Designing for Performance
lara
611
70k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
3
4.3k
Transcript
CocoaHeads Mathieu Hausherr @mhausherr 1 https://www.youtube.com/watch?v=wc38XyAA43o
Mode offline Notre application fonctionne au niveau -5 d’un parking
2
3
4
5
6
7
8
9
10
X
12
13
14
X Version 0.0.1-alpha
16
17 Plus jamais ça !
X Cache all requests if !isNetworkReachable && readFromCache(handler) { return
} manager.request(baseURL + path, method: method, parameters: parameters, encoding: encoding) .validate() .responseJSON { response in switch response.result { case .failure(let error): self.readFromCache(handler) case .success: self.writeResponseToCache(response: response) } }
X Cache all requests if !isNetworkReachable && readFromCache(handler) { return
} manager.request(baseURL + path, method: method, parameters: parameters, encoding: encoding) .validate() .responseJSON { response in switch response.result { case .failure(let error): self.readFromCache(handler) case .success: self.writeResponseToCache(response: response) } }
X Cache all requests if !isNetworkReachable && readFromCache(handler) { return
} manager.request(baseURL + path, method: method, parameters: parameters, encoding: encoding) .validate() .responseJSON { response in switch response.result { case .failure(let error): self.readFromCache(handler) case .success: self.writeResponseToCache(response: response) } }
X Cache all requests if !isNetworkReachable && readFromCache(handler) { return
} manager.request(baseURL + path, method: method, parameters: parameters, encoding: encoding) .validate() .responseJSON { response in switch response.result { case .failure(let error): self.readFromCache(handler) case .success: self.writeResponseToCache(response: response) } }
X Cache strategies switch cacheMode { case .standard: if !isNetworkReachable
&& readFromCache(handler) { return } case .forceCache: readFromCache(handler); return case .twoStepLoading: readFromCache(handler) }
X Cache strategies switch cacheMode { case .standard: if !isNetworkReachable
&& readFromCache(handler) { return } case .forceCache: readFromCache(handler); return case .twoStepLoading: readFromCache(handler) }
X Cache strategies switch cacheMode { case .standard: if !isNetworkReachable
&& readFromCache(handler) { return } case .forceCache: readFromCache(handler); return case .twoStepLoading: readFromCache(handler) }
X cache before call call cache after call standard forceCache
noCache twoStepLoading
X Cache Swift func getData() -> Data? { try? Data(contentsOf:
cacheURL) } func set(data: Data) { try? data.write(to: cacheURL, options: [.atomic]) } var isCacheStillValid: Bool { guard let attributes = try? FileManager.default.attributesOfItem(atPath: pathForCacheFile) else { return false } guard let modificationDate = attributes[FileAttributeKey.modificationDate] as? Date else { return false } return self.cacheDuration - modificationDate.timeIntervalSinceNow > 0 }
X Cache Swift func getData() -> Data? { try? Data(contentsOf:
cacheURL) } func set(data: Data) { try? data.write(to: cacheURL, options: [.atomic]) } var isCacheStillValid: Bool { guard let attributes = try? FileManager.default.attributesOfItem(atPath: pathForCacheFile) else { return false } guard let modificationDate = attributes[FileAttributeKey.modificationDate] as? Date else { return false } return self.cacheDuration - modificationDate.timeIntervalSinceNow > 0 }
X
29 Bien joué les gars !
X Version 1.0.0
31
X Déclaration la plus rapide possible, image avec sha256 POST
/inspection [{ "created_at": …, "zone_id": …, "image_hash": … }]
33
X Notifications silencieuses iOS <key>UIBackgroundModes</key> <array> <string>remote-notification</string> </array>
X Version 1.1.0
36
X
X
X
X Image cache Swift class ImageCache { var inMemoryCache: [URL:
UIImage] = [:] func image(forURL url: URL) -> UIImage? { if let image = inMemoryCache[url] { return image } if let image = readImageFromCache(url) { inMemoryCache[urlString] = image; return image } else { return nil } } }
X Premiers retours utilisateurs
42
X
X
X
X Version 2.7.0
X 400 voitures 250 000 téléchargements
X Pour tester
49 Merci