Need help with Butterfly?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

413 Stars 15 Forks MIT License 90 Commits 2 Opened issues


:airplane: A tiny library for integrating feedback feature. Compatible with Swift 4.0.

Services available


Need anything else?

Contributors list

# 2,538
1 commit


Butterfly is a lightweight library for integrating bug-report and feedback features with shake-motion event.

Goals of this project

One of the main issues accross the iOS development is the feedback of new features and bug report.

The most common way is to use

to send a dry and boring email :
let str = "mailto:[email protected][email protected]&subject=Greetings%20from%20Cupertino!&body=Wish%20you%20were%20here!"
let url = NSURL(string: str)

Butterfly provides an elegant way to present users' feedback as easy as possible.

Quick Look


via CocoaPod

source ''
platform :ios, '8.0'

pod 'Butterfly', '~> 0.3.15'


$ git submodule add
  • Open the
    folder, and drag
    into the file navigator of your app project, under your app project.
  • In Xcode, navigate to the target configuration window by clicking on the blue project icon, and selecting the application target under the "Targets" heading in the sidebar.
  • In the tab bar at the top of that window, open the "Build Phases" panel.
  • Add Butterfly.framework within the "Target Dependencies"
  • Click on the + button at the top left of "Build Phases" panel and select "New Copy Files Phase". Rename this new phase to "Copy Frameworks", set the "Destination" to "Frameworks", and add Butterfly.framework.


import Butterfly
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    let uploader = ButterflyFileUploader.sharedUploader
    uploader.setValue( "sample", forParameter: "folderName" )
    return true


protocol method invoked when send button pressed. You can conform this protocol to handle the image uploading. However, in Xcode Version 6.4 (6E35b) with Swift 2.0, there currently seems to be no way to call static (class) methods defined in a protocol (in pure Swift). Considering this issue, Butterfly included the
to handle uploading stuff in v0.3.13. The
class is an encapsulation under Alamofire 's upload API.
func ButterflyViewControllerDidPressedSendButton(drawView: ButterflyDrawView?) {
    if let image = imageWillUpload {
        let data: UIImage = image
        ButterflyFileUploader.sharedUploader.addFileData( UIImageJPEGRepresentation(data,0.8), withName: currentDate(), withMimeType: "image/jpeg" )

print("ButterflyViewController 's delegate method [-ButterflyViewControllerDidEndReporting] invoked\n")


Configuration of ButterflyFileUploader

// @discussion Make sure your serverURLString is valid before a further application. 
// Call `setServerURLString` to replace the default "" with your own's.
public var serverURLString: String? = ""

/// /// Set uploader 's server URL /// /// @param URL The server URL. /// public func setServerURLString( URL: String ) { serverURLString = URL }

/// /// Add one file or multiple files with file URL to uploader. /// /// @param url The URL of the file whose content will be encoded into the multipart form data. /// /// @param name The name to associate with the file content in the Content-Disposition HTTP header. /// /// @param mimeType The MIME type to associate with the data in the Content-Type HTTP header. /// public func addFileURL( url: NSURL, withName name: String, withMimeType mimeType: String? = nil ) { files.append( ButterflyFileUploadInfo( name: name, withFileURL: url, withMimeType: mimeType ) ) }

/// /// Add one file or multiple files with NSData to uploader. /// /// @param data The data to encode into the multipart form data. /// /// @param name The name to associate with the file content in the Content-Disposition HTTP header. /// /// @param mimeType The MIME type to associate with the data in the Content-Type HTTP header. /// public func addFileData( data: NSData, withName name: String, withMimeType mimeType: String = "application/octet-stream" ) { files.append( ButterflyFileUploadInfo( name: name, withData: data, withMimeType: mimeType ) ) }

For further information, please check out ButterflyFileUploader.swift.


Follow me on Twitter


Butterfly is under MIT LICENCE, see the LICENCE file for more info.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.