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
330
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
390
Apple HIG 正式名称クイズ結果発表 / HIG Quiz Result
usamik26
0
71
ゆめみ大技林製作委員会の立ち上げの話 / daigirin project
usamik26
0
250
@ViewLoadingプロパティラッパの紹介と自前で実装する方法 / @ViewLoading property wrapper implementation
usamik26
0
360
これからUICollectionViewを実践活用する人のためのガイド / Guide to UICollectionView
usamik26
1
610
Xcodeとの最近の付き合い方のはなし / Approach To Xcode
usamik26
2
530
UICollectionView Compositional Layout
usamik26
0
550
Coding Swift with Visual Studio Code and Docker
usamik26
0
350
Swift Extension for Visual Studio Code
usamik26
2
760
Other Decks in Programming
See All in Programming
Elm 0.19.0 Changes
bkuhlmann
0
490
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
350
GitHub Copilotのススメ
marcy731
1
200
Kotlin Multiplatform at Stable and Beyond (Android Makers 2024)
zsmb
0
320
Rubyでたのしむクリエイティブコーディング/Enjoy Creative coding with Ruby
chobishiba
1
210
雑に思考を整理する技術と効能
konifar
60
29k
Ruby Function Composition
bkuhlmann
1
330
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
110
使ってみよう Azure AI Document Intelligence
kosmosebi
2
330
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
800
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
170
GraphQLサーバの構成要素を整理する #ハッカー鮨 #tsukijigraphql / graphql server technology selection
izumin5210
4
870
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
689
190k
Clear Off the Table
cherdarchuk
84
310k
10 Git Anti Patterns You Should be Aware of
lemiorhan
648
58k
Scaling GitHub
holman
457
140k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
2
1.3k
The Language of Interfaces
destraynor
151
23k
Building Effective Engineering Teams - LeadDev
addyosmani
28
1.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
14
1.6k
It's Worth the Effort
3n
180
27k
Teambox: Starting and Learning
jrom
128
8.4k
Fireside Chat
paigeccino
21
2.6k
Practical Orchestrator
shlominoach
182
9.7k
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