bradhilton / SwiftKVC

Key-Value Coding (KVC) for native Swift classes and structs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better inline documentation

gilesvangruisen opened this issue · comments

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

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

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

@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.

@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. 👍

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

@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 ✌️

@eonist Updated this library and Reflection for Swift 4

@bradhilton Going to test tonight!