Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Share Data Across Extension and App with Realm
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kishikawa Katsumi
May 14, 2015
Programming
1
3k
Share Data Across Extension and App with Realm
Share Data Across Extension and App with Realm
Kishikawa Katsumi
May 14, 2015
Tweet
Share
More Decks by Kishikawa Katsumi
See All by Kishikawa Katsumi
浮動小数の比較について
kishikawakatsumi
0
64
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
200
愛される翻訳の秘訣
kishikawakatsumi
3
390
Private APIの呼び出し方
kishikawakatsumi
3
980
iOSでSVG画像を扱う
kishikawakatsumi
0
220
Build your own WebP codec in Swift
kishikawakatsumi
2
1.6k
iOSDC 2024 SMBファイル共有をSwiftで実装する
kishikawakatsumi
1
290
Enhancing Applications with Accessibility API
kishikawakatsumi
3
5.2k
Mastering SwiftSyntax
kishikawakatsumi
4
7.5k
Other Decks in Programming
See All in Programming
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
630
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
2.6k
CSC307 Lecture 01
javiergs
PRO
0
690
Oxlintはいいぞ
yug1224
5
1.4k
dchart: charts from deck markup
ajstarks
3
1k
CSC307 Lecture 09
javiergs
PRO
1
840
Apache Iceberg V3 and migration to V3
tomtanaka
0
170
MUSUBIXとは
nahisaho
0
140
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.5k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
620
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.6k
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Color Theory Basics | Prateek | Gurzu
gurzu
0
200
Amusing Abliteration
ianozsvald
0
110
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
950
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
71
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
460
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
1.9k
Leo the Paperboy
mayatellez
4
1.4k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
67
Transcript
Share Data Across Extension and App with Realm
http://kishikawakatsumi.com kishikawa katsumi https://github.com/kishikawakatsumi
App Group
App Group
Realm
NSFileManager *fileManager = [[NSFileManager alloc] init]; NSURL *containerURL = [fileManager
containerURLForSecurityApplicationGroupIdentifier:@"group.com.xxx.realm"]; NSString *containerPath = [containerURL URLByAppendingPathComponent:@"test.realm"].path; [RLMRealm setDefaultRealmPath:containerPath]; RLMRealm *realm = [RLMRealm defaultRealm]; [realm transactionWithBlock:^{ NSString *text = ...; __block NSUInteger identifier = 0; [text enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) { Address *address = [[Address alloc] init]; address.address = line; [realm addObject:address]; }]; }];
Memory Usage Limitations on App Extension
24MB?
Ұ෦ͷσʔλ͚ͩڞ༗͢Δ
RLMRealm *realm = [RLMRealm defaultRealm]; [realm transactionWithBlock:^{ NSString *text =
...; __block NSUInteger identifier = 0; [text enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) { Address *address = [[Address alloc] init]; address.address = line; [realm addObject:address]; }]; }]; NSFileManager *fileManager = [[NSFileManager alloc] init]; NSURL *containerURL = [fileManager containerURLForSecurityApplicationGroupIdentifier:@"group.com.xxx.realm"]; NSString *containerPath = [containerURL URLByAppendingPathComponent:@"test.realm"].path; RLMRealm *sharedRealm = [RLMRealm realmWithPath:containerPath]; [sharedRealm transactionWithBlock:^{ for (int i = 0; i < 10; i++) { Address *address = addresses[i]; Address *clone = [[Address alloc] initWithValue:address]; [sharedRealm addObject:clone]; } }];