Commit 3cd351da authored by leijunbo's avatar leijunbo

新加红包兑换

parent 279e3c89
//
// CTDiskCacheCenter.m
// Open
//
// Created by 雷俊博 on 2019/8/26.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import "CTDiskCacheCenter.h"
NSString * const kCTDiskCacheCenterCachedObjectKeyPrefix = @"kCTDiskCacheCenterCachedObjectKeyPrefix";
@implementation CTDiskCacheCenter
+ (id)fetchCachedRecordWithKey:(NSString *)key
{
NSString *actualKey = [NSString stringWithFormat:@"%@%@",kCTDiskCacheCenterCachedObjectKeyPrefix, key];
id response = nil;
NSData *data = [[NSUserDefaults standardUserDefaults] dataForKey:actualKey];
if (data) {
NSDictionary *fetchedContent = [NSJSONSerialization JSONObjectWithData:data options:0 error:NULL];
NSNumber *lastUpdateTimeNumber = fetchedContent[@"lastUpdateTime"];
NSDate *lastUpdateTime = [NSDate dateWithTimeIntervalSince1970:lastUpdateTimeNumber.doubleValue];
NSTimeInterval timeInterval = [[NSDate date] timeIntervalSinceDate:lastUpdateTime];
if (timeInterval < [fetchedContent[@"cacheTime"] doubleValue]) {
response = fetchedContent[@"content"];
} else {
[[NSUserDefaults standardUserDefaults] removeObjectForKey:actualKey];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
return response;
}
+ (void)saveCacheWithResponse:(id)response key:(NSString *)key cacheTime:(NSTimeInterval)cacheTime
{
if (response) {
NSData *data = [NSJSONSerialization dataWithJSONObject:@{
@"content":response,
@"lastUpdateTime":@([NSDate date].timeIntervalSince1970),
@"cacheTime":@(cacheTime)
}
options:0
error:NULL];
if (data) {
NSString *actualKey = [NSString stringWithFormat:@"%@%@",kCTDiskCacheCenterCachedObjectKeyPrefix, key];
[[NSUserDefaults standardUserDefaults] setObject:data forKey:actualKey];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
}
+ (void)cleanAll
{
NSDictionary *defaultsDict = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
NSArray *keys = [[defaultsDict allKeys] filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF beginswith[c] %@", kCTDiskCacheCenterCachedObjectKeyPrefix]];
for(NSString *key in keys) {
[[NSUserDefaults standardUserDefaults] removeObjectForKey:key];
}
[[NSUserDefaults standardUserDefaults] synchronize];
}
@end
//
// Home3MiddleBannerCell.h
// Open
//
// Created by 雷俊博 on 2019/8/27.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@protocol MiddleBannerViewCellDelegate <NSObject>
- (void)selectedItemCell:(NSInteger)index;
@end
@interface Home3MiddleBannerCell : UITableViewCell
@property (nonatomic, weak)id<MiddleBannerViewCellDelegate> delegate;
@end
NS_ASSUME_NONNULL_END
//
// Home3MiddleBannerCell.m
// Open
//
// Created by 雷俊博 on 2019/8/27.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import "Home3MiddleBannerCell.h"
#import "PDBannerView.h"
@interface Home3MiddleBannerCell ()<PDBannerViewDelegate>
@property (nonatomic, strong)PDBannerView *bannerView;
@property (nonatomic, strong)NSMutableArray *dataArray;
@end
@implementation Home3MiddleBannerCell
#pragma mark - life cycle
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self addSubview:self.bannerView];
}
return self;
}
#pragma mark - PDBannerViewDelegate
- (void)selectImage:(PDBannerView *)bannerView currentImage:(NSInteger)currentImage
{
NSLog(@"中间广告点击图片索引%ld",(long)currentImage);
if (self.delegate && [self.delegate respondsToSelector:@selector(selectedItemCell:)]) {
[self.delegate selectedItemCell:currentImage];
}
}
#pragma mark - public methods
#pragma mark - getters and setters
- (PDBannerView *)bannerView
{
if (!_bannerView) {
UIImage *image = [UIImage imageNamed:@"190123-微保乘驾险-V2.png"];
float width = image.size.width;
float height = image.size.height;
float widthProportion = ScreenWidth / width;
_bannerView = [[PDBannerView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, height * widthProportion) andImageArray:self.dataArray];
_bannerView.delegate = self;
}
return _bannerView;
}
- (NSMutableArray *)dataArray
{
if (!_dataArray) {
NSArray *imageNamesArray = @[@"middleBanner",@"190123-微保乘驾险-V2",@"airInsurance"];
_dataArray = [[NSMutableArray alloc]initWithArray:imageNamesArray];
}
return _dataArray;
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// OfficialAccountsAlertView.h
// Open
//
// Created by 雷俊博 on 2019/8/20.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef void(^clickActionBlock) (BOOL);
@interface OfficialAccountsAlertView : UIView
@property (nonatomic, copy) clickActionBlock block;
@end
NS_ASSUME_NONNULL_END
//
// OfficialAccountsAlertView.m
// Open
//
// Created by 雷俊博 on 2019/8/20.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import "OfficialAccountsAlertView.h"
#import "Constants.h"
#import "UIColor+Hex.h"
@interface OfficialAccountsAlertView ()
@property (nonatomic, strong)UILabel *lb_title;
@property (nonatomic, strong)UIImageView *img_message;
@property (nonatomic, strong)UIButton *btn_click;
@property (nonatomic, assign)BOOL show;
@end
@implementation OfficialAccountsAlertView
#pragma mark - life cycle
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self addSubview:self.lb_title];
[self addSubview:self.img_message];
[self addSubview:self.btn_click];
self.show = YES;
[self setupUI];
}
return self;
}
- (void)setupUI
{
[self.lb_title mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.offset(16 * WIDTHRADIU);
make.centerX.equalTo(self);
make.height.offset(15 * WIDTHRADIU);
}];
UIImage *image = [UIImage imageNamed:@"TencentTask"];
CGFloat scale = image.size.height/image.size.width;
[self.img_message mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.lb_title.mas_bottom).offset(16 * WIDTHRADIU);
make.centerX.equalTo(self);
make.width.offset(250 * WIDTHRADIU);
make.height.offset(250 * WIDTHRADIU * scale);
}];
[self.btn_click mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.img_message.mas_bottom).offset(20 * WIDTHRADIU);
make.width.offset(230 * WIDTHRADIU);
make.centerX.equalTo(self);
make.height.offset(40 * WIDTHRADIU);
}];
}
#pragma mark - event response
- (void)btnClick:(UIButton *)sender
{
if (self.block) {
self.block(self.show);
}
}
#pragma mark - getters and setters
- (UILabel *)lb_title
{
if (!_lb_title) {
_lb_title = [[UILabel alloc]init];
_lb_title.text = @"公众号账号:看看社保";
_lb_title.font = [UIFont boldSystemFontOfSize:15 * WIDTHRADIU];
_lb_title.textColor = [UIColor colorWithHex:0x4d4d4d];
_lb_title.textAlignment = NSTextAlignmentCenter;
}
return _lb_title;
}
- (UIImageView *)img_message
{
if (!_img_message) {
_img_message = [[UIImageView alloc]init];
_img_message.image = [UIImage imageNamed:@"TencentTask"];
}
return _img_message;
}
- (UIButton *)btn_click
{
if (!_btn_click) {
_btn_click = [UIButton buttonWithType:UIButtonTypeCustom];
_btn_click.backgroundColor = [UIColor colorWithHex:0xfa9504];
[_btn_click setTitle:@"复制账号并关注" forState:UIControlStateNormal];
[_btn_click setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_btn_click.titleLabel.font = [UIFont systemFontOfSize:15 * WIDTHRADIU];
[_btn_click addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
_btn_click.layer.cornerRadius = 20 * WIDTHRADIU;
}
return _btn_click;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
//
// OnFootEarnCoinsViewController.h
// Open
//
// Created by 雷俊博 on 2019/8/29.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface OnFootEarnCoinsViewController : UIViewController
@end
NS_ASSUME_NONNULL_END
//
// CQCountDownButton.h
// CQCountDownButton
//
// Created by CaiQiang on 2017/9/8.
// Copyright © 2017年 caiqiang. All rights reserved.
//
// Repo Detail: https://github.com/CaiWanFeng/CQCountDownButton
// About Author: https://www.jianshu.com/u/4212f351f6b5
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class CQCountDownButton;
@protocol CQCountDownButtonDataSource <NSObject>
@required
// 设置起始倒计时秒数
- (NSUInteger)startCountDownNumOfCountDownButton:(CQCountDownButton *)countDownButton;
@end
@protocol CQCountDownButtonDelegate <NSObject>
@optional
// 倒计时按钮点击回调
- (void)countDownButtonDidClick:(CQCountDownButton *)countDownButton;
// 倒计时开始时的回调
- (void)countDownButtonDidStartCountDown:(CQCountDownButton *)countDownButton;
@required
// 倒计时进行中的回调
- (void)countDownButtonDidInCountDown:(CQCountDownButton *)countDownButton withRestCountDownNum:(NSInteger)restCountDownNum;
// 倒计时结束时的回调
- (void)countDownButtonDidEndCountDown:(CQCountDownButton *)countDownButton;
@end
@interface CQCountDownButton : UIButton
#pragma mark - block版本
/**
所有回调通过block配置
@param duration 设置起始倒计时秒数
@param buttonClicked 倒计时按钮点击回调
@param countDownStart 倒计时开始时的回调
@param countDownUnderway 倒计时进行中的回调
@param countDownCompletion 倒计时结束时的回调
*/
- (void)configDuration:(NSUInteger)duration
buttonClicked:(nullable dispatch_block_t)buttonClicked
countDownStart:(nullable dispatch_block_t)countDownStart
countDownUnderway:(void (^)(NSInteger restCountDownNum))countDownUnderway
countDownCompletion:(dispatch_block_t)countDownCompletion;
#pragma mark - delegate版本
@property (nonatomic, weak, nullable) id <CQCountDownButtonDataSource> dataSource;
@property (nonatomic, weak, nullable) id <CQCountDownButtonDelegate> delegate;
#pragma mark - 开始/结束 倒计时
/**
开始倒计时
*/
- (void)startCountDown;
/**
结束倒计时
倒计时结束时会自动调用此方法
也可以主动调用此方法提前结束倒计时
调用此方法会回调倒计时结束的block和代理方法
*/
- (void)endCountDown;
@end
NS_ASSUME_NONNULL_END
//
// CQCountDownButton.m
// CQCountDownButton
//
// Created by CaiQiang on 2017/9/8.
// Copyright © 2017年 caiqiang. All rights reserved.
//
// Repo Detail: https://github.com/CaiWanFeng/CQCountDownButton
// About Author: https://www.jianshu.com/u/4212f351f6b5
//
#import "CQCountDownButton.h"
#import "NSTimer+CQBlockSupport.h"
@interface CQCountDownButton ()
/** 控制倒计时的timer */
@property (nonatomic, strong) NSTimer *timer;
/** 倒计时按钮点击回调 */
@property (nonatomic, copy) dispatch_block_t buttonClickedBlock;
/** 倒计时开始时的回调 */
@property (nonatomic, copy) dispatch_block_t countDownStartBlock;
/** 倒计时进行中的回调 */
@property (nonatomic, copy) void (^countDownUnderwayBlock)(NSInteger restCountDownNum);
/** 倒计时结束时的回调 */
@property (nonatomic, copy) dispatch_block_t countDownCompletionBlock;
@end
@implementation CQCountDownButton {
/** 倒计时开始值 */
NSInteger _startCountDownNum;
/** 剩余倒计时的值 */
NSInteger _restCountDownNum;
// 使用block(若使用block则不能再使用delegate,反之亦然)
BOOL _useBlock;
// 数据源响应的方法
struct {
BOOL startCountDownNumOfCountDownButton:TRUE;
} _dataSourceRespondsTo;
// 代理响应的方法
struct {
BOOL countDownButtonDidClick:TRUE;
BOOL countDownButtonDidStartCountDown:TRUE;
BOOL countDownButtonDidInCountDown:TRUE;
BOOL countDownButtonDidEndCountDown:TRUE;
} _delegateRespondsTo;
}
#pragma mark - init
// 纯代码init和initWithFrame方法调用
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self addTarget:self action:@selector(p_buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
}
return self;
}
// xib和storyboard调用
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
if (self = [super initWithCoder:aDecoder]) {
[self addTarget:self action:@selector(p_buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
}
return self;
}
#pragma mark - dealloc
// 检验是否释放
- (void)dealloc {
NSLog(@"倒计时按钮已释放");
}
#pragma mark - block版本
/**
所有回调通过block配置
@param duration 设置起始倒计时秒数
@param buttonClicked 倒计时按钮点击回调
@param countDownStart 倒计时开始时的回调
@param countDownUnderway 倒计时进行中的回调
@param countDownCompletion 倒计时结束时的回调
*/
- (void)configDuration:(NSUInteger)duration
buttonClicked:(nullable dispatch_block_t)buttonClicked
countDownStart:(nullable dispatch_block_t)countDownStart
countDownUnderway:(void (^)(NSInteger restCountDownNum))countDownUnderway
countDownCompletion:(dispatch_block_t)countDownCompletion {
if (_dataSource || _delegate) {
[self p_showError];
return;
}
_useBlock = YES;
_startCountDownNum = duration;
self.buttonClickedBlock = buttonClicked;
self.countDownStartBlock = countDownStart;
self.countDownUnderwayBlock = countDownUnderway;
self.countDownCompletionBlock = countDownCompletion;
}
#pragma mark - delegate版本
- (void)setDataSource:(id<CQCountDownButtonDataSource>)dataSource {
if (_useBlock) {
[self p_showError];
return;
}
if (_dataSource != dataSource) {
_dataSource = dataSource;
// 缓存数据源方法是否可以调用
_dataSourceRespondsTo.startCountDownNumOfCountDownButton = [_dataSource respondsToSelector:@selector(startCountDownNumOfCountDownButton:)];
}
_startCountDownNum = [_dataSource startCountDownNumOfCountDownButton:self];
}
- (void)setDelegate:(id<CQCountDownButtonDelegate>)delegate {
if (_useBlock) {
[self p_showError];
return;
}
if (_delegate != delegate) {
_delegate = delegate;
// 缓存代理方法是否可以调用
_delegateRespondsTo.countDownButtonDidClick = [_delegate respondsToSelector:@selector(countDownButtonDidClick:)];
_delegateRespondsTo.countDownButtonDidStartCountDown = [_delegate respondsToSelector:@selector(countDownButtonDidStartCountDown:)];
_delegateRespondsTo.countDownButtonDidInCountDown = [_delegate respondsToSelector:@selector(countDownButtonDidInCountDown:withRestCountDownNum:)];
_delegateRespondsTo.countDownButtonDidEndCountDown = [_delegate respondsToSelector:@selector(countDownButtonDidEndCountDown:)];
}
}
#pragma mark - 开始/结束 倒计时
/** 开始倒计时 */
- (void)startCountDown {
// 因为可以主动调用此方法开启倒计时,不需要点击按钮,所以此处需要将enabled设为no
self.enabled = NO;
if (self.timer) {
[self.timer invalidate];
self.timer = nil;
}
_restCountDownNum = _startCountDownNum;
// 倒计时开始的回调
!self.countDownStartBlock ?: self.countDownStartBlock();
if (_delegateRespondsTo.countDownButtonDidStartCountDown) {
[_delegate countDownButtonDidStartCountDown:self];
}
__weak typeof(self) weakSelf = self;
self.timer = [NSTimer cq_scheduledTimerWithTimeInterval:1 repeats:YES block:^(NSTimer *timer) {
__strong typeof(self) strongSelf = weakSelf;
[strongSelf p_handleCountDown];
}];
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
self.timer.fireDate = [NSDate distantPast];
}
/** 结束倒计时 */
- (void)endCountDown {
if (self.timer) {
[self.timer invalidate];
self.timer = nil;
}
// 重置剩余倒计时
_restCountDownNum = _startCountDownNum;
// 倒计时结束的回调
!self.countDownCompletionBlock ?: self.countDownCompletionBlock();
if (_delegateRespondsTo.countDownButtonDidEndCountDown) {
[_delegate countDownButtonDidEndCountDown:self];
}
// 恢复按钮的enabled状态
self.enabled = YES;
}
#pragma mark - 事件处理
/** 按钮点击 */
- (void)p_buttonClicked:(CQCountDownButton *)sender {
sender.enabled = NO;
!self.buttonClickedBlock ?: self.buttonClickedBlock();
if (_delegateRespondsTo.countDownButtonDidClick) {
[_delegate countDownButtonDidClick:self];
}
}
/** 处理倒计时进行中的事件 */
- (void)p_handleCountDown {
// 调用倒计时进行中的回调
!self.countDownUnderwayBlock ?: self.countDownUnderwayBlock(_restCountDownNum);
if (_delegateRespondsTo.countDownButtonDidInCountDown) {
[_delegate countDownButtonDidInCountDown:self withRestCountDownNum:_restCountDownNum];
}
if (_restCountDownNum == 0) { // 倒计时完成
[self endCountDown];
return;
}
_restCountDownNum --;
}
#pragma mark - 提示错误
- (void)p_showError {
NSAssert(nil, @"不能同时使用block和delegate");
}
@end
//
// NSTimer+CQBlockSupport.h
// CQCountDownButton
//
// Created by caiqiang on 2018/12/5.
// Copyright © 2018年 caiqiang. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSTimer (CQBlockSupport)
+ (NSTimer *)cq_scheduledTimerWithTimeInterval:(NSTimeInterval)interval repeats:(BOOL)repeats block:(void (^)(NSTimer *timer))block;
@end
//
// NSTimer+CQBlockSupport.m
// CQCountDownButton
//
// Created by caiqiang on 2018/12/5.
// Copyright © 2018年 caiqiang. All rights reserved.
//
#import "NSTimer+CQBlockSupport.h"
@implementation NSTimer (CQBlockSupport)
+ (NSTimer *)cq_scheduledTimerWithTimeInterval:(NSTimeInterval)interval repeats:(BOOL)repeats block:(void (^)(NSTimer *timer))block {
return [self scheduledTimerWithTimeInterval:interval target:self selector:@selector(cq_callBlock:) userInfo:[block copy] repeats:repeats];
}
+ (void)cq_callBlock:(NSTimer *)timer {
void (^block)(NSTimer *timer) = timer.userInfo;
!block ?: block(timer);
}
@end
//
// HealthKitManager.m
// Open
//
// Created by 雷俊博 on 2019/8/30.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#define HKVersion [[[UIDevice currentDevice] systemVersion] doubleValue]
#define CustomHealthErrorDomain @"com.sdqt.healthError"
#import "HealthKitManager.h"
@implementation HealthKitManager
+(id)shareInstance{
static id manager ;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
manager = [[[self class] alloc] init];
});
return manager;
}
/*
* @brief 检查是否支持获取健康数据
*/
- (void)authorizeHealthKit:(void(^)(BOOL success, NSError *error))compltion
{
if(HKVersion >= 8.0)
{
if (![HKHealthStore isHealthDataAvailable]) {
NSError *error = [NSError errorWithDomain: @"com.raywenderlich.tutorials.healthkit" code: 2 userInfo: [NSDictionary dictionaryWithObject:@"HealthKit is not available in th is Device" forKey:NSLocalizedDescriptionKey]];
if (compltion != nil) {
compltion(false, error);
}
return;
}
if ([HKHealthStore isHealthDataAvailable]) {
if(self.healthStore == nil)
self.healthStore = [[HKHealthStore alloc] init];
/*
组装需要读写的数据类型
*/
// NSSet *writeDataTypes = [self dataTypesToWrite];
NSSet *readDataTypes = [self dataTypesRead];
/*
注册需要读写的数据类型,也可以在“健康”APP中重新修改
*/
[self.healthStore requestAuthorizationToShareTypes:nil readTypes:readDataTypes completion:^(BOOL success, NSError *error) {
if (compltion != nil) {
NSLog(@"error->%@", error.localizedDescription);
compltion (success, error);
}
}];
}
}
else {
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:@"iOS 系统低于8.0" forKey:NSLocalizedDescriptionKey];
NSError *aError = [NSError errorWithDomain:CustomHealthErrorDomain code:0 userInfo:userInfo];
compltion(0,aError);
}
}
/*!
* @brief 写权限
* @return 集合
*/
- (NSSet *)dataTypesToWrite
{
HKQuantityType *heightType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeight];
HKQuantityType *weightType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyMass];
HKQuantityType *temperatureType = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyTemperature];
HKQuantityType *activeEnergyType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierActiveEnergyBurned];
return [NSSet setWithObjects:heightType, temperatureType, weightType,activeEnergyType,nil];
}
/*!
* @brief 读权限
* @return 集合
*/
- (NSSet *)dataTypesRead
{
// HKQuantityType *heightType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeight];
// HKQuantityType *weightType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyMass];
// HKQuantityType *temperatureType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyTemperature];
// HKCharacteristicType *birthdayType = [HKObjectType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierDateOfBirth];
// HKCharacteristicType *sexType = [HKObjectType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierBiologicalSex];
// HKQuantityType *stepCountType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount];
// HKQuantityType *distance = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierDistanceWalkingRunning];
// HKQuantityType *activeEnergyType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierActiveEnergyBurned];
//
// return [NSSet setWithObjects:heightType, temperatureType,birthdayType,sexType,weightType,stepCountType, distance, activeEnergyType,nil];
HKQuantityType *stepCountType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount];
// HKQuantityType *distance = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierDistanceWalkingRunning];
return [NSSet setWithObjects:stepCountType,nil];
}
//获取步数
- (void)getStepCount:(void(^)(double value, NSError *error))completion
{
HKQuantityType *stepType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount];
NSSortDescriptor *timeSortDescriptor = [[NSSortDescriptor alloc] initWithKey:HKSampleSortIdentifierEndDate ascending:NO];
// Since we are interested in retrieving the user's latest sample, we sort the samples in descending order, and set the limit to 1. We are not filtering the data, and so the predicate is set to nil.
HKSampleQuery *query = [[HKSampleQuery alloc] initWithSampleType:stepType predicate:[HealthKitManager predicateForSamplesToday] limit:HKObjectQueryNoLimit sortDescriptors:@[timeSortDescriptor] resultsHandler:^(HKSampleQuery *query, NSArray *results, NSError *error) {
if(error)
{
completion(0,error);
}
else
{
NSInteger totleSteps = 0;
for(HKQuantitySample *quantitySample in results)
{
HKQuantity *quantity = quantitySample.quantity;
HKUnit *heightUnit = [HKUnit countUnit];
double usersHeight = [quantity doubleValueForUnit:heightUnit];
totleSteps += usersHeight;
}
NSLog(@"当天行走步数 = %ld",(long)totleSteps);
completion(totleSteps,error);
}
}];
[self.healthStore executeQuery:query];
}
//获取公里数
- (void)getDistance:(void(^)(double value, NSError *error))completion
{
HKQuantityType *distanceType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierDistanceWalkingRunning];
NSSortDescriptor *timeSortDescriptor = [[NSSortDescriptor alloc] initWithKey:HKSampleSortIdentifierEndDate ascending:NO];
HKSampleQuery *query = [[HKSampleQuery alloc] initWithSampleType:distanceType predicate:[HealthKitManager predicateForSamplesToday] limit:HKObjectQueryNoLimit sortDescriptors:@[timeSortDescriptor] resultsHandler:^(HKSampleQuery * _Nonnull query, NSArray<__kindof HKSample *> * _Nullable results, NSError * _Nullable error) {
if(error)
{
completion(0,error);
}
else
{
double totleSteps = 0;
for(HKQuantitySample *quantitySample in results)
{
HKQuantity *quantity = quantitySample.quantity;
HKUnit *distanceUnit = [HKUnit meterUnitWithMetricPrefix:HKMetricPrefixKilo];
double usersHeight = [quantity doubleValueForUnit:distanceUnit];
totleSteps += usersHeight;
}
NSLog(@"当天行走距离 = %.2f",totleSteps);
completion(totleSteps,error);
}
}];
[self.healthStore executeQuery:query];
}
/*!
* @brief 当天时间段
*
* @return 时间段
*/
+ (NSPredicate *)predicateForSamplesToday {
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDate *now = [NSDate date];
NSDateComponents *components = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:now];
[components setHour:0];
[components setMinute:0];
[components setSecond: 0];
NSDate *startDate = [calendar dateFromComponents:components];
NSDate *endDate = [calendar dateByAddingUnit:NSCalendarUnitDay value:1 toDate:startDate options:0];
NSPredicate *predicate = [HKQuery predicateForSamplesWithStartDate:startDate endDate:endDate options:HKQueryOptionNone];
return predicate;
}
@end
//
// MQGradientProgressView.h
// MQGradientProgress
//
// Created by 小马 on 2017/7/24.
// Copyright © 2017年 maqi. All rights reserved.
//
#import <UIKit/UIKit.h>
#define MQRGBColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
@interface MQGradientProgressView : UIView
/**
* 进度条背景颜色 默认是 (230, 244, 245)
*/
@property (nonatomic, strong) UIColor *bgProgressColor;
/**
* 进度条渐变颜色数组,颜色个数>=2
* 默认是 @[(id)MQRGBColor(252, 244, 77).CGColor,(id)MQRGBColor(252, 93, 59).CGColor]
*/
@property (nonatomic, strong) NSArray *colorArr;
/**
* 进度 默认是0.65
*/
@property (nonatomic, assign) CGFloat progress;
- (void)refreshUI;
@end
//
// MQGradientProgressView.m
// MQGradientProgress
//
// Created by 小马 on 2017/7/24.
// Copyright © 2017年 maqi. All rights reserved.
//
#import "MQGradientProgressView.h"
#import "Constants.h"
@interface MQGradientProgressView ()
@property (nonatomic, strong) CALayer *bgLayer;
@property (nonatomic, strong) CAGradientLayer *gradientLayer;
@end
@implementation MQGradientProgressView
#pragma mark -
#pragma mark - GET ---> view
- (CALayer *)bgLayer {
if (!_bgLayer) {
_bgLayer = [CALayer layer];
//一般不用frame,因为不支持隐式动画
_bgLayer.bounds = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
_bgLayer.anchorPoint = CGPointMake(0, 0);
_bgLayer.backgroundColor = self.bgProgressColor.CGColor;
_bgLayer.cornerRadius = self.frame.size.height / 2.;
[self.layer addSublayer:_bgLayer];
}
return _bgLayer;
}
- (CAGradientLayer *)gradientLayer {
if (!_gradientLayer) {
_gradientLayer = [CAGradientLayer layer];
_gradientLayer.bounds = CGRectMake(0, 0, self.frame.size.width * self.progress, self.frame.size.height);
_gradientLayer.startPoint = CGPointMake(0, 0);
_gradientLayer.endPoint = CGPointMake(1, 0);
_gradientLayer.anchorPoint = CGPointMake(0, 0);
NSArray *colorArr = self.colorArr;
_gradientLayer.colors = colorArr;
_gradientLayer.cornerRadius = self.frame.size.height / 2.;
[self.layer addSublayer:_gradientLayer];
}
return _gradientLayer;
}
#pragma mark -
#pragma mark - SET ---> data
- (void)setProgress:(CGFloat)progress {
_progress = progress;
[self updateView];
}
- (void)setColorArr:(NSArray *)colorArr {
if (colorArr.count >= 2) {
_colorArr = colorArr;
[self updateView];
}else {
NSLog(@">>>>>颜色数组个数小于2,显示默认颜色");
}
}
#pragma mark -
#pragma mark - init
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self config];
[self simulateViewDidLoad];
self.colorArr = @[(id)MQRGBColor(252, 244, 77).CGColor,(id)MQRGBColor(252, 93, 59).CGColor];
self.progress = 0.65;
}
return self;
}
- (void)simulateViewDidLoad {
[self addSubViewTree];
}
- (void)config {
self.bgProgressColor = MQRGBColor(230., 230., 230.);
}
- (void)addSubViewTree {
[self bgLayer];
[self gradientLayer];
}
- (void)updateView {
self.gradientLayer.frame = CGRectMake(0, 0, self.frame.size.width * self.progress, 8 * WIDTHRADIU);
self.gradientLayer.colors = self.colorArr;
}
@end
//
// CTPrizeDetailProcessTableViewCell.h
// Open
//
// Created by 雷俊博 on 2019/9/6.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ListPrizeTableViewCell.h"
NS_ASSUME_NONNULL_BEGIN
@interface CTPrizeDetailProcessTableViewCell : UITableViewCell
@property (assign, nonatomic) BOOL hasUpLine;
@property (assign, nonatomic) BOOL hasDownLine;
@property (assign, nonatomic) BOOL currented;
- (void)reloadUIWithData:(NSDictionary *)dic state:(CTListPrizeState)state Index:(NSInteger)index;
@end
NS_ASSUME_NONNULL_END
//
// CTPrizeDetailProcessTableViewCell.m
// Open
//
// Created by 雷俊博 on 2019/9/6.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import "CTPrizeDetailProcessTableViewCell.h"
#import "CTPrizeDetailProcessTableCellContentView.h"
@interface CTPrizeDetailProcessTableViewCell ()
@property (nonatomic, strong)CTPrizeDetailProcessTableCellContentView *customView;
@end
@implementation CTPrizeDetailProcessTableViewCell
#pragma mark life cycle
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self setupUI];
}
return self;
}
- (void)setupUI {
CTPrizeDetailProcessTableCellContentView *custom = [[CTPrizeDetailProcessTableCellContentView alloc]init];
custom.backgroundColor=[UIColor clearColor];
[self addSubview:custom];
self.customView = custom;
custom.currented = NO;
custom.hasUpLine = NO;
custom.hasDownLine = NO;
[custom mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self);
}];
}
#pragma mark - public methods
- (void)reloadUIWithData:(NSDictionary *)dic state:(CTListPrizeState)state Index:(NSInteger)index
{
[self.customView reloadUIWithData:dic state:state Index:index];
}
#pragma mark - gettrs and setters
- (void)setHasUpLine:(BOOL)hasUpLine {
self.customView.hasUpLine = hasUpLine;
}
- (void)setHasDownLine:(BOOL)hasDownLine {
self.customView.hasDownLine = hasDownLine;
}
- (void)setCurrented:(BOOL)currented {
self.customView.currented = currented;
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// SNXUXIANView.h
// Open
//
// Created by 雷俊博 on 2019/9/5.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SNXUXIANView : UIView
@end
NS_ASSUME_NONNULL_END
//
// SNXUXIANView.m
// Open
//
// Created by 雷俊博 on 2019/9/5.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import "SNXUXIANView.h"
#import "UIColor+Hex.h"
@implementation SNXUXIANView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initViews];
}
return self;
}
- (void)initViews
{
}
- (void)drawRect:(CGRect)rect
{
// Drawing code
CGContextRef context=UIGraphicsGetCurrentContext();//获取绘图用的图形上下文
CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);//填充色设置成
CGFloat lengths[] = {4};
CGContextSetLineDash(context, 4, lengths,1);
CGContextFillRect(context,self.bounds);//把整个空间用刚设置的颜色填充
//上面是准备工作,下面开始画线了
CGContextSetStrokeColorWithColor(context, [UIColor colorWithHex:0xcccccc].CGColor);//设置线的颜色
CGContextMoveToPoint(context,0,0);//画线的起始点位置
CGContextAddLineToPoint(context,self.frame.size.width,0);//画第一条线的终点位置
CGContextStrokePath(context);//把线在界面上绘制出来
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
//
// ListPrizeTableViewCell.h
// Open
//
// Created by 雷俊博 on 2019/9/3.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, CTListPrizeType) {
CTListPrizeTypePackage2,
CTListPrizeTypePackage3,
CTListPrizeTypePackage10,
CTListPrizeTypeCoins200,
CTListPrizeTypeCoins388,
CTListPrizeTypeCoins588,
CTListPrizeTypeUnKnow
};
typedef NS_ENUM(NSUInteger, CTListPrizeState) {
CTListPrizeStateUnGet,//未领取
CTListPrizeStateReceived,//已领取
CTListPrizeStateGiving,//发放中
CTListPrizeStateInvalid,//已过期
CTListPrizeStateFailure,//发放失败
CTListPrizeStateUnKnow
};
@interface ListPrizeTableViewCell : UITableViewCell
@property (nonatomic, assign)CTListPrizeType type;
@property (nonatomic, assign)CTListPrizeState state;
- (void)refreshUIWithData:(NSDictionary *)dic;
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
//
// NoDataView.h
// Open
//
// Created by 雷俊博 on 2019/9/5.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface NoDataView : UIView
@end
NS_ASSUME_NONNULL_END
//
// NoDataView.m
// Open
//
// Created by 雷俊博 on 2019/9/5.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import "NoDataView.h"
#import "UIColor+Hex.h"
#import "Constants.h"
#import <Masonry.h>
@interface NoDataView ()
@property (nonatomic,strong)UIImageView *img_icon;
@property (nonatomic, strong)UILabel *lb_message;
@end
@implementation NoDataView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self addSubview:self.img_icon];
[self addSubview:self.lb_message];
[self setupUI];
}
return self;
}
- (void)setupUI
{
[self.img_icon mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self);
make.top.offset(116 * WIDTHRADIU);
}];
[self.lb_message mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self);
make.top.equalTo(self.img_icon.mas_bottom).offset(14 * WIDTHRADIU);
}];
}
#pragma mark - getters and setters
- (UIImageView *)img_icon
{
if (!_img_icon) {
_img_icon = [[UIImageView alloc]init];
_img_icon.image = [UIImage imageNamed:@"我的奖品-空状态"];
}
return _img_icon;
}
- (UILabel *)lb_message
{
if (!_lb_message) {
_lb_message = [[UILabel alloc]init];
_lb_message.numberOfLines = 0;
_lb_message.font = [UIFont systemFontOfSize:15 * WIDTHRADIU];
_lb_message.textColor = [UIColor colorWithHex:0xbfbfbf];
NSString *str = @"暂无奖品,快去抽奖中心\n赢取更多礼品吧!";
NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineSpacing = 10.0 * WIDTHRADIU; // 设置行间距
paragraphStyle.alignment = NSTextAlignmentCenter; //设置两端对齐显示
[attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedStr.length)];
_lb_message.attributedText = attributedStr;
}
return _lb_message;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
//
// MiddleBannerCollectionViewCell.h
// Open
//
// Created by 雷俊博 on 2019/8/22.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface MiddleBannerCollectionViewCell : UICollectionViewCell
@property (nonatomic, strong)UIImageView *goodsImageView;
- (void)configureCellWithInfo:(NSDictionary *)data;
@end
NS_ASSUME_NONNULL_END
//
// MiddleBannerCollectionViewCell.m
// Open
//
// Created by 雷俊博 on 2019/8/22.
// Copyright © 2019 黄江涛 . All rights reserved.
//
#import "MiddleBannerCollectionViewCell.h"
#import "Constants.h"
#import "UIColor+Hex.h"
@interface MiddleBannerCollectionViewCell ()
@end
@implementation MiddleBannerCollectionViewCell
#pragma mark - life cycle
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self.contentView addSubview:self.goodsImageView];
[self setupUI];
}
return self;
}
- (void)setupUI
{
[self.goodsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.offset(0);
make.top.bottom.offset(0);
}];
}
#pragma mark - public methods
- (void)configureCellWithInfo:(NSDictionary *)data
{
}
#pragma mark - getters and setters
- (UIImageView *)goodsImageView
{
if (!_goodsImageView) {
_goodsImageView = [[UIImageView alloc]init];
}
return _goodsImageView;
}
@end
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "btn_exercise_refresh.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "btn_exercise_refresh@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "btn_exercise_refresh@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_exercise_back.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_back@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_back@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_exercise_coins.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_coins@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_coins@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_exercise_person.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_person@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_person@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_exercise_ring.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_ring@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_ring@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_exercise_back.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_back@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_back@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_exercise_coins.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_coins@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_coins@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_exercise_person.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_person@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_person@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_exercise_ring.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_ring@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "img_exercise_ring@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "发现.png", "filename" : "Find-n.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "发现@2x.png", "filename" : "Find-n@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "发现@3x.png", "filename" : "Find-n@3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],
......
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "发现_s.png", "filename" : "Find-s.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "发现_s@2x.png", "filename" : "Find-s@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "发现_s@3x.png", "filename" : "Find-s@3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "middleBanner.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "middleBanner@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "middleBanner@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "TencentTask.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "TencentTask@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "TencentTask@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "coins-signSuccess.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "coins-signSuccess@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "coins-signSuccess@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
//
// BannerView.h
// 轮播图(循环和自动)
//
// Created by 裴铎 on 2018/3/9.
// Copyright © 2018年 裴铎. All rights reserved.
//
#import <UIKit/UIKit.h>
/**
7./创建一个协议
需要把文件的名称传过来
用@class BannerView;只传名称
*/
@class PDBannerView;
//定义一个协议( @protocol 协议名称 <NSObject> )
@protocol PDBannerViewDelegate <NSObject>
/**
协议方法实现方式
optional 可选 (默认是必须实现的)
*/
@optional
/**
8./用来传值的协议方法
@param bannerView 本类
@param currentImage 传进来的当前的图片
*/
- (void)selectImage:(PDBannerView *)bannerView currentImage:(NSInteger)currentImage;
@end//协议结束
@interface PDBannerView : UIView
/**
9./创建一个代理属性(用 weak)
写在.h文件里的属性 外界可以调用
*/
@property (nonatomic , weak) id <PDBannerViewDelegate> delegate;
/**
销毁定时器方法
*/
+ (void)destroyTimer;
/**
1./声明一个自定义的构造方法 让外界的对象用来初始化bannerView
@param frame 外界传入的frame
@param addImageArray 外界传入的图片数组
@return 1
*/
- (id)initWithFrame:(CGRect)frame andImageArray:(NSMutableArray *)addImageArray;
@end
This diff is collapsed.
../../../Reachability/Reachability.h
\ No newline at end of file
../../../Toast/Toast-Framework/Toast.h
\ No newline at end of file
../../../Toast/Toast/UIView+Toast.h
\ No newline at end of file
../../../UICountingLabel/UICountingLabel.h
\ No newline at end of file
../../../Reachability/Reachability.h
\ No newline at end of file
../../../Toast/Toast-Framework/Toast.h
\ No newline at end of file
../../../Toast/Toast/UIView+Toast.h
\ No newline at end of file
../../../UICountingLabel/UICountingLabel.h
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9F174662D84916BF4F9443D75BCB2946"
BuildableName = "libReachability.a"
BlueprintName = "Reachability"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97F970E97EB414C65EE9F58D5B909D10"
BuildableName = "libToast.a"
BlueprintName = "Toast"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0F088CBCD1A14E113BC154F4100AC585"
BuildableName = "libUICountingLabel.a"
BlueprintName = "UICountingLabel"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment