You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
case instagram(String) // DM only, if you need to share your content into a story please see this (https://gist.github.com/kunofellasleep/e160c64ecea64441ffee0a6a3e18f685)
case whatsapp(String) // Accept WhatsApp text formatting
case telegram(String) // Accept Telegram text formatting
case twitter(String) // Tweet only
case messenger(URL) // URL only
private var baseURL: String {
switch self {
case .instagram:
return "instagram://"
case .whatsapp:
return "whatsapp://"
case .telegram:
return "tg://"
case .twitter:
return "twitter://"
case .messenger:
return "fb-messenger://"
}
}
private var path: String {
switch self {
case .instagram:
return "sharesheet?text=" // if you need url only you should use `sharesheet?url=`
case .whatsapp:
return "send?text="
case .telegram:
return "msg?text="
case .twitter:
return "/post?message="
case .messenger:
return "share?link="
}
}
static func url(for social: Social) -> URL {
switch social {
case .instagram(let string), .whatsapp(let string), .telegram(let string), .twitter(let string):