Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/naturaln0va/visualactivityviewcontroller
A way to represent what you’re sharing.
https://github.com/naturaln0va/visualactivityviewcontroller
customization ios preview sharing swift4 uiactivityviewcontroller
Last synced: about 11 hours ago
JSON representation
A way to represent what you’re sharing.
- Host: GitHub
- URL: https://github.com/naturaln0va/visualactivityviewcontroller
- Owner: naturaln0va
- License: mit
- Created: 2018-05-23T13:22:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-12T16:03:04.000Z (almost 6 years ago)
- Last Synced: 2024-11-06T09:07:34.754Z (7 days ago)
- Topics: customization, ios, preview, sharing, swift4, uiactivityviewcontroller
- Language: Swift
- Homepage: https://ackermann.io/posts/previewing-the-system-share-sheet
- Size: 632 KB
- Stars: 758
- Watchers: 12
- Forks: 29
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## About
This project provides a preview of items being shared via `UIActivityViewController`. Example:
```swift
// standard activity view controller
let vc = UIActivityViewController(activityItems: [shareText])// custom activity view controller with a preview
let vc = VisualActivityViewController(text: shareText)
```## Features
* Text, Image, and URL previewing
* Swipe gesture to dismiss the share sheet
* Easy customization (match your app’s style)## Requirements
* iOS 9.0+
* Xcode 9.0+## Installation
To install, simply add the `VisualActivityViewController.swift` file to your project.
## Advanced Usage
There are quite a few different options to customize the appearance of the preview. Check out the example project to see how some of these options work.
```swift
/// The duration for the preview fading in
var fadeInDuration: TimeInterval = 0.3/// The duration for the preview fading out
var fadeOutDuration: TimeInterval = 0.3/// The corner radius of the preview
var previewCornerRadius: CGFloat = 12/// The corner radius of the preview image
var previewImageCornerRadius: CGFloat = 3/// The side length of the preview image
var previewImageSideLength: CGFloat = 80/// The padding around the preview
var previewPadding: CGFloat = 12/// The number of lines to preview
var previewNumberOfLines: Int = 5/// The preview color for URL activity items
var previewLinkColor: UIColor = UIColor(red: 0, green: 0.47, blue: 1, alpha: 1)/// The font for the preview label
var previewFont: UIFont = UIFont.systemFont(ofSize: 18)/// The margin from the top of the viewController's window
var previewTopMargin: CGFloat = 8/// The margin from the top of the viewController's view
var previewBottomMargin: CGFloat = 8
```## License
This project is available under the MIT license. See the LICENSE file for more info.