Skip to content

Commit c2bcb35

Browse files
committed
Address #529
1 parent 188705b commit c2bcb35

File tree

6 files changed

+27
-28
lines changed

6 files changed

+27
-28
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## 9.0.8
5+
6+
### Changes
7+
8+
* #529 Update readme and SwiftUI demo to demostrate how to mask edges.
9+
410
## 9.0.7
511

612
### Features

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,14 @@ struct DemoMessageView: View {
208208
.padding(30)
209209
.frame(maxWidth: .infinity)
210210
.background(.gray)
211-
.cornerRadius(15)
212-
.padding(15)
211+
// This makes a tab-style view where the bottom corners are rounded and the view's background
212+
// extends to the top edge.
213+
.mask(
214+
UnevenRoundedRectangle(
215+
cornerRadii: .init(bottomLeading: 15, bottomTrailing: 15)
216+
)
217+
.edgesIgnoringSafeArea(.top)
218+
)
213219
}
214220
}
215221
````

SwiftMessages.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'SwiftMessages'
3-
spec.version = '9.0.7'
3+
spec.version = '9.0.8'
44
spec.license = { :type => 'MIT' }
55
spec.homepage = 'https://github.com/SwiftKickMobile/SwiftMessages'
66
spec.authors = { 'Timothy Moose' => 'tim@swiftkickmobile.com' }

SwiftUIDemo/SwiftUIDemo.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
228F7DBD2ACF1E1E006C9644 /* SwiftMessages.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftMessages.xcodeproj; path = ../SwiftMessages.xcodeproj; sourceTree = "<group>"; };
5959
228F7DD42ACF59E4006C9644 /* DemoMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoMessage.swift; sourceTree = "<group>"; };
6060
228F7DD62ACF5C2E006C9644 /* DemoMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoMessageView.swift; sourceTree = "<group>"; };
61+
2291AA492AD1E3EC0084868E /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
62+
2291AA4C2AD1E4520084868E /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; sourceTree = "<group>"; };
6163
/* End PBXFileReference section */
6264

6365
/* Begin PBXFrameworksBuildPhase section */
@@ -75,6 +77,8 @@
7577
228F7DA02ACF17E8006C9644 = {
7678
isa = PBXGroup;
7779
children = (
80+
2291AA4C2AD1E4520084868E /* CHANGELOG.md */,
81+
2291AA492AD1E3EC0084868E /* README.md */,
7882
228F7DAB2ACF17E8006C9644 /* SwiftUIDemo */,
7983
228F7DAA2ACF17E8006C9644 /* Products */,
8084
228F7DC72ACF1E63006C9644 /* Frameworks */,

SwiftUIDemo/SwiftUIDemo/DemoMessageView.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ struct DemoMessageView: View {
2828
.padding(30)
2929
.frame(maxWidth: .infinity)
3030
.background(.demoMessageBackground)
31-
.cornerRadius(15)
32-
.padding(15)
31+
// This makes a tab-style view where the bottom corners are rounded and the view's background
32+
// extends to the top edge.
33+
.mask(
34+
UnevenRoundedRectangle(
35+
cornerRadii: .init(bottomLeading: 15, bottomTrailing: 15)
36+
)
37+
.edgesIgnoringSafeArea(.top)
38+
)
3339
}
3440
}
35-

SwiftUIDemo/SwiftUIDemo/DemoView.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,3 @@ struct DemoView: View {
2424
#Preview {
2525
DemoView()
2626
}
27-
28-
struct DemoViewx: View {
29-
var body: some View {
30-
Button("Show message") {
31-
let message = DemoMessage(title: "Demo", body: "SwiftUI forever!")
32-
let messageView = MessageHostingView(message: message)
33-
SwiftMessages.show(view: messageView)
34-
}
35-
}
36-
}
37-
38-
struct DemoViewy: View {
39-
40-
@State var message: DemoMessage?
41-
42-
var body: some View {
43-
Button("Show message") {
44-
message = DemoMessage(title: "Demo", body: "SwiftUI forever!")
45-
}
46-
.swiftMessage(message: $message)
47-
}
48-
}

0 commit comments

Comments
 (0)