diff --git a/CHANGELOG.md b/CHANGELOG.md index fdb8977..d17b7a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +## 9.0.8 + +### Changes + +* #529 Update readme and SwiftUI demo to demostrate how to mask edges. + ## 9.0.7 ### Features diff --git a/README.md b/README.md index 8cb208b..10ec0f2 100644 --- a/README.md +++ b/README.md @@ -208,8 +208,14 @@ struct DemoMessageView: View { .padding(30) .frame(maxWidth: .infinity) .background(.gray) - .cornerRadius(15) - .padding(15) + // This makes a tab-style view where the bottom corners are rounded and the view's background + // extends to the top edge. + .mask( + UnevenRoundedRectangle( + cornerRadii: .init(bottomLeading: 15, bottomTrailing: 15) + ) + .edgesIgnoringSafeArea(.top) + ) } } ```` diff --git a/SwiftMessages.podspec b/SwiftMessages.podspec index 941a982..e67d4b0 100644 --- a/SwiftMessages.podspec +++ b/SwiftMessages.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'SwiftMessages' - spec.version = '9.0.7' + spec.version = '9.0.8' spec.license = { :type => 'MIT' } spec.homepage = 'https://github.com/SwiftKickMobile/SwiftMessages' spec.authors = { 'Timothy Moose' => 'tim@swiftkickmobile.com' } diff --git a/SwiftUIDemo/SwiftUIDemo.xcodeproj/project.pbxproj b/SwiftUIDemo/SwiftUIDemo.xcodeproj/project.pbxproj index 8b289e2..f6c945b 100644 --- a/SwiftUIDemo/SwiftUIDemo.xcodeproj/project.pbxproj +++ b/SwiftUIDemo/SwiftUIDemo.xcodeproj/project.pbxproj @@ -58,6 +58,8 @@ 228F7DBD2ACF1E1E006C9644 /* SwiftMessages.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftMessages.xcodeproj; path = ../SwiftMessages.xcodeproj; sourceTree = ""; }; 228F7DD42ACF59E4006C9644 /* DemoMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoMessage.swift; sourceTree = ""; }; 228F7DD62ACF5C2E006C9644 /* DemoMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoMessageView.swift; sourceTree = ""; }; + 2291AA492AD1E3EC0084868E /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; + 2291AA4C2AD1E4520084868E /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -75,6 +77,8 @@ 228F7DA02ACF17E8006C9644 = { isa = PBXGroup; children = ( + 2291AA4C2AD1E4520084868E /* CHANGELOG.md */, + 2291AA492AD1E3EC0084868E /* README.md */, 228F7DAB2ACF17E8006C9644 /* SwiftUIDemo */, 228F7DAA2ACF17E8006C9644 /* Products */, 228F7DC72ACF1E63006C9644 /* Frameworks */, diff --git a/SwiftUIDemo/SwiftUIDemo/DemoMessageView.swift b/SwiftUIDemo/SwiftUIDemo/DemoMessageView.swift index cce5058..a299c35 100644 --- a/SwiftUIDemo/SwiftUIDemo/DemoMessageView.swift +++ b/SwiftUIDemo/SwiftUIDemo/DemoMessageView.swift @@ -28,8 +28,13 @@ struct DemoMessageView: View { .padding(30) .frame(maxWidth: .infinity) .background(.demoMessageBackground) - .cornerRadius(15) - .padding(15) + // This makes a tab-style view where the bottom corners are rounded and the view's background + // extends to the top edge. + .mask( + UnevenRoundedRectangle( + cornerRadii: .init(bottomLeading: 15, bottomTrailing: 15) + ) + .edgesIgnoringSafeArea(.top) + ) } } - diff --git a/SwiftUIDemo/SwiftUIDemo/DemoView.swift b/SwiftUIDemo/SwiftUIDemo/DemoView.swift index e0bcd6c..a6736d8 100644 --- a/SwiftUIDemo/SwiftUIDemo/DemoView.swift +++ b/SwiftUIDemo/SwiftUIDemo/DemoView.swift @@ -24,25 +24,3 @@ struct DemoView: View { #Preview { DemoView() } - -struct DemoViewx: View { - var body: some View { - Button("Show message") { - let message = DemoMessage(title: "Demo", body: "SwiftUI forever!") - let messageView = MessageHostingView(message: message) - SwiftMessages.show(view: messageView) - } - } -} - -struct DemoViewy: View { - - @State var message: DemoMessage? - - var body: some View { - Button("Show message") { - message = DemoMessage(title: "Demo", body: "SwiftUI forever!") - } - .swiftMessage(message: $message) - } -}