地址:
https://github.com/caixindong/Running-Life---iOS
功能
. 动态绘制跑步路径
. 智能判别跑步状态
. 记录跑步数据生成分享小卡片、微信分享
. 条形图展示消耗卡路里
技术
. MVVM架构
. 基于高德地图实现动态绘制轨迹
. CMMotionManager判断跑步状态
. 贝塞尔曲线与帧动画
. CoreData
. HealthKit
- #import <Foundation/Foundation.h>
- #import "Run.h"
- @interface ResultViewModel : NSObject
- /**
- * 跑步距离
- */
- @property (nonatomic, copy, readonly) NSString *distanceLabelText;
- /**
- * 跑步时间
- */
- @property (nonatomic, copy, readonly) NSString *timeLabelText;
- /**
- * 跑步步数
- */
- @property (nonatomic, copy, readonly) NSString *paceLabelText;
- /**
- * 卡路里
- */
- @property (nonatomic, copy, readonly) NSString *kcalLableText;
- /**
- * 消耗鸡腿数
- */
- @property (nonatomic, copy, readonly) NSString *countLabelText;
- /**
- * 运动轨迹(不同颜色)
- */
- @property (nonatomic, copy, readonly) NSArray *colorSegmentArray;
- /**
- * 地图显示区域
- */
- @property (nonatomic, assign, readonly) MKCoordinateRegion region;
- /**
- * 跑步排名
- */
- @property (nonatomic, copy, readonly) NSString *rank;
- /**
- * 网络失败
- */
- @property (nonatomic, strong, readonly) NSNumber *netFail;
- /**
- * 构造器
- *
- * @param run 跑步记录
- *
- * @return
- */
- - (instancetype)initWithRunModel:(Run *)run;
- /**
- * 上传跑步记录并获取排名
- */
- - (void)postRunRecordToServerAndGetRank;
- /**
- * 仅仅获取获取跑步排名
- */
- - (void)getRank;
- @end
来源: https://www.oschina.net/code/snippet_2881894_58550