Skip to content

Custom UIActivity implementations to show "Open in Safari" and "Open in Chrome" options in the list of activities. Implemented in Swift 3.0.

License

Notifications You must be signed in to change notification settings

nomadic-cc/BrowserActivity

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BrowserActivity

Version License Platform

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

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

BrowserActivity is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "BrowserActivity"

Add/append googlechrome and googlechromes schemes in your Info.plist under LSApplicationQueriesSchemes. For example:

    <key>LSApplicationQueriesSchemes</key>
	<array>
		<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.

About

Custom UIActivity implementations to show "Open in Safari" and "Open in Chrome" options in the list of activities. Implemented in Swift 3.0.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 84.5%
  • Ruby 15.5%