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
Kishikawa Katsumi
May 14, 2015
Programming
3.1k
1
Share
Share Data Across Extension and App with Realm
Share Data Across Extension and App with Realm
Kishikawa Katsumi
May 14, 2015
More Decks by Kishikawa Katsumi
See All by Kishikawa Katsumi
OCRを使ってゲームのアイテムをデータ化する
kishikawakatsumi
0
110
Running Swift without an OS
kishikawakatsumi
0
920
浮動小数の比較について
kishikawakatsumi
0
510
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
240
愛される翻訳の秘訣
kishikawakatsumi
3
440
Private APIの呼び出し方
kishikawakatsumi
3
1k
iOSでSVG画像を扱う
kishikawakatsumi
0
240
Build your own WebP codec in Swift
kishikawakatsumi
2
2.1k
iOSDC 2024 SMBファイル共有をSwiftで実装する
kishikawakatsumi
1
320
Other Decks in Programming
See All in Programming
LLM Plugin for Node-REDの利用方法と開発について
404background
0
110
Sans tests, vos agents ne sont pas fiables
nabondance
0
160
AI時代だからこそ「Bloc」を採用する価値があるのかもしれない
takuroabe
0
240
Hive Metastoreを通して学ぶIceberg REST Catalog ― 仕様から実装まで
okumin
0
280
要はバランスからの卒業 #yumemi_grow
kajitack
0
190
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
260
Agent Skills を社内で育てる仕組み作り
jackchuka
1
2.4k
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
2.3k
CSC307 Lecture 17
javiergs
PRO
0
240
Cloudflare で始める Data Platform
ta93abe
0
300
inferと仲良くなる10分間
ryokatsuse
1
250
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
980
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
210
YesSQL, Process and Tooling at Scale
rocio
174
15k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
800
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Scaling GitHub
holman
464
140k
Designing for Performance
lara
611
70k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
Become a Pro
speakerdeck
PRO
31
5.9k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
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]; } }];