Added documentation to the init methods#96
Conversation
| if let name = name { | ||
| self.name = name | ||
| } else { | ||
| self.name = "FunctionalCollectionDataRenderAndDiff-\((#file as NSString).lastPathComponent):\(#line)" |
There was a problem hiding this comment.
Suggestions to change these #file and #line to something else? Obviously outside of the init they won't work. But as parameters they are also pretty strange
"FunctionalCollectionDataRenderAndDiff-\(UUID().uuidString)" maybe? although not very useful for debugging.
There was a problem hiding this comment.
Thoughts @g-Off ? I used the UUID, but I don't know if the line and number where useful at some point
There was a problem hiding this comment.
UUID is even less useful. The file/line params indicate the creator of the instance of FunctionalTableData making it easier to trace back which instance may be generating a crash/exception
There was a problem hiding this comment.
In that case I think we should drop both then. Use the name only, there is no value in both
There was a problem hiding this comment.
Might be able to change this to name: String = "FunctionalCollectionDataRenderAndDiff-\(#file):\(#line)", which would give it a valid name all of the time and when one isn't provided would keep the file/line pairing
There was a problem hiding this comment.
Hmmmm apparently that doesn't work either, they have to be in their own argument to get the reference from the caller. Otherwise this
public init(name: String = "FunctionalTableDataRenderAndDiff-\((#file as NSString).lastPathComponent):\(#line)")becomes, this
(lldb) po name
"FunctionalTableDataRenderAndDiff-FunctionalTableData.swift:144"There was a problem hiding this comment.
Haha, sure why not, makes total sense 🤔 🙅♂️
Just the optional string name makes sense then. Although, why the desire to remove them? So they don't need to be documented?
There was a problem hiding this comment.
No real reason apart from when I was documenting I went “hmmm what is this and why should someone care about these weird arguments”
I can put them back and not document them I gues. Best of both worlds?
|
Bonus round adds documentation for UIScrollView methods |
Added documentation to the init methods, also removed those parameters. We may need to apply different default values
Also moved the example files into several groups for easier navigation