Closed NathanFlurry closed 8 years ago
@nbransby I just used some find + replace + a tad of regex magic in Xcode.
As for code styling, I'd highly suggest taking a look at this styling guide. Just some quick feedback from what I saw was generated from crossrails:
parameterName: Type
(not parameterName :Type
) for functions, variable definitions, etc..try!
in Swift, since you can't catch those error with do { } catch { }
(aka the app will crash entirely if it fails). Either return an optional type if the operation failed or throw/rethrow the error. The same applies for implicitly unwrapped variables, always try to make them optional values if possible. Attempting to access a nil value in an implicitly unwrapped optional will throw an uncatchable error.simpleObject.swift
should be SimpleObject.swift
===
operator if you're trying to compare the object reference. If your'e trying to compare the object's values, you'll have to implement it manually.enum
for the message type in SpecialException
. It'll make your life easier if you try and localize or create a standardized error code register.Otherwise, it looks like a very promising project.
Just a thought, maybe we should run something like SwiftLint on the results to check for this kind of thing?
Thanks for the feedback @NathanFlurry, I've finally found the time to act on it.
The other points you mentioned are by design and are moviated to match the orginal JS source:
Hey thanks Nathan, this is great. I had not had the chance to update to latest beta.
Re the formatting, did you use a formatter in an IDE to do it? Would like to make sure the complier is also outputting best practice formatted Swift.