liyanhuadev / objectmapper-plugin Goto Github PK
View Code? Open in Web Editor NEWa xcode plug-in for generating mapping
License: MIT License
a xcode plug-in for generating mapping
License: MIT License
'UTF16Index' is not a member type of 'String'
`import Cocoa
import ObjectMapper
class TestOb: NSObject , Mappable {
var testVar:String?
var testSS:Int?
required init?(map: Map) {
}
func mapping(map: Map) {
}
}
`
I run the plugin, write down a custom class, nothing happen there , only two funcs added there. what's the matter?
可否给个安装说明
need mac sign
According to the documentation of the ObjectMapper
(https://github.com/Hearst-DD/ObjectMapper), and my own findings, optional properties should be parsed from JSON -> Model with try?
instead of just try
, else the whole init of the object will fail.
So e.g. if the name
property is optional then it should be:
init(map: Map) throws {
name = try? map.value("name") // optional
}
According to the documentation: https://github.com/Hearst-DD/ObjectMapper#immutablemappable-protocol-beta
The syntax should be >>>
instead of <-
in the mapping(map: Map)
function:
mutating func mapping(map: Map) {
id >>> map["id"]
name >>> map["name"]
}
Hi,
Thanks for developing this plugin. I don't have a Mac developer a/c and I'm not able to build this project on my Xcode.
How can I install this plugin without building the plugin myself?
Installed successfully,but this plugin just add:
required init?(map: Map) {
}
func mapping(map: Map) {
}
these two empty functions without any convert code in them, not sure if this is a bug or I did something wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.