Commit fe236e05 authored by lujunye's avatar lujunye

升级第三方

parent a41af1a4
......@@ -435,6 +435,7 @@
E0F1BE4924692379003015B2 /* ItemCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0F1BE4724692379003015B2 /* ItemCell.xib */; };
E0F3C2CB24590C86006F0D1F /* XinZengAndBianJiKeHuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0F3C2C924590C86006F0D1F /* XinZengAndBianJiKeHuViewController.swift */; };
E0F3C2CC24590C86006F0D1F /* XinZengAndBianJiKeHuViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0F3C2CA24590C86006F0D1F /* XinZengAndBianJiKeHuViewController.xib */; };
E0F6002C25E77D6600B9BF34 /* GSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E0F6002B25E77D6600B9BF34 /* GSDK.a */; };
E0F8E91B248737F100817A08 /* NewOnlyRKCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0F8E919248737F100817A08 /* NewOnlyRKCell.swift */; };
E0F8E91C248737F100817A08 /* NewOnlyRKCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0F8E91A248737F100817A08 /* NewOnlyRKCell.xib */; };
E0F8E91F248747D200817A08 /* NewCKVc.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0F8E91D248747D200817A08 /* NewCKVc.swift */; };
......@@ -1170,6 +1171,16 @@
E0F1BE4724692379003015B2 /* ItemCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ItemCell.xib; sourceTree = "<group>"; };
E0F3C2C924590C86006F0D1F /* XinZengAndBianJiKeHuViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XinZengAndBianJiKeHuViewController.swift; sourceTree = "<group>"; };
E0F3C2CA24590C86006F0D1F /* XinZengAndBianJiKeHuViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = XinZengAndBianJiKeHuViewController.xib; sourceTree = "<group>"; };
E0F6002225E77D6600B9BF34 /* EthernetConnecter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EthernetConnecter.h; sourceTree = "<group>"; };
E0F6002325E77D6600B9BF34 /* GPUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUtils.h; sourceTree = "<group>"; };
E0F6002425E77D6600B9BF34 /* EscCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EscCommand.h; sourceTree = "<group>"; };
E0F6002525E77D6600B9BF34 /* CPCLData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPCLData.h; sourceTree = "<group>"; };
E0F6002625E77D6600B9BF34 /* ConnecterBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConnecterBlock.h; sourceTree = "<group>"; };
E0F6002725E77D6600B9BF34 /* TscCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TscCommand.h; sourceTree = "<group>"; };
E0F6002825E77D6600B9BF34 /* BLEConnecter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BLEConnecter.h; sourceTree = "<group>"; };
E0F6002925E77D6600B9BF34 /* Connecter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Connecter.h; sourceTree = "<group>"; };
E0F6002A25E77D6600B9BF34 /* CPCLCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPCLCommand.h; sourceTree = "<group>"; };
E0F6002B25E77D6600B9BF34 /* GSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = GSDK.a; sourceTree = "<group>"; };
E0F8E919248737F100817A08 /* NewOnlyRKCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewOnlyRKCell.swift; sourceTree = "<group>"; };
E0F8E91A248737F100817A08 /* NewOnlyRKCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NewOnlyRKCell.xib; sourceTree = "<group>"; };
E0F8E91D248747D200817A08 /* NewCKVc.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewCKVc.swift; sourceTree = "<group>"; };
......@@ -1497,6 +1508,7 @@
F96A581D24790D9A0070A057 /* libxml2.2.tbd in Frameworks */,
E09B3AD424B2FCAF00E3B238 /* ShareSDKConfigFile.framework in Frameworks */,
E09B3ADA24B2FCAF00E3B238 /* ShareSDK.framework in Frameworks */,
E0F6002C25E77D6600B9BF34 /* GSDK.a in Frameworks */,
E09B3AD924B2FCAF00E3B238 /* WechatConnector.framework in Frameworks */,
E02870C7258C547E00271055 /* MAMapKit.framework in Frameworks */,
F93E32092473CD6500524DFC /* libresolv.tbd in Frameworks */,
......@@ -2316,6 +2328,8 @@
E09B3AB624B2FCAF00E3B238 /* SDK */ = {
isa = PBXGroup;
children = (
E0F6002125E77D6600B9BF34 /* GSDK */,
E0F6002B25E77D6600B9BF34 /* GSDK.a */,
E09B3AB724B2FCAF00E3B238 /* ShareSDK */,
E09B3ACD24B2FCAF00E3B238 /* Required */,
);
......@@ -2732,6 +2746,22 @@
path = PurchaseModel;
sourceTree = "<group>";
};
E0F6002125E77D6600B9BF34 /* GSDK */ = {
isa = PBXGroup;
children = (
E0F6002225E77D6600B9BF34 /* EthernetConnecter.h */,
E0F6002325E77D6600B9BF34 /* GPUtils.h */,
E0F6002425E77D6600B9BF34 /* EscCommand.h */,
E0F6002525E77D6600B9BF34 /* CPCLData.h */,
E0F6002625E77D6600B9BF34 /* ConnecterBlock.h */,
E0F6002725E77D6600B9BF34 /* TscCommand.h */,
E0F6002825E77D6600B9BF34 /* BLEConnecter.h */,
E0F6002925E77D6600B9BF34 /* Connecter.h */,
E0F6002A25E77D6600B9BF34 /* CPCLCommand.h */,
);
path = GSDK;
sourceTree = "<group>";
};
E0F97B05245161E6001BD600 /* 商品详情 */ = {
isa = PBXGroup;
children = (
......
......@@ -26,6 +26,6 @@
#import "JZLocationConverter.h"
//#import "BLEConnecter.h"
#endif /* Bridge_Header_h */
//
// Connecter.h
// GSDK
//
// Created by 猿史森林 on 2018/6/15.
// Copyright © 2018年 Smarnet. All rights reserved.
//
#import "Connecter.h"
#import <CoreBluetooth/CoreBluetooth.h>
@interface BLEConnecter :Connecter
@property(nonatomic,strong)CBCharacteristic *airPatchChar;
@property(nonatomic,strong)CBCharacteristic *transparentDataWriteChar;
@property(nonatomic,strong)CBCharacteristic *transparentDataReadOrNotifyChar;
@property(nonatomic,strong)CBCharacteristic *connectionParameterChar;
@property(nonatomic,strong)CBUUID *transServiceUUID;
@property(nonatomic,strong)CBUUID *transTxUUID;
@property(nonatomic,strong)CBUUID *transRxUUID;
@property(nonatomic,strong)CBUUID *disUUID1;
@property(nonatomic,strong)CBUUID *disUUID2;
@property(nonatomic,strong)NSArray *serviceUUID;
@property(nonatomic,copy)DiscoverDevice discover;
@property(nonatomic,copy)UpdateState updateState;
@property(nonatomic,copy)WriteProgress writeProgress;
/**数据包大小,默认130个字节*/
@property(nonatomic,assign)NSUInteger datagramSize;
@property(nonatomic,strong)CBPeripheral *connPeripheral;
//+(instancetype)sharedInstance;
/**
* 方法说明:设置特定的Service UUID,以及Service对应的具有读、写特征值
* @param serviceUUID 蓝牙模块的service uuid
* @param txUUID 具有写入权限特征值
* @param rxUUID 具有读取权限特征值
*/
- (void)configureTransparentServiceUUID: (NSString *)serviceUUID txUUID:(NSString *)txUUID rxUUID:(NSString *)rxUUID;
/**
* 方法说明:扫描外设
* @param serviceUUIDs 需要连接的外设UUID
* @param options 其它可选操作
* @param discover 发现设备
* peripheral 发现的外设
* advertisementData
* RSSI 外设信号强度
*/
-(void)scanForPeripheralsWithServices:(nullable NSArray<CBUUID *> *)serviceUUIDs options:(nullable NSDictionary<NSString *, id> *)options discover:(void(^_Nullable)(CBPeripheral *_Nullable peripheral,NSDictionary<NSString *, id> *_Nullable advertisementData,NSNumber *_Nullable RSSI))discover;
/**
* 方法说明:停止扫描蓝牙外设
*/
-(void)stopScan;
/**
* 方法说明:更新蓝牙状态
* @param state 更新蓝牙状态
*/
-(void)didUpdateState:(void(^_Nullable)(NSInteger state))state;
/**
* 方法说明:连接外设
* @param peripheral 需要连接的外设
* @param options 其它可选操作
* @param timeout 连接超时
* @param connectState 连接状态
*/
-(void)connectPeripheral:(CBPeripheral *_Nullable)peripheral options:(nullable NSDictionary<NSString *,id> *)options timeout:(NSUInteger)timeout connectBlack:(void(^_Nullable)(ConnectState state)) connectState;
/**
* 方法说明:连接外设
* @param peripheral 需要连接的外设
* @param options 其它可选操作
*/
-(void)connectPeripheral:(CBPeripheral * _Nullable)peripheral options:(nullable NSDictionary<NSString *,id> *)options;
/**
* 方法说明:断开连接
* @param peripheral 需要断开连接的外设
*/
-(void)closePeripheral:(nonnull CBPeripheral *)peripheral;
/**
* 方法说明: 往蓝牙模块中写入数据
* @param data 往蓝牙模块中写入的数据
* @param progress 写入数据的进度
* @param callBack 读取蓝牙模块返回数据
*/
-(void)write:(NSData *_Nullable)data progress:(void(^_Nullable)(NSUInteger total,NSUInteger progress))progress receCallBack:(void (^_Nullable)(NSData *_Nullable))callBack;
/**
* 方法说明: 往蓝牙模块中写入数据
* @param characteristic 特征值
* @param data 往蓝牙模块中写入的数据
* @param type 写入方式<b>CBCharacteristicWriteWithResponse</b>写入方式是带流控写入方式。<b>CBCharacteristicWriteWithoutResponse</b>不带流控写入方式 <p><b>@see CBCharacteristicWriteType</b></p>
*/
-(void)writeValue:(NSData *)data forCharacteristic:(nonnull CBCharacteristic *)characteristic type:(CBCharacteristicWriteType)type;
@end
//
// CPCLCommand.h
// GPSDKDemo
//
// Created by max on 2020/7/22.
// Copyright © 2020 max. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
// 字体枚举
typedef enum {
FONT_00 = 0,
FONT_01 = 1,
FONT_02 = 2,
FONT_03 = 3,
FONT_04 = 4,
FONT_05 = 5,
FONT_06 = 6,
FONT_07 = 7,
FONT_08 = 8,
FONT_010 = 10,
FONT_011 = 11,
FONT_013 = 13,
FONT_020 = 20,
FONT_024 = 24,
FONT_041 = 41,
FONT_042 = 42,
FONT_043 = 43,
FONT_044 = 44,
FONT_045 = 45,
FONT_046 = 46,
FONT_047 = 47,
FONT_048_00 = 48,
FONT_048_01 = 48,
FONT_055 = 55,
}TEXTFONT;
// 打印图片方式枚举
typedef NS_ENUM (NSUInteger,GRAPHICS){
EXPANDED = 0,//横向打印扩展图形
COMPRESSED = 1,//横向打印压缩图形
};
// 条码种类枚举
typedef NS_ENUM (NSUInteger,CPCLBARCODETYPE) {
Code128=1,
Upc_A = 2,
Upc_E = 3,
Ean13 = 4,
Ean8 = 5,
Code39 = 6,
Code93 = 7,
Codebar = 8,
};
// 速度枚举
typedef enum {
SPEED00 = 0,
SPEED01 = 1,
SPEED02 = 2,
SPEED03 = 3,
SPEED04 = 4,
SPEED05 = 5,
}CPCLSPEED;
// 字段的对齐方式枚举
typedef NS_ENUM (NSUInteger,ALIGNMENT) {
CENTER = 0,
LEFT = 1,
RIGHT = 2,
};
// 字体指令枚举
typedef NS_ENUM (NSUInteger,TEXTCOMMAND) {
T = 0, // 横向打印文本。
VT = 1, // 逆时针旋转 90 度,纵向打印文本。
T90 = 2, // 同上
T180 = 3, // 逆时针旋转 80 度,反转打印文本。
T270 = 4, // 逆时针旋转 270 度,纵向打印文本。
};
// 宽窄比枚举
typedef enum {
Point0 = 0,//1.5:1
Point1 = 1,//2.0:1
Point2 = 2,//2.5:1
Point3 = 3,//3.0:1
Point4 = 4,//3.5:1
Point20 = 20,//2.0:1
Point21 = 21,//2.1:1
Point22 = 22,//2.2:1
Point23 = 23,//2.3:1
Point24 = 24,//2.4:1
Point25 = 25,//2.5:1
Point26 = 26,//2.6:1
Point27 = 27,//2.7:1
Point28 = 28,//2.8:1
Point29 = 29,//2.9:1
Point30 = 30,//3.0:1
}BARCODERATIO;//宽窄比
// 横向或纵向打印枚举
typedef NS_ENUM (NSUInteger,COMMAND){
BARCODE = 0,
VBARCODE = 1,
};
@interface CPCLCommand : NSObject
/**
* 方法说明:初始化
* @param offset 标签横向偏移量
* @param height 标签最大高度
* @param qty 打印标签的张数
*/
-(void)addInitializePrinterwithOffset:(int)offset withHeight:(int)height withQTY:(int)qty;
/**
* 方法说明:打印标签
*/
-(void)addPrint;
/**
* 方法说明:获得打印命令
* @return NSData
*/
-(NSData*)getCommand;
/**
* 方法说明:在标签上添加文本
* @param type 指令
* @param font 字体类型
* @param x 横向起始位置
* @param y 纵向起始位置
* @param text 打印的文本
*/
-(void)addText:(TEXTCOMMAND)type withFont:(TEXTFONT)font withXstart:(int)x withYstart:(int)y withContent:(NSString*)text;
/**
* 方法说明:将字体放大指定的放大倍数
* @param w 宽度放大倍数,有效放大倍数为 1 到 16
* @param h 高度放大倍数,有效放大倍数为 1 到 16
*/
-(void)addSetmagWithWidthScale:(int)w withHeightScale:(int)h;
/**
* 方法说明:以指定的宽度和高度纵向和横向打印条码
* @param command 横向或纵向打印
* @param type 条码种类
* @param width 条码窄条的单位宽度
* @param ratio 条码宽条与窄条的比率
* @param height 条码的单位高度
* @param x 横向起始位置
* @param y 纵向起始位置
* @param text 条码内容
*/
-(void)addBarcode:(COMMAND)command withType:(CPCLBARCODETYPE)type withWidth:(int)width withRatio:(BARCODERATIO)ratio withHeight:(int)height withXstart:(int)x withYstart:(int)y withString:(NSString*)text;
/**
* 方法说明:打印二维码
* @param command 横向或纵向打印
* @param x 横向起始位置
* @param y 纵向起始位置
* @param n QR Code 规范编号,1 或 2,默认推荐为 2
* @param u 模块的单位宽度/单位高度 1-32,默认为 6
* @param text 二维码内容
*/
-(void)addQrcode:(COMMAND)command withXstart:(int)x withYstart:(int)y with:(int)n with:(int)u withString:(NSString*)text;
/**
* 方法说明:添加条码注释
* @param font 注释条码时要使用的字体号
* @param offset 文本距离条码的单位偏移量
*/
-(void)addBarcodeTextWithFont:(int)font withOffset:(int)offset;
/**
* 方法说明:禁用条码注释
*/
-(void)addBarcodeTextOff;
/**
* 方法说明:打印图片
* @param command 指令
* @param x 起始点的X 坐标
* @param y 起始点的 Y 坐标
* @param img 图片
* @param maxWidth 最大宽度
*/
-(void)addGraphics:(GRAPHICS)command WithXstart:(int)x withYstart:(int)y withImage:(UIImage*)img withMaxWidth:(int)maxWidth;
/**
* 方法说明:打印任何长度、宽度和角度方向的线条
* @param x 起始点的X 坐标
* @param y 起始点的 Y 坐标
* @param xend 终止点的 X 坐标
* @param yend 终止点的 Y 坐标
* @param width 线条的单位宽度
*/
-(void)addLineWithXstart:(int)x withYstart:(int)y withXend:(int)xend withYend:(int)yend withWidth:(int)width;
/**
* 方法说明:打印指定线条宽度的矩形
* @param x 左上角的X 坐标
* @param y 左上角的 Y 坐标
* @param xend 右下角的 X 坐标
* @param yend 右下角的 Y 坐标
* @param thickness 形成矩形框的线条的单位宽度
*/
-(void)addBoxWithXstart:(int)x withYstart:(int)y withXend:(int)xend withYend:(int)yend withThickness:(int)thickness;
/**
* 方法说明:绘制反显区域,应先添加内容后再添加反显区域
* @param x 起始点的X 坐标
* @param y 起始点的 Y 坐标
* @param xend 终止点的 X 坐标
* @param yend 终止点的 Y 坐标
* @param width 反色区域高度
*/
-(void)addInverseLineWithXstart:(int)x withYstart:(int)y withXend:(int)xend withYend:(int)yend withWidth:(int)width;
/**
* 方法说明:控制字段的对齐方式
* @param align 对齐方式
*/
-(void)addJustification:(ALIGNMENT)align;
/**
* 方法说明:设置打印宽度
* @param width 页面的单位宽度
*/
-(void)addPagewidth:(int)width;
/**
* 方法说明:设置打印速度
* @param level 打印速度
*/
-(void)addSpeed:(CPCLSPEED)level;
/**
* 方法说明:让蜂鸣器发出给定时间长度的声音
* @param beep_length 蜂鸣持续时间,以 1/8 秒为单位递增
*/
-(void)addBeep:(int)beep_length;
/**
* 方法说明:查询打印机状态
*/
-(void)queryPrinterStatus;
@end
//
// CPCLData.h
// GPSDKDemo
//
// Created by max on 2020/7/23.
// Copyright © 2020 max. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface BitmapImage : NSObject
@property(nonatomic,strong)NSData* bitmap;
@property(nonatomic,assign)NSInteger width;
@property(nonatomic,assign)NSInteger height;
@end
@interface CPCLData : NSObject
@property(nonatomic,assign)NSInteger w;
@property(nonatomic,assign)NSInteger h;
- (id)initWithUIImage:(UIImage *)image maxWidth:(int)maxWidth;
-(NSData *)printCPCLData;
@end
//
// Connecter.h
// GSDK
//
// Created by 猿史森林 on 2018/6/16.
// Copyright © 2018年 Smarnet. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ConnecterBlock.h"
@interface Connecter:NSObject
//读取数据
@property(nonatomic,copy)ReadData readData;
//连接状态
@property(nonatomic,copy)ConnectDeviceState state;
/**
* 方法说明: 连接
*/
-(void)connect;
/**
* 方法说明: 连接到指定设备
* @param connectState 连接状态
*/
-(void)connect:(void(^)(ConnectState state))connectState;
/**
* 方法说明: 关闭连接
*/
-(void)close;
/**
* 发送数据
* 向输出流中写入数据
*/
-(void)write:(NSData *)data receCallBack:(void(^)(NSData *data))callBack;
-(void)write:(NSData *)data;
/**
* 读取数据
* @parma data 读取到的数据
*/
-(void)read:(void(^)(NSData *data))data;
@end
//
// ConnecterBlock.h
// GSDK
//
// Created by 猿史森林 on 2018/6/16.
// Copyright © 2018年 Smarnet. All rights reserved.
//
#ifndef ConnecterBlock_h
#define ConnecterBlock_h
#import <CoreBluetooth/CBPeripheral.h>
/**
* @enum ConnectState
* @discussion 连接状态
* @constant CONNECT_STATE_DISCONNECT ConnectDeviceState返回state为该状态是表示已断开连接
* @constant CONNECT_STATE_CONNECTING ConnectDeviceState返回state为该状态是表示正在连接中
* @constant CONNECT_STATE_CONNECTED ConnectDeviceState返回state为该状态是表示连接成功
* @constant CONNECT_STATE_TIMEOUT ConnectDeviceState返回state为该状态是表示连接超时
* @constant CONNECT_STATE_FAILT ConnectDeviceState返回state为该状态是表示连接失败
*/
typedef enum : NSUInteger{
NOT_FOUND_DEVICE,//未找到设备
CONNECT_STATE_DISCONNECT,//断开连接
CONNECT_STATE_CONNECTING,//连接中
CONNECT_STATE_CONNECTED,//连接上
CONNECT_STATE_TIMEOUT,//连接超时
CONNECT_STATE_FAILT//连接失败
}ConnectState;
/**
* @enum PrinterDPI
* @discussion 打印机DPI
* @constant PRINTER_200DPI 200dpi以8个点为单位传输图片数据
* @constant PRINTER_300DPI 300dpi以12个点为单位传输图片数据
*/
typedef enum PrinterDPI{
PRINTER_200DPI,
PRINTER_300DPI
}PrinterDPI;
/**发现设备*/
typedef void(^DiscoverDevice)(CBPeripheral *_Nullable peripheral,NSDictionary<NSString *, id> * _Nullable advertisementData,NSNumber * _Nullable RSSI);
/**蓝牙状态更新*/
typedef void(^UpdateState)(NSInteger state);
/**连接状态*/
typedef void(^ConnectDeviceState)(ConnectState state);
/**读取数据*/
typedef void(^ReadData)(NSData * _Nullable data);
/**发送数据进度 只适用于蓝牙发送数据*/
typedef void(^WriteProgress)(NSUInteger total,NSUInteger progress);
typedef void (^Error)(id _Nonnull error);//old:typedef void (^Error)(id error);
#endif /* ConnecterBlock_h */
This diff is collapsed.
//
// EthernetConnecter.h
// GSDK
//
// Created by 猿史森林 on 2018/6/16.
// Copyright © 2018年 猿史森林. All rights reserved.
//
#import "Connecter.h"
@interface EthernetConnecter :Connecter
/**连接设备的ip地址*/
@property(nonatomic,strong)NSString *ip;
/**连接设备的端口号*/
@property(nonatomic,assign)int port;
//+(instancetype)sharedInstance;
/**
* 方法说明: 连接设备
* @param ip 连接设备的ip地址
* @param port 连接设备的端口号
* @param connectState 连接状态 @see ConnectState
* @param callback 输入流数据回调
*/
-(void)connectIP:(NSString *)ip port:(int)port connectState:(void (^)(ConnectState state))connectState callback:(void(^)(NSData *data))callback;
-(void)connectIP:(NSString *)ip port:(int)port connectState:(void (^)(ConnectState))connectState;
@end
//
// Utils.h
// GSDK
//
// Created by 猿史森林 on 2018/6/22.
// Copyright © 2018年 Smarnet. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface GPUtils : NSObject
/**
* 方法说明:图片缩放
* @return 缩放后图片
*/
+(UIImage *)imageWithScaleImage:(UIImage *)image andScaleWidth:(int)width;
+(NSData *)printEscData:(UIImage *)image;
+(NSData *)printTscData:(UIImage *)image;
/**
* 方法说明:Tsc指令图片数据
* @param image 图片
* @param mode 打印机图片打印模式
* @return Tsc图片数据
*/
+(NSData *)printTscData:(UIImage *)image andMode:(int)mode;
/**
* 图像二值化处理
*/
+(UIImage *)binaryzation:(UIImage *)image;
/**
* 图像灰度化处理
* @param image 原图像
*/
+(UIImage *)grayImage:(UIImage *)image;
@end
//
// TscCommand.h
// Gprinter
//
// Created by Wind on 2018/6/15.
// Copyright (c) 2018年 Smarnet. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef NS_ENUM (NSUInteger,Response){
OFF = 0,//关闭自动返回状态功能
ON = 1,//打开自动返回状态功能,每打印完一张返回一次
BATCH = 2,//打开自动返回状态功能,打印完毕后返回一次
};
@interface TscCommand : NSObject
/**
* 方法说明:设置标签尺寸的宽和高
* @param width 标签宽度
* @param height 标签高度
*/
-(void) addSize:(int) width :(int) height;
/**
* 方法说明:设置标签间隙尺寸 单位mm
* @param m 间隙长度
* @param n 间隙偏移
*/
-(void) addGapWithM:(int) m withN:(int) n;
/**
* 方法说明:设置标签原点坐标
* @param x 横坐标
* @param y 纵坐标
*/
-(void) addReference:(int) x :(int)y;
/**
* 方法说明:设置打印速度
* @param speed 打印速度
*/
-(void) addSpeed:(int) speed;
/**
* 方法说明:设置打印速度,保留小数点后1位
* @param speed 打印速度
*/
-(void) addSpeedF:(float) speed;
/**
* 方法说明:设置打印浓度
* @param density 浓度
*/
-(void) addDensity:(int) density;
/**
* 方法说明:设置打印方向
* @param direction 方向
*/
-(void) addDirection:(int) direction;
/**
* 方法说明:清除打印缓冲区
*/
-(void) addCls;
/**
* 方法说明:在标签上绘制文字
* @param x 横坐标
* @param y 纵坐标
* @param font 字体类型
* @param rotation 旋转角度
* @param xScal 横向放大
* @param yScal 纵向放大
* @param text 文字字符串
*/
-(void) addTextwithX:(int)x withY:(int)y withFont:(NSString*)font withRotation:(int)rotation withXscal:(int)xScal withYscal:(int)yScal withText:(NSString*) text;
/*
BITMAP X, Y, width, height, mode, bitmap data
参 数 说 明
x 点阵影像的水平启始位置
y 点阵影像的垂直启始位置
width 影像的宽度,以 byte 表示
height 影像的高度,以点(dot)表示
mode 影像绘制模式
0 OVERWRITE
1 OR
2 XOR
bitmap data 影像数据
*/
-(void) addBitmapwithX:(int)x withY:(int) y withWidth:(int) width withHeight:(int) height withMode:(int) mode withData:(NSData*) data;
-(void)addBitmapwithX:(int)x withY:(int)y withMode:(int)mode withWidth:(int)width withImage:(UIImage *)image;
-(void)addBitmapwithX:(int)x withY:(int)y withMode:(int)mode withImage:(UIImage *)image;
/**
* 方法说明:在标签上绘制一维条码
* @param x 横坐标
* @param y 纵坐标
* @param barcodeType 条码类型
* @param height 条码高度,默认为40
* @param readable 是否可识别,0: 人眼不可识,1: 人眼可识
* @param rotation 旋转角度,条形码旋转角度,顺时钟方向,0不旋转,90顺时钟方向旋转90度,180顺时钟方向旋转180度,270顺时钟方向旋转270度
* @param narrow 默认值2,窄 bar 宽度,以点(dot)表示
* @param wide 默认值4,宽 bar 宽度,以点(dot)表示
* @param content 条码内容
BARCODE X,Y,"code type",height,human readable,rotation,narrow,wide,"code"
BARCODE 100,100,"39",40,1,0,2,4,"1000"
BARCODE 10,10,"128",40,1,0,2,2,"124096ABCDEFZ$%+-./*"
"code type":
EAN13("EAN13"),
EAN8("EAN8"),
UPCA("UPCA"),
ITF14("ITF14"),
CODE39("39"),
CODE128("128"),
*/
-(void) add1DBarcode:(int)x :(int)y :(NSString*)barcodeType :(int)height :(int)readable :(int)rotation :(int)narrow :(int)wide :(NSString*)content;
/**
* 方法说明:在标签上绘制QRCode二维码
* @param x 横坐标
* @param y 纵坐标
* @param ecclever 选择QRCODE纠错等级,L为7%,M为15%,Q为25%,H为30%
* @param cellwidth 二维码宽度1~10,默认为4
* @param mode 默认为A,A为Auto,M为Manual
* @param rotation 旋转角度,QRCode二维旋转角度,顺时钟方向,0不旋转,90顺时钟方向旋转90度,180顺时钟方向旋转180度,270顺时钟方向旋转270度
* @param content 条码内容
* QRCODE X,Y ,ECC LEVER ,cell width,mode,rotation, "data string"
* QRCODE 20,24,L,4,A,0,"佳博集团网站www.Gprinter.com.cn"
*/
-(void) addQRCode:(int)x :(int)y :(NSString*)ecclever :(int)cellwidth :(NSString*)mode :(int)rotation :(NSString*)content;
/**
* 方法说明:执行打印
* @param m
* @param n
*/
-(void) addPrint:(int) m :(int) n;
/**
* 方法说明:获得打印命令
*/
-(NSData*) getCommand;
/**
* 方法说明:将字符串转成十六进制码
* @param str 命令字符串
*/
-(void) addStrToCommand:(NSString *) str;
-(void) addNSDataToCommand:(NSData*) data;
/**
* 方法说明:发送一些TSC的固定命令,在cls命令之前发送
*/
-(void) addComonCommand;
/**
* 方法说明:打印自检页,打印测试页
*/
-(void) addSelfTest;
/**
* 方法说明 :查询打印机型号
*/
-(void) queryPrinterType;
/**
* 方法说明:设定黑标高度及定义标签印完后标签额外送出的长度
* @param m 黑标高度(0≤m≤1(inch),0≤m≤25.4(mm))
* @param n 额外送出纸张长度 n≤标签纸纸张长度(inch或mm)
*/
-(void)addBLine:(int)m :(int)n;
/**
* 方法说明:设定黑标高度及定义标签印完后标签额外送出的长度
* @param m 黑标高度(0≤m≤1(inch),0≤m≤25.4(mm))
* @param n 额外送出纸张长度 n≤标签纸纸张长度(inch或mm)
*/
-(void)addNewBLine:(int)m :(int)n;
/**
* 方法说明:设置打印机剥离模式
* @param peel ON/OFF 是否开启
*/
-(void) addPeel:(NSString *) peel;
/**
* 方法说明:设置打印机撕离模式
* @param tear ON/OFF 是否开启
*/
-(void) addTear:(NSString *) tear;
/**
* 方法说明:设置切刀是否有效
* @param cutter 是否开启 OFF/pieces (0<=pieces<=127)设定几张标签切一次
*/
-(void) addCutter:(NSString *) cutter;
/**
* 方法说明:设置切刀半切是否有效
* @param cutter 是否开启
*/
-(void) addPartialCutter:(NSString *) cutter;
/**
* 方法说明:设置蜂鸣器
* @param level 频率
* @param interval 时间ms
*/
-(void) addSound:(int) level :(int) interval;
/**
* 方法说明:打开钱箱命令,CASHDRAWER m,t1,t2
* @param m 钱箱号 m 0,48 钱箱插座的引脚2 1,49 钱箱插座的引脚5
* @param t1 高电平时间0 ≤ t1 ≤ 255输出由t1和t2设定的钱箱开启脉冲到由m指定的引脚
* @param t2 低电平时间0 ≤ t2 ≤ 255输出由t1和t2设定的钱箱开启脉冲到由m指定的引脚
*/
-(void) addCashdrawer:(int) m :(int) t1 :(int) t2;
/**
* 方法说明:在标签上绘制黑块,画线
* @param x 起始横坐标
* @param y 起始纵坐标
* @param width 线宽,以点(dot)表示
* @param height 线高,以点(dot)表示
*/
-(void) addBar:(int) x :(int) y :(int) width :(int) height;
/**
* 方法说明:在标签上绘制矩形
* @param xStart 起始横坐标
* @param yStart 起始纵坐标
* @param xEnd 终点横坐标
* @param yEnd 终点纵坐标
* @param lineThickness 矩形框线厚度或宽度,以点(dot)表示
*/
-(void) addBox:(int) xStart :(int) yStart :(int) xEnd :(int) yEnd :(int) lineThickness;
/**
* 方法说明:查询打印机状态<ESC>!?
*询问打印机状态指令为立即响应型指令,该指令控制字符是以<ESC> (ASCII 27=0x1B, escape字符)为控制字符.!(ASCII 33=0x21),?(ASCII 63=0x3F)
*即使打印机在错误状态中仍能透过 RS-232 回传一个 byte 资料来表示打印机状态,若回传值为 0 则表示打印
*机处于正常的状态
*/
-(void) queryPrinterStatus;
/**
* 方法说明:将指定的区域反向打印(黑色变成白色,白色变成黑色)
* @param xStart 起始横坐标
* @param yStart 起始横坐标
* @param xWidth X坐标方向宽度,dot为单位
* @param yHeight Y坐标方向高度,dot为单位
*/
-(void) addReverse:(int) xStart :(int) yStart :(int) xWidth :(int) yHeight;
/**
* 方法说明: 打印机打印完成时,自动返回状态。可用于实现连续打印功能
* @param response 自动返回状态 <a>@see Response</a>
* OFF 关闭自动返回状态功能
* ON 开启自动返回状态功能
* BATCH 全部打印完成后返回状态
*/
-(void)addQueryPrinterStatus:(Response)response;
/**
* 方法说明: 查询打印机电量。
* <p>返回值: 31(低电量);32 (中电量);33 (高电量);35 (正在充电)</p>
*
*/
-(void)queryElectricity;
@end
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3957A4F8F4B8823C2472883F7D067592"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "39082CE2CA8065D786A75F5C09CFF2C0"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "971676D1C9A11C105647D995975ACE4F"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "54F872FDE6669F86C58C8075211FE643"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EAAA1AD3A8A1B59AB91319EE40752C6D"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "99313990C1D76A6D1D017868B6975CC8"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F798030A13A5E43528C860AD809CD390"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00D9B51B84230E50370AC70ADCF7F8AA"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B490E7485944099E16C9CBD79119D1D4"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E8572772A2B42B68FDF351C752B8A238"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E8022D22FAA6690B5E1C379C1BCE1491"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FD999FE212F29E29DEEA0A85E1DC4D4E"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6868056D761E163D10FDAF8CF1C4D9B8"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "162E649F50FEC62B61BDD87D1BD422B4"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3847153A6E5EEFB86565BA840768F429"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8CEEFD1CB630CA790F0396E2E24A4C8C"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "19622742EBA51E823D6DAE3F8CDBFAD4"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6038CE6006EFBE9D905454CF01909C42"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5D8BB851D938AE8F1A461F95C1ABD69B"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D118A6A04828FD3CDA8640CD2B6796D2"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "91BFC2827E7E6E2B51AB2CFF58AC6317"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "930887923DC0E8AC2A3589A7987F2BDD"
......@@ -23,15 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......@@ -39,14 +38,17 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
......@@ -105,7 +105,7 @@ You can use those directly, or create similar components of your own, by using t
- For iOS 8, macOS 10.10 or Xcode < 11, use [any 5.x version up to 5.9.5](https://github.com/SDWebImage/SDWebImage/releases/tag/5.9.5)
- For iOS 7, macOS 10.9 or Xcode < 8, use [any 4.x version up to 4.4.6](https://github.com/SDWebImage/SDWebImage/releases/tag/4.4.6)
- For macOS 10.8, use [any 4.x version up to 4.3.0](https://github.com/SDWebImage/SDWebImage/releases/tag/4.3.0)
- For iOS 5 and 6, use [any 3.x version up to 3.7.6](https://github.com/SDWebImage/SDWebImage/tag/3.7.6)
- For iOS 5 and 6, use [any 3.x version up to 3.7.6](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.6)
- For iOS < 5.0, please use the last [2.0 version](https://github.com/SDWebImage/SDWebImage/tree/2.0-compat).
## Getting Started
......
......@@ -361,7 +361,13 @@ static NSString * _defaultDiskCacheDirectory;
- (nullable UIImage *)imageFromDiskCacheForKey:(nullable NSString *)key options:(SDImageCacheOptions)options context:(nullable SDWebImageContext *)context {
NSData *data = [self diskImageDataForKey:key];
UIImage *diskImage = [self diskImageForKey:key data:data options:options context:context];
if (diskImage && self.config.shouldCacheImagesInMemory) {
BOOL shouldCacheToMomery = YES;
if (context[SDWebImageContextStoreCacheType]) {
SDImageCacheType cacheType = [context[SDWebImageContextStoreCacheType] integerValue];
shouldCacheToMomery = (cacheType == SDImageCacheTypeAll || cacheType == SDImageCacheTypeMemory);
}
if (diskImage && self.config.shouldCacheImagesInMemory && shouldCacheToMomery) {
NSUInteger cost = diskImage.sd_memoryCost;
[self.memoryCache setObject:diskImage forKey:key cost:cost];
}
......
......@@ -452,7 +452,7 @@ didReceiveResponse:(NSURLResponse *)response
[self done];
} else {
if ([self callbacksForKey:kCompletedCallbackKey].count > 0) {
NSData *imageData = [self.imageData copy];
NSData *imageData = self.imageData;
self.imageData = nil;
// data decryptor
if (imageData && self.decryptor) {
......
![](Assets/header2.jpg)
<p align="center">
<a href="https://github.com/Juanpe/SkeletonView/workflows/build">
<img src="https://github.com/Juanpe/SkeletonView/workflows/build/badge.svg">
<a href="https://github.com/Juanpe/SkeletonView/actions?query=workflow%3ACI">
<img src="https://github.com/Juanpe/SkeletonView/workflows/CI/badge.svg">
</a>
<a href="https://codebeat.co/projects/github-com-juanpe-skeletonview-master"><img alt="codebeat badge" src="https://codebeat.co/badges/f854fdfd-31e5-4689-ba04-075d83653e60" /></a>
<img src="http://img.shields.io/badge/dependency%20manager-swiftpm%2Bcocoapods%2Bcarthage-green" />
......@@ -19,7 +19,7 @@
<a href="#️-contributing">Contributing</a>
</p>
**🌎 README is available in other languages: [🇪🇸](https://github.com/Juanpe/SkeletonView/blob/develop/README_es.md) . [🇨🇳](https://github.com/Juanpe/SkeletonView/blob/master/README_zh.md) . [🇧🇷](https://github.com/Juanpe/SkeletonView/blob/master/README_pt-br.md) . [🇰🇷](https://github.com/Juanpe/SkeletonView/blob/master/README_ko.md) . [🇫🇷](https://github.com/Juanpe/SkeletonView/blob/master/README_fr.md)**
**🌎 README is available in other languages: [🇪🇸](https://github.com/Juanpe/SkeletonView/blob/main/README_es.md) . [🇨🇳](https://github.com/Juanpe/SkeletonView/blob/master/README_zh.md) . [🇧🇷](https://github.com/Juanpe/SkeletonView/blob/master/README_pt-br.md) . [🇰🇷](https://github.com/Juanpe/SkeletonView/blob/master/README_ko.md) . [🇫🇷](https://github.com/Juanpe/SkeletonView/blob/master/README_fr.md)**
Today almost all apps have async processes, such as API requests, long running processes, etc. While the processes are working, usually developers place a loading view to show users that something is going on.
......@@ -28,7 +28,7 @@ Today almost all apps have async processes, such as API requests, long running p
Enjoy it! 🙂
##
##
- [🌟 Features](#-features)
- [🎬 Guides](#-guides)
- [📲 Installation](#-installation)
......@@ -37,10 +37,14 @@ Enjoy it! 🙂
- [🔠 Texts](#-texts)
- [🦋 Appearance](#-appearance)
- [🎨 Custom colors](#-custom-colors)
- [ 🏃‍♀️ Animations](#%EF%B8%8F-animations)
- [Image captured from website https://flatuicolors.com](#image-captured-from-website-httpsflatuicolorscom)
- [🏃‍♀️ Animations](#️-animations)
- [🏄 Transitions](#-transitions)
- [✨ Miscellaneous](#-miscellaneous)
- [❤️ Contributing](#️-contributing)
- [📢 Mentions](#-mentions)
- [👨🏻‍💻 Author](#-author)
- [👮🏻 License](#-license)
......@@ -527,7 +531,7 @@ This is an open source project, so feel free to contribute. How?
See [all contributors](https://github.com/Juanpe/SkeletonView/graphs/contributors)
For more information, please read the [contributing guidelines](https://github.com/Juanpe/SkeletonView/blob/develop/CONTRIBUTING.md).
For more information, please read the [contributing guidelines](https://github.com/Juanpe/SkeletonView/blob/main/CONTRIBUTING.md).
## 📢 Mentions
......
......@@ -29,6 +29,14 @@ extension CollectionSkeleton where Self: UIScrollView {
var estimatedNumberOfRows: Int { return 0 }
func addDummyDataSource() {}
func removeDummyDataSource(reloadAfter: Bool) {}
func disableUserInteraction() { isUserInteractionEnabled = false; isScrollEnabled = false }
func enableUserInteraction() { isUserInteractionEnabled = true; isScrollEnabled = true }
func disableUserInteraction() {
isUserInteractionEnabled = false
isScrollEnabled = false
}
func enableUserInteraction() {
isUserInteractionEnabled = true
isScrollEnabled = true
}
}
......@@ -28,11 +28,11 @@ class SkeletonCollectionDataSource: NSObject {
// MARK: - UITableViewDataSource
extension SkeletonCollectionDataSource: UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return originalTableViewDataSource?.numSections(in: tableView) ?? 0
originalTableViewDataSource?.numSections(in: tableView) ?? 0
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return originalTableViewDataSource?.collectionSkeletonView(tableView, numberOfRowsInSection: section) ?? 0
originalTableViewDataSource?.collectionSkeletonView(tableView, numberOfRowsInSection: section) ?? 0
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
......@@ -46,11 +46,11 @@ extension SkeletonCollectionDataSource: UITableViewDataSource {
// MARK: - UICollectionViewDataSource
extension SkeletonCollectionDataSource: UICollectionViewDataSource {
func numberOfSections(in collectionView: UICollectionView) -> Int {
return originalCollectionViewDataSource?.numSections(in: collectionView) ?? 0
originalCollectionViewDataSource?.numSections(in: collectionView) ?? 0
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return originalCollectionViewDataSource?.collectionSkeletonView(collectionView, numberOfItemsInSection: section) ?? 0
originalCollectionViewDataSource?.collectionSkeletonView(collectionView, numberOfItemsInSection: section) ?? 0
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
......
......@@ -21,23 +21,11 @@ class SkeletonCollectionDelegate: NSObject {
// MARK: - UITableViewDelegate
extension SkeletonCollectionDelegate: UITableViewDelegate {
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if let viewIdentifier = originalTableViewDelegate?.collectionSkeletonView(tableView, identifierForHeaderInSection: section),
let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: viewIdentifier) {
skeletonViewIfContainerSkeletonIsActive(container: tableView, view: header)
return header
}
return nil
headerOrFooterView(tableView, for: originalTableViewDelegate?.collectionSkeletonView(tableView, identifierForHeaderInSection: section))
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
if let viewIdentifier = originalTableViewDelegate?.collectionSkeletonView(tableView, identifierForFooterInSection: section),
let footer = tableView.dequeueReusableHeaderFooterView(withIdentifier: viewIdentifier) {
skeletonViewIfContainerSkeletonIsActive(container: tableView, view: footer)
return footer
}
return nil
headerOrFooterView(tableView, for: originalTableViewDelegate?.collectionSkeletonView(tableView, identifierForHeaderInSection: section))
}
func tableView(_ tableView: UITableView, didEndDisplayingHeaderView view: UIView, forSection section: Int) {
......@@ -54,6 +42,12 @@ extension SkeletonCollectionDelegate: UITableViewDelegate {
cell.hideSkeleton()
originalTableViewDelegate?.tableView?(tableView, didEndDisplaying: cell, forRowAt: indexPath)
}
private func headerOrFooterView(_ tableView: UITableView, for viewIdentifier: String? ) -> UIView? {
guard let viewIdentifier = viewIdentifier, let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: viewIdentifier) else { return nil }
skeletonViewIfContainerSkeletonIsActive(container: tableView, view: header)
return header
}
}
// MARK: - UICollectionViewDelegate
......
......@@ -152,7 +152,8 @@ public extension CALayer {
var pulse: CAAnimation {
let pulseAnimation = CABasicAnimation(keyPath: #keyPath(CALayer.backgroundColor))
pulseAnimation.fromValue = backgroundColor
//swiftlint:disable:next force_unwrapping
// swiftlint:disable:next force_unwrapping
pulseAnimation.toValue = UIColor(cgColor: backgroundColor!).complementaryColor.cgColor
pulseAnimation.duration = 1
pulseAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
......
......@@ -4,10 +4,10 @@ import Foundation
extension Int {
var whitespace: String {
return whitespaces
whitespaces
}
var whitespaces: String {
return String(repeating: " ", count: self)
String(repeating: " ", count: self)
}
}
......@@ -31,11 +31,11 @@ extension UIColor {
}
public var lighter: UIColor {
return adjust(by: 1.35)
adjust(by: 1.35)
}
public var darker: UIColor {
return adjust(by: 0.94)
adjust(by: 0.94)
}
func adjust(by percent: CGFloat) -> UIColor {
......@@ -45,7 +45,7 @@ extension UIColor {
}
func makeGradient() -> [UIColor] {
return [self, self.complementaryColor, self]
[self, self.complementaryColor, self]
}
}
......
......@@ -2,7 +2,7 @@
import Foundation
//Partially copy/pasted from https://github.com/jameslintaylor/AssociatedObjects/blob/master/AssociatedObjects/AssociatedObjects.swift
// Partially copy/pasted from https://github.com/jameslintaylor/AssociatedObjects/blob/master/AssociatedObjects/AssociatedObjects.swift
enum AssociationPolicy: UInt {
// raw values map to objc_AssociationPolicy's raw values
case assign = 0
......@@ -17,7 +17,7 @@ enum AssociationPolicy: UInt {
}
}
protocol AssociatedObjects: class { }
protocol AssociatedObjects: AnyObject { }
// transparent wrappers
extension AssociatedObjects {
......
......@@ -10,16 +10,16 @@ import UIKit
extension UIView {
@objc func prepareViewForSkeleton() {
isUserInteractionEnabled = false
startTransition { [weak self] in
self?.backgroundColor = .clear
self?.isUserInteractionEnabled = false
}
}
}
extension UILabel {
var desiredHeightBasedOnNumberOfLines: CGFloat {
let lineHeight = multilineTextFont?.lineHeight ?? SkeletonAppearance.default.multilineHeight
let lineHeight = constraintHeight ?? SkeletonAppearance.default.multilineHeight
let spaceNeededForEachLine = lineHeight * CGFloat(numberOfLines)
let spaceNeededForSpaces = skeletonLineSpacing * CGFloat(numberOfLines - 1)
let padding = paddingInsets.top + paddingInsets.bottom
......@@ -39,14 +39,17 @@ extension UILabel {
}
func restoreBackupHeightConstraints() {
heightConstraints.forEach {
removeConstraint($0)
}
guard !backupHeightConstraints.isEmpty else { return }
NSLayoutConstraint.deactivate(heightConstraints)
NSLayoutConstraint.activate(backupHeightConstraints)
backupHeightConstraints.removeAll()
}
override func prepareViewForSkeleton() {
backgroundColor = .clear
isUserInteractionEnabled = false
resignFirstResponder()
startTransition { [weak self] in
self?.updateHeightConstraintsIfNeeded()
......@@ -58,6 +61,7 @@ extension UILabel {
extension UITextView {
override func prepareViewForSkeleton() {
backgroundColor = .clear
isUserInteractionEnabled = false
resignFirstResponder()
startTransition { [weak self] in
self?.textColor = .clear
......@@ -65,9 +69,22 @@ extension UITextView {
}
}
extension UITextField {
override func prepareViewForSkeleton() {
backgroundColor = .clear
resignFirstResponder()
startTransition { [weak self] in
self?.textColor = .clear
self?.placeholder = nil
}
}
}
extension UIImageView {
override func prepareViewForSkeleton() {
backgroundColor = .clear
isUserInteractionEnabled = false
startTransition { [weak self] in
self?.image = nil
}
......@@ -77,6 +94,7 @@ extension UIImageView {
extension UIButton {
override func prepareViewForSkeleton() {
backgroundColor = .clear
isUserInteractionEnabled = false
startTransition { [weak self] in
self?.setTitle(nil, for: .normal)
}
......
......@@ -11,7 +11,7 @@ enum MultilineAssociatedKeys {
}
protocol ContainsMultilineText {
var multilineTextFont: UIFont? { get }
var constraintHeight: CGFloat? { get }
var numLines: Int { get }
var lastLineFillingPercent: Int { get }
var multilineCornerRadius: Int { get }
......
......@@ -12,13 +12,13 @@ public extension UILabel {
@IBInspectable
var linesCornerRadius: Int {
get { return multilineCornerRadius }
set { multilineCornerRadius = min(newValue, 10) }
set { multilineCornerRadius = newValue }
}
@IBInspectable
var skeletonLineSpacing: CGFloat {
get { return multilineSpacing }
set { multilineSpacing = min(newValue, 10) }
set { multilineSpacing = newValue }
}
var skeletonPaddingInsets: UIEdgeInsets {
......@@ -28,10 +28,10 @@ public extension UILabel {
}
extension UILabel: ContainsMultilineText {
var multilineTextFont: UIFont? {
return font
}
var constraintHeight: CGFloat? {
backupHeightConstraints.first?.constant
}
var numLines: Int {
return numberOfLines
}
......
......@@ -12,13 +12,13 @@ public extension UITextView {
@IBInspectable
var linesCornerRadius: Int {
get { return multilineCornerRadius }
set { multilineCornerRadius = min(newValue, 10) }
set { multilineCornerRadius = newValue }
}
@IBInspectable
var skeletonLineSpacing: CGFloat {
get { return multilineSpacing }
set { multilineSpacing = min(newValue, 10) }
set { multilineSpacing = newValue }
}
var skeletonPaddingInsets: UIEdgeInsets {
......@@ -28,8 +28,8 @@ public extension UITextView {
}
extension UITextView: ContainsMultilineText {
var multilineTextFont: UIFont? {
font
var constraintHeight: CGFloat? {
heightConstraints.first?.constant
}
var numLines: Int {
......
......@@ -86,6 +86,33 @@ extension UITextView {
}
}
extension UITextField {
var textState: RecoverableTextFieldState? {
get { return ao_get(pkey: &ViewAssociatedKeys.labelViewState) as? RecoverableTextFieldState }
set { ao_setOptional(newValue, pkey: &ViewAssociatedKeys.labelViewState) }
}
override func saveViewState() {
super.saveViewState()
textState = RecoverableTextFieldState(view: self)
}
override func recoverViewState(forced: Bool) {
super.recoverViewState(forced: forced)
startTransition { [weak self] in
guard let storedLabelState = self?.textState else { return }
if self?.textColor == .clear || forced {
self?.textColor = storedLabelState.textColor
}
if self?.placeholder == nil || forced {
self?.placeholder = storedLabelState.placeholder
}
}
}
}
extension UIImageView {
var imageState: RecoverableImageViewState? {
get { return ao_get(pkey: &ViewAssociatedKeys.imageViewState) as? RecoverableImageViewState }
......
......@@ -34,6 +34,16 @@ struct RecoverableTextViewState {
}
}
struct RecoverableTextFieldState {
var textColor: UIColor?
var placeholder: String?
init(view: UITextField) {
self.textColor = view.textColor
self.placeholder = view.placeholder
}
}
struct RecoverableImageViewState {
var image: UIImage?
......
......@@ -63,7 +63,7 @@ public class SkeletonAnimationBuilder {
public init() { }
public func makeSlidingAnimation(withDirection direction: GradientDirection, duration: CFTimeInterval = 1.5, autoreverses: Bool = false) -> SkeletonLayerAnimation {
return { layer in
return { _ in
let startPointAnim = CABasicAnimation(keyPath: #keyPath(CAGradientLayer.startPoint))
startPointAnim.fromValue = direction.startPoint.from
startPointAnim.toValue = direction.startPoint.to
......
......@@ -83,7 +83,7 @@ struct SkeletonLayer {
/// If there is more than one line, or custom preferences have been set for a single line, draw custom layers
func addTextLinesIfNeeded() {
guard let textView = holderAsTextView else { return }
let lineHeight = textView.multilineTextFont?.lineHeight ?? SkeletonAppearance.default.multilineHeight
let lineHeight = textView.constraintHeight ?? SkeletonAppearance.default.multilineHeight
let config = SkeletonMultilinesLayerConfig(lines: textView.numLines,
lineHeight: lineHeight,
type: type,
......@@ -98,7 +98,7 @@ struct SkeletonLayer {
func updateLinesIfNeeded() {
guard let textView = holderAsTextView else { return }
let lineHeight = textView.multilineTextFont?.lineHeight ?? SkeletonAppearance.default.multilineHeight
let lineHeight = textView.constraintHeight ?? SkeletonAppearance.default.multilineHeight
let config = SkeletonMultilinesLayerConfig(lines: textView.numLines,
lineHeight: lineHeight,
type: type,
......
......@@ -136,7 +136,7 @@ extension UIView {
private func showSkeletonIfNotActive(skeletonConfig config: SkeletonConfig) {
guard !isSkeletonActive else { return }
saveViewState()
isUserInteractionEnabled = false
prepareViewForSkeleton()
addSkeletonLayer(skeletonConfig: config)
}
......@@ -190,7 +190,6 @@ extension UIView {
isHidden = false
}
currentSkeletonConfig?.transition = transition
isUserInteractionEnabled = true
removeDummyDataSourceIfNeeded(reloadAfter: reload)
subviewsSkeletonables.recursiveSearch(leafBlock: {
recoverViewState(forced: false)
......
......@@ -4,46 +4,46 @@ import UIKit
extension UIView {
@objc var subviewsSkeletonables: [UIView] {
return subviewsToSkeleton.filter { $0.isSkeletonable }
subviewsToSkeleton.filter { $0.isSkeletonable }
}
@objc var subviewsToSkeleton: [UIView] {
return subviews
subviews
}
}
extension UITableView {
override var subviewsToSkeleton: [UIView] {
return visibleCells + visibleSectionHeaders + visibleSectionFooters
visibleCells + visibleSectionHeaders + visibleSectionFooters
}
}
extension UITableViewCell {
override var subviewsToSkeleton: [UIView] {
return contentView.subviews
contentView.subviews
}
}
extension UITableViewHeaderFooterView {
override var subviewsToSkeleton: [UIView] {
return contentView.subviews
contentView.subviews
}
}
extension UICollectionView {
override var subviewsToSkeleton: [UIView] {
return subviews
subviews
}
}
extension UICollectionViewCell {
override var subviewsToSkeleton: [UIView] {
return contentView.subviews
contentView.subviews
}
}
extension UIStackView {
override var subviewsToSkeleton: [UIView] {
return arrangedSubviews
arrangedSubviews
}
}
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.10.2</string>
<string>5.10.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.11.0</string>
<string>1.13.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
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