├── Cartfile ├── Cartfile.resolved ├── DemoApp ├── DemoApp │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── EggsBenedict.imageset │ │ │ ├── EggsBenedict.jpg │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── ViewController.swift │ └── AppDelegate.swift └── DemoApp.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ └── project.pbxproj ├── EggsBenedictTests ├── EggsBenedict.jpg ├── Info.plist └── EggsBenedictTests.swift ├── Documentation ├── Images │ └── EggsBenedict.gif ├── README.md ├── ja │ ├── Documentation │ │ ├── README.md │ │ ├── SharingFlowTypeEnumeration.md │ │ └── SharingFlowClassReference.md │ └── README.md ├── SharingFlowTypeEnumeration.md └── SharingFlowClassReference.md ├── EggsBenedict.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata ├── xcshareddata │ └── xcschemes │ │ └── EggsBenedict.xcscheme └── project.pbxproj ├── .travis.yml ├── EggsBenedict.xcworkspace └── contents.xcworkspacedata ├── EggsBenedict ├── SharingFlowResult.swift ├── EggsBenedict.h ├── SharingFlowType.swift ├── SharingFlowError.swift ├── Info.plist └── SharingFlow.swift ├── .gitignore ├── EggsBenedict.podspec ├── LICENSE └── README.md /Cartfile: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DemoApp/DemoApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /EggsBenedictTests/EggsBenedict.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpmartha/EggsBenedict/HEAD/EggsBenedictTests/EggsBenedict.jpg -------------------------------------------------------------------------------- /Documentation/Images/EggsBenedict.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpmartha/EggsBenedict/HEAD/Documentation/Images/EggsBenedict.gif -------------------------------------------------------------------------------- /DemoApp/DemoApp/Assets.xcassets/EggsBenedict.imageset/EggsBenedict.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpmartha/EggsBenedict/HEAD/DemoApp/DemoApp/Assets.xcassets/EggsBenedict.imageset/EggsBenedict.jpg -------------------------------------------------------------------------------- /Documentation/README.md: -------------------------------------------------------------------------------- 1 | # EggsBenedict Framework Reference 2 | 3 | - [SharingFlow Class Reference](./SharingFlowClassReference.md) 4 | - [SharingFlowType Enumeration](./SharingFlowTypeEnumeration.md) 5 | -------------------------------------------------------------------------------- /EggsBenedict.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DemoApp/DemoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode7.2 3 | script: 4 | - pod lib lint 5 | - set -o pipefail 6 | - xcodebuild test -scheme EggsBenedict -destination "name=iPhone 6s Plus" -sdk iphonesimulator | xcpretty -c 7 | notifications: 8 | email: false 9 | -------------------------------------------------------------------------------- /Documentation/ja/Documentation/README.md: -------------------------------------------------------------------------------- 1 | # EggsBenedict フレームワークリファレンス 2 | 3 | 日本語に翻訳されたドキュメントです。 4 | 5 | 英語版の方が新しい場合がありますので、更新日を確認して下さい。 6 | 7 | - [SharingFlow クラスリファレンス](./SharingFlowClassReference.md) 8 | - [SharingFlowType 列挙型](./SharingFlowTypeEnumeration.md) 9 | -------------------------------------------------------------------------------- /EggsBenedict.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /EggsBenedict/SharingFlowResult.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SharingFlowResult.swift 3 | // EggsBenedict 4 | // 5 | // Created by JPMartha on 2016/01/13. 6 | // Copyright © 2016 JPMartha. All rights reserved. 7 | // 8 | 9 | public enum SharingFlowResult { 10 | case Success(String) 11 | case Failure(String, ErrorType) 12 | } 13 | -------------------------------------------------------------------------------- /DemoApp/DemoApp/Assets.xcassets/EggsBenedict.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "EggsBenedict.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # Carthage 21 | # 22 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 23 | # Carthage/Checkouts 24 | 25 | Carthage/Build 26 | -------------------------------------------------------------------------------- /EggsBenedict/EggsBenedict.h: -------------------------------------------------------------------------------- 1 | // 2 | // EggsBenedict.h 3 | // EggsBenedict 4 | // 5 | // Created by JPMartha on 2015/12/28. 6 | // Copyright © 2015 JPMartha. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for EggsBenedict. 12 | FOUNDATION_EXPORT double EggsBenedictVersionNumber; 13 | 14 | //! Project version string for EggsBenedict. 15 | FOUNDATION_EXPORT const unsigned char EggsBenedictVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Documentation/ja/Documentation/SharingFlowTypeEnumeration.md: -------------------------------------------------------------------------------- 1 | # SharingFlowType 列挙型 2 | 3 | Instagram アプリへ画像を渡す方法は2種類あります。`SharingFlowType` はそれらに従った列挙型です。 4 | 5 | ##### 宣言 6 | 7 | ```swift 8 | enum SharingFlowType { 9 | case IGPhoto 10 | case IGOExclusivegram 11 | } 12 | ``` 13 | 14 | ##### 定数 15 | 16 | - `IGPhoto` 17 | 18 | Instagram アプリと public/jpeg に対応したほかのアプリが表示されます。 19 | 20 | - `IGOExclusivegram` (オススメ) 21 | 22 | Instagram アプリだけが表示されます。(ドキュメントにはそのように記載されていますが実際にはいくつか表示されます) 23 | 24 | 詳しくは [Instagram's documentation](https://www.instagram.com/developer/mobile-sharing/iphone-hooks/)(英語)を参照してください。 25 | -------------------------------------------------------------------------------- /EggsBenedict/SharingFlowType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SharingFlowType.swift 3 | // EggsBenedict 4 | // 5 | // Created by JPMartha on 2016/01/13. 6 | // Copyright © 2016 JPMartha. All rights reserved. 7 | // 8 | 9 | /** 10 | A type of Instagram's sharing flow. 11 | - seealso: [SharingFlowType Enumeration](https://github.com/JPMartha/EggsBenedict/blob/develop/Documentation/SharingFlowTypeEnumeration.md) 12 | - `IGPhoto`: Show Instagram plus any other public/jpeg-conforming apps in the application list. 13 | - `IGOExclusivegram` __(preferred)__: Show only Instagram in the application list. (Actually, some apps are shown.) 14 | */ 15 | public enum SharingFlowType { 16 | case IGPhoto 17 | case IGOExclusivegram 18 | } 19 | -------------------------------------------------------------------------------- /Documentation/SharingFlowTypeEnumeration.md: -------------------------------------------------------------------------------- 1 | # SharingFlowType Enumeration 2 | 3 | You can use two ways in Instagram's sharing flow. The `SharingFlowType` is the enumeration following them. 4 | 5 | ##### Declaration 6 | 7 | ```swift 8 | enum SharingFlowType { 9 | case IGPhoto 10 | case IGOExclusivegram 11 | } 12 | ``` 13 | 14 | ##### Constants 15 | 16 | - `IGPhoto` 17 | 18 | Show Instagram plus any other public/jpeg-conforming apps in the application list. 19 | 20 | - `IGOExclusivegram` (preferred) 21 | 22 | Show only Instagram in the application list. (Actually, some apps are shown.) 23 | 24 | For more information, see [Instagram's documentation](https://www.instagram.com/developer/mobile-sharing/iphone-hooks/). 25 | -------------------------------------------------------------------------------- /DemoApp/DemoApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /EggsBenedictTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /EggsBenedict.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "EggsBenedict" 3 | s.version = "0.9.9" 4 | s.summary = "EggsBenedict is a library for sharing picture on Instagram written in Swift." 5 | s.description = <<-DESC 6 | This library is following Instagram's sharing flow. 7 | 8 | > __Instagram's documentation__ 9 | 10 | > - [Document Interaction](https://www.instagram.com/developer/mobile-sharing/iphone-hooks/#document-interaction) 11 | DESC 12 | s.homepage = "https://github.com/JPMartha/EggsBenedict" 13 | s.license = { :type => "MIT", :file => "LICENSE" } 14 | s.author = "JPMartha" 15 | s.social_media_url = "https://twitter.com/JPMartha_jp" 16 | s.platform = :ios, "8.0" 17 | s.source = { :git => "https://github.com/JPMartha/EggsBenedict.git", :branch => 'develop', :tag => s.version } 18 | s.source_files = "EggsBenedict/**/*.swift" 19 | s.requires_arc = true 20 | end 21 | -------------------------------------------------------------------------------- /EggsBenedict/SharingFlowError.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SharingFlowError.swift 3 | // EggsBenedict 4 | // 5 | // Created by JPMartha on 2016/01/13. 6 | // Copyright © 2016 JPMartha. All rights reserved. 7 | // 8 | 9 | public enum SharingFlowError: ErrorType, CustomDebugStringConvertible { 10 | case NotFoundInstagramApp 11 | case UTIisEmpty 12 | case ImageJPEGRepresentationFailed 13 | case WriteToFileFailed 14 | case ImagePathIsEmpty 15 | 16 | public var debugDescription: String { 17 | switch self { 18 | case .NotFoundInstagramApp: 19 | return "Not found Instagram app." 20 | case .UTIisEmpty: 21 | return "UTI is empty." 22 | case .ImageJPEGRepresentationFailed: 23 | return "\"UIImageJPEGRepresentation::\" method failed." 24 | case .WriteToFileFailed: 25 | return "\"writeToFile:atomically:\" method failed." 26 | case .ImagePathIsEmpty: 27 | return "ImagePath is empty." 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 JPMartha 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /EggsBenedict/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | LSApplicationQueriesSchemes 24 | 25 | instagram 26 | 27 | NSPrincipalClass 28 | 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIMainStoryboardFile 32 | Main 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /DemoApp/DemoApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LSApplicationQueriesSchemes 6 | 7 | instagram 8 | 9 | CFBundleDevelopmentRegion 10 | en 11 | CFBundleExecutable 12 | $(EXECUTABLE_NAME) 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | $(PRODUCT_NAME) 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1 27 | LSRequiresIPhoneOS 28 | 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIMainStoryboardFile 32 | Main 33 | UIRequiredDeviceCapabilities 34 | 35 | armv7 36 | 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /DemoApp/DemoApp/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /DemoApp/DemoApp/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // DemoApp 4 | // 5 | // Created by JPMartha on 2015/12/25. 6 | // Copyright © 2015 JPMartha. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import EggsBenedict 11 | 12 | class ViewController: UIViewController, UIDocumentInteractionControllerDelegate { 13 | 14 | @IBOutlet weak var imageView: UIImageView! 15 | @IBOutlet weak var shareOnInstagramButton: UIButton! 16 | 17 | let sharingFlow = SharingFlow(type: .IGOExclusivegram) 18 | 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | 22 | shareOnInstagramButton.enabled = sharingFlow.hasInstagramApp 23 | } 24 | 25 | @IBAction func shareOnInstagramButtonTapped(sender: UIButton) { 26 | sharingFlow.presentOpenInMenuWithImage(imageView.image, inView: view, documentInteractionDelegate: self) { (sharingFlowResult) -> Void in 27 | switch sharingFlowResult { 28 | case .Success(let imagePath): 29 | print("Success: \(imagePath)") 30 | case let .Failure(imagePath, errorType): 31 | print("ImagePath: \(imagePath), ErrorType: \(errorType)") 32 | } 33 | } 34 | } 35 | 36 | @IBAction func removeTmpButtonTapped(sender: UIButton) { 37 | sharingFlow.removeTemporaryImage { (sharingFlowResult) -> Void in 38 | switch sharingFlowResult { 39 | case .Success(let imagePath): 40 | print("Success: \(imagePath)") 41 | case let .Failure(imagePath, errorType): 42 | print("ImagePath: \(imagePath), ErrorType: \(errorType)") 43 | } 44 | } 45 | } 46 | 47 | // MARK: - UIDocumentInteractionControllerDelegate 48 | 49 | func documentInteractionControllerDidDismissOpenInMenu(controller: UIDocumentInteractionController) { 50 | print(__FUNCTION__) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /DemoApp/DemoApp/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // DemoApp 4 | // 5 | // Created by JPMartha on 2015/12/27. 6 | // Copyright © 2015 JPMartha. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Documentation/ja/README.md: -------------------------------------------------------------------------------- 1 | # EggsBenedict 2 | 3 | [![Build Status](https://travis-ci.org/JPMartha/EggsBenedict.svg)](https://travis-ci.org/JPMartha/EggsBenedict) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [English](https://github.com/JPMartha/EggsBenedict) 4 | 5 | __EggsBenedict__ は Swift で Instagram アプリに画像を渡すためのライブラリです。 6 | 7 | 8 | 9 | このライブラリは Instagram ドキュメントに記載されている手順に従います。 10 | 11 | > __Instagram ドキュメント__ 12 | 13 | > - [Document Interaction](https://www.instagram.com/developer/mobile-sharing/iphone-hooks/#document-interaction) 14 | 15 | ユーザーの iOS デバイス上でカスタム URL スキーム `instagram:// ` を開くことができる場合に次の手順を実行します。 16 | 17 | 1. JPEG 形式で `jpmarthaeggsbenedict` という名前と拡張子 `.ig` または `.igo` を付けて `tmp/` フォルダに書き込みます。 18 | 2. Instagram アプリへコピーするためのメニューを表示します。 19 | 3. 「Instagram にコピー」アイコンをタップすると Instagram アプリが起動してフィルタ画面に遷移します。 20 | 21 | 画像は640ピクセルの正方形で JPEG 形式が最適だとドキュメントに記載されています。 22 | 23 | > 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. 24 | 25 | #### _\- ところでなんで EggsBenedict って名前やねん?_ 26 | 27 | エッグベネディクトが好きだからです😋 28 | 29 | ## 必要条件 30 | 31 | - Swift 2.1 32 | - Xcode 7.2 33 | - iOS 8.0 以降 34 | 35 | ## Xcodeプロジェクトに EggsBenedict.framework を追加 36 | 37 | #### [Carthage](https://github.com/Carthage/Carthage) (オススメ) 38 | 39 | 1. [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile) を作成し、`github "JPMartha/EggsBenedict" ~> 0.9.9` を追記します。 40 | 2. プロジェクトのフォルダで `$ carthage update --platform iOS` を実行します。 41 | 3. TARGETS の「Build Phases」にある「Link Binary With Libraries」の「+」アイコンをクリックして Carthage/Build フォルダから `EggsBenedict.framework` を追加します。 42 | 4. TARGETS の「Build Phases」にある「+」アイコンをクリックして「New Run Script Phase」を選択し Run Script に次の内容を入力します。 43 | ``` 44 | /usr/local/bin/carthage copy-frameworks 45 | ``` 46 | 「Input Files」に EggsBenedict.framework のパスを追加します。 47 | ``` 48 | $(SRCROOT)/Carthage/Build/iOS/EggsBenedict.framework 49 | ``` 50 | このスクリプトは [App Store へ提出時のバグ](http://www.openradar.me/radar?id=6409498411401216) を回避します。 51 | 52 | > This script works around an [App Store submission bug](http://www.openradar.me/radar?id=6409498411401216) triggered by universal binaries and ensures that necessary bitcode-related files are copied when archiving. 53 | 54 | #### [CocoaPods](https://cocoapods.org) 55 | 56 | 1. [Podfile](https://guides.cocoapods.org/using/the-podfile.html) を作成し、次の内容を入力します。 57 | 58 | ``` 59 | use_frameworks! 60 | pod 'EggsBenedict', '~> 0.9.9' 61 | ``` 62 | 63 | 2. プロジェクトのフォルダで `$ pod install` を実行します。 64 | 65 | ## はじめ方 66 | 67 | 1. Xcode プロジェクトの Info.plist に `LSApplicationQueriesSchemes` キーを追加します。 68 | 69 | Key |Type |Value 70 | ------------------------------------|--------|----------- 71 | LSApplicationQueriesSchemes | Array | instagram 72 | 73 | 2. `SharingFlowType` 列挙型のタイプを指定して `SharingFlow` クラスのインスタンスを作成します。 74 | 75 | ```swift 76 | let sharingFlow = SharingFlow(type: .IGOExclusivegram) 77 | ``` 78 | 79 | 詳しくは [SharingFlow クラスリファレンス](./Documentation/SharingFlowClassReference.md) と [SharingFlowType 列挙型](./Documentation/SharingFlowTypeEnumeration.md) を参照してください。 80 | 81 | 3. 作成したインスタンスの `presentOpenInMenuWithImage:inView:` メソッドを呼びます。 82 | 83 | 詳しくは [SharingFlow クラスリファレンス](./Documentation/SharingFlowClassReference.md) を参照してください。 84 | 85 | ## ドキュメント 86 | 87 | - [EggsBenedict フレームワークリファレンス](./Documentation) 88 | 89 | ## ライセンス 90 | 91 | __EggsBenedict__ は [MIT License](LICENSE) の下に提供されています。 92 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EggsBenedict 2 | 3 | [![Build Status](https://travis-ci.org/JPMartha/EggsBenedict.svg)](https://travis-ci.org/JPMartha/EggsBenedict) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [日本語](./Documentation/ja/) 4 | 5 | __EggsBenedict__ is a library for sharing picture with Instagram app written in Swift. 6 | 7 | 8 | 9 | This library is following Instagram's sharing flow. 10 | 11 | > __Instagram's documentation__ 12 | 13 | > - [Document Interaction](https://www.instagram.com/developer/mobile-sharing/iphone-hooks/#document-interaction) 14 | 15 | If the custom URL schemes `instagram://` can be opened direct users on the iOS device, the flow is as follows. 16 | 17 | 1. Save temporary image file named `jpmarthaeggsbenedict` (JPEG format) in `tmp/` directory using the filename extension `.ig` or `.igo`. 18 | 2. Display the menu for copying to Instagram app. 19 | 3. If users tap the "Copy to Instagram" icon, open Instagram app with its filter screen. 20 | 21 | > 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. 22 | 23 | #### _\- By the way, why was it named "EggsBenedict"?_ 24 | 25 | The reason is because I like Eggs Benedict 😋 26 | 27 | ## Availability 28 | 29 | - Swift 2.1 30 | - Xcode 7.2 31 | - iOS 8.0 and later 32 | 33 | ## Adding EggsBenedict.framework to your project 34 | 35 | #### [Carthage](https://github.com/Carthage/Carthage) (preferred) 36 | 37 | 1. Create a [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile), and add `github "JPMartha/EggsBenedict" ~> 0.9.9`. 38 | 2. Run `$ carthage update --platform iOS` in your project directory. 39 | 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. 40 | 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: 41 | ``` 42 | /usr/local/bin/carthage copy-frameworks 43 | ``` 44 | and add the "Input Files" to EggsBenedict.framework: 45 | ``` 46 | $(SRCROOT)/Carthage/Build/iOS/EggsBenedict.framework 47 | ``` 48 | 49 | This script works around an [App Store submission bug](http://www.openradar.me/radar?id=6409498411401216) triggered by universal binaries and ensures that necessary bitcode-related files are copied when archiving. 50 | 51 | #### [CocoaPods](https://cocoapods.org) 52 | 53 | 1. Create a [Podfile](https://guides.cocoapods.org/using/the-podfile.html), and add the following contents: 54 | 55 | ``` 56 | use_frameworks! 57 | pod 'EggsBenedict', '~> 0.9.9' 58 | ``` 59 | 60 | 2. Run `$ pod install` in your project directory. 61 | 62 | ## Getting started 63 | 64 | 1. On your application Info.plist, add `LSApplicationQueriesSchemes` key. 65 | 66 | Key |Type |Value 67 | ------------------------------------|--------|----------- 68 | LSApplicationQueriesSchemes | Array | instagram 69 | 70 | 2. Create an instance of the `SharingFlow` class with the `SharingFlowType` enumeration. 71 | 72 | ```swift 73 | let sharingFlow = SharingFlow(type: .IGOExclusivegram) 74 | ``` 75 | 76 | For more information, see [SharingFlow Class Reference](./Documentation/SharingFlowClassReference.md) and [SharingFlowType Enumeration](./Documentation/SharingFlowTypeEnumeration.md). 77 | 78 | 3. Call the `presentOpenInMenuWithImage:inView:` of the created instance. 79 | 80 | ```swift 81 | sharingFlow.presentOpenInMenuWithImage(YourImage, inView view: YourView) 82 | ``` 83 | 84 | For more information, see [SharingFlow Class Reference](./Documentation/SharingFlowClassReference.md). 85 | 86 | ## Documentation 87 | 88 | - [EggsBenedict Framework Reference](./Documentation) 89 | 90 | ## License 91 | 92 | __EggsBenedict__ is released under the [MIT License](LICENSE). 93 | -------------------------------------------------------------------------------- /EggsBenedict.xcodeproj/xcshareddata/xcschemes/EggsBenedict.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /Documentation/ja/Documentation/SharingFlowClassReference.md: -------------------------------------------------------------------------------- 1 | # SharingFlow クラスリファレンス 2 | 3 | ### SharingFlow クラスのインスタンス作成 4 | 5 | - `init(type:)` 6 | 7 | ##### 宣言 8 | 9 | ```swift 10 | init(type: SharingFlowType) 11 | ``` 12 | 13 | ##### パラメータ 14 | 15 | パラメータ | 説明 16 | -------------|--------------- 17 | _type_ | `SharingFlowType` のタイプ 18 | 19 | 詳しくは [SharingFlowType 列挙型](./SharingFlowTypeEnumeration.md) を参照してください。 20 | 21 | == 22 | 23 | ### メニューの表示 24 | 25 | - `presentOpenInMenuWithImage:inView:` 26 | 27 | Instagram アプリへ画像を渡すためのメニューを表示します。 28 | 29 | ##### 宣言 30 | 31 | ```swift 32 | func presentOpenInMenuWithImage(_ image: UIImage!, inView view: UIView!) 33 | ``` 34 | 35 | ##### ディスカッション 36 | 37 | このメソッドは `delegate` パラメータと `completion` パラメータに `nil` を設定して `presentOpenInMenuWithImage:inView:documentInteractionDelegate:completion:` メソッドを呼びます。 38 | 39 | ##### 必要条件 40 | 41 | 0.9.8 以降で利用できます。 42 | 43 | == 44 | 45 | - `presentOpenInMenuWithImage:inView:documentInteractionDelegate:` 46 | 47 | Instagram アプリへ画像を渡すためのメニューを表示します。 48 | 49 | ##### 宣言 50 | 51 | ```swift 52 | func presentOpenInMenuWithImage(_ image: UIImage!, 53 | inView view: UIView!, 54 | documentInteractionDelegate delegate: UIDocumentInteractionControllerDelegate?) 55 | ``` 56 | 57 | ##### ディスカッション 58 | 59 | このメソッドは `completion` パラメータに `nil` を設定して `presentOpenInMenuWithImage:inView:documentInteractionDelegate:completion:` メソッドを呼びます。 60 | 61 | ##### 必要条件 62 | 63 | 0.9.8 以降で利用できます。 64 | 65 | == 66 | 67 | - `presentOpenInMenuWithImage:inView:completion:` 68 | 69 | Instagram アプリへ画像を渡すためのメニューを表示します。 70 | 71 | ##### 宣言 72 | 73 | ```swift 74 | func presentOpenInMenuWithImage(_ image: UIImage!, 75 | inView view: UIView!, 76 | completion: ((sharingFlowResult: SharingFlowResult) -> Void)?) 77 | ``` 78 | 79 | ##### ディスカッション 80 | 81 | このメソッドは `delegate` パラメータに `nil` を設定して `presentOpenInMenuWithImage:inView:documentInteractionDelegate:completion:` メソッドを呼びます。 82 | 83 | ##### 必要条件 84 | 85 | 0.9.8 以降で利用できます。 86 | 87 | == 88 | 89 | - `presentOpenInMenuWithImage:inView:documentInteractionDelegate:completion:` 90 | 91 | Instagram アプリへ画像を渡すためのメニューを表示します。 92 | 93 | ##### 宣言 94 | 95 | ```swift 96 | func presentOpenInMenuWithImage(_ image: UIImage!, 97 | inView view: UIView!, 98 | documentInteractionDelegate delegate: UIDocumentInteractionControllerDelegate?, 99 | completion: ((sharingFlowResult: SharingFlowResult) -> Void)?) 100 | ``` 101 | 102 | ##### パラメータ 103 | 104 | パラメータ | 説明 105 | --------------|--------------- 106 | _image_ | Instagram アプリに渡す画像です。 107 | _view_ | メニューを表示するビューです。 108 | _delegate_ | Document Interaction の通知を受け取りたい場合はデリゲートです。必要なければ `nil` を指定します。 109 | _completion_ | メニューを表示したあとに実行する完了ハンドラブロックです。必要なければ `nil` を指定します。 110 | 111 | ##### ディスカッション 112 | 113 | このメソッドは `hasInstagramApp` プロパティが `true` を返す場合に実行されます。メインスレッドをブロックしないよう Grand Central Dispatch (GCD) で非同期に実行されます。 114 | まず `tmp`フォルダに一時的な画像ファイルを書き込みます。画像データはバックアップファイルへの書き込みでエラーが発生しないことを確認したうえで指定された名前にリネームされます。画像ファイル名は `SharingFlowType` 列挙型のタイプに応じて `jpmarthaeggsbenedict.ig` または `jpmarthaeggsbenedict.igo` になります。詳しくは [NSData Class Reference](https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/) を参照してください。 115 | 116 | そしてメインスレッドで `UIDocumentInteractionController` クラスのインスタンスの `presentOpenInMenuFromRect:inView:animated:` メソッドを呼びます。 117 | 118 | Document Interaction Controller で表示されたメニューのユーザー操作を把握するデリゲートオブジェクトを実装することができます。詳しくは [UIDocumentInteractionControllerDelegate Protocol Reference](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDocumentInteractionControllerDelegate_protocol/) を参照してください。 119 | 120 | 完了ハンドラは `UIDocumentInteractionController` クラスのインスタンスの `presentOpenInMenuFromRect:inView:animated:` メソッドが呼ばれたあとに呼ばれます。 121 | 122 | > __[UIDocumentInteractionController Class Reference](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDocumentInteractionController_class/)__ 123 | > 124 | > This method displays the options menu asynchronously. The document interaction controller dismisses the menu automatically when the user selects an appropriate option. 125 | 126 | ##### エラー処理の例 127 | 128 | ```swift 129 | sharingFlow.presentOpenInMenuWithImage(YourImage, inView: YourView, documentInteractionDelegate: self) { (sharingFlowResult) -> Void in 130 | switch sharingFlowResult { 131 | case .Success(let imagePath): 132 | print("Success: \(imagePath)") 133 | case let .Failure(imagePath, errorType): 134 | print("ImagePath: \(imagePath), ErrorType: \(errorType)") 135 | } 136 | } 137 | ``` 138 | 139 | == 140 | 141 | ### 画像の削除 142 | 143 | - `removeTemporaryImage` 144 | 145 | `tmp` フォルダに書き込んだ画像を削除します。 146 | 147 | ##### 宣言 148 | 149 | ```swift 150 | func removeTemporaryImage() 151 | ``` 152 | 153 | ##### ディスカッション 154 | 155 | このライブラリは既存ファイルを上書きするため、通常はこのメソッドを使う必要がありません。 156 | 157 | このメソッドは `completion` パラメータに `nil` を設定して `removeTemporaryImage:` メソッドを呼びます。 158 | 159 | ##### 必要条件 160 | 161 | 0.9.8 以降で利用できます。 162 | 163 | == 164 | 165 | - `removeTemporaryImage:` 166 | 167 | `tmp` フォルダに書き込んだ画像を削除します。 168 | 169 | ##### 宣言 170 | 171 | ```swift 172 | func removeTemporaryImage(completionHandler completion: ((sharingFlowResult: SharingFlowResult) -> Void)?) 173 | ``` 174 | 175 | ##### パラメータ 176 | 177 | パラメータ | 説明 178 | --------------|--------------- 179 | _completion_ | 画像を削除したあとに実行する完了ハンドラブロックです。必要なければ `nil` を指定します。 180 | 181 | ##### ディスカッション 182 | 183 | このライブラリは既存ファイルを上書きするため、通常はこのメソッドを使う必要がありません。 184 | 185 | ##### エラー処理の例 186 | 187 | ```swift 188 | sharingFlow.removeTemporaryImage { (sharingFlowResult) -> Void in 189 | switch sharingFlowResult { 190 | case .Success(let imagePath): 191 | print("Success: \(imagePath)") 192 | case let .Failure(imagePath, errorType): 193 | print("ImagePath: \(imagePath), ErrorType: \(errorType)") 194 | } 195 | } 196 | ``` 197 | 198 | == 199 | 200 | ### iOSデバイスの状態 201 | 202 | - `hasInstagramApp` 203 | 204 | iOS デバイスに Instagram アプリがインストールされているかどうかを示す `Bool` 型の値を返します。 205 | 206 | ##### 宣言 207 | 208 | ```swift 209 | var hasInstagramApp: Bool { get } 210 | ``` 211 | 212 | ##### ディスカッション 213 | 214 | `true` を返す場合は iOS デバイスに Instagram アプリが存在し、そうでなければ存在しません。 215 | -------------------------------------------------------------------------------- /DemoApp/DemoApp/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 38 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /Documentation/SharingFlowClassReference.md: -------------------------------------------------------------------------------- 1 | # SharingFlow Class Reference 2 | 3 | ### Creating an Instance 4 | 5 | - `init(type:)` 6 | 7 | ##### Declaration 8 | 9 | ```swift 10 | init(type: SharingFlowType) 11 | ``` 12 | 13 | ##### Parameters 14 | 15 | Parameter | Description 16 | --------------|--------------- 17 | _type_ | A type of `SharingFlowType` 18 | 19 | For more information, see [SharingFlowType Enumeration](./SharingFlowTypeEnumeration.md). 20 | 21 | == 22 | 23 | ### Presenting Menus 24 | 25 | - `presentOpenInMenuWithImage:inView:` 26 | 27 | Present the menu for sending image to Instagram app. 28 | 29 | ##### Declaration 30 | 31 | ```swift 32 | func presentOpenInMenuWithImage(_ image: UIImage!, inView view: UIView!) 33 | ``` 34 | 35 | ##### Discussion 36 | 37 | This method calls the `presentOpenInMenuWithImage:inView:documentInteractionDelegate:completion:` method setting the `delegate` parameter and the `completion` parameter `nil`. 38 | 39 | ##### Availability 40 | 41 | Available in 0.9.8 and later. 42 | 43 | == 44 | 45 | - `presentOpenInMenuWithImage:inView:documentInteractionDelegate:` 46 | 47 | Present the menu for sending image to Instagram app. 48 | 49 | ##### Declaration 50 | 51 | ```swift 52 | func presentOpenInMenuWithImage(_ image: UIImage!, 53 | inView view: UIView!, 54 | documentInteractionDelegate delegate: UIDocumentInteractionControllerDelegate?) 55 | ``` 56 | 57 | ##### Discussion 58 | 59 | This method calls the `presentOpenInMenuWithImage:inView:documentInteractionDelegate:completion:` method setting the `completion` parameter `nil`. 60 | 61 | ##### Availability 62 | 63 | Available in 0.9.8 and later. 64 | 65 | == 66 | 67 | - `presentOpenInMenuWithImage:inView:completion:` 68 | 69 | Present the menu for sending image to Instagram app. 70 | 71 | ##### Declaration 72 | 73 | ```swift 74 | func presentOpenInMenuWithImage(_ image: UIImage!, 75 | inView view: UIView!, 76 | completion: ((sharingFlowResult: SharingFlowResult) -> Void)?) 77 | ``` 78 | 79 | ##### Discussion 80 | 81 | This method calls the `presentOpenInMenuWithImage:inView:documentInteractionDelegate:completion:` method setting the `delegate` parameter `nil`. 82 | 83 | ##### Availability 84 | 85 | Available in 0.9.8 and later. 86 | 87 | == 88 | 89 | - `presentOpenInMenuWithImage:inView:documentInteractionDelegate:completion:` 90 | 91 | Present the menu for sending image to Instagram app. 92 | 93 | ##### Declaration 94 | 95 | ```swift 96 | func presentOpenInMenuWithImage(_ image: UIImage!, 97 | inView view: UIView!, 98 | documentInteractionDelegate delegate: UIDocumentInteractionControllerDelegate?, 99 | completion: ((sharingFlowResult: SharingFlowResult) -> Void)?) 100 | ``` 101 | 102 | ##### Parameters 103 | 104 | Parameter | Description 105 | --------------|--------------- 106 | _image_ | The image for sending to Instagram app. 107 | _view_ | The view from which to display the menu. 108 | _delegate_ | The delegate you want to receive document interaction notifications. You may specify `nil` for this parameter. 109 | _completion_ | The block to execute after the presenting menu. You may specify `nil` for this parameter. 110 | 111 | ##### Discussion 112 | 113 | This method is invoked if the `hasInstagramApp` property is `true`. To avoid blocking the main thread, it is invoked asynchronously with Grand Central Dispatch (GCD). 114 | 115 | First, write a temporary image file in `tmp/` directory. The image data is written to a backup file, and then—assuming no errors occur—the backup file is renamed to the name specified by path. The image file is named `jpmarthaeggsbenedict.ig` or `jpmarthaeggsbenedict.igo` according to the `SharingFlowType` enumeration. For more information, see [NSData Class Reference](https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/). 116 | 117 | Then, call the `presentOpenInMenuFromRect:inView:animated:` method of an instance of the `UIDocumentInteractionController` class in main thread. 118 | 119 | You can implement a delegate object to track user interactions with menu items displayed by the document interaction controller. For more information, see [UIDocumentInteractionControllerDelegate Protocol Reference](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDocumentInteractionControllerDelegate_protocol/). 120 | 121 | The completion handler is called after the `presentOpenInMenuFromRect:inView:animated:` method is called of an instance of the `UIDocumentInteractionController` class. 122 | 123 | > __[UIDocumentInteractionController Class Reference](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDocumentInteractionController_class/)__ 124 | > 125 | > This method displays the options menu asynchronously. The document interaction controller dismisses the menu automatically when the user selects an appropriate option. 126 | 127 | ##### Handling Errors Example 128 | 129 | ```swift 130 | sharingFlow.presentOpenInMenuWithImage(YourImage, inView: YourView, documentInteractionDelegate: self) { (sharingFlowResult) -> Void in 131 | switch sharingFlowResult { 132 | case .Success(let imagePath): 133 | print("Success: \(imagePath)") 134 | case let .Failure(imagePath, errorType): 135 | print("ImagePath: \(imagePath), ErrorType: \(errorType)") 136 | } 137 | } 138 | ``` 139 | 140 | == 141 | 142 | ### Removing Temporary Image 143 | 144 | - `removeTemporaryImage` 145 | 146 | Remove temporary image file in `tmp/` directory. 147 | 148 | ##### Declaration 149 | 150 | ```swift 151 | func removeTemporaryImage() 152 | ``` 153 | 154 | ##### Discussion 155 | 156 | It is not usually necessary to use this method because this library overwrites an existing file. 157 | 158 | This method calls the `removeTemporaryImage:` method setting the `completion` parameter `nil`. 159 | 160 | ##### Availability 161 | 162 | Available in 0.9.8 and later. 163 | 164 | == 165 | 166 | - `removeTemporaryImage:` 167 | 168 | Remove temporary image file in `tmp/` directory. 169 | 170 | ##### Declaration 171 | 172 | ```swift 173 | func removeTemporaryImage(completionHandler completion: ((sharingFlowResult: SharingFlowResult) -> Void)?) 174 | ``` 175 | 176 | ##### Parameters 177 | 178 | Parameter | Description 179 | --------------|--------------- 180 | _completion_ | The block to execute after the removing temporary image finishes. You may specify `nil` for this parameter. 181 | 182 | ##### Discussion 183 | 184 | It is not usually necessary to use this method because this library overwrites an existing file. 185 | 186 | ##### Handling Errors Example 187 | 188 | ```swift 189 | sharingFlow.removeTemporaryImage { (sharingFlowResult) -> Void in 190 | switch sharingFlowResult { 191 | case .Success(let imagePath): 192 | print("Success: \(imagePath)") 193 | case let .Failure(imagePath, errorType): 194 | print("ImagePath: \(imagePath), ErrorType: \(errorType)") 195 | } 196 | } 197 | ``` 198 | 199 | == 200 | 201 | ### Accessing the Device Attributes 202 | 203 | - `hasInstagramApp` 204 | 205 | Returns a Boolean value indicating whether or not Instagram app is installed on the iOS device. 206 | 207 | ##### Declaration 208 | 209 | ```swift 210 | var hasInstagramApp: Bool { get } 211 | ``` 212 | 213 | ##### Discussion 214 | 215 | If `true`, the iOS device has Instagram app; otherwise it does not. 216 | -------------------------------------------------------------------------------- /EggsBenedict/SharingFlow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SharingFlow.swift 3 | // EggsBenedict 4 | // 5 | // Created by JPMartha on 2015/12/26. 6 | // Copyright © 2015 JPMartha. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private protocol InstagramSharingFlow { 12 | var filenameExtension: String! { get } 13 | var UTI: String! { get } 14 | var hasInstagramApp: Bool { get } 15 | init(type: SharingFlowType) 16 | func writeTemporaryImage(image: UIImage!) throws -> Bool 17 | func presentOpenInMenuWithImage(image: UIImage!, inView view: UIView!, documentInteractionDelegate delegate: UIDocumentInteractionControllerDelegate?, completion: ((sharingFlowResult: SharingFlowResult) -> Void)?) 18 | } 19 | 20 | public final class SharingFlow: InstagramSharingFlow { 21 | public var filenameExtension: String! 22 | public var UTI: String! 23 | internal var imagePath: String! 24 | lazy private var documentInteractionController = UIDocumentInteractionController() 25 | 26 | public init(type: SharingFlowType) { 27 | switch type { 28 | case .IGPhoto: 29 | self.filenameExtension = ".ig" 30 | self.UTI = "com.instagram.photo" 31 | case .IGOExclusivegram: 32 | self.filenameExtension = ".igo" 33 | self.UTI = "com.instagram.exclusivegram" 34 | } 35 | let temporaryDirectory = NSTemporaryDirectory() as NSString 36 | self.imagePath = temporaryDirectory.stringByAppendingPathComponent("jpmarthaeggsbenedict\(filenameExtension)") 37 | } 38 | 39 | /** 40 | - seealso: [SharingFlow Class Reference](https://github.com/JPMartha/EggsBenedict/blob/develop/Documentation/SharingFlowClassReference.md) 41 | - returns: A Boolean value indicating whether or not Instagram app is installed on the iOS device. 42 | */ 43 | public var hasInstagramApp: Bool { 44 | return UIApplication.sharedApplication().canOpenURL(NSURL(string: "instagram://")!) 45 | } 46 | 47 | internal func writeTemporaryImage(image: UIImage!) throws -> Bool { 48 | guard let imageData = UIImageJPEGRepresentation(image, 1.0) else { 49 | throw SharingFlowError.ImageJPEGRepresentationFailed 50 | } 51 | 52 | return imageData.writeToFile(imagePath, atomically: true) 53 | } 54 | 55 | /** 56 | Present the menu for sending image to Instagram app. 57 | - seealso: [SharingFlow Class Reference](https://github.com/JPMartha/EggsBenedict/blob/develop/Documentation/SharingFlowClassReference.md) 58 | - Parameters: 59 | - image: The image for sending to Instagram app. 60 | - view: The view from which to display the menu. 61 | */ 62 | public func presentOpenInMenuWithImage(image: UIImage!, inView view: UIView!) { 63 | presentOpenInMenuWithImage(image, inView: view, documentInteractionDelegate: nil, completion: nil) 64 | } 65 | 66 | /** 67 | Present the menu for sending image to Instagram app. 68 | - seealso: [SharingFlow Class Reference](https://github.com/JPMartha/EggsBenedict/blob/develop/Documentation/SharingFlowClassReference.md) 69 | - Parameters: 70 | - image: The image for sending to Instagram app. 71 | - view: The view from which to display the menu. 72 | - delegate: The delegate you want to receive document interaction notifications. You may specify `nil` for this parameter. 73 | */ 74 | public func presentOpenInMenuWithImage(image: UIImage!, inView view: UIView!, documentInteractionDelegate delegate: UIDocumentInteractionControllerDelegate?) { 75 | presentOpenInMenuWithImage(image, inView: view, documentInteractionDelegate: delegate, completion: nil) 76 | } 77 | 78 | /** 79 | Present the menu for sending image to Instagram app. 80 | - seealso: [SharingFlow Class Reference](https://github.com/JPMartha/EggsBenedict/blob/develop/Documentation/SharingFlowClassReference.md) 81 | - Parameters: 82 | - image: The image for sending to Instagram app. 83 | - view: The view from which to display the menu. 84 | - completion: The block to execute after the presenting menu. You may specify `nil` for this parameter. 85 | */ 86 | public func presentOpenInMenuWithImage(image: UIImage!, inView view: UIView!, completion: ((sharingFlowResult: SharingFlowResult) -> Void)?) { 87 | presentOpenInMenuWithImage(image, inView: view, documentInteractionDelegate: nil, completion: completion) 88 | } 89 | 90 | /** 91 | Present the menu for sending image to Instagram app. 92 | - seealso: [SharingFlow Class Reference](https://github.com/JPMartha/EggsBenedict/blob/develop/Documentation/SharingFlowClassReference.md) 93 | - Parameters: 94 | - image: The image for sending to Instagram app. 95 | - view: The view from which to display the menu. 96 | - delegate: The delegate you want to receive document interaction notifications. You may specify `nil` for this parameter. 97 | - completion: The block to execute after the presenting menu. You may specify `nil` for this parameter. 98 | */ 99 | public func presentOpenInMenuWithImage(image: UIImage!, inView view: UIView!, documentInteractionDelegate delegate: UIDocumentInteractionControllerDelegate?, completion: ((sharingFlowResult: SharingFlowResult) -> Void)?) { 100 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), { 101 | guard self.hasInstagramApp else { 102 | completion?(sharingFlowResult: .Failure(self.imagePath, SharingFlowError.NotFoundInstagramApp)) 103 | return 104 | } 105 | 106 | guard let UTI = self.UTI else { 107 | completion?(sharingFlowResult: .Failure(self.imagePath, SharingFlowError.UTIisEmpty)) 108 | return 109 | } 110 | 111 | let result: Bool 112 | do { 113 | result = try self.writeTemporaryImage(image) 114 | } catch let errorType { 115 | completion?(sharingFlowResult: .Failure(self.imagePath, errorType)) 116 | return 117 | } 118 | 119 | guard result else { 120 | completion?(sharingFlowResult: .Failure(self.imagePath, SharingFlowError.WriteToFileFailed)) 121 | return 122 | } 123 | 124 | self.documentInteractionController.URL = NSURL.fileURLWithPath(self.imagePath) 125 | self.documentInteractionController.UTI = UTI 126 | self.documentInteractionController.delegate = delegate 127 | dispatch_async(dispatch_get_main_queue(), { 128 | self.documentInteractionController.presentOpenInMenuFromRect( 129 | view.bounds, 130 | inView: view, 131 | animated: true 132 | ) 133 | completion?(sharingFlowResult: .Success(self.imagePath)) 134 | }) 135 | }) 136 | } 137 | 138 | /** 139 | Remove temporary image file in `tmp/" directory. 140 | - seealso: [SharingFlow Class Reference](https://github.com/JPMartha/EggsBenedict/blob/develop/Documentation/SharingFlowClassReference.md) 141 | */ 142 | public func removeTemporaryImage() { 143 | removeTemporaryImage(completionHandler: nil) 144 | } 145 | 146 | /** 147 | Remove temporary image file in "tmp/" directory. 148 | - Parameter completion: The block to execute after the removing temporary image file finishes. You may specify nil for this parameter. 149 | - seealso: [SharingFlow Class Reference](https://github.com/JPMartha/EggsBenedict/blob/develop/Documentation/SharingFlowClassReference.md) 150 | */ 151 | public func removeTemporaryImage(completionHandler completion: ((sharingFlowResult: SharingFlowResult) -> Void)?) { 152 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), { 153 | guard !self.imagePath.isEmpty else { 154 | completion?(sharingFlowResult: .Failure(self.imagePath, SharingFlowError.ImagePathIsEmpty)) 155 | return 156 | } 157 | 158 | do { 159 | try NSFileManager().removeItemAtPath(self.imagePath) 160 | } catch let errorType { 161 | completion?(sharingFlowResult: .Failure(self.imagePath, errorType)) 162 | return 163 | } 164 | completion?(sharingFlowResult: .Success(self.imagePath)) 165 | }) 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /EggsBenedictTests/EggsBenedictTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EggsBenedictTests.swift 3 | // EggsBenedictTests 4 | // 5 | // Created by JPMartha on 2015/12/28. 6 | // Copyright © 2015 JPMartha. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import EggsBenedict 11 | 12 | class EggsBenedictTests: XCTestCase { 13 | 14 | func testInitSharingFlowIGPhoto() { 15 | let sharingFlow = SharingFlow(type: .IGPhoto) 16 | XCTAssertEqual(sharingFlow.filenameExtension, ".ig") 17 | XCTAssertEqual(sharingFlow.UTI,"com.instagram.photo") 18 | let temporaryDirectory = NSTemporaryDirectory() as NSString 19 | XCTAssertEqual(sharingFlow.imagePath, temporaryDirectory.stringByAppendingPathComponent("jpmarthaeggsbenedict.ig")) 20 | } 21 | 22 | func testInitSharingFlowIGOExclusivegram() { 23 | let sharingFlow = SharingFlow(type: .IGOExclusivegram) 24 | XCTAssertEqual(sharingFlow.filenameExtension,".igo") 25 | XCTAssertEqual(sharingFlow.UTI, "com.instagram.exclusivegram") 26 | let temporaryDirectory = NSTemporaryDirectory() as NSString 27 | XCTAssertEqual(sharingFlow.imagePath, temporaryDirectory.stringByAppendingPathComponent("jpmarthaeggsbenedict.igo")) 28 | } 29 | 30 | func testHasInstagramApp() { 31 | let result = UIApplication.sharedApplication().canOpenURL(NSURL(string: "instagram://")!) 32 | let sharingFlow = SharingFlow(type: .IGOExclusivegram) 33 | XCTAssertEqual(sharingFlow.hasInstagramApp, result) 34 | } 35 | 36 | func testWriteTemporaryImageIGPhoto() { 37 | guard let image = UIImage(named: "EggsBenedict.jpg", inBundle: NSBundle(forClass: self.dynamicType), compatibleWithTraitCollection: nil) else { 38 | XCTFail("Image is nil.") 39 | return 40 | } 41 | 42 | let sharingFlow = SharingFlow(type: .IGPhoto) 43 | do { 44 | try sharingFlow.writeTemporaryImage(image) 45 | } catch let error as NSError { 46 | XCTFail(error.debugDescription) 47 | return 48 | } 49 | let temporaryDirectory = NSTemporaryDirectory() as NSString 50 | let testImagePath = temporaryDirectory.stringByAppendingPathComponent("jpmarthaeggsbenedict.ig") 51 | XCTAssertTrue(NSFileManager.defaultManager().fileExistsAtPath(testImagePath), testImagePath) 52 | } 53 | 54 | func testWriteTemporaryImageIGOExclusivegram() { 55 | guard let image = UIImage(named: "EggsBenedict.jpg", inBundle: NSBundle(forClass: self.dynamicType), compatibleWithTraitCollection: nil) else { 56 | XCTFail("Image is nil.") 57 | return 58 | } 59 | 60 | let sharingFlow = SharingFlow(type: .IGOExclusivegram) 61 | do { 62 | try sharingFlow.writeTemporaryImage(image) 63 | } catch let error as NSError { 64 | XCTFail(error.debugDescription) 65 | return 66 | } 67 | let temporaryDirectory = NSTemporaryDirectory() as NSString 68 | let testImagePath = temporaryDirectory.stringByAppendingPathComponent("jpmarthaeggsbenedict.igo") 69 | XCTAssertTrue(NSFileManager.defaultManager().fileExistsAtPath(testImagePath), testImagePath) 70 | } 71 | 72 | func testWriteTemporaryImageNil() { 73 | let sharingFlow = SharingFlow(type: .IGOExclusivegram) 74 | do { 75 | try sharingFlow.writeTemporaryImage(UIImage()) 76 | } catch let sharingFlowError as SharingFlowError { 77 | XCTAssertEqual(sharingFlowError, SharingFlowError.ImageJPEGRepresentationFailed) 78 | return 79 | } catch let error as NSError { 80 | XCTFail(error.debugDescription) 81 | return 82 | } 83 | XCTFail("An unknown error occurred.") 84 | } 85 | 86 | func testPresentOpenInMenuWithImageInViewCompletion() { 87 | let sharingFlow = SharingFlow(type: .IGOExclusivegram) 88 | sharingFlow.presentOpenInMenuWithImage(UIImage(), inView: UIView()) { (sharingFlowResult) -> Void in 89 | switch sharingFlowResult { 90 | case .Success(_): 91 | XCTFail("An unknown error occurred.") 92 | case let .Failure(_, sharingFlowError as SharingFlowError): 93 | XCTAssertEqual(sharingFlowError, SharingFlowError.NotFoundInstagramApp) 94 | case let .Failure(_, error as NSError): 95 | XCTFail(error.debugDescription) 96 | default: 97 | XCTFail("An unknown error occurred.") 98 | } 99 | } 100 | } 101 | 102 | func testPresentOpenInMenuWithImageInViewDocumentInteractionDelegateCompletion() { 103 | let sharingFlow = SharingFlow(type: .IGOExclusivegram) 104 | sharingFlow.presentOpenInMenuWithImage(UIImage(), inView: UIView(), documentInteractionDelegate: nil) { (sharingFlowResult) -> Void in 105 | switch sharingFlowResult { 106 | case .Success(_): 107 | XCTFail() 108 | case let .Failure(_, sharingFlowError as SharingFlowError): 109 | XCTAssertEqual(sharingFlowError, SharingFlowError.NotFoundInstagramApp) 110 | case let .Failure(_, error as NSError): 111 | XCTFail(error.debugDescription) 112 | default: 113 | XCTFail("An unknown error occurred.") 114 | } 115 | } 116 | } 117 | 118 | func testRemoveTemporaryImageIG() { 119 | guard let image = UIImage(named: "EggsBenedict.jpg", inBundle: NSBundle(forClass: self.dynamicType), compatibleWithTraitCollection: nil) else { 120 | XCTFail("Image is nil.") 121 | return 122 | } 123 | 124 | guard let imageData = UIImageJPEGRepresentation(image, 1.0) else { 125 | XCTFail(SharingFlowError.ImageJPEGRepresentationFailed.debugDescription) 126 | return 127 | } 128 | 129 | let temporaryDirectory = NSTemporaryDirectory() as NSString 130 | let testImagePath = temporaryDirectory.stringByAppendingPathComponent("jpmarthaeggsbenedict.ig") 131 | guard imageData.writeToFile(testImagePath, atomically: true) else { 132 | XCTFail(SharingFlowError.WriteToFileFailed.debugDescription) 133 | return 134 | } 135 | 136 | let sharingFlow = SharingFlow.init(type: .IGPhoto) 137 | sharingFlow.removeTemporaryImage { (sharingFlowResult) -> Void in 138 | XCTAssertFalse(NSFileManager.defaultManager().fileExistsAtPath(testImagePath), testImagePath) 139 | } 140 | } 141 | 142 | func testRemoveTemporaryImageIGO() { 143 | guard let image = UIImage(named: "EggsBenedict.jpg", inBundle: NSBundle(forClass: self.dynamicType), compatibleWithTraitCollection: nil) else { 144 | XCTFail("Image is nil.") 145 | return 146 | } 147 | 148 | guard let imageData = UIImageJPEGRepresentation(image, 1.0) else { 149 | XCTFail(SharingFlowError.ImageJPEGRepresentationFailed.debugDescription) 150 | return 151 | } 152 | 153 | let temporaryDirectory = NSTemporaryDirectory() as NSString 154 | let testImagePath = temporaryDirectory.stringByAppendingPathComponent("jpmarthaeggsbenedict.igo") 155 | guard imageData.writeToFile(testImagePath, atomically: true) else { 156 | XCTFail(SharingFlowError.WriteToFileFailed.debugDescription) 157 | return 158 | } 159 | 160 | let sharingFlow = SharingFlow.init(type: .IGOExclusivegram) 161 | sharingFlow.removeTemporaryImage { (sharingFlowResult) -> Void in 162 | XCTAssertFalse(NSFileManager.defaultManager().fileExistsAtPath(testImagePath), testImagePath) 163 | } 164 | } 165 | 166 | func testSharingFlowErrorDebugDescriptionNotFoundInstagramApp() { 167 | XCTAssertEqual(SharingFlowError.NotFoundInstagramApp.debugDescription, 168 | "Not found Instagram app.") 169 | } 170 | 171 | func testSharingFlowErrorDebugDescriptionUTIisEmpty() { 172 | XCTAssertEqual(SharingFlowError.UTIisEmpty.debugDescription, 173 | "UTI is empty.") 174 | } 175 | 176 | func testSharingFlowErrorDebugDescriptionImageJPEGRepresentationFailed() { 177 | XCTAssertEqual(SharingFlowError.ImageJPEGRepresentationFailed.debugDescription, 178 | "\"UIImageJPEGRepresentation::\" method failed.") 179 | } 180 | 181 | func testSharingFlowErrorDebugDescriptionWriteToFileFailed() { 182 | XCTAssertEqual(SharingFlowError.WriteToFileFailed.debugDescription, 183 | "\"writeToFile:atomically:\" method failed.") 184 | } 185 | 186 | func testSharingFlowErrorDebugDescriptionImagePathIsEmpty() { 187 | XCTAssertEqual(SharingFlowError.ImagePathIsEmpty.debugDescription, 188 | "ImagePath is empty.") 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /DemoApp/DemoApp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5CACDDBC1C3F8ED2005F9D49 /* EggsBenedict.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CACDDBB1C3F8ED2005F9D49 /* EggsBenedict.framework */; }; 11 | 5CACDDBE1C3F8F46005F9D49 /* EggsBenedict.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5CACDDBB1C3F8ED2005F9D49 /* EggsBenedict.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 12 | 5CF153681C3F0F6A0004411D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF153601C3F0F6A0004411D /* AppDelegate.swift */; }; 13 | 5CF153691C3F0F6A0004411D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5CF153611C3F0F6A0004411D /* Assets.xcassets */; }; 14 | 5CF1536A1C3F0F6A0004411D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5CF153631C3F0F6A0004411D /* LaunchScreen.storyboard */; }; 15 | 5CF1536B1C3F0F6A0004411D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5CF153651C3F0F6A0004411D /* Main.storyboard */; }; 16 | 5CF1536C1C3F0F6A0004411D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF153671C3F0F6A0004411D /* ViewController.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | 5CACDDBD1C3F8F3A005F9D49 /* CopyFiles */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | 5CACDDBE1C3F8F46005F9D49 /* EggsBenedict.framework in CopyFiles */, 27 | ); 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXCopyFilesBuildPhase section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 5CACDDBB1C3F8ED2005F9D49 /* EggsBenedict.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EggsBenedict.framework; path = "../../Library/Developer/Xcode/DerivedData/EggsBenedict-avpdwokamsboahflmcfmhfjatpxj/Build/Products/Debug-iphoneos/EggsBenedict.framework"; sourceTree = ""; }; 34 | 5CF1533C1C3F0EC60004411D /* DemoApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DemoApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 5CF1534B1C3F0EC60004411D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36 | 5CF153601C3F0F6A0004411D /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 5CF153611C3F0F6A0004411D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 38 | 5CF153641C3F0F6A0004411D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = LaunchScreen.storyboard; sourceTree = ""; }; 39 | 5CF153661C3F0F6A0004411D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Main.storyboard; sourceTree = ""; }; 40 | 5CF153671C3F0F6A0004411D /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | 5CF153391C3F0EC60004411D /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | 5CACDDBC1C3F8ED2005F9D49 /* EggsBenedict.framework in Frameworks */, 49 | ); 50 | runOnlyForDeploymentPostprocessing = 0; 51 | }; 52 | /* End PBXFrameworksBuildPhase section */ 53 | 54 | /* Begin PBXGroup section */ 55 | 5CF153331C3F0EC60004411D = { 56 | isa = PBXGroup; 57 | children = ( 58 | 5CACDDBB1C3F8ED2005F9D49 /* EggsBenedict.framework */, 59 | 5CF1533E1C3F0EC60004411D /* DemoApp */, 60 | 5CF1533D1C3F0EC60004411D /* Products */, 61 | ); 62 | sourceTree = ""; 63 | }; 64 | 5CF1533D1C3F0EC60004411D /* Products */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 5CF1533C1C3F0EC60004411D /* DemoApp.app */, 68 | ); 69 | name = Products; 70 | sourceTree = ""; 71 | }; 72 | 5CF1533E1C3F0EC60004411D /* DemoApp */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 5CF153601C3F0F6A0004411D /* AppDelegate.swift */, 76 | 5CF153671C3F0F6A0004411D /* ViewController.swift */, 77 | 5CF153611C3F0F6A0004411D /* Assets.xcassets */, 78 | 5CF153621C3F0F6A0004411D /* Base.lproj */, 79 | 5CF1534B1C3F0EC60004411D /* Info.plist */, 80 | ); 81 | path = DemoApp; 82 | sourceTree = ""; 83 | }; 84 | 5CF153621C3F0F6A0004411D /* Base.lproj */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 5CF153631C3F0F6A0004411D /* LaunchScreen.storyboard */, 88 | 5CF153651C3F0F6A0004411D /* Main.storyboard */, 89 | ); 90 | path = Base.lproj; 91 | sourceTree = ""; 92 | }; 93 | /* End PBXGroup section */ 94 | 95 | /* Begin PBXNativeTarget section */ 96 | 5CF1533B1C3F0EC60004411D /* DemoApp */ = { 97 | isa = PBXNativeTarget; 98 | buildConfigurationList = 5CF1534E1C3F0EC60004411D /* Build configuration list for PBXNativeTarget "DemoApp" */; 99 | buildPhases = ( 100 | 5CF153381C3F0EC60004411D /* Sources */, 101 | 5CF153391C3F0EC60004411D /* Frameworks */, 102 | 5CF1533A1C3F0EC60004411D /* Resources */, 103 | 5CACDDBD1C3F8F3A005F9D49 /* CopyFiles */, 104 | ); 105 | buildRules = ( 106 | ); 107 | dependencies = ( 108 | ); 109 | name = DemoApp; 110 | productName = DemoApp; 111 | productReference = 5CF1533C1C3F0EC60004411D /* DemoApp.app */; 112 | productType = "com.apple.product-type.application"; 113 | }; 114 | /* End PBXNativeTarget section */ 115 | 116 | /* Begin PBXProject section */ 117 | 5CF153341C3F0EC60004411D /* Project object */ = { 118 | isa = PBXProject; 119 | attributes = { 120 | LastSwiftUpdateCheck = 0720; 121 | LastUpgradeCheck = 0720; 122 | ORGANIZATIONNAME = JPMartha; 123 | TargetAttributes = { 124 | 5CF1533B1C3F0EC60004411D = { 125 | CreatedOnToolsVersion = 7.2; 126 | }; 127 | }; 128 | }; 129 | buildConfigurationList = 5CF153371C3F0EC60004411D /* Build configuration list for PBXProject "DemoApp" */; 130 | compatibilityVersion = "Xcode 3.2"; 131 | developmentRegion = English; 132 | hasScannedForEncodings = 0; 133 | knownRegions = ( 134 | en, 135 | Base, 136 | ); 137 | mainGroup = 5CF153331C3F0EC60004411D; 138 | productRefGroup = 5CF1533D1C3F0EC60004411D /* Products */; 139 | projectDirPath = ""; 140 | projectRoot = ""; 141 | targets = ( 142 | 5CF1533B1C3F0EC60004411D /* DemoApp */, 143 | ); 144 | }; 145 | /* End PBXProject section */ 146 | 147 | /* Begin PBXResourcesBuildPhase section */ 148 | 5CF1533A1C3F0EC60004411D /* Resources */ = { 149 | isa = PBXResourcesBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | 5CF1536B1C3F0F6A0004411D /* Main.storyboard in Resources */, 153 | 5CF153691C3F0F6A0004411D /* Assets.xcassets in Resources */, 154 | 5CF1536A1C3F0F6A0004411D /* LaunchScreen.storyboard in Resources */, 155 | ); 156 | runOnlyForDeploymentPostprocessing = 0; 157 | }; 158 | /* End PBXResourcesBuildPhase section */ 159 | 160 | /* Begin PBXSourcesBuildPhase section */ 161 | 5CF153381C3F0EC60004411D /* Sources */ = { 162 | isa = PBXSourcesBuildPhase; 163 | buildActionMask = 2147483647; 164 | files = ( 165 | 5CF1536C1C3F0F6A0004411D /* ViewController.swift in Sources */, 166 | 5CF153681C3F0F6A0004411D /* AppDelegate.swift in Sources */, 167 | ); 168 | runOnlyForDeploymentPostprocessing = 0; 169 | }; 170 | /* End PBXSourcesBuildPhase section */ 171 | 172 | /* Begin PBXVariantGroup section */ 173 | 5CF153631C3F0F6A0004411D /* LaunchScreen.storyboard */ = { 174 | isa = PBXVariantGroup; 175 | children = ( 176 | 5CF153641C3F0F6A0004411D /* Base */, 177 | ); 178 | name = LaunchScreen.storyboard; 179 | sourceTree = ""; 180 | }; 181 | 5CF153651C3F0F6A0004411D /* Main.storyboard */ = { 182 | isa = PBXVariantGroup; 183 | children = ( 184 | 5CF153661C3F0F6A0004411D /* Base */, 185 | ); 186 | name = Main.storyboard; 187 | sourceTree = ""; 188 | }; 189 | /* End PBXVariantGroup section */ 190 | 191 | /* Begin XCBuildConfiguration section */ 192 | 5CF1534C1C3F0EC60004411D /* Debug */ = { 193 | isa = XCBuildConfiguration; 194 | buildSettings = { 195 | ALWAYS_SEARCH_USER_PATHS = NO; 196 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 197 | CLANG_CXX_LIBRARY = "libc++"; 198 | CLANG_ENABLE_MODULES = YES; 199 | CLANG_ENABLE_OBJC_ARC = YES; 200 | CLANG_WARN_BOOL_CONVERSION = YES; 201 | CLANG_WARN_CONSTANT_CONVERSION = YES; 202 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 203 | CLANG_WARN_EMPTY_BODY = YES; 204 | CLANG_WARN_ENUM_CONVERSION = YES; 205 | CLANG_WARN_INT_CONVERSION = YES; 206 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 207 | CLANG_WARN_UNREACHABLE_CODE = YES; 208 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 209 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 210 | COPY_PHASE_STRIP = NO; 211 | DEBUG_INFORMATION_FORMAT = dwarf; 212 | ENABLE_STRICT_OBJC_MSGSEND = YES; 213 | ENABLE_TESTABILITY = YES; 214 | GCC_C_LANGUAGE_STANDARD = gnu99; 215 | GCC_DYNAMIC_NO_PIC = NO; 216 | GCC_NO_COMMON_BLOCKS = YES; 217 | GCC_OPTIMIZATION_LEVEL = 0; 218 | GCC_PREPROCESSOR_DEFINITIONS = ( 219 | "DEBUG=1", 220 | "$(inherited)", 221 | ); 222 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 223 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 224 | GCC_WARN_UNDECLARED_SELECTOR = YES; 225 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 226 | GCC_WARN_UNUSED_FUNCTION = YES; 227 | GCC_WARN_UNUSED_VARIABLE = YES; 228 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 229 | MTL_ENABLE_DEBUG_INFO = YES; 230 | ONLY_ACTIVE_ARCH = YES; 231 | SDKROOT = iphoneos; 232 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 233 | }; 234 | name = Debug; 235 | }; 236 | 5CF1534D1C3F0EC60004411D /* Release */ = { 237 | isa = XCBuildConfiguration; 238 | buildSettings = { 239 | ALWAYS_SEARCH_USER_PATHS = NO; 240 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 241 | CLANG_CXX_LIBRARY = "libc++"; 242 | CLANG_ENABLE_MODULES = YES; 243 | CLANG_ENABLE_OBJC_ARC = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_CONSTANT_CONVERSION = YES; 246 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 247 | CLANG_WARN_EMPTY_BODY = YES; 248 | CLANG_WARN_ENUM_CONVERSION = YES; 249 | CLANG_WARN_INT_CONVERSION = YES; 250 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 251 | CLANG_WARN_UNREACHABLE_CODE = YES; 252 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 253 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 254 | COPY_PHASE_STRIP = NO; 255 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 256 | ENABLE_NS_ASSERTIONS = NO; 257 | ENABLE_STRICT_OBJC_MSGSEND = YES; 258 | GCC_C_LANGUAGE_STANDARD = gnu99; 259 | GCC_NO_COMMON_BLOCKS = YES; 260 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 261 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 262 | GCC_WARN_UNDECLARED_SELECTOR = YES; 263 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 264 | GCC_WARN_UNUSED_FUNCTION = YES; 265 | GCC_WARN_UNUSED_VARIABLE = YES; 266 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 267 | MTL_ENABLE_DEBUG_INFO = NO; 268 | SDKROOT = iphoneos; 269 | VALIDATE_PRODUCT = YES; 270 | }; 271 | name = Release; 272 | }; 273 | 5CF1534F1C3F0EC60004411D /* Debug */ = { 274 | isa = XCBuildConfiguration; 275 | buildSettings = { 276 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 277 | CLANG_ENABLE_MODULES = YES; 278 | FRAMEWORK_SEARCH_PATHS = ""; 279 | INFOPLIST_FILE = DemoApp/Info.plist; 280 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 281 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 282 | LIBRARY_SEARCH_PATHS = ""; 283 | PRODUCT_BUNDLE_IDENTIFIER = jp.martha.DemoApp; 284 | PRODUCT_NAME = "$(TARGET_NAME)"; 285 | SWIFT_INCLUDE_PATHS = ""; 286 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 287 | }; 288 | name = Debug; 289 | }; 290 | 5CF153501C3F0EC60004411D /* Release */ = { 291 | isa = XCBuildConfiguration; 292 | buildSettings = { 293 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 294 | CLANG_ENABLE_MODULES = YES; 295 | FRAMEWORK_SEARCH_PATHS = ""; 296 | INFOPLIST_FILE = DemoApp/Info.plist; 297 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 298 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 299 | LIBRARY_SEARCH_PATHS = ""; 300 | PRODUCT_BUNDLE_IDENTIFIER = jp.martha.DemoApp; 301 | PRODUCT_NAME = "$(TARGET_NAME)"; 302 | SWIFT_INCLUDE_PATHS = ""; 303 | }; 304 | name = Release; 305 | }; 306 | /* End XCBuildConfiguration section */ 307 | 308 | /* Begin XCConfigurationList section */ 309 | 5CF153371C3F0EC60004411D /* Build configuration list for PBXProject "DemoApp" */ = { 310 | isa = XCConfigurationList; 311 | buildConfigurations = ( 312 | 5CF1534C1C3F0EC60004411D /* Debug */, 313 | 5CF1534D1C3F0EC60004411D /* Release */, 314 | ); 315 | defaultConfigurationIsVisible = 0; 316 | defaultConfigurationName = Release; 317 | }; 318 | 5CF1534E1C3F0EC60004411D /* Build configuration list for PBXNativeTarget "DemoApp" */ = { 319 | isa = XCConfigurationList; 320 | buildConfigurations = ( 321 | 5CF1534F1C3F0EC60004411D /* Debug */, 322 | 5CF153501C3F0EC60004411D /* Release */, 323 | ); 324 | defaultConfigurationIsVisible = 0; 325 | defaultConfigurationName = Release; 326 | }; 327 | /* End XCConfigurationList section */ 328 | }; 329 | rootObject = 5CF153341C3F0EC60004411D /* Project object */; 330 | } 331 | -------------------------------------------------------------------------------- /EggsBenedict.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5CACDDC21C3F9C59005F9D49 /* EggsBenedict.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 5CACDDC11C3F9C59005F9D49 /* EggsBenedict.jpg */; }; 11 | 5CD031D61C31C7B600BC4BF6 /* SharingFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDCE8991C30249600B203EC /* SharingFlow.swift */; }; 12 | 5CF239031C30B1900009815F /* EggsBenedict.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CF239021C30B1900009815F /* EggsBenedict.h */; settings = {ATTRIBUTES = (Public, ); }; }; 13 | 5CF239111C30B1900009815F /* EggsBenedictTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF239101C30B1900009815F /* EggsBenedictTests.swift */; }; 14 | 5CF239441C30CD520009815F /* SharingFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDCE8991C30249600B203EC /* SharingFlow.swift */; }; 15 | 5CF8E73C1C46407100FC22EC /* SharingFlowType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF8E73B1C46407100FC22EC /* SharingFlowType.swift */; }; 16 | 5CF8E73E1C46421A00FC22EC /* SharingFlowError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF8E73D1C46421A00FC22EC /* SharingFlowError.swift */; }; 17 | 5CF8E73F1C46428600FC22EC /* SharingFlowType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF8E73B1C46407100FC22EC /* SharingFlowType.swift */; }; 18 | 5CF8E7401C46428900FC22EC /* SharingFlowError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF8E73D1C46421A00FC22EC /* SharingFlowError.swift */; }; 19 | 5CF8E7421C4642DB00FC22EC /* SharingFlowResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF8E7411C4642DB00FC22EC /* SharingFlowResult.swift */; }; 20 | 5CF8E7431C4642DB00FC22EC /* SharingFlowResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF8E7411C4642DB00FC22EC /* SharingFlowResult.swift */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | 5CF2390B1C30B1900009815F /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = 5CDCE85B1C3023BB00B203EC /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = 5CF238FF1C30B1900009815F; 29 | remoteInfo = EggsBenedict; 30 | }; 31 | /* End PBXContainerItemProxy section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 5CACDDC11C3F9C59005F9D49 /* EggsBenedict.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = EggsBenedict.jpg; sourceTree = ""; }; 35 | 5CDCE8991C30249600B203EC /* SharingFlow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SharingFlow.swift; sourceTree = ""; }; 36 | 5CF239001C30B1900009815F /* EggsBenedict.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = EggsBenedict.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 5CF239021C30B1900009815F /* EggsBenedict.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EggsBenedict.h; sourceTree = ""; }; 38 | 5CF239041C30B1900009815F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | 5CF239091C30B1900009815F /* EggsBenedictTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EggsBenedictTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 5CF239101C30B1900009815F /* EggsBenedictTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EggsBenedictTests.swift; sourceTree = ""; }; 41 | 5CF239121C30B1900009815F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 42 | 5CF8E73B1C46407100FC22EC /* SharingFlowType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SharingFlowType.swift; sourceTree = ""; }; 43 | 5CF8E73D1C46421A00FC22EC /* SharingFlowError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SharingFlowError.swift; sourceTree = ""; }; 44 | 5CF8E7411C4642DB00FC22EC /* SharingFlowResult.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SharingFlowResult.swift; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 5CF238FC1C30B1900009815F /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | 5CF239061C30B1900009815F /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | /* End PBXFrameworksBuildPhase section */ 63 | 64 | /* Begin PBXGroup section */ 65 | 5CDCE85A1C3023BB00B203EC = { 66 | isa = PBXGroup; 67 | children = ( 68 | 5CF239011C30B1900009815F /* EggsBenedict */, 69 | 5CF2390F1C30B1900009815F /* EggsBenedictTests */, 70 | 5CDCE8641C3023BB00B203EC /* Products */, 71 | ); 72 | sourceTree = ""; 73 | }; 74 | 5CDCE8641C3023BB00B203EC /* Products */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 5CF239001C30B1900009815F /* EggsBenedict.framework */, 78 | 5CF239091C30B1900009815F /* EggsBenedictTests.xctest */, 79 | ); 80 | name = Products; 81 | sourceTree = ""; 82 | }; 83 | 5CF239011C30B1900009815F /* EggsBenedict */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 5CDCE8991C30249600B203EC /* SharingFlow.swift */, 87 | 5CF8E73B1C46407100FC22EC /* SharingFlowType.swift */, 88 | 5CF8E7411C4642DB00FC22EC /* SharingFlowResult.swift */, 89 | 5CF8E73D1C46421A00FC22EC /* SharingFlowError.swift */, 90 | 5CF239021C30B1900009815F /* EggsBenedict.h */, 91 | 5CF239041C30B1900009815F /* Info.plist */, 92 | ); 93 | path = EggsBenedict; 94 | sourceTree = ""; 95 | }; 96 | 5CF2390F1C30B1900009815F /* EggsBenedictTests */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 5CF239101C30B1900009815F /* EggsBenedictTests.swift */, 100 | 5CACDDC11C3F9C59005F9D49 /* EggsBenedict.jpg */, 101 | 5CF239121C30B1900009815F /* Info.plist */, 102 | ); 103 | path = EggsBenedictTests; 104 | sourceTree = ""; 105 | }; 106 | /* End PBXGroup section */ 107 | 108 | /* Begin PBXHeadersBuildPhase section */ 109 | 5CF238FD1C30B1900009815F /* Headers */ = { 110 | isa = PBXHeadersBuildPhase; 111 | buildActionMask = 2147483647; 112 | files = ( 113 | 5CF239031C30B1900009815F /* EggsBenedict.h in Headers */, 114 | ); 115 | runOnlyForDeploymentPostprocessing = 0; 116 | }; 117 | /* End PBXHeadersBuildPhase section */ 118 | 119 | /* Begin PBXNativeTarget section */ 120 | 5CF238FF1C30B1900009815F /* EggsBenedict */ = { 121 | isa = PBXNativeTarget; 122 | buildConfigurationList = 5CF2391B1C30B1910009815F /* Build configuration list for PBXNativeTarget "EggsBenedict" */; 123 | buildPhases = ( 124 | 5CF238FB1C30B1900009815F /* Sources */, 125 | 5CF238FC1C30B1900009815F /* Frameworks */, 126 | 5CF238FD1C30B1900009815F /* Headers */, 127 | 5CF238FE1C30B1900009815F /* Resources */, 128 | ); 129 | buildRules = ( 130 | ); 131 | dependencies = ( 132 | ); 133 | name = EggsBenedict; 134 | productName = EggsBenedict; 135 | productReference = 5CF239001C30B1900009815F /* EggsBenedict.framework */; 136 | productType = "com.apple.product-type.framework"; 137 | }; 138 | 5CF239081C30B1900009815F /* EggsBenedictTests */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = 5CF2391D1C30B1910009815F /* Build configuration list for PBXNativeTarget "EggsBenedictTests" */; 141 | buildPhases = ( 142 | 5CF239051C30B1900009815F /* Sources */, 143 | 5CF239061C30B1900009815F /* Frameworks */, 144 | 5CF239071C30B1900009815F /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | 5CF2390C1C30B1900009815F /* PBXTargetDependency */, 150 | ); 151 | name = EggsBenedictTests; 152 | productName = EggsBenedictTests; 153 | productReference = 5CF239091C30B1900009815F /* EggsBenedictTests.xctest */; 154 | productType = "com.apple.product-type.bundle.unit-test"; 155 | }; 156 | /* End PBXNativeTarget section */ 157 | 158 | /* Begin PBXProject section */ 159 | 5CDCE85B1C3023BB00B203EC /* Project object */ = { 160 | isa = PBXProject; 161 | attributes = { 162 | LastSwiftUpdateCheck = 0720; 163 | LastUpgradeCheck = 0720; 164 | ORGANIZATIONNAME = JPMartha; 165 | TargetAttributes = { 166 | 5CF238FF1C30B1900009815F = { 167 | CreatedOnToolsVersion = 7.2; 168 | }; 169 | 5CF239081C30B1900009815F = { 170 | CreatedOnToolsVersion = 7.2; 171 | TestTargetID = 5CDCE8621C3023BB00B203EC; 172 | }; 173 | }; 174 | }; 175 | buildConfigurationList = 5CDCE85E1C3023BB00B203EC /* Build configuration list for PBXProject "EggsBenedict" */; 176 | compatibilityVersion = "Xcode 3.2"; 177 | developmentRegion = English; 178 | hasScannedForEncodings = 0; 179 | knownRegions = ( 180 | en, 181 | Base, 182 | ); 183 | mainGroup = 5CDCE85A1C3023BB00B203EC; 184 | productRefGroup = 5CDCE8641C3023BB00B203EC /* Products */; 185 | projectDirPath = ""; 186 | projectRoot = ""; 187 | targets = ( 188 | 5CF238FF1C30B1900009815F /* EggsBenedict */, 189 | 5CF239081C30B1900009815F /* EggsBenedictTests */, 190 | ); 191 | }; 192 | /* End PBXProject section */ 193 | 194 | /* Begin PBXResourcesBuildPhase section */ 195 | 5CF238FE1C30B1900009815F /* Resources */ = { 196 | isa = PBXResourcesBuildPhase; 197 | buildActionMask = 2147483647; 198 | files = ( 199 | ); 200 | runOnlyForDeploymentPostprocessing = 0; 201 | }; 202 | 5CF239071C30B1900009815F /* Resources */ = { 203 | isa = PBXResourcesBuildPhase; 204 | buildActionMask = 2147483647; 205 | files = ( 206 | 5CACDDC21C3F9C59005F9D49 /* EggsBenedict.jpg in Resources */, 207 | ); 208 | runOnlyForDeploymentPostprocessing = 0; 209 | }; 210 | /* End PBXResourcesBuildPhase section */ 211 | 212 | /* Begin PBXSourcesBuildPhase section */ 213 | 5CF238FB1C30B1900009815F /* Sources */ = { 214 | isa = PBXSourcesBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | 5CF8E73C1C46407100FC22EC /* SharingFlowType.swift in Sources */, 218 | 5CF8E73E1C46421A00FC22EC /* SharingFlowError.swift in Sources */, 219 | 5CF8E7421C4642DB00FC22EC /* SharingFlowResult.swift in Sources */, 220 | 5CF239441C30CD520009815F /* SharingFlow.swift in Sources */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | 5CF239051C30B1900009815F /* Sources */ = { 225 | isa = PBXSourcesBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | 5CD031D61C31C7B600BC4BF6 /* SharingFlow.swift in Sources */, 229 | 5CF8E7431C4642DB00FC22EC /* SharingFlowResult.swift in Sources */, 230 | 5CF239111C30B1900009815F /* EggsBenedictTests.swift in Sources */, 231 | 5CF8E73F1C46428600FC22EC /* SharingFlowType.swift in Sources */, 232 | 5CF8E7401C46428900FC22EC /* SharingFlowError.swift in Sources */, 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | }; 236 | /* End PBXSourcesBuildPhase section */ 237 | 238 | /* Begin PBXTargetDependency section */ 239 | 5CF2390C1C30B1900009815F /* PBXTargetDependency */ = { 240 | isa = PBXTargetDependency; 241 | target = 5CF238FF1C30B1900009815F /* EggsBenedict */; 242 | targetProxy = 5CF2390B1C30B1900009815F /* PBXContainerItemProxy */; 243 | }; 244 | /* End PBXTargetDependency section */ 245 | 246 | /* Begin XCBuildConfiguration section */ 247 | 5CDCE8891C3023BB00B203EC /* Debug */ = { 248 | isa = XCBuildConfiguration; 249 | buildSettings = { 250 | ALWAYS_SEARCH_USER_PATHS = NO; 251 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 252 | CLANG_CXX_LIBRARY = "libc++"; 253 | CLANG_ENABLE_MODULES = YES; 254 | CLANG_ENABLE_OBJC_ARC = YES; 255 | CLANG_WARN_BOOL_CONVERSION = YES; 256 | CLANG_WARN_CONSTANT_CONVERSION = YES; 257 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 258 | CLANG_WARN_EMPTY_BODY = YES; 259 | CLANG_WARN_ENUM_CONVERSION = YES; 260 | CLANG_WARN_INT_CONVERSION = YES; 261 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 262 | CLANG_WARN_UNREACHABLE_CODE = YES; 263 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 264 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 265 | COPY_PHASE_STRIP = NO; 266 | DEBUG_INFORMATION_FORMAT = dwarf; 267 | ENABLE_STRICT_OBJC_MSGSEND = YES; 268 | ENABLE_TESTABILITY = YES; 269 | GCC_C_LANGUAGE_STANDARD = gnu99; 270 | GCC_DYNAMIC_NO_PIC = NO; 271 | GCC_NO_COMMON_BLOCKS = YES; 272 | GCC_OPTIMIZATION_LEVEL = 0; 273 | GCC_PREPROCESSOR_DEFINITIONS = ( 274 | "DEBUG=1", 275 | "$(inherited)", 276 | ); 277 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 278 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 279 | GCC_WARN_UNDECLARED_SELECTOR = YES; 280 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 281 | GCC_WARN_UNUSED_FUNCTION = YES; 282 | GCC_WARN_UNUSED_VARIABLE = YES; 283 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 284 | MTL_ENABLE_DEBUG_INFO = YES; 285 | ONLY_ACTIVE_ARCH = YES; 286 | SDKROOT = iphoneos; 287 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 288 | }; 289 | name = Debug; 290 | }; 291 | 5CDCE88A1C3023BB00B203EC /* Release */ = { 292 | isa = XCBuildConfiguration; 293 | buildSettings = { 294 | ALWAYS_SEARCH_USER_PATHS = NO; 295 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 296 | CLANG_CXX_LIBRARY = "libc++"; 297 | CLANG_ENABLE_MODULES = YES; 298 | CLANG_ENABLE_OBJC_ARC = YES; 299 | CLANG_WARN_BOOL_CONVERSION = YES; 300 | CLANG_WARN_CONSTANT_CONVERSION = YES; 301 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 302 | CLANG_WARN_EMPTY_BODY = YES; 303 | CLANG_WARN_ENUM_CONVERSION = YES; 304 | CLANG_WARN_INT_CONVERSION = YES; 305 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 306 | CLANG_WARN_UNREACHABLE_CODE = YES; 307 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 308 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 309 | COPY_PHASE_STRIP = NO; 310 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 311 | ENABLE_NS_ASSERTIONS = NO; 312 | ENABLE_STRICT_OBJC_MSGSEND = YES; 313 | GCC_C_LANGUAGE_STANDARD = gnu99; 314 | GCC_NO_COMMON_BLOCKS = YES; 315 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 316 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 317 | GCC_WARN_UNDECLARED_SELECTOR = YES; 318 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 319 | GCC_WARN_UNUSED_FUNCTION = YES; 320 | GCC_WARN_UNUSED_VARIABLE = YES; 321 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 322 | MTL_ENABLE_DEBUG_INFO = NO; 323 | SDKROOT = iphoneos; 324 | VALIDATE_PRODUCT = YES; 325 | }; 326 | name = Release; 327 | }; 328 | 5CF239171C30B1910009815F /* Debug */ = { 329 | isa = XCBuildConfiguration; 330 | buildSettings = { 331 | CURRENT_PROJECT_VERSION = 1; 332 | DEFINES_MODULE = YES; 333 | DYLIB_COMPATIBILITY_VERSION = 1; 334 | DYLIB_CURRENT_VERSION = 1; 335 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 336 | INFOPLIST_FILE = EggsBenedict/Info.plist; 337 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 338 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 339 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 340 | PRODUCT_BUNDLE_IDENTIFIER = jp.martha.EggsBenedict; 341 | PRODUCT_NAME = "$(TARGET_NAME)"; 342 | SKIP_INSTALL = YES; 343 | TARGETED_DEVICE_FAMILY = "1,2"; 344 | VERSIONING_SYSTEM = "apple-generic"; 345 | VERSION_INFO_PREFIX = ""; 346 | }; 347 | name = Debug; 348 | }; 349 | 5CF239181C30B1910009815F /* Release */ = { 350 | isa = XCBuildConfiguration; 351 | buildSettings = { 352 | CURRENT_PROJECT_VERSION = 1; 353 | DEFINES_MODULE = YES; 354 | DYLIB_COMPATIBILITY_VERSION = 1; 355 | DYLIB_CURRENT_VERSION = 1; 356 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 357 | INFOPLIST_FILE = EggsBenedict/Info.plist; 358 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 359 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 360 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 361 | PRODUCT_BUNDLE_IDENTIFIER = jp.martha.EggsBenedict; 362 | PRODUCT_NAME = "$(TARGET_NAME)"; 363 | SKIP_INSTALL = YES; 364 | TARGETED_DEVICE_FAMILY = "1,2"; 365 | VERSIONING_SYSTEM = "apple-generic"; 366 | VERSION_INFO_PREFIX = ""; 367 | }; 368 | name = Release; 369 | }; 370 | 5CF239191C30B1910009815F /* Debug */ = { 371 | isa = XCBuildConfiguration; 372 | buildSettings = { 373 | INFOPLIST_FILE = EggsBenedictTests/Info.plist; 374 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 375 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 376 | PRODUCT_BUNDLE_IDENTIFIER = jp.martha.EggsBenedictTests; 377 | PRODUCT_NAME = "$(TARGET_NAME)"; 378 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EggsBenedict.app/EggsBenedict"; 379 | }; 380 | name = Debug; 381 | }; 382 | 5CF2391A1C30B1910009815F /* Release */ = { 383 | isa = XCBuildConfiguration; 384 | buildSettings = { 385 | INFOPLIST_FILE = EggsBenedictTests/Info.plist; 386 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 387 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 388 | PRODUCT_BUNDLE_IDENTIFIER = jp.martha.EggsBenedictTests; 389 | PRODUCT_NAME = "$(TARGET_NAME)"; 390 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EggsBenedict.app/EggsBenedict"; 391 | }; 392 | name = Release; 393 | }; 394 | /* End XCBuildConfiguration section */ 395 | 396 | /* Begin XCConfigurationList section */ 397 | 5CDCE85E1C3023BB00B203EC /* Build configuration list for PBXProject "EggsBenedict" */ = { 398 | isa = XCConfigurationList; 399 | buildConfigurations = ( 400 | 5CDCE8891C3023BB00B203EC /* Debug */, 401 | 5CDCE88A1C3023BB00B203EC /* Release */, 402 | ); 403 | defaultConfigurationIsVisible = 0; 404 | defaultConfigurationName = Release; 405 | }; 406 | 5CF2391B1C30B1910009815F /* Build configuration list for PBXNativeTarget "EggsBenedict" */ = { 407 | isa = XCConfigurationList; 408 | buildConfigurations = ( 409 | 5CF239171C30B1910009815F /* Debug */, 410 | 5CF239181C30B1910009815F /* Release */, 411 | ); 412 | defaultConfigurationIsVisible = 0; 413 | defaultConfigurationName = Release; 414 | }; 415 | 5CF2391D1C30B1910009815F /* Build configuration list for PBXNativeTarget "EggsBenedictTests" */ = { 416 | isa = XCConfigurationList; 417 | buildConfigurations = ( 418 | 5CF239191C30B1910009815F /* Debug */, 419 | 5CF2391A1C30B1910009815F /* Release */, 420 | ); 421 | defaultConfigurationIsVisible = 0; 422 | defaultConfigurationName = Release; 423 | }; 424 | /* End XCConfigurationList section */ 425 | }; 426 | rootObject = 5CDCE85B1C3023BB00B203EC /* Project object */; 427 | } 428 | --------------------------------------------------------------------------------