Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

First commit

  • Loading branch information...
commit 43405ff7fa630921394d9704a57a8b1f817adc51 0 parents
@justin authored
Showing with 1,024 additions and 0 deletions.
  1. +18 −0 .gitignore
  2. +477 −0 SGSmokeScreenSample.xcodeproj/project.pbxproj
  3. +7 −0 SGSmokeScreenSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  4. +18 −0 SGSmokeScreenSample/Images.xcassets/AppIcon.appiconset/Contents.json
  5. +23 −0 SGSmokeScreenSample/Images.xcassets/LaunchImage.launchimage/Contents.json
  6. +15 −0 SGSmokeScreenSample/SGAppDelegate.h
  7. +49 −0 SGSmokeScreenSample/SGAppDelegate.m
  8. +38 −0 SGSmokeScreenSample/SGSmokeScreenSample-Info.plist
  9. +16 −0 SGSmokeScreenSample/SGSmokeScreenSample-Prefix.pch
  10. +2 −0  SGSmokeScreenSample/en.lproj/InfoPlist.strings
  11. +18 −0 SGSmokeScreenSample/main.m
  12. +22 −0 SGSmokeScreenSampleTests/SGSmokeScreenSampleTests-Info.plist
  13. +36 −0 SGSmokeScreenSampleTests/SGSmokeScreenSampleTests.m
  14. +2 −0  SGSmokeScreenSampleTests/en.lproj/InfoPlist.strings
  15. +23 −0 SGSmokeScreenViewController/SGSmokeScreenAnimation.h
  16. +28 −0 SGSmokeScreenViewController/SGSmokeScreenAnimation.m
  17. +23 −0 SGSmokeScreenViewController/SGSmokeScreenViewController.h
  18. +125 −0 SGSmokeScreenViewController/SGSmokeScreenViewController.m
  19. +16 −0 SGSmokeScreenViewController/UIView+Screenshots.h
  20. +68 −0 SGSmokeScreenViewController/UIView+Screenshots.m
18 .gitignore
@@ -0,0 +1,18 @@
+# xcode noise
+build/*
+*.pbxuser
+*.mode1v3
+*.mode2v3
+*.perspectivev3
+*.o
+
+xcuserdata
+
+# old skool
+.svn
+
+# osx noise
+.DS_Store
+
+External/sfbcrashreporter/build/*vendor/bundle
+.DS_Store
477 SGSmokeScreenSample.xcodeproj/project.pbxproj
@@ -0,0 +1,477 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ D0A2121E17905C4500B0368B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0A2121D17905C4500B0368B /* Foundation.framework */; };
+ D0A2122017905C4500B0368B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0A2121F17905C4500B0368B /* CoreGraphics.framework */; };
+ D0A2122217905C4500B0368B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0A2122117905C4500B0368B /* UIKit.framework */; };
+ D0A2122817905C4500B0368B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D0A2122617905C4500B0368B /* InfoPlist.strings */; };
+ D0A2122A17905C4500B0368B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A2122917905C4500B0368B /* main.m */; };
+ D0A2122E17905C4500B0368B /* SGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A2122D17905C4500B0368B /* SGAppDelegate.m */; };
+ D0A2123017905C4500B0368B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D0A2122F17905C4500B0368B /* Images.xcassets */; };
+ D0A2123717905C4500B0368B /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0A2123617905C4500B0368B /* XCTest.framework */; };
+ D0A2123817905C4500B0368B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0A2121D17905C4500B0368B /* Foundation.framework */; };
+ D0A2123917905C4500B0368B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0A2122117905C4500B0368B /* UIKit.framework */; };
+ D0A2124117905C4500B0368B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D0A2123F17905C4500B0368B /* InfoPlist.strings */; };
+ D0A2124317905C4500B0368B /* SGSmokeScreenSampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A2124217905C4500B0368B /* SGSmokeScreenSampleTests.m */; };
+ D0A2125317905C7B00B0368B /* SGSmokeScreenAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A2124E17905C7B00B0368B /* SGSmokeScreenAnimation.m */; };
+ D0A2125417905C7B00B0368B /* SGSmokeScreenViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A2125017905C7B00B0368B /* SGSmokeScreenViewController.m */; };
+ D0A2125517905C7B00B0368B /* UIView+Screenshots.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A2125217905C7B00B0368B /* UIView+Screenshots.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ D0A2123A17905C4500B0368B /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = D0A2121217905C4500B0368B /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = D0A2121917905C4500B0368B;
+ remoteInfo = SGSmokeScreenSample;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ D0A2121A17905C4500B0368B /* SGSmokeScreenSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SGSmokeScreenSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0A2121D17905C4500B0368B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ D0A2121F17905C4500B0368B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ D0A2122117905C4500B0368B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ D0A2122517905C4500B0368B /* SGSmokeScreenSample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SGSmokeScreenSample-Info.plist"; sourceTree = "<group>"; };
+ D0A2122717905C4500B0368B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ D0A2122917905C4500B0368B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ D0A2122B17905C4500B0368B /* SGSmokeScreenSample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SGSmokeScreenSample-Prefix.pch"; sourceTree = "<group>"; };
+ D0A2122C17905C4500B0368B /* SGAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SGAppDelegate.h; sourceTree = "<group>"; };
+ D0A2122D17905C4500B0368B /* SGAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SGAppDelegate.m; sourceTree = "<group>"; };
+ D0A2122F17905C4500B0368B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
+ D0A2123517905C4500B0368B /* SGSmokeScreenSampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SGSmokeScreenSampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ D0A2123617905C4500B0368B /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
+ D0A2123E17905C4500B0368B /* SGSmokeScreenSampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SGSmokeScreenSampleTests-Info.plist"; sourceTree = "<group>"; };
+ D0A2124017905C4500B0368B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ D0A2124217905C4500B0368B /* SGSmokeScreenSampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SGSmokeScreenSampleTests.m; sourceTree = "<group>"; };
+ D0A2124D17905C7B00B0368B /* SGSmokeScreenAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGSmokeScreenAnimation.h; sourceTree = "<group>"; };
+ D0A2124E17905C7B00B0368B /* SGSmokeScreenAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGSmokeScreenAnimation.m; sourceTree = "<group>"; };
+ D0A2124F17905C7B00B0368B /* SGSmokeScreenViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGSmokeScreenViewController.h; sourceTree = "<group>"; };
+ D0A2125017905C7B00B0368B /* SGSmokeScreenViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGSmokeScreenViewController.m; sourceTree = "<group>"; };
+ D0A2125117905C7B00B0368B /* UIView+Screenshots.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Screenshots.h"; sourceTree = "<group>"; };
+ D0A2125217905C7B00B0368B /* UIView+Screenshots.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Screenshots.m"; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ D0A2121717905C4500B0368B /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0A2122017905C4500B0368B /* CoreGraphics.framework in Frameworks */,
+ D0A2122217905C4500B0368B /* UIKit.framework in Frameworks */,
+ D0A2121E17905C4500B0368B /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ D0A2123217905C4500B0368B /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0A2123717905C4500B0368B /* XCTest.framework in Frameworks */,
+ D0A2123917905C4500B0368B /* UIKit.framework in Frameworks */,
+ D0A2123817905C4500B0368B /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ D0A2121117905C4500B0368B = {
+ isa = PBXGroup;
+ children = (
+ D0A2124C17905C7B00B0368B /* SGSmokeScreenViewController */,
+ D0A2122317905C4500B0368B /* SGSmokeScreenSample */,
+ D0A2123C17905C4500B0368B /* SGSmokeScreenSampleTests */,
+ D0A2121C17905C4500B0368B /* Frameworks */,
+ D0A2121B17905C4500B0368B /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ D0A2121B17905C4500B0368B /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ D0A2121A17905C4500B0368B /* SGSmokeScreenSample.app */,
+ D0A2123517905C4500B0368B /* SGSmokeScreenSampleTests.xctest */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ D0A2121C17905C4500B0368B /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ D0A2121D17905C4500B0368B /* Foundation.framework */,
+ D0A2121F17905C4500B0368B /* CoreGraphics.framework */,
+ D0A2122117905C4500B0368B /* UIKit.framework */,
+ D0A2123617905C4500B0368B /* XCTest.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ D0A2122317905C4500B0368B /* SGSmokeScreenSample */ = {
+ isa = PBXGroup;
+ children = (
+ D0A2122C17905C4500B0368B /* SGAppDelegate.h */,
+ D0A2122D17905C4500B0368B /* SGAppDelegate.m */,
+ D0A2122F17905C4500B0368B /* Images.xcassets */,
+ D0A2122417905C4500B0368B /* Supporting Files */,
+ );
+ path = SGSmokeScreenSample;
+ sourceTree = "<group>";
+ };
+ D0A2122417905C4500B0368B /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ D0A2122517905C4500B0368B /* SGSmokeScreenSample-Info.plist */,
+ D0A2122617905C4500B0368B /* InfoPlist.strings */,
+ D0A2122917905C4500B0368B /* main.m */,
+ D0A2122B17905C4500B0368B /* SGSmokeScreenSample-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ D0A2123C17905C4500B0368B /* SGSmokeScreenSampleTests */ = {
+ isa = PBXGroup;
+ children = (
+ D0A2124217905C4500B0368B /* SGSmokeScreenSampleTests.m */,
+ D0A2123D17905C4500B0368B /* Supporting Files */,
+ );
+ path = SGSmokeScreenSampleTests;
+ sourceTree = "<group>";
+ };
+ D0A2123D17905C4500B0368B /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ D0A2123E17905C4500B0368B /* SGSmokeScreenSampleTests-Info.plist */,
+ D0A2123F17905C4500B0368B /* InfoPlist.strings */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ D0A2124C17905C7B00B0368B /* SGSmokeScreenViewController */ = {
+ isa = PBXGroup;
+ children = (
+ D0A2124D17905C7B00B0368B /* SGSmokeScreenAnimation.h */,
+ D0A2124E17905C7B00B0368B /* SGSmokeScreenAnimation.m */,
+ D0A2124F17905C7B00B0368B /* SGSmokeScreenViewController.h */,
+ D0A2125017905C7B00B0368B /* SGSmokeScreenViewController.m */,
+ D0A2125117905C7B00B0368B /* UIView+Screenshots.h */,
+ D0A2125217905C7B00B0368B /* UIView+Screenshots.m */,
+ );
+ path = SGSmokeScreenViewController;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ D0A2121917905C4500B0368B /* SGSmokeScreenSample */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D0A2124617905C4500B0368B /* Build configuration list for PBXNativeTarget "SGSmokeScreenSample" */;
+ buildPhases = (
+ D0A2121617905C4500B0368B /* Sources */,
+ D0A2121717905C4500B0368B /* Frameworks */,
+ D0A2121817905C4500B0368B /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = SGSmokeScreenSample;
+ productName = SGSmokeScreenSample;
+ productReference = D0A2121A17905C4500B0368B /* SGSmokeScreenSample.app */;
+ productType = "com.apple.product-type.application";
+ };
+ D0A2123417905C4500B0368B /* SGSmokeScreenSampleTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D0A2124917905C4500B0368B /* Build configuration list for PBXNativeTarget "SGSmokeScreenSampleTests" */;
+ buildPhases = (
+ D0A2123117905C4500B0368B /* Sources */,
+ D0A2123217905C4500B0368B /* Frameworks */,
+ D0A2123317905C4500B0368B /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ D0A2123B17905C4500B0368B /* PBXTargetDependency */,
+ );
+ name = SGSmokeScreenSampleTests;
+ productName = SGSmokeScreenSampleTests;
+ productReference = D0A2123517905C4500B0368B /* SGSmokeScreenSampleTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ D0A2121217905C4500B0368B /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ CLASSPREFIX = SG;
+ LastUpgradeCheck = 0500;
+ ORGANIZATIONNAME = "Second Gear";
+ TargetAttributes = {
+ D0A2123417905C4500B0368B = {
+ TestTargetID = D0A2121917905C4500B0368B;
+ };
+ };
+ };
+ buildConfigurationList = D0A2121517905C4500B0368B /* Build configuration list for PBXProject "SGSmokeScreenSample" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = D0A2121117905C4500B0368B;
+ productRefGroup = D0A2121B17905C4500B0368B /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ D0A2121917905C4500B0368B /* SGSmokeScreenSample */,
+ D0A2123417905C4500B0368B /* SGSmokeScreenSampleTests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ D0A2121817905C4500B0368B /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0A2122817905C4500B0368B /* InfoPlist.strings in Resources */,
+ D0A2123017905C4500B0368B /* Images.xcassets in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ D0A2123317905C4500B0368B /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0A2124117905C4500B0368B /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ D0A2121617905C4500B0368B /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0A2125417905C7B00B0368B /* SGSmokeScreenViewController.m in Sources */,
+ D0A2125317905C7B00B0368B /* SGSmokeScreenAnimation.m in Sources */,
+ D0A2122E17905C4500B0368B /* SGAppDelegate.m in Sources */,
+ D0A2125517905C7B00B0368B /* UIView+Screenshots.m in Sources */,
+ D0A2122A17905C4500B0368B /* main.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ D0A2123117905C4500B0368B /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D0A2124317905C4500B0368B /* SGSmokeScreenSampleTests.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ D0A2123B17905C4500B0368B /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = D0A2121917905C4500B0368B /* SGSmokeScreenSample */;
+ targetProxy = D0A2123A17905C4500B0368B /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ D0A2122617905C4500B0368B /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ D0A2122717905C4500B0368B /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ D0A2123F17905C4500B0368B /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ D0A2124017905C4500B0368B /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ D0A2124417905C4500B0368B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ D0A2124517905C4500B0368B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = YES;
+ ENABLE_NS_ASSERTIONS = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+ SDKROOT = iphoneos;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ D0A2124717905C4500B0368B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "SGSmokeScreenSample/SGSmokeScreenSample-Prefix.pch";
+ INFOPLIST_FILE = "SGSmokeScreenSample/SGSmokeScreenSample-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ D0A2124817905C4500B0368B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "SGSmokeScreenSample/SGSmokeScreenSample-Prefix.pch";
+ INFOPLIST_FILE = "SGSmokeScreenSample/SGSmokeScreenSample-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+ D0A2124A17905C4500B0368B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SGSmokeScreenSample.app/SGSmokeScreenSample";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SDKROOT)/Developer/Library/Frameworks",
+ "$(inherited)",
+ "$(SYSTEM_APPS_DIR)/Xcode5-DP3.app/Contents/Developer/Library/Frameworks",
+ );
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "SGSmokeScreenSample/SGSmokeScreenSample-Prefix.pch";
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "SGSmokeScreenSampleTests/SGSmokeScreenSampleTests-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TEST_HOST = "$(BUNDLE_LOADER)";
+ WRAPPER_EXTENSION = xctest;
+ };
+ name = Debug;
+ };
+ D0A2124B17905C4500B0368B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SGSmokeScreenSample.app/SGSmokeScreenSample";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SDKROOT)/Developer/Library/Frameworks",
+ "$(inherited)",
+ "$(SYSTEM_APPS_DIR)/Xcode5-DP3.app/Contents/Developer/Library/Frameworks",
+ );
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "SGSmokeScreenSample/SGSmokeScreenSample-Prefix.pch";
+ INFOPLIST_FILE = "SGSmokeScreenSampleTests/SGSmokeScreenSampleTests-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TEST_HOST = "$(BUNDLE_LOADER)";
+ WRAPPER_EXTENSION = xctest;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ D0A2121517905C4500B0368B /* Build configuration list for PBXProject "SGSmokeScreenSample" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0A2124417905C4500B0368B /* Debug */,
+ D0A2124517905C4500B0368B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ D0A2124617905C4500B0368B /* Build configuration list for PBXNativeTarget "SGSmokeScreenSample" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0A2124717905C4500B0368B /* Debug */,
+ D0A2124817905C4500B0368B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
+ D0A2124917905C4500B0368B /* Build configuration list for PBXNativeTarget "SGSmokeScreenSampleTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D0A2124A17905C4500B0368B /* Debug */,
+ D0A2124B17905C4500B0368B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = D0A2121217905C4500B0368B /* Project object */;
+}
7 SGSmokeScreenSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:SGSmokeScreenSample.xcodeproj">
+ </FileRef>
+</Workspace>
18 SGSmokeScreenSample/Images.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,18 @@
+{
+ "images" : [
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
23 SGSmokeScreenSample/Images.xcassets/LaunchImage.launchimage/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "subtype" : "retina4",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
15 SGSmokeScreenSample/SGAppDelegate.h
@@ -0,0 +1,15 @@
+//
+// SGAppDelegate.h
+// SGSmokeScreenSample
+//
+// Created by Justin Williams on 7/12/13.
+// Copyright (c) 2013 Second Gear. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface SGAppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
49 SGSmokeScreenSample/SGAppDelegate.m
@@ -0,0 +1,49 @@
+//
+// SGAppDelegate.m
+// SGSmokeScreenSample
+//
+// Created by Justin Williams on 7/12/13.
+// Copyright (c) 2013 Second Gear. All rights reserved.
+//
+
+#import "SGAppDelegate.h"
+
+@implementation SGAppDelegate
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ // Override point for customization after application launch.
+ self.window.backgroundColor = [UIColor whiteColor];
+ [self.window makeKeyAndVisible];
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ // 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.
+ // 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.
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ // 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.
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ // 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.
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ // 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.
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+@end
38 SGSmokeScreenSample/SGSmokeScreenSample-Info.plist
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.secondgear.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
16 SGSmokeScreenSample/SGSmokeScreenSample-Prefix.pch
@@ -0,0 +1,16 @@
+//
+// Prefix header
+//
+// The contents of this file are implicitly included at the beginning of every source file.
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_3_0
+#warning "This project uses features only available in iOS SDK 3.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
2  SGSmokeScreenSample/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
18 SGSmokeScreenSample/main.m
@@ -0,0 +1,18 @@
+//
+// main.m
+// SGSmokeScreenSample
+//
+// Created by Justin Williams on 7/12/13.
+// Copyright (c) 2013 Second Gear. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "SGAppDelegate.h"
+
+int main(int argc, char * argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([SGAppDelegate class]));
+ }
+}
22 SGSmokeScreenSampleTests/SGSmokeScreenSampleTests-Info.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.secondgear.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
36 SGSmokeScreenSampleTests/SGSmokeScreenSampleTests.m
@@ -0,0 +1,36 @@
+//
+// SGSmokeScreenSampleTests.m
+// SGSmokeScreenSampleTests
+//
+// Created by Justin Williams on 7/12/13.
+// Copyright (c) 2013 Second Gear. All rights reserved.
+//
+
+#import <XCTest/XCTest.h>
+
+@interface SGSmokeScreenSampleTests : XCTestCase
+
+@end
+
+@implementation SGSmokeScreenSampleTests
+
+- (void)setUp
+{
+ [super setUp];
+
+ // Set-up code here.
+}
+
+- (void)tearDown
+{
+ // Tear-down code here.
+
+ [super tearDown];
+}
+
+- (void)testExample
+{
+ XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
+}
+
+@end
2  SGSmokeScreenSampleTests/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
23 SGSmokeScreenViewController/SGSmokeScreenAnimation.h
@@ -0,0 +1,23 @@
+//
+// SGSmokeScreenAnimation.h
+// SGSmokeScreenView
+//
+// Created by Justin Williams on 7/7/13.
+// Copyright (c) 2013 Second Gear. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "SGSmokeScreenViewController.h"
+
+typedef void (^SGSmokeScreenAnimationsBlock)(SGSmokeScreenViewController *smokeScreen);
+
+@interface SGSmokeScreenAnimation : NSObject
+
+@property (nonatomic, assign) NSTimeInterval duration;
+@property (nonatomic, assign) NSTimeInterval delay;
+@property (nonatomic, assign) UIViewAnimationCurve curve;
+@property (nonatomic, copy) SGSmokeScreenAnimationsBlock animations;
+
+- (instancetype)initWithSmokeScreenView:(SGSmokeScreenViewController *)viewController;
+
+@end
28 SGSmokeScreenViewController/SGSmokeScreenAnimation.m
@@ -0,0 +1,28 @@
+//
+// SGSmokeScreenAnimation.m
+// SGSmokeScreenView
+//
+// Created by Justin Williams on 7/7/13.
+// Copyright (c) 2013 Second Gear. All rights reserved.
+//
+
+#import "SGSmokeScreenAnimation.h"
+
+@interface SGSmokeScreenAnimation ()
+
+@property (nonatomic, strong) SGSmokeScreenViewController *smokeScreenViewController;
+
+@end
+
+@implementation SGSmokeScreenAnimation
+
+- (instancetype)initWithSmokeScreenView:(SGSmokeScreenViewController *)viewController
+{
+ if ((self = [super init]))
+ {
+ self.smokeScreenViewController = viewController;
+ }
+ return self;
+}
+
+@end
23 SGSmokeScreenViewController/SGSmokeScreenViewController.h
@@ -0,0 +1,23 @@
+//
+// SGSmokeScreenViewController.h
+// SGSmokeScreenView
+//
+// Created by Justin Williams on 7/7/13.
+// Copyright (c) 2013 Second Gear. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface SGSmokeScreenViewController : UIViewController
+
+// The animations array is expecting an array of `SGSmokeScreenAnimation` objects.
+// If it doesn't receive them, we bring back the linen texture.
+@property (nonatomic, strong) NSArray *animations;
+
+
+- (instancetype)initWithStartingViewController:(UIViewController *)startingViewController destinationViewController:(UIViewController *)destinationViewController;
+
+- (void)performTransition;
+- (void)unwindTransition;
+
+@end
125 SGSmokeScreenViewController/SGSmokeScreenViewController.m
@@ -0,0 +1,125 @@
+//
+// SGSmokeScreenViewController.m
+// SGSmokeScreenView
+//
+// Created by Justin Williams on 7/7/13.
+// Copyright (c) 2013 Second Gear. All rights reserved.
+//
+
+#import "SGSmokeScreenViewController.h"
+#import "SGSmokeScreenAnimation.h"
+
+@interface SGSmokeScreenViewController ()
+
+@property (nonatomic, strong) UIViewController *startingViewController;
+@property (nonatomic, strong) UIViewController *destinationViewController;
+@property (nonatomic, assign) NSUInteger useCount;
+
+- (void)incrementUseCount;
+- (void)decrementUseCount;
+
+@end
+
+@implementation SGSmokeScreenViewController
+
+- (instancetype)initWithStartingViewController:(UIViewController *)startingViewController destinationViewController:(UIViewController *)destinationViewController;
+{
+ if ((self = [super initWithNibName:nil bundle:nil]))
+ {
+ self.useCount = 0;
+ self.startingViewController = startingViewController;
+ self.destinationViewController = destinationViewController;
+ }
+ return self;
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+ // Do any additional setup after loading the view.
+ self.view.backgroundColor = [UIColor clearColor];
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+ [super viewWillAppear:animated];
+}
+
+- (void)viewDidAppear:(BOOL)animated
+{
+ [super viewDidAppear:animated];
+
+ [UIView beginAnimations:nil context:nil];
+ for (SGSmokeScreenAnimation *animation in self.animations)
+ {
+ NSTimeInterval duration = animation.duration;
+ NSTimeInterval delay = animation.delay;
+ UIViewAnimationCurve curve = animation.curve;
+
+ [self incrementUseCount];
+ [UIView beginAnimations:nil context:nil];
+ [UIView setAnimationDuration:duration];
+ [UIView setAnimationDelay:delay];
+ [UIView setAnimationCurve:curve];
+ [UIView setAnimationDelegate:self];
+ [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
+ animation.animations(self);
+ [UIView commitAnimations];
+ }
+ [UIView commitAnimations];
+}
+
+- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context{
+ [self decrementUseCount];
+}
+
+- (void)performTransition
+{
+ self.startingViewController.view.hidden = YES;
+ self.destinationViewController.view.hidden = YES;
+
+
+ UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
+ [keyWindow addSubview:self.view];
+
+ [self.startingViewController.navigationController presentViewController:self.destinationViewController animated:NO completion:nil];
+}
+
+- (void)unwindTransition
+{
+ self.startingViewController.view.hidden = YES;
+ self.destinationViewController.view.hidden = YES;
+
+ UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
+ [keyWindow addSubview:self.view];
+
+ [self.destinationViewController dismissViewControllerAnimated:NO completion:nil];
+}
+
+
+
+- (void)incrementUseCount
+{
+ self.useCount++;
+}
+
+- (void)decrementUseCount
+{
+ self.useCount--;
+
+ [self removeSmokescreenIfUseCountIsZero];
+}
+
+- (void)removeSmokescreenIfUseCountIsZero
+{
+ if (self.useCount != 0)
+ {
+ return;
+ }
+
+ self.startingViewController.view.hidden = NO;
+ self.destinationViewController.view.hidden = NO;
+ [self.view removeFromSuperview];
+}
+
+@end
16 SGSmokeScreenViewController/UIView+Screenshots.h
@@ -0,0 +1,16 @@
+//
+// UIView+Screenshots.h
+// ZoomingTest
+//
+// Created by Justin Williams on 7/2/13.
+// Copyright (c) 2013 Second Gear. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface UIView (Screenshots)
+
++ (UIImageView *)screenshotForScreen;
++ (UIImageView *)screenshotForView:(UIView *)view;
+
+@end
68 SGSmokeScreenViewController/UIView+Screenshots.m
@@ -0,0 +1,68 @@
+//
+// UIView+Screenshots.m
+// ZoomingTest
+//
+// Created by Justin Williams on 7/2/13.
+// Copyright (c) 2013 Second Gear. All rights reserved.
+//
+
+#import <QuartzCore/QuartzCore.h>
+#import "UIView+Screenshots.h"
+
+@implementation UIView (Screenshots)
+
++ (UIImageView *)screenshotForScreen
+{
+ UIView *view = [UIApplication sharedApplication].keyWindow;
+
+ UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, [[UIScreen mainScreen] scale]);
+
+ [view.layer renderInContext:UIGraphicsGetCurrentContext()];
+ UIImage *screenshotImage = UIGraphicsGetImageFromCurrentImageContext();
+ UIGraphicsEndImageContext();
+
+ CGFloat barHeight = [[UIApplication sharedApplication] statusBarFrame].size.height;
+
+ if ([[UIApplication sharedApplication] isStatusBarHidden] == NO)
+ {
+ CGFloat scale = [[UIScreen mainScreen] scale];
+ CGFloat scaledY = barHeight * scale;
+ CGFloat scaledWidth = view.bounds.size.width * scale;
+ CGFloat scaledHeight = ((view.bounds.size.height - barHeight) * scale);
+
+ CGRect rect = (CGRect) { {0, scaledY }, { scaledWidth, scaledHeight } };
+
+ CGImageRef imageRef = CGImageCreateWithImageInRect(screenshotImage.CGImage, rect);
+ screenshotImage = [UIImage imageWithCGImage:imageRef scale:screenshotImage.scale orientation:screenshotImage.imageOrientation];
+ }
+
+ UIImageView *screenshotView = [[UIImageView alloc] initWithImage:screenshotImage];
+ screenshotView.frame = (CGRect) { CGPointZero, { view.bounds.size.width, view.bounds.size.height - barHeight }};
+
+ return screenshotView;
+}
+
++ (UIImageView *)screenshotForView:(UIView *)view
+{
+ BOOL isViewHidden = NO;
+
+ if (view.hidden == YES)
+ {
+ isViewHidden = YES;
+ view.hidden = NO;
+ }
+
+ UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, [[UIScreen mainScreen] scale]);
+
+ [view.layer renderInContext:UIGraphicsGetCurrentContext()];
+ UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
+ UIGraphicsEndImageContext();
+
+ UIImageView *screenshotView = [[UIImageView alloc] initWithImage:viewImage];
+ screenshotView.frame = (CGRect) { CGPointZero, view.bounds.size };
+ view.hidden = isViewHidden;
+
+ return screenshotView;
+}
+
+@end
Please sign in to comment.
Something went wrong with that request. Please try again.