This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ZipSparsePairsSequence<A: Sequence, B: Sequence> : Sequence { | |
private var primary: A | |
private var subset: B | |
private let predicate: PairingPredicate | |
fileprivate init(primary: A, subset: B, pairingWith predicate: @escaping PairingPredicate) { | |
self.primary = primary | |
self.subset = subset | |
self.predicate = predicate | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ViewController : UIViewController { | |
// Monotonous view setup hidden. Imagine there's a button on screen that gets tapped and fires the action below. | |
@IBAction func shareLinkButtonPressed(_ sender: Any) { | |
let urlToShare = URL(string: "http://twitter.com/bzamayo")! // the base URL, in a real app this would be provided dynamically based on the current context | |
let sharingActivityItemProvider = LinkSharingActivityItemProvider(url: urlToShare) // make an activity item provider, defined below | |
let activityViewController = UIActivityViewController(activityItems: [sharingActivityItemProvider], applicationActivities: nil) |