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 Xamarin
Search
USAMI Kosuke
June 22, 2016
Programming
0
340
Realm Xamarin
http://kanmoba.connpass.com/event/33117/
USAMI Kosuke
June 22, 2016
Tweet
Share
More Decks by USAMI Kosuke
See All by USAMI Kosuke
Onsager代数とその周辺 / Onsager algebra tsudoi
usamik26
0
530
Apple HIG 正式名称クイズ結果発表 / HIG Quiz Result
usamik26
0
110
ゆめみ大技林製作委員会の立ち上げの話 / daigirin project
usamik26
0
280
@ViewLoadingプロパティラッパの紹介と自前で実装する方法 / @ViewLoading property wrapper implementation
usamik26
0
430
これからUICollectionViewを実践活用する人のためのガイド / Guide to UICollectionView
usamik26
1
690
Xcodeとの最近の付き合い方のはなし / Approach To Xcode
usamik26
2
610
UICollectionView Compositional Layout
usamik26
0
680
Coding Swift with Visual Studio Code and Docker
usamik26
0
450
Swift Extension for Visual Studio Code
usamik26
2
910
Other Decks in Programming
See All in Programming
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
3
690
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
距離関数を極める! / SESSIONS 2024
gam0022
0
280
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.7k
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
Outline View in SwiftUI
1024jp
1
330
Amazon Qを使ってIaCを触ろう!
maruto
0
410
CSC509 Lecture 11
javiergs
PRO
0
180
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
RubyLSPのマルチバイト文字対応
notfounds
0
120
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Designing Experiences People Love
moore
138
23k
Building an army of robots
kneath
302
43k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
The Cult of Friendly URLs
andyhume
78
6k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Statistics for Hackers
jakevdp
796
220k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Transcript
Realm Xamarin USAMI Kosuke Fenrir Inc.
Xamarin
Xamarin » C# Ͱ iOS / Android ωΠςΟϒΞϓϦ։ൃ » iOS
/ Android ͰίʔυΛڞ༗Մೳ » .NET ϥΠϒϥϦ / ωΠςΟϒϥΠϒϥϦΛ༻Մೳ
ݸਓ։ൃϥΠηϯεແঈԽ » Xamarin ϥΠηϯε͕ Visual Studio ϥΠηϯεͱ౷߹ » ݸਓ։ൃϥΠηϯε͕ແঈʹʢCommunity Editionʣ
http://www.fenrir-inc.com/jp/business/app/xamarin/
Xamarin Consulting Partner
Realm
Realm » ϞόΠϧΞϓϦ͚σʔλϕʔε » Objective-C / Swift / Java /
React Native / Xamarin » ͍͘͢ɺύϑΥʔϚϯε༏ल
Realm 1.0 » Objective-C / Swift / Java ͕ beta
͔Β 1.0 » beta Ͱͳ͘ͳͬͨ͜ͱͰɺಋೖͷෑډ͕͘ͳͬͨ » React Native / Xamarin beta ʢ·ͩొ͔ͨ͠Γʣ
Introducing Realm Xamarin on 2016/05/11
Realm Xamarin
Install » NuGet Ͱ؆୯ʹಋೖͰ͖Δ
Model public class Person : RealmObject { public string Name
{ get; set; } public int Age { get; set; } }
Model ͷσʔλܕ » ֤ϓϦϛςΟϒܕʢbool,char,byte,short,int,long,float,doubleʣ » string » DateTimeOffset » Null
ڐ༰ܕʢint? ͳͲʣՄೳɺnull ༻Մೳ
getter / setter ͷࣗಈੜ » ࣗಈ࣮ϓϩύςΟɺgetter ͱ setter ͕ࣗಈੜ͞ΕΔ »
ͦͷதͰ Realm ෦ετϨʔδͱؔ࿈͚͞ΕΔ » Ignore ଐੑΛ͚ͭΔͱࣗಈੜ͞Εͳ͍ » ΧελϜ getter / setter ্ॻ͖͞Εͳ͍
ΦϒδΣΫτͷऔಘʢΫΤϦʣ public IEnumerable<Person> Persons { get; private set; } public
PersonViewModel() { var realm = Realm.GetInstance(); Persons = realm.All<Person>() }
ΦϒδΣΫτͷՃ public AddPerson() { var realm = Realm.GetInstance(); using(var transaction
= realm.BeginWrite()) { var person = realm.CreateObject<Person>(); person.Name = "Hoge"; person.Age = 20; transaction.Commit(); } // ࣗಈతʹ transaction ͕ Dispose() ͞ΕΔ }
ΦϒδΣΫτͷࣗಈߋ৽ ʢઌ΄ͲͷίʔυΛ࠶ܝʣ public PersonViewModel() { var realm = Realm.GetInstance(); Persons
= realm.All<Person>() // ΦϒδΣΫτΛՃͨ͠ΒɺPersons ͕ࣗಈతʹߋ৽͞ΕΔ // ࠶ All ΫΤϦΛ࣮ߦ͢Δඞཁͳ͍ }
LINQ ʹΑΔΫΤϦ // ϝιουߏจ Persons = realm.All<Person>() .Where(p => p.Age
< 20); // ΫΤϦࣜ Persons = from p in realm.All<Person>() where p.Age < 20 select p;
Realm Xamarin ·ͱΊ » ͱͯ؆୯ʹ͑Δ » C# ͱͯࣗ͠વʹॻ͚Δ » ࢀߟࢿྉ
» Realm Xamarin https://realm.io/jp/docs/xamarin/latest/ » Cross-Platform Development with Xamarin.Forms and Realm | Xamarin Blog