Skip to content

Commit

Permalink
Minor improvements and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arturdev committed Mar 12, 2020
1 parent 9f25a55 commit c65f3f9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
16 changes: 16 additions & 0 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

4 changes: 2 additions & 2 deletions Unrealm.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
4 changes: 2 additions & 2 deletions Unrealm/Classes/Swift/Unrealm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ fileprivate func convert<T: NSObject>(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
Expand All @@ -390,7 +390,7 @@ fileprivate func convert<T: NSObject>(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)
Expand Down

0 comments on commit c65f3f9

Please sign in to comment.