Skip to content

Commit

Permalink
优化一些代码
Browse files Browse the repository at this point in the history
  • Loading branch information
crazypoo committed Sep 2, 2024
1 parent 8610c1f commit 783b257
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 242 deletions.
2 changes: 1 addition & 1 deletion PooTools.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'PooTools'
s.version = '3.58.45'
s.version = '3.58.46'
s.author = { 'crazypoo' => '273277355@qq.com' }
s.homepage = 'http://crazypoo.github.io/PTools/'
s.summary = '多年来积累的轮子'
Expand Down
2 changes: 1 addition & 1 deletion PooToolsSource/AESAndDES/PTDataEncryption.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class PTDataEncryption {

private static func performDESCrypt(operation: CCOperation, key: String, dataString: String) throws -> String {
guard let keyData = key.data(using: .utf8),
var cryptData = operation == kCCEncrypt ? dataString.data(using: .utf8) : Data(base64Encoded: dataString)
let cryptData = operation == kCCEncrypt ? dataString.data(using: .utf8) : Data(base64Encoded: dataString)
else {
throw createError("Invalid key or data")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ public class PTActionSheetController: PTAlertController {
let currentContentHeight = contentItemsCount * sheetConfig.rowHeight + (contentItemsCount - 1) * sheetConfig.lineHeight

// 計算是否可以滾動
var realContentSize = min(currentContentHeight, contentItemsMaxHeight)
let realContentSize = min(currentContentHeight, contentItemsMaxHeight)
let contentItemCanScroll = currentContentHeight > contentItemsMaxHeight

// 計算總高度
Expand Down
2 changes: 1 addition & 1 deletion PooToolsSource/Base/PTCollectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ public class PTCollectionView: UIView {
group = UICollectionView.tagShowLayout(data: tagDatas as! [PTTagLayoutModel],screenWidth: self.frame.width,itemOriginalX: viewConfig.itemOriginalX,itemHeight: viewConfig.itemHeight,topContentSpace: viewConfig.contentTopSpace,bottomContentSpace: viewConfig.contentBottomSpace,itemLeadingSpace: viewConfig.cellLeadingSpace,itemTrailingSpace: viewConfig.cellTrailingSpace,itemContentSpace: viewConfig.tagCellContentSpace)
} else {
group = NSCollectionLayoutGroup.init(layoutSize: NSCollectionLayoutSize(widthDimension: .absolute(1), heightDimension: .absolute(1)))
fatalError("如果是Tag,則datamode必須是PTTagLayoutModel")
fatalError("如果是Tag,則datamodel必須是PTTagLayoutModel")
}
case .Custom:
group = customerLayout!(section, sectionModel)
Expand Down
337 changes: 114 additions & 223 deletions PooToolsSource/Base/PTFusionCell.swift

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions PooToolsSource/Base/PTUnavailableFunction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ import SnapKit

@objcMembers
open class PTEmptyDataViewConfig : NSObject {
public var mainTitleAtt:ASAttributedString?
public var secondaryEmptyAtt:ASAttributedString?
public var buttonTitle:String = ""
public var buttonFont:UIFont = .appfont(size: 18)
public var buttonTextColor:UIColor = .systemBlue
public var image:UIImage? = UIImage(.exclamationmark.triangle)
public var backgroundColor:UIColor = .clear
public var imageToTextPadding:CGFloat = 10
public var textToSecondaryTextPadding:CGFloat = 5
public var buttonToSecondaryButtonPadding:CGFloat = 15
public var verticalOffSet:CGFloat = 0
public var customerView:UIView? = nil
public var mainTitleAtt: ASAttributedString?
public var secondaryEmptyAtt: ASAttributedString?
public var buttonTitle: String = ""
public var buttonFont: UIFont = .appfont(size: 18)
public var buttonTextColor: UIColor = .systemBlue
public var image: UIImage? = UIImage(.exclamationmark.triangle)
public var backgroundColor: UIColor = .clear
public var imageToTextPadding: CGFloat = 10
public var textToSecondaryTextPadding: CGFloat = 5
public var buttonToSecondaryButtonPadding: CGFloat = 15
public var verticalOffSet: CGFloat = 0
public var customerView: UIView? = nil
}

@available(iOS 17.0 , *)
Expand Down
6 changes: 3 additions & 3 deletions PooToolsSource/WhereIsMyEye/PTEyeTrackingTestUtility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class PTEyeTrackingTestUtility {
internal func showStatusView(parent: UIView) {
if statusLabel == nil {
let label = UILabel(frame: CGRect(x: 50,
y: kSCREEN_BOUNDS.height / 2 - 15,
width: kSCREEN_BOUNDS.width - 50,
height: 30))
y: kSCREEN_BOUNDS.height / 2 - 15,
width: kSCREEN_BOUNDS.width - 50,
height: 30))

label.textAlignment = NSTextAlignment.left
label.text = ""
Expand Down

0 comments on commit 783b257

Please sign in to comment.