realm

How do I show 2 different color dots for a date using FSCalendar?

一个人想着一个人 提交于 2021-02-10 23:40:43
问题 Beginner programmer here. I am trying to show two different color dots if there is a negative AND a positive transaction for that date. Here is my code. It only shows one dot. func calendar(_ calendar: FSCalendar, numberOfEventsFor date: Date) -> Int { let incomeTransaction = realm.objects(Transaction.self).filter(positiveTransactionPredicate(date: date)) let expenseTransaction = realm.objects(Transaction.self).filter(negativeTransactionPredicate(date: date)) for _ in incomeTransaction {

How do I show 2 different color dots for a date using FSCalendar?

落花浮王杯 提交于 2021-02-10 23:40:23
问题 Beginner programmer here. I am trying to show two different color dots if there is a negative AND a positive transaction for that date. Here is my code. It only shows one dot. func calendar(_ calendar: FSCalendar, numberOfEventsFor date: Date) -> Int { let incomeTransaction = realm.objects(Transaction.self).filter(positiveTransactionPredicate(date: date)) let expenseTransaction = realm.objects(Transaction.self).filter(negativeTransactionPredicate(date: date)) for _ in incomeTransaction {

Realm: Migrating from ObjC to Swift

点点圈 提交于 2021-02-10 12:54:18
问题 I have an app written in ObjC. I've chosen Realm as my DataBase. I would like to start migrating some parts of my app to Swift. When getting to Realm I get confused. There are two pods . From what I understood from the docs, RealmSwift is for pure Swift projects, right? But, is it possible to migrate model classes to Swift without the RealmSwift pod ? 回答1: As I understand it, Realm Swift isn't exclusive for pure Swift projects, but if you do use it in an iOS app, you can't make any calls to

RealmList serialization issues (Realm/Gson/Intent)

試著忘記壹切 提交于 2021-02-08 13:33:45
问题 I use Retrofit, Gson and Realm in my project. I have this class Example that need to be Serializable . Without Realm I'd write it like that : public class Example implements Serializable { @SerializationName("users") private List<String> users //... getters and setters } Realm comes into play and Example becomes (note that getters and setters are this way for compatibility reasons) : public class Example extends RealmObject implement Serializable { @SerializedName("users") private RealmList

Database for storing data after app is killed in React Native

可紊 提交于 2021-02-08 10:12:36
问题 I am making a React native app, with native services to scan for devices nearby. It works fine when the app is in foreground, but when the app is killed and the service detects a device, it wakes up the React Native part of app by headless JS and makes an API call using redux action, but it cannot store the data received from API call in reducer data. I can't user AsyncStorage as the data is big and a JSON. How do I persist this data so that when the app is started, the users can see the data

Database for storing data after app is killed in React Native

允我心安 提交于 2021-02-08 10:10:27
问题 I am making a React native app, with native services to scan for devices nearby. It works fine when the app is in foreground, but when the app is killed and the service detects a device, it wakes up the React Native part of app by headless JS and makes an API call using redux action, but it cannot store the data received from API call in reducer data. I can't user AsyncStorage as the data is big and a JSON. How do I persist this data so that when the app is started, the users can see the data

How to store a System.Collections.Generic.Dictionary in realm-dotnet

旧时模样 提交于 2021-02-08 04:41:05
问题 I m trying to integrate Realm .NET in my uwp project and I would like to know if there is any way to store a System.Collections.Generic.Dictionary in realm-dotnet base. I tried this : public class Training : RealmObject { public int Id { get; set; } public int Id_document { get; set; } public IDictionary<string, string> Names { get; set;} } But I m getting this error : Error Fody/RealmWeaver: Training.Name is a 'System.Collections.Generic.IDictionary`2' which is not yet supported. Thanks for

RealmSwift initialize list : Cannot specialize a non-generic definition

房东的猫 提交于 2021-02-07 20:27:09
问题 Hi I have an exception like "Cannot specialize a non-generic definition" when i'm trying to initialize List in Realm object. Does anyone know how to fix this issue? swift 3.2 class Dog: Object { @objc dynamic var name = "" @objc dynamic var age = 0 } class Event : Object{ dynamic var event_id = 0 dynamic var date : String? dynamic var name : String? dynamic var remind : Remind? dynamic var event_status = 0 let dogs = List<Dog>() "Cannot specialize a non-generic definition" required

RealmSwift initialize list : Cannot specialize a non-generic definition

馋奶兔 提交于 2021-02-07 20:25:54
问题 Hi I have an exception like "Cannot specialize a non-generic definition" when i'm trying to initialize List in Realm object. Does anyone know how to fix this issue? swift 3.2 class Dog: Object { @objc dynamic var name = "" @objc dynamic var age = 0 } class Event : Object{ dynamic var event_id = 0 dynamic var date : String? dynamic var name : String? dynamic var remind : Remind? dynamic var event_status = 0 let dogs = List<Dog>() "Cannot specialize a non-generic definition" required

How to get the index in Results of a certain Realm object?

梦想的初衷 提交于 2021-02-07 19:14:30
问题 Here is an example. class Person: Object { dynamic var id dynamic var name } // does this work? let sortedPeople = realm.objects(Person).sorted("id") let Dave = realm.objects(Person).filter("id=5") // at what index does Dave reside in sortedPeople? The reason I need to find out about this is coz I have a UITableView that is set to the sortedPeople, but I need to store the last visible row viewed. The sortedPeople array changes frequently. So, if I can find out the index in the sortedPeople of