fix warning

This commit is contained in:
xaoxuu 2023-12-11 15:27:41 +08:00
parent a77f1a4356
commit b2a73f1c1b
6 changed files with 20 additions and 48 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1150"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -13,7 +13,6 @@
CD6537C328C35E6200A5981B /* DemoToastVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD6537C228C35E6200A5981B /* DemoToastVC.swift */; };
CD6537C528C35F2C00A5981B /* DemoSheetVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD6537C428C35F2C00A5981B /* DemoSheetVC.swift */; };
CD6AE8A32A7CC1BA0044E53D /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = CD6AE8A22A7CC1BA0044E53D /* SnapKit */; };
CD891BCD2A80B58E00848BBC /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = CD891BCC2A80B58E00848BBC /* SnapKit */; };
CD8EEF3B28BC5C7200E660EA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD8EEF3A28BC5C7200E660EA /* AppDelegate.swift */; };
CD8EEF3D28BC5C7200E660EA /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD8EEF3C28BC5C7200E660EA /* SceneDelegate.swift */; };
CD8EEF4228BC5C7200E660EA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CD8EEF4028BC5C7200E660EA /* Main.storyboard */; };
@ -50,7 +49,6 @@
buildActionMask = 2147483647;
files = (
CDCBAEC42A80D6FD00C30DE5 /* ProHUD in Frameworks */,
CD891BCD2A80B58E00848BBC /* SnapKit in Frameworks */,
CDB6A2A228BC5F4600DEC80D /* ProHUD in Frameworks */,
CD6AE8A32A7CC1BA0044E53D /* SnapKit in Frameworks */,
);
@ -123,7 +121,6 @@
packageProductDependencies = (
CDB6A2A128BC5F4600DEC80D /* ProHUD */,
CD6AE8A22A7CC1BA0044E53D /* SnapKit */,
CD891BCC2A80B58E00848BBC /* SnapKit */,
CDCBAEC32A80D6FD00C30DE5 /* ProHUD */,
);
productName = PHDemo;
@ -138,7 +135,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1340;
LastUpgradeCheck = 1340;
LastUpgradeCheck = 1500;
TargetAttributes = {
CD8EEF3628BC5C7200E660EA = {
CreatedOnToolsVersion = 13.4.1;
@ -155,7 +152,6 @@
);
mainGroup = CD8EEF2E28BC5C7200E660EA;
packageReferences = (
CD891BCB2A80B58E00848BBC /* XCRemoteSwiftPackageReference "SnapKit" */,
CDCBAEC22A80D6FD00C30DE5 /* XCLocalSwiftPackageReference ".." */,
);
productRefGroup = CD8EEF3828BC5C7200E660EA /* Products */;
@ -224,6 +220,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
@ -256,6 +253,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@ -284,6 +282,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
@ -316,6 +315,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@ -422,27 +422,11 @@
};
/* End XCLocalSwiftPackageReference section */
/* Begin XCRemoteSwiftPackageReference section */
CD891BCB2A80B58E00848BBC /* XCRemoteSwiftPackageReference "SnapKit" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://git.xaox.cc/mirrors/SnapKit.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 5.6.0;
};
};
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
CD6AE8A22A7CC1BA0044E53D /* SnapKit */ = {
isa = XCSwiftPackageProductDependency;
productName = SnapKit;
};
CD891BCC2A80B58E00848BBC /* SnapKit */ = {
isa = XCSwiftPackageProductDependency;
package = CD891BCB2A80B58E00848BBC /* XCRemoteSwiftPackageReference "SnapKit" */;
productName = SnapKit;
};
CDB6A2A128BC5F4600DEC80D /* ProHUD */ = {
isa = XCSwiftPackageProductDependency;
productName = ProHUD;

View File

@ -3,7 +3,7 @@
{
"identity" : "snapkit",
"kind" : "remoteSourceControl",
"location" : "https://git.xaox.cc/mirrors/SnapKit.git",
"location" : "https://github.com/SnapKit/SnapKit.git",
"state" : {
"revision" : "f222cbdf325885926566172f6f5f06af95473158",
"version" : "5.6.0"

View File

@ -1,25 +1,14 @@
{
"object": {
"pins": [
{
"package": "Inspire",
"repositoryURL": "https://github.com/xaoxuu/Inspire.git",
"state": {
"branch": null,
"revision": "05bdbf23e380b7b283f9ef5c5115e1c1e1d1ad97",
"version": "2.2.0"
}
},
{
"package": "SnapKit",
"repositoryURL": "https://github.com/SnapKit/SnapKit.git",
"state": {
"branch": null,
"revision": "f222cbdf325885926566172f6f5f06af95473158",
"version": "5.6.0"
}
"pins" : [
{
"identity" : "snapkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SnapKit/SnapKit.git",
"state" : {
"revision" : "f222cbdf325885926566172f6f5f06af95473158",
"version" : "5.6.0"
}
]
},
"version": 1
}
],
"version" : 2
}

View File

@ -28,7 +28,7 @@ extension CapsuleTarget: DefaultLayout {
if contentStack.arrangedSubviews.contains(textLabel) == false {
contentStack.addArrangedSubview(textLabel)
}
var text = [vm?.title ?? "", vm?.message ?? ""].filter({ $0.count > 0 }).joined(separator: " ")
let text = [vm?.title ?? "", vm?.message ?? ""].filter({ $0.count > 0 }).joined(separator: " ")
if text.count > 0 {
textLabel.snp.remakeConstraints { make in
make.width.lessThanOrEqualTo(AppContext.appBounds.width * 0.5)
@ -113,7 +113,7 @@ extension CapsuleTarget: DefaultLayout {
func getWindowSize(window: CapsuleWindow) -> CGSize {
let cardEdgeInsetsByDefault = config.cardEdgeInsetsByDefault
view.layoutIfNeeded()
var size = contentStack.frame.size
let size = contentStack.frame.size
let width = min(config.cardMaxWidthByDefault, size.width + cardEdgeInsetsByDefault.left + cardEdgeInsetsByDefault.right)
let height = min(config.cardMaxHeightByDefault, size.height + cardEdgeInsetsByDefault.top + cardEdgeInsetsByDefault.bottom)
return .init(width: max(width, config.cardMinWidth ?? 0), height: max(height, config.cardMinHeight))

View File

@ -150,7 +150,6 @@ extension ToastTarget {
}
func getWindowSize(window: ToastWindow) -> CGSize {
let cardEdgeInsets = config.cardEdgeInsetsByDefault
let width = CGFloat.minimum(AppContext.appBounds.width - config.marginX - config.marginX, config.cardMaxWidthByDefault)
view.frame.size = CGSize(width: width, height: config.cardMaxHeightByDefault) //
titleLabel.sizeToFit()