Skip to content

Commit

Permalink
Address #529
Browse files Browse the repository at this point in the history
  • Loading branch information
wtmoose committed Oct 7, 2023
1 parent 188705b commit c2bcb35
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 28 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
}
}
````
Expand Down
2 changes: 1 addition & 1 deletion SwiftMessages.podspec
Original file line number Diff line number Diff line change
@@ -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' => '[email protected]' }
Expand Down
4 changes: 4 additions & 0 deletions SwiftUIDemo/SwiftUIDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
228F7DBD2ACF1E1E006C9644 /* SwiftMessages.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftMessages.xcodeproj; path = ../SwiftMessages.xcodeproj; sourceTree = "<group>"; };
228F7DD42ACF59E4006C9644 /* DemoMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoMessage.swift; sourceTree = "<group>"; };
228F7DD62ACF5C2E006C9644 /* DemoMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoMessageView.swift; sourceTree = "<group>"; };
2291AA492AD1E3EC0084868E /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
2291AA4C2AD1E4520084868E /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -75,6 +77,8 @@
228F7DA02ACF17E8006C9644 = {
isa = PBXGroup;
children = (
2291AA4C2AD1E4520084868E /* CHANGELOG.md */,
2291AA492AD1E3EC0084868E /* README.md */,
228F7DAB2ACF17E8006C9644 /* SwiftUIDemo */,
228F7DAA2ACF17E8006C9644 /* Products */,
228F7DC72ACF1E63006C9644 /* Frameworks */,
Expand Down
11 changes: 8 additions & 3 deletions SwiftUIDemo/SwiftUIDemo/DemoMessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
}
}

22 changes: 0 additions & 22 deletions SwiftUIDemo/SwiftUIDemo/DemoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit c2bcb35

Please sign in to comment.