bradhilton / SwiftKVC

Key-Value Coding (KVC) for native Swift classes and structs
MIT License
134 stars 22 forks source link

Better inline documentation #1

Closed gilesvangruisen closed 7 years ago

gilesvangruisen commented 8 years ago

This is slick! Very clever. I'd love to see some more inline documentation, particularly on Model.swift

bradhilton commented 7 years ago

I now let all the reflection logic be handled by another project I manage, Reflection, so there's really nothing to document here inline.

eonist commented 7 years ago

@gilesvangruisen @bradhilton Inline doc for Reflection then 😁 Trying to upgrade your lib to swift 4. Failing hard! 😅

bradhilton commented 7 years ago

@eonist Yeah, I haven't had a chance to upgrade reflection to Swift 4 yet. If you want to dig in and let me know where it's crashing that'd be awesome.

eonist commented 7 years ago

@bradhilton I gave up. Reading data worked. Setting data with subscript didn't. It broke in the Set.swift class in line 5. Setting data with subscript would be so awesome! So I will attempt again tomorrow with XCode 8 and see if I can figure out the diff.

But yeah, Inline documentation would help a lot for "future on lookers" when upgrading to swift 5 ...6 etc When the swift lang changes again and your lib breaks. Because It will break as your API is pretty "hard core" and not something we deal with everyday. So If you comment your intent and "gotchas" etc it would be easier to cross reference online information and fix future problems. AKA: more useable. Right now I'm reluctant to implement it as is. Id probably rewrite the whole thing so I had intimate knowledge and documentation for future breaks.

That being said. Got damn. Great job. I bet apple is using something similar in their Decodable protocol in swift4. 👍

bradhilton commented 7 years ago

Yeah it's growing long in the tooth, probably time for a rewrite. :)

eonist commented 7 years ago

@bradhilton I have to postpone digging deeper into your amazing reflection lib. I have my own humble reflection lib: https://github.com/gitsync/ReflectionLib It can't do the setValue trickery that yours can. So I will just have to live with that until I get fed up with writing all these extensions for every type I need to work with.

Anyways, Ill probably be back sooner rather than later ✌️

bradhilton commented 7 years ago

@eonist Updated this library and Reflection for Swift 4

eonist commented 7 years ago

@bradhilton Going to test tonight!