KeenClient-iOS
KeenClient-iOS copied to clipboard
Clean up KeenClient interface
There are a few items on KeenClient that shouldn't be exposed in KeenClient.h:
- -runQuery, which is marked as for testing only, so should be in a test category
- -runMultiAnalysisWithQueries, also should be in a test category
- +clearAllQueries
- +getDBStore
- +clearAllEvents
They should be removed for the next major release.
runAsyncQuery:block: should be renamed runAsyncQuery:completion: or something better. Same goes for runAsyncMultiAnalysisWithQueries:block:.
Should evaluate how shared client initialization is done and look for ways to improve it. Configuration and fetching of the shared client object should be separate things. Perhaps the client should provide a configuration object to be used for the shared client, or maybe implement a delegate object that provides a shared client configuration.
This documentation is wrong in KeenClient.h, sharedClient:
@return A managed instance of KeenClient, or nil if you haven't called [KeenClient
sharedClientWithProjectID:andWriteKey:andReadKey:].
If ID's and keys haven't been provided, it'll return a client that doesn't have any of those values set.
As mentioned in #226, would be nice to have overloads of KeenClient int that don't require nil passed in for optional parameters. Obj-C doesn't make this very fun, though maybe there's a way to mark the parameters as optional for Swift only?