├── DropDownExample.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── bisma.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── bisma.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── DropDownExample.xcscheme │ └── xcschememanagement.plist ├── DropDownExample ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── BSDropDownClass │ ├── BSDropDown.h │ ├── BSDropDown.m │ ├── dot-menu@2x.png │ └── dot-menu@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── README.md └── _config.yml /DropDownExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4E10DE841E824A91000C43F9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E10DE831E824A91000C43F9 /* main.m */; }; 11 | 4E10DE871E824A91000C43F9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E10DE861E824A91000C43F9 /* AppDelegate.m */; }; 12 | 4E10DE8A1E824A91000C43F9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E10DE891E824A91000C43F9 /* ViewController.m */; }; 13 | 4E10DE8D1E824A91000C43F9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4E10DE8B1E824A91000C43F9 /* Main.storyboard */; }; 14 | 4E10DE8F1E824A91000C43F9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4E10DE8E1E824A91000C43F9 /* Assets.xcassets */; }; 15 | 4E10DE921E824A91000C43F9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4E10DE901E824A91000C43F9 /* LaunchScreen.storyboard */; }; 16 | 4E10DEA61E82546E000C43F9 /* BSDropDown.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E10DEA31E82546E000C43F9 /* BSDropDown.m */; }; 17 | 4E10DEA71E82546E000C43F9 /* dot-menu@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E10DEA41E82546E000C43F9 /* dot-menu@2x.png */; }; 18 | 4E10DEA81E82546E000C43F9 /* dot-menu@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E10DEA51E82546E000C43F9 /* dot-menu@3x.png */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 4E10DE7F1E824A91000C43F9 /* DropDownExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DropDownExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 4E10DE831E824A91000C43F9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 24 | 4E10DE851E824A91000C43F9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 25 | 4E10DE861E824A91000C43F9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 26 | 4E10DE881E824A91000C43F9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 27 | 4E10DE891E824A91000C43F9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 28 | 4E10DE8C1E824A91000C43F9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 29 | 4E10DE8E1E824A91000C43F9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 30 | 4E10DE911E824A91000C43F9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 31 | 4E10DE931E824A91000C43F9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 4E10DEA21E82546D000C43F9 /* BSDropDown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSDropDown.h; sourceTree = ""; }; 33 | 4E10DEA31E82546E000C43F9 /* BSDropDown.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSDropDown.m; sourceTree = ""; }; 34 | 4E10DEA41E82546E000C43F9 /* dot-menu@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "dot-menu@2x.png"; sourceTree = ""; }; 35 | 4E10DEA51E82546E000C43F9 /* dot-menu@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "dot-menu@3x.png"; sourceTree = ""; }; 36 | /* End PBXFileReference section */ 37 | 38 | /* Begin PBXFrameworksBuildPhase section */ 39 | 4E10DE7C1E824A91000C43F9 /* Frameworks */ = { 40 | isa = PBXFrameworksBuildPhase; 41 | buildActionMask = 2147483647; 42 | files = ( 43 | ); 44 | runOnlyForDeploymentPostprocessing = 0; 45 | }; 46 | /* End PBXFrameworksBuildPhase section */ 47 | 48 | /* Begin PBXGroup section */ 49 | 4E10DE761E824A91000C43F9 = { 50 | isa = PBXGroup; 51 | children = ( 52 | 4E10DEA11E82544C000C43F9 /* BSDropDownClass */, 53 | 4E10DE811E824A91000C43F9 /* DropDownExample */, 54 | 4E10DE801E824A91000C43F9 /* Products */, 55 | ); 56 | sourceTree = ""; 57 | }; 58 | 4E10DE801E824A91000C43F9 /* Products */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 4E10DE7F1E824A91000C43F9 /* DropDownExample.app */, 62 | ); 63 | name = Products; 64 | sourceTree = ""; 65 | }; 66 | 4E10DE811E824A91000C43F9 /* DropDownExample */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 4E10DE851E824A91000C43F9 /* AppDelegate.h */, 70 | 4E10DE861E824A91000C43F9 /* AppDelegate.m */, 71 | 4E10DE881E824A91000C43F9 /* ViewController.h */, 72 | 4E10DE891E824A91000C43F9 /* ViewController.m */, 73 | 4E10DE8B1E824A91000C43F9 /* Main.storyboard */, 74 | 4E10DE8E1E824A91000C43F9 /* Assets.xcassets */, 75 | 4E10DE901E824A91000C43F9 /* LaunchScreen.storyboard */, 76 | 4E10DE931E824A91000C43F9 /* Info.plist */, 77 | 4E10DE821E824A91000C43F9 /* Supporting Files */, 78 | ); 79 | path = DropDownExample; 80 | sourceTree = ""; 81 | }; 82 | 4E10DE821E824A91000C43F9 /* Supporting Files */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 4E10DE831E824A91000C43F9 /* main.m */, 86 | ); 87 | name = "Supporting Files"; 88 | sourceTree = ""; 89 | }; 90 | 4E10DEA11E82544C000C43F9 /* BSDropDownClass */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 4E10DEA21E82546D000C43F9 /* BSDropDown.h */, 94 | 4E10DEA31E82546E000C43F9 /* BSDropDown.m */, 95 | 4E10DEA41E82546E000C43F9 /* dot-menu@2x.png */, 96 | 4E10DEA51E82546E000C43F9 /* dot-menu@3x.png */, 97 | ); 98 | name = BSDropDownClass; 99 | path = DropDownExample/BSDropDownClass; 100 | sourceTree = ""; 101 | }; 102 | /* End PBXGroup section */ 103 | 104 | /* Begin PBXNativeTarget section */ 105 | 4E10DE7E1E824A91000C43F9 /* DropDownExample */ = { 106 | isa = PBXNativeTarget; 107 | buildConfigurationList = 4E10DE961E824A91000C43F9 /* Build configuration list for PBXNativeTarget "DropDownExample" */; 108 | buildPhases = ( 109 | 4E10DE7B1E824A91000C43F9 /* Sources */, 110 | 4E10DE7C1E824A91000C43F9 /* Frameworks */, 111 | 4E10DE7D1E824A91000C43F9 /* Resources */, 112 | ); 113 | buildRules = ( 114 | ); 115 | dependencies = ( 116 | ); 117 | name = DropDownExample; 118 | productName = DropDownExample; 119 | productReference = 4E10DE7F1E824A91000C43F9 /* DropDownExample.app */; 120 | productType = "com.apple.product-type.application"; 121 | }; 122 | /* End PBXNativeTarget section */ 123 | 124 | /* Begin PBXProject section */ 125 | 4E10DE771E824A91000C43F9 /* Project object */ = { 126 | isa = PBXProject; 127 | attributes = { 128 | LastUpgradeCheck = 0820; 129 | ORGANIZATIONNAME = Bisma; 130 | TargetAttributes = { 131 | 4E10DE7E1E824A91000C43F9 = { 132 | CreatedOnToolsVersion = 8.2.1; 133 | ProvisioningStyle = Automatic; 134 | }; 135 | }; 136 | }; 137 | buildConfigurationList = 4E10DE7A1E824A91000C43F9 /* Build configuration list for PBXProject "DropDownExample" */; 138 | compatibilityVersion = "Xcode 3.2"; 139 | developmentRegion = English; 140 | hasScannedForEncodings = 0; 141 | knownRegions = ( 142 | en, 143 | Base, 144 | ); 145 | mainGroup = 4E10DE761E824A91000C43F9; 146 | productRefGroup = 4E10DE801E824A91000C43F9 /* Products */; 147 | projectDirPath = ""; 148 | projectRoot = ""; 149 | targets = ( 150 | 4E10DE7E1E824A91000C43F9 /* DropDownExample */, 151 | ); 152 | }; 153 | /* End PBXProject section */ 154 | 155 | /* Begin PBXResourcesBuildPhase section */ 156 | 4E10DE7D1E824A91000C43F9 /* Resources */ = { 157 | isa = PBXResourcesBuildPhase; 158 | buildActionMask = 2147483647; 159 | files = ( 160 | 4E10DE921E824A91000C43F9 /* LaunchScreen.storyboard in Resources */, 161 | 4E10DEA71E82546E000C43F9 /* dot-menu@2x.png in Resources */, 162 | 4E10DE8F1E824A91000C43F9 /* Assets.xcassets in Resources */, 163 | 4E10DEA81E82546E000C43F9 /* dot-menu@3x.png in Resources */, 164 | 4E10DE8D1E824A91000C43F9 /* Main.storyboard in Resources */, 165 | ); 166 | runOnlyForDeploymentPostprocessing = 0; 167 | }; 168 | /* End PBXResourcesBuildPhase section */ 169 | 170 | /* Begin PBXSourcesBuildPhase section */ 171 | 4E10DE7B1E824A91000C43F9 /* Sources */ = { 172 | isa = PBXSourcesBuildPhase; 173 | buildActionMask = 2147483647; 174 | files = ( 175 | 4E10DE8A1E824A91000C43F9 /* ViewController.m in Sources */, 176 | 4E10DEA61E82546E000C43F9 /* BSDropDown.m in Sources */, 177 | 4E10DE871E824A91000C43F9 /* AppDelegate.m in Sources */, 178 | 4E10DE841E824A91000C43F9 /* main.m in Sources */, 179 | ); 180 | runOnlyForDeploymentPostprocessing = 0; 181 | }; 182 | /* End PBXSourcesBuildPhase section */ 183 | 184 | /* Begin PBXVariantGroup section */ 185 | 4E10DE8B1E824A91000C43F9 /* Main.storyboard */ = { 186 | isa = PBXVariantGroup; 187 | children = ( 188 | 4E10DE8C1E824A91000C43F9 /* Base */, 189 | ); 190 | name = Main.storyboard; 191 | sourceTree = ""; 192 | }; 193 | 4E10DE901E824A91000C43F9 /* LaunchScreen.storyboard */ = { 194 | isa = PBXVariantGroup; 195 | children = ( 196 | 4E10DE911E824A91000C43F9 /* Base */, 197 | ); 198 | name = LaunchScreen.storyboard; 199 | sourceTree = ""; 200 | }; 201 | /* End PBXVariantGroup section */ 202 | 203 | /* Begin XCBuildConfiguration section */ 204 | 4E10DE941E824A91000C43F9 /* Debug */ = { 205 | isa = XCBuildConfiguration; 206 | buildSettings = { 207 | ALWAYS_SEARCH_USER_PATHS = NO; 208 | CLANG_ANALYZER_NONNULL = YES; 209 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 210 | CLANG_CXX_LIBRARY = "libc++"; 211 | CLANG_ENABLE_MODULES = YES; 212 | CLANG_ENABLE_OBJC_ARC = YES; 213 | CLANG_WARN_BOOL_CONVERSION = YES; 214 | CLANG_WARN_CONSTANT_CONVERSION = YES; 215 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 216 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 217 | CLANG_WARN_EMPTY_BODY = YES; 218 | CLANG_WARN_ENUM_CONVERSION = YES; 219 | CLANG_WARN_INFINITE_RECURSION = YES; 220 | CLANG_WARN_INT_CONVERSION = YES; 221 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 222 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 223 | CLANG_WARN_UNREACHABLE_CODE = YES; 224 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 225 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 226 | COPY_PHASE_STRIP = NO; 227 | DEBUG_INFORMATION_FORMAT = dwarf; 228 | ENABLE_STRICT_OBJC_MSGSEND = YES; 229 | ENABLE_TESTABILITY = YES; 230 | GCC_C_LANGUAGE_STANDARD = gnu99; 231 | GCC_DYNAMIC_NO_PIC = NO; 232 | GCC_NO_COMMON_BLOCKS = YES; 233 | GCC_OPTIMIZATION_LEVEL = 0; 234 | GCC_PREPROCESSOR_DEFINITIONS = ( 235 | "DEBUG=1", 236 | "$(inherited)", 237 | ); 238 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 239 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 240 | GCC_WARN_UNDECLARED_SELECTOR = YES; 241 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 242 | GCC_WARN_UNUSED_FUNCTION = YES; 243 | GCC_WARN_UNUSED_VARIABLE = YES; 244 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 245 | MTL_ENABLE_DEBUG_INFO = YES; 246 | ONLY_ACTIVE_ARCH = YES; 247 | SDKROOT = iphoneos; 248 | TARGETED_DEVICE_FAMILY = "1,2"; 249 | }; 250 | name = Debug; 251 | }; 252 | 4E10DE951E824A91000C43F9 /* Release */ = { 253 | isa = XCBuildConfiguration; 254 | buildSettings = { 255 | ALWAYS_SEARCH_USER_PATHS = NO; 256 | CLANG_ANALYZER_NONNULL = YES; 257 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 258 | CLANG_CXX_LIBRARY = "libc++"; 259 | CLANG_ENABLE_MODULES = YES; 260 | CLANG_ENABLE_OBJC_ARC = YES; 261 | CLANG_WARN_BOOL_CONVERSION = YES; 262 | CLANG_WARN_CONSTANT_CONVERSION = YES; 263 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 264 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 265 | CLANG_WARN_EMPTY_BODY = YES; 266 | CLANG_WARN_ENUM_CONVERSION = YES; 267 | CLANG_WARN_INFINITE_RECURSION = YES; 268 | CLANG_WARN_INT_CONVERSION = YES; 269 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 270 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 271 | CLANG_WARN_UNREACHABLE_CODE = YES; 272 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 273 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 274 | COPY_PHASE_STRIP = NO; 275 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 276 | ENABLE_NS_ASSERTIONS = NO; 277 | ENABLE_STRICT_OBJC_MSGSEND = YES; 278 | GCC_C_LANGUAGE_STANDARD = gnu99; 279 | GCC_NO_COMMON_BLOCKS = YES; 280 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 281 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 282 | GCC_WARN_UNDECLARED_SELECTOR = YES; 283 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 284 | GCC_WARN_UNUSED_FUNCTION = YES; 285 | GCC_WARN_UNUSED_VARIABLE = YES; 286 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 287 | MTL_ENABLE_DEBUG_INFO = NO; 288 | SDKROOT = iphoneos; 289 | TARGETED_DEVICE_FAMILY = "1,2"; 290 | VALIDATE_PRODUCT = YES; 291 | }; 292 | name = Release; 293 | }; 294 | 4E10DE971E824A91000C43F9 /* Debug */ = { 295 | isa = XCBuildConfiguration; 296 | buildSettings = { 297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 298 | INFOPLIST_FILE = DropDownExample/Info.plist; 299 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 300 | PRODUCT_BUNDLE_IDENTIFIER = com.bismasaeed.DropDownExample; 301 | PRODUCT_NAME = "$(TARGET_NAME)"; 302 | }; 303 | name = Debug; 304 | }; 305 | 4E10DE981E824A91000C43F9 /* Release */ = { 306 | isa = XCBuildConfiguration; 307 | buildSettings = { 308 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 309 | INFOPLIST_FILE = DropDownExample/Info.plist; 310 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 311 | PRODUCT_BUNDLE_IDENTIFIER = com.bismasaeed.DropDownExample; 312 | PRODUCT_NAME = "$(TARGET_NAME)"; 313 | }; 314 | name = Release; 315 | }; 316 | /* End XCBuildConfiguration section */ 317 | 318 | /* Begin XCConfigurationList section */ 319 | 4E10DE7A1E824A91000C43F9 /* Build configuration list for PBXProject "DropDownExample" */ = { 320 | isa = XCConfigurationList; 321 | buildConfigurations = ( 322 | 4E10DE941E824A91000C43F9 /* Debug */, 323 | 4E10DE951E824A91000C43F9 /* Release */, 324 | ); 325 | defaultConfigurationIsVisible = 0; 326 | defaultConfigurationName = Release; 327 | }; 328 | 4E10DE961E824A91000C43F9 /* Build configuration list for PBXNativeTarget "DropDownExample" */ = { 329 | isa = XCConfigurationList; 330 | buildConfigurations = ( 331 | 4E10DE971E824A91000C43F9 /* Debug */, 332 | 4E10DE981E824A91000C43F9 /* Release */, 333 | ); 334 | defaultConfigurationIsVisible = 0; 335 | }; 336 | /* End XCConfigurationList section */ 337 | }; 338 | rootObject = 4E10DE771E824A91000C43F9 /* Project object */; 339 | } 340 | -------------------------------------------------------------------------------- /DropDownExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DropDownExample.xcodeproj/project.xcworkspace/xcuserdata/bisma.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bismasaeed00/BSDropDown/efa7f62225d6e5e8cc53c52b544452fb63ec400c/DropDownExample.xcodeproj/project.xcworkspace/xcuserdata/bisma.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DropDownExample.xcodeproj/xcuserdata/bisma.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /DropDownExample.xcodeproj/xcuserdata/bisma.xcuserdatad/xcschemes/DropDownExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /DropDownExample.xcodeproj/xcuserdata/bisma.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DropDownExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 4E10DE7E1E824A91000C43F9 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /DropDownExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DropDownExample 4 | // 5 | // Created by Bisma on 22/03/2017. 6 | // Copyright © 2017 Bisma. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DropDownExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DropDownExample 4 | // 5 | // Created by Bisma on 22/03/2017. 6 | // Copyright © 2017 Bisma. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /DropDownExample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /DropDownExample/BSDropDownClass/BSDropDown.h: -------------------------------------------------------------------------------- 1 | // 2 | // BSDropDown.h 3 | // DropDownExample 4 | // 5 | // Created by Bisma on 22/03/2017. 6 | // Copyright © 2017 Bisma. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol BSDropDownDelegate 12 | @required 13 | -(void)dropDownView:(UIView*)ddView AtIndex:(NSInteger)selectedIndex ; 14 | @end 15 | 16 | @interface BSDropDown : UIView 17 | 18 | - (id) initWithWidth:(float)width withHeightForEachRow:(float)height originPoint:(CGPoint)originPoint withOptions:(NSArray*)options; 19 | 20 | @property (nonatomic) NSInteger selectedIndex; 21 | @property (weak,nonatomic) id delegate; 22 | 23 | -(void)addAsSubviewTo:(UIView*)parentView; 24 | 25 | -(void)setDropDownFont:(UIFont*)font; 26 | -(void)setDropDownBGColor:(UIColor*)color; 27 | -(void)setDropDownTextColor:(UIColor*)color; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /DropDownExample/BSDropDownClass/BSDropDown.m: -------------------------------------------------------------------------------- 1 | // 2 | // BSDropDown.m 3 | // DropDownExample 4 | // 5 | // Created by Bisma on 22/03/2017. 6 | // Copyright © 2017 Bisma. All rights reserved. 7 | // 8 | 9 | #import "BSDropDown.h" 10 | 11 | @interface BSDropDown() 12 | 13 | @property (nonatomic,strong) UIFont *dropDownFont; 14 | @property (nonatomic,strong) UIColor *dropDownBGColor; 15 | @property (nonatomic,strong) UIColor *dropDownTextColor; 16 | 17 | @property (nonatomic,strong) UITableView *tblView; 18 | 19 | @end 20 | 21 | @implementation BSDropDown{ 22 | NSArray *optionsArry; 23 | NSString *imgName; 24 | float rowHeight; 25 | UIButton *menuBtn; 26 | } 27 | - (id) initWithWidth:(float)width withHeightForEachRow:(float)height originPoint:(CGPoint)originPoint withOptions:(NSArray*)options{ 28 | 29 | 30 | CGRect frame=CGRectMake(originPoint.x, originPoint.y, width, (height*options.count)+12); 31 | 32 | if (frame.origin.y+frame.size.height>[UIScreen mainScreen].bounds.size.height) { 33 | 34 | frame.size.height=[UIScreen mainScreen].bounds.size.height-frame.origin.y-12; 35 | 36 | } 37 | 38 | if (frame.origin.x+frame.size.width>[UIScreen mainScreen].bounds.size.width){ 39 | 40 | frame.size.width=[UIScreen mainScreen].bounds.size.width-frame.origin.x-12; 41 | } 42 | 43 | if ((self = [super initWithFrame:frame])) { 44 | 45 | rowHeight=height; 46 | imgName=@"dot-menu.png"; 47 | optionsArry=options; 48 | _dropDownFont=[UIFont fontWithName:@"MyriadPro-Regular" size:14]; 49 | _dropDownBGColor=[UIColor blackColor]; 50 | _dropDownTextColor=[UIColor whiteColor]; 51 | 52 | [self initialzeViewsForFrame:frame]; 53 | } 54 | return self; 55 | } 56 | 57 | -(void)initialzeViewsForFrame:(CGRect)frame{ 58 | 59 | self.clipsToBounds=YES; 60 | self.layer.cornerRadius=5.0; 61 | 62 | menuBtn=[[UIButton alloc] initWithFrame:CGRectMake(frame.size.width-30,4,30,30)]; 63 | 64 | 65 | 66 | [menuBtn setImage:[UIImage imageNamed:imgName] forState:UIControlStateNormal]; 67 | 68 | [menuBtn addTarget:self action:@selector(manuPressed) forControlEvents:UIControlEventTouchUpInside]; 69 | 70 | _tblView=[[UITableView alloc] initWithFrame:CGRectMake(0, 12, frame.size.width, frame.size.height-8) style:UITableViewStylePlain]; 71 | _tblView.separatorStyle=UITableViewCellSeparatorStyleNone; 72 | _tblView.backgroundColor=[UIColor clearColor]; 73 | _tblView.bounces=NO; 74 | _tblView.showsHorizontalScrollIndicator=NO; 75 | _tblView.delegate=self; 76 | _tblView.dataSource=self; 77 | 78 | [self addSubview:_tblView]; 79 | [self addSubview:menuBtn]; 80 | } 81 | 82 | -(void)manuPressed{ 83 | 84 | [UIView transitionWithView:self.superview duration:0.5 85 | options:UIViewAnimationOptionTransitionCrossDissolve //change to whatever animation you like 86 | animations:^ { [self removeFromSuperview]; } 87 | completion:nil]; 88 | } 89 | 90 | #pragma mark - TableView 91 | -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 92 | 93 | return optionsArry.count; 94 | } 95 | -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 96 | 97 | self.backgroundColor=_dropDownBGColor; 98 | NSString *cellIdentifier = @"CustomCell"; 99 | UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 100 | 101 | if (cell == nil) 102 | { 103 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; 104 | 105 | cell.textLabel.textColor=_dropDownTextColor; 106 | 107 | cell.textLabel.numberOfLines=2; 108 | cell.backgroundColor=[UIColor clearColor]; 109 | cell.textLabel.font=_dropDownFont; 110 | cell.selectionStyle=UITableViewCellSelectionStyleNone; 111 | } 112 | 113 | cell.textLabel.text=[optionsArry objectAtIndex:indexPath.row]; 114 | 115 | return cell; 116 | } 117 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 118 | 119 | [_tblView deselectRowAtIndexPath:indexPath animated:YES]; 120 | [self.delegate dropDownView:self AtIndex:indexPath.row]; 121 | [self manuPressed]; 122 | } 123 | -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ 124 | 125 | return rowHeight; 126 | } 127 | -(void)addAsSubviewTo:(UIView*)parentView{ 128 | 129 | NSArray *subviews=[parentView subviews]; 130 | BOOL ddAlreadyExisted=NO; 131 | for (UIView *sbvew in subviews) { 132 | 133 | if ([sbvew isKindOfClass:[BSDropDown class]]) { 134 | 135 | ddAlreadyExisted=YES; 136 | break; 137 | } 138 | } 139 | 140 | if (!ddAlreadyExisted) { 141 | 142 | [UIView transitionWithView:parentView duration:0.5 143 | options:UIViewAnimationOptionTransitionCrossDissolve 144 | 145 | animations:^ { [parentView addSubview:self]; } 146 | completion:nil]; 147 | } 148 | } 149 | 150 | -(void)setDropDownTextColor:(UIColor *)textColor{ 151 | 152 | _dropDownTextColor=textColor; 153 | 154 | [menuBtn setImage:[[menuBtn imageForState:UIControlStateNormal] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateNormal]; 155 | [menuBtn setTintColor:_dropDownTextColor]; 156 | 157 | } 158 | -(void)setDropDownFont:(UIFont *)font{ 159 | 160 | _dropDownFont=font; 161 | } 162 | -(void)setDropDownBGColor:(UIColor *)color{ 163 | 164 | _dropDownBGColor=color; 165 | } 166 | 167 | @end 168 | -------------------------------------------------------------------------------- /DropDownExample/BSDropDownClass/dot-menu@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bismasaeed00/BSDropDown/efa7f62225d6e5e8cc53c52b544452fb63ec400c/DropDownExample/BSDropDownClass/dot-menu@2x.png -------------------------------------------------------------------------------- /DropDownExample/BSDropDownClass/dot-menu@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bismasaeed00/BSDropDown/efa7f62225d6e5e8cc53c52b544452fb63ec400c/DropDownExample/BSDropDownClass/dot-menu@3x.png -------------------------------------------------------------------------------- /DropDownExample/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /DropDownExample/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 | 32 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /DropDownExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /DropDownExample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DropDownExample 4 | // 5 | // Created by Bisma on 22/03/2017. 6 | // Copyright © 2017 Bisma. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DropDownExample/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DropDownExample 4 | // 5 | // Created by Bisma on 22/03/2017. 6 | // Copyright © 2017 Bisma. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "BSDropDown.h" 11 | 12 | @interface ViewController () 13 | - (IBAction)showDropDown:(id)sender; 14 | @property (weak, nonatomic) IBOutlet UILabel *displayLabel; 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | 23 | } 24 | 25 | 26 | - (IBAction)showDropDown:(id)sender { 27 | 28 | UIButton *btn=(UIButton*)sender; 29 | 30 | BSDropDown *ddView=[[BSDropDown alloc] initWithWidth:120 withHeightForEachRow:50 originPoint:btn.center withOptions:@[@"option 1",@"option 2",@"option 3",@"option 4",@"option 5"]]; 31 | ddView.delegate=self; 32 | ddView.dropDownBGColor=[UIColor blueColor]; 33 | ddView.dropDownTextColor=[UIColor yellowColor]; 34 | ddView.dropDownFont=[UIFont systemFontOfSize:13]; 35 | [ddView addAsSubviewTo:self.view]; 36 | 37 | } 38 | 39 | #pragma mark - DropDown Delegate 40 | -(void)dropDownView:(UIView *)ddView AtIndex:(NSInteger)selectedIndex{ 41 | 42 | NSLog(@"selectedIndex: %li",(long)selectedIndex); 43 | _displayLabel.text=[NSString stringWithFormat:@"options %li",(long)selectedIndex+1]; 44 | 45 | } 46 | @end 47 | -------------------------------------------------------------------------------- /DropDownExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DropDownExample 4 | // 5 | // Created by Bisma on 22/03/2017. 6 | // Copyright © 2017 Bisma. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BSDropDown 2 | It's show dropdown menu list. 3 | 4 | ![alt tag](https://cloud.githubusercontent.com/assets/16186934/24190122/6cd1c28a-0f09-11e7-869b-9626182ea172.png) 5 | ## How To Get Started 6 | Download the project and drop BSDropDownClass into your project. 7 | Don't forget to import the header file. 8 | 9 | ``` 10 | #import "BSDropDown.h" 11 | ``` 12 | You can create a dropdown with options to show ans add in your view. Here is the example 13 | ``` 14 | BSDropDown *ddView=[[BSDropDown alloc] initWithWidth:120 withHeightForEachRow:50 originPoint:btn.center withOptions:@[@"option 1",@"option 2",@"option 3",@"option 4",@"option 5"]]; 15 | ddView.delegate=self; 16 | // ddView.dropDownBGColor=[UIColor yellowColor]; 17 | // ddView.dropDownTextColor=[UIColor greenColor]; 18 | // ddView.dropDownFont=[UIFont systemFontOfSize:13]; 19 | [self.view addSubview:ddView]; 20 | 21 | ``` 22 | You can customize it's backgroud color, font and text color using the commented code above. 23 | The colour of menu button will be the same as defined for the text colour of options in dropdown. 24 | 25 | ### Delegate 26 | Implement the delegate method to know when user cliceked an option 27 | 28 | ``` 29 | #pragma mark - DropDown Delegate 30 | -(void)dropDownView:(UIView *)ddView AtIndex:(NSInteger)selectedIndex{ 31 | 32 | NSLog(@"selectedIndex: %li",(long)selectedIndex); 33 | _displayLabel.text=[NSString stringWithFormat:@"options %li",(long)selectedIndex+1]; 34 | 35 | } 36 | ``` 37 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman --------------------------------------------------------------------------------