Can't create custom `SortFunction`s
zackdotcomputer opened this issue · 1 comments
zackdotcomputer commented
The current setup of SortFunction.swift
makes it impossible to create custom instances of SortFunction
s because:
SortFunction
is public, implying that the intention is that developers should be able to conform to it and create custom sorts.SortFunction
requires two functions, each of which are expected to return[TimedView]
.- However,
TimedView
has two properties, each of which have no access modifiers (and so default tointernal
), and which has noinit
method (and so one is autogenerated and defaults tointernal
). - Because
TimedView
'sinit
and properties are allinternal
, they can't be viewed from outside of the compiled target and, thus, it is impossible to construct a new instance of aTimedView
. This means it's impossible to make one to return from the required functions and so it is impossible to actually subclassSortFunction
.
I recommend we create a public init method for this struct to fix this issue. I'll submit a PR shortly to do that.
zackdotcomputer commented
Resolved by merging of #109 - thanks @eriklamanna