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
Realm Japan meetup #16
Search
Kishikawa Katsumi
July 24, 2016
Programming
200
0
Share
Realm Japan meetup #16
- Realm Objective-C/Swift 1.0.1
- Realm video tutorial
- What's new in CoreData
Kishikawa Katsumi
July 24, 2016
More Decks by Kishikawa Katsumi
See All by Kishikawa Katsumi
OCRを使ってゲームのアイテムをデータ化する
kishikawakatsumi
0
120
Running Swift without an OS
kishikawakatsumi
0
930
浮動小数の比較について
kishikawakatsumi
0
520
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
250
愛される翻訳の秘訣
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
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
270
CSC307 Lecture 17
javiergs
PRO
0
290
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.2k
Inspired By RubyKaigi (EN)
atzzcokek
0
460
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
130
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
7
2.4k
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
0
240
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
1.8k
New "Type" system on PicoRuby
pocke
1
390
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
18
7.6k
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
5
1k
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
500
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
96
14k
Claude Code のすすめ
schroneko
67
220k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
540
Test your architecture with Archunit
thirion
1
2.3k
The Cult of Friendly URLs
andyhume
79
6.9k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
How to Ace a Technical Interview
jacobian
281
24k
Odyssey Design
rkendrick25
PRO
2
650
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
380
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
300
Transcript
Realm meetup #16
[email protected]
Katsumi Kishikawa Realm Inc.
[email protected]
Recent Updates
[email protected]
Recent Updates • Realm Objective-C/Swift 1.0.1 (was 1.0.0) • Realm
Java 1.0.1 (was 1.0.0) • Realm React Native 0.13.0 • Realm Xamarin 0.76.0
[email protected]
[email protected]
Realm Objective-C/Swift 1.0.1 (was 1.0.1)
[email protected]
Realm Objective-C/Swift 1.0.1 • RealmϑΝΠϧΛ։͘ࡍͷύϑΥʔϚϯε্ • ॻ͖ࠐΈτϥϯβΫγϣϯͷύϑΥʔϚϯε্ • RealmOptionalܕͷϓϥΠϚϦΩʔΛ࣋ͭΦϒδΣΫ τΛߋ৽Ͱ͖ͳ͍ͷमਖ਼
• objectForPrimaryKey(_:key:)ͷύϥϝʔλ͕Φϓγϣ φϧʹ • ෆ۩߹ͷमਖ਼
[email protected]
[email protected]
Already compatible with Swift 3 & Xcode 8 https://github.com/realm/realm-cocoa/issues/3796
[email protected]
Realm Objective-C/Swift 1.0.2 will be very soon!
[email protected]
Realm Video Tutorial
[email protected]
Beginning Realm on iOS www.raywenderlich.com/video-tutorials#begrealm
[email protected]
Beginning Realm on iOS raywenderlich.com
[email protected]
Beginning Realm on iOS raywenderlich.com
[email protected]
WWDC 2016
[email protected]
What’s new in Core Data
[email protected]
What’s new in Core Data • Simple Core Data Stack
• NSPersistentStoreDescription (Like RealmConfiguratin?) • Type safety • Subclass generation • Version Pinning
[email protected]
[email protected]
Simpler Core Data Stack
[email protected]
lazy var managedObjectModel: NSManagedObjectModel =
{ let modelURL = NSBundle.mainBundle().URLForResource("Example", withExtension: "momd")! return NSManagedObjectModel(contentsOfURL: modelURL)! }() lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator? = { var coordinator: NSPersistentStoreCoordinator? = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel) let url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("Example.sqlite") var error: NSError? = nil var failureReason = "There was an error creating or loading the application's saved data." if coordinator!.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil, error: &error) == nil { coordinator = nil NSLog("Unresolved error \(error), \(error!.userInfo)") abort() } return coordinator }() lazy var managedObjectContext: NSManagedObjectContext? = { let coordinator = self.persistentStoreCoordinator if coordinator == nil { return nil } var managedObjectContext = NSManagedObjectContext() managedObjectContext.persistentStoreCoordinator = coordinator return managedObjectContext }()
Simpler Core Data Stack
[email protected]
lazy var persistentContainer: NSPersistentContainer =
{ let container = NSPersistentContainer(name: "Example") container .loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error { fatalError("Unresolved error \(error), \(error.userInfo)") } }) return container }()
Typed fetch request
[email protected]
let request: NSFetchRequest<Dog> = Dog.fetchRequest() request.predicate
= Predicate(format: "...") request.fetchBatchSize = 20 let dogs = try! persistentContainer.viewContext.fetch(request) print(dogs)
Typed fetch request
[email protected]
let request: NSFetchRequest<Dog> = Dog.fetchRequest() request.predicate
= Predicate(format: "...") request.fetchBatchSize = 20 let dogs = try! persistentContainer.viewContext.fetch(request) print(dogs)
Insert
[email protected]
let dog = Dog(context: persistentContainer.viewContext) ... try! persistentContainer.viewContext.save()
Backgroud task
[email protected]
let context = persistentContainer.newBackgroundContext() ...
Backgroud task
[email protected]
persistentContainer.performBackgroundTask { (context) in ... }
Auto generation subclasses
[email protected]
import Foundation import CoreData class Dog:
NSManagedObject { } extension Dog { @nonobjc class func fetchRequest() -> NSFetchRequest<Dog> { return NSFetchRequest<Dog>(entityName: "Dog"); } @NSManaged var age: Int64 @NSManaged var name: String? }
Where to find us • ! Realm Japan User Group:
facebook.com/groups/realmjp • ! Twitter: twitter.com/realmJapan • GitHub: github.com/realm • ! StackOverflow: ja.stackoverflow.com/questions/tagged/realm • ! Email:
[email protected]
• ! Slack: slack.realm.io/
[email protected]
[email protected]
Realm Japan User Group Facebook
[email protected]
Support Chat Slack
[email protected]
Ξϯέʔτ http://bit.ly/RealmJP_16
[email protected]
Questions? Katsuma Kishikawa
[email protected]
www.realm.io/jp @k_katsumi