新增调试工具

This commit is contained in:
liyuhua
2023-11-09 15:26:14 +08:00
parent 4285c2b6c7
commit 92844a9619
75 changed files with 5235 additions and 94 deletions

View File

@@ -303,6 +303,35 @@
23B2AEC42A6516C200543D17 /* LoginForgetPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2AEC22A6516C200543D17 /* LoginForgetPasswordViewController.m */; };
23BA165B2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23BA165A2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m */; };
23C7C0B72A7CD7B000802205 /* XPNewMineGuildItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C7C0B62A7CD7B000802205 /* XPNewMineGuildItemView.m */; };
23CEFB6C2AFB803B00576D89 /* PISwitchingEnvironmentVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFB6B2AFB803B00576D89 /* PISwitchingEnvironmentVC.m */; };
23CEFC4A2AFB8FC100576D89 /* BSNSStringUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC0C2AFB8FC100576D89 /* BSNSStringUtil.m */; };
23CEFC4B2AFB8FC100576D89 /* BSUIDemoUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC0D2AFB8FC100576D89 /* BSUIDemoUtil.m */; };
23CEFC4C2AFB8FC100576D89 /* BS_UIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC0F2AFB8FC100576D89 /* BS_UIColor.m */; };
23CEFC4D2AFB8FC100576D89 /* BSXWDateUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC102AFB8FC100576D89 /* BSXWDateUtil.m */; };
23CEFC4E2AFB8FC100576D89 /* BSNSDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC132AFB8FC100576D89 /* BSNSDictionary.m */; };
23CEFC4F2AFB8FC100576D89 /* BSSDLayoutUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC172AFB8FC100576D89 /* BSSDLayoutUtil.m */; };
23CEFC502AFB8FC100576D89 /* UILabel+YBAttributeTextTapAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC1D2AFB8FC100576D89 /* UILabel+YBAttributeTextTapAction.m */; };
23CEFC512AFB8FC100576D89 /* SystemUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC1E2AFB8FC100576D89 /* SystemUtil.m */; };
23CEFC522AFB8FC100576D89 /* BSFileOptionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC222AFB8FC100576D89 /* BSFileOptionModel.m */; };
23CEFC532AFB8FC100576D89 /* readMe_FileOption.txt in Resources */ = {isa = PBXBuildFile; fileRef = 23CEFC232AFB8FC100576D89 /* readMe_FileOption.txt */; };
23CEFC542AFB8FC100576D89 /* BSNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC262AFB8FC100576D89 /* BSNotification.m */; };
23CEFC552AFB8FC100576D89 /* pay_off@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 23CEFC292AFB8FC100576D89 /* pay_off@3x.png */; };
23CEFC562AFB8FC100576D89 /* pay_off.png in Resources */ = {isa = PBXBuildFile; fileRef = 23CEFC2A2AFB8FC100576D89 /* pay_off.png */; };
23CEFC572AFB8FC100576D89 /* pay_off@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 23CEFC2B2AFB8FC100576D89 /* pay_off@2x.png */; };
23CEFC582AFB8FC100576D89 /* pay_on@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 23CEFC2C2AFB8FC100576D89 /* pay_on@3x.png */; };
23CEFC592AFB8FC100576D89 /* pay_on@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 23CEFC2E2AFB8FC100576D89 /* pay_on@2x.png */; };
23CEFC5A2AFB8FC100576D89 /* pay_on.png in Resources */ = {isa = PBXBuildFile; fileRef = 23CEFC2F2AFB8FC100576D89 /* pay_on.png */; };
23CEFC5B2AFB8FC100576D89 /* BSSelectView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC302AFB8FC100576D89 /* BSSelectView.m */; };
23CEFC5C2AFB8FC100576D89 /* BSNetListenModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC312AFB8FC100576D89 /* BSNetListenModel.m */; };
23CEFC5D2AFB8FC100576D89 /* BSRecordModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC342AFB8FC100576D89 /* BSRecordModel.m */; };
23CEFC5E2AFB8FC100576D89 /* BSRealTimeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC372AFB8FC100576D89 /* BSRealTimeView.m */; };
23CEFC5F2AFB8FC100576D89 /* BSLogTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC392AFB8FC100576D89 /* BSLogTableViewController.m */; };
23CEFC602AFB8FC100576D89 /* RealViewCellModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC3D2AFB8FC100576D89 /* RealViewCellModel.m */; };
23CEFC612AFB8FC100576D89 /* RealViewNetWorkCell_0.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC402AFB8FC100576D89 /* RealViewNetWorkCell_0.m */; };
23CEFC622AFB8FC100576D89 /* BSLogNetDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC422AFB8FC100576D89 /* BSLogNetDetailViewController.m */; };
23CEFC632AFB8FC100576D89 /* BSRealTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC442AFB8FC100576D89 /* BSRealTextView.m */; };
23CEFC642AFB8FC100576D89 /* BSkObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC472AFB8FC100576D89 /* BSkObject.m */; };
23CEFC652AFB8FC100576D89 /* BSDrawLine.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFC482AFB8FC100576D89 /* BSDrawLine.m */; };
23D321D22ADD0EBC006B259C /* PIRoomPhotoAlbumItemPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 23D321D12ADD0EBC006B259C /* PIRoomPhotoAlbumItemPresenter.m */; };
23D321D52ADD0F05006B259C /* Api+PhotoAlbum.m in Sources */ = {isa = PBXBuildFile; fileRef = 23D321D42ADD0F05006B259C /* Api+PhotoAlbum.m */; };
23D321D92ADD1B46006B259C /* PIRoomPhotoAlbumItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23D321D82ADD1B46006B259C /* PIRoomPhotoAlbumItemModel.m */; };
@@ -2035,6 +2064,58 @@
23BA165A2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIBaseAnimationViewModel.m; sourceTree = "<group>"; };
23C7C0B52A7CD7B000802205 /* XPNewMineGuildItemView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewMineGuildItemView.h; sourceTree = "<group>"; };
23C7C0B62A7CD7B000802205 /* XPNewMineGuildItemView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewMineGuildItemView.m; sourceTree = "<group>"; };
23CEFB6A2AFB803B00576D89 /* PISwitchingEnvironmentVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PISwitchingEnvironmentVC.h; sourceTree = "<group>"; };
23CEFB6B2AFB803B00576D89 /* PISwitchingEnvironmentVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PISwitchingEnvironmentVC.m; sourceTree = "<group>"; };
23CEFC0B2AFB8FC100576D89 /* BSXWDateUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSXWDateUtil.h; sourceTree = "<group>"; };
23CEFC0C2AFB8FC100576D89 /* BSNSStringUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSNSStringUtil.m; sourceTree = "<group>"; };
23CEFC0D2AFB8FC100576D89 /* BSUIDemoUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSUIDemoUtil.m; sourceTree = "<group>"; };
23CEFC0E2AFB8FC100576D89 /* BSNSDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSNSDictionary.h; sourceTree = "<group>"; };
23CEFC0F2AFB8FC100576D89 /* BS_UIColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BS_UIColor.m; sourceTree = "<group>"; };
23CEFC102AFB8FC100576D89 /* BSXWDateUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSXWDateUtil.m; sourceTree = "<group>"; };
23CEFC112AFB8FC100576D89 /* BSUIDemoUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSUIDemoUtil.h; sourceTree = "<group>"; };
23CEFC122AFB8FC100576D89 /* BSNSStringUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSNSStringUtil.h; sourceTree = "<group>"; };
23CEFC132AFB8FC100576D89 /* BSNSDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSNSDictionary.m; sourceTree = "<group>"; };
23CEFC142AFB8FC100576D89 /* BS_UIColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BS_UIColor.h; sourceTree = "<group>"; };
23CEFC172AFB8FC100576D89 /* BSSDLayoutUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSSDLayoutUtil.m; sourceTree = "<group>"; };
23CEFC182AFB8FC100576D89 /* BSSDLayoutUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSSDLayoutUtil.h; sourceTree = "<group>"; };
23CEFC1A2AFB8FC100576D89 /* SystemUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SystemUtil.h; sourceTree = "<group>"; };
23CEFC1B2AFB8FC100576D89 /* UILabel+YBAttributeTextTapAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UILabel+YBAttributeTextTapAction.h"; sourceTree = "<group>"; };
23CEFC1C2AFB8FC100576D89 /* BS_Define.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BS_Define.h; sourceTree = "<group>"; };
23CEFC1D2AFB8FC100576D89 /* UILabel+YBAttributeTextTapAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+YBAttributeTextTapAction.m"; sourceTree = "<group>"; };
23CEFC1E2AFB8FC100576D89 /* SystemUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SystemUtil.m; sourceTree = "<group>"; };
23CEFC212AFB8FC100576D89 /* BSFileOptionModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSFileOptionModel.h; sourceTree = "<group>"; };
23CEFC222AFB8FC100576D89 /* BSFileOptionModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSFileOptionModel.m; sourceTree = "<group>"; };
23CEFC232AFB8FC100576D89 /* readMe_FileOption.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = readMe_FileOption.txt; sourceTree = "<group>"; };
23CEFC252AFB8FC100576D89 /* BSNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSNotification.h; sourceTree = "<group>"; };
23CEFC262AFB8FC100576D89 /* BSNotification.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSNotification.m; sourceTree = "<group>"; };
23CEFC292AFB8FC100576D89 /* pay_off@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pay_off@3x.png"; sourceTree = "<group>"; };
23CEFC2A2AFB8FC100576D89 /* pay_off.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pay_off.png; sourceTree = "<group>"; };
23CEFC2B2AFB8FC100576D89 /* pay_off@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pay_off@2x.png"; sourceTree = "<group>"; };
23CEFC2C2AFB8FC100576D89 /* pay_on@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pay_on@3x.png"; sourceTree = "<group>"; };
23CEFC2D2AFB8FC100576D89 /* BSSelectView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSSelectView.h; sourceTree = "<group>"; };
23CEFC2E2AFB8FC100576D89 /* pay_on@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pay_on@2x.png"; sourceTree = "<group>"; };
23CEFC2F2AFB8FC100576D89 /* pay_on.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pay_on.png; sourceTree = "<group>"; };
23CEFC302AFB8FC100576D89 /* BSSelectView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSSelectView.m; sourceTree = "<group>"; };
23CEFC312AFB8FC100576D89 /* BSNetListenModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSNetListenModel.m; sourceTree = "<group>"; };
23CEFC322AFB8FC100576D89 /* BSNetListenModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSNetListenModel.h; sourceTree = "<group>"; };
23CEFC342AFB8FC100576D89 /* BSRecordModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSRecordModel.m; sourceTree = "<group>"; };
23CEFC352AFB8FC100576D89 /* BSRecordModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSRecordModel.h; sourceTree = "<group>"; };
23CEFC372AFB8FC100576D89 /* BSRealTimeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSRealTimeView.m; sourceTree = "<group>"; };
23CEFC382AFB8FC100576D89 /* BSRealTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSRealTextView.h; sourceTree = "<group>"; };
23CEFC392AFB8FC100576D89 /* BSLogTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSLogTableViewController.m; sourceTree = "<group>"; };
23CEFC3A2AFB8FC100576D89 /* BSLogNetDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSLogNetDetailViewController.h; sourceTree = "<group>"; };
23CEFC3C2AFB8FC100576D89 /* RealViewCellModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RealViewCellModel.h; sourceTree = "<group>"; };
23CEFC3D2AFB8FC100576D89 /* RealViewCellModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RealViewCellModel.m; sourceTree = "<group>"; };
23CEFC3F2AFB8FC100576D89 /* RealViewNetWorkCell_0.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RealViewNetWorkCell_0.h; sourceTree = "<group>"; };
23CEFC402AFB8FC100576D89 /* RealViewNetWorkCell_0.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RealViewNetWorkCell_0.m; sourceTree = "<group>"; };
23CEFC412AFB8FC100576D89 /* BSRealTimeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSRealTimeView.h; sourceTree = "<group>"; };
23CEFC422AFB8FC100576D89 /* BSLogNetDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSLogNetDetailViewController.m; sourceTree = "<group>"; };
23CEFC432AFB8FC100576D89 /* BSLogTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSLogTableViewController.h; sourceTree = "<group>"; };
23CEFC442AFB8FC100576D89 /* BSRealTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSRealTextView.m; sourceTree = "<group>"; };
23CEFC462AFB8FC100576D89 /* BSDrawLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSDrawLine.h; sourceTree = "<group>"; };
23CEFC472AFB8FC100576D89 /* BSkObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSkObject.m; sourceTree = "<group>"; };
23CEFC482AFB8FC100576D89 /* BSDrawLine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSDrawLine.m; sourceTree = "<group>"; };
23CEFC492AFB8FC100576D89 /* BSkObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSkObject.h; sourceTree = "<group>"; };
23D321D02ADD0EBC006B259C /* PIRoomPhotoAlbumItemPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomPhotoAlbumItemPresenter.h; sourceTree = "<group>"; };
23D321D12ADD0EBC006B259C /* PIRoomPhotoAlbumItemPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomPhotoAlbumItemPresenter.m; sourceTree = "<group>"; };
23D321D32ADD0F05006B259C /* Api+PhotoAlbum.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+PhotoAlbum.h"; sourceTree = "<group>"; };
@@ -4689,6 +4770,7 @@
189DD5A726DFA09700AB55B1 /* Tools */ = {
isa = PBXGroup;
children = (
23CEFC082AFB8FC100576D89 /* sdkContent */,
23FF255C2ABA8EEE0064E904 /* PIIAPTool */,
23E9EA9B2A84C42B00B792F2 /* SGYProgressView */,
23E9E9AB2A81E8E900B792F2 /* Event */,
@@ -5597,6 +5679,183 @@
path = Api;
sourceTree = "<group>";
};
23CEFC082AFB8FC100576D89 /* sdkContent */ = {
isa = PBXGroup;
children = (
23CEFC092AFB8FC100576D89 /* catagory */,
23CEFC1F2AFB8FC100576D89 /* content */,
);
path = sdkContent;
sourceTree = "<group>";
};
23CEFC092AFB8FC100576D89 /* catagory */ = {
isa = PBXGroup;
children = (
23CEFC0A2AFB8FC100576D89 /* Util */,
23CEFC152AFB8FC100576D89 /* 3Party */,
23CEFC192AFB8FC100576D89 /* system */,
);
path = catagory;
sourceTree = "<group>";
};
23CEFC0A2AFB8FC100576D89 /* Util */ = {
isa = PBXGroup;
children = (
23CEFC0B2AFB8FC100576D89 /* BSXWDateUtil.h */,
23CEFC0C2AFB8FC100576D89 /* BSNSStringUtil.m */,
23CEFC0D2AFB8FC100576D89 /* BSUIDemoUtil.m */,
23CEFC0E2AFB8FC100576D89 /* BSNSDictionary.h */,
23CEFC0F2AFB8FC100576D89 /* BS_UIColor.m */,
23CEFC102AFB8FC100576D89 /* BSXWDateUtil.m */,
23CEFC112AFB8FC100576D89 /* BSUIDemoUtil.h */,
23CEFC122AFB8FC100576D89 /* BSNSStringUtil.h */,
23CEFC132AFB8FC100576D89 /* BSNSDictionary.m */,
23CEFC142AFB8FC100576D89 /* BS_UIColor.h */,
);
path = Util;
sourceTree = "<group>";
};
23CEFC152AFB8FC100576D89 /* 3Party */ = {
isa = PBXGroup;
children = (
23CEFC162AFB8FC100576D89 /* fmdb */,
);
path = 3Party;
sourceTree = "<group>";
};
23CEFC162AFB8FC100576D89 /* fmdb */ = {
isa = PBXGroup;
children = (
23CEFC172AFB8FC100576D89 /* BSSDLayoutUtil.m */,
23CEFC182AFB8FC100576D89 /* BSSDLayoutUtil.h */,
);
path = fmdb;
sourceTree = "<group>";
};
23CEFC192AFB8FC100576D89 /* system */ = {
isa = PBXGroup;
children = (
23CEFC1A2AFB8FC100576D89 /* SystemUtil.h */,
23CEFC1B2AFB8FC100576D89 /* UILabel+YBAttributeTextTapAction.h */,
23CEFC1C2AFB8FC100576D89 /* BS_Define.h */,
23CEFC1D2AFB8FC100576D89 /* UILabel+YBAttributeTextTapAction.m */,
23CEFC1E2AFB8FC100576D89 /* SystemUtil.m */,
);
path = system;
sourceTree = "<group>";
};
23CEFC1F2AFB8FC100576D89 /* content */ = {
isa = PBXGroup;
children = (
23CEFC202AFB8FC100576D89 /* FileOption(文件操作) */,
23CEFC242AFB8FC100576D89 /* XWNotification(通知) */,
23CEFC272AFB8FC100576D89 /* NetListen(网络监听) */,
23CEFC452AFB8FC100576D89 /* K */,
);
path = content;
sourceTree = "<group>";
};
23CEFC202AFB8FC100576D89 /* FileOption(文件操作) */ = {
isa = PBXGroup;
children = (
23CEFC212AFB8FC100576D89 /* BSFileOptionModel.h */,
23CEFC222AFB8FC100576D89 /* BSFileOptionModel.m */,
23CEFC232AFB8FC100576D89 /* readMe_FileOption.txt */,
);
path = "FileOption(文件操作)";
sourceTree = "<group>";
};
23CEFC242AFB8FC100576D89 /* XWNotification(通知) */ = {
isa = PBXGroup;
children = (
23CEFC252AFB8FC100576D89 /* BSNotification.h */,
23CEFC262AFB8FC100576D89 /* BSNotification.m */,
);
path = "XWNotification(通知)";
sourceTree = "<group>";
};
23CEFC272AFB8FC100576D89 /* NetListen(网络监听) */ = {
isa = PBXGroup;
children = (
23CEFC282AFB8FC100576D89 /* component(组件) */,
23CEFC312AFB8FC100576D89 /* BSNetListenModel.m */,
23CEFC322AFB8FC100576D89 /* BSNetListenModel.h */,
23CEFC332AFB8FC100576D89 /* model */,
23CEFC362AFB8FC100576D89 /* RealTime(实时) */,
);
path = "NetListen(网络监听)";
sourceTree = "<group>";
};
23CEFC282AFB8FC100576D89 /* component(组件) */ = {
isa = PBXGroup;
children = (
23CEFC292AFB8FC100576D89 /* pay_off@3x.png */,
23CEFC2A2AFB8FC100576D89 /* pay_off.png */,
23CEFC2B2AFB8FC100576D89 /* pay_off@2x.png */,
23CEFC2C2AFB8FC100576D89 /* pay_on@3x.png */,
23CEFC2D2AFB8FC100576D89 /* BSSelectView.h */,
23CEFC2E2AFB8FC100576D89 /* pay_on@2x.png */,
23CEFC2F2AFB8FC100576D89 /* pay_on.png */,
23CEFC302AFB8FC100576D89 /* BSSelectView.m */,
);
path = "component(组件)";
sourceTree = "<group>";
};
23CEFC332AFB8FC100576D89 /* model */ = {
isa = PBXGroup;
children = (
23CEFC342AFB8FC100576D89 /* BSRecordModel.m */,
23CEFC352AFB8FC100576D89 /* BSRecordModel.h */,
);
path = model;
sourceTree = "<group>";
};
23CEFC362AFB8FC100576D89 /* RealTime(实时) */ = {
isa = PBXGroup;
children = (
23CEFC372AFB8FC100576D89 /* BSRealTimeView.m */,
23CEFC382AFB8FC100576D89 /* BSRealTextView.h */,
23CEFC392AFB8FC100576D89 /* BSLogTableViewController.m */,
23CEFC3A2AFB8FC100576D89 /* BSLogNetDetailViewController.h */,
23CEFC3B2AFB8FC100576D89 /* model */,
23CEFC3E2AFB8FC100576D89 /* view */,
23CEFC412AFB8FC100576D89 /* BSRealTimeView.h */,
23CEFC422AFB8FC100576D89 /* BSLogNetDetailViewController.m */,
23CEFC432AFB8FC100576D89 /* BSLogTableViewController.h */,
23CEFC442AFB8FC100576D89 /* BSRealTextView.m */,
);
path = "RealTime(实时)";
sourceTree = "<group>";
};
23CEFC3B2AFB8FC100576D89 /* model */ = {
isa = PBXGroup;
children = (
23CEFC3C2AFB8FC100576D89 /* RealViewCellModel.h */,
23CEFC3D2AFB8FC100576D89 /* RealViewCellModel.m */,
);
path = model;
sourceTree = "<group>";
};
23CEFC3E2AFB8FC100576D89 /* view */ = {
isa = PBXGroup;
children = (
23CEFC3F2AFB8FC100576D89 /* RealViewNetWorkCell_0.h */,
23CEFC402AFB8FC100576D89 /* RealViewNetWorkCell_0.m */,
);
path = view;
sourceTree = "<group>";
};
23CEFC452AFB8FC100576D89 /* K */ = {
isa = PBXGroup;
children = (
23CEFC462AFB8FC100576D89 /* BSDrawLine.h */,
23CEFC472AFB8FC100576D89 /* BSkObject.m */,
23CEFC482AFB8FC100576D89 /* BSDrawLine.m */,
23CEFC492AFB8FC100576D89 /* BSkObject.h */,
);
path = K;
sourceTree = "<group>";
};
23E9E9AB2A81E8E900B792F2 /* Event */ = {
isa = PBXGroup;
children = (
@@ -9939,6 +10198,8 @@
E8E70D7F26F2F39000F03460 /* SubViews */,
E8E70D7526F2F15100F03460 /* XPMineViewController.h */,
E8E70D7626F2F15100F03460 /* XPMineViewController.m */,
23CEFB6A2AFB803B00576D89 /* PISwitchingEnvironmentVC.h */,
23CEFB6B2AFB803B00576D89 /* PISwitchingEnvironmentVC.m */,
23E9EA932A84BE4800B792F2 /* XPGiftUserDataViewController.h */,
23E9EA922A84BE4800B792F2 /* XPGiftUserDataViewController.m */,
23E9EAA42A84C97C00B792F2 /* XPMineUserInfoTagVC.h */,
@@ -10277,6 +10538,7 @@
E80EC81F28ACD84000D133C5 /* emoji_45@2x.png in Resources */,
E80EC85A28ACD84000D133C5 /* emoji_14@2x.png in Resources */,
E80EC8B828ACD84100D133C5 /* emoji_85@2x.png in Resources */,
23CEFC5A2AFB8FC100576D89 /* pay_on.png in Resources */,
E80EC82828ACD84000D133C5 /* emoji_55@2x.png in Resources */,
E84A2EAD2A52F20900D6AF8A /* Launch Screen.storyboard in Resources */,
E8729EEF2A3B34D30076D80A /* images in Resources */,
@@ -10307,6 +10569,7 @@
E80EC8BF28ACDB2A00D133C5 /* Assets.xcassets in Resources */,
E80EC88028ACD84000D133C5 /* emoji_146@2x.png in Resources */,
E80EC82F28ACD84000D133C5 /* emoji_71@2x.png in Resources */,
23CEFC582AFB8FC100576D89 /* pay_on@3x.png in Resources */,
E80EC8A428ACD84100D133C5 /* emoji_31@2x.png in Resources */,
E80EC85028ACD84000D133C5 /* emoji_96@2x.png in Resources */,
E80EC85E28ACD84000D133C5 /* emoji_18@2x.png in Resources */,
@@ -10339,6 +10602,7 @@
E80EC81728ACD84000D133C5 /* emoji_134@2x.png in Resources */,
E8729EF02A3B34D30076D80A /* js in Resources */,
E80EC88328ACD84000D133C5 /* emoji_70@2x.png in Resources */,
23CEFC532AFB8FC100576D89 /* readMe_FileOption.txt in Resources */,
E80EC89528ACD84000D133C5 /* emoji_99@2x.png in Resources */,
E80EC89128ACD84000D133C5 /* emoji_133@2x.png in Resources */,
E80EC87F28ACD84000D133C5 /* emoji_137@2x.png in Resources */,
@@ -10384,6 +10648,7 @@
E80EC84A28ACD84000D133C5 /* emoji_94@2x.png in Resources */,
23FF255B2AB956D50064E904 /* pi_home_new_pk.svga in Resources */,
E80EC84F28ACD84000D133C5 /* emoji_151@2x.png in Resources */,
23CEFC592AFB8FC100576D89 /* pay_on@2x.png in Resources */,
E80EC88428ACD84000D133C5 /* emoji_01@2x.png in Resources */,
E80EC8B628ACD84100D133C5 /* emoji_107@2x.png in Resources */,
E80EC83B28ACD84000D133C5 /* emoji_163@2x.png in Resources */,
@@ -10427,6 +10692,7 @@
E80EC8A328ACD84100D133C5 /* emoji_52@2x.png in Resources */,
E80EC84E28ACD84000D133C5 /* emoji_132@2x.png in Resources */,
E8729EED2A3B34D30076D80A /* upload.html in Resources */,
23CEFC562AFB8FC100576D89 /* pay_off.png in Resources */,
E80EC82928ACD84000D133C5 /* emoji_28@2x.png in Resources */,
E80EC82028ACD84000D133C5 /* emoji_38@2x.png in Resources */,
23E9EB332A85E97C00B792F2 /* pi_login_new_logo.png in Resources */,
@@ -10446,6 +10712,7 @@
23E9EAA32A84C80300B792F2 /* pi_new_loading.svga in Resources */,
E80EC83628ACD84000D133C5 /* emoji_147@2x.png in Resources */,
23E9EB242A84E98300B792F2 /* pi_new_mine_info_sound_play.svga in Resources */,
23CEFC552AFB8FC100576D89 /* pay_off@3x.png in Resources */,
E80EC86B28ACD84000D133C5 /* emoji_200@2x.png in Resources */,
E80EC88F28ACD84000D133C5 /* emoji_121@2x.png in Resources */,
E80EC87C28ACD84000D133C5 /* emoji_162@2x.png in Resources */,
@@ -10456,6 +10723,7 @@
E80EC88228ACD84000D133C5 /* emoji_13@2x.png in Resources */,
E80EC82228ACD84000D133C5 /* emoji_34@2x.png in Resources */,
E80EC87628ACD84000D133C5 /* emoji_139@2x.png in Resources */,
23CEFC572AFB8FC100576D89 /* pay_off@2x.png in Resources */,
E80EC86328ACD84000D133C5 /* emoji_41@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -10605,6 +10873,7 @@
E8E20BE2281695800033B688 /* XPMineLoginPasswordViewController.m in Sources */,
E84A2EA22A52883000D6AF8A /* XPIncomeRecordGoldDetailsTimeView.m in Sources */,
E86E79D628A4EA0C006DAF48 /* SessionRiskCache.m in Sources */,
23CEFC542AFB8FC100576D89 /* BSNotification.m in Sources */,
E824543826F5820A00BE8163 /* XPLoginVerifBindPhonePresenter.m in Sources */,
E8B846BF26FD827900A777FE /* XPMineUserInfoAlbumViewController.m in Sources */,
E84CBCE128436D3C00D43221 /* XPMineContactViewController.m in Sources */,
@@ -10716,6 +10985,7 @@
E8998D7A2859784200C68558 /* XPSVGAPlayer.m in Sources */,
9BD9A18427A0F128004186FE /* XPMineVisitorItemModel.m in Sources */,
E852D73E28631C18001465ED /* XPMonentsCommentTableViewCell.m in Sources */,
23CEFC4E2AFB8FC100576D89 /* BSNSDictionary.m in Sources */,
23FF426A2AA5DF050055733C /* XPNewHomePartyTagView.m in Sources */,
E85E7BA22A4EC99300B6D00A /* XPMineGiveDiamondSearchModel.m in Sources */,
1427219829A75F6F00C7C423 /* HTTPServer.m in Sources */,
@@ -10739,12 +11009,14 @@
E8BD0F8828A9E9E400DE050D /* RoomSailingPrizeModel.m in Sources */,
238B37B32AC55A2C00BFC9D5 /* XPTreasureFairyPrizeRecordCell.m in Sources */,
E8A1F79C290644DC0099C952 /* XPRoomMorePlayCollectionViewCell.m in Sources */,
23CEFC512AFB8FC100576D89 /* SystemUtil.m in Sources */,
E8659909273E800D00EE349D /* XPGiftCollectionViewFlowLayout.m in Sources */,
238B37BD2AC55A2C00BFC9D5 /* XPTreasureFairyTrialsContentView.m in Sources */,
E85E7B262A4EB0D300B6D00A /* XPMineGuildViewController.m in Sources */,
E85E7B672A4EC35A00B6D00A /* XPBindExtractInfoModel.m in Sources */,
E8B846CB26FDD7CD00A777FE /* XPMineRechargeViewController.m in Sources */,
E86596512701A1C000846EBD /* StatisticsService.m in Sources */,
23CEFC5E2AFB8FC100576D89 /* BSRealTimeView.m in Sources */,
E824544026F58F9400BE8163 /* XPMinePayPwdViewController.m in Sources */,
9BE01AED2893D0DF00B50299 /* XPDressShopSearchTableViewCell.m in Sources */,
23FF42732AA6CC480055733C /* PIHomeItemModel.m in Sources */,
@@ -10770,11 +11042,13 @@
E8AC723D26F4B6AA007D6E91 /* XPLoginBindPhoneResultViewController.m in Sources */,
E8AB632728AE13210023B0D2 /* XPMonentsTopicListPresenter.m in Sources */,
1427218729A75F6F00C7C423 /* MyHTTPConnection.m in Sources */,
23CEFB6C2AFB803B00576D89 /* PISwitchingEnvironmentVC.m in Sources */,
E8D55C9D28113218006935A5 /* MessageMenuModel.m in Sources */,
E87DF4EF2A42CB90009C1185 /* XPHomeCollectRoomTableViewCell.m in Sources */,
236B2E442AA07D06003967A8 /* UIColor+RW.m in Sources */,
189DD73E26E21C3F00AB55B1 /* YYUtility.m in Sources */,
14A6034F29A36D8300D2A6A5 /* XPSimpleMineHeaderView.m in Sources */,
23CEFC652AFB8FC100576D89 /* BSDrawLine.m in Sources */,
E81C1B2F277071670020D1E4 /* XPArrangeMicInfoModel.m in Sources */,
9B0086CA27BA4F570032BD2B /* AnchorMicroView.m in Sources */,
E83ABF00280EC45700322EE4 /* MessageContentApplicationShareView.m in Sources */,
@@ -10792,6 +11066,7 @@
E8A03DFF27635F960098D9EA /* XPRoomCandyGiftView.m in Sources */,
E8A3538E28FE5CED0014A784 /* Api+WishGift.m in Sources */,
180116F9279E8C4C00F2CBC0 /* PLTimeUtil.m in Sources */,
23CEFC502AFB8FC100576D89 /* UILabel+YBAttributeTextTapAction.m in Sources */,
E87E545429AA05EA00EBE52B /* XPFootPrintNavView.m in Sources */,
E8252FEE27687DF1002B3164 /* ActivityInfoModel.m in Sources */,
E84BF7D1277BFCDD00EF8877 /* RoomTagModel.m in Sources */,
@@ -10808,6 +11083,7 @@
9BA812E428BF70A600783EA7 /* XPRoomRedPacketPwdView.m in Sources */,
23E9EB1B2A84D28A00B792F2 /* XPMineUserInfoEditTagView.m in Sources */,
237B94BE2A984DA7007853E3 /* XPRoomTrumpetViewController.m in Sources */,
23CEFC5C2AFB8FC100576D89 /* BSNetListenModel.m in Sources */,
2331C1662A5EB71000E1D940 /* NobleCenterModel.m in Sources */,
E8998D8B2859CB6A00C68558 /* XPMineUserInfoGiftWallSubViewController.m in Sources */,
E8DEC9A42764A6600078CB70 /* XPMoreMenuPresenter.m in Sources */,
@@ -10858,6 +11134,7 @@
E8C1CD6627D88EF800376F83 /* XPRoomFaceViewController.m in Sources */,
E80DE4102775C34E00BE5BCB /* XPFirstRechargeSuccessView.m in Sources */,
E8412FB32779E285006E1101 /* Api+RoomSetting.m in Sources */,
23CEFC4A2AFB8FC100576D89 /* BSNSStringUtil.m in Sources */,
9B2F72D028E45A480000E4FA /* XPRoomQuickMessageContainView.m in Sources */,
23FF426D2AA5E4EE0055733C /* XPNewHomePartyAudioView.m in Sources */,
E81060E82987720F00B772F0 /* MessageUnSupportModel.m in Sources */,
@@ -10866,6 +11143,7 @@
238B37A52AC55A2C00BFC9D5 /* TreasureFailyKeyInfoModel.m in Sources */,
140A818D299CFF1C00841594 /* XPVendorCallViewController.m in Sources */,
E8EEB8F226FC2050007C6EBA /* SDPhotoBrowser.m in Sources */,
23CEFC4F2AFB8FC100576D89 /* BSSDLayoutUtil.m in Sources */,
E81C27AB26EF2D920031E639 /* ThirdUserInfo.m in Sources */,
23FF25682ABC3BC00064E904 /* XPHomeGameCell.m in Sources */,
E8788950273A699900BF1D57 /* ThemeColor+SendGift.m in Sources */,
@@ -10998,6 +11276,7 @@
E85E7B472A4EB0D300B6D00A /* XPMineGuildManagerPerTableViewCell.m in Sources */,
E824544326F58FCE00BE8163 /* XPMinePayPwdInputView.m in Sources */,
23C7C0B72A7CD7B000802205 /* XPNewMineGuildItemView.m in Sources */,
23CEFC5D2AFB8FC100576D89 /* BSRecordModel.m in Sources */,
9B1B72A1280023F3003FACE9 /* XPMineAnchorFansTeamTableViewCell.m in Sources */,
1808073027315E8E001FD836 /* NetImageView.m in Sources */,
E880B3AC278BD98600A83B0D /* XPAcrossRoomPKEmptyTableViewCell.m in Sources */,
@@ -11113,6 +11392,7 @@
9B1B72BF2800422E003FACE9 /* XPAnchorPKRuleView.m in Sources */,
1427219729A75F6F00C7C423 /* DDRange.m in Sources */,
E85E7B6E2A4EC4AE00B6D00A /* XPMineGuildPresenter.m in Sources */,
23CEFC5B2AFB8FC100576D89 /* BSSelectView.m in Sources */,
E81125CA296E606F000D9804 /* QPhotoImageModel.m in Sources */,
9B42869528C1E00A009034D2 /* XPRedPacketResultModel.m in Sources */,
2331C16E2A5EB71000E1D940 /* XPNobleAuthorityDescView.m in Sources */,
@@ -11132,6 +11412,7 @@
18A61BE8274F9CF000A09A54 /* SessionListViewController.m in Sources */,
E8C1CD6A27D8937800376F83 /* XPRoomFaceCollectionViewCell.m in Sources */,
9B2EA7C02804037700ED17BF /* AnchorPKStageView.m in Sources */,
23CEFC622AFB8FC100576D89 /* BSLogNetDetailViewController.m in Sources */,
238B37CF2AC55A2C00BFC9D5 /* XPTreasureFairySendRecordView.m in Sources */,
238B37C52AC55A2C00BFC9D5 /* XPTreasureFairyMoreView.m in Sources */,
E811FFF72742367B00918544 /* XPGiftEmptyCollectionViewCell.m in Sources */,
@@ -11323,6 +11604,7 @@
E85E3FA728B7A6F000268DC8 /* MessageContentMonentsView.m in Sources */,
E880B3AF278BE1D800A83B0D /* Api+AcrossRoomPK.m in Sources */,
238B37DC2AC55A2C00BFC9D5 /* XPTreasureFairyBallView.m in Sources */,
23CEFC4B2AFB8FC100576D89 /* BSUIDemoUtil.m in Sources */,
E8B9842D28AB77F10022D026 /* XPMonentsPublishTopicView.m in Sources */,
239141C62AE129F700322CA9 /* PIInputScrollingView.m in Sources */,
E88C72992828F3620047FB2B /* XPRoomMusicLibraryTableViewCell.m in Sources */,
@@ -11388,7 +11670,9 @@
E8D34D5628080393009C4835 /* XPMineDataGiftCollectionViewCell.m in Sources */,
E84A2E9C2A52823900D6AF8A /* XPTextField.m in Sources */,
186A536926FC6F2E00D67B2C /* XPShareView.m in Sources */,
23CEFC602AFB8FC100576D89 /* RealViewCellModel.m in Sources */,
E8AB632C28AE19600023B0D2 /* XPMonentsMineViewController.m in Sources */,
23CEFC5F2AFB8FC100576D89 /* BSLogTableViewController.m in Sources */,
236B2E4D2AA07D06003967A8 /* XPRoomLittleGameContainerView.m in Sources */,
E87AE8C1284E184300CAFBB3 /* RoomNewUserGreetModel.m in Sources */,
9BC5C91C277C8A7B007C8719 /* XPReleaseRadioViewController.m in Sources */,
@@ -11412,6 +11696,7 @@
E818E34B286ECABF005EDF68 /* XPMonentsPublishPresenter.m in Sources */,
E85E7B462A4EB0D300B6D00A /* XPGuildEmptyCollectionViewCell.m in Sources */,
9B7B605B27BB53060070BB72 /* XPAnchorAudienceUpMicView.m in Sources */,
23CEFC522AFB8FC100576D89 /* BSFileOptionModel.m in Sources */,
238B37D02AC55A2C00BFC9D5 /* XPTreasureFairySummonGiftView.m in Sources */,
14DCAD0E299B6AD900A7DD31 /* XPForgetPwdViewController.m in Sources */,
23194DD12AD14BF000649F51 /* DDAbstractDatabaseLogger.m in Sources */,
@@ -11458,6 +11743,7 @@
23E9EA9E2A84C42B00B792F2 /* SGYProgressView.m in Sources */,
E87E91552796B6DE00A7B3F2 /* XPRoomInviteUserViewController.m in Sources */,
E880B3B5278C1FE400A83B0D /* XPAcrossRoomPKPresenter.m in Sources */,
23CEFC612AFB8FC100576D89 /* RealViewNetWorkCell_0.m in Sources */,
186A534626FC6ED900D67B2C /* TTPopup.m in Sources */,
9B4D449328F15765002572D5 /* XPGiftLuckyGiftBroadcastView.m in Sources */,
E81C278C26EAFAF60031E639 /* Base64.m in Sources */,
@@ -11496,6 +11782,7 @@
9BCE6144277D657600CC0358 /* XPReleaseRadioTableViewCell.m in Sources */,
186A534D26FC6ED900D67B2C /* TTActionSheetView.m in Sources */,
E81060E529876FF300B772F0 /* MessageAudioModel.m in Sources */,
23CEFC642AFB8FC100576D89 /* BSkObject.m in Sources */,
E83DB481274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.m in Sources */,
9B3A1DF4280571000058E2DD /* XPAnchorPKInviteView.m in Sources */,
2331C1BD2A60F69E00E1D940 /* UILabel+Utils.m in Sources */,
@@ -11531,6 +11818,7 @@
9B41D36E282649230048C588 /* XPWeekStarRankUserModel.m in Sources */,
E824545926F5E65900BE8163 /* XPMineVerifIdentityView.m in Sources */,
E841ED61280FB0BD00904808 /* ContentLevelUpgradeModel.m in Sources */,
23CEFC632AFB8FC100576D89 /* BSRealTextView.m in Sources */,
238B37B92AC55A2C00BFC9D5 /* XPTreasureFairyTrialsRecordCell.m in Sources */,
236B2E542AA08757003967A8 /* LittleGameScrollStageView.m in Sources */,
189DD74026E21C3F00AB55B1 /* YYUtility+App.m in Sources */,
@@ -11618,6 +11906,7 @@
E85E7BB62A4ED59900B6D00A /* XPIncomeRecordGoldDetailsCell.m in Sources */,
9B7B606227BB96E40070BB72 /* XPRoomAnchorInfoCardView.m in Sources */,
E87DF4FE2A42CD7E009C1185 /* XPRoomSearchRecommendHeadView.m in Sources */,
23CEFC4D2AFB8FC100576D89 /* BSXWDateUtil.m in Sources */,
E85E7B442A4EB0D300B6D00A /* XPMineExchangeAuthorityCell.m in Sources */,
E80B0734280D740600A79F63 /* MessageContentGuildView.m in Sources */,
E8395334276A03C300CF2F24 /* XPMineDressUpPresenter.m in Sources */,
@@ -11690,6 +11979,7 @@
E81A654C28351D9900F55894 /* XPMonentsTopicCollectionViewCell.m in Sources */,
E85E7B9F2A4EC99300B6D00A /* XPMineGiveDiamondPresenter.m in Sources */,
14D8767C29A7445C00E1DD7F /* NSObject+AutoCoding.m in Sources */,
23CEFC4C2AFB8FC100576D89 /* BS_UIColor.m in Sources */,
E8412FA92779C2ED006E1101 /* XPRoomSettingItemModel.m in Sources */,
189DD58F26DF97E700AB55B1 /* LoginPresenter.m in Sources */,
E88863C9278EBA43004BCFAB /* XPAcrossRoomPKForceEndResultView.m in Sources */,

View File

@@ -31,7 +31,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"

View File

@@ -39,7 +39,7 @@
- (void)clientInit {
#ifdef DEBUG
self.canOpen = YES;
self.canOpen = YES;
#else
if(isEnterprise == YES){
self.canOpen = NO;

View File

@@ -50,7 +50,12 @@ NSString * const kFreeGiftCountdownNotification = @"kFreeGiftCountdownNotificati
NSString * const KeyWithType(Pi_KeyType type) {
BOOL isRelase = NO;
#ifdef DEBUG
isRelase = NO;
NSString *isProduction = [[NSUserDefaults standardUserDefaults]valueForKey:@"kIsProductionEnvironment"];
if([isProduction isEqualToString:@"YES"]){
isRelase = YES;
}else{
isRelase = NO;
}
#else
isRelase = YES;
#endif

View File

@@ -48,18 +48,15 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
///内置版本号
#define PI_App_Version @"2.2.1"
///渠道
#define PI_App_Source @"appstore"
//#define PI_App_Source @"pi_tf"
#ifdef DEBUG
#define API_HOST_URL [NSString stringWithFormat:@"%@%@",@"http://beta.api",@".pekolive.com"]
#else
///正式环境
#define API_HOST_URL @"https://api.hfighting.com"
#endif
///测试环境
#define API_HOST_TEST_URL [NSString stringWithFormat:@"%@%@",@"http://beta.api",@".pekolive.com"]
#define API_Image_URL @"https://image.hfighting.com"

View File

@@ -336,7 +336,12 @@
NSDate *resDate;
#ifdef DEBUG
resDate = [formatter dateFromString:@"2022-09-05"];
NSString *isProduction = [[NSUserDefaults standardUserDefaults]valueForKey:@"kIsProductionEnvironment"];
if([isProduction isEqualToString:@"YES"]){
resDate = [formatter dateFromString:@"2022-12-05"];
}else{
resDate = [formatter dateFromString:@"2022-09-05"];
}
#else
resDate = [formatter dateFromString:@"2022-12-05"];
#endif

View File

@@ -117,7 +117,12 @@
[formatter setDateFormat:@"yyyy-MM-dd"];
NSDate *resDate;
#ifdef DEBUG
resDate = [formatter dateFromString:@"2022-09-05"];
NSString *isProduction = [[NSUserDefaults standardUserDefaults]valueForKey:@"kIsProductionEnvironment"];
if([isProduction isEqualToString:@"YES"]){
resDate = [formatter dateFromString:@"2022-12-05"];
}else{
resDate = [formatter dateFromString:@"2022-09-05"];
}
#else
resDate = [formatter dateFromString:@"2022-12-05"];
#endif

View File

@@ -48,7 +48,12 @@
[formatter setDateFormat:@"yyyy-MM-dd"];
NSDate *resDate;
#ifdef DEBUG
resDate = [formatter dateFromString:@"2022-09-05"];
NSString *isProduction = [[NSUserDefaults standardUserDefaults]valueForKey:@"kIsProductionEnvironment"];
if([isProduction isEqualToString:@"YES"]){
resDate = [formatter dateFromString:@"2022-12-05"];
}else{
resDate = [formatter dateFromString:@"2022-09-05"];
}
#else
resDate = [formatter dateFromString:@"2022-12-05"];
#endif

View File

@@ -0,0 +1,16 @@
//
// PISwitchingEnvironmentVC.h
// YuMi
//
// Created by duoban on 2023/11/8.
//
#import <UIKit/UIKit.h>
#import "MvpViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface PISwitchingEnvironmentVC : MvpViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,108 @@
//
// PISwitchingEnvironmentVC.m
// YuMi
//
// Created by duoban on 2023/11/8.
//
#import "PISwitchingEnvironmentVC.h"
#import "XPLoginViewController.h"
#import "XPAdImageTool.h"
#import "BaseNavigationController.h"
@interface PISwitchingEnvironmentVC ()
@property(nonatomic,strong) UILabel *titleView;
@end
@implementation PISwitchingEnvironmentVC
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"切换";
NSString *isProduction = [[NSUserDefaults standardUserDefaults]valueForKey:@"kIsProductionEnvironment"];
NSString *text = @"";
if([isProduction isEqualToString:@"YES"]){
text = @"当前环境:正式环境";
}else{
text = @"当前环境:测试环境";
}
self.titleView = [UILabel labelInitWithText:text font:kFontMedium(16) textColor:[DJDKMIMOMColor mainTextColor]];
[self.view addSubview:self.titleView];
UILabel *switchTitle = [UILabel labelInitWithText:@"切换环境" font:kFontMedium(15) textColor:[DJDKMIMOMColor secondTextColor]];
[self.view addSubview:switchTitle];
UISwitch *switchView = [[UISwitch alloc]init];
[switchView setOn:[isProduction isEqualToString:@"YES"]];
[self.view addSubview:switchView];
[switchView addTarget:self action:@selector(switchEnvironmentAction:) forControlEvents:UIControlEventValueChanged];
UIButton *realBtn = [UIButton new];
[realBtn setTitle:@"调试" forState:UIControlStateNormal];
[realBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
[realBtn addTarget:self action:@selector(showRealTimeView) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:realBtn];
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(kGetScaleWidth(30));
make.top.mas_equalTo(kGetScaleWidth(100));
}];
[switchTitle mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.equalTo(self.titleView);
make.top.equalTo(self.titleView.mas_bottom).mas_offset(kGetScaleWidth(20));
}];
[switchView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.equalTo(switchTitle.mas_trailing).mas_offset(kGetScaleWidth(10));
make.centerY.equalTo(switchTitle);
}];
[realBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.equalTo(self.titleView);
make.top.equalTo(switchTitle.mas_bottom).mas_offset(kGetScaleWidth(30));
}];
}
-(void)showRealTimeView{
[BSNetListenModel initRealTimeView];
UIWindow * window = [UIApplication sharedApplication].keyWindow;
[BSNetListenModel sharedInstance:window];
}
-(void)switchEnvironmentAction:(UISwitch *)sender{
TTAlertConfig *config = [[TTAlertConfig alloc]init];
config.title = @"提示";
config.message = @"确认切换网络环境吗需要重启app";
[TTPopup alertWithConfig:config confirmHandler:^{
if(sender.isOn == YES){
[[NSUserDefaults standardUserDefaults]setValue:@"YES" forKey:@"kIsProductionEnvironment"];
[[NSUserDefaults standardUserDefaults]synchronize];
self.titleView.text = @"当前环境:正式环境";
[self logoutAction];
return;
}
[[NSUserDefaults standardUserDefaults]setValue:@"NO" forKey:@"kIsProductionEnvironment"];
[[NSUserDefaults standardUserDefaults]synchronize];
self.titleView.text = @"当前环境:测试环境";
[self logoutAction];
} cancelHandler:^{
[sender setOn:!sender.isOn];
}];
}
-(void)logoutAction{
exit(0);
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end

View File

@@ -62,6 +62,7 @@
#import "HomeLittleGameRoomModel.h"
#import "XPLittleGameRoomOpenView.h"
#import "XPMineGameTableViewCell.h"
#import "PISwitchingEnvironmentVC.h"
UIKIT_EXTERN NSString *kRequestRicket;
@interface XPMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineProtocol, XPMineHeadItemTableViewCellDelegate, XPMineHeadViewDelegate, XPHomeBannerTableViewCellDelegate>
@@ -175,6 +176,8 @@ UIKIT_EXTERN NSString *kRequestRicket;
setItem.skipType = XPMineItemType_My_Set;
[self.functionArray addObject:setItem];
[self.view addSubview:self.bgImageView];
[self.view addSubview:self.tableView];
// [self.view addSubview:self.settingButton];
@@ -197,6 +200,13 @@ UIKIT_EXTERN NSString *kRequestRicket;
}
- (void)pushViewControllerWithType:(NSInteger)type functionItem:(XPMineFuntionItemModel *)item {
if([item.centerName isEqualToString:@"切换分区"]){
PISwitchingEnvironmentVC *vc = [PISwitchingEnvironmentVC new];
[self.navigationController pushViewController:vc animated:YES];
return;
}
switch (type) {
case XPMineItemType_My_Set:{
[self settingButtonAction];
@@ -509,6 +519,9 @@ UIKIT_EXTERN NSString *kRequestRicket;
if (obj.skipType == XPMineItemType_CP || obj.skipType == XPMineItemType_My_Room) {
[self.functionArray removeObject:obj];
}
if([obj.centerName isEqualToString:@"切换分区"]){
[self.functionArray removeObject:obj];
}
}];
NSMutableArray *array = [NSMutableArray array];
for (XPMineFuntionItemModel *item in self.functionArray) {
@@ -516,6 +529,13 @@ UIKIT_EXTERN NSString *kRequestRicket;
}
NSString *trackName = [array componentsJoinedByString:@","];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_function_show eventAttributes:@{@"functionName" : trackName}];
#ifdef DEBUG
XPMineFuntionItemModel *item = [XPMineFuntionItemModel new];
item.centerName = @"切换分区";
item.centerPic = @"mineview_set";
[self.functionArray addObject:item];
#else
#endif
[self.tableView reloadData];
}
- (void)onGetMineFuntionItemFail{

View File

@@ -296,7 +296,7 @@
shareInfo.shareContent = self.monentsInfo.content;
shareInfo.shareImageUrl = self.monentsInfo.avatar;
NSString * uid = [AccountInfoStorage instance].getUid;
NSString *urlStr = [NSString stringWithFormat:@"%@/%@?uid=%@&dynamicId=%@&worldId=%ld",API_HOST_URL, URLWithType(kMonentsShareURL), uid, self.monentsInfo.dynamicId, self.monentsInfo.worldId];
NSString *urlStr = [NSString stringWithFormat:@"%@/%@?uid=%@&dynamicId=%@&worldId=%ld",[HttpRequestHelper getHostUrl], URLWithType(kMonentsShareURL), uid, self.monentsInfo.dynamicId, self.monentsInfo.worldId];
shareInfo.shareUrl = urlStr;
shareInfo.dynamicId = self.monentsInfo.dynamicId;
shareInfo.uid = self.monentsInfo.uid;

View File

@@ -654,7 +654,7 @@
shareInfo.type = ShareType_Room;
shareInfo.roomUid = self.userInfo.roomUid.integerValue;
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * urlString = [NSString stringWithFormat:@"%@/%@?shareUid=%@&uid=%@&room_name=%@&room_id=%@&room_avatar=%@&share_name=%@",API_HOST_URL,URLWithType(kShareRoomURL),uid,self.userInfo.roomUid,self.userInfo.nick,self.userInfo.roomId,self.userInfo.roomAvatar,self.userInfo.nick];
NSString * urlString = [NSString stringWithFormat:@"%@/%@?shareUid=%@&uid=%@&room_name=%@&room_id=%@&room_avatar=%@&share_name=%@",[HttpRequestHelper getHostUrl],URLWithType(kShareRoomURL),uid,self.userInfo.roomUid,self.userInfo.nick,self.userInfo.roomId,self.userInfo.roomAvatar,self.userInfo.nick];
shareInfo.shareUrl = urlString;
CGFloat margin = 15;
CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65);

View File

@@ -1364,7 +1364,12 @@
dispatch_source_cancel(self.followAnchorTimer);
}
#ifdef DEBUG
NSInteger totalTime = 5;
NSInteger totalTime = 5;
NSString *isProduction = [[NSUserDefaults standardUserDefaults]valueForKey:@"kIsProductionEnvironment"];
if([isProduction isEqualToString:@"YES"]){
totalTime = 420;
}
#else
NSInteger totalTime = 420;
#endif

View File

@@ -250,7 +250,7 @@
shareInfo.type = ShareType_Room;
shareInfo.roomUid = roomInfo.uid;
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * urlString = [NSString stringWithFormat:@"%@/%@?shareUid=%@&uid=%ld&room_name=%@&room_id=%ld&room_avatar=%@&share_name=%@",API_HOST_URL,URLWithType(kShareRoomURL),uid,roomInfo.uid,roomInfo.title,roomInfo.erbanNo,roomInfo.avatar,roomInfo.nick];
NSString * urlString = [NSString stringWithFormat:@"%@/%@?shareUid=%@&uid=%ld&room_name=%@&room_id=%ld&room_avatar=%@&share_name=%@",[HttpRequestHelper getHostUrl],URLWithType(kShareRoomURL),uid,roomInfo.uid,roomInfo.title,roomInfo.erbanNo,roomInfo.avatar,roomInfo.nick];
shareInfo.shareUrl = urlString;
CGFloat margin = 15;

View File

@@ -151,10 +151,9 @@
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.top.mas_equalTo(self.avatarImageView.mas_bottom).offset(10);
make.width.mas_lessThanOrEqualTo(kGetScaleWidth(88));
}];
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_lessThanOrEqualTo(kGetScaleWidth(70));
}];
[self.postionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(14);
}];

View File

@@ -483,7 +483,7 @@ NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat";
return;
}
if (![_url hasPrefix:@"http"] && ![_url hasPrefix:@"https"]){
_url = [NSString stringWithFormat:@"%@/%@", API_HOST_URL, _url];
_url = [NSString stringWithFormat:@"%@/%@", [HttpRequestHelper getHostUrl], _url];
}
if (![_url containsString:@"?"]) {

View File

@@ -21,7 +21,7 @@ typedef void(^HttpRequestHelperCompletion)(BaseModel* _Nullable data, NSInteger
NS_ASSUME_NONNULL_BEGIN
@interface HttpRequestHelper : NSObject
+(NSString *)getHostUrl;
+ (NSDictionary*)configBaseParmars:(NSDictionary *)parmars;
+ (void)GET:(NSString *)method

View File

@@ -18,7 +18,7 @@
static AFHTTPSessionManager *manager = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
manager = [[AFHTTPSessionManager manager]initWithBaseURL:[NSURL URLWithString:API_HOST_URL]];
manager = [[AFHTTPSessionManager manager]initWithBaseURL:[NSURL URLWithString:[HttpRequestHelper getHostUrl]]];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
manager.requestSerializer.HTTPShouldHandleCookies = YES;
//
@@ -32,7 +32,20 @@
});
return manager;
}
+(NSString *)getHostUrl{
#ifdef DEBUG
NSString *isProduction = [[NSUserDefaults standardUserDefaults]valueForKey:@"kIsProductionEnvironment"];
if([isProduction isEqualToString:@"YES"]){
return API_HOST_URL;
}
return API_HOST_TEST_URL;
#else
return API_HOST_URL
#endif
}
+ (void)GET:(NSString *)method
params:(NSDictionary *)params
success:(void (^)(BaseModel *data))success
@@ -41,25 +54,42 @@
if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == 0) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
failure(-1, YMLocalizedString(@"HttpRequestHelper0"));
});
return;
}
[self configHeaders];
params = [self configBaseParmars:params];
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
#ifdef DEBUG
NSLog(@"\nmethod:\n%@\nparameter:\n%@", method, params);
#endif
#ifdef DEBUG
NSString *url = API_HOST_URL;
NSString *urlPath = [NSString stringWithFormat:@"%@/%@", url ,method];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[BSNetListenModel addHttpReq:urlPath header:manager.requestSerializer.HTTPRequestHeaders param:[params copy] time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]];
});
#else
#endif
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
[manager GET:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject];
#ifdef DEBUG
NSLog(@"\n%@", [baseModel toJSONString]);
NSHTTPURLResponse *response = (NSHTTPURLResponse *)task.response;
NSDictionary *allHeaders = response.allHeaderFields;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[BSNetListenModel addHttpRsp:urlPath header:allHeaders result:baseModel.data isSuccess:YES time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]];
});
#else
#endif
success(baseModel);
success(baseModel);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
[self handleNetError:error method:method failure:failure];
[self handleNetError:error method:method failure:failure];
}];
}
@@ -78,51 +108,77 @@
[self configHeaders];
params = [self configBaseParmars:params];
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
#ifdef DEBUG
NSLog(@"\nmethod:\n%@\nparameter:\n%@", method, params);
NSString *url = API_HOST_URL;
NSString *urlPath = [NSString stringWithFormat:@"%@/%@", url ,method];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[BSNetListenModel addHttpReq:urlPath header:manager.requestSerializer.HTTPRequestHeaders param:[params copy] time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]];
});
#else
#endif
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
[manager POST:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject];
#ifdef DEBUG
NSLog(@"\n%@", [baseModel toJSONString]);
NSHTTPURLResponse *response = (NSHTTPURLResponse *)task.response;
NSDictionary *allHeaders = response.allHeaderFields;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[BSNetListenModel addHttpRsp:urlPath header:allHeaders result:baseModel.data isSuccess:YES time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]];
});
#else
#endif
success(baseModel);
success(baseModel);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
[self handleNetError:error method:method failure:failure];
[self handleNetError:error method:method failure:failure];
}];
}
+ (void)DELETE:(NSString *)method
params:(NSDictionary *)params
success:(void (^)(BaseModel *data))success
failure:(void (^)(NSInteger resCode, NSString *message))failure
params:(NSDictionary *)params
success:(void (^)(BaseModel *data))success
failure:(void (^)(NSInteger resCode, NSString *message))failure
{
if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == 0) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
failure(-1, YMLocalizedString(@"HttpRequestHelper0"));
if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == 0) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
failure(-1, YMLocalizedString(@"HttpRequestHelper0"));
});
return;
}
});
return;
}
[self configHeaders];
params = [self configBaseParmars:params];
[self configHeaders];
params = [self configBaseParmars:params];
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
#ifdef DEBUG
NSLog(@"\nmethod:\n%@\nparameter:\n%@", method, params);
NSLog(@"\nmethod:\n%@\nparameter:\n%@", method, params);
NSString *url = API_HOST_URL;
NSString *urlPath = [NSString stringWithFormat:@"%@/%@", url ,method];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[BSNetListenModel addHttpReq:urlPath header:manager.requestSerializer.HTTPRequestHeaders param:[params copy] time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]];
});
#else
#endif
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
[manager DELETE:method parameters:params headers:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject];
[manager DELETE:method parameters:params headers:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject];
#ifdef DEBUG
NSLog(@"\n%@", [baseModel toJSONString]);
NSLog(@"\n%@", [baseModel toJSONString]);
NSHTTPURLResponse *response = (NSHTTPURLResponse *)task.response;
NSDictionary *allHeaders = response.allHeaderFields;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[BSNetListenModel addHttpRsp:urlPath header:allHeaders result:baseModel.data isSuccess:YES time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]];
});
#else
#endif
success(baseModel);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
[self handleNetError:error method:method failure:failure];
}];
success(baseModel);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
[self handleNetError:error method:method failure:failure];
}];
}
+ (void)request:(NSString *)url
@@ -140,10 +196,10 @@
[self POST:url params:params success:success failure:failure];
}
break;
case HttpRequestHelperMethodDELETE:{
[self DELETE:url params:params success:success failure:failure];
}
break;
case HttpRequestHelperMethodDELETE:{
[self DELETE:url params:params success:success failure:failure];
}
break;
}
}
@@ -205,27 +261,38 @@
+ (void)handleNetError:(NSError *)error method:(NSString *)method
failure:(void (^)(NSInteger resCode, NSString *message))failure
{
#ifdef DEBUG
NSLog(@"\n%@", error);
#endif
// oauth/ticket
NSHTTPURLResponse *response = error.userInfo[@"com.alamofire.serialization.response.error.response"];
NSString *NETWORK_ERROR = error.description.length > 0 ? error.description : YMLocalizedString(@"HttpRequestHelper5");;
if (response && response.statusCode == 401) {
failure(response.statusCode, YMLocalizedString(@"HttpRequestHelper7"));
} else {
if (error.code == -1009 || error.code == -1001 || error.code == -1004 || error.code == -1003 || error.code == -1002 || error.code == 3840) {
failure(error.code, @"");
} else {
failure(error.code, error.localizedDescription.length > 0 ? error.localizedDescription : YMLocalizedString(@"HttpRequestHelper4"));
} else {
failure(error.code, error.localizedDescription.length > 0 ? error.localizedDescription : YMLocalizedString(@"HttpRequestHelper4"));
}
NSString * code = error.code ? [NSString stringWithFormat:@"%ld", error.code] : @"9999";
NSString * des = error.description.length > 0 ? error.description : YMLocalizedString(@"HttpRequestHelper5");
NSException *exception = [NSException exceptionWithName:@"229181"
reason:method
userInfo:@{@"code":code, @"desc":des}];
NSString * code = error.code ? [NSString stringWithFormat:@"%ld", error.code] : @"9999";
NSString * des = error.description.length > 0 ? error.description : YMLocalizedString(@"HttpRequestHelper5");
NSException *exception = [NSException exceptionWithName:@"229181"
reason:method
userInfo:@{@"code":code, @"desc":des}];
}
#ifdef DEBUG
NSLog(@"\n%@", error);
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSDictionary *allHeaders = response.allHeaderFields;
//3,
NSMutableDictionary *blockDict = [[NSMutableDictionary alloc]init];
[blockDict setObject:@(response.statusCode) forKey:@"resultCode"];
[blockDict setObject:NETWORK_ERROR forKey:@"resultDesc"];
[BSNetListenModel addHttpRsp:method header:allHeaders result:blockDict isSuccess:NO time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]];
});
#else
#endif
}
/// Post body 使 application/json
@@ -233,7 +300,7 @@
/// @param params
/// @param completion
+ (void)postSkillCard:(NSString *)path
params:(NSString *)params
params:(NSString *)params
completion:(HttpRequestHelperCompletion)completion{
if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == 0) {
@@ -245,17 +312,16 @@
[self configHeaders];
NSDictionary *baseParams = [self configBaseParmars:nil];
#ifdef DEBUG
// NSLog(@"\nmethod:\n%@\nparameter:\n%@", method, params);
#endif
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
NSString *url = API_HOST_URL;
NSString *urlPath = [NSString stringWithFormat:@"%@/%@", url ,path];
#ifdef DEBUG
NSLog(@"url:%@,parameter:%@",urlPath, baseParams);
#endif
#ifdef DEBUG
NSLog(@"\nmethod:\n%@\nparameter:\n%@", path, params);
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[BSNetListenModel addHttpReq:urlPath header:manager.requestSerializer.HTTPRequestHeaders param:[params copy] time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]];
});
#else
#endif
__block NSString *requestUrl = @"";
[baseParams.allKeys enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
@@ -290,10 +356,21 @@
[[manager dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
if (responseObject) {
BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject];
#ifdef DEBUG
#ifdef DEBUG
NSLog(@"\n%@", [baseModel toJSONString]);
#endif
#else
#endif
if (baseModel.code == 200) {
#ifdef DEBUG
NSHTTPURLResponse *response = response;
NSDictionary *allHeaders = response.allHeaderFields;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[BSNetListenModel addHttpRsp:urlPath header:allHeaders result:baseModel.data isSuccess:YES time:[NSDate getCurrentTimeWithFormat:@"yyyy-MM-dd HH:mm:ss"]];
});
#else
#endif
if (completion) {
completion(baseModel, 200, nil);
}
@@ -304,7 +381,7 @@
}
}
if (error) {
[self handleNetError:error method:path failure:^(NSInteger resCode, NSString *message) {
[self handleNetError:error method:path failure:^(NSInteger resCode, NSString *message) {
completion(nil, resCode, message);
}];
}

View File

@@ -18,6 +18,7 @@
#import "DJDKMIMOMColor.h"
#import "YUMIMacroUitls.h"
#import "YUMIHtmlUrl.h"
#import "BSRealTimeView.h"
@interface MvpViewController ()
@@ -39,6 +40,24 @@
- (void)viewDidLoad {
[super viewDidLoad];
#ifdef DEBUG
for (id obj in kWindow.subviews) {
if([obj isKindOfClass:[BSRealTimeView class]]){
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
BSRealTimeView *timeView = (BSRealTimeView *)obj;
[timeView removeFromSuperview];
[kWindow addSubview:timeView];
});
break;
}
}
#else
#endif
}
- (void)tokenInvalid {

View File

@@ -53,4 +53,6 @@ isEnterprise = [bundleID isEqualToString:@"com.hflighting.yumi"];\
#import "NSObject+MJExtension.h"
#import <MarqueeLabel-Swift.h>
#import <YYText/YYText.h>
#import "HttpRequestHelper.h"
#import "BSNetListenModel.h"
#endif /* PrefixHeader_pch */

View File

@@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSString *)stringFromDate:(NSDate *)date;
+(NSString *)getNowTimeTimestamp;
+ (NSString *)getCurrentTimeWithFormat:(NSString *)format;
+(NSString *)timestampSwitchTime:(NSInteger)timestamp andFormatter:(NSString *)format;
#pragma mark - 将某个时间戳转化成 时间
+ (NSString *)timestampSwitchTime:(NSInteger)timestamp formatter:(NSString *)format;

View File

@@ -164,7 +164,13 @@ NSString * const kDateFormatYYMMDDTHHmmss = @"yyyy-MM-dd'T'HH:mm:ss";
NSLog(@"两个时间相差%ld年%ld月%ld日%ld小时%ld分钟%ld秒", cmps.year, cmps.month, cmps.day, cmps.hour, cmps.minute, cmps.second);
return cmps.second;
}
+ (NSString *)getCurrentTimeWithFormat:(NSString *)format{
NSDate *now = [NSDate date];
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
formatter.dateFormat = format;
NSString *dateStr = [formatter stringFromDate:now];
return dateStr;
}
@end
@implementation NSCalendar (Pick)

View File

@@ -15,7 +15,7 @@
+ (void)getInternetDateWithSuccess:(void(^)(NSTimeInterval timeInterval))succes
failure:(void(^)(NSError *error))failure{
//1.URL
NSString *urlString = API_HOST_URL;
NSString *urlString = [HttpRequestHelper getHostUrl];
urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
//2.request
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];

View File

@@ -25,8 +25,12 @@
+ (NSString *)appName {
#ifdef DEBUG
NSString *isProduction = [[NSUserDefaults standardUserDefaults]valueForKey:@"kIsProductionEnvironment"];
if([isProduction isEqualToString:@"YES"]){
return @"youmi";
}
NSString *text = [NSString stringWithFormat:@"%@%@%@%@",@"p",@"e",@"k",@"o"];
return text;
return text;
#else
@@ -76,6 +80,10 @@ static NSString * const kMobileFrameworkResourceBundleName = @"YYMobileFramework
+ (NSString *)buildType{
#ifdef DEBUG
NSString *isProduction = [[NSUserDefaults standardUserDefaults]valueForKey:@"kIsProductionEnvironment"];
if([isProduction isEqualToString:@"YES"]){
return @"RELEASE";
}
return @"DEBUG";
#else
return @"RELEASE";

View File

@@ -0,0 +1,31 @@
//
// GWSDLayoutUtil.h
// GWTestSDK
//
// Created by xiaowen.chen on 16/8/31.
// Copyright © 2016年 xw.com. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Masonry.h"
//位置固定宽度跟高度
#define SDLAYOUT_wh1(A,B,C,D,E,F,G) [A mas_makeConstraints:^(MASConstraintMaker *make) {make.leading.equalTo(B).offset(C);make.top.equalTo(D).offset(E);make.width.mas_equalTo(F);make.height.mas_equalTo(G);}];//左上
#define SDLAYOUT_wh2(A,B,C,D,E,F,G) [A mas_makeConstraints:^(MASConstraintMaker *make) {make.trailing.equalTo(B).offset(C);make.top.equalTo(D).offset(E);make.width.mas_equalTo(F);make.height.mas_equalTo(G);}];//右上
#define SDLAYOUT_wh3(A,B,C,D,E,F,G) [A mas_makeConstraints:^(MASConstraintMaker *make) {make.leading.equalTo(B).offset(C);make.bottom.equalTo(D).offset(E);make.width.mas_equalTo(F);make.height.mas_equalTo(G);}];//左下
#define SDLAYOUT_wh4(A,B,C,D,E,F,G) [A mas_makeConstraints:^(MASConstraintMaker *make) {make.trailing.equalTo(B).offset(C);make.bottom.equalTo(D).offset(E);make.width.mas_equalTo(F);make.height.mas_equalTo(G);}];//右下
//固定高度
#define SDLAYOUT_h(A,B,C,D,E,F,G,H) [A mas_makeConstraints:^(MASConstraintMaker *make) {make.top.equalTo(B).offset(C);make.leading.equalTo(D).offset(E);make.trailing.equalTo(F).offset(G);make.height.mas_equalTo(H);}];
//原始的
#define SDLAYOUT(A,B,C,D,E,F,G,H,I) [A mas_makeConstraints:^(MASConstraintMaker *make) {make.top.equalTo(B).offset(C);make.leading.equalTo(D).offset(E);make.trailing.equalTo(F).offset(G);make.bottom.equalTo(H).offset(I);}];
@interface BSSDLayoutUtil : NSObject
@end

View File

@@ -0,0 +1,17 @@
//
// GWSDLayoutUtil.m
// GWTestSDK
//
// Created by xiaowen.chen on 16/8/31.
// Copyright © 2016 xw.com. All rights reserved.
//
#import "BSSDLayoutUtil.h"
@implementation BSSDLayoutUtil
//
@end

View File

@@ -0,0 +1,39 @@
//
// GWNSDictionary.h
// GWTestSDK
//
// Created by xiaowen.chen on 16/11/8.
// Copyright © 2016年 xw.com. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BSNSDictionary : NSObject
/*!
* @brief 把格式化的JSON格式的字符串转换成字典
* @param jsonString JSON格式的字符串
* @return 返回字典
*/
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
/*!
* @brief 把字典转json字符串
* @param dic 字典
* @return 字符串
*/
+ (NSString*)dictionaryToJson:(NSDictionary *)dic;
@end

View File

@@ -0,0 +1,47 @@
//
// GWNSDictionary.m
// GWTestSDK
//
// Created by xiaowen.chen on 16/11/8.
// Copyright © 2016 xw.com. All rights reserved.
//
#import "BSNSDictionary.h"
@implementation BSNSDictionary
#pragma mark - JSON
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString {
if (jsonString == nil) {
return nil;
}
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
NSError *err;
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData
options:NSJSONReadingMutableContainers
error:&err];
if(err) {
NSLog(@"json解析失败%@",err);
return nil;
}
return dic;
}
#pragma mark - json
+ (NSString*)dictionaryToJson:(NSDictionary *)dic
{
NSError *parseError = nil;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:&parseError];
return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
}
@end

View File

@@ -0,0 +1,71 @@
//
// NSStringUtil.h
// GWTestSDK
//
// Created by xiaowen.chen on 16/8/30.
// Copyright © 2016年 xw.com. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface BSNSStringUtil : NSObject
/**
格式换字典,数组,转字符串(格式化)
@param object 数据对象
@return 格式化的字符串
*/
+(NSString *)getStringFromObj:(id)object;
/**
去掉所有的空格和回车,\t
@param str 原始的字符串
@return 去掉所有的空格和回车后的字符串
*/
+(NSString *)clearStr:(NSString *)str;
/**
URLEncode url编码
@param unencodedString 原始字符串
@return 编码后的字符串
*/
+(NSString*)encodeString:(NSString*)unencodedString;
/**
URLDEcode url解码
@param encodedString 原始字符串
@return 解码后的字符串
*/
+(NSString *)decodeString:(NSString*)encodedString;
/**
判断字符串是否是纯数字
@param BOOL 字符串
@return 是否纯数字
*/
+ (BOOL)isPureInt:(NSString *)string;
#pragma mark - 富文本相关
/**
根据字体,颜色,返回富文本,行距
@param str 字符串
@param color 颜色
@param font 字体
@param lineSpac 行距
@return 富文本
*/
+(NSAttributedString *)getAttributedString:(NSString *)str color:(UIColor *)color font:(CGFloat)font lineSpa:(CGFloat)lineSpac;
@end

View File

@@ -0,0 +1,168 @@
//
// NSStringUtil.m
// GWTestSDK
//
// Created by xiaowen.chen on 16/8/30.
// Copyright © 2016 xw.com. All rights reserved.
//
#import "BSNSStringUtil.h"
@implementation BSNSStringUtil
#pragma mark - ,,()
+(NSString *)getStringFromObj:(id)object{
return [self getStringFromObj:object withTimes:0];
}
+(NSString *)getStringFromObj:(id)object withTimes:(int)times{
if (!object) {
return @"";
}
times++;
NSMutableString *intervalStr = [NSMutableString string];
for (int i = 1; i < times; i++) {
[intervalStr appendString:@"\t"];
}
if ([object isKindOfClass:[NSDictionary class]]) {
NSMutableString *string = [NSMutableString string];
[string appendString:@"{\n"];
//
[object enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
[string appendFormat:@"\t%@%@",intervalStr,key];
[string appendString:@" : "];
[string appendFormat:@"%@,\n", [self getStringFromObj:obj withTimes:times]];
}];
// }
[string appendFormat:@"%@}",intervalStr];
//
NSRange range = [string rangeOfString:@"," options:NSBackwardsSearch];
if (range.location != NSNotFound){
[string deleteCharactersInRange:range];
}
return string;
}else if([object isKindOfClass:[NSArray class]]){
NSMutableString *string = [NSMutableString string];
// [
[string appendString:@"[\n"];
//
[object enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
// [string appendFormat:@"\t%@,\n", [self getStringFromObj:obj withTimes:times]];
[string appendFormat:@"\t%@%@,\n",intervalStr, [self getStringFromObj:obj withTimes:times]];
}];
// ]
// [string appendString:@"]"];
[string appendFormat:@"%@]",intervalStr];
//
NSRange range = [string rangeOfString:@"," options:NSBackwardsSearch];
if (range.location != NSNotFound){
[string deleteCharactersInRange:range];
}
return string;
}else if([object isKindOfClass:[NSString class]]){
return (NSString *)object;
}
return [object description];
}
#pragma mark - ,\t
+(NSString *)clearStr:(NSString *)str{
str = [str stringByReplacingOccurrencesOfString: @" " withString: @""];
str = [str stringByReplacingOccurrencesOfString: @"\n" withString: @""];
str = [str stringByReplacingOccurrencesOfString: @"\t" withString: @""];
return str;
}
#pragma mark - URLEncode
+(NSString*)encodeString:(NSString*)unencodedString{
#pragma clang diagnostic push
#pragma clang diagnostic ignored"-Wdeprecated-declarations"
NSString *encodedString = (NSString *)
CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
(CFStringRef)unencodedString,
NULL,
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
kCFStringEncodingUTF8));
#pragma clang diagnostic pop
return encodedString;
}
#pragma mark - URLDEcode
+(NSString *)decodeString:(NSString*)encodedString
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored"-Wdeprecated-declarations"
NSString *decodedString = (__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(NULL,
(__bridge CFStringRef)encodedString,
CFSTR(""),
CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding));
#pragma clang diagnostic pop
return decodedString;
}
#pragma mark --
+ (BOOL)isPureInt:(NSString *)string{
NSScanner* scan = [NSScanner scannerWithString:string];
int val;
return [scan scanInt:&val] && [scan isAtEnd];
}
#pragma mark -
#pragma mark - ,,,
+(NSAttributedString *)getAttributedString:(NSString *)str color:(UIColor *)color font:(CGFloat)font lineSpa:(CGFloat)lineSpac{
if (lineSpac == 0) {
lineSpac = 5;
}
if (str == nil){
str = @"";
}
if (font <= 0) {
font = 15;
}
if (color == nil) {
color = [UIColor blackColor];
}
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineSpacing = lineSpac;//
NSDictionary *attributes = @{
NSFontAttributeName:[UIFont systemFontOfSize:font],
NSParagraphStyleAttributeName:paragraphStyle,
NSForegroundColorAttributeName:color
};
return [[NSAttributedString alloc] initWithString:str attributes:attributes];
}
//
@end

View File

@@ -0,0 +1,17 @@
//
// GWUIDemoUtil.h
// GWTestSDK
//
// Created by xiaowen.chen on 16/10/28.
// Copyright © 2016年 xw.com. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface BSUIDemoUtil : NSObject
//测试的button
+(UIButton *)addBtn:(NSString *)btnName withView:(UIView *)subViewn frame:(CGRect)frame andtarget:(id)target action:(SEL)action;
@end

View File

@@ -0,0 +1,33 @@
//
// GWUIDemoUtil.m
// GWTestSDK
//
// Created by xiaowen.chen on 16/10/28.
// Copyright © 2016 xw.com. All rights reserved.
//
#import "BSUIDemoUtil.h"
@implementation BSUIDemoUtil
//button
+(UIButton *)addBtn:(NSString *)btnName withView:(UIView *)subViewn frame:(CGRect)frame andtarget:(id)target action:(SEL)action{
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
[btn setTitle:btnName forState:UIControlStateNormal];
[btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
btn.backgroundColor = [UIColor grayColor];
btn.frame = frame;
[btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
return btn;
}
//textFILE
//lable
@end

View File

@@ -0,0 +1,106 @@
//
// XWDateUtil.h
// FrameObject
//
// Created by shenba on 16/4/12.
// Copyright © 2016年 xiaowen. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BSXWDateUtil : NSObject
/**
获取多少天,多少小时,多少分钟,多少秒之后的时间
@param day 天
@param hours 小时
@param min 分数
@param ss 秒数
@param date 当前时间
@param forMet 格式化
@return 结果字符串
*/
+(NSString *)getTimeAfterDay:(int)day hours:(int)hours min:(int)min ss:(int)ss fromDate:(NSDate *)date withForMet:(NSString *)forMet;
/**
时间转字符串
@param date 时间
@param forMet 格式
@return 结果字符串
*/
+(NSString *)strWithDate:(NSDate *)date withForMet:(NSString *)forMet;
/**
字符串转时间
@param dateStr 时间格式的字符串
@param dateFormatterStr 格式
@return 时间
*/
+(NSDate *)DateInitWithString:(NSString *)dateStr dateFormatterStr:(NSString *)dateFormatterStr;
/**
判断是否超过某个时间段 timeInterval:单位秒,记录到硬盘
@param timeInterval 时间(秒)
@param tag 标记
@return 结果是否超过某个时间
*/
+(Boolean)isTimeOver:(int)timeInterval withTag:(NSString *)tag;
/**
清除记录标记的时间
@param tag 标记
*/
+(void)removeTimeOverTag:(NSString *)tag;
/**
判断是否超过某个时间段 timeInterval:单位秒 分组处理
@param timeInterval 时间(秒)
@param tag 标记
@param group 分组
@return 结果是否超过某个时间
*/
+(Boolean)isTimeOver:(int)timeInterval withTag:(NSString *)tag withGroup:(NSString *)group;
/**
按照分组清除记录标记的时间
@param group 分组
*/
+(void)removeTimeOverGroup:(NSString *)group;
/**
计算事件差,需要同格式的字符串
@param time1 时间1
@param time2 时间2
@param formet 时间格式
@return 时间差
*/
+(NSTimeInterval)TimeDifferenceWithTime1:(NSString *)time1 AndTime2:(NSString *)time2 formet:(NSString *)formet;
/**
根据日期返回是否今天,明天,昨天
@param date 日期
@return 今天,昨天,明天,...
*/
+(NSString *)compareDate:(NSDate *)date;
@end

View File

@@ -0,0 +1,222 @@
//
// XWDateUtil.m
// FrameObject
//
// Created by shenba on 16/4/12.
// Copyright © 2016 xiaowen. All rights reserved.
//
#import "BSXWDateUtil.h"
@implementation BSXWDateUtil
static NSDateFormatter *simgle_df;
#pragma mark - ,,,
+(NSString *)getTimeAfterDay:(int)day hours:(int)hours min:(int)min ss:(int)ss fromDate:(NSDate *)date withForMet:(NSString *)forMet{
if (date==nil) {
date = [NSDate date];
}
NSDate *resultDate = [[NSDate alloc]initWithTimeInterval:(24 * 60 * 60)*day+(60*60)*hours+min*60+ss sinceDate:date];
return [self strWithDate:resultDate withForMet:forMet];
}
#pragma mark -
+(NSString *)strWithDate:(NSDate *)date withForMet:(NSString *)forMet{
if (date == nil) {
date = [NSDate date];
}
if (forMet==nil) {
if (!simgle_df) {
simgle_df = [[NSDateFormatter alloc]init];//
[simgle_df setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//simgle_df,线dateFormat
}
return [simgle_df stringFromDate:date];
}
NSDateFormatter*df = [[NSDateFormatter alloc]init];//
[df setDateFormat:forMet];
return [df stringFromDate:date];
}
#pragma mark -
+(NSDate *)DateInitWithString:(NSString *)dateStr dateFormatterStr:(NSString *)dateFormatterStr
{
if (!dateStr) {
return [NSDate date];
}
if (dateFormatterStr == nil) {
if (!simgle_df) {
simgle_df = [[NSDateFormatter alloc]init];//
[simgle_df setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//simgle_df,线dateFormat
}
return [simgle_df dateFromString:dateStr];
}
NSDate *reslutDate = nil;
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
[formatter setDateFormat:dateFormatterStr];
reslutDate = [formatter dateFromString:dateStr];//
return reslutDate;
}
#pragma mark - timeInterval:
+(Boolean)isTimeOver:(int)timeInterval withTag:(NSString *)tag{
NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
NSString *tempStrTag = [NSString stringWithFormat:@"bs_timesover_%@",tag];
NSString *str = [defaults valueForKey:tempStrTag];
NSDate *nowDate = [NSDate date];
// NSLog(@"比较之前存放的时间:%@",tempStrTag);
if (timeInterval == 0) {
[defaults setValue:[self strWithDate:nowDate withForMet:nil] forKey:tempStrTag];
return YES;//0,,
}
if (!str) {
[defaults setValue:[self strWithDate:nowDate withForMet:nil] forKey:tempStrTag];
return YES;//
}
NSTimeInterval time = [nowDate timeIntervalSinceDate:[self DateInitWithString:str dateFormatterStr:nil]];
// NSLog(@"比较相差的时间:%f",time);
if (time > timeInterval) {
[defaults setValue:[self strWithDate:nowDate withForMet:nil] forKey:tempStrTag];
return YES;
}
return NO;
}
#pragma mark - timeInterval:
+(Boolean)isTimeOver:(int)timeInterval withTag:(NSString *)tag withGroup:(NSString *)group{
if (group == nil || tag == nil) {
return YES;
}
NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
//
NSArray *temp = [defaults valueForKey:@"bs_timesGroup"];
NSMutableArray *resultArr = [NSMutableArray arrayWithArray:temp];
NSString *keyStr = [NSString stringWithFormat:@"bs_timeGroup_%@_%@",group,tag];
if (![resultArr containsObject:keyStr]) {
[resultArr addObject:keyStr];
[defaults setValue:resultArr forKey:@"bs_timesGroup"];
}
NSString *str = [defaults valueForKey:keyStr];
NSDate *nowDate = [NSDate date];
// NSLog(@"比较之前存放的时间:%@",tempStrTag);
if (timeInterval == 0) {
[defaults setValue:[self strWithDate:nowDate withForMet:nil] forKey:keyStr];
return YES;//0,,
}
if (!str) {
[defaults setValue:[self strWithDate:nowDate withForMet:nil] forKey:keyStr];
return YES;//
}
NSTimeInterval time = [nowDate timeIntervalSinceDate:[self DateInitWithString:str dateFormatterStr:nil]];
// NSLog(@"比较相差的时间:%f",time);
if (time > timeInterval) {
[defaults setValue:[self strWithDate:nowDate withForMet:nil] forKey:keyStr];
return YES;
}
return NO;
}
#pragma mark -
+(void)removeTimeOverTag:(NSString *)tag{
if (tag == nil) {
return;
}
NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
NSString *tempStrTag = [NSString stringWithFormat:@"bs_timesover_%@",tag];
[defaults removeObjectForKey:tempStrTag];
}
#pragma mark -
+(void)removeTimeOverGroup:(NSString *)group{
if (group == nil) {
return;
}
NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
NSMutableArray *resultArr = [NSMutableArray array];
NSArray *temp = [defaults valueForKey:@"bs_timesGroup"];
Boolean isChange = NO;
for (NSString *str in temp) {
if ([str hasPrefix:[NSString stringWithFormat:@"bs_timeGroup_%@_",group]]) {
[defaults removeObjectForKey:str];
isChange = YES;
}else{
[resultArr addObject:str];
}
}
if (isChange) {
[defaults setValue:resultArr forKey:@"bs_timesGroup"];
}
}
#pragma mark - ,
+(NSTimeInterval)TimeDifferenceWithTime1:(NSString *)time1 AndTime2:(NSString *)time2 formet:(NSString *)formet{
return [[self DateInitWithString:time1 dateFormatterStr:formet] timeIntervalSinceDate:[self DateInitWithString:time2 dateFormatterStr:formet]];
}
#pragma mark - ios,,
+(NSString *)compareDate:(NSDate *)date{
NSTimeInterval secondsPerDay = 24 * 60 * 60;
NSDate *today = [[NSDate alloc] init];
NSDate *tomorrow, *yesterday;
tomorrow = [today dateByAddingTimeInterval: secondsPerDay];
yesterday = [today dateByAddingTimeInterval: -secondsPerDay];
// 10 first characters of description is the calendar date:
NSString * todayString = [[today description] substringToIndex:10];
NSString * yesterdayString = [[yesterday description] substringToIndex:10];
NSString * tomorrowString = [[tomorrow description] substringToIndex:10];
NSString * dateString = [[date description] substringToIndex:10];
if ([dateString isEqualToString:todayString])
{
return @"今天";
} else if ([dateString isEqualToString:yesterdayString])
{
return @"昨天";
}else if ([dateString isEqualToString:tomorrowString])
{
return @"明天";
}
else
{
return dateString;
}
}
@end

View File

@@ -0,0 +1,16 @@
//
// BS_UIColor.h
// TextSdk
//
// Created by xiaowen on 2017/9/22.
// Copyright © 2017年 gatawang.com. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface BS_UIColor : NSObject
+ (UIColor *) stringTOColor:(NSString *)str;
@end

View File

@@ -0,0 +1,31 @@
//
// BS_UIColor.m
// TextSdk
//
// Created by xiaowen on 2017/9/22.
// Copyright © 2017 gatawang.com. All rights reserved.
//
#import "BS_UIColor.h"
@implementation BS_UIColor
+ (UIColor *) stringTOColor:(NSString *)str
{
if (!str || [str isEqualToString:@""]) {
return nil;
}
unsigned red,green,blue;
NSRange range;
range.length = 2;
range.location = 1;
[[NSScanner scannerWithString:[str substringWithRange:range]] scanHexInt:&red];
range.location = 3;
[[NSScanner scannerWithString:[str substringWithRange:range]] scanHexInt:&green];
range.location = 5;
[[NSScanner scannerWithString:[str substringWithRange:range]] scanHexInt:&blue];
UIColor *color= [UIColor colorWithRed:red/255.0f green:green/255.0f blue:blue/255.0f alpha:1];
return color;
}
@end

View File

@@ -0,0 +1,32 @@
//
// BS_Define.h
// GWTestSDK
//
// Created by xiaowen.chen on 16/8/16.
// Copyright © 2016年 xw.com. All rights reserved.
//
#define GET_X(view) view.frame.origin.x
#define GET_Y(view) view.frame.origin.y
#define GET_W(view) view.frame.size.width
#define GET_H(view) view.frame.size.height
#define GET_X_Max(view) view.frame.origin.x + view.frame.size.width
#define GET_Y_Max(view) view.frame.origin.y + view.frame.size.height
#define Set_frame(tempView,a,b) CGRect bs_tempRect = tempView.frame;bs_tempRect.origin.x = a;bs_tempRect.origin.y = b;tempView.frame = bs_tempRect;
#define Set_frame2(tempView,a,b,c,d) CGRect bs_tempRect = tempView.frame;bs_tempRect.origin.x = a;bs_tempRect.origin.y = b;bs_tempRect.size.width = c;bs_tempRect.size.height = d;tempView.frame = bs_tempRect;
#define USER_LANGUAGE @"user_language"
//判断ios系统版本
#define IOS7 ([[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 ? YES:NO)
#define IOS8 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0 ? YES:NO)
#define IOS9 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0 ? YES:NO)
#define IOS10 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0 ? YES:NO)

View File

@@ -0,0 +1,18 @@
//
// SystemUtil.h
// GWTestSDK
//
// Created by xiaowen.chen on 16/11/10.
// Copyright © 2016年 xw.com. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface SystemUtil : NSObject
/*
* 获取项目名
*/
+(NSString *)getProjectName;
@end

View File

@@ -0,0 +1,35 @@
//
// SystemUtil.m
// GWTestSDK
//
// Created by xiaowen.chen on 16/11/10.
// Copyright © 2016 xw.com. All rights reserved.
//
#import "SystemUtil.h"
@implementation SystemUtil
+(NSString *)getProjectName{
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
return [infoDictionary objectForKey:(NSString *)kCFBundleExecutableKey]; //
}
@end
//
//
//
//
//
//
//
//
//

View File

@@ -0,0 +1,62 @@
//
// UILabel+YBAttributeTextTapAction.h
//
// Created by LYB on 16/7/1.
// Copyright © 2016年 LYB. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol YBAttributeTapActionDelegate <NSObject>
@optional
/**
* YBAttributeTapActionDelegate
*
* @param string 点击的字符串
* @param range 点击的字符串range
* @param index 点击的字符在数组中的index
*/
- (void)yb_attributeTapReturnString:(NSString *)string
range:(NSRange)range
index:(NSInteger)index;
@end
@interface YBAttributeModel : NSObject
@property (nonatomic, copy) NSString *str;
@property (nonatomic, assign) NSRange range;
@end
@interface UILabel (YBAttributeTextTapAction)
/**
* 是否打开点击效果,默认是打开
*/
@property (nonatomic, assign) BOOL enabledTapEffect;
/**
* 给文本添加点击事件Block回调
*
* @param strings 需要添加的字符串数组
* @param tapClick 点击事件回调
*/
- (void)yb_addAttributeTapActionWithStrings:(NSArray <NSString *> *)strings
tapClicked:(void (^) (NSString *string , NSRange range , NSInteger index))tapClick;
/**
* 给文本添加点击事件delegate回调
*
* @param strings 需要添加的字符串数组
* @param delegate delegate
*/
- (void)yb_addAttributeTapActionWithStrings:(NSArray <NSString *> *)strings
delegate:(id <YBAttributeTapActionDelegate> )delegate;
@end

View File

@@ -0,0 +1,396 @@
//
// UILabel+YBAttributeTextTapAction.m
//
// Created by LYB on 16/7/1.
// Copyright © 2016 LYB. All rights reserved.
//
#import "UILabel+YBAttributeTextTapAction.h"
#import <objc/runtime.h>
#import <CoreText/CoreText.h>
#import <Foundation/Foundation.h>
@implementation YBAttributeModel
@end
@implementation UILabel (YBAttributeTextTapAction)
#pragma mark - AssociatedObjects
- (NSMutableArray *)attributeStrings
{
return objc_getAssociatedObject(self, _cmd);
}
- (void)setAttributeStrings:(NSMutableArray *)attributeStrings
{
objc_setAssociatedObject(self, @selector(attributeStrings), attributeStrings, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (NSMutableDictionary *)effectDic
{
return objc_getAssociatedObject(self, _cmd);
}
- (void)setEffectDic:(NSMutableDictionary *)effectDic
{
objc_setAssociatedObject(self, @selector(effectDic), effectDic, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (BOOL)isTapAction
{
return [objc_getAssociatedObject(self, _cmd) boolValue];
}
- (void)setIsTapAction:(BOOL)isTapAction
{
objc_setAssociatedObject(self, @selector(isTapAction), @(isTapAction), OBJC_ASSOCIATION_ASSIGN);
}
- (void (^)(NSString *, NSRange, NSInteger))tapBlock
{
return objc_getAssociatedObject(self, _cmd);
}
- (void)setTapBlock:(void (^)(NSString *, NSRange, NSInteger))tapBlock
{
objc_setAssociatedObject(self, @selector(tapBlock), tapBlock, OBJC_ASSOCIATION_COPY_NONATOMIC);
}
- (id<YBAttributeTapActionDelegate>)delegate
{
return objc_getAssociatedObject(self, _cmd);
}
- (BOOL)enabledTapEffect
{
return [objc_getAssociatedObject(self, _cmd) boolValue];
}
- (void)setEnabledTapEffect:(BOOL)enabledTapEffect
{
objc_setAssociatedObject(self, @selector(enabledTapEffect), @(enabledTapEffect), OBJC_ASSOCIATION_ASSIGN);
self.isTapEffect = enabledTapEffect;
}
- (BOOL)isTapEffect
{
return [objc_getAssociatedObject(self, _cmd) boolValue];
}
- (void)setIsTapEffect:(BOOL)isTapEffect
{
objc_setAssociatedObject(self, @selector(isTapEffect), @(isTapEffect), OBJC_ASSOCIATION_ASSIGN);
}
- (void)setDelegate:(id<YBAttributeTapActionDelegate>)delegate
{
objc_setAssociatedObject(self, @selector(delegate), delegate, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
#pragma mark - mainFunction
- (void)yb_addAttributeTapActionWithStrings:(NSArray <NSString *> *)strings tapClicked:(void (^) (NSString *string , NSRange range , NSInteger index))tapClick
{
[self yb_getRangesWithStrings:strings];
if (self.tapBlock != tapClick) {
self.tapBlock = tapClick;
}
}
- (void)yb_addAttributeTapActionWithStrings:(NSArray <NSString *> *)strings
delegate:(id <YBAttributeTapActionDelegate> )delegate
{
[self yb_getRangesWithStrings:strings];
if (self.delegate != delegate) {
self.delegate = delegate;
}
}
#pragma mark - touchAction
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
if (!self.isTapAction) {
return;
}
if (objc_getAssociatedObject(self, @selector(enabledTapEffect))) {
self.isTapEffect = self.enabledTapEffect;
}
UITouch *touch = [touches anyObject];
CGPoint point = [touch locationInView:self];
__weak typeof(self) weakSelf = self;
[self yb_getTapFrameWithTouchPoint:point result:^(NSString *string, NSRange range, NSInteger index) {
if (weakSelf.tapBlock) {
weakSelf.tapBlock (string , range , index);
}
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(yb_attributeTapReturnString:range:index:)]) {
[weakSelf.delegate yb_attributeTapReturnString:string range:range index:index];
}
if (self.isTapEffect) {
[self yb_saveEffectDicWithRange:range];
[self yb_tapEffectWithStatus:NO];
}
}];
}
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
if (self.isTapAction) {
if ([self yb_getTapFrameWithTouchPoint:point result:nil]) {
return self;
}
}
return [super hitTest:point withEvent:event];
}
#pragma mark - getTapFrame
- (BOOL)yb_getTapFrameWithTouchPoint:(CGPoint)point result:(void (^) (NSString *string , NSRange range , NSInteger index))resultBlock
{
CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((CFAttributedStringRef)self.attributedText);
CGMutablePathRef Path = CGPathCreateMutable();
CGPathAddRect(Path, NULL, CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height));
CTFrameRef frame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), Path, NULL);
CFRange range = CTFrameGetVisibleStringRange(frame);
if (self.attributedText.length > range.length) {
UIFont *font ;
if ([self.attributedText attribute:NSFontAttributeName atIndex:0 effectiveRange:nil]) {
font = [self.attributedText attribute:NSFontAttributeName atIndex:0 effectiveRange:nil];
}else if (self.font){
font = self.font;
}else {
font = [UIFont systemFontOfSize:17];
}
CGPathRelease(Path);
Path = CGPathCreateMutable();
CGPathAddRect(Path, NULL, CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height + font.lineHeight));
frame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), Path, NULL);
}
CFArrayRef lines = CTFrameGetLines(frame);
if (!lines) {
CFRelease(frame);
CFRelease(framesetter);
CGPathRelease(Path);
return NO;
}
CFIndex count = CFArrayGetCount(lines);
CGPoint origins[count];
CTFrameGetLineOrigins(frame, CFRangeMake(0, 0), origins);
CGAffineTransform transform = [self yb_transformForCoreText];
CGFloat verticalOffset = 0;
for (CFIndex i = 0; i < count; i++) {
CGPoint linePoint = origins[i];
CTLineRef line = CFArrayGetValueAtIndex(lines, i);
CGRect flippedRect = [self yb_getLineBounds:line point:linePoint];
CGRect rect = CGRectApplyAffineTransform(flippedRect, transform);
rect = CGRectInset(rect, 0, 0);
rect = CGRectOffset(rect, 0, verticalOffset);
NSParagraphStyle *style = [self.attributedText attribute:NSParagraphStyleAttributeName atIndex:0 effectiveRange:nil];
CGFloat lineSpace;
if (style) {
lineSpace = style.lineSpacing;
}else {
lineSpace = 0;
}
CGFloat lineOutSpace = (self.bounds.size.height - lineSpace * (count - 1) -rect.size.height * count) / 2;
rect.origin.y = lineOutSpace + rect.size.height * i + lineSpace * i;
if (CGRectContainsPoint(rect, point)) {
CGPoint relativePoint = CGPointMake(point.x - CGRectGetMinX(rect), point.y - CGRectGetMinY(rect));
CFIndex index = CTLineGetStringIndexForPosition(line, relativePoint);
CGFloat offset;
CTLineGetOffsetForStringIndex(line, index, &offset);
if (offset > relativePoint.x) {
index = index - 1;
}
NSInteger link_count = self.attributeStrings.count;
for (int j = 0; j < link_count; j++) {
YBAttributeModel *model = self.attributeStrings[j];
NSRange link_range = model.range;
if (NSLocationInRange(index, link_range)) {
if (resultBlock) {
resultBlock (model.str , model.range , (NSInteger)j);
}
CFRelease(frame);
CFRelease(framesetter);
CGPathRelease(Path);
return YES;
}
}
}
}
CFRelease(frame);
CFRelease(framesetter);
CGPathRelease(Path);
return NO;
}
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
if (self.isTapEffect) {
[self performSelectorOnMainThread:@selector(yb_tapEffectWithStatus:) withObject:nil waitUntilDone:NO];
}
}
- (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
if (self.isTapEffect) {
[self performSelectorOnMainThread:@selector(yb_tapEffectWithStatus:) withObject:nil waitUntilDone:NO];
}
}
- (CGAffineTransform)yb_transformForCoreText
{
return CGAffineTransformScale(CGAffineTransformMakeTranslation(0, self.bounds.size.height), 1.f, -1.f);
}
- (CGRect)yb_getLineBounds:(CTLineRef)line point:(CGPoint)point
{
CGFloat ascent = 0.0f;
CGFloat descent = 0.0f;
CGFloat leading = 0.0f;
CGFloat width = (CGFloat)CTLineGetTypographicBounds(line, &ascent, &descent, &leading);
CGFloat height = ascent + fabs(descent) + leading;
return CGRectMake(point.x, point.y , width, height);
}
#pragma mark - tapEffect
- (void)yb_tapEffectWithStatus:(BOOL)status
{
if (self.isTapEffect) {
NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithAttributedString:self.attributedText];
NSMutableAttributedString *subAtt = [[NSMutableAttributedString alloc] initWithAttributedString:[[self.effectDic allValues] firstObject]];
NSRange range = NSRangeFromString([[self.effectDic allKeys] firstObject]);
if (status) {
[subAtt addAttribute:NSBackgroundColorAttributeName value:[UIColor lightGrayColor] range:NSMakeRange(0, subAtt.string.length)];
[attStr replaceCharactersInRange:range withAttributedString:subAtt];
}else {
[attStr replaceCharactersInRange:range withAttributedString:subAtt];
}
self.attributedText = attStr;
}
}
- (void)yb_saveEffectDicWithRange:(NSRange)range
{
self.effectDic = [NSMutableDictionary dictionary];
NSAttributedString *subAttribute = [self.attributedText attributedSubstringFromRange:range];
[self.effectDic setObject:subAttribute forKey:NSStringFromRange(range)];
}
#pragma mark - getRange
- (void)yb_getRangesWithStrings:(NSArray <NSString *> *)strings
{
if (self.attributedText == nil) {
self.isTapAction = NO;
return;
}
self.isTapAction = YES;
self.isTapEffect = YES;
__block NSString *totalStr = self.attributedText.string;
self.attributeStrings = [NSMutableArray array];
__weak typeof(self) weakSelf = self;
[strings enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
NSRange range = [totalStr rangeOfString:obj];
if (range.length != 0) {
totalStr = [totalStr stringByReplacingCharactersInRange:range withString:[weakSelf yb_getStringWithRange:range]];
YBAttributeModel *model = [YBAttributeModel new];
model.range = range;
model.str = obj;
[weakSelf.attributeStrings addObject:model];
}
}];
}
- (NSString *)yb_getStringWithRange:(NSRange)range
{
NSMutableString *string = [NSMutableString string];
for (int i = 0; i < range.length ; i++) {
[string appendString:@" "];
}
return string;
}
@end

View File

@@ -0,0 +1,32 @@
//
// GWFileOptionModel.h
// GWTestSDK
//
// Created by xiaowen.chen on 16/8/29.
// Copyright © 2016年 xw.com. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BSFileOptionModel : NSObject
//写入数据
+(void)writeToFile_RecordModel:(NSArray *)logArray stringForMatBlock:( NSString*(^)( NSString *forMatString) )forMatblock withCompletion:( NSString*(^)( NSString *logString) )block class:(Class)class1;
/*
* 压缩当天产生的日志文件zip文件:
* 1:如果当天没有日志文件,返回空;
* 2:如果没有实现压缩zip的方法,返回日志的位置路径;
* 3:如果实现了压缩文件的方法,返回日志压缩后的位置路径.
*
*/
+(NSString *)compression:(void(^)( NSString *logPath))block;
//删除所有日志数据
+(void)deleteFilePathLog;
@end

View File

@@ -0,0 +1,206 @@
//
// FileOptionModel.m
// GWTestSDK
//
// Created by xiaowen.chen on 16/8/29.
// Copyright © 2016 xw.com. All rights reserved.
//
#import "BSFileOptionModel.h"
#import "BSRecordModel.h"
#import <objc/runtime.h>//
#define BS_DocumentPath [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]
#define BS_LogFilePath [NSString stringWithFormat:@"%@/%@", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0],@"GWLogFile"]
#define BS_LogZipFilePath [NSString stringWithFormat:@"%@/%@", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0],@"GWLogFileZip"]
@implementation BSFileOptionModel
+(void)writeToFile_RecordModel:(NSArray *)logArray stringForMatBlock:( NSString*(^)( NSString *forMatString) )forMatblock withCompletion:( NSString*(^)( NSString *logString) )block class:(Class)class1{
//
NSString *logFile = BS_LogFilePath;
if (![[NSFileManager defaultManager] fileExistsAtPath:logFile]) {
[[NSFileManager defaultManager] createDirectoryAtPath:logFile withIntermediateDirectories:YES attributes:nil error:nil];
} else {
NSLog(@"FileDir is exists.");
}
//txt
NSString *logTxtPath = [NSString stringWithFormat:@"%@/%@.txt", logFile,[self currentTime]];
if (![[NSFileManager defaultManager] fileExistsAtPath:logTxtPath]) {
[[NSFileManager defaultManager] createFileAtPath:logTxtPath contents:nil attributes:nil];
}
// NSLog(@"logTxtPath = %@",logTxtPath);
//
NSError *error;
NSString *logHead = [NSString stringWithFormat:@"日志协议类型:1,写入时间:%@\n",[self currentTime2]];
BOOL flag = [logHead writeToFile:logTxtPath atomically:YES encoding:NSUTF8StringEncoding error:&error];//errornil
if (flag) {
NSLog(@"写入文件头成功");
}
else{
NSLog(@"写入文件头失败");
}
@autoreleasepool {
NSString *str = @"类型编码:[coding] 类型:ddd 描述:[describe] 关键字:[keyword] 结果:[result] 操作编码:[optionCoding]\n";
if (forMatblock) {
str = forMatblock(str);
}
id log;
NSFileHandle *fileHandle = [NSFileHandle fileHandleForUpdatingAtPath:logTxtPath];
for (int i = 0 ; i<logArray.count; i++) {
if ([logArray[i] isKindOfClass:class1]) {
log = logArray[i];
[fileHandle seekToEndOfFile];
for (NSString *tempProperties in [self getProperties:class1]) {
NSString *tempValue = [log valueForKey:tempProperties];
if ([tempValue isKindOfClass:[NSNumber class]]) {
NSNumber *tempNumber = (NSNumber *)tempValue;
tempValue = [NSString stringWithFormat:@"%@",tempNumber];
str = [str stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"[%@]",tempProperties] withString:tempValue];
}else{
str = [str stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"[%@]",tempProperties] withString:tempValue];
}
}
if(block){
str = block(str);
}
NSLog(@"写入:%@",str);
NSData* stringData = [str dataUsingEncoding:NSUTF8StringEncoding];
[fileHandle writeData:stringData];
}
}
[fileHandle closeFile];
}
}
/*
* zip:
* 1:,;
* 2:zip,;
* 3:,.
*
*/
+(NSString *)compression:(void(^)( NSString *logPath))block{
//
NSString *logTextPath = [NSString stringWithFormat:@"%@/%@.txt", BS_LogFilePath,[self currentTime]];
if (![[NSFileManager defaultManager] fileExistsAtPath:logTextPath]) {
//
return nil;
}
if (![[NSFileManager defaultManager] fileExistsAtPath:BS_LogZipFilePath]) {
[[NSFileManager defaultManager] createDirectoryAtPath:BS_LogZipFilePath withIntermediateDirectories:YES attributes:nil error:nil];
}
NSString *zipPath = [NSString stringWithFormat:@"%@/%@.zip", BS_LogZipFilePath,[self currentTime]];
if (block) {
block(logTextPath);
}else{
return logTextPath;
}
return zipPath;
}
+ (instancetype)getProperties:(Class)cls{
//
unsigned int count;//
objc_property_t *properties = class_copyPropertyList(cls, &count);
//
NSMutableArray *mArray = [NSMutableArray array];
for (int i = 0; i < count; i++) {
// objc_property_t
objc_property_t property = properties[i];
// C
const char *cName = property_getName(property);
// Objective C
NSString *name = [NSString stringWithCString:cName encoding:NSUTF8StringEncoding];
[mArray addObject:name];
}
return mArray.copy;
}
//
+(NSString *)currentTime{
return [self getTimeStr:@"YYYY-MM-dd"];
}
//
+(NSString *)currentTime2{
return [self getTimeStr:@"YYYY-MM-dd HH:mm:ss:SSS"];
}
+(NSString *)getTimeStr:(NSString *)forMet{
NSDate * currentTime=[NSDate date];
NSDateFormatter *dateformatter=[[NSDateFormatter alloc] init];
[dateformatter setDateFormat:forMet];//
NSString *currentTimeStr=[dateformatter stringFromDate:currentTime];
return currentTimeStr;
}
#pragma mark -
+(void)deleteFilePathLog{
NSFileManager *fileManager = [NSFileManager defaultManager];
[self deleteFilePath:BS_LogFilePath fileManager:fileManager];//
[self deleteFilePath:BS_LogZipFilePath fileManager:fileManager];//
}
+(void)deleteFilePath:(NSString *)path fileManager:(NSFileManager *)fileManager{
if ([[NSFileManager defaultManager] fileExistsAtPath:path]) {
Boolean b = [fileManager removeItemAtPath:path error:nil];
if (b) {
NSLog(@"删除文件成功");
}else{
NSLog(@"删除文件失败");
}
}
}
-(void)deleteFile{
NSString *extension = @"m4r";
NSFileManager *fileManager = [NSFileManager defaultManager];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSArray *contents = [fileManager contentsOfDirectoryAtPath:documentsDirectory error:NULL];
NSEnumerator *e = [contents objectEnumerator];
NSString *filename;
while ((filename = [e nextObject])) {
if ([[filename pathExtension] isEqualToString:extension]) {
[fileManager removeItemAtPath:[documentsDirectory stringByAppendingPathComponent:filename] error:NULL];
}
}
}
@end

View File

@@ -0,0 +1,11 @@
文件操作类
(内部)GWFileOptionModel:网络接口监听类,获取网络数据日志处理对象
==>2016.11.8
初始导入 by 陈啸文
================================================

View File

@@ -0,0 +1,90 @@
//
// GWDrawLine.h
// GWTestSDK
//
// Created by xiaowen.chen on 16/9/26.
// Copyright © 2016年 xw.com. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface BSDrawLine : NSObject
/*
* 设置坐标系数据
*/
-(void)initSettingXuint:(CGFloat)xunit xBegin:(CGFloat)xBegin yUint:(CGFloat)yUint yBegain:(CGFloat)yBegain;
/*
* 设置坐标原点
*/
-(void)initPoint:(CGPoint)point;
/**
设置阴线阳线的颜色,是否实心
@param color 阳线颜色
@param color2 阴线颜色
@param isYangLineSolid 阳线是否实心
@param isYinLineSolid 阴线是否实心
.
*/
-(void)initYangLineColor:(UIColor *)color YinLineColor:(UIColor *)color2 isYangLineSolid:(Boolean)isYangLineSolid isYinLineSolid:(Boolean)isYinLineSolid;
/**
画k图
@param arr arr数组长度要>=5 [最大值,最小值,开盘值,收盘值,x坐标,...]
@param ctx CGContextRef画笔对象
@param scan 放大比例
*/
-(void)drawKline:(NSArray *)arr withContext:(CGContextRef)contex scan:(CGFloat)scan;
#pragma mark - 类方法
/**
画直线
[self.myDraw drawLinePoint:@[@[lineWidthStr,@"185",@"185",@"15",@"1"],@[temp5,temp6]] withContext:UIGraphicsGetCurrentContext()];
@param arr2 [[粗细,颜色r,颜色g,颜色b,透明度],[第一条线[第一个点],[第二个点]...],[第二条线]......]
@param ctx CGContextRef画笔对象
@param scan 放大比例
*/
+(void)drawLinePoint:(NSArray *)arr2 withContext:(CGContextRef)context scan:(CGFloat)scan;
/**
画曲线
@param lineArr [[线宽,点size,颜色],[第一条线[第一个点],[第二个点]...],[第二条线]...]
@param ctx CGContextRef画笔对象
@param scan 放大比例
*/
+(void)drawCurves:(NSArray *)lineArr withContext:(CGContextRef)ctx scan:(CGFloat)scan;
/**
画多个多边形
@param lineArr [[线宽,线颜色,填充颜色],[第一个多边形[第一个点],[第二个点]...],[第二个多边形]...]
@param ctx CGContextRef画笔对象
@param scan 放大比例
*/
+(void)drawMoreRects:(NSArray *)lineArr withContext:(CGContextRef)ctx scan:(CGFloat)scan;
#pragma mark - 字体类相关
/**
富文本字体
@param str 字符串
@param size 字体范围
@param point 中心点位置
@param font 字体大小
@param color 字体颜色
*/
+(void)drawWord:(NSString *)str size:(CGSize)size centerPoint:(CGPoint)point font:(CGFloat)font color:(UIColor *)color;
@end

View File

@@ -0,0 +1,530 @@
//
// GWDrawLine.m
// GWTestSDK
//
// Created by xiaowen.chen on 16/9/26.
// Copyright © 2016 xw.com. All rights reserved.
//
#import "BSDrawLine.h"
@interface BSDrawLine()
@property(nonatomic,assign)CGPoint point; //
@property(nonatomic,assign)CGFloat xUint; //x
@property(nonatomic,assign)CGFloat xbegin; //x
@property(nonatomic,assign)CGFloat yUint; //y
@property(nonatomic,assign)CGFloat ybegin; //y
@property(nonatomic,assign)NSString *isSolidYangLine; //线 0(),1
@property(nonatomic,assign)NSString *isSolidYinLine; //线 0(),1
@property(nonatomic,strong)UIColor *YangLineColor; //线
@property(nonatomic,strong)UIColor *YinLineColor; //线
@end
@implementation BSDrawLine
//
-(void)initSettingXuint:(CGFloat)xunit xBegin:(CGFloat)xBegin yUint:(CGFloat)yUint yBegain:(CGFloat)yBegain{
//
if (xunit <= 0 || yBegain < 0 || yUint <= 0 || xBegin < 0) {
NSLog(@"参数配置有误...,%.2f,%.2f,%.2f,%.2f",xunit,xBegin,yUint,yBegain);
return;
}
_xbegin = xBegin;
_ybegin = yBegain;
_xUint = xunit;
_yUint = yUint;
}
//
-(void)initPoint:(CGPoint)point{
_point = point;
}
//线线,
-(void)initYangLineColor:(UIColor *)color YinLineColor:(UIColor *)color2 isYangLineSolid:(Boolean)isYangLineSolid isYinLineSolid:(Boolean)isYinLineSolid{
_YangLineColor = color;
_YinLineColor = color2;
if (isYangLineSolid) {
_isSolidYangLine = @"1";
}else{
_isSolidYangLine = @"0";
}
if (isYinLineSolid) {
_isSolidYinLine = @"0";
}else{
_isSolidYinLine = @"1";
}
}
-(void)drawKline:(NSArray *)arr withContext:(CGContextRef)context scan:(CGFloat)scan{
//
if (_xUint <= 0 ) {
NSLog(@"参数配置未设置...");
return;
}
if (scan == 0) {
scan = 1;
}
if ([arr isKindOfClass:[NSArray class]]) {
for (NSArray *tempArr in arr) {
if ([tempArr isKindOfClass:[NSArray class]]) {
if ([tempArr count] >= 5) {
CGFloat maxTemp = [tempArr[0] floatValue];
CGFloat minTemp = [tempArr[1] floatValue];
CGFloat openTemp = [tempArr[2] floatValue];
CGFloat closeTemp = [tempArr[3] floatValue];
CGFloat xTemp = [tempArr[4] floatValue];
[self drawKLine:maxTemp min:minTemp open:openTemp close:closeTemp x:xTemp lineWidth:1/scan lineWidth2:5/scan context:context];
}else{
NSLog(@"单条数组长度<4");
}
}else{
NSLog(@"单条数组数据异常");
}
}
}else{
NSLog(@"数组有误");
}
//
}
-(void)drawKLine:(CGFloat)max min:(CGFloat)min open:(CGFloat)open close:(CGFloat)close x:(CGFloat)x lineWidth:(CGFloat)lineWidth lineWidth2:(CGFloat)lineWidth2 context:(CGContextRef)context{
//
if (max < min || max < open || max < close) {
NSLog(@"最大值不正确");
NSLog(@"最大值:%.2f,最小值:%.2f,开盘:%.2f,收盘:%.2f",max,min,open,close);
}
if (min > max || min > open || min > close) {
NSLog(@"最小值不正确");
NSLog(@"最大值:%.2f,最小值:%.2f,开盘:%.2f,收盘:%.2f",max,min,open,close);
}
[self drawKLine:max min:min open:open close:close x:x lineWidth:lineWidth lineWidth2:lineWidth2 withPoint:_point xUnit:_xUint yUnit:_yUint xbegin:_xbegin ybegin:_ybegin context:context];
}
/**
* k线
*/
-(void)drawKLine:(CGFloat)max min:(CGFloat)min open:(CGFloat)open close:(CGFloat)close x:(CGFloat)x lineWidth:(CGFloat)lineWidth lineWidth2:(CGFloat)lineWidth2 withPoint:(CGPoint)point xUnit:(CGFloat)xUnit yUnit:(CGFloat)yUnit xbegin:(CGFloat)xbegin ybegin:(CGFloat)ybegin context:(CGContextRef)context{
//线or线
Boolean isYangLine;
CGFloat top = 0;
CGFloat bottom = 0;
if (close > open) {
isYangLine = true;
top = close;
bottom = open;
}else{
isYangLine = false;
top = open;
bottom = close;
}
//pointview
max = point.y - (max - ybegin)*yUnit;
min = point.y - (min - ybegin)*yUnit;
top = point.y - (top - ybegin)*yUnit;
bottom = point.y - (bottom - ybegin)*yUnit;
x = (x - xbegin)*xUnit + point.x;
// NSLog(@"\nmax:%.2f\ntop:%.2f\nbottom:%.2f\nmin:%.2f",max,top,bottom,min);
UIColor *lineColor = [self getLineColor:isYangLine];
[lineColor setStroke];
//线
CGContextSetLineCap(context,kCGLineCapSquare); //线
CGContextSetLineWidth(context,lineWidth); //线
CGContextBeginPath(context); //
CGContextMoveToPoint(context,x, max); //
CGContextAddLineToPoint(context,x, top); //
CGContextStrokePath(context); //
//
CGFloat height = top - bottom == 0 ? 1 : top - bottom;
if (height < 0) {
height = - height;
}
UIColor *solidColor = lineColor;
if (![self getSolid:isYangLine]) {
solidColor = [UIColor clearColor]; //
}
CGContextBeginPath(context); //
CGContextMoveToPoint(context,x, top); //
[self draw4Rect:CGRectMake(x - lineWidth2/2 , top, lineWidth2,height) withColor:lineColor color2:solidColor withContex:context];
//线
[lineColor setStroke];
CGContextSetLineCap(context,kCGLineCapSquare); //线
CGContextSetLineWidth(context,lineWidth); //线
CGContextBeginPath(context); //
CGContextMoveToPoint(context,x, bottom); //
CGContextAddLineToPoint(context,x, min); //
CGContextStrokePath(context); //
}
//k线
-(UIColor *)getLineColor:(Boolean)isYangLine{
if (isYangLine) {
if (_YangLineColor == nil) {
return [UIColor redColor];
}
return _YangLineColor;
}
if (_YinLineColor == nil) {
return [UIColor greenColor];
}
return _YinLineColor;
}
//
-(Boolean)getSolid:(Boolean)isYangLine{
if (isYangLine) {
if ([_isSolidYangLine isEqualToString:@"0"]) {
return false;
}
}else{
if (![_isSolidYinLine isEqualToString:@"0"]) {
return false;
}
}
return true;
}
//[[,r,g,b,],[],[]......]
+(void)drawLinePoint:(NSArray *)arr2 withContext:(CGContextRef)context scan:(CGFloat)scan{
if (arr2.count < 2) {
NSLog(@"数据不全...");
return;
}
if (scan == 0) {
scan = 1;
}
@autoreleasepool {
NSArray *arr = arr2[0];
if (![arr isKindOfClass:[NSArray class]] || arr.count < 5) {
NSLog(@"设置参数不正确...");
return;
}
//kCGLineCapButt,
//kCGLineCapRound,
//kCGLineCapSquare
//线
CGContextSetLineCap(context,kCGLineCapSquare);
// kCGLineJoinMiter,
// kCGLineJoinRound,
// kCGLineJoinBevel
//线
CGContextSetLineJoin(context, kCGLineJoinRound);
//线
CGContextSetLineWidth(context,[arr[0] floatValue]/scan);
//
CGContextSetRGBStrokeColor(context,[arr[1] floatValue]/255.0, [arr[2] floatValue]/255.0, [arr[3] floatValue]/255.0, [arr[4] floatValue]);
//
CGContextBeginPath(context);
//(31,170)
for (int i = 1; i < arr2.count; i++) {
NSArray *temp = arr2[i];
if ([temp isKindOfClass:[NSArray class]]) {
for (int j = 0; j < temp.count; ++j) {
NSString *tempStr = temp[j];
NSArray *tempArr = [tempStr componentsSeparatedByString:@","];
if (j == 0) {
if (tempArr.count != 2) {
NSLog(@"初始点异常");
//
CGContextStrokePath(context);
return;
}
CGContextMoveToPoint(context,
[tempArr[0] floatValue], [tempArr[1] floatValue]);
}else{
// NSLog(@"画下一个点(%.2f,%.2f);",[tempArr[0] floatValue],[tempArr[1] floatValue]);
//
CGContextAddLineToPoint(context,
[tempArr[0] floatValue], [tempArr[1] floatValue]);
}
}
}else{
NSLog(@"抛弃不规范的数据...");
}
}
//
CGContextStrokePath(context);
}
}
//[[线,size,],[线[],[]...],[线]...]
+(void)drawCurves:(NSArray *)lineArr withContext:(CGContextRef)ctx scan:(CGFloat)scan{
if (lineArr.count < 2) {
return;
}
if (scan == 0) {
scan = 1;
}
NSArray *peizhiArr = lineArr[0];
CGFloat lineWidth = 0.0;
CGSize pointSize1;
UIColor *lineColor;
if ([peizhiArr isKindOfClass:[NSArray class]]) {
//线
if (peizhiArr.count > 0) {
lineWidth = [peizhiArr[0] floatValue];
}else{
lineWidth = 1;
}
//
if (peizhiArr.count > 1) {
pointSize1 = [peizhiArr[1] CGSizeValue];
}else{
pointSize1 = CGSizeMake(1, 1);
}
//线
if (peizhiArr.count > 2) {
lineColor = peizhiArr[2];
}else{
lineColor = [UIColor blackColor];
}
}else{
lineWidth = 1;
pointSize1 = CGSizeMake(1, 1);
lineColor = [UIColor blackColor];
}
lineWidth = lineWidth/scan;
pointSize1 = CGSizeMake(pointSize1.width/scan, pointSize1.height/scan);
for (int i = 1; i < lineArr.count; ++i) {
NSArray *tempLineArr = lineArr[i];
if ([tempLineArr isKindOfClass:[NSArray class]]) {
[self drawCurve:tempLineArr context:ctx color:lineColor pointSize:pointSize1 lineWidth:lineWidth];
}
}
}
//线
+(void)drawCurve:(NSArray *)lineArr2_1 context:(CGContextRef)ctx color:(UIColor *)color pointSize:(CGSize)pointSize lineWidth:(CGFloat)lineWidth{
//bezier 线
if([lineArr2_1 count]){
//线
UIBezierPath* path = [UIBezierPath bezierPath];
[path setLineWidth:lineWidth];
for(int i=0; i<[lineArr2_1 count]-1; i++){
if([lineArr2_1 safeObjectAtIndex1:i] != nil && [lineArr2_1 safeObjectAtIndex1:i+1] != nil){
CGPoint firstPoint = [[lineArr2_1 safeObjectAtIndex1:i] CGPointValue];
CGPoint secondPoint = [[lineArr2_1 safeObjectAtIndex1:i+1] CGPointValue];
[path moveToPoint:firstPoint];
// ios <wbr>线
[path addCurveToPoint:secondPoint controlPoint1:CGPointMake((secondPoint.x-firstPoint.x)/2+firstPoint.x, firstPoint.y) controlPoint2:CGPointMake((secondPoint.x-firstPoint.x)/2+firstPoint.x, secondPoint.y)];
[color set];
}
}
path.lineCapStyle = kCGLineCapRound;
[path strokeWithBlendMode:kCGBlendModeNormal alpha:1];
//
// for(int i=0; i<[lineArr2_1 count]; i++){
// CGPoint point = [[lineArr2_1 safeObjectAtIndex1:i] CGPointValue];
// CGContextFillEllipseInRect(ctx, CGRectMake(point.x-(pointSize.width/2.0), point.y-(pointSize.height/2.0), pointSize.width, pointSize.height));
// CGContextSetFillColorWithColor(ctx, color.CGColor);
// CGContextFillPath(ctx);
// }
}
}
/**
* 线
*/
-(void)drawlineWithPointsArray:(CGPoint *)points count:(int)count lineWeight:(CGFloat)lineWeight lineColor:(UIColor *)lineColor withPointWeight1:(CGFloat)width pointWeight2:(CGFloat)width2 pointColor1:(UIColor *)color1 pointColor2:(UIColor *)color2{
CGContextRef context = UIGraphicsGetCurrentContext();
[lineColor setStroke];
CGContextSetLineWidth(context, lineWeight);
CGContextAddLines(context, points, count);
CGContextStrokePath(context);
for (int i = 0; i < count; i ++) {
CGRect ellipseRect = CGRectMake(points[i].x - (width+width2), points[i].y - (width+width2), (width+width2)*2, (width+width2)*2);
CGContextAddEllipseInRect(context, ellipseRect);
CGContextSetLineWidth(context, width);
[color1 setStroke];
[color2 setFill];
CGContextFillEllipseInRect(context, ellipseRect);
CGContextStrokeEllipseInRect(context, ellipseRect);
}
}
/**
*
*/
-(void)draw4Rect:(CGRect)rect withColor:(UIColor *)color1 color2:(UIColor *)color2 withContex:(CGContextRef)ctx{
// 2.
CGContextAddRect(ctx,rect);
CGContextSetLineWidth(ctx,0.5f);//
CGContextSetFillColorWithColor(ctx, color2.CGColor);//
CGContextSetStrokeColorWithColor(ctx, color1.CGColor);//线
CGContextAddRect(ctx,rect);//
CGContextDrawPath(ctx, kCGPathFillStroke);//
CGContextFillPath(ctx);//
}
//[[线,线,],[[],[]...],[]...]
+(void)drawMoreRects:(NSArray *)lineArr withContext:(CGContextRef)ctx scan:(CGFloat)scan{
if (lineArr.count < 2) {
return;
}
if (scan == 0) {
scan = 1;
}
NSArray *peizhiArr = lineArr[0];
CGFloat lineWidth = 0.0;
UIColor *lineColor;
UIColor *fileColor;
if ([peizhiArr isKindOfClass:[NSArray class]]) {
//线
if (peizhiArr.count > 0) {
lineWidth = [peizhiArr[0] floatValue];
}else{
lineWidth = 1;
}
//线
if (peizhiArr.count > 1) {
lineColor = peizhiArr[1];
}else{
lineColor = [UIColor blackColor];
}
//
if (peizhiArr.count > 2) {
fileColor = peizhiArr[2];
}else{
fileColor = [UIColor redColor];
}
}else{
lineWidth = 1;
lineColor = [UIColor blackColor];
fileColor = [UIColor redColor];
}
lineWidth = lineWidth/scan;
for (int i = 1; i < lineArr.count; ++i) {
NSArray *tempLineArr = lineArr[i];
if ([tempLineArr isKindOfClass:[NSArray class]]) {
[self drawMoreRect:tempLineArr withColor:lineColor color2:fileColor width:lineWidth withContex:ctx];
}
}
}
/**
* color1线 color2 width线 pointArr,cgpoint
*/
+(void)drawMoreRect:(NSArray *)pointArr withColor:(UIColor *)color1 color2:(UIColor *)color2 width:(CGFloat)width withContex:(CGContextRef)context{
if (pointArr.count < 3) {
NSLog(@"不规范的多边形图");
return;
}
//
CGContextSetLineWidth(context, width);
CGContextSetFillColorWithColor(context, color2.CGColor);//
CGContextSetStrokeColorWithColor(context, color1.CGColor);//线
CGPoint begainPoint = [pointArr[0] CGPointValue];
CGContextMoveToPoint(context, begainPoint.x, begainPoint.y);
for (int i = 1; i < pointArr.count; ++i) {
CGPoint tempPoint = [pointArr[i] CGPointValue];
CGContextAddLineToPoint(context, tempPoint.x, tempPoint.y);
}
CGContextFillPath(context);
}
#pragma mark -
+(void)drawWord:(NSString *)str size:(CGSize)size centerPoint:(CGPoint)point font:(CGFloat)font color:(UIColor *)color{
if (color == nil) {
color = [UIColor blueColor];
}
NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
style.alignment=NSTextAlignmentCenter;
style.lineSpacing=0.1;
NSMutableDictionary *attr = [NSMutableDictionary dictionaryWithObject:style forKey:NSParagraphStyleAttributeName];
[attr setValue:color forKey:NSForegroundColorAttributeName];
[attr setValue:[UIFont systemFontOfSize:font] forKey:NSFontAttributeName];//[UIFont fontWithName:@"Zapfino"size:5.0]
[str drawInRect:CGRectMake(point.x - size.width/2.0, point.y - size.height/2.0, size.width, size.height) withAttributes:attr];
}
@end

View File

@@ -0,0 +1,45 @@
//
// GWkObject.h
// GWTestSDK
//
// Created by xiaowen.chen on 16/9/26.
// Copyright © 2016年 xw.com. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
/*
* 阳线:收盘价高于开盘价(红色/空心),阴线:收盘价低于开盘价(黑色/实心)
*/
@interface BSkObject : NSObject
//开盘价
@property(nonatomic,assign)CGFloat opening;
//收盘价
@property(nonatomic,assign)CGFloat closing;
//最高价
@property(nonatomic,assign)CGFloat highest;
//最低价
@property(nonatomic,assign)CGFloat lowest;
#pragma mark - 时间类
@property(nonatomic,assign)NSDate *openingTime; //开盘时间
@property(nonatomic,assign)NSDate *closingTime; //收盘时间
@property(nonatomic,assign)NSDate *kTime; //k线时间差
#pragma mark - 获取方法
/**
获取当前是否为阳线
@return 是否为阳线
*/
//-(Boolean)isYangLine;
//
@end

View File

@@ -0,0 +1,14 @@
//
// GWkObject.m
// GWTestSDK
//
// Created by xiaowen.chen on 16/9/26.
// Copyright © 2016 xw.com. All rights reserved.
//
#import "BSkObject.h"
@implementation BSkObject
@end

View File

@@ -0,0 +1,60 @@
//
// NetListenModel.h
// BaseProject
//
// Created by xiaowen.chen on 16/8/12.
// Copyright © 2016年 xw.com. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface BSNetListenModel : NSObject
@property(nonatomic,assign)BOOL isShow;
+ (instancetype)sharedInstance:(UIWindow *)window;
//初始化实时监听的view
+(void)initRealTimeView:(UIView *)view;
+(void)initRealTimeView;
//隐藏view
+(void)hideView;
//实时打印事件
+(void)GWPrint:(id)object;
+(void)GWPrint:(id)object color:(UIColor *)color;
+(void)GWPrint:(id)object color:(UIColor *)color font:(CGFloat)font;
#pragma mark - 网络类的监听处理
/*
* url:请求的链接
* headDic:请求的头文件
* param:请求的参数
*/
+(void)addHttpReq:(NSString *)url param:(NSDictionary *)param time:(NSString *)time;
+(void)addHttpReq:(NSString *)url header:(NSDictionary *)headDic param:(NSDictionary *)param time:(NSString *)time;
+(void)addHttpRsp:(NSString *)url result:(id)result isSuccess:(Boolean)isSuccess time:(NSString *)time;
+(void)addHttpRsp:(NSString *)url header:(NSDictionary *)headDic result:(id)result isSuccess:(Boolean)isSuccess time:(NSString *)time;
#pragma mark - 操作记录存储
/*
* coding:类型编码
* keyword:关键字,(比如:按钮名)
* describe:描述语,(比如:打开)
* option:操作编码
*/
+(void)addOptionRecord:(int)coding keyword:(NSString *)keyword describe:(NSString *)describe option:(int)option;
#pragma mark - 页面分析
+(void)pushToLogViewWithNavigationController:(UINavigationController *)na;
@end

View File

@@ -0,0 +1,263 @@
//
// NetListenModel.m
// BaseProject
//
// Created by xiaowen.chen on 16/8/12.
// Copyright © 2016 xw.com. All rights reserved.
//
#import "BSNetListenModel.h"
#import "BSRealTimeView.h"
#import "BSRecordModel.h"
#import "BSLogTableViewController.h"
#import "BSNotification.h"
static NSString * const gwTeskSdk_version = @"gwTeskSdk_version";
@interface BSNetListenModel()
@property (nonatomic, strong) UIWindow *window;
@property (nonatomic, strong) BSRealTimeView *timeView;//view
@end
@implementation BSNetListenModel
+ (instancetype)sharedInstance:(UIWindow *)window {
static BSNetListenModel *instance;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
instance = [[self alloc] init];
instance.window = window;
[self instance];
//view;
[BSNotification addHandler:^(NFMessageType type,NSString *key,NSObject *value) {
[instance.timeView setHidden:YES];
instance.isShow = NO;
} withName:@"netlisten_viewhide"];
});
return instance;
}
#pragma mark -
+(void)instance{
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
NSString *result = [userDefaults valueForKey:@"bs_isFirstRunDataBase_gwtestsdk"];
}
static NSMutableDictionary *dataDic;//
+(void)initRealTimeView:(UIView *)view{
UIWindow * window = [UIApplication sharedApplication].keyWindow;
BSNetListenModel *netModel = [BSNetListenModel sharedInstance:window];
if (!netModel.timeView) {
BSRealTimeView *timeView = [[BSRealTimeView alloc] initWithFrame:CGRectMake(20, 300, 200, 160)];
netModel.timeView = timeView;
}else{
if (netModel.timeView.subviews) {
[netModel.timeView removeFromSuperview];//
}
}
[view addSubview:netModel.timeView];
[netModel.timeView setHidden:NO];
}
+(void)initRealTimeView{
UIWindow * window = [UIApplication sharedApplication].keyWindow;
BSNetListenModel *netModel = [BSNetListenModel sharedInstance:window];
if (!netModel.timeView) {
BSRealTimeView *timeView = [[BSRealTimeView alloc] initWithFrame:CGRectMake(20, 300, 200, 160)];
netModel.timeView = timeView;
}else{
if (netModel.timeView.subviews) {
[netModel.timeView removeFromSuperview];//
}
}
[netModel.window addSubview:netModel.timeView];
[netModel.timeView setHidden:NO];
}
+(void)hideView{
[BSNotification pushHandle:nil withName:@"netlisten_viewhide"];
UIWindow * window = [UIApplication sharedApplication].keyWindow;
BSNetListenModel *netModel = [BSNetListenModel sharedInstance:window];
netModel.isShow = NO;
}
#pragma mark -
+(void)addHttpReq:(NSString *)url param:(NSDictionary *)param time:(NSString *)time{
return [self addHttpReq:url header:nil param:param time:time];
}
+(void)addHttpReq:(NSString *)url header:(NSDictionary *)headDic param:(NSDictionary *)param time:(NSString *)time{
if (time == nil) {//
return;
}
NSMutableDictionary *dic;
if (url == nil) {
url = @"---";
}
dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:url,@"url",@"netReq",@"handle",time,@"time", nil];
if (headDic != nil) {
[dic setValue:headDic forKey:@"header"];
}
if (param != nil) {
[dic setValue:param forKey:@"param"];
}
[BSNotification pushHandle:dic withName:@"gwsdk_print"];
}
+(void)addHttpRsp:(NSString *)url result:(id)result isSuccess:(Boolean)isSuccess time:(NSString *)time{
return [self addHttpRsp:url header:nil result:result isSuccess:isSuccess time:time];
}
+(void)addHttpRsp:(NSString *)url header:(NSDictionary *)headDic result:(id)result isSuccess:(Boolean)isSuccess time:(NSString *)time{
if (time == nil) {//
return;
}
NSMutableDictionary *dic;
if (url == nil) {
url = @"---";
}
dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:url,@"url",@"netRsp",@"handle",time,@"time", nil];
if (headDic != nil) {
[dic setValue:headDic forKey:@"header"];
}
if (result != nil) {
[dic setValue:result forKey:@"result"];
}
if (isSuccess) {
[dic setValue:@"1" forKey:@"isSuccess"];
}else{
[dic setValue:@"0" forKey:@"isSuccess"];
}
[BSNotification pushHandle:dic withName:@"gwsdk_print"];
}
//
+(void)GWPrint:(id)object{
return [self GWPrint:object color:nil font:0];
}
+(void)GWPrint:(id)object color:(UIColor *)color{
return [self GWPrint:object color:color font:0];
}
+(void)GWPrint:(id)object color:(UIColor *)color font:(CGFloat)font{
NSMutableDictionary *dic;
//
if ([object isKindOfClass:[NSDictionary class]]||[object isKindOfClass:[NSArray class]]) {
dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"yes",@"isChangeLine",object,@"printData", nil];
}else if([object isKindOfClass:[NSString class]]){
dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"no",@"isChangeLine",object,@"printData", nil];
}else{
dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"yes",@"isChangeLine",@"不支持该打印模式...",@"printData",@"15",@"font",[UIColor redColor],@"color", nil];
}
if (!dic[@"color"] && color != nil) {
[dic setValue:color forKey:@"color"];
}
if (!dic[@"font"] && font != 0) {
[dic setValue:[NSString stringWithFormat:@"%.2f",font] forKey:@"font"];
}
[BSNotification pushHandle:dic withName:@"gwsdk_print"];
}
static NSMutableArray *recordArr;//
#pragma mark -
+(void)addOptionRecord:(int)coding keyword:(NSString *)keyword describe:(NSString *)describe option:(int)option{
BSRecordModel *tempModel = [BSRecordModel recordModelWith:coding keyword:keyword describe:describe option:option];
[self GWPrint:[tempModel description] color:[UIColor orangeColor] font:7];
if (tempModel) {
//
[self writeRecordToCache:tempModel];
}
}
//
+(void)writeRecordToCache:(BSRecordModel *)record{
if (!recordArr) {
recordArr = [NSMutableArray array];
}
[recordArr addObject:record];
}
//
+(NSMutableArray *)getRecordFromCache{
if (!recordArr) {
recordArr = [NSMutableArray array];
}
return recordArr;
}
#pragma mark -
+(void)pushToLogViewWithNavigationController:(UINavigationController *)na{
UIWindow * window = [[UIApplication sharedApplication].windows lastObject];
BSNetListenModel *netModel = [BSNetListenModel sharedInstance:window];
if (netModel.timeView != nil) {
[netModel.timeView cancleINtime];//
}
BSLogTableViewController *gw = [[BSLogTableViewController alloc] init];
[na pushViewController:gw animated:YES];
}
@end

View File

@@ -0,0 +1,18 @@
//
// GWLogNetDetailViewController.h
// GWTestSDK
//
// Created by xiaowen.chen on 16/8/31.
// Copyright © 2016年 xw.com. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BSRecordModel.h"
//网络详情
@interface BSLogNetDetailViewController : UIViewController
@property (nonatomic, strong) BSRecordModel *model;
@end

View File

@@ -0,0 +1,90 @@
//
// GWLogNetDetailViewController.m
// GWTestSDK
//
// Created by xiaowen.chen on 16/8/31.
// Copyright © 2016 xw.com. All rights reserved.
//
#import "BSLogNetDetailViewController.h"
#import "BSSDLayoutUtil.h"
@interface BSLogNetDetailViewController ()
@property (nonatomic, strong) UILabel *urlLabel;
@property (nonatomic, strong) UILabel *reqTimeLable;
@property (nonatomic, strong) UILabel *rspTimeLable;
@property (nonatomic, strong) UITextView *reqLabel;
@property (nonatomic, strong) UITextView *rspLabel;
@end
@implementation BSLogNetDetailViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
//url
_urlLabel = [[UILabel alloc] init];
_urlLabel.numberOfLines = 2;
[self.view addSubview:_urlLabel];
SDLAYOUT_h(_urlLabel, self.view, 20, self.view, -5, self.view, -5, 40);
//
_reqTimeLable = [[UILabel alloc] init];
[self.view addSubview:_reqTimeLable];
SDLAYOUT_h(_reqTimeLable, _urlLabel, 42, self.view, -5, self.view, -5, 22);
//
_rspTimeLable = [[UILabel alloc] init];
[self.view addSubview:_rspTimeLable];
SDLAYOUT_h(_rspTimeLable, _reqTimeLable, 25, self.view, -5, self.view, -5, 22);
//
_reqLabel = [[UITextView alloc] init];
_reqLabel.editable = NO;
_reqLabel.textColor = [UIColor grayColor];
[self.view addSubview:_reqLabel];
SDLAYOUT_h(_reqLabel, _rspTimeLable, 25, self.view, -5, self.view, -5, 150);
//
_rspLabel = [[UITextView alloc] init];
_rspLabel.editable = NO;
[self.view addSubview:_rspLabel];
SDLAYOUT(_rspLabel, _reqLabel, 152, self.view, 5, self.view, -5, self.view,-5);
[self initData];
}
-(void)initData{
_urlLabel.text = _model.keyword;
_reqTimeLable.text = [NSString stringWithFormat:@"请求时间:%@",_model.time];
_rspTimeLable.text = [NSString stringWithFormat:@"响应时间:%@",_model.time2];
_reqLabel.text = [NSString stringWithFormat:@"请求头:%@\n请求参数:%@",_model.describe,_model.result];
_rspLabel.text = [NSString stringWithFormat:@"结果头:%@\n结果:%@",_model.describe2,_model.result2];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end

View File

@@ -0,0 +1,13 @@
//
// LogTableViewController.h
// BaseProject
//
// Created by xiaowen.chen on 16/8/24.
// Copyright © 2016年 xw.com. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface BSLogTableViewController : UIViewController
@end

View File

@@ -0,0 +1,260 @@
//
// LogTableViewController.m
// BaseProject
//
// Created by xiaowen.chen on 16/8/24.
// Copyright © 2016 xw.com. All rights reserved.
//
#import "BSLogTableViewController.h"
#import "BSRecordModel.h"
#import "BSLogNetDetailViewController.h"
#import "Masonry.h"
#import "BSNSStringUtil.h"
#import "BS_UIColor.h"
#import "BSXWDateUtil.h"
@interface BSLogTableViewController ()<UITableViewDelegate,UITableViewDataSource,UIAlertViewDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *arr;
@end
@implementation BSLogTableViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self createMyView];
}
-(void)createMyView{
self.title = @"历史记录30条";
self.view.backgroundColor = [UIColor whiteColor];
_tableView = [[UITableView alloc] init];
[self.view addSubview:_tableView];
_tableView.dataSource = self;
_tableView.delegate = self;
[_tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.view);
make.leading.equalTo(self.view);
make.trailing.equalTo(self.view);
make.bottom.equalTo(self.view);
}];
// NSLog(@"获取数据1");
//
_arr = [NSMutableArray array];
//
UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc] initWithTitle:@"清空" style:UIBarButtonItemStylePlain target:self action:@selector(rightBarButtonItem:) ] ;
[rightBarButton setTintColor:[UIColor blueColor]];
self.navigationItem.rightBarButtonItem = rightBarButton;
}
//txt
-(void)rightBarButtonItem:(UIBarButtonItem *)btnItem{
//
// btnItem.enabled = NO;
// [GWFileOptionModel writeToFile_RecordModel:_arr stringForMatBlock:^NSString *(NSString *forMatString) {
// return @"类型编码:[coding] 链接:[keyword] 请求时间:[time] 返回时间:[time2] 关键字:[keyword] 请求:[result] 结果:[result2] 操作编码:[optionCoding]\n\n ";
// } withCompletion:nil class:[BSRecordModel class]];
#pragma clang diagnostic push
#pragma clang diagnostic ignored"-Wdeprecated-declarations"
//,-Wdeprecated-declarations
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"是否清空历史记录?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
[alert show];
#pragma clang diagnostic pop
}
#pragma mark - alertView
#pragma clang diagnostic push
#pragma clang diagnostic ignored"-Wdeprecated-declarations"
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 1) {
//
self.navigationItem.rightBarButtonItem.enabled = NO;
BSRecordModel *tempModel = [[BSRecordModel alloc] init];
[_arr removeAllObjects];
[_tableView reloadData];
}
}
#pragma clang diagnostic pop
#pragma mark -
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
BSRecordModel *model = _arr[section];
if (model.coding == 200) {
return 1;
}else{
return 1;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *indentifiner = @"gwlog_table_cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:indentifiner];
if(cell == nil)
{
NSLog(@"创建cell1~~");
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:indentifiner] ;
cell.textLabel.numberOfLines = 2;
}
// Cell...
BSRecordModel *model = _arr[indexPath.section];
if (model.coding == 200) {
if (indexPath.row == 0) {
cell.textLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
cell.textLabel.text = model.keyword;
}else if (indexPath.row == 1){
cell.textLabel.lineBreakMode = NSLineBreakByTruncatingTail;
cell.textLabel.text = [BSNSStringUtil clearStr:model.result];
}else{
cell.textLabel.lineBreakMode = NSLineBreakByTruncatingTail;
cell.textLabel.text = [BSNSStringUtil clearStr:model.result2];
}
}else{
cell.textLabel.lineBreakMode = NSLineBreakByTruncatingTail;
cell.textLabel.text = model.result;
}
return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath == 0) {
return 45;
}else{
return 40;
}
}
#pragma mark - tableView
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
//
return _arr.count;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
//
return 30;
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
BSRecordModel *model = _arr[section];
static NSString *identy = @"headhead";
UITableViewHeaderFooterView * hf = [tableView dequeueReusableHeaderFooterViewWithIdentifier:identy];
if (!hf) {
NSLog(@"创建分区头~~");
hf = [[UITableViewHeaderFooterView alloc]initWithReuseIdentifier:identy];
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 40)];
view.backgroundColor = [BS_UIColor stringTOColor:@"#ecffff"];
UILabel *la = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, view.frame.size.width-40, 40)];
[view addSubview:la];
NSString *option = @"未知";
if (model.optionCoding == -1) {
option = @"正在请求";
}else if (model.optionCoding == 0) {
option = @"请求失败";
}else if (model.optionCoding == 1) {
option = @"请求成功";
}
NSMutableAttributedString *att = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"[%@],S:%d,R:%@",model.onlySign,model.coding,option]];
if (model.time2.length > 8 && model.time.length > 8) {
NSTimeInterval time = [BSXWDateUtil TimeDifferenceWithTime1:model.time2 AndTime2:model.time formet:nil];
UIColor *color = [UIColor blackColor];
if (time > 30) {
color = [UIColor redColor];
}else if(time > 15){
color = [UIColor yellowColor];
}
[att appendAttributedString:[BSNSStringUtil getAttributedString:[NSString stringWithFormat:@",T:%.1fS",time] color:color font:14 lineSpa:5]];
}
la.attributedText = att;
la.font = [UIFont systemFontOfSize:10];
UIButton *detailBtn = [UIButton buttonWithType:UIButtonTypeCustom];
detailBtn.tag = section;
[view addSubview:detailBtn];
[detailBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(40);
make.height.mas_equalTo(30);
make.bottom.equalTo(view).offset(-2);
make.trailing.equalTo(view).offset(-8);
}];
[detailBtn setTitle:@"详细" forState:UIControlStateNormal];
[detailBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
[detailBtn addTarget:self action:@selector(onclicBtn:) forControlEvents:UIControlEventTouchUpInside];
[hf addSubview:view];
}
return hf;
}
-(void)onclicBtn:(UIButton *)btn{
BSRecordModel *model = _arr[btn.tag];
BSLogNetDetailViewController *tempView = [[BSLogNetDetailViewController alloc] init];
tempView.model = model;
[self.navigationController pushViewController:tempView animated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end

View File

@@ -0,0 +1,19 @@
//
// BSRealTextView.h
// TextSdk
//
// Created by xiaowen on 2017/9/22.
// Copyright © 2017年 gatawang.com. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "RealViewCellModel.h"
@interface BSRealTextView : UIView
@property (nonatomic,strong)RealViewCellModel *tempModel;
@property(nonatomic,strong)NSString *guid;
@property(nonatomic,strong)NSString *number;
//初始化数据
-(void)initData;
@end

View File

@@ -0,0 +1,154 @@
//
// BSRealTextView.m
// TextSdk
//
// Created by xiaowen on 2017/9/22.
// Copyright © 2017 gatawang.com. All rights reserved.
//
#import "BSRealTextView.h"
#import "BSRecordModel.h"
#import "Masonry.h"
#import "BSSDLayoutUtil.h"
#import "BSNSStringUtil.h"
@interface BSRealTextView()
@property (nonatomic, strong) UITextView *dataLabel;//
@property (nonatomic, strong) NSMutableAttributedString *resultAttiText;
@property (nonatomic, strong) UIButton *option_close;//
@property (nonatomic, strong) UIButton *option_copy;//
@property (nonatomic, strong) UILabel *numbLable;//
@end
@implementation BSRealTextView
-(instancetype)init{
self = [super init];
if (self) {
[self initView];
}
return self;
}
-(void)initView{
_option_close = [UIButton buttonWithType:UIButtonTypeCustom];
[_option_close setTitle:@" x " forState:UIControlStateNormal];
[_option_close addTarget:self action:@selector(onclick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:_option_close];
_option_close.backgroundColor = [UIColor greenColor];
SDLAYOUT_wh2(_option_close, self, 0, self, 0, 40, 30)
_option_copy = [UIButton buttonWithType:UIButtonTypeCustom];
[_option_copy setTitle:@"copy" forState:UIControlStateNormal];
[_option_copy addTarget:self action:@selector(onclickCopy:) forControlEvents:UIControlEventTouchUpInside];
[_option_copy setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[self addSubview:_option_copy];
[_option_copy mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_offset(0);
make.width.mas_offset(40);
make.height.mas_offset(30);
make.trailing.mas_offset(-55);
}];
_numbLable = [[UILabel alloc] init];
[self addSubview:_numbLable];
[_numbLable mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_offset(0);
make.width.mas_offset(50);
make.height.mas_offset(30);
make.leading.mas_offset(10);
}];
_numbLable.textColor = [UIColor blackColor];
_numbLable.textAlignment = NSTextAlignmentCenter;
_dataLabel = [[UITextView alloc] init];
_dataLabel.editable = NO;
[self addSubview:_dataLabel];
[_dataLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_offset(30);
make.leading.mas_offset(4);
make.bottom.mas_offset(-4);
make.trailing.mas_offset(-4);
}];
_dataLabel.backgroundColor = [UIColor whiteColor];
}
#pragma mark -
-(void)onclick:(UIButton *)btn{
if (self.subviews) {
[self removeFromSuperview];
}
}
#pragma mark -
-(void)onclickCopy:(UIButton *)btn{
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
pasteboard.string = _dataLabel.attributedText.string;
[_option_copy setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
}
-(void)initData{
_resultAttiText = [[NSMutableAttributedString alloc] init];
_resultAttiText = [[NSMutableAttributedString alloc] init];
[_resultAttiText appendAttributedString:[self getAttributedString:[NSString stringWithFormat:@"请求时间:%@",self.tempModel.time1]]];
[_resultAttiText appendAttributedString:[self getAttributedString:[NSString stringWithFormat:@"\n响应时间:%@",self.tempModel.time2]]];
[_resultAttiText appendAttributedString:[self getAttributedString:@"\n请求链接:"]];
[_resultAttiText appendAttributedString:[self getAttributedString:self.tempModel.url color:[UIColor blueColor]]];
[_resultAttiText appendAttributedString:[self getAttributedString:@"\n请求header:\n"]];
NSString *headStr = [NSString stringWithFormat:@"%@\n",[BSNSStringUtil getStringFromObj:self.tempModel.header]];
[_resultAttiText appendAttributedString:[self getAttributedString:headStr color:[UIColor grayColor] font:12 lineSpa:3]];
[_resultAttiText appendAttributedString:[self getAttributedString:@"请求参数:\n"]];
NSString *paramStr = [NSString stringWithFormat:@"%@\n",[BSNSStringUtil getStringFromObj:self.tempModel.param]];
[_resultAttiText appendAttributedString:[self getAttributedString:paramStr color:[UIColor redColor] font:12 lineSpa:3]];
[_resultAttiText appendAttributedString:[self getAttributedString:@"返回header:\n"]];
NSString *headStr2 = [NSString stringWithFormat:@"%@\n",[BSNSStringUtil getStringFromObj:self.tempModel.backHeader]];
[_resultAttiText appendAttributedString:[self getAttributedString:headStr2 color:[UIColor grayColor] font:12 lineSpa:3]];
[_resultAttiText appendAttributedString:[self getAttributedString:@"结果:\n"]];
UIColor *color = [UIColor redColor];
NSString *resultStr = [NSString stringWithFormat:@"%@\n",[BSNSStringUtil getStringFromObj:self.tempModel.result]];
[_resultAttiText appendAttributedString:[self getAttributedString:resultStr color:color font:12 lineSpa:3]];
_dataLabel.attributedText = _resultAttiText;
_numbLable.text = _number;
}
-(NSAttributedString *)getAttributedString:(NSString *)str{
return [self getAttributedString:str color:nil font:0 lineSpa:0];
}
-(NSAttributedString *)getAttributedString:(NSString *)str color:(UIColor *)color{
return [self getAttributedString:str color:color font:0 lineSpa:0];
}
//,,
-(NSAttributedString *)getAttributedString:(NSString *)str color:(UIColor *)color font:(CGFloat)font lineSpa:(CGFloat)lineSpac{
return [BSNSStringUtil getAttributedString:str color:color font:font lineSpa:lineSpac];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end

View File

@@ -0,0 +1,20 @@
//
// RealTimeView.h
// BaseProject
//
// Created by xiaowen.chen on 16/8/12.
// Copyright © 2016年 xw.com. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface BSRealTimeView : UIView
//取消实时监听
-(void)cancleINtime;
@end

View File

@@ -0,0 +1,611 @@
//
// RealTimeView.m
// BaseProject
//
// Created by xiaowen.chen on 16/8/12.
// Copyright © 2016 xw.com. All rights reserved.
//
#import "BSRealTimeView.h"
#import "BSSelectView.h"
#import "BSRecordModel.h"
#import "BSDrawLine.h"
#import <AudioToolbox/AudioToolbox.h>
#import "RealViewNetWorkCell_0.h"
#import "BSRealTextView.h"
#import "BSNotification.h"
#import "BS_UIColor.h"
#import "BSSDLayoutUtil.h"
@interface BSRealTimeView()<UIAlertViewDelegate,UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, assign) Boolean isCanMove;
@property (nonatomic, strong) UIView *topView;
@property (nonatomic, strong) UITableView *tableView;
@property(nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic, assign) int model;
@property (nonatomic, assign) CGFloat sc_width;
@property (nonatomic, assign) CGFloat sc_height;
@property (nonatomic, assign) CGRect self_rect;
//@property (nonatomic, strong) UITextView *dataLabel;
//@property (nonatomic, strong) NSMutableAttributedString *resultAttiText;
//'
@property (nonatomic, strong) UIButton *option;
@property (nonatomic, strong) UIButton *option_clear;
@property (nonatomic, strong) BSSelectView *option_intime;
@property (nonatomic, strong) UILabel *opLable;
@property (nonatomic, assign) Boolean isMin;
@end
@implementation BSRealTimeView
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
[self createMyView];
// todo
[BSNotification addHandler:^(NFMessageType type,NSString *key,NSObject *value) {
NSDictionary *handleDic = (NSDictionary *)value;
dispatch_async(dispatch_get_main_queue(), ^{
NSString *stateStr = handleDic[@"handle"];
if (stateStr) {
if ([stateStr isEqualToString:@"netReq"]) {
//-
[self printReq:handleDic[@"url"] header:handleDic[@"header"] param:handleDic[@"param"] time:handleDic[@"time"]];//
}else if([stateStr isEqualToString:@"netRsp"]){
//-
[self printRsp:handleDic[@"url"] header:handleDic[@"header"] result:handleDic[@"result"] isSuccess:handleDic[@"isSuccess"] time:handleDic[@"time"]];
}else{
[self print:@"不支持该打印模式..." isChangeLine:YES colors:[UIColor yellowColor] font:0];
}
return;
}
[self printDictionary:handleDic];
});
} withName:@"gwsdk_print"];
return self;
}
-(void)createMyView{
_isMin = NO;
_model = 0;//
_sc_width = [[UIScreen mainScreen] bounds].size.width;
_sc_height = [[UIScreen mainScreen] bounds].size.height;
// _resultAttiText = [[NSMutableAttributedString alloc] init];
self.clipsToBounds = YES;
self.backgroundColor = [UIColor grayColor];
_option = [UIButton buttonWithType:UIButtonTypeCustom];
[_option setTitle:@" x " forState:UIControlStateNormal];
[_option addTarget:self action:@selector(onclick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:_option];
_option.backgroundColor = [UIColor greenColor];
SDLAYOUT_wh1(_option, self, 0, self, 0, 40, 30)
//
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clickClose:)];
//
tap.numberOfTapsRequired = 2;//
//
[_option addGestureRecognizer:tap];
_dataArr = [NSMutableArray array];
// for (int i = 0; i < 5; i++) {
// RealViewCellModel *modle = [[RealViewCellModel alloc] init];
// [_dataArr addObject:modle];
// }
// _dataLabel = [[UITextView alloc] init];
// _dataLabel.editable = NO;
// [self addSubview:_dataLabel];
// SDLAYOUT(_dataLabel, self, 30, self, 2, self, -2, self, -30)
_tableView = [[UITableView alloc] init];
[self addSubview:_tableView];
_tableView.dataSource = self;
_tableView.delegate = self;
[_tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_offset(30);
make.leading.mas_offset(1);
make.bottom.mas_offset(-30);
make.trailing.mas_offset(-1);
}];
self.tableView.separatorStyle = NO;
self.tableView.backgroundColor = [BS_UIColor stringTOColor:@"#f4f4f4"];
_opLable = [[UILabel alloc] init];
_opLable.text = @"";
[self addSubview:_opLable];
SDLAYOUT_wh1(_opLable, _option, 5, self, 5, 50, 20)
_option_intime = [[BSSelectView alloc]init];
_option_intime.button.tag = 1001;
_option_intime.label.textColor = [UIColor whiteColor];
[self addSubview:_option_intime];
[_option_intime setTitle:@"实时" detail:@"" sender:self selector:@selector(buttonDidSelect:)];
[_option_intime.button setSelected:YES];
SDLAYOUT_wh1(_option_intime, _option, 55, self, 10, 50, 20)
_option_clear = [UIButton buttonWithType:UIButtonTypeCustom];
[_option_clear setTitle:@"清空" forState:UIControlStateNormal];
[_option_clear addTarget:self action:@selector(onclick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:_option_clear];
SDLAYOUT_wh3(_option_clear, self, 5, self, -5, 50, 20)
//view
[self bringSubviewToFront:_option];
}
#pragma mark -
-(void)print:(NSString *)str isChangeLine:(Boolean)isChange colors:(UIColor*)color font:(CGFloat)font{
if (![self isNeedToPrintWithType:@"print"]) {
return;
}
if (isChange) {
str = [NSString stringWithFormat:@"%@\n",str];
}
if (font == 0) {
font = 15;
}
if (color == nil) {
color = [UIColor blackColor];
}
NSLog(@"暂无实现");
// [_resultAttiText appendAttributedString:[self getAttributedString:str color:color font:font lineSpa:8]];
// [self printToLable:[_resultAttiText copy]];
}
#pragma mark -
-(void)printReq:(NSString *)url header:(NSDictionary *)headDic param:(NSDictionary *)param time:(NSString *)time{
if (![self isNeedToPrintWithType:@"req"]) {
return;
}
if (!url) {
url = @"---";
}
RealViewCellModel *modle = [[RealViewCellModel alloc] init];
modle.UI_centerStr = @"请求...";
modle.guid = time;
modle.header = headDic;
modle.time1 = time;
modle.param = param;
modle.UI_rightStr = url;
[_dataArr addObject:modle];
[_tableView reloadData];
}
-(void)printRsp:(NSString *)url header:(NSDictionary *)headDic result:(id)result isSuccess:(NSString *)isSuccess time:(NSString *)time{
// if (![self isNeedToPrintWithType:@"rsp"]) {
// return;
// }
for (RealViewCellModel *tempModel in _dataArr) {
if ([tempModel.UI_rightStr isEqualToString:url]) {
tempModel.result = result;
tempModel.url = url;
tempModel.backHeader = headDic;
tempModel.time2 = time;
tempModel.isSuccess = [isSuccess isEqualToString:@"1"];
tempModel.UI_centerStr = isSuccess;
[_tableView reloadData];
break;
}
}
}
//
-(Boolean)isNeedToPrintWithType:(NSString *)type{
if (!_option_intime.button.isSelected) {
return NO;
}
//print,req,rsp//
return YES;
}
#pragma mark -
-(void)cancleINtime{
[_option_intime.button setSelected:NO];
}
#pragma mark -
+(void)printRsp:(NSString *)url header:(NSDictionary *)headDic result:(NSDictionary *)result{
}
-(void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
if (!_isCanMove) {
return;
}
if (_model == 0 || _model == 1) {
}
}
#pragma mark -
-(void)printDictionary:(NSDictionary *)dic{
if ([dic isKindOfClass:[NSDictionary class]]) {
id object = dic[@"printData"];
Boolean isChange = [dic[@"isChangeLine"] isEqualToString:@"yes"] ? YES : NO;
CGFloat font = 0;
UIColor *color = nil;
if (!dic[@"font"]) {
font = [dic[@"font"] floatValue];
}
if ([dic[@"color"] isKindOfClass:[UIColor class]]) {
color = dic[@"color"];
}
if (object) {
if ([object isKindOfClass:[NSDictionary class]]) {
NSString *tempStr = [NSString stringWithFormat:@"%@",object];
[self print:tempStr isChangeLine:isChange colors:color font:font];
}else if([object isKindOfClass:[NSString class]]){
[self print:object isChangeLine:isChange colors:color font:font];
}else if([object isKindOfClass:[NSArray class]]){
NSString *tempStr = [NSString stringWithFormat:@"%@",object];
[self print:tempStr isChangeLine:isChange colors:color font:font];
}
}
}
}
#pragma mark -
-(void)buttonDidSelect:(UIButton *)btn{
if(btn.tag == 1001){
if (_option_intime.button.selected) {
[_option_intime.button setSelected:NO];
}else{
[_option_intime.button setSelected:YES];
}
}
}
//
-(void)onclick:(UIButton *)btn{
if (btn == _option_clear) {
// _resultAttiText = [[NSMutableAttributedString alloc] init];
// _dataLabel.attributedText = [_resultAttiText copy];
[_dataArr removeAllObjects];
[_tableView reloadData];
return;
}
if (_isMin) {
_isMin = NO;
[self onclick_min_end:btn];
}else{
_isMin = YES;
[self onclick_min:btn];
}
}
//
-(void)clickClose:(UITapGestureRecognizer *)tap{
[BSNotification pushHandle:nil withName:@"netlisten_viewhide"];
[[NSNotificationCenter defaultCenter]postNotificationName:@"netlisten_viewhide1" object:nil userInfo:nil];
//退
[_option_intime.button setSelected:NO];
}
-(void)onclick_min:(UIButton *)btn{
_self_rect = self.frame;//
[_option_clear setHidden:YES];
CGRect endRect = CGRectMake(_self_rect.origin.x, _self_rect.origin.y, _option.frame.size.width, _option.frame.size.height);
[UIView animateWithDuration:0.2 animations:^{
self.frame = endRect;
} completion:^(BOOL finished) {
self.frame = endRect;
[_option_clear setHidden:NO];
}];
}
-(void)onclick_min_end:(UIButton *)btn{
[UIView animateWithDuration:0.2 animations:^{
self.frame = _self_rect;
} completion:^(BOOL finished) {
self.frame = _self_rect;
}];
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored"-Wdeprecated-declarations"
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 1) {
[BSNotification pushHandle:nil withName:@"netlisten_viewhide"];
[[NSNotificationCenter defaultCenter]postNotificationName:@"netlisten_viewhide1" object:nil userInfo:nil];
//退
[_option_intime.button setSelected:NO];
}
}
#pragma clang diagnostic pop
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
CGPoint currentP = [touch locationInView:self];
// NSLog(@"当前点击的位置:(%.2f,%.2f)",currentP.x,currentP.y);
if (currentP.x > self.frame.size.width - 40 && currentP.y > self.frame.size.height - 40) {
_model = 1;
// NSLog(@"进入缩放状态");
}else{
_model = 0;
// NSLog(@"进入移动状态");
}
}
//(2)
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
// if (!_isCanMove) {
// return;
// }
if (_model == 0) {
// NSLog(@"改变位置");
//
self.userInteractionEnabled = NO;
UITouch *touch = [touches anyObject];
//point
CGPoint currentP = [touch locationInView:self];
//point
CGPoint preP = [touch previousLocationInView:self];
//x
CGFloat offsetX = currentP.x - preP.x;
//Y
CGFloat offsetY = currentP.y - preP.y;
self.transform = CGAffineTransformTranslate(self.transform, offsetX, offsetY);
self.userInteractionEnabled = YES;
}else if(_model == 1){
//
// if ([_option_max.titleLabel.text isEqualToString:@"还原"]) {
// return;
// }
//
self.userInteractionEnabled = NO;
UITouch *touch = [touches anyObject];
//point
CGPoint currentP = [touch locationInView:self];
//point
CGPoint preP = [touch previousLocationInView:self];
//x
CGFloat offsetX = currentP.x - preP.x;
//Y
CGFloat offsetY = currentP.y - preP.y;
//
CGFloat tempWidth = self.frame.size.width + offsetX;
CGFloat tempHeight = self.frame.size.height +offsetY;
if (tempWidth < 165 || tempWidth > KScreenWidth || tempHeight < 150 || tempHeight > _sc_height) {
self.userInteractionEnabled = YES;
return;
}
self.frame = CGRectMake(self.frame.origin.x,self.frame.origin.y,self.frame.size.width + offsetX, self.frame.size.height +offsetY);
self.userInteractionEnabled = YES;
}
}
-(void)dealloc{
[BSNotification removeHandler:@"gwsdk_print"];
}
#pragma mark - tableView
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return _dataArr.count;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
RealViewCellModel *tempModel = _dataArr[indexPath.row];
if (tempModel.type == 0) {
return tempModel.rightCellHeight;
}
return 190;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
RealViewCellModel *tempModel = _dataArr[indexPath.row];
tempModel.UI_leftStr = [NSString stringWithFormat:@"%d",(int)indexPath.row];
if (tempModel.type == 0) {
static NSString *identifier = @"RealViewNetWorkCell_0";
RealViewNetWorkCell_0 *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if (!cell)
{
cell = [[RealViewNetWorkCell_0 alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
}
cell.model = tempModel;
return cell;
}
return nil;
}
-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{
return YES;
}
- (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
@kWeakify(self)
UITableViewRowAction * deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"置頂" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
@kStrongify(self)
[ self.dataArr removeObjectAtIndex:indexPath.row];
[self.tableView reloadData];
}];
deleteAction.title = @"刪除";
deleteAction.backgroundColor = [UIColor redColor];
return @[deleteAction];
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
RealViewCellModel *tempModel = _dataArr[indexPath.row];
if (tempModel.type == 0) {
BSRealTextView *textView = [[BSRealTextView alloc] init];
textView.tempModel = tempModel;
textView.guid = tempModel.guid;
textView.number = tempModel.UI_leftStr;
[textView initData];
[self addSubview:textView];
[textView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_offset(30);
make.leading.mas_offset(0);
make.bottom.mas_offset(-30);
make.trailing.mas_offset(0);
}];
textView.backgroundColor = [BS_UIColor stringTOColor:@"#f4f4f4"];
}
}
#pragma mark -
-(void)drawRect:(CGRect)rect{
[super drawRect:rect];
if (_isCanMove) {
NSString *point1 = [NSString stringWithFormat:@"%.2f,%.2f",self.frame.size.width - 15,self.frame.size.height];
NSString *point2 = [NSString stringWithFormat:@"%.2f,%.2f",self.frame.size.width ,self.frame.size.height - 15];
NSString *point3 = [NSString stringWithFormat:@"%.2f,%.2f",self.frame.size.width - 10,self.frame.size.height];
NSString *point4 = [NSString stringWithFormat:@"%.2f,%.2f",self.frame.size.width ,self.frame.size.height - 10];
NSString *point5 = [NSString stringWithFormat:@"%.2f,%.2f",self.frame.size.width - 5,self.frame.size.height];
NSString *point6 = [NSString stringWithFormat:@"%.2f,%.2f",self.frame.size.width ,self.frame.size.height - 5];
//线
[BSDrawLine drawLinePoint:@[@[@"1",@"255",@"255",@"255",@"1"],@[point1,point2],@[point3,point4],@[point5,point6]] withContext:UIGraphicsGetCurrentContext() scan:1];
}
}
@end

View File

@@ -0,0 +1,45 @@
//
// RealViewCellModel.h
// TextSdk
//
// Created by xiaowen on 2017/9/22.
// Copyright © 2017年 gatawang.com. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface RealViewCellModel : NSObject
@property (nonatomic,assign) BOOL isSuccess;
@property (nonatomic,copy) id result;
@property (nonatomic,copy) NSString *url;
@property (nonatomic,copy) NSDictionary * header;
@property (nonatomic,copy) NSDictionary * backHeader;
@property (nonatomic,copy) NSDictionary * param;
@property (nonatomic,copy) NSString *time1;
@property (nonatomic,copy) NSString *time2;
@property(nonatomic,assign)int type;//0
@property(nonatomic,strong)NSString *guid;
@property(nonatomic,strong)NSString *UI_leftStr;
@property(nonatomic,assign)CGFloat leftFont;
@property(nonatomic,strong)UIColor *leftColor;
@property(nonatomic,strong)NSString *UI_centerStr;
@property(nonatomic,assign)CGFloat centerFont;
@property(nonatomic,strong)UIColor *centerColor;
@property(nonatomic,strong)NSString *UI_rightStr;
@property(nonatomic,assign)CGFloat rightFont;
@property(nonatomic,strong)UIColor *rightColor;
@property(nonatomic,assign)CGFloat rightCellHeight;//实际的高度
@end

View File

@@ -0,0 +1,13 @@
//
// RealViewCellModel.m
// TextSdk
//
// Created by xiaowen on 2017/9/22.
// Copyright © 2017 gatawang.com. All rights reserved.
//
#import "RealViewCellModel.h"
@implementation RealViewCellModel
@end

View File

@@ -0,0 +1,21 @@
//
// RealViewNetWorkCell_0.h
// TextSdk
//
// Created by xiaowen on 2017/9/22.
// Copyright © 2017年 gatawang.com. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "RealViewCellModel.h"
@interface RealViewNetWorkCell_0 : UITableViewCell
@property(nonatomic,strong)RealViewCellModel *model;
@property(nonatomic,strong)UILabel *leftLable;
@property(nonatomic,strong)UILabel *centerLable;
@property(nonatomic,strong)UILabel *rightLable;
@end

View File

@@ -0,0 +1,154 @@
//
// RealViewNetWorkCell_0.m
// TextSdk
//
// Created by xiaowen on 2017/9/22.
// Copyright © 2017 gatawang.com. All rights reserved.
//
#import "RealViewNetWorkCell_0.h"
#import "Masonry.h"
#import "BS_UIColor.h"
@implementation RealViewNetWorkCell_0
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.contentView.userInteractionEnabled = YES;
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self initUI];
}
return self;
}
-(void)initUI{
_rightLable = [[UILabel alloc] init];
[self addSubview:_rightLable];
[_rightLable mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self);
make.leading.mas_offset(35);
make.trailing.mas_offset(-10);
make.height.mas_offset(35);
}];
_rightLable.textAlignment = NSTextAlignmentRight;
_rightLable.text = @"openapi/jfidnfdinfdnfd/fdinfidfndf/nfidjfidjfdijf";
_rightLable.lineBreakMode = NSLineBreakByTruncatingHead;
_leftLable = [[UILabel alloc] init];
[self addSubview:_leftLable];
[_leftLable mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.contentView);
make.leading.mas_offset(5);
make.width.mas_offset(20);
make.height.mas_offset(20);
}];
_leftLable.textAlignment = NSTextAlignmentCenter;
_leftLable.layer.cornerRadius = 10;
_leftLable.layer.masksToBounds = YES;
_leftLable.layer.borderWidth = 0.5;
_leftLable.backgroundColor = [UIColor redColor];
// _leftLable.text = @"100";
_centerLable = [[UILabel alloc] init];
[self addSubview:_centerLable];
[_centerLable mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(_rightLable);
make.leading.equalTo(_leftLable.mas_trailing).mas_offset(5);
make.width.mas_offset(0);
make.height.mas_offset(35);
}];
_centerLable.textAlignment = NSTextAlignmentCenter;
// _centerLable.text = @"请求...";
}
-(void)setModel:(RealViewCellModel *)model{
_model = model;
_leftLable.text = model.UI_leftStr;
if (model.leftFont != 0) {
_leftLable.font = [UIFont systemFontOfSize:model.leftFont] ;
}else{
_leftLable.font = [UIFont systemFontOfSize:12];
}
if (model.leftColor != nil) {
_leftLable.textColor = model.leftColor;
_leftLable.layer.borderColor = model.leftColor.CGColor;
}else{
_leftLable.textColor = [BS_UIColor stringTOColor:@"#181818"];
_leftLable.layer.borderColor = [BS_UIColor stringTOColor:@"#181818"].CGColor;
}
// _centerLable.text = model.UI_centerStr;
// //
// if (model.centerFont != 0) {
// _centerLable.font = AUTOADAPFont(model.centerFont];
// }else{
// _centerLable.font = AUTOADAPFont(12];
// }
// if (model.centerColor != nil) {
// _centerLable.textColor = model.centerColor;
// }else{
// _centerLable.textColor = [BS_UIColor stringTOColor:@"#181818"];
// }
//
if ([model.UI_rightStr isKindOfClass:[NSNull class]]) {
model.UI_rightStr = @"";
}
_rightLable.text = model.UI_rightStr;
if (model.rightFont != 0) {
_rightLable.font = [UIFont systemFontOfSize:model.rightFont] ;
}else{
_rightLable.font = [UIFont systemFontOfSize:12];
}
if (model.leftColor != nil) {
_rightLable.textColor = model.rightColor;
}else{
_rightLable.textColor = [BS_UIColor stringTOColor:@"#676767"];
}
if ([model.UI_centerStr isEqualToString:@"0"]) {
UIColor *redCor = [BS_UIColor stringTOColor:@"#ff2d2d"];;
_rightLable.textColor = redCor;
_leftLable.textColor = redCor;
_leftLable.layer.borderColor = redCor.CGColor;
}
model.rightCellHeight = 40;
UIView *view = [[UIView alloc] init];
[self.contentView addSubview:view];
[view mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_offset(-1);
make.leading.mas_offset(5);
make.trailing.mas_offset(-5);
make.height.mas_offset(0.5);
}];
view.backgroundColor = [BS_UIColor stringTOColor:@"#f0f0f0"];
}
- (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

View File

@@ -0,0 +1,29 @@
//
// SelectView.h
// lianxi
//
// Created by 陈奕智 on 16/7/7.
// Copyright © 2016年 chenyizhi. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface BSSelectView : UIView
/**
* 按钮
*/
@property (nonatomic, strong) UIButton *button;
/**
* 标签
*/
@property (nonatomic, strong) UILabel *label;
/**
* titledetail 显示文字
* senderselector 按钮添加点击方法参数
*/
-(void)setTitle:(NSString*)title detail:(NSString*)detail sender:(id)sender selector:(SEL)selector;
@end

View File

@@ -0,0 +1,71 @@
//
// SelectView.m
// lianxi
//
// Created by on 16/7/7.
// Copyright © 2016 chenyizhi. All rights reserved.
//
#import "BSSelectView.h"
#import "Masonry.h"
static int const FONTSIZE = 14;
@implementation BSSelectView
-(instancetype)init{
self = [super init];
if (self) {
self.button = [[UIButton alloc]init];
[self addSubview:self.button];
[self.button setImage:[UIImage imageNamed:@"pay_off"] forState:UIControlStateNormal];
[self.button setImage:[UIImage imageNamed:@"pay_on"] forState:UIControlStateSelected];
[self.button mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.equalTo(self).offset(0);
make.top.equalTo(self).offset(0);
make.width.mas_equalTo(12);
make.height.mas_equalTo(12);
}];
self.label = [[UILabel alloc]init];
[self addSubview:self.label];
[self.label mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.equalTo(self).offset(12);
make.bottom.equalTo(self).offset(-4);
make.width.mas_equalTo(40);
}];
}
return self;
}
-(void)setTitle:(NSString *)title detail:(NSString *)detail sender:(id)sender selector:(SEL)selector {
NSInteger len1 = title.length;
NSInteger len2 = detail.length;
NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%@", title, detail]];
[attStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:FONTSIZE weight:UIFontWeightBold] range:NSMakeRange(0, len1)];
[attStr addAttribute:NSFontAttributeName value:[UIFont italicSystemFontOfSize:FONTSIZE-2] range:NSMakeRange(len1, len2)];
[attStr addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, len1)];
[attStr addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(len1, len2)];
self.label.attributedText = attStr;
[self.button addTarget:sender action:selector forControlEvents:UIControlEventTouchUpInside];
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[self.button sendActionsForControlEvents:UIControlEventTouchUpInside];
}
@end

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 931 B

View File

@@ -0,0 +1,50 @@
//
// BSRecordModel.h
// GWTestSDK
//
// Created by xiaowen.chen on 16/8/18.
// Copyright © 2016年 xw.com. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BSRecordModel : NSObject
//类型编码
@property (nonatomic, assign) int coding;
//关键字
@property (nonatomic, strong) NSString *keyword;
//描述
@property (nonatomic, strong) NSString *describe;
//描述2
@property (nonatomic, strong) NSString *describe2;
//操作编码
@property (nonatomic, assign) int optionCoding;
//唯一标示
@property (nonatomic, strong) NSString *onlySign;
//时间
@property (nonatomic, strong) NSString *time;
//详细时间
@property (nonatomic, strong) NSString *time2;
//结果
@property (nonatomic, strong) NSString *result;
//结果2
@property (nonatomic, strong) NSString *result2;
+(BSRecordModel *)recordModelWith:(int)coding keyword:(NSString *)keyword describe:(NSString *)describe option:(int)option;
+(NSString *)getStringWithDate:(NSDate *)date format:(NSString *)format;
@end

View File

@@ -0,0 +1,89 @@
//
// RecordModel.m
// GWTestSDK
//
// Created by xiaowen.chen on 16/8/18.
// Copyright © 2016 xw.com. All rights reserved.
//
#import "BSRecordModel.h"
@implementation BSRecordModel
//
-(NSDictionary *)getAttribute{
return @{
@"coding":@"INTEGER",
@"keyword":@"TEXT",
@"describe":@"TEXT",
@"describe2":@"TEXT",
@"optionCoding":@"INTEGER",
@"time":@"DATETIME",
@"time2":@"DATETIME",
@"onlySign":@"TEXT",
@"result":@"TEXT",
@"result2":@"TEXT"
};
}
+(BSRecordModel *)recordModelWith:(int)coding keyword:(NSString *)keyword describe:(NSString *)describe option:(int)option{
if([keyword rangeOfString:@","].location !=NSNotFound)
{
keyword = @"不合法的keyword";
}
if([describe rangeOfString:@","].location !=NSNotFound)
{
describe = @"不合法的describe";
}
BSRecordModel *recordModel = [[BSRecordModel alloc] init];
recordModel.coding = coding;
recordModel.keyword = keyword;
recordModel.describe = describe;
recordModel.optionCoding = option;
recordModel.time = [self getStringWithDate:nil format:nil];
return recordModel;
}
+(NSString *)getStringWithDate:(NSDate *)date format:(NSString *)format
{
if (date == nil) {
date = [NSDate date];
}
if (format == nil) {
format = @"yyyyMMdd HH:mm:ss.SSS";
}
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
[formatter setDateFormat:format];
return [formatter stringFromDate:date];
}
-(NSString *)description{
return [NSString stringWithFormat:@"%d,[%@],%@,%@,%d\n",_coding,[_time substringWithRange:NSMakeRange(9, 8)],_keyword,_describe,_optionCoding];
}
-(id)copy{
BSRecordModel *resultId = [[BSRecordModel alloc] init];
resultId.coding = _coding;
resultId.keyword = _keyword;
resultId.describe = _describe;
resultId.describe2 = _describe2;
resultId.optionCoding = _optionCoding;
resultId.onlySign = _onlySign;
resultId.time = _time;
resultId.time2 = _time2;
resultId.result = _result;
resultId.result2 = _result2;
return resultId;
}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
}
@end

View File

@@ -0,0 +1,132 @@
//
// XWNotification.h
// BaseProject
//
// Created by xiaowen.chen on 16/7/19.
// Copyright © 2016年 xw.com. All rights reserved.
//
#import <Foundation/Foundation.h>
enum{
//简单的消息
NFMessageType_Simple,
//api消息
NFMessageType_API,
//主题消息
NFMessageType_Theme,
//自定义消息
NFMessageType_Custom
}typedef NFMessageType;
typedef void(^GWHandleOption)(NFMessageType type,NSString *key,NSObject *value);
typedef NSDictionary *(^GWSingleHandleOption)(NSDictionary *handleDic);
@interface BSNotification : NSObject
/**
添加处理方法,在viewdeload或者viewwillAppear里面添加,object对象的地址h加key确定唯一性
@param block 回调方法块
@param handleName 处理标识名
@param object 对象实例
*/
+(void)addHandler:(GWHandleOption)block withName:(NSString *)handleName andObject:(NSObject *)object;
/**
移除处理方法,在dealloc或者viewwillDisAppear里面移除,object对象的地址加key确定唯一性
@param handleName 处理标识名
@param object 对象实例
*/
+(void)removeHandler:(NSString *)handleName andObject:(NSObject *)object;
/**
添加处理方法,在viewdeload或者viewwillAppear里面添加,添加重复的name无效
@param block 回调方法块
@param handleName 处理标识名
*/
+(void)addHandler:(GWHandleOption)block withName:(NSString *)handleName;
/**
移除处理方法,在dealloc或者viewwillDisAppear里面移除
@param name 处理标识名
*/
+(void)removeHandler:(NSString *)name;
/**
推送消息-简化版本
@param handleDic 参数字典
@param handleName 处理标识名
*/
+(void)pushHandle:(NSDictionary *)handleDic withName:(NSString *)handleName;
/**
推送消息-简化版本
@param type 消息类型
@param key key
@param value 结果对象
@param handleName 处理标识名
*/
+(void)pushHandle:(NFMessageType)type withKey:(NSString *)key value:(NSObject *)value withName:(NSString *)handleName;
/**
获取所有的注册信息,调试的时候用
@return 处理标识名数组
*/
+(NSMutableDictionary *)getHandleDic;
#pragma mark - 有返回值的做法,可以用在一个页面向另外一个页面取值,要求是1对1,不然会出异常
/**
添加一个唯一的处理方法
@param block 回调方法块
@param handleName 处理标识名
*/
+(void)addSingleHandler:(GWSingleHandleOption)block withName:(NSString *)handleName;
/**
触发唯一的处理方法,并且从唯一的处理方法中获取结果
@param handleDic 参数字典
@param handleName 处理标识名
@return 结果字典
*/
+(NSDictionary *)getResultFromSingleHandle:(NSDictionary *)handleDic withName:(NSString *)handleName;
#pragma mark - 批量移除的方法
/**
移除所有
*/
+(void)removeAllHandle;
/**
移除所有不是指定字符串开头的
@param str 指定字符串
*/
+(void)removeHandleNotInclude:(NSString *)str;
/**
移除所有指定字符串开头的
@param str 指定字符串
*/
+(void)removeHandleInclude:(NSString *)str;
@end

View File

@@ -0,0 +1,193 @@
//
// XWNotification.m
// BaseProject
//
// Created by xiaowen.chen on 16/7/19.
// Copyright © 2016 xw.com. All rights reserved.
//
#import "BSNotification.h"
@implementation BSNotification
static NSMutableDictionary *bs_handlerDic = nil;
static NSObject *bs_lock_obj = nil;
static NSString *objectSplit = @"_obj_";
#pragma mark - (keyobject)
+(void)addHandler:(GWHandleOption)block withName:(NSString *)handleName andObject:(NSObject *)object{
handleName = [NSString stringWithFormat:@"%@%@%p",handleName,objectSplit,object];
[self addHandler:block withName:handleName];
}
#pragma mark - (keyobject)
+(void)removeHandler:(NSString *)handleName andObject:(NSObject *)object{
handleName = [NSString stringWithFormat:@"%@%@%p",handleName,objectSplit,object];
[self removeHandler: handleName];
}
#pragma mark -
+(void)addHandler:(GWHandleOption)block withName:(NSString *)handleName{
[self checkClass];
@synchronized (bs_lock_obj) {
Boolean ishave = NO;
for (NSString *tempStr in [bs_handlerDic allKeys]) {
if ([tempStr isEqualToString:handleName]) {
ishave = YES;
break;
}
}
if (ishave) {
[bs_handlerDic removeObjectForKey:handleName];
}
[bs_handlerDic setObject:block forKey:handleName];
}
}
#pragma mark -
+(void)removeHandler:(NSString *)name{
[self checkClass];
@synchronized (bs_lock_obj) {
for (NSString *key in [bs_handlerDic allKeys]) {
if ([key isEqualToString:name]) {
[bs_handlerDic removeObjectForKey:key];
}
}
}
}
#pragma mark - -
+(void)pushHandle:(NSDictionary *)handleDic withName:(NSString *)handleName{
return [self pushHandle:NFMessageType_Simple withKey:@"BSdefaultKey" value:handleDic withName:handleName];
}
#pragma mark -
+(void)pushHandle:(NFMessageType)type withKey:(NSString *)key value:(NSObject *)value withName:(NSString *)handleName{
[self checkClass];
@synchronized (bs_lock_obj) {
for (NSString *temp in [bs_handlerDic allKeys]) {
if ([temp hasPrefix:handleName]) {
GWHandleOption option = (GWHandleOption)[bs_handlerDic objectForKey:temp];
if (option) {
option(type,key,value);
}
}
}
}
}
+(NSMutableDictionary *)getHandleDic{
return bs_handlerDic;
}
#pragma mark - ,,11,
/*
*
*/
+(void)addSingleHandler:(GWSingleHandleOption)block withName:(NSString *)handleName{
[self checkClass];
@synchronized (bs_lock_obj) {
Boolean ishave = NO;
for (NSString *tempStr in [bs_handlerDic allKeys]) {
if ([tempStr isEqualToString:handleName]) {
ishave = YES;
break;
}
}
if (ishave) {
[bs_handlerDic removeObjectForKey:handleName];
}
[bs_handlerDic setObject:block forKey:handleName];
}
}
/*
* ,
*/
+(NSDictionary *)getResultFromSingleHandle:(NSDictionary *)handleDic withName:(NSString *)handleName{
[self checkClass];
@synchronized (bs_lock_obj) {
for (NSString *temp in [bs_handlerDic allKeys]) {
if ([temp isEqualToString:handleName]) {
GWSingleHandleOption option = (GWSingleHandleOption)[bs_handlerDic objectForKey:temp];
if (option) {
return option(handleDic);
}
}
}
}
return nil;
}
#pragma mark -
/*
*
*/
+(void)removeAllHandle{
[self checkClass];
@synchronized (bs_lock_obj) {
[bs_handlerDic removeAllObjects];
}
}
/*
*
*/
+(void)removeHandleNotInclude:(NSString *)str{
[self checkClass];
@synchronized (bs_lock_obj) {
NSMutableArray *resultArr = [NSMutableArray array];
for (NSString *temp in [bs_handlerDic allKeys]) {
if ([temp hasPrefix:str]) {
[resultArr addObject:temp];
}
}
for(NSString *temp in resultArr){
[bs_handlerDic removeObjectForKey:temp];
}
}
}
/*
*
*/
+(void)removeHandleInclude:(NSString *)str{
[self checkClass];
@synchronized (bs_lock_obj) {
NSMutableArray *resultArr = [NSMutableArray array];
for (NSString *temp in [bs_handlerDic allKeys]) {
if (![temp hasPrefix:str]) {
[resultArr addObject:temp];
}
}
for(NSString *temp in resultArr){
[bs_handlerDic removeObjectForKey:temp];
}
}
}
+(void)checkClass{
if (bs_lock_obj == nil) {
bs_lock_obj = [[NSObject alloc] init];
}
if (bs_handlerDic == nil) {
bs_handlerDic = [NSMutableDictionary dictionary];
}
}
@end