Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zunda-pixel/chatbubble
ChatBubble SwiftUI
https://github.com/zunda-pixel/chatbubble
swift swift-package-manager swiftui
Last synced: 3 months ago
JSON representation
ChatBubble SwiftUI
- Host: GitHub
- URL: https://github.com/zunda-pixel/chatbubble
- Owner: zunda-pixel
- License: apache-2.0
- Created: 2022-11-14T15:19:45.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-09T16:08:20.000Z (about 1 year ago)
- Last Synced: 2024-05-02T02:34:24.633Z (9 months ago)
- Topics: swift, swift-package-manager, swiftui
- Language: Swift
- Homepage:
- Size: 20.5 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ChatBubble
```swift
struct SingleChatBubble: PreviewProvider {
static var previews: some View {
Text("Stanford Video Steve Jobs’ 2005 Stanford Commencement Address I am honored to be with you today at your commencement from one of the finest universities in the world.")
.fixedSize(horizontal: false, vertical: true)
.chatBubble(
direction: .leadingTop,
cornerRadius: 17,
color: .blue.opacity(0.5)
)
}
}
``````swift
struct ShapePreview: PreviewProvider {
static var previews: some View {
ChatBubble(cornerRadius: 17)
.frame(width: 300, height: 100)
.foregroundColor(.cyan)
}
}
``````swift
struct RawChatBubble: PreviewProvider {
static var previews: some View {
Text("Sample Text.")
.fixedSize(horizontal: false, vertical: true)
.padding()
.background {
ChatBubble(cornerRadius: 17)
.rotateChatBubble(position: .trailingBottom)
.foregroundColor(.red.opacity(0.5))
}
}
}
```## 参考にしたもの
https://qiita.com/yuppejp/items/92429a0fc8440f9da487