From c65f3f9fec9737c7b15ead5d7377e3668f0b3145 Mon Sep 17 00:00:00 2001 From: Artur Mkrtchyan Date: Fri, 13 Mar 2020 00:05:56 +0400 Subject: [PATCH] Minor improvements and fixes --- Example/Podfile | 16 ++++++++++++++++ Unrealm.podspec | 4 ++-- Unrealm/Classes/Swift/Unrealm.swift | 4 ++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Example/Podfile b/Example/Podfile index c0afd89..0645cb3 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -18,3 +18,19 @@ target 'Example with Abstraction' do end end + +post_install do |installer| + installer.pods_project.targets.each do |target| + + #Fixing compile warning caused by CRuntime dependency + if target.name == 'CRuntime' + source_files = target.source_build_phase.files + dummy = source_files.find do |file| + file.file_ref.name == 'module.modulemap' + end + source_files.delete dummy + puts "Deleting source file #{dummy.inspect} from target #{target.inspect}." + end + end +end + diff --git a/Unrealm.podspec b/Unrealm.podspec index 5d1a1a2..2942ea3 100755 --- a/Unrealm.podspec +++ b/Unrealm.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |s| s.name = 'Unrealm' s.swift_version = '5.1' - s.version = '1.0.4' + s.version = '1.0.5' 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. @@ -36,5 +36,5 @@ Getting rid of boilerplate code such @objc dynamic var. Use just var or let # s.public_header_files = 'Pod/Classes/**/*.h' s.dependency 'RealmSwift', '4.3.2' - s.dependency 'Runtime', '2.1.0' + s.dependency 'Runtime', '2.1.1' end diff --git a/Unrealm/Classes/Swift/Unrealm.swift b/Unrealm/Classes/Swift/Unrealm.swift index fc6e09b..56d4b2e 100644 --- a/Unrealm/Classes/Swift/Unrealm.swift +++ b/Unrealm/Classes/Swift/Unrealm.swift @@ -373,7 +373,7 @@ fileprivate func convert(val: Any, to objectType: T.Type) -> AnyObj let value = $0.value if value is RealmableBase { guard let className = propertyClassName(label, objectType) else {return} - let fullClassName = objectsAndRealmables.keys.first(where: {$0.contains(className)}) ?? className + let fullClassName = objectsAndRealmables.keys.first(where: {$0 == className}) ?? className guard let c = NSClassFromString(fullClassName) as? NSObject.Type else {return} if let opt = value as? OptionalPrtc, (opt.val is NSNull) { return @@ -390,7 +390,7 @@ fileprivate func convert(val: Any, to objectType: T.Type) -> AnyObj values.forEach({value in if value is RealmableBase { guard let className = realmArray.objectClassName else {return} - let fullClassName = objectsAndRealmables.keys.first(where: {$0.contains(className)}) ?? className + let fullClassName = objectsAndRealmables.keys.first(where: {$0 == className}) ?? className guard let c = NSClassFromString(fullClassName) as? NSObject.Type else {return} if let o = convert(val: value, to: c) { realmArray.add(o)