CE/splits

keep track of current split and previous split.  not yet added to UI.  
on Wednesday you thought it would be good to create a Split Calculator
rather than do the work in the odometer class and liked initializing a
split calculator with an odometer so that's what i did.

On Mon, Dec 1, 2014 at 10:50 AM, Fabian <notifications@github.com> wrote:

> In RandomRun/Navigation/SplitCalculator.h:
>
> > +#import "Odometer.h"
> > +
> > +#import <Foundation/Foundation.h>
> > +
> > +typedef NS_ENUM(NSUInteger, SplitUnit) {
> > +    KilometerSplits,
> > +    MileSplits,
> > +};
> > +
> > +@interface SplitCalculator : NSObject
> > +@property (nonatomic, readonly) NSTimeInterval currentSplit; // seconds per meter
> > +@property (nonatomic, readonly) NSTimeInterval previousSplit; // seconds per meter
> > +
> > ++ (instancetype)new NS_UNAVAILABLE;
> > +- (instancetype)init NS_UNAVAILABLE;
> > +- (instancetype)initWithOdometer:(Odometer *)odometer splitUnit:(SplitUnit)splitUnit NS_DESIGNATED_INITIALIZER;
>
> An odometer doesn't expose any public interface that appears to be useful
> to a splits calculator. Meaning that the splits calculator either doesn't
> need an odometer, or is entangled with private implementation details of
> the odometer. Neither of those options are good.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mojotech/random-run/pull/52/files#r21096565>.
>