Skip to content

Commit

Permalink
update for SPM
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkitSimform committed Sep 10, 2020
1 parent 0f58cb5 commit fcf4516
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 113 deletions.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions SSToastMessage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
1 change: 1 addition & 0 deletions SSToastMessage/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let package = Package(
name: "SSToastMessage",
platforms: [
.iOS(.v13),
.macOS(.v10_15)
],
products: [
.library(
Expand Down
182 changes: 103 additions & 79 deletions SSToastMessage/SSToastMessage.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,45 @@
path = "";
sourceTree = "BUILT_PRODUCTS_DIR";
};
"OBJ_15" = {
isa = "PBXFileReference";
path = "Example";
sourceTree = "SOURCE_ROOT";
};
"OBJ_16" = {
isa = "PBXFileReference";
path = "LICENSE";
sourceTree = "<group>";
};
"OBJ_17" = {
isa = "PBXFileReference";
path = "README.md";
sourceTree = "<group>";
};
"OBJ_18" = {
isa = "PBXFileReference";
path = "SSToastMessage.podspec";
sourceTree = "<group>";
};
"OBJ_2" = {
isa = "XCConfigurationList";
buildConfigurations = (
"OBJ_17",
"OBJ_18"
"OBJ_3",
"OBJ_4"
);
defaultConfigurationIsVisible = "0";
defaultConfigurationName = "Release";
};
"OBJ_17" = {
"OBJ_20" = {
isa = "XCConfigurationList";
buildConfigurations = (
"OBJ_21",
"OBJ_22"
);
defaultConfigurationIsVisible = "0";
defaultConfigurationName = "Release";
};
"OBJ_21" = {
isa = "XCBuildConfiguration";
buildSettings = {
ENABLE_TESTABILITY = "YES";
Expand All @@ -77,7 +106,7 @@
"$(inherited)",
"$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"
);
MACOSX_DEPLOYMENT_TARGET = "10.10";
MACOSX_DEPLOYMENT_TARGET = "10.15";
OTHER_CFLAGS = (
"$(inherited)"
);
Expand All @@ -101,7 +130,7 @@
};
name = "Debug";
};
"OBJ_18" = {
"OBJ_22" = {
isa = "XCBuildConfiguration";
buildSettings = {
ENABLE_TESTABILITY = "YES";
Expand All @@ -118,7 +147,7 @@
"$(inherited)",
"$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"
);
MACOSX_DEPLOYMENT_TARGET = "10.10";
MACOSX_DEPLOYMENT_TARGET = "10.15";
OTHER_CFLAGS = (
"$(inherited)"
);
Expand All @@ -142,50 +171,83 @@
};
name = "Release";
};
"OBJ_19" = {
"OBJ_23" = {
isa = "PBXSourcesBuildPhase";
files = (
"OBJ_20",
"OBJ_21",
"OBJ_22"
"OBJ_24",
"OBJ_25",
"OBJ_26"
);
};
"OBJ_2" = {
isa = "XCConfigurationList";
buildConfigurations = (
"OBJ_3",
"OBJ_4"
);
defaultConfigurationIsVisible = "0";
defaultConfigurationName = "Release";
};
"OBJ_20" = {
"OBJ_24" = {
isa = "PBXBuildFile";
fileRef = "OBJ_9";
};
"OBJ_21" = {
"OBJ_25" = {
isa = "PBXBuildFile";
fileRef = "OBJ_10";
};
"OBJ_22" = {
"OBJ_26" = {
isa = "PBXBuildFile";
fileRef = "OBJ_11";
};
"OBJ_23" = {
"OBJ_27" = {
isa = "PBXFrameworksBuildPhase";
files = (
);
};
"OBJ_25" = {
"OBJ_29" = {
isa = "XCConfigurationList";
buildConfigurations = (
"OBJ_26",
"OBJ_27"
"OBJ_30",
"OBJ_31"
);
defaultConfigurationIsVisible = "0";
defaultConfigurationName = "Release";
};
"OBJ_26" = {
"OBJ_3" = {
isa = "XCBuildConfiguration";
buildSettings = {
CLANG_ENABLE_OBJC_ARC = "YES";
COMBINE_HIDPI_IMAGES = "YES";
COPY_PHASE_STRIP = "NO";
DEBUG_INFORMATION_FORMAT = "dwarf";
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = "YES";
GCC_OPTIMIZATION_LEVEL = "0";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"SWIFT_PACKAGE=1",
"DEBUG=1"
);
MACOSX_DEPLOYMENT_TARGET = "10.10";
ONLY_ACTIVE_ARCH = "YES";
OTHER_SWIFT_FLAGS = (
"$(inherited)",
"-DXcode"
);
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = "macosx";
SUPPORTED_PLATFORMS = (
"macosx",
"iphoneos",
"iphonesimulator",
"appletvos",
"appletvsimulator",
"watchos",
"watchsimulator"
);
SWIFT_ACTIVE_COMPILATION_CONDITIONS = (
"$(inherited)",
"SWIFT_PACKAGE",
"DEBUG"
);
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
USE_HEADERMAP = "NO";
};
name = "Debug";
};
"OBJ_30" = {
isa = "XCBuildConfiguration";
buildSettings = {
LD = "/usr/bin/true";
Expand All @@ -205,7 +267,7 @@
};
name = "Debug";
};
"OBJ_27" = {
"OBJ_31" = {
isa = "XCBuildConfiguration";
buildSettings = {
LD = "/usr/bin/true";
Expand All @@ -225,58 +287,16 @@
};
name = "Release";
};
"OBJ_28" = {
"OBJ_32" = {
isa = "PBXSourcesBuildPhase";
files = (
"OBJ_29"
"OBJ_33"
);
};
"OBJ_29" = {
"OBJ_33" = {
isa = "PBXBuildFile";
fileRef = "OBJ_6";
};
"OBJ_3" = {
isa = "XCBuildConfiguration";
buildSettings = {
CLANG_ENABLE_OBJC_ARC = "YES";
COMBINE_HIDPI_IMAGES = "YES";
COPY_PHASE_STRIP = "NO";
DEBUG_INFORMATION_FORMAT = "dwarf";
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = "YES";
GCC_OPTIMIZATION_LEVEL = "0";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"SWIFT_PACKAGE=1",
"DEBUG=1"
);
MACOSX_DEPLOYMENT_TARGET = "10.10";
ONLY_ACTIVE_ARCH = "YES";
OTHER_SWIFT_FLAGS = (
"$(inherited)",
"-DXcode"
);
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = "macosx";
SUPPORTED_PLATFORMS = (
"macosx",
"iphoneos",
"iphonesimulator",
"appletvos",
"appletvsimulator",
"watchos",
"watchsimulator"
);
SWIFT_ACTIVE_COMPILATION_CONDITIONS = (
"$(inherited)",
"SWIFT_PACKAGE",
"DEBUG"
);
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
USE_HEADERMAP = "NO";
};
name = "Debug";
};
"OBJ_4" = {
isa = "XCBuildConfiguration";
buildSettings = {
Expand Down Expand Up @@ -321,7 +341,11 @@
"OBJ_6",
"OBJ_7",
"OBJ_12",
"OBJ_13"
"OBJ_13",
"OBJ_15",
"OBJ_16",
"OBJ_17",
"OBJ_18"
);
path = "";
sourceTree = "<group>";
Expand Down Expand Up @@ -359,10 +383,10 @@
};
"SSToastMessage::SSToastMessage" = {
isa = "PBXNativeTarget";
buildConfigurationList = "OBJ_16";
buildConfigurationList = "OBJ_20";
buildPhases = (
"OBJ_19",
"OBJ_23"
"OBJ_23",
"OBJ_27"
);
dependencies = (
);
Expand All @@ -378,9 +402,9 @@
};
"SSToastMessage::SwiftPMPackageDescription" = {
isa = "PBXNativeTarget";
buildConfigurationList = "OBJ_25";
buildConfigurationList = "OBJ_29";
buildPhases = (
"OBJ_28"
"OBJ_32"
);
dependencies = (
);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions SSToastMessage/Sources/Classes/MessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,23 @@ public struct MessageView<MessageContent>: ViewModifier where MessageContent: Vi
}

private var screenHeight: CGFloat {
UIScreen.main.bounds.height
#if os(watchOS)
return WKInterfaceDevice.current().screenBounds.size.height
#elseif os(iOS)
return UIScreen.main.bounds.size.height
#elseif os(macOS)
return NSScreen.main?.frame.height ?? 0
#endif
}

private var screenWidth: CGFloat {
#if os(watchOS)
return WKInterfaceDevice.current().screenBounds.size.width
#elseif os(iOS)
return UIScreen.main.bounds.size.width
#elseif os(macOS)
return NSScreen.main?.frame.width ?? 0
#endif
}

// MARK: - Content Builders
Expand Down Expand Up @@ -173,7 +189,7 @@ public struct MessageView<MessageContent>: ViewModifier where MessageContent: Vi
)
}
}
.frame(width: UIScreen.main.bounds.width)
.frame(width: screenWidth)
.offset(x: 0, y: currentOffset)
.animation(animation)
}
Expand Down
7 changes: 0 additions & 7 deletions SSToastMessage/Tests/LinuxMain.swift

This file was deleted.

15 changes: 0 additions & 15 deletions SSToastMessage/Tests/SSToastMessageTests/SSToastMessageTests.swift

This file was deleted.

This file was deleted.

0 comments on commit fcf4516

Please sign in to comment.