NijiDigital / gyro

Tool to generate Realm.io models for Swift, Java & ObjC from xcdatamodel and its visual Xcode editor
Apache License 2.0
93 stars 15 forks source link

Refact enum property name #65

Open StevenWatremez opened 6 years ago

StevenWatremez commented 6 years ago

Currently enums have Enum suffix. This issue is about removing Suffix on Enum types and adding rawValue suffix.

// Before
var toto: String
var totoEnum: Toto { /*…*/ }

// After
var totoRawValue: String
var toto: Toto { /*…*/ }
StevenWatremez commented 6 years ago

We could provide migration templates (in 2 steps?) with Deprecated attributes to help renaming.

// Migration template 1
var totoRawValue: String
@available(*, deprecated, renamed: "totoRawValue")
var toto: String { return totoRawValue }
var totoEnum: Toto { /* … */ }
// Migration template 2
var totoRawValue: String
var toto: Toto { /* … */ }
@available(*, deprecated, renamed: "toto")
var totoEnum: Toto { return toto }