Skip to content

interactiveservices/Share-iOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Share

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

import Share

//Share by message

//For example add this in your view controller's button handling code. 

let message = Share.IMessage.Message(recipients: ["somebodyPhonenumber"],body:"Hello, man!")
Share.IMessage().shareBy(item: message)

//more advanced usage 
 
 let attachment = Share.IMessage.Attachement.data(data: UIImagePNGRepresentation(UIImage(named:"sendimage"))!,
                                                         typeIdentifier: "image/png",
                                                         fileName: "nice.png")
        let message = Share.IMessage.Message(recipients: ["somebodyPhonenumber"],
                                             subject: "No subject :)",
                                             body: "Hello. How are you?",
                                             attachments: [attachment])
        
        Share.IMessage().shareBy(item: message) {  sharer,item,result in
            print("finished with:\nsharer\(sharer)\nitem:\(item)\nresult:\(result)")
        }
//Mail

let letter = Share.Email.Letter(subject: "Hello test letter",
                                        recipients: ["1@mail.ru","admin@mail.ru"],
                                        body: "some body for Email",
                                        bodyIsHTML: false)

Share.Email().shareBy(item:latter)

//General Activity ViewController

let shareElements:[Any] = ["stupid text",
                           URL(string:"https://github.com/interactiveservices/")!,
                           #imageLiteral(resourceName: "sendimage"), 
                           Date()]
Share.Activity().shareBy(item:shareElements)

Requirements

Installation

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

pod "Share"

Author

nikolay.shubenkov@gmail.com, n.shubenkov@be-interactive.ru

License

Share is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published