Swiftpack.co - raxityo/BrowserActivity as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by raxityo.
raxityo/BrowserActivity 2.0.0
Custom UIActivity implementations to show "Open in Safari", "Open in Chrome" and "Open in Firefox" options in the list of activities
⭐️ 15
🕓 3 years ago
.package(url: "https://github.com/raxityo/BrowserActivity.git", from: "2.0.0")

BrowserActivity

Custom UIActivity implementations to show "Open in Safari", "Open in Chrome" and "Open in Firefox" options in the list of activities, implemented in Swift 5.3

UIActivity Screenshot

Usage:

	let sharingURL = URL(string: "https://www.google.com/search?q=swift")
	let activityViewController = UIActivityViewController(
	    activityItems: [sharingURL],
	    applicationActivities: BrowserActivity.compatibleActivities
	)
	present(activityViewController, animated: true, completion: nil)

Helper:

BrowserActivity.compatibleActivities

Returns an Array of UIActivity instances to open the given URL in Safari and/or Google Chrome (if Google Chrome is installed in the device).

Example:

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation:

  • Swift Package Manager:
      .package(url: "https://github.com/raxityo/BrowserActivity", from: "2.0.0"),
    

Update Info.plist:

Add/append googlechrome, googlechromes and firefox schemes in your Info.plist under LSApplicationQueriesSchemes.

	<key>LSApplicationQueriesSchemes</key>
	<array>
		<string>firefox</string>
		<string>googlechrome</string>
		<string>googlechromes</string>
	</array>

Author:

Raxit Majithiya (@raxityo)

License:

BrowserActivity is available under the MIT license. See the LICENSE file for more info.

GitHub

link
Stars: 15
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics