mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-14 07:33:28 +01:00
How to create a func() to build OrderBy clauses #385
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @appfabtech on GitHub (Apr 13, 2022).
Hello, and thanks for the great library
I would like to create a function to avoid duplicate code in sort selection (having a table view with 4 different sort asc/desc
like
func buildSort(section: Section, sort: Sort, sortAscending: Bool) -> OrderBy
But I have issues on how to define in function declaration the -> OrderBy return parameter
Any help?
Thanks
@JohnEstropia commented on GitHub (Sep 29, 2022):
OrderByis a generic type, so you'll have to parameterize the object type:(assuming
SectionandSortthere are your app's internal types)