Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bullinnyc/MagicText
MagicText is the perfect solution when you need to show a small amount of information in a pretty wrapper.
https://github.com/bullinnyc/MagicText
animation animation-text ios macos magic-text swift swiftui text tvos visionos watchos
Last synced: 13 days ago
JSON representation
MagicText is the perfect solution when you need to show a small amount of information in a pretty wrapper.
- Host: GitHub
- URL: https://github.com/bullinnyc/MagicText
- Owner: bullinnyc
- License: mit
- Created: 2023-04-24T11:04:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-17T08:58:06.000Z (5 months ago)
- Last Synced: 2024-07-30T20:59:24.001Z (3 months ago)
- Topics: animation, animation-text, ios, macos, magic-text, swift, swiftui, text, tvos, visionos, watchos
- Language: Swift
- Homepage:
- Size: 1.81 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MagicText
[![Swift Package Manager compatible](https://img.shields.io/badge/SPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
MagicText is the perfect solution when you need to show a small amount of information in a pretty wrapper.
## Gifs
![](./charmed.gif) ![](./charmed-color.gif) ![](./bubble.gif) ![](./fantasy.gif) ![](./charmed-letter.gif) ![](./art-letter.gif)
## Installation
### [Swift Package Manager](https://swift.org/package-manager/)
Going to Xcode `File` > `Add Packages...` and add the repository by giving the URL
`https://github.com/bullinnyc/MagicText`
Enjoy!## Usage
```swift
import MagicText
``````swift
let singleLineExampleText = "Life is like a box of chocolates, you never know what you’re gonna get."let multiLineExampleText = """
Life is like a box
of chocolates, you never
know what you’re
gonna get.
"""// Charmed magic text (default).
MagicTextView(
text: singleLineExampleText,
fontSize: 28
) {
print("Animation finished.")
}// Fantasy magic text.
MagicTextView(
text: multiLineExampleText,
textColors: [.black.opacity(0.8)],
fontSize: 28,
magicType: .fantasy
) {
print("Animation finished.")
}
```### Set the type of MagicText
**Note:** Default `magicType` is set to `charmed`.
You can try other types.```swift
.charmed
.artLetter
.bubble
.fantasy
.charmedLetter(backgroundColor:)
```## Requirements
- iOS 14.0 + / macOS 11.0 + / tvOS 14.0 + / watchOS 7.0 + / visionOS 1.0 +
- Xcode 15.0 +
- [SwiftUI](https://developer.apple.com/xcode/swiftui/)## License
- MagicText is distributed under the MIT License.