Skip to content

Instantly share code, notes, and snippets.

View mcz9mm's full-sized avatar
🏠
Working from home

Kaoru Matarai mcz9mm

🏠
Working from home
View GitHub Profile
@yuji96
yuji96 / 2018-2019.ipynb
Created June 2, 2021 08:28
インフルエンザ感染者数の csv ファイルを、厚労省報道発表資料(週ごとの pdf ファイル)作成
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sgr-ksmt
sgr-ksmt / _usage.dart
Last active May 5, 2020 23:42
BouncedWidget
Widget buld(BuildContext context) {
return BouncedWidget.create(
child: const SomeListTile(),
bounce: 0.1,
duration: const Duration(milliseconds: 350),
);
}
@y-takagi
y-takagi / DOCUMENT.md
Last active April 29, 2024 16:36
iOSでデータを永続化する方法

How to save data in iOS

この投稿では、iOSのファイルシステムについて理解し、データを永続化(iCloud含む)する方法を紹介する。尚、サンプルコードは動かない可能性もあるので参考程度にして下さい。

iOS File System

アプリがファイルシステムとやり取り出来る場所は、ほぼアプリのサンドボックス内のディレクトリに制限されている。新しいアプリがインストールされる際、インストーラーはサンドボックス内に複数のコンテナを作成し、図1に示す構成をとる。各コンテナには役割があり、Bundle Containerはアプリのバンドルを保持し、Data Containerはアプリとユーザ両方のデータを保持する。Data Containerは用途毎に、さらに複数のディレクトリに分けられる。アプリは、例えばiCloud Containerのように、実行時に追加のコンテナへのアクセスをリクエストすることもある。

IMG_0017_RESIZE.png

図1. An iOS app operating within its own sandbox