Skip to content

Instantly share code, notes, and snippets.

@jsclayton
Created December 7, 2014 00:18
Show Gist options
  • Save jsclayton/5a14cfb8b5fdcfb0e331 to your computer and use it in GitHub Desktop.
Save jsclayton/5a14cfb8b5fdcfb0e331 to your computer and use it in GitHub Desktop.
class Load: RLMObject {
dynamic var localIdentifier: String?
dynamic var name: String? = ""
dynamic var loadDescription: String? = ""
dynamic var weapon: Weapon? = nil
dynamic var bullet: Bullet? = nil
dynamic var powder: Powder? = nil
dynamic var brass: Brass? = nil
dynamic var primer: Primer? = nil
dynamic var overallLength: Float = 0.0
dynamic var comparatorLength: Float = 0.0
dynamic var trimLength: Float = 0.0
dynamic var powderCharge: Float = 0.0
}
extension Load: FXForm {
func fields() -> [AnyObject]! {
return [
"name",
"loadDescription",
"weapon",
"bullet",
"powder",
"brass",
"primer",
"overallLength",
"comparatorLength",
"trimLength",
"powderCharge"
]
}
func bulletField() -> NSDictionary {
return [ FXFormFieldHeader: "Components" ]
}
func loadDescriptionField() -> NSDictionary {
return [ FXFormFieldTitle: "Description", FXFormFieldType: FXFormFieldTypeLongText ]
}
func overallLengthField() -> NSDictionary {
return [ FXFormFieldHeader: "Measurements" ]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment