This file contains 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 Foundation | |
import UIKit | |
private let InstagramAppURL = URL(string: "instagram://app")! | |
class InstagramActivity: UIActivity, UIDocumentInteractionControllerDelegate { | |
override class var activityCategory: UIActivityCategory { return .share } | |
override var activityType: UIActivityType? { return UIActivityType("postToInstagram") } | |
override var activityTitle: String? { return "Instagram" } | |
override var activityImage: UIImage? { return #imageLiteral(resourceName: "instagram_activity") } |
This file contains 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
// | |
// GIF2MP4.swift | |
// | |
// Created by PowHu Yang on 2020/4/24. | |
// Copyright © 2020 PowHu Yang. All rights reserved. | |
// | |
/* How to use | |
let data = try! Data(contentsOf: Bundle.main.url(forResource: "gif", withExtension: "gif")!) | |
let tempUrl = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("temp.mp4") |