From 6a9098a4471f197e110c9f8e817849b16fda7efa Mon Sep 17 00:00:00 2001 From: Shiva Kumar Ponnuraj Date: Tue, 10 Jul 2018 17:29:44 +0530 Subject: [PATCH] Fixed Version and Export As Menu Button StoryBoard Issue, Modified the Swift Content Generator to include "objcMembers" and changed deprecated "flatMap" to "CompactMap" --- RealmModelGenerator/AttributeDetailView.swift | 2 +- RealmModelGenerator/Base.lproj/Main.storyboard | 12 ++++++------ RealmModelGenerator/SwiftContentGenerator.swift | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/RealmModelGenerator/AttributeDetailView.swift b/RealmModelGenerator/AttributeDetailView.swift index 4ed4821..27596c9 100644 --- a/RealmModelGenerator/AttributeDetailView.swift +++ b/RealmModelGenerator/AttributeDetailView.swift @@ -36,7 +36,7 @@ class AttributeDetailView: NibDesignableView, NSTextFieldDelegate { override func nibDidLoad() { super.nibDidLoad() self.attributeTypePopUpButton.removeAllItems() - self.attributeTypePopUpButton.addItems(withTitles: AttributeType.values.flatMap({$0.rawValue})) + self.attributeTypePopUpButton.addItems(withTitles: AttributeType.values.compactMap({$0.rawValue})) } @IBInspectable var name:String { diff --git a/RealmModelGenerator/Base.lproj/Main.storyboard b/RealmModelGenerator/Base.lproj/Main.storyboard index 98a50ea..c94333b 100644 --- a/RealmModelGenerator/Base.lproj/Main.storyboard +++ b/RealmModelGenerator/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - + - + @@ -91,19 +91,19 @@ - + - + - + @@ -112,7 +112,7 @@ - + diff --git a/RealmModelGenerator/SwiftContentGenerator.swift b/RealmModelGenerator/SwiftContentGenerator.swift index 8ce6ce7..34e5d8a 100644 --- a/RealmModelGenerator/SwiftContentGenerator.swift +++ b/RealmModelGenerator/SwiftContentGenerator.swift @@ -34,8 +34,8 @@ class SwiftContentGenerator: BaseContentGenerator { content += getHeaderComments(entity: entity, fileExtension: "swift") content += "import RealmSwift\n\n" - content += "class " + entity.name + ": \(entity.superEntity?.name ?? "Object") {\n" - content += "\tstatic let TAG = NSStringFromClass(" + entity.name + ");\n" + content += "@objcMembers " + "class " + entity.name + ": \(entity.superEntity?.name ?? "Object") {\n" + content += "\tstatic let TAG = NSStringFromClass(" + entity.name + ".self" + ");\n" } // MARK: - Append RealmKeys