├── LICENSE ├── README.md ├── SearchBarPlayground.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── SearchBarPlayground.xccheckout │ └── xcuserdata │ │ └── bsalanki.xcuserdatad │ │ └── WorkspaceSettings.xcsettings └── xcuserdata │ └── bsalanki.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── SearchBarPlayground.xcscheme │ └── xcschememanagement.plist ├── SearchBarPlayground ├── Base.lproj │ └── Main.storyboard ├── INSAppDelegate.h ├── INSAppDelegate.m ├── INSSearchBar.h ├── INSSearchBar.m ├── INSViewController.h ├── INSViewController.m ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── NavBarIconSearchBar2_blue.png ├── NavBarIconSearchBar2_blue@2x.png ├── NavBarIconSearchBar_blue.png ├── NavBarIconSearchBar_blue@2x.png ├── NavBarIconSearchCircle_blue.png ├── NavBarIconSearchCircle_blue@2x.png ├── NavBarIconSearch_blue.png ├── NavBarIconSearch_blue@2x.png ├── NavBarIconSearch_white.png ├── NavBarIconSearch_white@2x.png ├── SearchBarPlayground-Info.plist ├── SearchBarPlayground-Prefix.pch ├── en.lproj │ └── InfoPlist.strings └── main.m └── SearchBarPlaygroundTests ├── SearchBarPlaygroundTests-Info.plist ├── SearchBarPlaygroundTests.m └── en.lproj └── InfoPlist.strings /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | INSSearchBar 2 | ============ 3 | 4 | An animating search bar. 5 | 6 | Originally developed for ShopNow v2. (http://www.shopnow.de) 7 | 8 | The search bar is designed as a standalone component that can be easily drag'n'dropped into any existing iOS project. 9 | 10 | For a story behind this control see http://salanki.com/insomniac/2014/06/03/the-search-bar-experiment/ 11 | 12 | The swift version can be found at https://github.com/berlininsomniac/INSSearchBar_Swift 13 | 14 | 06.03.2014 15 | Berlin Insomniac 16 | -------------------------------------------------------------------------------- /SearchBarPlayground.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1E471641193E66440062674B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E471640193E66440062674B /* Foundation.framework */; }; 11 | 1E471643193E66440062674B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E471642193E66440062674B /* CoreGraphics.framework */; }; 12 | 1E471645193E66440062674B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E471644193E66440062674B /* UIKit.framework */; }; 13 | 1E47164B193E66440062674B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1E471649193E66440062674B /* InfoPlist.strings */; }; 14 | 1E47164D193E66440062674B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E47164C193E66440062674B /* main.m */; }; 15 | 1E471651193E66440062674B /* INSAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E471650193E66440062674B /* INSAppDelegate.m */; }; 16 | 1E471654193E66440062674B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1E471652193E66440062674B /* Main.storyboard */; }; 17 | 1E471657193E66440062674B /* INSViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E471656193E66440062674B /* INSViewController.m */; }; 18 | 1E471659193E66440062674B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1E471658193E66440062674B /* Images.xcassets */; }; 19 | 1E471660193E66440062674B /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E47165F193E66440062674B /* XCTest.framework */; }; 20 | 1E471661193E66440062674B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E471640193E66440062674B /* Foundation.framework */; }; 21 | 1E471662193E66440062674B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E471644193E66440062674B /* UIKit.framework */; }; 22 | 1E47166A193E66440062674B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1E471668193E66440062674B /* InfoPlist.strings */; }; 23 | 1E47166C193E66440062674B /* SearchBarPlaygroundTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E47166B193E66440062674B /* SearchBarPlaygroundTests.m */; }; 24 | 1E471677193E66700062674B /* INSSearchBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E471676193E66700062674B /* INSSearchBar.m */; }; 25 | 1E471682193E68BD0062674B /* NavBarIconSearch_blue@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1E471678193E68BD0062674B /* NavBarIconSearch_blue@2x.png */; }; 26 | 1E471683193E68BD0062674B /* NavBarIconSearchBar_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 1E471679193E68BD0062674B /* NavBarIconSearchBar_blue.png */; }; 27 | 1E471684193E68BD0062674B /* NavBarIconSearchBar_blue@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1E47167A193E68BD0062674B /* NavBarIconSearchBar_blue@2x.png */; }; 28 | 1E471685193E68BD0062674B /* NavBarIconSearchBar2_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 1E47167B193E68BD0062674B /* NavBarIconSearchBar2_blue.png */; }; 29 | 1E471686193E68BD0062674B /* NavBarIconSearchBar2_blue@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1E47167C193E68BD0062674B /* NavBarIconSearchBar2_blue@2x.png */; }; 30 | 1E471687193E68BD0062674B /* NavBarIconSearchCircle_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 1E47167D193E68BD0062674B /* NavBarIconSearchCircle_blue.png */; }; 31 | 1E471688193E68BD0062674B /* NavBarIconSearchCircle_blue@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1E47167E193E68BD0062674B /* NavBarIconSearchCircle_blue@2x.png */; }; 32 | 1E471689193E68BD0062674B /* NavBarIconSearch_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 1E47167F193E68BD0062674B /* NavBarIconSearch_blue.png */; }; 33 | 1E47168A193E68BD0062674B /* NavBarIconSearch_white@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1E471680193E68BD0062674B /* NavBarIconSearch_white@2x.png */; }; 34 | 1E47168B193E68BD0062674B /* NavBarIconSearch_white.png in Resources */ = {isa = PBXBuildFile; fileRef = 1E471681193E68BD0062674B /* NavBarIconSearch_white.png */; }; 35 | /* End PBXBuildFile section */ 36 | 37 | /* Begin PBXContainerItemProxy section */ 38 | 1E471663193E66440062674B /* PBXContainerItemProxy */ = { 39 | isa = PBXContainerItemProxy; 40 | containerPortal = 1E471635193E66440062674B /* Project object */; 41 | proxyType = 1; 42 | remoteGlobalIDString = 1E47163C193E66440062674B; 43 | remoteInfo = SearchBarPlayground; 44 | }; 45 | /* End PBXContainerItemProxy section */ 46 | 47 | /* Begin PBXFileReference section */ 48 | 1E47163D193E66440062674B /* SearchBarPlayground.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SearchBarPlayground.app; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 1E471640193E66440062674B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 50 | 1E471642193E66440062674B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 51 | 1E471644193E66440062674B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 52 | 1E471648193E66440062674B /* SearchBarPlayground-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SearchBarPlayground-Info.plist"; sourceTree = ""; }; 53 | 1E47164A193E66440062674B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 54 | 1E47164C193E66440062674B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 55 | 1E47164E193E66440062674B /* SearchBarPlayground-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SearchBarPlayground-Prefix.pch"; sourceTree = ""; }; 56 | 1E47164F193E66440062674B /* INSAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = INSAppDelegate.h; sourceTree = ""; }; 57 | 1E471650193E66440062674B /* INSAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = INSAppDelegate.m; sourceTree = ""; }; 58 | 1E471653193E66440062674B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 59 | 1E471655193E66440062674B /* INSViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = INSViewController.h; sourceTree = ""; }; 60 | 1E471656193E66440062674B /* INSViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = INSViewController.m; sourceTree = ""; }; 61 | 1E471658193E66440062674B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 62 | 1E47165E193E66440062674B /* SearchBarPlaygroundTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SearchBarPlaygroundTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 63 | 1E47165F193E66440062674B /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 64 | 1E471667193E66440062674B /* SearchBarPlaygroundTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SearchBarPlaygroundTests-Info.plist"; sourceTree = ""; }; 65 | 1E471669193E66440062674B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 66 | 1E47166B193E66440062674B /* SearchBarPlaygroundTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SearchBarPlaygroundTests.m; sourceTree = ""; }; 67 | 1E471675193E66700062674B /* INSSearchBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = INSSearchBar.h; sourceTree = ""; }; 68 | 1E471676193E66700062674B /* INSSearchBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = INSSearchBar.m; sourceTree = ""; }; 69 | 1E471678193E68BD0062674B /* NavBarIconSearch_blue@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "NavBarIconSearch_blue@2x.png"; sourceTree = ""; }; 70 | 1E471679193E68BD0062674B /* NavBarIconSearchBar_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = NavBarIconSearchBar_blue.png; sourceTree = ""; }; 71 | 1E47167A193E68BD0062674B /* NavBarIconSearchBar_blue@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "NavBarIconSearchBar_blue@2x.png"; sourceTree = ""; }; 72 | 1E47167B193E68BD0062674B /* NavBarIconSearchBar2_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = NavBarIconSearchBar2_blue.png; sourceTree = ""; }; 73 | 1E47167C193E68BD0062674B /* NavBarIconSearchBar2_blue@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "NavBarIconSearchBar2_blue@2x.png"; sourceTree = ""; }; 74 | 1E47167D193E68BD0062674B /* NavBarIconSearchCircle_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = NavBarIconSearchCircle_blue.png; sourceTree = ""; }; 75 | 1E47167E193E68BD0062674B /* NavBarIconSearchCircle_blue@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "NavBarIconSearchCircle_blue@2x.png"; sourceTree = ""; }; 76 | 1E47167F193E68BD0062674B /* NavBarIconSearch_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = NavBarIconSearch_blue.png; sourceTree = ""; }; 77 | 1E471680193E68BD0062674B /* NavBarIconSearch_white@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "NavBarIconSearch_white@2x.png"; sourceTree = ""; }; 78 | 1E471681193E68BD0062674B /* NavBarIconSearch_white.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = NavBarIconSearch_white.png; sourceTree = ""; }; 79 | /* End PBXFileReference section */ 80 | 81 | /* Begin PBXFrameworksBuildPhase section */ 82 | 1E47163A193E66440062674B /* Frameworks */ = { 83 | isa = PBXFrameworksBuildPhase; 84 | buildActionMask = 2147483647; 85 | files = ( 86 | 1E471643193E66440062674B /* CoreGraphics.framework in Frameworks */, 87 | 1E471645193E66440062674B /* UIKit.framework in Frameworks */, 88 | 1E471641193E66440062674B /* Foundation.framework in Frameworks */, 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | 1E47165B193E66440062674B /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | 1E471660193E66440062674B /* XCTest.framework in Frameworks */, 97 | 1E471662193E66440062674B /* UIKit.framework in Frameworks */, 98 | 1E471661193E66440062674B /* Foundation.framework in Frameworks */, 99 | ); 100 | runOnlyForDeploymentPostprocessing = 0; 101 | }; 102 | /* End PBXFrameworksBuildPhase section */ 103 | 104 | /* Begin PBXGroup section */ 105 | 1E471634193E66440062674B = { 106 | isa = PBXGroup; 107 | children = ( 108 | 1E471646193E66440062674B /* SearchBarPlayground */, 109 | 1E471665193E66440062674B /* SearchBarPlaygroundTests */, 110 | 1E47163F193E66440062674B /* Frameworks */, 111 | 1E47163E193E66440062674B /* Products */, 112 | ); 113 | sourceTree = ""; 114 | }; 115 | 1E47163E193E66440062674B /* Products */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 1E47163D193E66440062674B /* SearchBarPlayground.app */, 119 | 1E47165E193E66440062674B /* SearchBarPlaygroundTests.xctest */, 120 | ); 121 | name = Products; 122 | sourceTree = ""; 123 | }; 124 | 1E47163F193E66440062674B /* Frameworks */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 1E471640193E66440062674B /* Foundation.framework */, 128 | 1E471642193E66440062674B /* CoreGraphics.framework */, 129 | 1E471644193E66440062674B /* UIKit.framework */, 130 | 1E47165F193E66440062674B /* XCTest.framework */, 131 | ); 132 | name = Frameworks; 133 | sourceTree = ""; 134 | }; 135 | 1E471646193E66440062674B /* SearchBarPlayground */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 1E47164F193E66440062674B /* INSAppDelegate.h */, 139 | 1E471650193E66440062674B /* INSAppDelegate.m */, 140 | 1E471652193E66440062674B /* Main.storyboard */, 141 | 1E471655193E66440062674B /* INSViewController.h */, 142 | 1E471656193E66440062674B /* INSViewController.m */, 143 | 1E471675193E66700062674B /* INSSearchBar.h */, 144 | 1E471676193E66700062674B /* INSSearchBar.m */, 145 | 1E471678193E68BD0062674B /* NavBarIconSearch_blue@2x.png */, 146 | 1E471679193E68BD0062674B /* NavBarIconSearchBar_blue.png */, 147 | 1E47167A193E68BD0062674B /* NavBarIconSearchBar_blue@2x.png */, 148 | 1E47167B193E68BD0062674B /* NavBarIconSearchBar2_blue.png */, 149 | 1E47167C193E68BD0062674B /* NavBarIconSearchBar2_blue@2x.png */, 150 | 1E47167D193E68BD0062674B /* NavBarIconSearchCircle_blue.png */, 151 | 1E47167E193E68BD0062674B /* NavBarIconSearchCircle_blue@2x.png */, 152 | 1E47167F193E68BD0062674B /* NavBarIconSearch_blue.png */, 153 | 1E471680193E68BD0062674B /* NavBarIconSearch_white@2x.png */, 154 | 1E471681193E68BD0062674B /* NavBarIconSearch_white.png */, 155 | 1E471658193E66440062674B /* Images.xcassets */, 156 | 1E471647193E66440062674B /* Supporting Files */, 157 | ); 158 | path = SearchBarPlayground; 159 | sourceTree = ""; 160 | }; 161 | 1E471647193E66440062674B /* Supporting Files */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | 1E471648193E66440062674B /* SearchBarPlayground-Info.plist */, 165 | 1E471649193E66440062674B /* InfoPlist.strings */, 166 | 1E47164C193E66440062674B /* main.m */, 167 | 1E47164E193E66440062674B /* SearchBarPlayground-Prefix.pch */, 168 | ); 169 | name = "Supporting Files"; 170 | sourceTree = ""; 171 | }; 172 | 1E471665193E66440062674B /* SearchBarPlaygroundTests */ = { 173 | isa = PBXGroup; 174 | children = ( 175 | 1E47166B193E66440062674B /* SearchBarPlaygroundTests.m */, 176 | 1E471666193E66440062674B /* Supporting Files */, 177 | ); 178 | path = SearchBarPlaygroundTests; 179 | sourceTree = ""; 180 | }; 181 | 1E471666193E66440062674B /* Supporting Files */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | 1E471667193E66440062674B /* SearchBarPlaygroundTests-Info.plist */, 185 | 1E471668193E66440062674B /* InfoPlist.strings */, 186 | ); 187 | name = "Supporting Files"; 188 | sourceTree = ""; 189 | }; 190 | /* End PBXGroup section */ 191 | 192 | /* Begin PBXNativeTarget section */ 193 | 1E47163C193E66440062674B /* SearchBarPlayground */ = { 194 | isa = PBXNativeTarget; 195 | buildConfigurationList = 1E47166F193E66440062674B /* Build configuration list for PBXNativeTarget "SearchBarPlayground" */; 196 | buildPhases = ( 197 | 1E471639193E66440062674B /* Sources */, 198 | 1E47163A193E66440062674B /* Frameworks */, 199 | 1E47163B193E66440062674B /* Resources */, 200 | ); 201 | buildRules = ( 202 | ); 203 | dependencies = ( 204 | ); 205 | name = SearchBarPlayground; 206 | productName = SearchBarPlayground; 207 | productReference = 1E47163D193E66440062674B /* SearchBarPlayground.app */; 208 | productType = "com.apple.product-type.application"; 209 | }; 210 | 1E47165D193E66440062674B /* SearchBarPlaygroundTests */ = { 211 | isa = PBXNativeTarget; 212 | buildConfigurationList = 1E471672193E66440062674B /* Build configuration list for PBXNativeTarget "SearchBarPlaygroundTests" */; 213 | buildPhases = ( 214 | 1E47165A193E66440062674B /* Sources */, 215 | 1E47165B193E66440062674B /* Frameworks */, 216 | 1E47165C193E66440062674B /* Resources */, 217 | ); 218 | buildRules = ( 219 | ); 220 | dependencies = ( 221 | 1E471664193E66440062674B /* PBXTargetDependency */, 222 | ); 223 | name = SearchBarPlaygroundTests; 224 | productName = SearchBarPlaygroundTests; 225 | productReference = 1E47165E193E66440062674B /* SearchBarPlaygroundTests.xctest */; 226 | productType = "com.apple.product-type.bundle.unit-test"; 227 | }; 228 | /* End PBXNativeTarget section */ 229 | 230 | /* Begin PBXProject section */ 231 | 1E471635193E66440062674B /* Project object */ = { 232 | isa = PBXProject; 233 | attributes = { 234 | CLASSPREFIX = INS; 235 | LastUpgradeCheck = 0510; 236 | ORGANIZATIONNAME = "Berlin Insomniac"; 237 | TargetAttributes = { 238 | 1E47165D193E66440062674B = { 239 | TestTargetID = 1E47163C193E66440062674B; 240 | }; 241 | }; 242 | }; 243 | buildConfigurationList = 1E471638193E66440062674B /* Build configuration list for PBXProject "SearchBarPlayground" */; 244 | compatibilityVersion = "Xcode 3.2"; 245 | developmentRegion = English; 246 | hasScannedForEncodings = 0; 247 | knownRegions = ( 248 | en, 249 | Base, 250 | ); 251 | mainGroup = 1E471634193E66440062674B; 252 | productRefGroup = 1E47163E193E66440062674B /* Products */; 253 | projectDirPath = ""; 254 | projectRoot = ""; 255 | targets = ( 256 | 1E47163C193E66440062674B /* SearchBarPlayground */, 257 | 1E47165D193E66440062674B /* SearchBarPlaygroundTests */, 258 | ); 259 | }; 260 | /* End PBXProject section */ 261 | 262 | /* Begin PBXResourcesBuildPhase section */ 263 | 1E47163B193E66440062674B /* Resources */ = { 264 | isa = PBXResourcesBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | 1E471686193E68BD0062674B /* NavBarIconSearchBar2_blue@2x.png in Resources */, 268 | 1E47168B193E68BD0062674B /* NavBarIconSearch_white.png in Resources */, 269 | 1E471659193E66440062674B /* Images.xcassets in Resources */, 270 | 1E471683193E68BD0062674B /* NavBarIconSearchBar_blue.png in Resources */, 271 | 1E47168A193E68BD0062674B /* NavBarIconSearch_white@2x.png in Resources */, 272 | 1E471688193E68BD0062674B /* NavBarIconSearchCircle_blue@2x.png in Resources */, 273 | 1E471682193E68BD0062674B /* NavBarIconSearch_blue@2x.png in Resources */, 274 | 1E471689193E68BD0062674B /* NavBarIconSearch_blue.png in Resources */, 275 | 1E47164B193E66440062674B /* InfoPlist.strings in Resources */, 276 | 1E471687193E68BD0062674B /* NavBarIconSearchCircle_blue.png in Resources */, 277 | 1E471685193E68BD0062674B /* NavBarIconSearchBar2_blue.png in Resources */, 278 | 1E471654193E66440062674B /* Main.storyboard in Resources */, 279 | 1E471684193E68BD0062674B /* NavBarIconSearchBar_blue@2x.png in Resources */, 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | 1E47165C193E66440062674B /* Resources */ = { 284 | isa = PBXResourcesBuildPhase; 285 | buildActionMask = 2147483647; 286 | files = ( 287 | 1E47166A193E66440062674B /* InfoPlist.strings in Resources */, 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | /* End PBXResourcesBuildPhase section */ 292 | 293 | /* Begin PBXSourcesBuildPhase section */ 294 | 1E471639193E66440062674B /* Sources */ = { 295 | isa = PBXSourcesBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | 1E47164D193E66440062674B /* main.m in Sources */, 299 | 1E471677193E66700062674B /* INSSearchBar.m in Sources */, 300 | 1E471651193E66440062674B /* INSAppDelegate.m in Sources */, 301 | 1E471657193E66440062674B /* INSViewController.m in Sources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | 1E47165A193E66440062674B /* Sources */ = { 306 | isa = PBXSourcesBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | 1E47166C193E66440062674B /* SearchBarPlaygroundTests.m in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | /* End PBXSourcesBuildPhase section */ 314 | 315 | /* Begin PBXTargetDependency section */ 316 | 1E471664193E66440062674B /* PBXTargetDependency */ = { 317 | isa = PBXTargetDependency; 318 | target = 1E47163C193E66440062674B /* SearchBarPlayground */; 319 | targetProxy = 1E471663193E66440062674B /* PBXContainerItemProxy */; 320 | }; 321 | /* End PBXTargetDependency section */ 322 | 323 | /* Begin PBXVariantGroup section */ 324 | 1E471649193E66440062674B /* InfoPlist.strings */ = { 325 | isa = PBXVariantGroup; 326 | children = ( 327 | 1E47164A193E66440062674B /* en */, 328 | ); 329 | name = InfoPlist.strings; 330 | sourceTree = ""; 331 | }; 332 | 1E471652193E66440062674B /* Main.storyboard */ = { 333 | isa = PBXVariantGroup; 334 | children = ( 335 | 1E471653193E66440062674B /* Base */, 336 | ); 337 | name = Main.storyboard; 338 | sourceTree = ""; 339 | }; 340 | 1E471668193E66440062674B /* InfoPlist.strings */ = { 341 | isa = PBXVariantGroup; 342 | children = ( 343 | 1E471669193E66440062674B /* en */, 344 | ); 345 | name = InfoPlist.strings; 346 | sourceTree = ""; 347 | }; 348 | /* End PBXVariantGroup section */ 349 | 350 | /* Begin XCBuildConfiguration section */ 351 | 1E47166D193E66440062674B /* Debug */ = { 352 | isa = XCBuildConfiguration; 353 | buildSettings = { 354 | ALWAYS_SEARCH_USER_PATHS = NO; 355 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 356 | CLANG_CXX_LIBRARY = "libc++"; 357 | CLANG_ENABLE_MODULES = YES; 358 | CLANG_ENABLE_OBJC_ARC = YES; 359 | CLANG_WARN_BOOL_CONVERSION = YES; 360 | CLANG_WARN_CONSTANT_CONVERSION = YES; 361 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 362 | CLANG_WARN_EMPTY_BODY = YES; 363 | CLANG_WARN_ENUM_CONVERSION = YES; 364 | CLANG_WARN_INT_CONVERSION = YES; 365 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 366 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 367 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 368 | COPY_PHASE_STRIP = NO; 369 | GCC_C_LANGUAGE_STANDARD = gnu99; 370 | GCC_DYNAMIC_NO_PIC = NO; 371 | GCC_OPTIMIZATION_LEVEL = 0; 372 | GCC_PREPROCESSOR_DEFINITIONS = ( 373 | "DEBUG=1", 374 | "$(inherited)", 375 | ); 376 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 377 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 378 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 379 | GCC_WARN_UNDECLARED_SELECTOR = YES; 380 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 381 | GCC_WARN_UNUSED_FUNCTION = YES; 382 | GCC_WARN_UNUSED_VARIABLE = YES; 383 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 384 | ONLY_ACTIVE_ARCH = YES; 385 | SDKROOT = iphoneos; 386 | }; 387 | name = Debug; 388 | }; 389 | 1E47166E193E66440062674B /* Release */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | ALWAYS_SEARCH_USER_PATHS = NO; 393 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 394 | CLANG_CXX_LIBRARY = "libc++"; 395 | CLANG_ENABLE_MODULES = YES; 396 | CLANG_ENABLE_OBJC_ARC = YES; 397 | CLANG_WARN_BOOL_CONVERSION = YES; 398 | CLANG_WARN_CONSTANT_CONVERSION = YES; 399 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 400 | CLANG_WARN_EMPTY_BODY = YES; 401 | CLANG_WARN_ENUM_CONVERSION = YES; 402 | CLANG_WARN_INT_CONVERSION = YES; 403 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 404 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 405 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 406 | COPY_PHASE_STRIP = YES; 407 | ENABLE_NS_ASSERTIONS = NO; 408 | GCC_C_LANGUAGE_STANDARD = gnu99; 409 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 410 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 411 | GCC_WARN_UNDECLARED_SELECTOR = YES; 412 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 413 | GCC_WARN_UNUSED_FUNCTION = YES; 414 | GCC_WARN_UNUSED_VARIABLE = YES; 415 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 416 | SDKROOT = iphoneos; 417 | VALIDATE_PRODUCT = YES; 418 | }; 419 | name = Release; 420 | }; 421 | 1E471670193E66440062674B /* Debug */ = { 422 | isa = XCBuildConfiguration; 423 | buildSettings = { 424 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 425 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 426 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 427 | GCC_PREFIX_HEADER = "SearchBarPlayground/SearchBarPlayground-Prefix.pch"; 428 | INFOPLIST_FILE = "SearchBarPlayground/SearchBarPlayground-Info.plist"; 429 | PRODUCT_NAME = "$(TARGET_NAME)"; 430 | WRAPPER_EXTENSION = app; 431 | }; 432 | name = Debug; 433 | }; 434 | 1E471671193E66440062674B /* Release */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 438 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 439 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 440 | GCC_PREFIX_HEADER = "SearchBarPlayground/SearchBarPlayground-Prefix.pch"; 441 | INFOPLIST_FILE = "SearchBarPlayground/SearchBarPlayground-Info.plist"; 442 | PRODUCT_NAME = "$(TARGET_NAME)"; 443 | WRAPPER_EXTENSION = app; 444 | }; 445 | name = Release; 446 | }; 447 | 1E471673193E66440062674B /* Debug */ = { 448 | isa = XCBuildConfiguration; 449 | buildSettings = { 450 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SearchBarPlayground.app/SearchBarPlayground"; 451 | FRAMEWORK_SEARCH_PATHS = ( 452 | "$(SDKROOT)/Developer/Library/Frameworks", 453 | "$(inherited)", 454 | "$(DEVELOPER_FRAMEWORKS_DIR)", 455 | ); 456 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 457 | GCC_PREFIX_HEADER = "SearchBarPlayground/SearchBarPlayground-Prefix.pch"; 458 | GCC_PREPROCESSOR_DEFINITIONS = ( 459 | "DEBUG=1", 460 | "$(inherited)", 461 | ); 462 | INFOPLIST_FILE = "SearchBarPlaygroundTests/SearchBarPlaygroundTests-Info.plist"; 463 | PRODUCT_NAME = "$(TARGET_NAME)"; 464 | TEST_HOST = "$(BUNDLE_LOADER)"; 465 | WRAPPER_EXTENSION = xctest; 466 | }; 467 | name = Debug; 468 | }; 469 | 1E471674193E66440062674B /* Release */ = { 470 | isa = XCBuildConfiguration; 471 | buildSettings = { 472 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SearchBarPlayground.app/SearchBarPlayground"; 473 | FRAMEWORK_SEARCH_PATHS = ( 474 | "$(SDKROOT)/Developer/Library/Frameworks", 475 | "$(inherited)", 476 | "$(DEVELOPER_FRAMEWORKS_DIR)", 477 | ); 478 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 479 | GCC_PREFIX_HEADER = "SearchBarPlayground/SearchBarPlayground-Prefix.pch"; 480 | INFOPLIST_FILE = "SearchBarPlaygroundTests/SearchBarPlaygroundTests-Info.plist"; 481 | PRODUCT_NAME = "$(TARGET_NAME)"; 482 | TEST_HOST = "$(BUNDLE_LOADER)"; 483 | WRAPPER_EXTENSION = xctest; 484 | }; 485 | name = Release; 486 | }; 487 | /* End XCBuildConfiguration section */ 488 | 489 | /* Begin XCConfigurationList section */ 490 | 1E471638193E66440062674B /* Build configuration list for PBXProject "SearchBarPlayground" */ = { 491 | isa = XCConfigurationList; 492 | buildConfigurations = ( 493 | 1E47166D193E66440062674B /* Debug */, 494 | 1E47166E193E66440062674B /* Release */, 495 | ); 496 | defaultConfigurationIsVisible = 0; 497 | defaultConfigurationName = Release; 498 | }; 499 | 1E47166F193E66440062674B /* Build configuration list for PBXNativeTarget "SearchBarPlayground" */ = { 500 | isa = XCConfigurationList; 501 | buildConfigurations = ( 502 | 1E471670193E66440062674B /* Debug */, 503 | 1E471671193E66440062674B /* Release */, 504 | ); 505 | defaultConfigurationIsVisible = 0; 506 | }; 507 | 1E471672193E66440062674B /* Build configuration list for PBXNativeTarget "SearchBarPlaygroundTests" */ = { 508 | isa = XCConfigurationList; 509 | buildConfigurations = ( 510 | 1E471673193E66440062674B /* Debug */, 511 | 1E471674193E66440062674B /* Release */, 512 | ); 513 | defaultConfigurationIsVisible = 0; 514 | }; 515 | /* End XCConfigurationList section */ 516 | }; 517 | rootObject = 1E471635193E66440062674B /* Project object */; 518 | } 519 | -------------------------------------------------------------------------------- /SearchBarPlayground.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SearchBarPlayground.xcodeproj/project.xcworkspace/xcshareddata/SearchBarPlayground.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | F024B4E1-DCA4-45E3-BB5C-21E6826607E1 9 | IDESourceControlProjectName 10 | SearchBarPlayground 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | B20F1041-6E80-4FCD-B3ED-9E0F6E035A73 14 | https://github.com/berlininsomniac/INSSearchBar.git 15 | 16 | IDESourceControlProjectPath 17 | SearchBarPlayground.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | B20F1041-6E80-4FCD-B3ED-9E0F6E035A73 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/berlininsomniac/INSSearchBar.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | B20F1041-6E80-4FCD-B3ED-9E0F6E035A73 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | B20F1041-6E80-4FCD-B3ED-9E0F6E035A73 36 | IDESourceControlWCCName 37 | INSSearchBar 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /SearchBarPlayground.xcodeproj/project.xcworkspace/xcuserdata/bsalanki.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /SearchBarPlayground.xcodeproj/xcuserdata/bsalanki.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /SearchBarPlayground.xcodeproj/xcuserdata/bsalanki.xcuserdatad/xcschemes/SearchBarPlayground.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 | -------------------------------------------------------------------------------- /SearchBarPlayground.xcodeproj/xcuserdata/bsalanki.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SearchBarPlayground.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 1E47163C193E66440062674B 16 | 17 | primary 18 | 19 | 20 | 1E47165D193E66440062674B 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SearchBarPlayground/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SearchBarPlayground/INSAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // INSAppDelegate.h 3 | // Berlin Insomniac 4 | // 5 | // Created by Salánki, Benjámin on 06/03/14. 6 | // Copyright (c) 2014 Berlin Insomniac. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface INSAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SearchBarPlayground/INSAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // INSAppDelegate.m 3 | // Berlin Insomniac 4 | // 5 | // Created by Salánki, Benjámin on 06/03/14. 6 | // Copyright (c) 2014 Berlin Insomniac. All rights reserved. 7 | // 8 | 9 | #import "INSAppDelegate.h" 10 | 11 | @implementation INSAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /SearchBarPlayground/INSSearchBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // INSSearchBar.h 3 | // Berlin Insomniac 4 | // 5 | // Created by Salánki, Benjámin on 06/03/14. 6 | // Copyright (c) 2014 Berlin Insomniac. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * The different states for an INSSearchBarState. 13 | */ 14 | 15 | typedef NS_ENUM(NSUInteger, INSSearchBarState) 16 | { 17 | /** 18 | * The default or normal state. The search field is hidden. 19 | */ 20 | 21 | INSSearchBarStateNormal = 0, 22 | 23 | /** 24 | * The state where the search field is visible. 25 | */ 26 | 27 | INSSearchBarStateSearchBarVisible, 28 | 29 | /** 30 | * The state where the search field is visible and there is text entered. 31 | */ 32 | 33 | INSSearchBarStateSearchBarHasContent, 34 | 35 | /** 36 | * The search bar is transitioning between states. 37 | */ 38 | 39 | INSSearchBarStateTransitioning 40 | }; 41 | 42 | @class INSSearchBar; 43 | 44 | /** 45 | * The delegate is responsible for providing values to the search bar that it can use to determine its size. 46 | */ 47 | 48 | @protocol INSSearchBarDelegate 49 | 50 | /** 51 | * The delegate is asked to provide the destination frame for the search bar when the search bar is transitioning to the visible state. 52 | * 53 | * @param searchBar The search bar that will begin transitioning. 54 | * 55 | * @return The frame in the coordinate system of the search bar's superview. 56 | */ 57 | 58 | - (CGRect)destinationFrameForSearchBar:(INSSearchBar *)searchBar; 59 | 60 | /** 61 | * The delegate is informed about the imminent state transitioning of the status bar. 62 | * 63 | * @param searchBar The search bar that will begin transitioning. 64 | * @param destinationState The state that the bar will be in once transitioning completes. The current state of the search bar can be queried and will return the state before transitioning. 65 | */ 66 | 67 | - (void)searchBar:(INSSearchBar *)searchBar willStartTransitioningToState:(INSSearchBarState)destinationState; 68 | 69 | /** 70 | * The delegate is informed about the state transitioning of the status bar that has just occured. 71 | * 72 | * @param searchBar The search bar that went through state transitioning. 73 | * @param destinationState The state that the bar was in before transitioning started. The current state of the search bar can be queried and will return the state after transitioning. 74 | */ 75 | 76 | - (void)searchBar:(INSSearchBar *)searchBar didEndTransitioningFromState:(INSSearchBarState)previousState; 77 | 78 | /** 79 | * The delegate is informed that the search bar's return key was pressed. This should be used to start querries. 80 | * 81 | * Important: If the searchField property is explicitly supplied with a delegate property this method will not be called. 82 | * 83 | * @param searchBar The search bar whose return key was pressed. 84 | */ 85 | 86 | - (void)searchBarDidTapReturn:(INSSearchBar *)searchBar; 87 | 88 | /** 89 | * The delegate is informed that the search bar's text has changed. 90 | * 91 | * Important: If the searchField property is explicitly supplied with a delegate property this method will not be called. 92 | * 93 | * @param searchBar The search bar whose text did change. 94 | */ 95 | 96 | - (void)searchBarTextDidChange:(INSSearchBar *)searchBar; 97 | 98 | @end 99 | 100 | /** 101 | * An animating search bar. 102 | */ 103 | 104 | @interface INSSearchBar : UIView 105 | 106 | /** 107 | * The current state of the search bar. 108 | */ 109 | 110 | @property (nonatomic, readonly) INSSearchBarState state; 111 | 112 | /** 113 | * The text field used for entering search queries. Visible only when search is active. 114 | */ 115 | 116 | @property (nonatomic, readonly) UITextField *searchField; 117 | 118 | /** 119 | * The (optional) delegate is responsible for providing values necessary for state change animations of the search bar. @see INSSearchBarDelegate. 120 | */ 121 | 122 | @property (nonatomic, weak) id delegate; 123 | 124 | @end 125 | -------------------------------------------------------------------------------- /SearchBarPlayground/INSSearchBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // INSSearchBar.m 3 | // Berlin Insomniac 4 | // 5 | // Created by Salánki, Benjámin on 06/03/14. 6 | // Copyright (c) 2014 Berlin Insomniac. All rights reserved. 7 | // 8 | 9 | #import "INSSearchBar.h" 10 | 11 | @interface INSSearchBar () 12 | 13 | /** 14 | * The borderedframe of the search bar. Visible only when search mode is active. 15 | */ 16 | 17 | @property (nonatomic, strong) UIView *searchFrame; 18 | 19 | @property (nonatomic, strong) UITextField *searchField; 20 | 21 | /** 22 | * The image view containing the search magnifying glass icon in white. Visible when search is not active. 23 | */ 24 | 25 | @property (nonatomic, strong) UIImageView *searchImageViewOff; 26 | 27 | /** 28 | * The image view containing the search magnifying glass icon in blue. Visible when search is active. 29 | */ 30 | 31 | @property (nonatomic, strong) UIImageView *searchImageViewOn; 32 | 33 | /** 34 | * The image view containing the circle part of the magnifying glass icon in blue. 35 | */ 36 | 37 | @property (nonatomic, strong) UIImageView *searchImageCircle; 38 | 39 | /** 40 | * The image view containing the left cross part of the magnifying glass icon in blue. 41 | */ 42 | 43 | @property (nonatomic, strong) UIImageView *searchImageCrossLeft; 44 | 45 | /** 46 | * The image view containing the right cross part of the magnifying glass icon in blue. 47 | */ 48 | 49 | @property (nonatomic, strong) UIImageView *searchImageCrossRight; 50 | 51 | /** 52 | * The frame of the search bar before a transition started. Only set if delegate is not nil. 53 | */ 54 | 55 | @property (nonatomic, assign) CGRect originalFrame; 56 | 57 | /** 58 | * A gesture recognizer responsible for closing the keyboard once tapped on. 59 | * 60 | * Added to the window's root view controller view and set to allow touches to propagate to that view. 61 | */ 62 | 63 | @property (nonatomic, strong) UITapGestureRecognizer *keyboardDismissGestureRecognizer; 64 | 65 | @property (nonatomic, assign) INSSearchBarState state; 66 | 67 | @end 68 | 69 | static CGFloat const kINSSearchBarInset = 11.0; 70 | static CGFloat const kINSSearchBarImageSize = 22.0; 71 | static NSTimeInterval const kINSSearchBarAnimationStepDuration = 0.25; 72 | 73 | @implementation INSSearchBar 74 | 75 | #pragma mark - initialization 76 | 77 | - (id)initWithFrame:(CGRect)frame 78 | { 79 | if ((self = [super initWithFrame:CGRectMake(CGRectGetMinX(frame), CGRectGetMinY(frame), CGRectGetWidth(frame), 34.0)])) 80 | { 81 | // Initialization code 82 | self.opaque = NO; 83 | self.backgroundColor = [UIColor clearColor]; 84 | 85 | self.searchFrame = [[UIView alloc] initWithFrame:self.bounds]; 86 | self.searchFrame.backgroundColor = [UIColor clearColor]; 87 | self.searchFrame.opaque = NO; 88 | self.searchFrame.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 89 | self.searchFrame.layer.masksToBounds = YES; 90 | self.searchFrame.layer.cornerRadius = CGRectGetHeight(self.bounds) / 2; 91 | self.searchFrame.layer.borderWidth = 0.5; 92 | self.searchFrame.layer.borderColor = [UIColor clearColor].CGColor; 93 | self.searchFrame.contentMode = UIViewContentModeRedraw; 94 | 95 | [self addSubview:self.searchFrame]; 96 | 97 | self.searchField = [[UITextField alloc] initWithFrame:CGRectMake(kINSSearchBarInset, 3.0, CGRectGetWidth(self.bounds) - (2 * kINSSearchBarInset) - kINSSearchBarImageSize, CGRectGetHeight(self.bounds) - 6.0)]; 98 | self.searchField.borderStyle = UITextBorderStyleNone; 99 | self.searchField.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 100 | self.searchField.font = [UIFont fontWithName:@"AvenirNext-Regular" size:16.0]; 101 | self.searchField.textColor = [UIColor colorWithRed:17.0/255.0 green:190.0/255.0 blue:227.0/255.0 alpha:1.0]; 102 | self.searchField.alpha = 0.0; 103 | self.searchField.delegate = self; 104 | 105 | [self.searchFrame addSubview:self.searchField]; 106 | 107 | UIView *searchImageViewOnContainerView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.bounds) - kINSSearchBarInset - kINSSearchBarImageSize, (CGRectGetHeight(self.bounds) - kINSSearchBarImageSize) / 2, kINSSearchBarImageSize, kINSSearchBarImageSize)]; 108 | searchImageViewOnContainerView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin; 109 | 110 | [self.searchFrame addSubview:searchImageViewOnContainerView]; 111 | 112 | self.searchImageViewOn = [[UIImageView alloc] initWithFrame:searchImageViewOnContainerView.bounds]; 113 | self.searchImageViewOn.alpha = 0.0; 114 | self.searchImageViewOn.image = [UIImage imageNamed:@"NavBarIconSearch_blue"]; 115 | 116 | [searchImageViewOnContainerView addSubview:self.searchImageViewOn]; 117 | 118 | self.searchImageCircle = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 18.0, 18.0)]; 119 | self.searchImageCircle.alpha = 0.0; 120 | self.searchImageCircle.image = [UIImage imageNamed:@"NavBarIconSearchCircle_blue"]; 121 | 122 | [searchImageViewOnContainerView addSubview:self.searchImageCircle]; 123 | 124 | self.searchImageCrossLeft = [[UIImageView alloc] initWithFrame:CGRectMake(14.0, 14.0, 8.0, 8.0)]; 125 | self.searchImageCrossLeft.alpha = 0.0; 126 | self.searchImageCrossLeft.image = [UIImage imageNamed:@"NavBarIconSearchBar_blue"]; 127 | 128 | [searchImageViewOnContainerView addSubview:self.searchImageCrossLeft]; 129 | 130 | self.searchImageCrossRight = [[UIImageView alloc] initWithFrame:CGRectMake(7.0, 7.0, 8.0, 8.0)]; 131 | self.searchImageCrossRight.alpha = 0.0; 132 | self.searchImageCrossRight.image = [UIImage imageNamed:@"NavBarIconSearchBar2_blue"]; 133 | 134 | [searchImageViewOnContainerView addSubview:self.searchImageCrossRight]; 135 | 136 | self.searchImageViewOff = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.bounds) - kINSSearchBarInset - kINSSearchBarImageSize, (CGRectGetHeight(self.bounds) - kINSSearchBarImageSize) / 2, kINSSearchBarImageSize, kINSSearchBarImageSize)]; 137 | self.searchImageViewOff.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin; 138 | self.searchImageViewOff.alpha = 1.0; 139 | self.searchImageViewOff.image = [UIImage imageNamed:@"NavBarIconSearch_white"]; 140 | 141 | [self.searchFrame addSubview:self.searchImageViewOff]; 142 | 143 | UIView *tapableView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.bounds) - (2 * kINSSearchBarInset) - kINSSearchBarImageSize, 0.0, (2 * kINSSearchBarInset) + kINSSearchBarImageSize, CGRectGetHeight(self.bounds))]; 144 | tapableView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight; 145 | [tapableView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(changeStateIfPossible:)]]; 146 | 147 | [self.searchFrame addSubview:tapableView]; 148 | 149 | self.keyboardDismissGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissKeyboard:)]; 150 | self.keyboardDismissGestureRecognizer.cancelsTouchesInView = NO; 151 | self.keyboardDismissGestureRecognizer.delegate = self; 152 | 153 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; 154 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; 155 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidChange:) name:UITextFieldTextDidChangeNotification object:self.searchField]; 156 | } 157 | 158 | return self; 159 | } 160 | 161 | #pragma mark - state change 162 | 163 | - (void)changeStateIfPossible:(UITapGestureRecognizer *)gestureRecognizer 164 | { 165 | switch (self.state) 166 | { 167 | case INSSearchBarStateNormal: 168 | { 169 | [self showSearchBar:gestureRecognizer]; 170 | } 171 | break; 172 | 173 | case INSSearchBarStateSearchBarVisible: 174 | { 175 | [self hideSearchBar:gestureRecognizer]; 176 | } 177 | break; 178 | 179 | case INSSearchBarStateSearchBarHasContent: 180 | { 181 | self.searchField.text = nil; 182 | [self textDidChange:nil]; 183 | } 184 | break; 185 | 186 | case INSSearchBarStateTransitioning: 187 | { 188 | // Do nothing. 189 | } 190 | break; 191 | } 192 | } 193 | 194 | - (void)showSearchBar:(id)sender 195 | { 196 | if (self.state == INSSearchBarStateNormal) 197 | { 198 | if ([self.delegate respondsToSelector:@selector(searchBar:willStartTransitioningToState:)]) 199 | { 200 | [self.delegate searchBar:self willStartTransitioningToState:INSSearchBarStateSearchBarVisible]; 201 | } 202 | 203 | self.state = INSSearchBarStateTransitioning; 204 | 205 | self.searchField.text = nil; 206 | 207 | [UIView animateWithDuration:kINSSearchBarAnimationStepDuration animations:^{ 208 | 209 | self.searchFrame.layer.borderColor = [UIColor whiteColor].CGColor; 210 | 211 | if ([self.delegate respondsToSelector:@selector(destinationFrameForSearchBar:)]) 212 | { 213 | self.originalFrame = self.frame; 214 | 215 | self.frame = [self.delegate destinationFrameForSearchBar:self]; 216 | } 217 | 218 | } completion:^(BOOL finished) { 219 | 220 | [self.searchField becomeFirstResponder]; 221 | 222 | [UIView animateWithDuration:kINSSearchBarAnimationStepDuration * 2 animations:^{ 223 | 224 | self.searchFrame.layer.backgroundColor = [UIColor whiteColor].CGColor; 225 | self.searchImageViewOff.alpha = 0.0; 226 | self.searchImageViewOn.alpha = 1.0; 227 | self.searchField.alpha = 1.0; 228 | 229 | } completion:^(BOOL finished) { 230 | 231 | self.state = INSSearchBarStateSearchBarVisible; 232 | 233 | if ([self.delegate respondsToSelector:@selector(searchBar:didEndTransitioningFromState:)]) 234 | { 235 | [self.delegate searchBar:self didEndTransitioningFromState:INSSearchBarStateNormal]; 236 | } 237 | }]; 238 | }]; 239 | } 240 | } 241 | 242 | - (void)hideSearchBar:(id)sender 243 | { 244 | if (self.state == INSSearchBarStateSearchBarVisible || self.state == INSSearchBarStateSearchBarHasContent) 245 | { 246 | [self.window endEditing:YES]; 247 | 248 | if ([self.delegate respondsToSelector:@selector(searchBar:willStartTransitioningToState:)]) 249 | { 250 | [self.delegate searchBar:self willStartTransitioningToState:INSSearchBarStateNormal]; 251 | } 252 | 253 | self.searchField.text = nil; 254 | 255 | self.state = INSSearchBarStateTransitioning; 256 | 257 | [UIView animateWithDuration:kINSSearchBarAnimationStepDuration animations:^{ 258 | 259 | if ([self.delegate respondsToSelector:@selector(destinationFrameForSearchBar:)]) 260 | { 261 | self.frame = self.originalFrame; 262 | } 263 | 264 | self.searchFrame.layer.backgroundColor = [UIColor clearColor].CGColor; 265 | self.searchImageViewOff.alpha = 1.0; 266 | self.searchImageViewOn.alpha = 0.0; 267 | self.searchField.alpha = 0.0; 268 | 269 | } completion:^(BOOL finished) { 270 | 271 | [UIView animateWithDuration:kINSSearchBarAnimationStepDuration animations:^{ 272 | 273 | self.searchFrame.layer.borderColor = [UIColor clearColor].CGColor; 274 | 275 | } completion:^(BOOL finished) { 276 | 277 | self.searchImageCircle.frame = CGRectMake(0.0, 0.0, 18.0, 18.0); 278 | self.searchImageCrossLeft.frame = CGRectMake(14.0, 14.0, 8.0, 8.0); 279 | self.searchImageCircle.alpha = 0.0; 280 | self.searchImageCrossLeft.alpha = 0.0; 281 | self.searchImageCrossRight.alpha = 0.0; 282 | 283 | self.state = INSSearchBarStateNormal; 284 | 285 | if ([self.delegate respondsToSelector:@selector(searchBar:didEndTransitioningFromState:)]) 286 | { 287 | [self.delegate searchBar:self didEndTransitioningFromState:INSSearchBarStateSearchBarVisible]; 288 | } 289 | }]; 290 | }]; 291 | } 292 | } 293 | 294 | #pragma mark - keyboard handling 295 | 296 | - (void)keyboardWillShow:(NSNotification *)notification 297 | { 298 | if ([self.searchField isFirstResponder]) 299 | { 300 | [self.window.rootViewController.view addGestureRecognizer:self.keyboardDismissGestureRecognizer]; 301 | } 302 | } 303 | 304 | - (void)keyboardWillHide:(NSNotification *)notification 305 | { 306 | if ([self.searchField isFirstResponder]) 307 | { 308 | [self.window.rootViewController.view removeGestureRecognizer:self.keyboardDismissGestureRecognizer]; 309 | } 310 | } 311 | 312 | - (void)dismissKeyboard:(UITapGestureRecognizer *)gestureRecognizer 313 | { 314 | if ([self.searchField isFirstResponder]) 315 | { 316 | [self.window endEditing:YES]; 317 | 318 | if (self.state == INSSearchBarStateSearchBarVisible && self.searchField.text.length == 0) 319 | { 320 | [self hideSearchBar:nil]; 321 | } 322 | } 323 | } 324 | 325 | #pragma mark - clear button handling 326 | 327 | - (void)textDidChange:(NSNotification *)notification 328 | { 329 | BOOL hasText = self.searchField.text.length != 0; 330 | 331 | if (hasText) 332 | { 333 | if (self.state == INSSearchBarStateSearchBarVisible) 334 | { 335 | self.state = INSSearchBarStateTransitioning; 336 | 337 | self.searchImageViewOn.alpha = 0.0; 338 | self.searchImageCircle.alpha = 1.0; 339 | self.searchImageCrossLeft.alpha = 1.0; 340 | 341 | [UIView animateWithDuration:kINSSearchBarAnimationStepDuration animations:^{ 342 | 343 | self.searchImageCircle.frame = CGRectMake(2.0, 2.0, 18.0, 18.0); 344 | self.searchImageCrossLeft.frame = CGRectMake(7.0, 7.0, 8.0, 8.0); 345 | 346 | } completion:^(BOOL finished) { 347 | 348 | [UIView animateWithDuration:kINSSearchBarAnimationStepDuration animations:^{ 349 | 350 | self.searchImageCrossRight.alpha = 1.0; 351 | 352 | } completion:^(BOOL finished) { 353 | 354 | self.state = INSSearchBarStateSearchBarHasContent; 355 | 356 | }]; 357 | }]; 358 | } 359 | } 360 | else 361 | { 362 | if (self.state == INSSearchBarStateSearchBarHasContent) 363 | { 364 | self.state = INSSearchBarStateTransitioning; 365 | 366 | [UIView animateWithDuration:kINSSearchBarAnimationStepDuration animations:^{ 367 | 368 | self.searchImageCrossRight.alpha = 0.0; 369 | 370 | } completion:^(BOOL finished) { 371 | 372 | [UIView animateWithDuration:kINSSearchBarAnimationStepDuration animations:^{ 373 | 374 | self.searchImageCircle.frame = CGRectMake(0.0, 0.0, 18.0, 18.0); 375 | self.searchImageCrossLeft.frame = CGRectMake(14.0, 14.0, 8.0, 8.0); 376 | 377 | } completion:^(BOOL finished) { 378 | 379 | self.searchImageViewOn.alpha = 1.0; 380 | self.searchImageCircle.alpha = 0.0; 381 | self.searchImageCrossLeft.alpha = 0.0; 382 | 383 | self.state = INSSearchBarStateSearchBarVisible; 384 | 385 | }]; 386 | }]; 387 | } 388 | } 389 | 390 | if ([self.delegate respondsToSelector:@selector(searchBarTextDidChange:)]) 391 | { 392 | [self.delegate searchBarTextDidChange:self]; 393 | } 394 | } 395 | 396 | #pragma mark - text field delegate 397 | 398 | - (BOOL)textFieldShouldReturn:(UITextField *)textField 399 | { 400 | BOOL retVal = YES; 401 | 402 | if ([self.delegate respondsToSelector:@selector(searchBarDidTapReturn:)]) 403 | { 404 | [self.delegate searchBarDidTapReturn:self]; 405 | } 406 | 407 | return retVal; 408 | } 409 | 410 | #pragma mark - gesture recognizer delegate 411 | 412 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch 413 | { 414 | BOOL retVal = YES; 415 | 416 | if (CGRectContainsPoint(self.bounds, [touch locationInView:self])) 417 | { 418 | retVal = NO; 419 | } 420 | 421 | return retVal; 422 | } 423 | 424 | #pragma mark - cleanup 425 | 426 | - (void)dealloc 427 | { 428 | [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; 429 | [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil]; 430 | [[NSNotificationCenter defaultCenter] removeObserver:self name:UITextFieldTextDidChangeNotification object:self.searchField]; 431 | } 432 | 433 | @end 434 | -------------------------------------------------------------------------------- /SearchBarPlayground/INSViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // INSViewController.h 3 | // Berlin Insomniac 4 | // 5 | // Created by Salánki, Benjámin on 06/03/14. 6 | // Copyright (c) 2014 Berlin Insomniac. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface INSViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SearchBarPlayground/INSViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // INSViewController.m 3 | // Berlin Insomniac 4 | // 5 | // Created by Salánki, Benjámin on 06/03/14. 6 | // Copyright (c) 2014 Berlin Insomniac. All rights reserved. 7 | // 8 | 9 | #import "INSViewController.h" 10 | #import "INSSearchBar.h" 11 | 12 | @interface INSViewController () 13 | 14 | @property (nonatomic, strong) INSSearchBar *searchBarWithoutDelegate; 15 | @property (nonatomic, strong) INSSearchBar *searchBarWithDelegate; 16 | 17 | @end 18 | 19 | @implementation INSViewController 20 | 21 | #pragma mark - view life cycle 22 | 23 | - (void)viewDidLoad 24 | { 25 | [super viewDidLoad]; 26 | // Do any additional setup after loading the view, typically from a nib. 27 | self.view.backgroundColor = [UIColor colorWithRed:0.000 green:0.418 blue:0.673 alpha:1.000]; 28 | 29 | UILabel *descriptionLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(20.0, 20.0, CGRectGetWidth(self.view.bounds) - 40.0, 20.0)]; 30 | descriptionLabel1.textColor = [UIColor whiteColor]; 31 | descriptionLabel1.font = [UIFont fontWithName:@"AvenirNext-Regular" size:16.0]; 32 | descriptionLabel1.text = @"Without delegate"; 33 | 34 | [self.view addSubview:descriptionLabel1]; 35 | 36 | self.searchBarWithoutDelegate = [[INSSearchBar alloc] initWithFrame:CGRectMake(20.0, 40.0, CGRectGetWidth(self.view.bounds) - 40.0, 34.0)]; 37 | 38 | [self.view addSubview:self.searchBarWithoutDelegate]; 39 | 40 | UILabel *descriptionLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(20.0, 120.0, CGRectGetWidth(self.view.bounds) - 40.0, 20.0)]; 41 | descriptionLabel2.textColor = [UIColor whiteColor]; 42 | descriptionLabel2.font = [UIFont fontWithName:@"AvenirNext-Regular" size:16.0]; 43 | descriptionLabel2.text = @"With delegate"; 44 | 45 | [self.view addSubview:descriptionLabel2]; 46 | 47 | self.searchBarWithDelegate = [[INSSearchBar alloc] initWithFrame:CGRectMake(20.0, 140.0, 44.0, 34.0)]; 48 | self.searchBarWithDelegate.delegate = self; 49 | 50 | [self.view addSubview:self.searchBarWithDelegate]; 51 | } 52 | 53 | #pragma mark - search bar delegate 54 | 55 | - (CGRect)destinationFrameForSearchBar:(INSSearchBar *)searchBar 56 | { 57 | return CGRectMake(20.0, 140.0, CGRectGetWidth(self.view.bounds) - 40.0, 34.0); 58 | } 59 | 60 | - (void)searchBar:(INSSearchBar *)searchBar willStartTransitioningToState:(INSSearchBarState)destinationState 61 | { 62 | // Do whatever you deem necessary. 63 | } 64 | 65 | - (void)searchBar:(INSSearchBar *)searchBar didEndTransitioningFromState:(INSSearchBarState)previousState 66 | { 67 | // Do whatever you deem necessary. 68 | } 69 | 70 | - (void)searchBarDidTapReturn:(INSSearchBar *)searchBar 71 | { 72 | // Do whatever you deem necessary. 73 | // Access the text from the search bar like searchBar.searchField.text 74 | } 75 | 76 | - (void)searchBarTextDidChange:(INSSearchBar *)searchBar 77 | { 78 | // Do whatever you deem necessary. 79 | // Access the text from the search bar like searchBar.searchField.text 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /SearchBarPlayground/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 | } -------------------------------------------------------------------------------- /SearchBarPlayground/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 | } -------------------------------------------------------------------------------- /SearchBarPlayground/NavBarIconSearchBar2_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/berlininsomniac/INSSearchBar/973b03486c50d6efadd542aea64c325833243643/SearchBarPlayground/NavBarIconSearchBar2_blue.png -------------------------------------------------------------------------------- /SearchBarPlayground/NavBarIconSearchBar2_blue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/berlininsomniac/INSSearchBar/973b03486c50d6efadd542aea64c325833243643/SearchBarPlayground/NavBarIconSearchBar2_blue@2x.png -------------------------------------------------------------------------------- /SearchBarPlayground/NavBarIconSearchBar_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/berlininsomniac/INSSearchBar/973b03486c50d6efadd542aea64c325833243643/SearchBarPlayground/NavBarIconSearchBar_blue.png -------------------------------------------------------------------------------- /SearchBarPlayground/NavBarIconSearchBar_blue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/berlininsomniac/INSSearchBar/973b03486c50d6efadd542aea64c325833243643/SearchBarPlayground/NavBarIconSearchBar_blue@2x.png -------------------------------------------------------------------------------- /SearchBarPlayground/NavBarIconSearchCircle_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/berlininsomniac/INSSearchBar/973b03486c50d6efadd542aea64c325833243643/SearchBarPlayground/NavBarIconSearchCircle_blue.png -------------------------------------------------------------------------------- /SearchBarPlayground/NavBarIconSearchCircle_blue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/berlininsomniac/INSSearchBar/973b03486c50d6efadd542aea64c325833243643/SearchBarPlayground/NavBarIconSearchCircle_blue@2x.png -------------------------------------------------------------------------------- /SearchBarPlayground/NavBarIconSearch_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/berlininsomniac/INSSearchBar/973b03486c50d6efadd542aea64c325833243643/SearchBarPlayground/NavBarIconSearch_blue.png -------------------------------------------------------------------------------- /SearchBarPlayground/NavBarIconSearch_blue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/berlininsomniac/INSSearchBar/973b03486c50d6efadd542aea64c325833243643/SearchBarPlayground/NavBarIconSearch_blue@2x.png -------------------------------------------------------------------------------- /SearchBarPlayground/NavBarIconSearch_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/berlininsomniac/INSSearchBar/973b03486c50d6efadd542aea64c325833243643/SearchBarPlayground/NavBarIconSearch_white.png -------------------------------------------------------------------------------- /SearchBarPlayground/NavBarIconSearch_white@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/berlininsomniac/INSSearchBar/973b03486c50d6efadd542aea64c325833243643/SearchBarPlayground/NavBarIconSearch_white@2x.png -------------------------------------------------------------------------------- /SearchBarPlayground/SearchBarPlayground-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | berlin.insomniac.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /SearchBarPlayground/SearchBarPlayground-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_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /SearchBarPlayground/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /SearchBarPlayground/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SearchBarPlayground 4 | // 5 | // Created by Salánki, Benjamin on 03/06/14. 6 | // Copyright (c) 2014 Berlin Insomniac. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "INSAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([INSAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SearchBarPlaygroundTests/SearchBarPlaygroundTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | berlin.insomniac.${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 | -------------------------------------------------------------------------------- /SearchBarPlaygroundTests/SearchBarPlaygroundTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SearchBarPlaygroundTests.m 3 | // SearchBarPlaygroundTests 4 | // 5 | // Created by Salánki, Benjamin on 03/06/14. 6 | // Copyright (c) 2014 Berlin Insomniac. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SearchBarPlaygroundTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation SearchBarPlaygroundTests 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 | -------------------------------------------------------------------------------- /SearchBarPlaygroundTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | --------------------------------------------------------------------------------