Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dempseyatgithub/MemeMaker
An app that composes text over an image in SwiftUI
https://github.com/dempseyatgithub/MemeMaker
Last synced: 2 months ago
JSON representation
An app that composes text over an image in SwiftUI
- Host: GitHub
- URL: https://github.com/dempseyatgithub/MemeMaker
- Owner: dempseyatgithub
- Created: 2019-06-11T21:15:04.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-12T20:17:13.000Z (over 5 years ago)
- Last Synced: 2024-11-12T11:41:11.759Z (2 months ago)
- Language: Swift
- Size: 183 KB
- Stars: 101
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- fucking-open-source-ios-apps - MemeMaker
- awesome-swiftui - An app that composes text over an image in SwiftUI
README
MemeMaker
=================================MemeMaker is a little app using SwiftUI that shows a few things:
- Main list uses a generic type constrained to View to pass destination view into row
Now has three examples:
Overlay
- Uses the overlay modifier to overlay the text on top of the image. Probably the cleanest solution.ZStacks
- The original example using nested zstacks to pin text to top and bottom of imageText Gone Wild
- What happens when the text is allowed to spread out as far as it can
- Shadow is added to all text in this example so it can be seenAll Example Memes also show
- Using a named font instead of one of the semantic font styles
- Adding a shadow to Text and creating a non-named colorIt was also used to create this meme, which I found amusing:
https://twitter.com/jamesdempsey/status/1138491138740895744### Notes ###
This is a not-particularly-functional app created by someone on their first day of using a new technology.
- You can’t edit the text except by editing the code
- You can't different image unless add other images to the project.
- You can’t export or share the meme.The app composes some text over an image in a few different ways and then you can take a screenshot of the result to share if you want to.
### Caveats ###
The image is too wide for the screen, so the ends are clipped.
There should be a more elegant way to pin text at the top and bottom of the image than using two ZStacks.
UPDATE: There is! Check out the Overlay example in the app.Clearly, I need to learn more about having views size themselves in SwiftUI.
I also need to brush up on my generics and protocols. I know I need the type-erased AnyView type to keep from hardcoding destination views in the row view, but I couldn't explain to you very clearly why.
UPDATE: In fact, I should really only be using AnyView as a last resort. Based on that feedback from Matt Ricketson ([@ricketson_](https://twitter.com/@ricketson_)), I've updated to use generics.So, I'm putting this out there as a starting point if you want to check it out or play with it. Feel free to download or fork it and play with it on your own. If you discover better techniques for any of it, I'd love it if you'd let me know. I'm @jamesdempsey at [Micro.blog](https://micro.blog/jamesdempsey) and [Twitter](https://twitter.com/jamesdempsey).
You can read more about my initial experiences with SwiftUI at [jamesdempsey.net](https://jamesdempsey.net).