├── .DS_Store ├── LICENSE ├── README.md ├── SecretTestApp.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── SecretTestApp.xccheckout │ └── xcuserdata │ │ └── pango.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── aaronpang.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ ├── SecretTestApp.xcscheme │ │ └── xcschememanagement.plist │ └── pango.xcuserdatad │ └── xcschemes │ ├── SecretTestApp.xcscheme │ └── xcschememanagement.plist ├── SecretTestApp ├── AppDelegate.h ├── AppDelegate.m ├── CommentCell.h ├── CommentCell.m ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── RootViewController.h ├── RootViewController.m ├── SecretTestApp-Info.plist ├── SecretTestApp-Prefix.pch ├── ToolBarView.h ├── ToolBarView.m ├── UIFont+SecretFont.h ├── UIFont+SecretFont.m ├── UIImage+ImageEffects.h ├── UIImage+ImageEffects.m ├── UIView+GradientMask.h ├── UIView+GradientMask.m ├── bluejay.jpg ├── commentButton.png ├── en.lproj │ └── InfoPlist.strings ├── likeButtonToolbar_selected.png ├── likeButtonToolbar_unselected.png ├── likeButton_highlighted.png ├── likeButton_selected.png ├── likeButton_unselected.png ├── like_greyIcon.png ├── main.m ├── moreButton.png └── secret.png └── SecretTestAppTests ├── SecretTestAppTests-Info.plist ├── SecretTestAppTests.m └── en.lproj └── InfoPlist.strings /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpang/SecretViewer/ff711fe21a079155b427b66855c9ed0814a501d2/.DS_Store -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Aaron Pang 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. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SecretViewer 2 | ============ 3 | 4 | A quick fun test to remake the Secret Viewer for the Secret App. 5 | 6 | Download to check it out! I'm trying to make it almost identical to the Secret Viewer and I whipped this up in about 3 days so if you want to help out or just check out how I did things download the source here! 7 | 8 | Also make sure to check out my blog at http://aaronpango.svbtle.com/ 9 | 10 | [![ParallaxDemo.gif](https://d23f6h5jpj26xu.cloudfront.net/kn8dibaywmlava_small.gif)](http://img.svbtle.com/kn8dibaywmlava.gif) 11 | [![StickyDemo.gif](https://d23f6h5jpj26xu.cloudfront.net/c44kcwl1gkblg_small.gif)](http://img.svbtle.com/c44kcwl1gkblg.gif) 12 | [![ZoomDemo.gif](https://d23f6h5jpj26xu.cloudfront.net/louyhzqwxe6kdg_small.gif)](http://img.svbtle.com/louyhzqwxe6kdg.gif) 13 | [![HeartDemo.gif](https://d23f6h5jpj26xu.cloudfront.net/jc370o6qumdmkg_small.gif)](http://img.svbtle.com/jc370o6qumdmkg.gif) 14 | -------------------------------------------------------------------------------- /SecretTestApp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E31DF78718E61B4A007F3A8F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E31DF78618E61B4A007F3A8F /* Foundation.framework */; }; 11 | E31DF78918E61B4A007F3A8F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E31DF78818E61B4A007F3A8F /* CoreGraphics.framework */; }; 12 | E31DF78B18E61B4A007F3A8F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E31DF78A18E61B4A007F3A8F /* UIKit.framework */; }; 13 | E31DF79118E61B4A007F3A8F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E31DF78F18E61B4A007F3A8F /* InfoPlist.strings */; }; 14 | E31DF79318E61B4A007F3A8F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E31DF79218E61B4A007F3A8F /* main.m */; }; 15 | E31DF79718E61B4A007F3A8F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E31DF79618E61B4A007F3A8F /* AppDelegate.m */; }; 16 | E31DF79918E61B4A007F3A8F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E31DF79818E61B4A007F3A8F /* Images.xcassets */; }; 17 | E31DF7A018E61B4A007F3A8F /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E31DF79F18E61B4A007F3A8F /* XCTest.framework */; }; 18 | E31DF7A118E61B4A007F3A8F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E31DF78618E61B4A007F3A8F /* Foundation.framework */; }; 19 | E31DF7A218E61B4A007F3A8F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E31DF78A18E61B4A007F3A8F /* UIKit.framework */; }; 20 | E31DF7AA18E61B4A007F3A8F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E31DF7A818E61B4A007F3A8F /* InfoPlist.strings */; }; 21 | E31DF7AC18E61B4A007F3A8F /* SecretTestAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E31DF7AB18E61B4A007F3A8F /* SecretTestAppTests.m */; }; 22 | E31DF7B718E61B60007F3A8F /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E31DF7B618E61B60007F3A8F /* RootViewController.m */; }; 23 | E31DF7B918E62E64007F3A8F /* bluejay.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E31DF7B818E62E64007F3A8F /* bluejay.jpg */; }; 24 | E31DF7BC18E64CED007F3A8F /* UIImage+ImageEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = E31DF7BB18E64CED007F3A8F /* UIImage+ImageEffects.m */; }; 25 | E31DF7C018E678DE007F3A8F /* secret.png in Resources */ = {isa = PBXBuildFile; fileRef = E31DF7BF18E678DE007F3A8F /* secret.png */; }; 26 | E31DF7C318E67CD3007F3A8F /* ToolBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = E31DF7C218E67CD3007F3A8F /* ToolBarView.m */; }; 27 | E31DF7C918E746A6007F3A8F /* UIFont+SecretFont.m in Sources */ = {isa = PBXBuildFile; fileRef = E31DF7C818E746A6007F3A8F /* UIFont+SecretFont.m */; }; 28 | E31DF7CC18E7EA47007F3A8F /* CommentCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E31DF7CB18E7EA47007F3A8F /* CommentCell.m */; }; 29 | E3920CC218EA1A7300C0DF6C /* like_greyIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = E3920CBF18EA1A7300C0DF6C /* like_greyIcon.png */; }; 30 | E3920CC518EA27AE00C0DF6C /* likeButton_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = E3920CC318EA27AE00C0DF6C /* likeButton_selected.png */; }; 31 | E3920CC618EA27AE00C0DF6C /* likeButton_unselected.png in Resources */ = {isa = PBXBuildFile; fileRef = E3920CC418EA27AE00C0DF6C /* likeButton_unselected.png */; }; 32 | E3920CC818EA283700C0DF6C /* likeButton_highlighted.png in Resources */ = {isa = PBXBuildFile; fileRef = E3920CC718EA283700C0DF6C /* likeButton_highlighted.png */; }; 33 | E3920CED18EB3FF400C0DF6C /* UIView+GradientMask.m in Sources */ = {isa = PBXBuildFile; fileRef = E3920CEC18EB3FF400C0DF6C /* UIView+GradientMask.m */; }; 34 | E3920CF118EB471A00C0DF6C /* moreButton.png in Resources */ = {isa = PBXBuildFile; fileRef = E3920CF018EB471A00C0DF6C /* moreButton.png */; }; 35 | E3920CF518EB4CC400C0DF6C /* likeButtonToolbar_unselected.png in Resources */ = {isa = PBXBuildFile; fileRef = E3920CF218EB4CC400C0DF6C /* likeButtonToolbar_unselected.png */; }; 36 | E3920CF618EB4CC400C0DF6C /* commentButton.png in Resources */ = {isa = PBXBuildFile; fileRef = E3920CF318EB4CC400C0DF6C /* commentButton.png */; }; 37 | E3920CF718EB4CC400C0DF6C /* likeButtonToolbar_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = E3920CF418EB4CC400C0DF6C /* likeButtonToolbar_selected.png */; }; 38 | /* End PBXBuildFile section */ 39 | 40 | /* Begin PBXContainerItemProxy section */ 41 | E31DF7A318E61B4A007F3A8F /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = E31DF77B18E61B4A007F3A8F /* Project object */; 44 | proxyType = 1; 45 | remoteGlobalIDString = E31DF78218E61B4A007F3A8F; 46 | remoteInfo = SecretTestApp; 47 | }; 48 | /* End PBXContainerItemProxy section */ 49 | 50 | /* Begin PBXFileReference section */ 51 | E31DF78318E61B4A007F3A8F /* SecretTestApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SecretTestApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | E31DF78618E61B4A007F3A8F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 53 | E31DF78818E61B4A007F3A8F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 54 | E31DF78A18E61B4A007F3A8F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 55 | E31DF78E18E61B4A007F3A8F /* SecretTestApp-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SecretTestApp-Info.plist"; sourceTree = ""; }; 56 | E31DF79018E61B4A007F3A8F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 57 | E31DF79218E61B4A007F3A8F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 58 | E31DF79418E61B4A007F3A8F /* SecretTestApp-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SecretTestApp-Prefix.pch"; sourceTree = ""; }; 59 | E31DF79518E61B4A007F3A8F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 60 | E31DF79618E61B4A007F3A8F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 61 | E31DF79818E61B4A007F3A8F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 62 | E31DF79E18E61B4A007F3A8F /* SecretTestAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SecretTestAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 63 | E31DF79F18E61B4A007F3A8F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 64 | E31DF7A718E61B4A007F3A8F /* SecretTestAppTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SecretTestAppTests-Info.plist"; sourceTree = ""; }; 65 | E31DF7A918E61B4A007F3A8F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 66 | E31DF7AB18E61B4A007F3A8F /* SecretTestAppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SecretTestAppTests.m; sourceTree = ""; }; 67 | E31DF7B518E61B60007F3A8F /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; 68 | E31DF7B618E61B60007F3A8F /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = ""; }; 69 | E31DF7B818E62E64007F3A8F /* bluejay.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = bluejay.jpg; sourceTree = ""; }; 70 | E31DF7BA18E64CED007F3A8F /* UIImage+ImageEffects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+ImageEffects.h"; sourceTree = ""; }; 71 | E31DF7BB18E64CED007F3A8F /* UIImage+ImageEffects.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+ImageEffects.m"; sourceTree = ""; }; 72 | E31DF7BF18E678DE007F3A8F /* secret.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = secret.png; sourceTree = ""; }; 73 | E31DF7C118E67CD3007F3A8F /* ToolBarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ToolBarView.h; sourceTree = ""; }; 74 | E31DF7C218E67CD3007F3A8F /* ToolBarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ToolBarView.m; sourceTree = ""; }; 75 | E31DF7C718E746A6007F3A8F /* UIFont+SecretFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIFont+SecretFont.h"; sourceTree = ""; }; 76 | E31DF7C818E746A6007F3A8F /* UIFont+SecretFont.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIFont+SecretFont.m"; sourceTree = ""; }; 77 | E31DF7CA18E7EA47007F3A8F /* CommentCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommentCell.h; sourceTree = ""; }; 78 | E31DF7CB18E7EA47007F3A8F /* CommentCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommentCell.m; sourceTree = ""; }; 79 | E3920CBF18EA1A7300C0DF6C /* like_greyIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = like_greyIcon.png; sourceTree = ""; }; 80 | E3920CC318EA27AE00C0DF6C /* likeButton_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = likeButton_selected.png; sourceTree = ""; }; 81 | E3920CC418EA27AE00C0DF6C /* likeButton_unselected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = likeButton_unselected.png; sourceTree = ""; }; 82 | E3920CC718EA283700C0DF6C /* likeButton_highlighted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = likeButton_highlighted.png; sourceTree = ""; }; 83 | E3920CEB18EB3FF400C0DF6C /* UIView+GradientMask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+GradientMask.h"; sourceTree = ""; }; 84 | E3920CEC18EB3FF400C0DF6C /* UIView+GradientMask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+GradientMask.m"; sourceTree = ""; }; 85 | E3920CF018EB471A00C0DF6C /* moreButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = moreButton.png; sourceTree = ""; }; 86 | E3920CF218EB4CC400C0DF6C /* likeButtonToolbar_unselected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = likeButtonToolbar_unselected.png; sourceTree = ""; }; 87 | E3920CF318EB4CC400C0DF6C /* commentButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = commentButton.png; sourceTree = ""; }; 88 | E3920CF418EB4CC400C0DF6C /* likeButtonToolbar_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = likeButtonToolbar_selected.png; sourceTree = ""; }; 89 | /* End PBXFileReference section */ 90 | 91 | /* Begin PBXFrameworksBuildPhase section */ 92 | E31DF78018E61B4A007F3A8F /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | E31DF78918E61B4A007F3A8F /* CoreGraphics.framework in Frameworks */, 97 | E31DF78B18E61B4A007F3A8F /* UIKit.framework in Frameworks */, 98 | E31DF78718E61B4A007F3A8F /* Foundation.framework in Frameworks */, 99 | ); 100 | runOnlyForDeploymentPostprocessing = 0; 101 | }; 102 | E31DF79B18E61B4A007F3A8F /* Frameworks */ = { 103 | isa = PBXFrameworksBuildPhase; 104 | buildActionMask = 2147483647; 105 | files = ( 106 | E31DF7A018E61B4A007F3A8F /* XCTest.framework in Frameworks */, 107 | E31DF7A218E61B4A007F3A8F /* UIKit.framework in Frameworks */, 108 | E31DF7A118E61B4A007F3A8F /* Foundation.framework in Frameworks */, 109 | ); 110 | runOnlyForDeploymentPostprocessing = 0; 111 | }; 112 | /* End PBXFrameworksBuildPhase section */ 113 | 114 | /* Begin PBXGroup section */ 115 | E31DF77A18E61B4A007F3A8F = { 116 | isa = PBXGroup; 117 | children = ( 118 | E31DF78C18E61B4A007F3A8F /* SecretTestApp */, 119 | E31DF7A518E61B4A007F3A8F /* SecretTestAppTests */, 120 | E31DF78518E61B4A007F3A8F /* Frameworks */, 121 | E31DF78418E61B4A007F3A8F /* Products */, 122 | ); 123 | sourceTree = ""; 124 | }; 125 | E31DF78418E61B4A007F3A8F /* Products */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | E31DF78318E61B4A007F3A8F /* SecretTestApp.app */, 129 | E31DF79E18E61B4A007F3A8F /* SecretTestAppTests.xctest */, 130 | ); 131 | name = Products; 132 | sourceTree = ""; 133 | }; 134 | E31DF78518E61B4A007F3A8F /* Frameworks */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | E31DF78618E61B4A007F3A8F /* Foundation.framework */, 138 | E31DF78818E61B4A007F3A8F /* CoreGraphics.framework */, 139 | E31DF78A18E61B4A007F3A8F /* UIKit.framework */, 140 | E31DF79F18E61B4A007F3A8F /* XCTest.framework */, 141 | ); 142 | name = Frameworks; 143 | sourceTree = ""; 144 | }; 145 | E31DF78C18E61B4A007F3A8F /* SecretTestApp */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | E31DF79518E61B4A007F3A8F /* AppDelegate.h */, 149 | E31DF79618E61B4A007F3A8F /* AppDelegate.m */, 150 | E3920CCC18EA4A4200C0DF6C /* Resources */, 151 | E3920D1718EB9C0500C0DF6C /* Categories */, 152 | E31DF7B518E61B60007F3A8F /* RootViewController.h */, 153 | E31DF7B618E61B60007F3A8F /* RootViewController.m */, 154 | E31DF7CA18E7EA47007F3A8F /* CommentCell.h */, 155 | E31DF7CB18E7EA47007F3A8F /* CommentCell.m */, 156 | E31DF7C118E67CD3007F3A8F /* ToolBarView.h */, 157 | E31DF7C218E67CD3007F3A8F /* ToolBarView.m */, 158 | E31DF79818E61B4A007F3A8F /* Images.xcassets */, 159 | E31DF78D18E61B4A007F3A8F /* Supporting Files */, 160 | ); 161 | path = SecretTestApp; 162 | sourceTree = ""; 163 | }; 164 | E31DF78D18E61B4A007F3A8F /* Supporting Files */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | E31DF78E18E61B4A007F3A8F /* SecretTestApp-Info.plist */, 168 | E31DF78F18E61B4A007F3A8F /* InfoPlist.strings */, 169 | E31DF79218E61B4A007F3A8F /* main.m */, 170 | E31DF79418E61B4A007F3A8F /* SecretTestApp-Prefix.pch */, 171 | ); 172 | name = "Supporting Files"; 173 | sourceTree = ""; 174 | }; 175 | E31DF7A518E61B4A007F3A8F /* SecretTestAppTests */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | E31DF7AB18E61B4A007F3A8F /* SecretTestAppTests.m */, 179 | E31DF7A618E61B4A007F3A8F /* Supporting Files */, 180 | ); 181 | path = SecretTestAppTests; 182 | sourceTree = ""; 183 | }; 184 | E31DF7A618E61B4A007F3A8F /* Supporting Files */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | E31DF7A718E61B4A007F3A8F /* SecretTestAppTests-Info.plist */, 188 | E31DF7A818E61B4A007F3A8F /* InfoPlist.strings */, 189 | ); 190 | name = "Supporting Files"; 191 | sourceTree = ""; 192 | }; 193 | E3920CCC18EA4A4200C0DF6C /* Resources */ = { 194 | isa = PBXGroup; 195 | children = ( 196 | E3920CF018EB471A00C0DF6C /* moreButton.png */, 197 | E3920CC318EA27AE00C0DF6C /* likeButton_selected.png */, 198 | E3920CC418EA27AE00C0DF6C /* likeButton_unselected.png */, 199 | E3920CC718EA283700C0DF6C /* likeButton_highlighted.png */, 200 | E3920CBF18EA1A7300C0DF6C /* like_greyIcon.png */, 201 | E31DF7B818E62E64007F3A8F /* bluejay.jpg */, 202 | E31DF7BF18E678DE007F3A8F /* secret.png */, 203 | E3920CF218EB4CC400C0DF6C /* likeButtonToolbar_unselected.png */, 204 | E3920CF318EB4CC400C0DF6C /* commentButton.png */, 205 | E3920CF418EB4CC400C0DF6C /* likeButtonToolbar_selected.png */, 206 | ); 207 | name = Resources; 208 | sourceTree = ""; 209 | }; 210 | E3920D1718EB9C0500C0DF6C /* Categories */ = { 211 | isa = PBXGroup; 212 | children = ( 213 | E31DF7C718E746A6007F3A8F /* UIFont+SecretFont.h */, 214 | E31DF7C818E746A6007F3A8F /* UIFont+SecretFont.m */, 215 | E31DF7BA18E64CED007F3A8F /* UIImage+ImageEffects.h */, 216 | E31DF7BB18E64CED007F3A8F /* UIImage+ImageEffects.m */, 217 | E3920CEB18EB3FF400C0DF6C /* UIView+GradientMask.h */, 218 | E3920CEC18EB3FF400C0DF6C /* UIView+GradientMask.m */, 219 | ); 220 | name = Categories; 221 | sourceTree = ""; 222 | }; 223 | /* End PBXGroup section */ 224 | 225 | /* Begin PBXNativeTarget section */ 226 | E31DF78218E61B4A007F3A8F /* SecretTestApp */ = { 227 | isa = PBXNativeTarget; 228 | buildConfigurationList = E31DF7AF18E61B4A007F3A8F /* Build configuration list for PBXNativeTarget "SecretTestApp" */; 229 | buildPhases = ( 230 | E31DF77F18E61B4A007F3A8F /* Sources */, 231 | E31DF78018E61B4A007F3A8F /* Frameworks */, 232 | E31DF78118E61B4A007F3A8F /* Resources */, 233 | ); 234 | buildRules = ( 235 | ); 236 | dependencies = ( 237 | ); 238 | name = SecretTestApp; 239 | productName = SecretTestApp; 240 | productReference = E31DF78318E61B4A007F3A8F /* SecretTestApp.app */; 241 | productType = "com.apple.product-type.application"; 242 | }; 243 | E31DF79D18E61B4A007F3A8F /* SecretTestAppTests */ = { 244 | isa = PBXNativeTarget; 245 | buildConfigurationList = E31DF7B218E61B4A007F3A8F /* Build configuration list for PBXNativeTarget "SecretTestAppTests" */; 246 | buildPhases = ( 247 | E31DF79A18E61B4A007F3A8F /* Sources */, 248 | E31DF79B18E61B4A007F3A8F /* Frameworks */, 249 | E31DF79C18E61B4A007F3A8F /* Resources */, 250 | ); 251 | buildRules = ( 252 | ); 253 | dependencies = ( 254 | E31DF7A418E61B4A007F3A8F /* PBXTargetDependency */, 255 | ); 256 | name = SecretTestAppTests; 257 | productName = SecretTestAppTests; 258 | productReference = E31DF79E18E61B4A007F3A8F /* SecretTestAppTests.xctest */; 259 | productType = "com.apple.product-type.bundle.unit-test"; 260 | }; 261 | /* End PBXNativeTarget section */ 262 | 263 | /* Begin PBXProject section */ 264 | E31DF77B18E61B4A007F3A8F /* Project object */ = { 265 | isa = PBXProject; 266 | attributes = { 267 | LastUpgradeCheck = 0500; 268 | ORGANIZATIONNAME = "Aaron Pang"; 269 | TargetAttributes = { 270 | E31DF79D18E61B4A007F3A8F = { 271 | TestTargetID = E31DF78218E61B4A007F3A8F; 272 | }; 273 | }; 274 | }; 275 | buildConfigurationList = E31DF77E18E61B4A007F3A8F /* Build configuration list for PBXProject "SecretTestApp" */; 276 | compatibilityVersion = "Xcode 3.2"; 277 | developmentRegion = English; 278 | hasScannedForEncodings = 0; 279 | knownRegions = ( 280 | en, 281 | ); 282 | mainGroup = E31DF77A18E61B4A007F3A8F; 283 | productRefGroup = E31DF78418E61B4A007F3A8F /* Products */; 284 | projectDirPath = ""; 285 | projectRoot = ""; 286 | targets = ( 287 | E31DF78218E61B4A007F3A8F /* SecretTestApp */, 288 | E31DF79D18E61B4A007F3A8F /* SecretTestAppTests */, 289 | ); 290 | }; 291 | /* End PBXProject section */ 292 | 293 | /* Begin PBXResourcesBuildPhase section */ 294 | E31DF78118E61B4A007F3A8F /* Resources */ = { 295 | isa = PBXResourcesBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | E3920CF518EB4CC400C0DF6C /* likeButtonToolbar_unselected.png in Resources */, 299 | E31DF7B918E62E64007F3A8F /* bluejay.jpg in Resources */, 300 | E31DF79118E61B4A007F3A8F /* InfoPlist.strings in Resources */, 301 | E3920CF118EB471A00C0DF6C /* moreButton.png in Resources */, 302 | E3920CC618EA27AE00C0DF6C /* likeButton_unselected.png in Resources */, 303 | E31DF79918E61B4A007F3A8F /* Images.xcassets in Resources */, 304 | E3920CC518EA27AE00C0DF6C /* likeButton_selected.png in Resources */, 305 | E3920CC218EA1A7300C0DF6C /* like_greyIcon.png in Resources */, 306 | E3920CC818EA283700C0DF6C /* likeButton_highlighted.png in Resources */, 307 | E3920CF718EB4CC400C0DF6C /* likeButtonToolbar_selected.png in Resources */, 308 | E31DF7C018E678DE007F3A8F /* secret.png in Resources */, 309 | E3920CF618EB4CC400C0DF6C /* commentButton.png in Resources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | E31DF79C18E61B4A007F3A8F /* Resources */ = { 314 | isa = PBXResourcesBuildPhase; 315 | buildActionMask = 2147483647; 316 | files = ( 317 | E31DF7AA18E61B4A007F3A8F /* InfoPlist.strings in Resources */, 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | /* End PBXResourcesBuildPhase section */ 322 | 323 | /* Begin PBXSourcesBuildPhase section */ 324 | E31DF77F18E61B4A007F3A8F /* Sources */ = { 325 | isa = PBXSourcesBuildPhase; 326 | buildActionMask = 2147483647; 327 | files = ( 328 | E31DF7BC18E64CED007F3A8F /* UIImage+ImageEffects.m in Sources */, 329 | E31DF7C318E67CD3007F3A8F /* ToolBarView.m in Sources */, 330 | E31DF7CC18E7EA47007F3A8F /* CommentCell.m in Sources */, 331 | E31DF79718E61B4A007F3A8F /* AppDelegate.m in Sources */, 332 | E31DF79318E61B4A007F3A8F /* main.m in Sources */, 333 | E31DF7B718E61B60007F3A8F /* RootViewController.m in Sources */, 334 | E3920CED18EB3FF400C0DF6C /* UIView+GradientMask.m in Sources */, 335 | E31DF7C918E746A6007F3A8F /* UIFont+SecretFont.m in Sources */, 336 | ); 337 | runOnlyForDeploymentPostprocessing = 0; 338 | }; 339 | E31DF79A18E61B4A007F3A8F /* Sources */ = { 340 | isa = PBXSourcesBuildPhase; 341 | buildActionMask = 2147483647; 342 | files = ( 343 | E31DF7AC18E61B4A007F3A8F /* SecretTestAppTests.m in Sources */, 344 | ); 345 | runOnlyForDeploymentPostprocessing = 0; 346 | }; 347 | /* End PBXSourcesBuildPhase section */ 348 | 349 | /* Begin PBXTargetDependency section */ 350 | E31DF7A418E61B4A007F3A8F /* PBXTargetDependency */ = { 351 | isa = PBXTargetDependency; 352 | target = E31DF78218E61B4A007F3A8F /* SecretTestApp */; 353 | targetProxy = E31DF7A318E61B4A007F3A8F /* PBXContainerItemProxy */; 354 | }; 355 | /* End PBXTargetDependency section */ 356 | 357 | /* Begin PBXVariantGroup section */ 358 | E31DF78F18E61B4A007F3A8F /* InfoPlist.strings */ = { 359 | isa = PBXVariantGroup; 360 | children = ( 361 | E31DF79018E61B4A007F3A8F /* en */, 362 | ); 363 | name = InfoPlist.strings; 364 | sourceTree = ""; 365 | }; 366 | E31DF7A818E61B4A007F3A8F /* InfoPlist.strings */ = { 367 | isa = PBXVariantGroup; 368 | children = ( 369 | E31DF7A918E61B4A007F3A8F /* en */, 370 | ); 371 | name = InfoPlist.strings; 372 | sourceTree = ""; 373 | }; 374 | /* End PBXVariantGroup section */ 375 | 376 | /* Begin XCBuildConfiguration section */ 377 | E31DF7AD18E61B4A007F3A8F /* Debug */ = { 378 | isa = XCBuildConfiguration; 379 | buildSettings = { 380 | ALWAYS_SEARCH_USER_PATHS = NO; 381 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 382 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 383 | CLANG_CXX_LIBRARY = "libc++"; 384 | CLANG_ENABLE_MODULES = YES; 385 | CLANG_ENABLE_OBJC_ARC = YES; 386 | CLANG_WARN_BOOL_CONVERSION = YES; 387 | CLANG_WARN_CONSTANT_CONVERSION = YES; 388 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 389 | CLANG_WARN_EMPTY_BODY = YES; 390 | CLANG_WARN_ENUM_CONVERSION = YES; 391 | CLANG_WARN_INT_CONVERSION = YES; 392 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 393 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 394 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 395 | COPY_PHASE_STRIP = NO; 396 | GCC_C_LANGUAGE_STANDARD = gnu99; 397 | GCC_DYNAMIC_NO_PIC = NO; 398 | GCC_OPTIMIZATION_LEVEL = 0; 399 | GCC_PREPROCESSOR_DEFINITIONS = ( 400 | "DEBUG=1", 401 | "$(inherited)", 402 | ); 403 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 404 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 405 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 406 | GCC_WARN_UNDECLARED_SELECTOR = YES; 407 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 408 | GCC_WARN_UNUSED_FUNCTION = YES; 409 | GCC_WARN_UNUSED_VARIABLE = YES; 410 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 411 | ONLY_ACTIVE_ARCH = YES; 412 | SDKROOT = iphoneos; 413 | }; 414 | name = Debug; 415 | }; 416 | E31DF7AE18E61B4A007F3A8F /* Release */ = { 417 | isa = XCBuildConfiguration; 418 | buildSettings = { 419 | ALWAYS_SEARCH_USER_PATHS = NO; 420 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 421 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 422 | CLANG_CXX_LIBRARY = "libc++"; 423 | CLANG_ENABLE_MODULES = YES; 424 | CLANG_ENABLE_OBJC_ARC = YES; 425 | CLANG_WARN_BOOL_CONVERSION = YES; 426 | CLANG_WARN_CONSTANT_CONVERSION = YES; 427 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 428 | CLANG_WARN_EMPTY_BODY = YES; 429 | CLANG_WARN_ENUM_CONVERSION = YES; 430 | CLANG_WARN_INT_CONVERSION = YES; 431 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 432 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 433 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 434 | COPY_PHASE_STRIP = YES; 435 | ENABLE_NS_ASSERTIONS = NO; 436 | GCC_C_LANGUAGE_STANDARD = gnu99; 437 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 438 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 439 | GCC_WARN_UNDECLARED_SELECTOR = YES; 440 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 441 | GCC_WARN_UNUSED_FUNCTION = YES; 442 | GCC_WARN_UNUSED_VARIABLE = YES; 443 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 444 | SDKROOT = iphoneos; 445 | VALIDATE_PRODUCT = YES; 446 | }; 447 | name = Release; 448 | }; 449 | E31DF7B018E61B4A007F3A8F /* Debug */ = { 450 | isa = XCBuildConfiguration; 451 | buildSettings = { 452 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 453 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 454 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 455 | GCC_PREFIX_HEADER = "SecretTestApp/SecretTestApp-Prefix.pch"; 456 | INFOPLIST_FILE = "SecretTestApp/SecretTestApp-Info.plist"; 457 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 458 | PRODUCT_NAME = "$(TARGET_NAME)"; 459 | WRAPPER_EXTENSION = app; 460 | }; 461 | name = Debug; 462 | }; 463 | E31DF7B118E61B4A007F3A8F /* Release */ = { 464 | isa = XCBuildConfiguration; 465 | buildSettings = { 466 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 467 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 468 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 469 | GCC_PREFIX_HEADER = "SecretTestApp/SecretTestApp-Prefix.pch"; 470 | INFOPLIST_FILE = "SecretTestApp/SecretTestApp-Info.plist"; 471 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 472 | PRODUCT_NAME = "$(TARGET_NAME)"; 473 | WRAPPER_EXTENSION = app; 474 | }; 475 | name = Release; 476 | }; 477 | E31DF7B318E61B4A007F3A8F /* Debug */ = { 478 | isa = XCBuildConfiguration; 479 | buildSettings = { 480 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 481 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SecretTestApp.app/SecretTestApp"; 482 | FRAMEWORK_SEARCH_PATHS = ( 483 | "$(SDKROOT)/Developer/Library/Frameworks", 484 | "$(inherited)", 485 | "$(DEVELOPER_FRAMEWORKS_DIR)", 486 | ); 487 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 488 | GCC_PREFIX_HEADER = "SecretTestApp/SecretTestApp-Prefix.pch"; 489 | GCC_PREPROCESSOR_DEFINITIONS = ( 490 | "DEBUG=1", 491 | "$(inherited)", 492 | ); 493 | INFOPLIST_FILE = "SecretTestAppTests/SecretTestAppTests-Info.plist"; 494 | PRODUCT_NAME = "$(TARGET_NAME)"; 495 | TEST_HOST = "$(BUNDLE_LOADER)"; 496 | WRAPPER_EXTENSION = xctest; 497 | }; 498 | name = Debug; 499 | }; 500 | E31DF7B418E61B4A007F3A8F /* Release */ = { 501 | isa = XCBuildConfiguration; 502 | buildSettings = { 503 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 504 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SecretTestApp.app/SecretTestApp"; 505 | FRAMEWORK_SEARCH_PATHS = ( 506 | "$(SDKROOT)/Developer/Library/Frameworks", 507 | "$(inherited)", 508 | "$(DEVELOPER_FRAMEWORKS_DIR)", 509 | ); 510 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 511 | GCC_PREFIX_HEADER = "SecretTestApp/SecretTestApp-Prefix.pch"; 512 | INFOPLIST_FILE = "SecretTestAppTests/SecretTestAppTests-Info.plist"; 513 | PRODUCT_NAME = "$(TARGET_NAME)"; 514 | TEST_HOST = "$(BUNDLE_LOADER)"; 515 | WRAPPER_EXTENSION = xctest; 516 | }; 517 | name = Release; 518 | }; 519 | /* End XCBuildConfiguration section */ 520 | 521 | /* Begin XCConfigurationList section */ 522 | E31DF77E18E61B4A007F3A8F /* Build configuration list for PBXProject "SecretTestApp" */ = { 523 | isa = XCConfigurationList; 524 | buildConfigurations = ( 525 | E31DF7AD18E61B4A007F3A8F /* Debug */, 526 | E31DF7AE18E61B4A007F3A8F /* Release */, 527 | ); 528 | defaultConfigurationIsVisible = 0; 529 | defaultConfigurationName = Release; 530 | }; 531 | E31DF7AF18E61B4A007F3A8F /* Build configuration list for PBXNativeTarget "SecretTestApp" */ = { 532 | isa = XCConfigurationList; 533 | buildConfigurations = ( 534 | E31DF7B018E61B4A007F3A8F /* Debug */, 535 | E31DF7B118E61B4A007F3A8F /* Release */, 536 | ); 537 | defaultConfigurationIsVisible = 0; 538 | defaultConfigurationName = Release; 539 | }; 540 | E31DF7B218E61B4A007F3A8F /* Build configuration list for PBXNativeTarget "SecretTestAppTests" */ = { 541 | isa = XCConfigurationList; 542 | buildConfigurations = ( 543 | E31DF7B318E61B4A007F3A8F /* Debug */, 544 | E31DF7B418E61B4A007F3A8F /* Release */, 545 | ); 546 | defaultConfigurationIsVisible = 0; 547 | defaultConfigurationName = Release; 548 | }; 549 | /* End XCConfigurationList section */ 550 | }; 551 | rootObject = E31DF77B18E61B4A007F3A8F /* Project object */; 552 | } 553 | -------------------------------------------------------------------------------- /SecretTestApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SecretTestApp.xcodeproj/project.xcworkspace/xcshareddata/SecretTestApp.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | A9D03387-415B-4AE5-8F2D-4E79B988D850 9 | IDESourceControlProjectName 10 | SecretTestApp 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | C9C64BC7-4A64-4E6B-B2BC-16E5E542F19A 14 | ssh://github.com/aaronpang/SecretViewer.git 15 | 16 | IDESourceControlProjectPath 17 | SecretTestApp.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | C9C64BC7-4A64-4E6B-B2BC-16E5E542F19A 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/aaronpang/SecretViewer.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | C9C64BC7-4A64-4E6B-B2BC-16E5E542F19A 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | C9C64BC7-4A64-4E6B-B2BC-16E5E542F19A 36 | IDESourceControlWCCName 37 | SecretViewer 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /SecretTestApp.xcodeproj/project.xcworkspace/xcuserdata/pango.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpang/SecretViewer/ff711fe21a079155b427b66855c9ed0814a501d2/SecretTestApp.xcodeproj/project.xcworkspace/xcuserdata/pango.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SecretTestApp.xcodeproj/xcuserdata/aaronpang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /SecretTestApp.xcodeproj/xcuserdata/aaronpang.xcuserdatad/xcschemes/SecretTestApp.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /SecretTestApp.xcodeproj/xcuserdata/aaronpang.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SecretTestApp.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | E31DF78218E61B4A007F3A8F 16 | 17 | primary 18 | 19 | 20 | E31DF79D18E61B4A007F3A8F 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SecretTestApp.xcodeproj/xcuserdata/pango.xcuserdatad/xcschemes/SecretTestApp.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /SecretTestApp.xcodeproj/xcuserdata/pango.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SecretTestApp.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | E31DF78218E61B4A007F3A8F 16 | 17 | primary 18 | 19 | 20 | E31DF79D18E61B4A007F3A8F 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SecretTestApp/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SecretTestApp 4 | // 5 | // Created by Aaron Pang on 3/28/14. 6 | // Copyright (c) 2014 Aaron Pang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SecretTestApp/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SecretTestApp 4 | // 5 | // Created by Aaron Pang on 3/28/14. 6 | // Copyright (c) 2014 Aaron Pang. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "RootViewController.h" 11 | 12 | @implementation AppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 17 | // Override point for customization after application launch. 18 | self.window.backgroundColor = [UIColor whiteColor]; 19 | [self.window makeKeyAndVisible]; 20 | self.window.rootViewController = [[RootViewController alloc] init]; 21 | 22 | return YES; 23 | } 24 | 25 | - (void)applicationWillResignActive:(UIApplication *)application 26 | { 27 | // 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. 28 | // 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. 29 | } 30 | 31 | - (void)applicationDidEnterBackground:(UIApplication *)application 32 | { 33 | // 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. 34 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 35 | } 36 | 37 | - (void)applicationWillEnterForeground:(UIApplication *)application 38 | { 39 | // 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. 40 | } 41 | 42 | - (void)applicationDidBecomeActive:(UIApplication *)application 43 | { 44 | // 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. 45 | } 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application 48 | { 49 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 50 | } 51 | 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /SecretTestApp/CommentCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CommentCell.h 3 | // SecretTestApp 4 | // 5 | // Created by Aaron Pang on 3/29/14. 6 | // Copyright (c) 2014 Aaron Pang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CommentCell : UITableViewCell 12 | 13 | extern const CGFloat kCommentPaddingFromLeft; 14 | extern const CGFloat kCommentPaddingFromRight; 15 | 16 | @property (nonatomic, strong) UIImageView *iconView; 17 | @property (nonatomic, strong) UILabel *commentLabel; 18 | @property (nonatomic, strong) UILabel *timeLabel; 19 | @property (nonatomic, strong) UILabel *likeCountLabel; 20 | @property (nonatomic, strong) UIImageView *likeCountImageView; 21 | @property (nonatomic, strong) UIButton *likeButton; 22 | @end 23 | -------------------------------------------------------------------------------- /SecretTestApp/CommentCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CommentCell.m 3 | // SecretTestApp 4 | // 5 | // Created by Aaron Pang on 3/29/14. 6 | // Copyright (c) 2014 Aaron Pang. All rights reserved. 7 | // 8 | 9 | #import "CommentCell.h" 10 | #import "UIFont+SecretFont.h" 11 | 12 | @implementation CommentCell { 13 | NSInteger _likeCount; 14 | } 15 | const CGFloat kCommentPaddingFromTop = 4.0f; 16 | const CGFloat kCommentPaddingFromLeft = 10.0f; 17 | const CGFloat kCommentPaddingFromRight = 8.0f; 18 | 19 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 20 | { 21 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 22 | if (self) { 23 | self.backgroundColor = [UIColor whiteColor]; 24 | self.iconView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 15, 35, 35)]; 25 | // Go Toronto! 26 | self.iconView.image =[UIImage imageNamed:@"bluejay.jpg"]; 27 | self.iconView.layer.cornerRadius = CGRectGetWidth(self.iconView.frame) / 2.0f; 28 | self.iconView.layer.masksToBounds = YES; 29 | [self addSubview:self.iconView]; 30 | 31 | self.commentLabel = [[UILabel alloc] init]; 32 | self.commentLabel.textColor = [UIColor blackColor]; 33 | self.commentLabel.textAlignment = NSTextAlignmentLeft; 34 | self.commentLabel.font = [UIFont secretFontLightWithSize:16.f]; 35 | self.commentLabel.numberOfLines = 0; 36 | self.commentLabel.frame = (CGRect){.origin = {CGRectGetMinX(self.iconView.frame) + CGRectGetWidth(self.iconView.frame) + kCommentPaddingFromLeft, CGRectGetMinY(self.iconView.frame) + kCommentPaddingFromTop}}; 37 | [self addSubview:self.commentLabel]; 38 | 39 | self.timeLabel = [[UILabel alloc] init]; 40 | self.timeLabel.textColor = [UIColor grayColor]; 41 | self.timeLabel.textAlignment = NSTextAlignmentLeft; 42 | self.timeLabel.font = [UIFont secretFontLightWithSize:12.f]; 43 | self.timeLabel.numberOfLines = 1; 44 | [self addSubview:self.timeLabel]; 45 | 46 | 47 | self.likeButton = [[UIButton alloc] init]; 48 | // Hardcode the x value and size for simplicity 49 | self.likeButton.frame = (CGRect) {.origin = {290,CGRectGetMinY(self.commentLabel.frame) + 5}, .size = {18,18}}; 50 | [self.likeButton setImage:[UIImage imageNamed:@"likeButton_unselected.png"] forState:UIControlStateNormal]; 51 | [self.likeButton setImage:[UIImage imageNamed:@"likeButton_selected.png"] forState:UIControlStateSelected]; 52 | [self.likeButton setImage:[UIImage imageNamed:@"likeButton_highlighted.png"] forState:UIControlStateHighlighted]; 53 | [self.likeButton addTarget:self action:@selector(likeButtonSelected:) forControlEvents:UIControlEventTouchUpInside]; 54 | [self addSubview:self.likeButton]; 55 | 56 | self.likeCountLabel = [[UILabel alloc] init]; 57 | self.likeCountLabel.numberOfLines = 1; 58 | self.likeCountLabel.textColor = [UIColor grayColor]; 59 | self.likeCountLabel.textAlignment = NSTextAlignmentLeft; 60 | self.likeCountLabel.font = [UIFont secretFontLightWithSize:12.f]; 61 | self.likeCountLabel.hidden = YES; 62 | [self addSubview:self.likeCountLabel]; 63 | 64 | self.likeCountImageView = [[UIImageView alloc] init]; 65 | self.likeCountImageView.image = [UIImage imageNamed:@"like_greyIcon.png"]; 66 | self.likeCountImageView.hidden = YES; 67 | [self addSubview:self.likeCountImageView]; 68 | 69 | 70 | 71 | } 72 | return self; 73 | } 74 | 75 | - (void)likeButtonSelected:(id)sender { 76 | self.likeButton.selected = !self.likeButton.selected; 77 | if (self.likeButton.selected) { 78 | _likeCount++; 79 | } else { 80 | _likeCount--; 81 | } 82 | self.likeCountLabel.text = [NSString stringWithFormat:@"%d",_likeCount]; 83 | [self.likeCountLabel sizeToFit]; 84 | self.likeCountImageView.hidden = _likeCount <= 0; 85 | self.likeCountLabel.hidden = _likeCount <= 0; 86 | } 87 | 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /SecretTestApp/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 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /SecretTestApp/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 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /SecretTestApp/RootViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.h 3 | // SecretTestApp 4 | // 5 | // Created by Aaron Pang on 3/28/14. 6 | // Copyright (c) 2014 Aaron Pang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RootViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SecretTestApp/RootViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.m 3 | // SecretTestApp 4 | // 5 | // Created by Aaron Pang on 3/28/14. 6 | // Copyright (c) 2014 Aaron Pang. All rights reserved. 7 | // 8 | 9 | #import "RootViewController.h" 10 | #import "UIImage+ImageEffects.h" 11 | #import "ToolBarView.h" 12 | #import "UIFont+SecretFont.h" 13 | #import "CommentCell.h" 14 | #import "UIView+GradientMask.h" 15 | 16 | #import 17 | 18 | #define HEADER_HEIGHT 320.0f 19 | #define HEADER_INIT_FRAME CGRectMake(0, 0, self.view.frame.size.width, HEADER_HEIGHT) 20 | #define TOOLBAR_INIT_FRAME CGRectMake (0, 292, 320, 22) 21 | 22 | const CGFloat kBarHeight = 50.0f; 23 | const CGFloat kBackgroundParallexFactor = 0.5f; 24 | const CGFloat kBlurFadeInFactor = 0.005f; 25 | const CGFloat kTextFadeOutFactor = 0.05f; 26 | const CGFloat kCommentCellHeight = 50.0f; 27 | 28 | @interface RootViewController () 29 | 30 | @end 31 | 32 | @implementation RootViewController { 33 | UIScrollView *_mainScrollView; 34 | UIScrollView *_backgroundScrollView; 35 | UIImageView *_blurImageView; 36 | UILabel *_textLabel; 37 | ToolBarView *_toolBarView; 38 | UIView *_commentsViewContainer; 39 | UITableView *_commentsTableView; 40 | 41 | // TODO: Implement these 42 | UIGestureRecognizer *_leftSwipeGestureRecognizer; 43 | UIGestureRecognizer *_rightSwipeGestureRecognizer; 44 | 45 | NSMutableArray *comments; 46 | } 47 | 48 | - (id)init { 49 | self = [super init]; 50 | if (self) { 51 | _mainScrollView = [[UIScrollView alloc] initWithFrame:[UIApplication sharedApplication].keyWindow.frame]; 52 | _mainScrollView.delegate = self; 53 | _mainScrollView.bounces = YES; 54 | _mainScrollView.alwaysBounceVertical = YES; 55 | _mainScrollView.contentSize = CGSizeZero; 56 | _mainScrollView.showsVerticalScrollIndicator = YES; 57 | _mainScrollView.scrollIndicatorInsets = UIEdgeInsetsMake(kBarHeight, 0, 0, 0); 58 | self.view = _mainScrollView; 59 | 60 | _backgroundScrollView = [[UIScrollView alloc] initWithFrame:HEADER_INIT_FRAME]; 61 | _backgroundScrollView.scrollEnabled = NO; 62 | _backgroundScrollView.contentSize = CGSizeMake(320, 1000); 63 | UIImageView *imageView = [[UIImageView alloc] initWithFrame:HEADER_INIT_FRAME]; 64 | imageView.image = [UIImage imageNamed:@"secret.png"]; 65 | imageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 66 | UIView *fadeView = [[UIView alloc] initWithFrame:imageView.frame]; 67 | fadeView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3f]; 68 | fadeView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 69 | 70 | _textLabel = [[UILabel alloc] initWithFrame:HEADER_INIT_FRAME]; 71 | [_textLabel setText:@"I love sharing secrets"]; 72 | [_textLabel setFont:[UIFont secretFontWithSize:22.f]]; 73 | [_textLabel setTextAlignment:NSTextAlignmentCenter]; 74 | [_textLabel setTextColor:[UIColor whiteColor]]; 75 | _textLabel.backgroundColor = [UIColor clearColor]; 76 | _textLabel.layer.shadowColor = [UIColor blackColor].CGColor; 77 | _textLabel.layer.shadowRadius = 10.0f; 78 | _textLabel.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; 79 | 80 | _toolBarView = [[ToolBarView alloc] initWithFrame:TOOLBAR_INIT_FRAME]; 81 | _toolBarView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin; 82 | [_backgroundScrollView addSubview:imageView]; 83 | [_backgroundScrollView addSubview:fadeView]; 84 | [_backgroundScrollView addSubview:_toolBarView]; 85 | [_backgroundScrollView addSubview:_textLabel]; 86 | 87 | // Take a snapshot of the background scroll view and apply a blur to that image 88 | // Then add the blurred image on top of the regular image and slowly fade it in 89 | // in scrollViewDidScroll 90 | UIGraphicsBeginImageContextWithOptions(_backgroundScrollView.bounds.size, _backgroundScrollView.opaque, 0.0); 91 | [_backgroundScrollView.layer renderInContext:UIGraphicsGetCurrentContext()]; 92 | UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); 93 | UIGraphicsEndImageContext(); 94 | 95 | _blurImageView = [[UIImageView alloc] initWithFrame:HEADER_INIT_FRAME]; 96 | _blurImageView.image = [img applyBlurWithRadius:12 tintColor:[UIColor colorWithWhite:0.8 alpha:0.4] saturationDeltaFactor:1.8 maskImage:nil]; 97 | _blurImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 98 | _blurImageView.alpha = 0; 99 | _blurImageView.backgroundColor = [UIColor clearColor]; 100 | [_backgroundScrollView addSubview:_blurImageView]; 101 | 102 | _commentsViewContainer = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(_backgroundScrollView.frame), CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame) - kBarHeight )]; 103 | [_commentsViewContainer addGradientMaskWithStartPoint:CGPointMake(0.5, 0.0) endPoint:CGPointMake(0.5, 0.03)]; 104 | _commentsTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame) - kBarHeight ) style:UITableViewStylePlain]; 105 | _commentsTableView.scrollEnabled = NO; 106 | _commentsTableView.delegate = self; 107 | _commentsTableView.dataSource = self; 108 | _commentsTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; 109 | _commentsTableView.separatorColor = [UIColor clearColor]; 110 | 111 | [self.view addSubview:_backgroundScrollView]; 112 | [_commentsViewContainer addSubview:_commentsTableView]; 113 | [self.view addSubview:_commentsViewContainer]; 114 | 115 | // Let's put in some fake data! 116 | comments = [@[@"Oh my god! Me too!", @"No way! I love secrets too!", @"I for some reason really like sharing my deepest darkest secrest to the entire world", @"More comments", @"Go Toronto Blue Jays!", @"I rather use Twitter", @"I don't get Secret", @"I don't have an iPhone", @"How are you using this then?"] mutableCopy]; 117 | [_toolBarView setNumberOfComments:[comments count]]; 118 | } 119 | return self; 120 | } 121 | 122 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 123 | CGFloat delta = 0.0f; 124 | CGRect rect = HEADER_INIT_FRAME; 125 | CGRect toolbarRect = TOOLBAR_INIT_FRAME; 126 | // Here is where I do the "Zooming" image and the quick fade out the text and toolbar 127 | if (scrollView.contentOffset.y < 0.0f) { 128 | delta = fabs(MIN(0.0f, _mainScrollView.contentOffset.y)); 129 | _backgroundScrollView.frame = CGRectMake(CGRectGetMinX(rect) - delta / 2.0f, CGRectGetMinY(rect) - delta, CGRectGetWidth(rect) + delta, CGRectGetHeight(rect) + delta); 130 | _textLabel.alpha = MIN(1.0f, 1.0f - delta * kTextFadeOutFactor); 131 | _toolBarView.alpha = _textLabel.alpha; 132 | _toolBarView.frame = CGRectMake(CGRectGetMinX(toolbarRect) + delta / 2.0f, CGRectGetMinY(toolbarRect) + delta, CGRectGetWidth(toolbarRect), CGRectGetHeight(toolbarRect)); 133 | [_commentsTableView setContentOffset:(CGPoint){0,0} animated:NO]; 134 | } else { 135 | delta = _mainScrollView.contentOffset.y; 136 | _textLabel.alpha = 1.0f; 137 | _toolBarView.alpha = _textLabel.alpha; 138 | _blurImageView.alpha = MIN(1 , delta * kBlurFadeInFactor); 139 | _toolBarView.frame = TOOLBAR_INIT_FRAME; 140 | CGFloat backgroundScrollViewLimit = _backgroundScrollView.frame.size.height - kBarHeight; 141 | // Here I check whether or not the user has scrolled passed the limit where I want to stick the header, if they have then I move the frame with the scroll view 142 | // to give it the sticky header look 143 | if (delta > backgroundScrollViewLimit) { 144 | _backgroundScrollView.frame = (CGRect) {.origin = {0, delta - _backgroundScrollView.frame.size.height + kBarHeight}, .size = {self.view.frame.size.width, HEADER_HEIGHT}}; 145 | _commentsViewContainer.frame = (CGRect){.origin = {0, CGRectGetMinY(_backgroundScrollView.frame) + CGRectGetHeight(_backgroundScrollView.frame)}, .size = _commentsViewContainer.frame.size }; 146 | _commentsTableView.contentOffset = CGPointMake (0, delta - backgroundScrollViewLimit); 147 | CGFloat contentOffsetY = -backgroundScrollViewLimit * kBackgroundParallexFactor; 148 | [_backgroundScrollView setContentOffset:(CGPoint){0,contentOffsetY} animated:NO]; 149 | } 150 | else { 151 | _backgroundScrollView.frame = rect; 152 | _commentsViewContainer.frame = (CGRect){.origin = {0, CGRectGetMinY(rect) + CGRectGetHeight(rect)}, .size = _commentsViewContainer.frame.size }; 153 | [_commentsTableView setContentOffset:(CGPoint){0,0} animated:NO]; 154 | [_backgroundScrollView setContentOffset:CGPointMake(0, -delta * kBackgroundParallexFactor)animated:NO]; 155 | } 156 | } 157 | } 158 | 159 | #pragma mark 160 | 161 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 162 | return 1; 163 | } 164 | 165 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 166 | return [comments count]; 167 | } 168 | 169 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 170 | NSString *text = [comments objectAtIndex:[indexPath row]]; 171 | CGSize requiredSize; 172 | if ([text respondsToSelector:@selector(boundingRectWithSize:options:attributes:context:)]) { 173 | CGRect rect = [text boundingRectWithSize:(CGSize){225, MAXFLOAT} 174 | options:NSStringDrawingUsesLineFragmentOrigin 175 | attributes:@{NSFontAttributeName:[UIFont secretFontLightWithSize:16.f]} 176 | context:nil]; 177 | requiredSize = rect.size; 178 | } else { 179 | requiredSize = [text sizeWithFont:[UIFont secretFontLightWithSize:16.f] constrainedToSize:(CGSize){225, MAXFLOAT} lineBreakMode:NSLineBreakByWordWrapping]; 180 | } 181 | return kCommentCellHeight + requiredSize.height; 182 | } 183 | 184 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 185 | CommentCell *cell = [tableView dequeueReusableCellWithIdentifier:[NSString stringWithFormat:@"Cell %d", indexPath.row]]; 186 | if (!cell) { 187 | cell = [[CommentCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[NSString stringWithFormat:@"Cell %d", indexPath.row]]; 188 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 189 | cell.commentLabel.frame = (CGRect) {.origin = cell.commentLabel.frame.origin, .size = {CGRectGetMinX(cell.likeButton.frame) - CGRectGetMaxY(cell.iconView.frame) - kCommentPaddingFromLeft - kCommentPaddingFromRight,[self tableView:tableView heightForRowAtIndexPath:indexPath] - kCommentCellHeight}}; 190 | cell.commentLabel.text = comments[indexPath.row]; 191 | cell.timeLabel.frame = (CGRect) {.origin = {CGRectGetMinX(cell.commentLabel.frame), CGRectGetMaxY(cell.commentLabel.frame)}}; 192 | cell.timeLabel.text = @"1d ago"; 193 | [cell.timeLabel sizeToFit]; 194 | 195 | // Don't judge my magic numbers or my crappy assets!!! 196 | cell.likeCountImageView.frame = CGRectMake(CGRectGetMaxX(cell.timeLabel.frame) + 7, CGRectGetMinY(cell.timeLabel.frame) + 3, 10, 10); 197 | cell.likeCountImageView.image = [UIImage imageNamed:@"like_greyIcon.png"]; 198 | cell.likeCountLabel.frame = CGRectMake(CGRectGetMaxX(cell.likeCountImageView.frame) + 3, CGRectGetMinY(cell.timeLabel.frame), 0, CGRectGetHeight(cell.timeLabel.frame)); 199 | } 200 | 201 | return cell; 202 | } 203 | 204 | 205 | - (void)viewDidAppear:(BOOL)animated { 206 | _mainScrollView.contentSize = CGSizeMake(CGRectGetWidth(self.view.frame), _commentsTableView.contentSize.height + CGRectGetHeight(_backgroundScrollView.frame)); 207 | } 208 | 209 | - (void)viewDidLoad 210 | { 211 | [super viewDidLoad]; 212 | // Do any additional setup after loading the view. 213 | } 214 | 215 | - (void)didReceiveMemoryWarning 216 | { 217 | [super didReceiveMemoryWarning]; 218 | // Dispose of any resources that can be recreated. 219 | } 220 | 221 | #pragma mark 222 | - (BOOL)prefersStatusBarHidden { 223 | return YES; 224 | } 225 | 226 | @end 227 | -------------------------------------------------------------------------------- /SecretTestApp/SecretTestApp-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | aaronpang.${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 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /SecretTestApp/SecretTestApp-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /SecretTestApp/ToolBarView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ToolBarView.h 3 | // SecretTestApp 4 | // 5 | // Created by Aaron Pang on 3/28/14. 6 | // Copyright (c) 2014 Aaron Pang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ToolBarView : UIView 12 | - (void)setNumberOfComments:(NSInteger)comments; 13 | @end 14 | -------------------------------------------------------------------------------- /SecretTestApp/ToolBarView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ToolBarView.m 3 | // SecretTestApp 4 | // 5 | // Created by Aaron Pang on 3/28/14. 6 | // Copyright (c) 2014 Aaron Pang. All rights reserved. 7 | // 8 | 9 | #import "ToolBarView.h" 10 | #import "UIFont+SecretFont.h" 11 | 12 | @implementation ToolBarView { 13 | UILabel *_cityLabel; 14 | UIButton *_moreButton; 15 | UIButton *_commentButton; 16 | UILabel *_commentCountLabel; 17 | UIButton *_likeButton; 18 | UILabel *_likeCountLabel; 19 | 20 | NSInteger _likeCounter; 21 | } 22 | 23 | - (id)initWithFrame:(CGRect)frame 24 | { 25 | self = [super initWithFrame:frame]; 26 | if (self) { 27 | 28 | // Obviously my secret would have at least 10 likes 29 | _likeCounter = 10; 30 | 31 | _cityLabel = [[UILabel alloc] init]; 32 | _cityLabel.text = @"San Francisco"; 33 | _cityLabel.font = [UIFont secretFontLightWithSize:14.f]; 34 | _cityLabel.textColor = [UIColor whiteColor]; 35 | _cityLabel.textAlignment = NSTextAlignmentLeft; 36 | _cityLabel.frame = (CGRect) {.origin = {15,0}}; 37 | _cityLabel.backgroundColor = [UIColor clearColor]; 38 | [_cityLabel sizeToFit]; 39 | [self addSubview:_cityLabel]; 40 | 41 | // Hardcoded the frames for all of these for simplicity and quickness 42 | _moreButton = [[UIButton alloc] initWithFrame:(CGRect){.origin = {CGRectGetMaxX(_cityLabel.frame) + 98, CGRectGetMinY(_cityLabel.frame) + 3}, .size = {22, 13}}]; 43 | [_moreButton setImage:[UIImage imageNamed:@"moreButton.png"] forState:UIControlStateNormal]; 44 | [self addSubview:_moreButton]; 45 | 46 | _commentButton = [[UIButton alloc] initWithFrame:(CGRect){.origin = {CGRectGetMaxX(_moreButton.frame) + 20, CGRectGetMinY(_cityLabel.frame) + 2}, .size = {22,17}}]; 47 | [_commentButton setImage:[UIImage imageNamed:@"commentButton.png"] forState:UIControlStateNormal]; 48 | [self addSubview:_commentButton]; 49 | 50 | _commentCountLabel = [[UILabel alloc] init]; 51 | _commentCountLabel.font = [UIFont secretFontLightWithSize:13.f]; 52 | _commentCountLabel.textColor = [UIColor whiteColor]; 53 | _commentCountLabel.textAlignment = NSTextAlignmentLeft; 54 | _commentCountLabel.frame = (CGRect) {.origin = {CGRectGetMaxX(_commentButton.frame) + 6, CGRectGetMinY(_cityLabel.frame) + 1}}; 55 | _commentCountLabel.backgroundColor = [UIColor clearColor]; 56 | [self addSubview:_commentCountLabel]; 57 | 58 | _likeButton = [[UIButton alloc] initWithFrame:(CGRect){.origin = {CGRectGetMaxX(_commentCountLabel.frame) + 25, CGRectGetMinY(_cityLabel.frame) + 3}, .size = {15,15}}]; 59 | [_likeButton setImage:[UIImage imageNamed:@"likeButtonToolbar_unselected"] forState:UIControlStateNormal]; 60 | [_likeButton setImage:[UIImage imageNamed:@"likeButtonToolbar_selected"] forState:UIControlStateSelected]; 61 | 62 | [_likeButton addTarget:self action:@selector(likeButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; 63 | [self addSubview:_likeButton]; 64 | 65 | _likeCountLabel = [[UILabel alloc] init]; 66 | _likeCountLabel.font = [UIFont secretFontLightWithSize:13.f]; 67 | _likeCountLabel.textColor = [UIColor whiteColor]; 68 | _likeCountLabel.textAlignment = NSTextAlignmentLeft; 69 | _likeCountLabel.frame = (CGRect) {.origin = {CGRectGetMaxX(_likeButton.frame) + 6, CGRectGetMinY(_cityLabel.frame) + 1}}; 70 | _likeCountLabel.text = [NSString stringWithFormat:@"%d", _likeCounter]; 71 | _likeCountLabel.backgroundColor = [UIColor clearColor]; 72 | [_likeCountLabel sizeToFit]; 73 | [self addSubview:_likeCountLabel]; 74 | 75 | } 76 | return self; 77 | } 78 | 79 | - (void)setNumberOfComments:(NSInteger)comments { 80 | _commentCountLabel.text = [NSString stringWithFormat:@"%d",comments]; 81 | [_commentCountLabel sizeToFit]; 82 | } 83 | 84 | - (void)likeButtonTapped:(id)sender{ 85 | _likeButton.selected = !_likeButton.selected; 86 | if (_likeButton.selected) { 87 | _likeCounter++; 88 | // Don't let the user interrupt the animation 89 | _likeButton.userInteractionEnabled = NO; 90 | const NSInteger pixelsToScale = 9.0f; 91 | const NSInteger pixelsToShrink = 4.0f; 92 | CGRect likeButtonRect = _likeButton.frame; 93 | 94 | // Play that like/heart beat animation! 95 | [UIView animateWithDuration:0.4f delay:0.f options:UIViewAnimationOptionCurveEaseInOut animations:^{ 96 | _likeButton.frame = (CGRect){.origin = {CGRectGetMinX(likeButtonRect) - pixelsToScale / 2.0f, CGRectGetMinY(likeButtonRect) - pixelsToScale / 2.0f}, .size = {CGRectGetWidth(likeButtonRect) + pixelsToScale, CGRectGetHeight(likeButtonRect) + pixelsToScale}}; 97 | } completion:^(BOOL finished) { 98 | [UIView animateWithDuration:0.2f delay:0.1f options:UIViewAnimationOptionCurveEaseInOut animations:^{ 99 | _likeButton.frame = (CGRect) {.origin = {CGRectGetMinX(likeButtonRect) + pixelsToShrink / 2.0f, CGRectGetMinY(likeButtonRect) + pixelsToShrink / 2.0f}, .size = {CGRectGetWidth(likeButtonRect) - pixelsToShrink, CGRectGetHeight(likeButtonRect) - pixelsToShrink}}; 100 | } completion:^(BOOL finished) { 101 | [UIView animateWithDuration:0.2f delay:0.0f options:UIViewAnimationOptionCurveEaseInOut animations:^{ 102 | _likeButton.frame = likeButtonRect; 103 | } completion:^(BOOL finished) { 104 | _likeButton.userInteractionEnabled = YES; 105 | }]; 106 | }]; 107 | }]; 108 | } else { 109 | _likeCounter--; 110 | } 111 | [_likeCountLabel setText:[NSString stringWithFormat:@"%d",_likeCounter]]; 112 | } 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /SecretTestApp/UIFont+SecretFont.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIFont+secretFont.h 3 | // SecretTestApp 4 | // 5 | // Created by Aaron Pang on 3/29/14. 6 | // Copyright (c) 2014 Aaron Pang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIFont (secretFont) 12 | + (UIFont *)secretFontWithSize:(CGFloat)size; 13 | + (UIFont *)secretFontLightWithSize:(CGFloat)size; 14 | @end 15 | -------------------------------------------------------------------------------- /SecretTestApp/UIFont+SecretFont.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIFont+secretFont.m 3 | // SecretTestApp 4 | // 5 | // Created by Aaron Pang on 3/29/14. 6 | // Copyright (c) 2014 Aaron Pang. All rights reserved. 7 | // 8 | 9 | #import "UIFont+secretFont.h" 10 | 11 | @implementation UIFont (secretFont) 12 | 13 | + (UIFont *)secretFontWithSize:(CGFloat)size { 14 | return [UIFont fontWithName:@"AvenirNextCondensed-DemiBold" size:size]; 15 | } 16 | 17 | + (UIFont *)secretFontLightWithSize:(CGFloat)size { 18 | return [UIFont fontWithName:@"AvenirNextCondensed-Regular" size:size]; 19 | } 20 | @end 21 | -------------------------------------------------------------------------------- /SecretTestApp/UIImage+ImageEffects.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+ImageEffects.h 3 | // Inkling 4 | // 5 | // Created by Aaron Pang on 3/26/14. 6 | // Copyright (c) 2014 Inkling. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (ImageEffects) 12 | 13 | - (UIImage *)applySubtleEffect; 14 | - (UIImage *)applyLightEffect; 15 | - (UIImage *)applyExtraLightEffect; 16 | - (UIImage *)applyDarkEffect; 17 | - (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor; 18 | - (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /SecretTestApp/UIImage+ImageEffects.m: -------------------------------------------------------------------------------- 1 | /* 2 | File: UIImage+ImageEffects.m 3 | Abstract: This is a category of UIImage that adds methods to apply blur and tint effects to an image. This is the code you’ll want to look out to find out how to use vImage to efficiently calculate a blur. 4 | Version: 1.0 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2013 Apple Inc. All Rights Reserved. 45 | 46 | 47 | Copyright © 2013 Apple Inc. All rights reserved. 48 | WWDC 2013 License 49 | 50 | NOTE: This Apple Software was supplied by Apple as part of a WWDC 2013 51 | Session. Please refer to the applicable WWDC 2013 Session for further 52 | information. 53 | 54 | IMPORTANT: This Apple software is supplied to you by Apple Inc. 55 | ("Apple") in consideration of your agreement to the following terms, and 56 | your use, installation, modification or redistribution of this Apple 57 | software constitutes acceptance of these terms. If you do not agree with 58 | these terms, please do not use, install, modify or redistribute this 59 | Apple software. 60 | 61 | In consideration of your agreement to abide by the following terms, and 62 | subject to these terms, Apple grants you a non-exclusive license, under 63 | Apple's copyrights in this original Apple software (the "Apple 64 | Software"), to use, reproduce, modify and redistribute the Apple 65 | Software, with or without modifications, in source and/or binary forms; 66 | provided that if you redistribute the Apple Software in its entirety and 67 | without modifications, you must retain this notice and the following 68 | text and disclaimers in all such redistributions of the Apple Software. 69 | Neither the name, trademarks, service marks or logos of Apple Inc. may 70 | be used to endorse or promote products derived from the Apple Software 71 | without specific prior written permission from Apple. Except as 72 | expressly stated in this notice, no other rights or licenses, express or 73 | implied, are granted by Apple herein, including but not limited to any 74 | patent rights that may be infringed by your derivative works or by other 75 | works in which the Apple Software may be incorporated. 76 | 77 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES 78 | NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 79 | IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR 80 | A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 81 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 82 | 83 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 84 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 85 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 86 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 87 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 88 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 89 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 90 | POSSIBILITY OF SUCH DAMAGE. 91 | 92 | EA1002 93 | 5/3/2013 94 | */ 95 | 96 | #import "UIImage+ImageEffects.h" 97 | #import 98 | #import 99 | 100 | @implementation UIImage (ImageEffects) 101 | 102 | 103 | - (UIImage *)applySubtleEffect 104 | { 105 | UIColor *tintColor = [UIColor colorWithWhite:1.0 alpha:0.3]; 106 | return [self applyBlurWithRadius:3 tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil]; 107 | } 108 | 109 | 110 | - (UIImage *)applyLightEffect 111 | { 112 | UIColor *tintColor = [UIColor colorWithWhite:1.0 alpha:0.3]; 113 | return [self applyBlurWithRadius:30 tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil]; 114 | } 115 | 116 | 117 | - (UIImage *)applyExtraLightEffect 118 | { 119 | UIColor *tintColor = [UIColor colorWithWhite:0.97 alpha:0.82]; 120 | return [self applyBlurWithRadius:20 tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil]; 121 | } 122 | 123 | 124 | - (UIImage *)applyDarkEffect 125 | { 126 | UIColor *tintColor = [UIColor colorWithWhite:0.11 alpha:0.73]; 127 | return [self applyBlurWithRadius:20 tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil]; 128 | } 129 | 130 | 131 | - (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor 132 | { 133 | const CGFloat EffectColorAlpha = 0.6; 134 | UIColor *effectColor = tintColor; 135 | int componentCount = CGColorGetNumberOfComponents(tintColor.CGColor); 136 | if (componentCount == 2) { 137 | CGFloat b; 138 | if ([tintColor getWhite:&b alpha:NULL]) { 139 | effectColor = [UIColor colorWithWhite:b alpha:EffectColorAlpha]; 140 | } 141 | } 142 | else { 143 | CGFloat r, g, b; 144 | if ([tintColor getRed:&r green:&g blue:&b alpha:NULL]) { 145 | effectColor = [UIColor colorWithRed:r green:g blue:b alpha:EffectColorAlpha]; 146 | } 147 | } 148 | return [self applyBlurWithRadius:10 tintColor:effectColor saturationDeltaFactor:-1.0 maskImage:nil]; 149 | } 150 | 151 | 152 | - (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage 153 | { 154 | // Check pre-conditions. 155 | if (self.size.width < 1 || self.size.height < 1) { 156 | NSLog (@"*** error: invalid size: (%.2f x %.2f). Both dimensions must be >= 1: %@", self.size.width, self.size.height, self); 157 | return nil; 158 | } 159 | if (!self.CGImage) { 160 | NSLog (@"*** error: image must be backed by a CGImage: %@", self); 161 | return nil; 162 | } 163 | if (maskImage && !maskImage.CGImage) { 164 | NSLog (@"*** error: maskImage must be backed by a CGImage: %@", maskImage); 165 | return nil; 166 | } 167 | 168 | CGRect imageRect = { CGPointZero, self.size }; 169 | UIImage *effectImage = self; 170 | 171 | BOOL hasBlur = blurRadius > __FLT_EPSILON__; 172 | BOOL hasSaturationChange = fabs(saturationDeltaFactor - 1.) > __FLT_EPSILON__; 173 | if (hasBlur || hasSaturationChange) { 174 | UIGraphicsBeginImageContextWithOptions(self.size, NO, [[UIScreen mainScreen] scale]); 175 | CGContextRef effectInContext = UIGraphicsGetCurrentContext(); 176 | CGContextScaleCTM(effectInContext, 1.0, -1.0); 177 | CGContextTranslateCTM(effectInContext, 0, -self.size.height); 178 | CGContextDrawImage(effectInContext, imageRect, self.CGImage); 179 | 180 | vImage_Buffer effectInBuffer; 181 | effectInBuffer.data = CGBitmapContextGetData(effectInContext); 182 | effectInBuffer.width = CGBitmapContextGetWidth(effectInContext); 183 | effectInBuffer.height = CGBitmapContextGetHeight(effectInContext); 184 | effectInBuffer.rowBytes = CGBitmapContextGetBytesPerRow(effectInContext); 185 | 186 | UIGraphicsBeginImageContextWithOptions(self.size, NO, [[UIScreen mainScreen] scale]); 187 | CGContextRef effectOutContext = UIGraphicsGetCurrentContext(); 188 | vImage_Buffer effectOutBuffer; 189 | effectOutBuffer.data = CGBitmapContextGetData(effectOutContext); 190 | effectOutBuffer.width = CGBitmapContextGetWidth(effectOutContext); 191 | effectOutBuffer.height = CGBitmapContextGetHeight(effectOutContext); 192 | effectOutBuffer.rowBytes = CGBitmapContextGetBytesPerRow(effectOutContext); 193 | 194 | if (hasBlur) { 195 | // A description of how to compute the box kernel width from the Gaussian 196 | // radius (aka standard deviation) appears in the SVG spec: 197 | // http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement 198 | // 199 | // For larger values of 's' (s >= 2.0), an approximation can be used: Three 200 | // successive box-blurs build a piece-wise quadratic convolution kernel, which 201 | // approximates the Gaussian kernel to within roughly 3%. 202 | // 203 | // let d = floor(s * 3*sqrt(2*pi)/4 + 0.5) 204 | // 205 | // ... if d is odd, use three box-blurs of size 'd', centered on the output pixel. 206 | // 207 | CGFloat inputRadius = blurRadius * [[UIScreen mainScreen] scale]; 208 | NSUInteger radius = floor(inputRadius * 3. * sqrt(2 * M_PI) / 4 + 0.5); 209 | if (radius % 2 != 1) { 210 | radius += 1; // force radius to be odd so that the three box-blur methodology works. 211 | } 212 | vImageBoxConvolve_ARGB8888(&effectInBuffer, &effectOutBuffer, NULL, 0, 0, radius, radius, 0, kvImageEdgeExtend); 213 | vImageBoxConvolve_ARGB8888(&effectOutBuffer, &effectInBuffer, NULL, 0, 0, radius, radius, 0, kvImageEdgeExtend); 214 | vImageBoxConvolve_ARGB8888(&effectInBuffer, &effectOutBuffer, NULL, 0, 0, radius, radius, 0, kvImageEdgeExtend); 215 | } 216 | BOOL effectImageBuffersAreSwapped = NO; 217 | if (hasSaturationChange) { 218 | CGFloat s = saturationDeltaFactor; 219 | CGFloat floatingPointSaturationMatrix[] = { 220 | 0.0722 + 0.9278 * s, 0.0722 - 0.0722 * s, 0.0722 - 0.0722 * s, 0, 221 | 0.7152 - 0.7152 * s, 0.7152 + 0.2848 * s, 0.7152 - 0.7152 * s, 0, 222 | 0.2126 - 0.2126 * s, 0.2126 - 0.2126 * s, 0.2126 + 0.7873 * s, 0, 223 | 0, 0, 0, 1, 224 | }; 225 | const int32_t divisor = 256; 226 | NSUInteger matrixSize = sizeof(floatingPointSaturationMatrix)/sizeof(floatingPointSaturationMatrix[0]); 227 | int16_t saturationMatrix[matrixSize]; 228 | for (NSUInteger i = 0; i < matrixSize; ++i) { 229 | saturationMatrix[i] = (int16_t)roundf(floatingPointSaturationMatrix[i] * divisor); 230 | } 231 | if (hasBlur) { 232 | vImageMatrixMultiply_ARGB8888(&effectOutBuffer, &effectInBuffer, saturationMatrix, divisor, NULL, NULL, kvImageNoFlags); 233 | effectImageBuffersAreSwapped = YES; 234 | } 235 | else { 236 | vImageMatrixMultiply_ARGB8888(&effectInBuffer, &effectOutBuffer, saturationMatrix, divisor, NULL, NULL, kvImageNoFlags); 237 | } 238 | } 239 | if (!effectImageBuffersAreSwapped) 240 | effectImage = UIGraphicsGetImageFromCurrentImageContext(); 241 | UIGraphicsEndImageContext(); 242 | 243 | if (effectImageBuffersAreSwapped) 244 | effectImage = UIGraphicsGetImageFromCurrentImageContext(); 245 | UIGraphicsEndImageContext(); 246 | } 247 | 248 | // Set up output context. 249 | UIGraphicsBeginImageContextWithOptions(self.size, NO, [[UIScreen mainScreen] scale]); 250 | CGContextRef outputContext = UIGraphicsGetCurrentContext(); 251 | CGContextScaleCTM(outputContext, 1.0, -1.0); 252 | CGContextTranslateCTM(outputContext, 0, -self.size.height); 253 | 254 | // Draw base image. 255 | CGContextDrawImage(outputContext, imageRect, self.CGImage); 256 | 257 | // Draw effect image. 258 | if (hasBlur) { 259 | CGContextSaveGState(outputContext); 260 | if (maskImage) { 261 | CGContextClipToMask(outputContext, imageRect, maskImage.CGImage); 262 | } 263 | CGContextDrawImage(outputContext, imageRect, effectImage.CGImage); 264 | CGContextRestoreGState(outputContext); 265 | } 266 | 267 | // Add in color tint. 268 | if (tintColor) { 269 | CGContextSaveGState(outputContext); 270 | CGContextSetFillColorWithColor(outputContext, tintColor.CGColor); 271 | CGContextFillRect(outputContext, imageRect); 272 | CGContextRestoreGState(outputContext); 273 | } 274 | 275 | // Output image is ready. 276 | UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext(); 277 | UIGraphicsEndImageContext(); 278 | 279 | return outputImage; 280 | } 281 | 282 | 283 | @end -------------------------------------------------------------------------------- /SecretTestApp/UIView+GradientMask.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+GradientMask.h 3 | // SecretTestApp 4 | // 5 | // Created by Aaron Pang on 4/1/14. 6 | // Copyright (c) 2014 Aaron Pang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (GradientMask) 12 | - (void)addGradientMaskWithStartPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint; 13 | @end 14 | -------------------------------------------------------------------------------- /SecretTestApp/UIView+GradientMask.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+GradientMask.m 3 | // SecretTestApp 4 | // 5 | // Created by Aaron Pang on 4/1/14. 6 | // Copyright (c) 2014 Aaron Pang. All rights reserved. 7 | // 8 | 9 | #import "UIView+GradientMask.h" 10 | 11 | @implementation UIView (GradientMask) 12 | 13 | - (void)addGradientMaskWithStartPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint 14 | { 15 | CAGradientLayer *gradient = [CAGradientLayer layer]; 16 | gradient.frame = self.bounds; 17 | gradient.colors = @[(id)[[UIColor clearColor] CGColor], (id)[[UIColor whiteColor] CGColor]]; 18 | gradient.startPoint = startPoint; 19 | gradient.endPoint = endPoint; 20 | 21 | [self.layer setMask:gradient]; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /SecretTestApp/bluejay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpang/SecretViewer/ff711fe21a079155b427b66855c9ed0814a501d2/SecretTestApp/bluejay.jpg -------------------------------------------------------------------------------- /SecretTestApp/commentButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpang/SecretViewer/ff711fe21a079155b427b66855c9ed0814a501d2/SecretTestApp/commentButton.png -------------------------------------------------------------------------------- /SecretTestApp/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /SecretTestApp/likeButtonToolbar_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpang/SecretViewer/ff711fe21a079155b427b66855c9ed0814a501d2/SecretTestApp/likeButtonToolbar_selected.png -------------------------------------------------------------------------------- /SecretTestApp/likeButtonToolbar_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpang/SecretViewer/ff711fe21a079155b427b66855c9ed0814a501d2/SecretTestApp/likeButtonToolbar_unselected.png -------------------------------------------------------------------------------- /SecretTestApp/likeButton_highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpang/SecretViewer/ff711fe21a079155b427b66855c9ed0814a501d2/SecretTestApp/likeButton_highlighted.png -------------------------------------------------------------------------------- /SecretTestApp/likeButton_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpang/SecretViewer/ff711fe21a079155b427b66855c9ed0814a501d2/SecretTestApp/likeButton_selected.png -------------------------------------------------------------------------------- /SecretTestApp/likeButton_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpang/SecretViewer/ff711fe21a079155b427b66855c9ed0814a501d2/SecretTestApp/likeButton_unselected.png -------------------------------------------------------------------------------- /SecretTestApp/like_greyIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpang/SecretViewer/ff711fe21a079155b427b66855c9ed0814a501d2/SecretTestApp/like_greyIcon.png -------------------------------------------------------------------------------- /SecretTestApp/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SecretTestApp 4 | // 5 | // Created by Aaron Pang on 3/28/14. 6 | // Copyright (c) 2014 Aaron Pang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SecretTestApp/moreButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpang/SecretViewer/ff711fe21a079155b427b66855c9ed0814a501d2/SecretTestApp/moreButton.png -------------------------------------------------------------------------------- /SecretTestApp/secret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpang/SecretViewer/ff711fe21a079155b427b66855c9ed0814a501d2/SecretTestApp/secret.png -------------------------------------------------------------------------------- /SecretTestAppTests/SecretTestAppTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | aaronpang.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /SecretTestAppTests/SecretTestAppTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SecretTestAppTests.m 3 | // SecretTestAppTests 4 | // 5 | // Created by Aaron Pang on 3/28/14. 6 | // Copyright (c) 2014 Aaron Pang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SecretTestAppTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation SecretTestAppTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /SecretTestAppTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | --------------------------------------------------------------------------------