From a37f086a52f4416152c00614e9fc3f3f78dba1e1 Mon Sep 17 00:00:00 2001 From: Artur Mkrtchyan Date: Thu, 20 Jan 2022 14:26:31 +0400 Subject: [PATCH] Fixed build error with Realm v10.21.0 --- Unrealm.podspec | 2 +- Unrealm/Classes/Swift/Results.swift | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Unrealm.podspec b/Unrealm.podspec index e45a119..9b487fc 100755 --- a/Unrealm.podspec +++ b/Unrealm.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |s| s.name = 'Unrealm' s.swift_version = '5.5' - s.version = '1.9.3' + s.version = '1.9.4' s.summary = 'Unrealm is an extension on RealmCocoa, which enables Swift native types to be saved in Realm.' s.description = <<-DESC Unrealm enables you to easily store Swift native Classes, Structs and Enums into Realm. diff --git a/Unrealm/Classes/Swift/Results.swift b/Unrealm/Classes/Swift/Results.swift index 3834d92..1a33346 100644 --- a/Unrealm/Classes/Swift/Results.swift +++ b/Unrealm/Classes/Swift/Results.swift @@ -148,7 +148,7 @@ extension Results { - parameter property: The name of a property whose minimum value is desired. */ - public func min(ofProperty property: String) -> T? { + public func min(ofProperty property: String) -> T? where T.PersistedType: MinMaxType { return rlmResult.min(ofProperty: property) } @@ -159,7 +159,7 @@ extension Results { - parameter property: The name of a property whose minimum value is desired. */ - public func max(ofProperty property: String) -> T? { + public func max(ofProperty property: String) -> T? where T.PersistedType: MinMaxType { return rlmResult.max(ofProperty: property) } @@ -170,7 +170,7 @@ extension Results { - parameter property: The name of a property whose values should be summed. */ - public func sum(ofProperty property: String) -> T { + public func sum(ofProperty property: String) -> T where T.PersistedType: AddableType { return rlmResult.sum(ofProperty: property) } @@ -181,7 +181,7 @@ extension Results { - parameter property: The name of a property whose average value should be calculated. */ - public func average(ofProperty property: String) -> T? { + public func average(ofProperty property: String) -> T? where T.PersistedType: AddableType { return rlmResult.average(ofProperty: property) } }