Giter VIP home page Giter VIP logo

eggsbenedict's Introduction

EggsBenedict

Build Status Carthage compatible 日本語

EggsBenedict is a library for sharing picture with Instagram app written in Swift.

This library is following Instagram's sharing flow.

Instagram's documentation

If the custom URL schemes instagram:// can be opened direct users on the iOS device, the flow is as follows.

  1. Save temporary image file named jpmarthaeggsbenedict (JPEG format) in tmp/ directory using the filename extension .ig or .igo.
  2. Display the menu for copying to Instagram app.
  3. If users tap the "Copy to Instagram" icon, open Instagram app with its filter screen.

The image is preloaded and sized appropriately for Instagram. For best results, Instagram prefers opening a JPEG that is 640px by 640px square. If the image is larger, it will be resized dynamically.

- By the way, why was it named "EggsBenedict"?

The reason is because I like Eggs Benedict 😋

Availability

  • Swift 2.1
  • Xcode 7.2
  • iOS 8.0 and later

Adding EggsBenedict.framework to your project

Carthage (preferred)

  1. Create a Cartfile, and add github "JPMartha/EggsBenedict" ~> 0.9.9.
  2. Run $ carthage update --platform iOS in your project directory.
  3. On your application targets’ “Build Phases” settings tab, in the “Link Binary With Libraries” section, click the “+” icon and add EggsBenedict.framework from the Carthage/Build folder on disk.
  4. On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script with the following contents:
/usr/local/bin/carthage copy-frameworks

and add the "Input Files" to EggsBenedict.framework:

$(SRCROOT)/Carthage/Build/iOS/EggsBenedict.framework

This script works around an App Store submission bug triggered by universal binaries and ensures that necessary bitcode-related files are copied when archiving.

  1. Create a Podfile, and add the following contents:
use_frameworks!
pod 'EggsBenedict', '~> 0.9.9'
  1. Run $ pod install in your project directory.

Getting started

  1. On your application Info.plist, add LSApplicationQueriesSchemes key.
Key Type Value
LSApplicationQueriesSchemes Array instagram
  1. Create an instance of the SharingFlow class with the SharingFlowType enumeration.
let sharingFlow = SharingFlow(type: .IGOExclusivegram)

For more information, see SharingFlow Class Reference and SharingFlowType Enumeration.

  1. Call the presentOpenInMenuWithImage:inView: of the created instance.
sharingFlow.presentOpenInMenuWithImage(YourImage, inView view: YourView)

For more information, see SharingFlow Class Reference.

Documentation

License

EggsBenedict is released under the MIT License.

eggsbenedict's People

Contributors

jpmartha avatar

Watchers

James Cloos avatar Larry Nickerson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.