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
0
170
Realm Japan meetup #16
- Realm Objective-C/Swift 1.0.1
- Realm video tutorial
- What's new in CoreData
Kishikawa Katsumi
July 24, 2016
Tweet
Share
More Decks by Kishikawa Katsumi
See All by Kishikawa Katsumi
iOSDC 2024 SMBファイル共有をSwiftで実装する
kishikawakatsumi
1
160
Enhancing Applications with Accessibility API
kishikawakatsumi
3
3.2k
Mastering SwiftSyntax
kishikawakatsumi
4
5.3k
My SwiftData Review
kishikawakatsumi
7
1.4k
Swift Expression Macros: a practical introduction
kishikawakatsumi
3
1.8k
Xcode Cloudの評価
kishikawakatsumi
2
1.2k
Regular expressions basics/正規表現の基本
kishikawakatsumi
7
720
家のいろいろな数値を計測する
kishikawakatsumi
4
2.2k
GitHub Actionsでテストの結果をわかりやすく表示する
kishikawakatsumi
1
1k
Other Decks in Programming
See All in Programming
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
170
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
Outline View in SwiftUI
1024jp
1
330
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
670
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
Remix on Hono on Cloudflare Workers
yusukebe
1
290
as(型アサーション)を書く前にできること
marokanatani
10
2.6k
RubyLSPのマルチバイト文字対応
notfounds
0
120
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
A Tale of Four Properties
chriscoyier
156
23k
A designer walks into a library…
pauljervisheath
204
24k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
It's Worth the Effort
3n
183
27k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Scaling GitHub
holman
458
140k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
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