├── Example ├── Images.xcassets │ ├── LaunchImage.launchimage │ │ ├── Default-iOS6.png │ │ ├── Default-Portrait.png │ │ ├── Default-iOS6@2x.png │ │ ├── Default-iOS7@2x.png │ │ ├── Default-Landscape.png │ │ ├── Default-Landscape@2x.png │ │ ├── Default-Portrait@2x.png │ │ ├── Default-iOS6-568h@2x.png │ │ ├── Default-iOS7-568h@2x.png │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── AppDelegate.h ├── main.m ├── SDScreenshotCaptureExample.pch ├── SDScreenshotCaptureExample-Info.plist ├── AppDelegate.m ├── Main_iPhone.storyboard └── Main_iPad.storyboard ├── SDScreenshotCapture.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── .gitignore ├── LICENSE ├── SDScreenshotCapture.podspec ├── SDScreenshotCapture ├── SDScreenshotCapture.h └── SDScreenshotCapture.m └── README.md /Example/Images.xcassets/LaunchImage.launchimage/Default-iOS6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinydevelopment/SDScreenshotCapture/HEAD/Example/Images.xcassets/LaunchImage.launchimage/Default-iOS6.png -------------------------------------------------------------------------------- /Example/Images.xcassets/LaunchImage.launchimage/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinydevelopment/SDScreenshotCapture/HEAD/Example/Images.xcassets/LaunchImage.launchimage/Default-Portrait.png -------------------------------------------------------------------------------- /Example/Images.xcassets/LaunchImage.launchimage/Default-iOS6@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinydevelopment/SDScreenshotCapture/HEAD/Example/Images.xcassets/LaunchImage.launchimage/Default-iOS6@2x.png -------------------------------------------------------------------------------- /Example/Images.xcassets/LaunchImage.launchimage/Default-iOS7@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinydevelopment/SDScreenshotCapture/HEAD/Example/Images.xcassets/LaunchImage.launchimage/Default-iOS7@2x.png -------------------------------------------------------------------------------- /Example/Images.xcassets/LaunchImage.launchimage/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinydevelopment/SDScreenshotCapture/HEAD/Example/Images.xcassets/LaunchImage.launchimage/Default-Landscape.png -------------------------------------------------------------------------------- /Example/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinydevelopment/SDScreenshotCapture/HEAD/Example/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png -------------------------------------------------------------------------------- /Example/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinydevelopment/SDScreenshotCapture/HEAD/Example/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png -------------------------------------------------------------------------------- /Example/Images.xcassets/LaunchImage.launchimage/Default-iOS6-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinydevelopment/SDScreenshotCapture/HEAD/Example/Images.xcassets/LaunchImage.launchimage/Default-iOS6-568h@2x.png -------------------------------------------------------------------------------- /Example/Images.xcassets/LaunchImage.launchimage/Default-iOS7-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shinydevelopment/SDScreenshotCapture/HEAD/Example/Images.xcassets/LaunchImage.launchimage/Default-iOS7-568h@2x.png -------------------------------------------------------------------------------- /SDScreenshotCapture.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 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 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | *.xccheckout 19 | 20 | #CocoaPods 21 | Pods -------------------------------------------------------------------------------- /Example/Images.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" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Shiny Development Ltd. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2013 Shiny Development Ltd. 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | // this software and associated documentation files (the "Software"), to deal in 7 | // the Software without restriction, including without limitation the rights to 8 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | // the Software, and to permit persons to whom the Software is furnished to do so, 10 | // 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, FITNESS 17 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | @interface AppDelegate : UIResponder 23 | 24 | @property (strong, nonatomic) UIWindow *window; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /SDScreenshotCapture.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "SDScreenshotCapture" 3 | s.version = "1.3.1" 4 | s.summary = "A class to capture screenshots from your app which exclude the iOS status bar." 5 | s.description = <<-DESC 6 | SDScreenshotCapture is a class which can be used to capture a screenshot of the app window which excludes the iOS status bar. It includes methods to grab the screenshot directly as a UIImage, share it via a UIActivityViewController, save it to the camera roll or write it directly to the app sandbox in the Documents directory. 7 | 8 | This class is most useful in combination with [Status Magic](http://shinydevelopment.com/status-magic/) for putting perfect status bars on screenshots ready for use in an App Store listing. 9 | DESC 10 | s.homepage = "https://github.com/shinydevelopment/SDScreenshotCapture" 11 | s.license = { :type => 'MIT', :file => 'LICENSE' } 12 | s.authors = { "Shiny Development" => "contact@shinydevelopment.com", "Dave Verwer" => "dave.verwer@shinydevelopment.com", "Greg Spiers" => "greg.spiers@shinydevelopment.com" } 13 | s.platform = :ios, '5.0' 14 | s.source = { :git => "https://github.com/shinydevelopment/SDScreenshotCapture.git", :tag => "1.3.1" } 15 | s.source_files = "SDScreenshotCapture" 16 | s.framework = 'QuartzCore' 17 | s.requires_arc = true 18 | end 19 | -------------------------------------------------------------------------------- /Example/main.m: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2013 Shiny Development Ltd. 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | // this software and associated documentation files (the "Software"), to deal in 7 | // the Software without restriction, including without limitation the rights to 8 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | // the Software, and to permit persons to whom the Software is furnished to do so, 10 | // 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, FITNESS 17 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | #import "AppDelegate.h" 23 | 24 | int main(int argc, char * argv[]) 25 | { 26 | @autoreleasepool { 27 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Example/SDScreenshotCaptureExample.pch: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2013 Shiny Development Ltd. 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | // this software and associated documentation files (the "Software"), to deal in 7 | // the Software without restriction, including without limitation the rights to 8 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | // the Software, and to permit persons to whom the Software is furnished to do so, 10 | // 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, FITNESS 17 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | #import 23 | 24 | #ifndef __IPHONE_5_0 25 | #warning "This project uses features only available in iOS SDK 5.0 and later." 26 | #endif 27 | 28 | #ifdef __OBJC__ 29 | #import 30 | #import 31 | #endif 32 | -------------------------------------------------------------------------------- /SDScreenshotCapture/SDScreenshotCapture.h: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2013 Shiny Development Ltd. 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | // this software and associated documentation files (the "Software"), to deal in 7 | // the Software without restriction, including without limitation the rights to 8 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | // the Software, and to permit persons to whom the Software is furnished to do so, 10 | // 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, FITNESS 17 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | #import 23 | 24 | @interface SDScreenshotCapture : NSObject 25 | 26 | + (UIImage *)imageWithScreenshot; 27 | + (void)takeScreenshotToActivityViewController; 28 | + (void)takeScreenshotToCameraRoll; 29 | + (void)takeScreenshotToDocumentsDirectory; 30 | + (void)takeScreenshotToDirectoryAtPath:(NSString *)path; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Example/SDScreenshotCaptureExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.shinydevelopment.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main_iPhone 29 | UIMainStoryboardFile~ipad 30 | Main_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "filename" : "Default-iOS7@2x.png", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "extent" : "full-screen", 13 | "idiom" : "iphone", 14 | "subtype" : "retina4", 15 | "filename" : "Default-iOS7-568h@2x.png", 16 | "minimum-system-version" : "7.0", 17 | "orientation" : "portrait", 18 | "scale" : "2x" 19 | }, 20 | { 21 | "orientation" : "portrait", 22 | "idiom" : "ipad", 23 | "extent" : "full-screen", 24 | "minimum-system-version" : "7.0", 25 | "filename" : "Default-Portrait.png", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "orientation" : "landscape", 30 | "idiom" : "ipad", 31 | "extent" : "full-screen", 32 | "minimum-system-version" : "7.0", 33 | "filename" : "Default-Landscape.png", 34 | "scale" : "1x" 35 | }, 36 | { 37 | "orientation" : "portrait", 38 | "idiom" : "ipad", 39 | "extent" : "full-screen", 40 | "minimum-system-version" : "7.0", 41 | "filename" : "Default-Portrait@2x.png", 42 | "scale" : "2x" 43 | }, 44 | { 45 | "orientation" : "landscape", 46 | "idiom" : "ipad", 47 | "extent" : "full-screen", 48 | "minimum-system-version" : "7.0", 49 | "filename" : "Default-Landscape@2x.png", 50 | "scale" : "2x" 51 | }, 52 | { 53 | "orientation" : "portrait", 54 | "idiom" : "iphone", 55 | "extent" : "full-screen", 56 | "filename" : "Default-iOS6.png", 57 | "scale" : "1x" 58 | }, 59 | { 60 | "orientation" : "portrait", 61 | "idiom" : "iphone", 62 | "extent" : "full-screen", 63 | "filename" : "Default-iOS6@2x.png", 64 | "scale" : "2x" 65 | }, 66 | { 67 | "orientation" : "portrait", 68 | "idiom" : "iphone", 69 | "extent" : "full-screen", 70 | "filename" : "Default-iOS6-568h@2x.png", 71 | "subtype" : "retina4", 72 | "scale" : "2x" 73 | } 74 | ], 75 | "info" : { 76 | "version" : 1, 77 | "author" : "xcode" 78 | } 79 | } -------------------------------------------------------------------------------- /Example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2013 Shiny Development Ltd. 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | // this software and associated documentation files (the "Software"), to deal in 7 | // the Software without restriction, including without limitation the rights to 8 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | // the Software, and to permit persons to whom the Software is furnished to do so, 10 | // 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, FITNESS 17 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | #import "AppDelegate.h" 23 | #import "SDScreenshotCapture.h" 24 | 25 | @implementation AppDelegate 26 | 27 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 28 | { 29 | // This example application uses a four finger tap gesture to trigger the screenshot. You should use whatever gesture or mechanism works best with your app. 30 | UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureRecognized:)]; 31 | tapGesture.numberOfTouchesRequired = 4; 32 | [self.window addGestureRecognizer:tapGesture]; 33 | 34 | return YES; 35 | } 36 | 37 | - (void)tapGestureRecognized:(UITapGestureRecognizer *)tapGesture 38 | { 39 | [SDScreenshotCapture takeScreenshotToActivityViewController]; 40 | 41 | // Alternatively, SDScreenshotCapture includes two additional methods for saving a screenshot excluding the status bar 42 | // [SDScreenshotCapture takeScreenshotToCameraRoll]; - Immediately store the screenshot to the camera roll, no prompt 43 | // [SDScreenshotCapture takeScreenshotToDocumentsDirectory]; - Immediately store the screenshot to the documents directory using the date and time as a filename 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SDScreenshotCapture 2 | 3 | ![MIT Licensed](https://go-shields.herokuapp.com/license-MIT-blue.png)  4 | ![Platform](https://cocoapod-badges.herokuapp.com/p/SDScreenshotCapture/badge.png)  5 | ![Version](https://cocoapod-badges.herokuapp.com/v/SDScreenshotCapture/badge.png)  6 | 7 | SDScreenshotCapture is a class which can be used to capture a screenshot of the app window which excludes the iOS status bar. It includes methods to grab the screenshot directly as a `UIImage`, share it via a `UIActivityViewController`, save it to the camera roll or write it directly to the app sandbox in the Documents directory. 8 | 9 | # Usage 10 | 11 | Import the SDScreenshotCapture class and use **one** of the following methods to capture a screenshot: 12 | 13 | ```objective-c 14 | // Screenshot and show share sheet 15 | [SDScreenshotCapture takeScreenshotToActivityViewController]; 16 | ``` 17 | ```objective-c 18 | // Screenshot and store to camera roll 19 | [SDScreenshotCapture takeScreenshotToCameraRoll]; 20 | ``` 21 | ```objective-c 22 | // Screenshot and store to documents directory 23 | [SDScreenshotCapture takeScreenshotToDocumentsDirectory]; 24 | ``` 25 | 26 | These methods can be called from anywhere but there are a couple of suggestions on how to trigger a screenshot in a generic way below: 27 | 28 | ### Triggering with a four finger tap gesture on the window 29 | 30 | ```objective-c 31 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 32 | { 33 | UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureRecognized:)]; 34 | tapGesture.numberOfTouchesRequired = 4; 35 | [self.window addGestureRecognizer:tapGesture]; 36 | 37 | return YES; 38 | } 39 | 40 | - (void)tapGestureRecognized:(UITapGestureRecognizer *)tapGesture 41 | { 42 | [SDScreenshotCapture takeScreenshotToActivityViewController]; 43 | } 44 | ``` 45 | 46 | ### Triggering with a screenshot taken notification (iOS 7 only) 47 | 48 | ```objective-c 49 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 50 | { 51 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDidTakeScreenshot:) name:UIApplicationUserDidTakeScreenshotNotification object:nil]; 52 | 53 | return YES; 54 | } 55 | 56 | - (void)userDidTakeScreenshot:(NSNotification *)notification 57 | { 58 | [SDScreenshotCapture takeScreenshotToActivityViewController]; 59 | } 60 | ``` 61 | 62 | **Note:** Unfortunately there is no way to stop the original screenshot being taken if using this method to trigger the SDScreenshotCapture screenshot. 63 | 64 | # Installation 65 | 66 | Just import the SDScreenshotCapture class. Alternatively the class is also available as a CocoaPod: 67 | 68 | ```ruby 69 | pod 'SDScreenshotCapture' 70 | ``` 71 | 72 | # Demo 73 | 74 | Run the `SDScreenshotCapture.xcodeproj` project in the `Example` folder. 75 | 76 | # Authors 77 | 78 | SDScreenshotCapture was written by [Dave Verwer](http://twitter.com/daveverwer) and [Greg Spiers](http://twitter.com/gspiers) of [Shiny Development](http://shinydevelopment.com). 79 | 80 | # License 81 | 82 | SDScreenshotCapture is available under the MIT license. See the LICENSE file for details. 83 | -------------------------------------------------------------------------------- /Example/Main_iPhone.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 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/Main_iPad.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 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /SDScreenshotCapture/SDScreenshotCapture.m: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2013 Shiny Development Ltd. 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | // this software and associated documentation files (the "Software"), to deal in 7 | // the Software without restriction, including without limitation the rights to 8 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | // the Software, and to permit persons to whom the Software is furnished to do so, 10 | // 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, FITNESS 17 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | #import 23 | #import "SDScreenshotCapture.h" 24 | 25 | #ifndef __IPHONE_7_0 26 | #error "This class requires an SDK version of iOS 7.0 or later" 27 | #endif 28 | 29 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 30 | #error "This class requires a deployment target of iOS 5.0 or later" 31 | #endif 32 | 33 | @implementation SDScreenshotCapture 34 | 35 | + (NSData *)dataWithScreenshotInPNGFormat 36 | { 37 | CGSize imageSize = CGSizeZero; 38 | UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; 39 | if (UIInterfaceOrientationIsPortrait(orientation)) imageSize = [UIScreen mainScreen].bounds.size; 40 | else imageSize = CGSizeMake([UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width); 41 | 42 | UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0); 43 | CGContextRef context = UIGraphicsGetCurrentContext(); 44 | for (UIWindow *window in [[UIApplication sharedApplication] windows]) { 45 | CGContextSaveGState(context); 46 | CGContextTranslateCTM(context, window.center.x, window.center.y); 47 | CGContextConcatCTM(context, window.transform); 48 | CGContextTranslateCTM(context, -window.bounds.size.width * window.layer.anchorPoint.x, -window.bounds.size.height * window.layer.anchorPoint.y); 49 | if (orientation == UIInterfaceOrientationLandscapeLeft) { 50 | CGContextRotateCTM(context, M_PI_2); 51 | CGContextTranslateCTM(context, 0, -imageSize.width); 52 | } else if (orientation == UIInterfaceOrientationLandscapeRight) { 53 | CGContextRotateCTM(context, -M_PI_2); 54 | CGContextTranslateCTM(context, -imageSize.height, 0); 55 | } else if (orientation == UIInterfaceOrientationPortraitUpsideDown) { 56 | CGContextRotateCTM(context, M_PI); 57 | CGContextTranslateCTM(context, -imageSize.width, -imageSize.height); 58 | } 59 | if ([window respondsToSelector:@selector(drawViewHierarchyInRect:afterScreenUpdates:)]) { 60 | [window drawViewHierarchyInRect:window.bounds afterScreenUpdates:YES]; 61 | } else { 62 | [window.layer renderInContext:context]; 63 | } 64 | CGContextRestoreGState(context); 65 | } 66 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 67 | UIGraphicsEndImageContext(); 68 | 69 | return UIImagePNGRepresentation(image); 70 | } 71 | 72 | + (UIImage *)imageWithScreenshot 73 | { 74 | NSData *imageData = [self dataWithScreenshotInPNGFormat]; 75 | return [UIImage imageWithData:imageData]; 76 | } 77 | 78 | + (void)takeScreenshotToActivityViewController 79 | { 80 | if ([UIActivityViewController class] == nil) { 81 | NSLog(@"UIActivityViewController is not supported on iOS versions less than 6.0"); 82 | return; 83 | } 84 | 85 | UIImage *image = [self imageWithScreenshot]; 86 | UIViewController *topViewController = [self topViewController]; 87 | UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:@[ image ] applicationActivities:nil]; 88 | [topViewController presentViewController:controller animated:YES completion:nil]; 89 | } 90 | 91 | + (void)takeScreenshotToCameraRoll 92 | { 93 | UIImage *image = [self imageWithScreenshot]; 94 | UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil); 95 | } 96 | 97 | + (void)takeScreenshotToDocumentsDirectory 98 | { 99 | NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; 100 | [self takeScreenshotToDirectoryAtPath:documentsPath]; 101 | } 102 | 103 | + (void)takeScreenshotToDirectoryAtPath:(NSString *)path 104 | { 105 | static NSDateFormatter *dateFormatter = nil; 106 | if (dateFormatter == nil) { 107 | dateFormatter = [[NSDateFormatter alloc] init]; 108 | [dateFormatter setDateFormat:@"Y-MM-d HH-mm-ss-SSS"]; 109 | } 110 | 111 | NSData *imageData = [self dataWithScreenshotInPNGFormat]; 112 | NSString *imageFileName = [NSString stringWithFormat:@"%@.png", [dateFormatter stringFromDate:[NSDate date]]]; 113 | NSString *imagePath = [path stringByAppendingPathComponent:imageFileName]; 114 | [[NSFileManager defaultManager] createFileAtPath:imagePath contents:imageData attributes:nil]; 115 | } 116 | 117 | + (UIViewController *)topViewController 118 | { 119 | // Returns the currently visible ViewController, including active modal ViewControllers. 120 | NSAssert([UIApplication sharedApplication].keyWindow, @"Application should have a key window"); 121 | NSAssert([UIApplication sharedApplication].keyWindow.rootViewController, @"Window should have a root view controller"); 122 | return [self topViewControllerWithRootViewController:[UIApplication sharedApplication].keyWindow.rootViewController]; 123 | } 124 | 125 | + (UIViewController *)topViewControllerWithRootViewController:(UIViewController *)rootViewController 126 | { 127 | // Check type of rootViewController and return current or topmost child ViewController. 128 | // (Implementation by kleo, see http://stackoverflow.com/a/17578272/170132.) 129 | 130 | if ([rootViewController isKindOfClass:[UITabBarController class]]) { 131 | UITabBarController *tabBarController = (UITabBarController *)rootViewController; 132 | return [self topViewControllerWithRootViewController:tabBarController.selectedViewController]; 133 | } else if ([rootViewController isKindOfClass:[UINavigationController class]]) { 134 | UINavigationController *navigationController = (UINavigationController *)rootViewController; 135 | return [self topViewControllerWithRootViewController:navigationController.visibleViewController]; 136 | } else if (rootViewController.presentedViewController) { 137 | UIViewController *presentedViewController = rootViewController.presentedViewController; 138 | return [self topViewControllerWithRootViewController:presentedViewController]; 139 | } 140 | return rootViewController; 141 | } 142 | 143 | @end 144 | -------------------------------------------------------------------------------- /SDScreenshotCapture.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 551859C717DF308B002432A8 /* SDScreenshotCapture.m in Sources */ = {isa = PBXBuildFile; fileRef = 551859C617DF308B002432A8 /* SDScreenshotCapture.m */; }; 11 | 5580198A17DF1F3A00B4133E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5580198917DF1F3A00B4133E /* Foundation.framework */; }; 12 | 5580198C17DF1F3A00B4133E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5580198B17DF1F3A00B4133E /* CoreGraphics.framework */; }; 13 | 5580198E17DF1F3A00B4133E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5580198D17DF1F3A00B4133E /* UIKit.framework */; }; 14 | 5580199617DF1F3A00B4133E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5580199517DF1F3A00B4133E /* main.m */; }; 15 | 5580199A17DF1F3A00B4133E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5580199917DF1F3A00B4133E /* AppDelegate.m */; }; 16 | 558019A517DF1F3A00B4133E /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 558019A417DF1F3A00B4133E /* Images.xcassets */; }; 17 | 559A87D817DF30FA008AB42A /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 559A87D617DF30FA008AB42A /* Main_iPad.storyboard */; }; 18 | 559A87D917DF30FA008AB42A /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 559A87D717DF30FA008AB42A /* Main_iPhone.storyboard */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 551859C517DF308B002432A8 /* SDScreenshotCapture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDScreenshotCapture.h; sourceTree = ""; }; 23 | 551859C617DF308B002432A8 /* SDScreenshotCapture.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDScreenshotCapture.m; sourceTree = ""; }; 24 | 5580198617DF1F3A00B4133E /* SDScreenshotCapture.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SDScreenshotCapture.app; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 5580198917DF1F3A00B4133E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 26 | 5580198B17DF1F3A00B4133E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 27 | 5580198D17DF1F3A00B4133E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 28 | 5580199117DF1F3A00B4133E /* SDScreenshotCaptureExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SDScreenshotCaptureExample-Info.plist"; sourceTree = ""; }; 29 | 5580199517DF1F3A00B4133E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 30 | 5580199717DF1F3A00B4133E /* SDScreenshotCaptureExample.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDScreenshotCaptureExample.pch; sourceTree = ""; }; 31 | 5580199817DF1F3A00B4133E /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 32 | 5580199917DF1F3A00B4133E /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 33 | 558019A417DF1F3A00B4133E /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 34 | 559A87D617DF30FA008AB42A /* Main_iPad.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main_iPad.storyboard; sourceTree = ""; }; 35 | 559A87D717DF30FA008AB42A /* Main_iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main_iPhone.storyboard; sourceTree = ""; }; 36 | /* End PBXFileReference section */ 37 | 38 | /* Begin PBXFrameworksBuildPhase section */ 39 | 5580198317DF1F3A00B4133E /* Frameworks */ = { 40 | isa = PBXFrameworksBuildPhase; 41 | buildActionMask = 2147483647; 42 | files = ( 43 | 5580198A17DF1F3A00B4133E /* Foundation.framework in Frameworks */, 44 | 5580198C17DF1F3A00B4133E /* CoreGraphics.framework in Frameworks */, 45 | 5580198E17DF1F3A00B4133E /* UIKit.framework in Frameworks */, 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | /* End PBXFrameworksBuildPhase section */ 50 | 51 | /* Begin PBXGroup section */ 52 | 551859C417DF2FCA002432A8 /* SDScreenshotCapture */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | 551859C517DF308B002432A8 /* SDScreenshotCapture.h */, 56 | 551859C617DF308B002432A8 /* SDScreenshotCapture.m */, 57 | ); 58 | path = SDScreenshotCapture; 59 | sourceTree = ""; 60 | }; 61 | 5580197D17DF1F3A00B4133E = { 62 | isa = PBXGroup; 63 | children = ( 64 | 5580198F17DF1F3A00B4133E /* Example */, 65 | 551859C417DF2FCA002432A8 /* SDScreenshotCapture */, 66 | 5580198817DF1F3A00B4133E /* Frameworks */, 67 | 5580198717DF1F3A00B4133E /* Products */, 68 | ); 69 | sourceTree = ""; 70 | }; 71 | 5580198717DF1F3A00B4133E /* Products */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 5580198617DF1F3A00B4133E /* SDScreenshotCapture.app */, 75 | ); 76 | name = Products; 77 | sourceTree = ""; 78 | }; 79 | 5580198817DF1F3A00B4133E /* Frameworks */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 5580198917DF1F3A00B4133E /* Foundation.framework */, 83 | 5580198B17DF1F3A00B4133E /* CoreGraphics.framework */, 84 | 5580198D17DF1F3A00B4133E /* UIKit.framework */, 85 | ); 86 | name = Frameworks; 87 | sourceTree = ""; 88 | }; 89 | 5580198F17DF1F3A00B4133E /* Example */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 559A87D717DF30FA008AB42A /* Main_iPhone.storyboard */, 93 | 559A87D617DF30FA008AB42A /* Main_iPad.storyboard */, 94 | 5580199817DF1F3A00B4133E /* AppDelegate.h */, 95 | 5580199917DF1F3A00B4133E /* AppDelegate.m */, 96 | 558019A417DF1F3A00B4133E /* Images.xcassets */, 97 | 5580199017DF1F3A00B4133E /* Supporting Files */, 98 | ); 99 | path = Example; 100 | sourceTree = ""; 101 | }; 102 | 5580199017DF1F3A00B4133E /* Supporting Files */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 5580199117DF1F3A00B4133E /* SDScreenshotCaptureExample-Info.plist */, 106 | 5580199717DF1F3A00B4133E /* SDScreenshotCaptureExample.pch */, 107 | 5580199517DF1F3A00B4133E /* main.m */, 108 | ); 109 | name = "Supporting Files"; 110 | sourceTree = ""; 111 | }; 112 | /* End PBXGroup section */ 113 | 114 | /* Begin PBXNativeTarget section */ 115 | 5580198517DF1F3A00B4133E /* SDScreenshotCapture */ = { 116 | isa = PBXNativeTarget; 117 | buildConfigurationList = 558019BB17DF1F3A00B4133E /* Build configuration list for PBXNativeTarget "SDScreenshotCapture" */; 118 | buildPhases = ( 119 | 5580198217DF1F3A00B4133E /* Sources */, 120 | 5580198317DF1F3A00B4133E /* Frameworks */, 121 | 5580198417DF1F3A00B4133E /* Resources */, 122 | ); 123 | buildRules = ( 124 | ); 125 | dependencies = ( 126 | ); 127 | name = SDScreenshotCapture; 128 | productName = ScreenshotTaker; 129 | productReference = 5580198617DF1F3A00B4133E /* SDScreenshotCapture.app */; 130 | productType = "com.apple.product-type.application"; 131 | }; 132 | /* End PBXNativeTarget section */ 133 | 134 | /* Begin PBXProject section */ 135 | 5580197E17DF1F3A00B4133E /* Project object */ = { 136 | isa = PBXProject; 137 | attributes = { 138 | LastUpgradeCheck = 0500; 139 | ORGANIZATIONNAME = "Shiny Development"; 140 | }; 141 | buildConfigurationList = 5580198117DF1F3A00B4133E /* Build configuration list for PBXProject "SDScreenshotCapture" */; 142 | compatibilityVersion = "Xcode 3.2"; 143 | developmentRegion = English; 144 | hasScannedForEncodings = 0; 145 | knownRegions = ( 146 | en, 147 | Base, 148 | ); 149 | mainGroup = 5580197D17DF1F3A00B4133E; 150 | productRefGroup = 5580198717DF1F3A00B4133E /* Products */; 151 | projectDirPath = ""; 152 | projectRoot = ""; 153 | targets = ( 154 | 5580198517DF1F3A00B4133E /* SDScreenshotCapture */, 155 | ); 156 | }; 157 | /* End PBXProject section */ 158 | 159 | /* Begin PBXResourcesBuildPhase section */ 160 | 5580198417DF1F3A00B4133E /* Resources */ = { 161 | isa = PBXResourcesBuildPhase; 162 | buildActionMask = 2147483647; 163 | files = ( 164 | 558019A517DF1F3A00B4133E /* Images.xcassets in Resources */, 165 | 559A87D817DF30FA008AB42A /* Main_iPad.storyboard in Resources */, 166 | 559A87D917DF30FA008AB42A /* Main_iPhone.storyboard in Resources */, 167 | ); 168 | runOnlyForDeploymentPostprocessing = 0; 169 | }; 170 | /* End PBXResourcesBuildPhase section */ 171 | 172 | /* Begin PBXSourcesBuildPhase section */ 173 | 5580198217DF1F3A00B4133E /* Sources */ = { 174 | isa = PBXSourcesBuildPhase; 175 | buildActionMask = 2147483647; 176 | files = ( 177 | 551859C717DF308B002432A8 /* SDScreenshotCapture.m in Sources */, 178 | 5580199A17DF1F3A00B4133E /* AppDelegate.m in Sources */, 179 | 5580199617DF1F3A00B4133E /* main.m in Sources */, 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | }; 183 | /* End PBXSourcesBuildPhase section */ 184 | 185 | /* Begin XCBuildConfiguration section */ 186 | 558019B917DF1F3A00B4133E /* Debug */ = { 187 | isa = XCBuildConfiguration; 188 | buildSettings = { 189 | ALWAYS_SEARCH_USER_PATHS = NO; 190 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 191 | CLANG_CXX_LIBRARY = "libc++"; 192 | CLANG_ENABLE_MODULES = YES; 193 | CLANG_ENABLE_OBJC_ARC = YES; 194 | CLANG_WARN_BOOL_CONVERSION = YES; 195 | CLANG_WARN_CONSTANT_CONVERSION = YES; 196 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 197 | CLANG_WARN_EMPTY_BODY = YES; 198 | CLANG_WARN_ENUM_CONVERSION = YES; 199 | CLANG_WARN_INT_CONVERSION = YES; 200 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 201 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 202 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 203 | COPY_PHASE_STRIP = NO; 204 | GCC_C_LANGUAGE_STANDARD = gnu99; 205 | GCC_DYNAMIC_NO_PIC = NO; 206 | GCC_OPTIMIZATION_LEVEL = 0; 207 | GCC_PREPROCESSOR_DEFINITIONS = ( 208 | "DEBUG=1", 209 | "$(inherited)", 210 | ); 211 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 212 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 213 | GCC_WARN_UNDECLARED_SELECTOR = YES; 214 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 215 | GCC_WARN_UNUSED_FUNCTION = YES; 216 | GCC_WARN_UNUSED_VARIABLE = YES; 217 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 218 | ONLY_ACTIVE_ARCH = YES; 219 | SDKROOT = iphoneos; 220 | TARGETED_DEVICE_FAMILY = "1,2"; 221 | }; 222 | name = Debug; 223 | }; 224 | 558019BA17DF1F3A00B4133E /* Release */ = { 225 | isa = XCBuildConfiguration; 226 | buildSettings = { 227 | ALWAYS_SEARCH_USER_PATHS = NO; 228 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 229 | CLANG_CXX_LIBRARY = "libc++"; 230 | CLANG_ENABLE_MODULES = YES; 231 | CLANG_ENABLE_OBJC_ARC = YES; 232 | CLANG_WARN_BOOL_CONVERSION = YES; 233 | CLANG_WARN_CONSTANT_CONVERSION = YES; 234 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 235 | CLANG_WARN_EMPTY_BODY = YES; 236 | CLANG_WARN_ENUM_CONVERSION = YES; 237 | CLANG_WARN_INT_CONVERSION = YES; 238 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 239 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 240 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 241 | COPY_PHASE_STRIP = YES; 242 | ENABLE_NS_ASSERTIONS = NO; 243 | GCC_C_LANGUAGE_STANDARD = gnu99; 244 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 245 | GCC_WARN_UNDECLARED_SELECTOR = YES; 246 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 247 | GCC_WARN_UNUSED_FUNCTION = YES; 248 | GCC_WARN_UNUSED_VARIABLE = YES; 249 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 250 | SDKROOT = iphoneos; 251 | TARGETED_DEVICE_FAMILY = "1,2"; 252 | VALIDATE_PRODUCT = YES; 253 | }; 254 | name = Release; 255 | }; 256 | 558019BC17DF1F3A00B4133E /* Debug */ = { 257 | isa = XCBuildConfiguration; 258 | buildSettings = { 259 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 260 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 261 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 262 | GCC_PREFIX_HEADER = Example/SDScreenshotCaptureExample.pch; 263 | INFOPLIST_FILE = "$(SRCROOT)/Example/SDScreenshotCaptureExample-Info.plist"; 264 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 265 | PRODUCT_NAME = SDScreenshotCapture; 266 | WRAPPER_EXTENSION = app; 267 | }; 268 | name = Debug; 269 | }; 270 | 558019BD17DF1F3A00B4133E /* Release */ = { 271 | isa = XCBuildConfiguration; 272 | buildSettings = { 273 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 274 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 275 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 276 | GCC_PREFIX_HEADER = Example/SDScreenshotCaptureExample.pch; 277 | INFOPLIST_FILE = "$(SRCROOT)/Example/SDScreenshotCaptureExample-Info.plist"; 278 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 279 | PRODUCT_NAME = SDScreenshotCapture; 280 | WRAPPER_EXTENSION = app; 281 | }; 282 | name = Release; 283 | }; 284 | /* End XCBuildConfiguration section */ 285 | 286 | /* Begin XCConfigurationList section */ 287 | 5580198117DF1F3A00B4133E /* Build configuration list for PBXProject "SDScreenshotCapture" */ = { 288 | isa = XCConfigurationList; 289 | buildConfigurations = ( 290 | 558019B917DF1F3A00B4133E /* Debug */, 291 | 558019BA17DF1F3A00B4133E /* Release */, 292 | ); 293 | defaultConfigurationIsVisible = 0; 294 | defaultConfigurationName = Release; 295 | }; 296 | 558019BB17DF1F3A00B4133E /* Build configuration list for PBXNativeTarget "SDScreenshotCapture" */ = { 297 | isa = XCConfigurationList; 298 | buildConfigurations = ( 299 | 558019BC17DF1F3A00B4133E /* Debug */, 300 | 558019BD17DF1F3A00B4133E /* Release */, 301 | ); 302 | defaultConfigurationIsVisible = 0; 303 | defaultConfigurationName = Release; 304 | }; 305 | /* End XCConfigurationList section */ 306 | }; 307 | rootObject = 5580197E17DF1F3A00B4133E /* Project object */; 308 | } 309 | --------------------------------------------------------------------------------