Skip to content

Instantly share code, notes, and snippets.

@KalpeshTalkar
Created March 24, 2017 11:47
Show Gist options
  • Save KalpeshTalkar/bfb53bfc664159e8e270e5b613f7dee8 to your computer and use it in GitHub Desktop.
Save KalpeshTalkar/bfb53bfc664159e8e270e5b613f7dee8 to your computer and use it in GitHub Desktop.
Custom UIActivity written in Swift 2.2
//
// CustomActivity.swift
//
// Created by Kalpesh on 24/03/17.
// Copyright © 2017 Kalpesh Talkar. All rights reserved.
//
//
class CustomActivity: UIActivity {
override func activityType() -> String? {
return "ActicityType"
}
override func activityTitle() -> String? {
return "ActivityTitle"
}
override func canPerformWithActivityItems(activityItems: [AnyObject]) -> Bool {
print(#function)
return true
}
override func prepareWithActivityItems(activityItems: [AnyObject]) {
print(#function)
}
override func activityViewController() -> UIViewController? {
print(#function)
return nil
}
override func performActivity() {
print(#function)
activityDidFinish(true)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment