└── MSDynamicMenu ├── MSDynamicMenu.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── Midhun.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Midhun.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── MSDynamicMenu.xcscheme │ └── xcschememanagement.plist └── MSDynamicMenu ├── AppDelegate.swift ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json ├── Contents.json ├── close.imageset │ ├── Contents.json │ ├── close_red-1.png │ ├── close_red-2.png │ └── close_red.png ├── fb.imageset │ ├── Contents.json │ ├── facebook-icon-1.png │ ├── facebook-icon-2.png │ └── facebook-icon.png ├── google+.imageset │ ├── Contents.json │ ├── RebellionRider-googleplus-1.png │ ├── RebellionRider-googleplus-2.png │ └── RebellionRider-googleplus.png ├── linkdin.imageset │ ├── Contents.json │ ├── linkedin-icon-1.png │ ├── linkedin-icon-2.png │ └── linkedin-icon.png ├── messenger.imageset │ ├── Contents.json │ ├── facebook-messenger-icon-1.png │ ├── facebook-messenger-icon-2.png │ └── facebook-messenger-icon.png ├── penguins.imageset │ ├── Contents.json │ ├── penguin-1.jpg │ ├── penguin-2.jpg │ └── penguin.jpg ├── share.imageset │ ├── Contents.json │ ├── share-icon-1.png │ ├── share-icon-2.png │ └── share-icon.png └── twitter.imageset │ ├── Contents.json │ ├── twitter-icon-1.png │ ├── twitter-icon-2.png │ └── twitter-icon.png ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist ├── MSDynamicMenu.swift ├── ViewController.swift └── images ├── Dandelions.jpg ├── RebellionRider-googleplus.png ├── apple.jpg ├── close_red.png ├── facebook-icon.png ├── facebook-messenger-icon.png ├── landscape.png ├── linkedin-icon.png ├── penguin.jpg ├── share-icon.png ├── twitter-icon.png └── whatsapp-icon.png /MSDynamicMenu/MSDynamicMenu.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D9AA70EB1C9031E100DF9BAE /* penguin.jpg in Resources */ = {isa = PBXBuildFile; fileRef = D9AA70EA1C9031E100DF9BAE /* penguin.jpg */; settings = {ASSET_TAGS = (); }; }; 11 | D9AA70ED1C9036BB00DF9BAE /* apple.jpg in Resources */ = {isa = PBXBuildFile; fileRef = D9AA70EC1C9036BB00DF9BAE /* apple.jpg */; settings = {ASSET_TAGS = (); }; }; 12 | D9AA70EF1C903A0C00DF9BAE /* landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = D9AA70EE1C903A0C00DF9BAE /* landscape.png */; settings = {ASSET_TAGS = (); }; }; 13 | D9ED53B21C898F6C00029D42 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9ED53B11C898F6C00029D42 /* AppDelegate.swift */; }; 14 | D9ED53B41C898F6C00029D42 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9ED53B31C898F6C00029D42 /* ViewController.swift */; }; 15 | D9ED53B71C898F6C00029D42 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D9ED53B51C898F6C00029D42 /* Main.storyboard */; }; 16 | D9ED53B91C898F6C00029D42 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D9ED53B81C898F6C00029D42 /* Assets.xcassets */; }; 17 | D9ED53BC1C898F6C00029D42 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D9ED53BA1C898F6C00029D42 /* LaunchScreen.storyboard */; }; 18 | D9ED53C41C89910700029D42 /* MSDynamicMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9ED53C31C89910700029D42 /* MSDynamicMenu.swift */; settings = {ASSET_TAGS = (); }; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | D9AA70EA1C9031E100DF9BAE /* penguin.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = penguin.jpg; path = images/penguin.jpg; sourceTree = ""; }; 23 | D9AA70EC1C9036BB00DF9BAE /* apple.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = apple.jpg; path = images/apple.jpg; sourceTree = ""; }; 24 | D9AA70EE1C903A0C00DF9BAE /* landscape.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = landscape.png; path = images/landscape.png; sourceTree = ""; }; 25 | D9ED53AE1C898F6C00029D42 /* MSDynamicMenu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MSDynamicMenu.app; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | D9ED53B11C898F6C00029D42 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 27 | D9ED53B31C898F6C00029D42 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 28 | D9ED53B61C898F6C00029D42 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 29 | D9ED53B81C898F6C00029D42 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 30 | D9ED53BB1C898F6C00029D42 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 31 | D9ED53BD1C898F6C00029D42 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | D9ED53C31C89910700029D42 /* MSDynamicMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MSDynamicMenu.swift; sourceTree = ""; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | D9ED53AB1C898F6B00029D42 /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | ); 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXFrameworksBuildPhase section */ 44 | 45 | /* Begin PBXGroup section */ 46 | D9ED53A51C898F6B00029D42 = { 47 | isa = PBXGroup; 48 | children = ( 49 | D9ED53B01C898F6C00029D42 /* MSDynamicMenu */, 50 | D9ED53AF1C898F6C00029D42 /* Products */, 51 | ); 52 | sourceTree = ""; 53 | }; 54 | D9ED53AF1C898F6C00029D42 /* Products */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | D9ED53AE1C898F6C00029D42 /* MSDynamicMenu.app */, 58 | ); 59 | name = Products; 60 | sourceTree = ""; 61 | }; 62 | D9ED53B01C898F6C00029D42 /* MSDynamicMenu */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | D9AA70EE1C903A0C00DF9BAE /* landscape.png */, 66 | D9AA70EC1C9036BB00DF9BAE /* apple.jpg */, 67 | D9AA70EA1C9031E100DF9BAE /* penguin.jpg */, 68 | D9ED53B11C898F6C00029D42 /* AppDelegate.swift */, 69 | D9ED53B31C898F6C00029D42 /* ViewController.swift */, 70 | D9ED53C31C89910700029D42 /* MSDynamicMenu.swift */, 71 | D9ED53B51C898F6C00029D42 /* Main.storyboard */, 72 | D9ED53B81C898F6C00029D42 /* Assets.xcassets */, 73 | D9ED53BA1C898F6C00029D42 /* LaunchScreen.storyboard */, 74 | D9ED53BD1C898F6C00029D42 /* Info.plist */, 75 | ); 76 | path = MSDynamicMenu; 77 | sourceTree = ""; 78 | }; 79 | /* End PBXGroup section */ 80 | 81 | /* Begin PBXNativeTarget section */ 82 | D9ED53AD1C898F6B00029D42 /* MSDynamicMenu */ = { 83 | isa = PBXNativeTarget; 84 | buildConfigurationList = D9ED53C01C898F6C00029D42 /* Build configuration list for PBXNativeTarget "MSDynamicMenu" */; 85 | buildPhases = ( 86 | D9ED53AA1C898F6B00029D42 /* Sources */, 87 | D9ED53AB1C898F6B00029D42 /* Frameworks */, 88 | D9ED53AC1C898F6B00029D42 /* Resources */, 89 | ); 90 | buildRules = ( 91 | ); 92 | dependencies = ( 93 | ); 94 | name = MSDynamicMenu; 95 | productName = MSDynamicMenu; 96 | productReference = D9ED53AE1C898F6C00029D42 /* MSDynamicMenu.app */; 97 | productType = "com.apple.product-type.application"; 98 | }; 99 | /* End PBXNativeTarget section */ 100 | 101 | /* Begin PBXProject section */ 102 | D9ED53A61C898F6B00029D42 /* Project object */ = { 103 | isa = PBXProject; 104 | attributes = { 105 | LastUpgradeCheck = 0700; 106 | ORGANIZATIONNAME = InApp; 107 | TargetAttributes = { 108 | D9ED53AD1C898F6B00029D42 = { 109 | CreatedOnToolsVersion = 7.0.1; 110 | }; 111 | }; 112 | }; 113 | buildConfigurationList = D9ED53A91C898F6B00029D42 /* Build configuration list for PBXProject "MSDynamicMenu" */; 114 | compatibilityVersion = "Xcode 3.2"; 115 | developmentRegion = English; 116 | hasScannedForEncodings = 0; 117 | knownRegions = ( 118 | en, 119 | Base, 120 | ); 121 | mainGroup = D9ED53A51C898F6B00029D42; 122 | productRefGroup = D9ED53AF1C898F6C00029D42 /* Products */; 123 | projectDirPath = ""; 124 | projectRoot = ""; 125 | targets = ( 126 | D9ED53AD1C898F6B00029D42 /* MSDynamicMenu */, 127 | ); 128 | }; 129 | /* End PBXProject section */ 130 | 131 | /* Begin PBXResourcesBuildPhase section */ 132 | D9ED53AC1C898F6B00029D42 /* Resources */ = { 133 | isa = PBXResourcesBuildPhase; 134 | buildActionMask = 2147483647; 135 | files = ( 136 | D9AA70EB1C9031E100DF9BAE /* penguin.jpg in Resources */, 137 | D9AA70EF1C903A0C00DF9BAE /* landscape.png in Resources */, 138 | D9ED53BC1C898F6C00029D42 /* LaunchScreen.storyboard in Resources */, 139 | D9ED53B91C898F6C00029D42 /* Assets.xcassets in Resources */, 140 | D9ED53B71C898F6C00029D42 /* Main.storyboard in Resources */, 141 | D9AA70ED1C9036BB00DF9BAE /* apple.jpg in Resources */, 142 | ); 143 | runOnlyForDeploymentPostprocessing = 0; 144 | }; 145 | /* End PBXResourcesBuildPhase section */ 146 | 147 | /* Begin PBXSourcesBuildPhase section */ 148 | D9ED53AA1C898F6B00029D42 /* Sources */ = { 149 | isa = PBXSourcesBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | D9ED53B41C898F6C00029D42 /* ViewController.swift in Sources */, 153 | D9ED53C41C89910700029D42 /* MSDynamicMenu.swift in Sources */, 154 | D9ED53B21C898F6C00029D42 /* AppDelegate.swift in Sources */, 155 | ); 156 | runOnlyForDeploymentPostprocessing = 0; 157 | }; 158 | /* End PBXSourcesBuildPhase section */ 159 | 160 | /* Begin PBXVariantGroup section */ 161 | D9ED53B51C898F6C00029D42 /* Main.storyboard */ = { 162 | isa = PBXVariantGroup; 163 | children = ( 164 | D9ED53B61C898F6C00029D42 /* Base */, 165 | ); 166 | name = Main.storyboard; 167 | sourceTree = ""; 168 | }; 169 | D9ED53BA1C898F6C00029D42 /* LaunchScreen.storyboard */ = { 170 | isa = PBXVariantGroup; 171 | children = ( 172 | D9ED53BB1C898F6C00029D42 /* Base */, 173 | ); 174 | name = LaunchScreen.storyboard; 175 | sourceTree = ""; 176 | }; 177 | /* End PBXVariantGroup section */ 178 | 179 | /* Begin XCBuildConfiguration section */ 180 | D9ED53BE1C898F6C00029D42 /* Debug */ = { 181 | isa = XCBuildConfiguration; 182 | buildSettings = { 183 | ALWAYS_SEARCH_USER_PATHS = NO; 184 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 185 | CLANG_CXX_LIBRARY = "libc++"; 186 | CLANG_ENABLE_MODULES = YES; 187 | CLANG_ENABLE_OBJC_ARC = YES; 188 | CLANG_WARN_BOOL_CONVERSION = YES; 189 | CLANG_WARN_CONSTANT_CONVERSION = YES; 190 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 191 | CLANG_WARN_EMPTY_BODY = YES; 192 | CLANG_WARN_ENUM_CONVERSION = YES; 193 | CLANG_WARN_INT_CONVERSION = YES; 194 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 195 | CLANG_WARN_UNREACHABLE_CODE = YES; 196 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 197 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 198 | COPY_PHASE_STRIP = NO; 199 | DEBUG_INFORMATION_FORMAT = dwarf; 200 | ENABLE_STRICT_OBJC_MSGSEND = YES; 201 | ENABLE_TESTABILITY = YES; 202 | GCC_C_LANGUAGE_STANDARD = gnu99; 203 | GCC_DYNAMIC_NO_PIC = NO; 204 | GCC_NO_COMMON_BLOCKS = YES; 205 | GCC_OPTIMIZATION_LEVEL = 0; 206 | GCC_PREPROCESSOR_DEFINITIONS = ( 207 | "DEBUG=1", 208 | "$(inherited)", 209 | ); 210 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 211 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 212 | GCC_WARN_UNDECLARED_SELECTOR = YES; 213 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 214 | GCC_WARN_UNUSED_FUNCTION = YES; 215 | GCC_WARN_UNUSED_VARIABLE = YES; 216 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 217 | MTL_ENABLE_DEBUG_INFO = YES; 218 | ONLY_ACTIVE_ARCH = YES; 219 | SDKROOT = iphoneos; 220 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 221 | TARGETED_DEVICE_FAMILY = "1,2"; 222 | }; 223 | name = Debug; 224 | }; 225 | D9ED53BF1C898F6C00029D42 /* Release */ = { 226 | isa = XCBuildConfiguration; 227 | buildSettings = { 228 | ALWAYS_SEARCH_USER_PATHS = NO; 229 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 230 | CLANG_CXX_LIBRARY = "libc++"; 231 | CLANG_ENABLE_MODULES = YES; 232 | CLANG_ENABLE_OBJC_ARC = YES; 233 | CLANG_WARN_BOOL_CONVERSION = YES; 234 | CLANG_WARN_CONSTANT_CONVERSION = YES; 235 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 236 | CLANG_WARN_EMPTY_BODY = YES; 237 | CLANG_WARN_ENUM_CONVERSION = YES; 238 | CLANG_WARN_INT_CONVERSION = YES; 239 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 240 | CLANG_WARN_UNREACHABLE_CODE = YES; 241 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 242 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 243 | COPY_PHASE_STRIP = NO; 244 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 245 | ENABLE_NS_ASSERTIONS = NO; 246 | ENABLE_STRICT_OBJC_MSGSEND = YES; 247 | GCC_C_LANGUAGE_STANDARD = gnu99; 248 | GCC_NO_COMMON_BLOCKS = YES; 249 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 250 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 251 | GCC_WARN_UNDECLARED_SELECTOR = YES; 252 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 253 | GCC_WARN_UNUSED_FUNCTION = YES; 254 | GCC_WARN_UNUSED_VARIABLE = YES; 255 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 256 | MTL_ENABLE_DEBUG_INFO = NO; 257 | SDKROOT = iphoneos; 258 | TARGETED_DEVICE_FAMILY = "1,2"; 259 | VALIDATE_PRODUCT = YES; 260 | }; 261 | name = Release; 262 | }; 263 | D9ED53C11C898F6C00029D42 /* Debug */ = { 264 | isa = XCBuildConfiguration; 265 | buildSettings = { 266 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 267 | INFOPLIST_FILE = MSDynamicMenu/Info.plist; 268 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 269 | PRODUCT_BUNDLE_IDENTIFIER = com.inapp.MSDynamicMenu; 270 | PRODUCT_NAME = "$(TARGET_NAME)"; 271 | }; 272 | name = Debug; 273 | }; 274 | D9ED53C21C898F6C00029D42 /* Release */ = { 275 | isa = XCBuildConfiguration; 276 | buildSettings = { 277 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 278 | INFOPLIST_FILE = MSDynamicMenu/Info.plist; 279 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 280 | PRODUCT_BUNDLE_IDENTIFIER = com.inapp.MSDynamicMenu; 281 | PRODUCT_NAME = "$(TARGET_NAME)"; 282 | }; 283 | name = Release; 284 | }; 285 | /* End XCBuildConfiguration section */ 286 | 287 | /* Begin XCConfigurationList section */ 288 | D9ED53A91C898F6B00029D42 /* Build configuration list for PBXProject "MSDynamicMenu" */ = { 289 | isa = XCConfigurationList; 290 | buildConfigurations = ( 291 | D9ED53BE1C898F6C00029D42 /* Debug */, 292 | D9ED53BF1C898F6C00029D42 /* Release */, 293 | ); 294 | defaultConfigurationIsVisible = 0; 295 | defaultConfigurationName = Release; 296 | }; 297 | D9ED53C01C898F6C00029D42 /* Build configuration list for PBXNativeTarget "MSDynamicMenu" */ = { 298 | isa = XCConfigurationList; 299 | buildConfigurations = ( 300 | D9ED53C11C898F6C00029D42 /* Debug */, 301 | D9ED53C21C898F6C00029D42 /* Release */, 302 | ); 303 | defaultConfigurationIsVisible = 0; 304 | defaultConfigurationName = Release; 305 | }; 306 | /* End XCConfigurationList section */ 307 | }; 308 | rootObject = D9ED53A61C898F6B00029D42 /* Project object */; 309 | } 310 | -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu.xcodeproj/project.xcworkspace/xcuserdata/Midhun.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu.xcodeproj/project.xcworkspace/xcuserdata/Midhun.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu.xcodeproj/xcuserdata/Midhun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu.xcodeproj/xcuserdata/Midhun.xcuserdatad/xcschemes/MSDynamicMenu.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 | -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu.xcodeproj/xcuserdata/Midhun.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MSDynamicMenu.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | D9ED53AD1C898F6B00029D42 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // MSDynamicMenu 4 | // 5 | // Created by Midhun on 3/4/16. 6 | // Copyright © 2016 InApp. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication) { 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 | func applicationDidBecomeActive(application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/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 | } -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/close.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "close_red.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "close_red-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "close_red-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/close.imageset/close_red-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/close.imageset/close_red-1.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/close.imageset/close_red-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/close.imageset/close_red-2.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/close.imageset/close_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/close.imageset/close_red.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/fb.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "facebook-icon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "facebook-icon-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "facebook-icon-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/fb.imageset/facebook-icon-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/fb.imageset/facebook-icon-1.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/fb.imageset/facebook-icon-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/fb.imageset/facebook-icon-2.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/fb.imageset/facebook-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/fb.imageset/facebook-icon.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/google+.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "RebellionRider-googleplus.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "RebellionRider-googleplus-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "RebellionRider-googleplus-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/google+.imageset/RebellionRider-googleplus-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/google+.imageset/RebellionRider-googleplus-1.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/google+.imageset/RebellionRider-googleplus-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/google+.imageset/RebellionRider-googleplus-2.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/google+.imageset/RebellionRider-googleplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/google+.imageset/RebellionRider-googleplus.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/linkdin.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "linkedin-icon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "linkedin-icon-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "linkedin-icon-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/linkdin.imageset/linkedin-icon-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/linkdin.imageset/linkedin-icon-1.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/linkdin.imageset/linkedin-icon-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/linkdin.imageset/linkedin-icon-2.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/linkdin.imageset/linkedin-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/linkdin.imageset/linkedin-icon.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/messenger.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "facebook-messenger-icon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "facebook-messenger-icon-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "facebook-messenger-icon-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/messenger.imageset/facebook-messenger-icon-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/messenger.imageset/facebook-messenger-icon-1.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/messenger.imageset/facebook-messenger-icon-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/messenger.imageset/facebook-messenger-icon-2.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/messenger.imageset/facebook-messenger-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/messenger.imageset/facebook-messenger-icon.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/penguins.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "penguin.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "penguin-1.jpg", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "penguin-2.jpg", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/penguins.imageset/penguin-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/penguins.imageset/penguin-1.jpg -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/penguins.imageset/penguin-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/penguins.imageset/penguin-2.jpg -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/penguins.imageset/penguin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/penguins.imageset/penguin.jpg -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/share.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "share-icon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "share-icon-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "share-icon-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/share.imageset/share-icon-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/share.imageset/share-icon-1.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/share.imageset/share-icon-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/share.imageset/share-icon-2.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/share.imageset/share-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/share.imageset/share-icon.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/twitter.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "twitter-icon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "twitter-icon-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "twitter-icon-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/twitter.imageset/twitter-icon-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/twitter.imageset/twitter-icon-1.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/twitter.imageset/twitter-icon-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/twitter.imageset/twitter-icon-2.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/Assets.xcassets/twitter.imageset/twitter-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/Assets.xcassets/twitter.imageset/twitter-icon.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/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 | -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/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 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/MSDynamicMenu.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MSDynamicMenu.swift 3 | // MSDynamicMenu 4 | // 5 | // Created by Midhun on 3/4/16. 6 | // Copyright © 2016 InApp. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | class MSDynamicMenu: UIView,UIDynamicAnimatorDelegate,UICollisionBehaviorDelegate { 13 | 14 | var animator : UIDynamicAnimator! 15 | var closeButtonAnimator:UIDynamicAnimator! 16 | 17 | var closeButton:UIButton! 18 | 19 | var gravityBehaviour: UIGravityBehavior! 20 | var dynamicItemBehaviour: UIDynamicItemBehavior! 21 | var collisionBehaviour:UICollisionBehavior! 22 | var attachmentBehaviour:UIAttachmentBehavior! 23 | 24 | var selected:Bool = false 25 | 26 | 27 | override init (frame : CGRect) { 28 | 29 | super.init(frame : frame) 30 | 31 | addBlurEffect() 32 | setupAnimators() 33 | addCloseButton() 34 | } 35 | 36 | required init?(coder aDecoder: NSCoder) { 37 | 38 | fatalError("init(coder:) has not been implemented") 39 | 40 | } 41 | 42 | var items:[UIButton]?{ 43 | 44 | didSet{ 45 | 46 | updateInitialValues() 47 | } 48 | 49 | } 50 | 51 | 52 | func show(){ 53 | 54 | let win:UIWindow = UIApplication.sharedApplication().delegate!.window!! 55 | win.addSubview(self) 56 | } 57 | 58 | 59 | func addBlurEffect(){ 60 | 61 | if !UIAccessibilityIsReduceTransparencyEnabled() { 62 | 63 | self.backgroundColor = UIColor.clearColor() 64 | 65 | let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.Light) 66 | let blurEffectView = UIVisualEffectView(effect: blurEffect) 67 | blurEffectView.frame = self.bounds 68 | blurEffectView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight] 69 | 70 | self.addSubview(blurEffectView) 71 | } 72 | else { 73 | 74 | self.backgroundColor = UIColor.blackColor() 75 | } 76 | 77 | } 78 | 79 | func addCloseButton(){ 80 | 81 | closeButton = UIButton(frame: CGRectMake(self.frame.width-100, 0, 50, 50)) 82 | closeButton.setImage(UIImage(named: "close"), forState: UIControlState.Normal) 83 | closeButton.addTarget(self, action: Selector("closeDidClicked"), forControlEvents: UIControlEvents.TouchUpInside) 84 | addSubview(closeButton) 85 | addBehavioursForCloseButton() 86 | 87 | } 88 | 89 | func setupAnimators(){ 90 | 91 | animator = UIDynamicAnimator(referenceView: self) 92 | closeButtonAnimator = UIDynamicAnimator(referenceView: self) 93 | } 94 | 95 | override func willMoveToSuperview(newSuperview: UIView?) { 96 | 97 | print("added menu") 98 | 99 | let snapX : CGFloat = self.frame.width/2 100 | let snapY :CGFloat = self.frame.height/4 101 | 102 | addSnapBehaviour(CGPointMake(snapX, snapY)) 103 | addDynamicItemBehaviour() 104 | 105 | 106 | } 107 | 108 | func updateInitialValues(){ 109 | 110 | let initialX : CGFloat = -100 111 | var initialY :CGFloat = self.frame.height/4 112 | let spaceBetween :CGFloat = 25 113 | 114 | for (index, element) in items!.enumerate(){ 115 | 116 | element.center = CGPointMake(initialX, initialY) 117 | initialY += element.frame.height + spaceBetween; 118 | print("Item \(index): \(element.tag)") 119 | element.tag = index 120 | element.addTarget(self, action: Selector("buttonClicked:"), forControlEvents: UIControlEvents.TouchUpInside) 121 | addSubview(element) 122 | } 123 | 124 | } 125 | 126 | func addBehavioursForCloseButton(){ 127 | 128 | let g = UIGravityBehavior(items: [self.closeButton]) 129 | // g.gravityDirection = CGVectorMake(-3,2) 130 | g.magnitude = 9.8 131 | self.closeButtonAnimator.addBehavior(g) 132 | let attachmentBehaviour = UIAttachmentBehavior(item: closeButton, attachedToAnchor: CGPointMake(self.closeButton.center.x, 0)) 133 | attachmentBehaviour.length = self.frame.height/8 134 | attachmentBehaviour.frequency = 3.0 135 | attachmentBehaviour.damping = 0.2 136 | self.closeButtonAnimator.addBehavior(attachmentBehaviour) 137 | 138 | } 139 | 140 | func addDynamicItemBehaviour(){ 141 | 142 | dynamicItemBehaviour = UIDynamicItemBehavior(items: items!) 143 | dynamicItemBehaviour.allowsRotation = false 144 | dynamicItemBehaviour.elasticity = 0.5 145 | dynamicItemBehaviour.friction = 0.2 146 | dynamicItemBehaviour.density = 0.3 147 | 148 | self.animator.addBehavior(dynamicItemBehaviour) 149 | } 150 | 151 | func addSnapBehaviour(var destinationPoint:CGPoint){ 152 | 153 | let spaceBetween :CGFloat = (CGFloat)(100 / (items!.count)) 154 | 155 | var dampingValue : CGFloat = 0.5 156 | for (_, element) in items!.enumerate(){ 157 | 158 | let snapBehaviour = UISnapBehavior(item: element, snapToPoint: destinationPoint) 159 | snapBehaviour.damping = dampingValue 160 | dampingValue -= 0.05 161 | destinationPoint.y += element.frame.height + spaceBetween; 162 | self.animator.addBehavior(snapBehaviour) 163 | } 164 | 165 | } 166 | 167 | func addGravityBehaviour(){ 168 | 169 | self.gravityBehaviour = UIGravityBehavior(items: items!) 170 | self.gravityBehaviour.gravityDirection = CGVectorMake(0,2) 171 | self.gravityBehaviour.magnitude = 9.8 172 | self.animator.addBehavior(self.gravityBehaviour) 173 | 174 | } 175 | 176 | func addCollisionBehaviour(){ 177 | 178 | collisionBehaviour = UICollisionBehavior(items: items!) 179 | collisionBehaviour.translatesReferenceBoundsIntoBoundary = true 180 | // collisionBehaviour.addBoundaryWithIdentifier("sideboundary", fromPoint: CGPointMake(0, self.frame.height), toPoint: CGPointMake(self.frame.width, self.frame.height)) 181 | 182 | collisionBehaviour.translatesReferenceBoundsIntoBoundary = true 183 | collisionBehaviour.collisionDelegate = self 184 | self.animator.addBehavior(collisionBehaviour) 185 | 186 | } 187 | 188 | 189 | 190 | func buttonClicked( sender:UIButton!){ 191 | 192 | 193 | print("button clicked : \(sender.tag)") 194 | 195 | self.animator.removeAllBehaviors() 196 | 197 | addDynamicItemBehaviour() 198 | addGravityBehaviour() 199 | addCollisionBehaviour() 200 | 201 | 202 | let attach = UIAttachmentBehavior(item: sender, attachedToAnchor: self.center) 203 | attach.length = 0 204 | attach.damping = 0.2 205 | attach.frequency = 3.0 206 | 207 | self.animator.addBehavior(attach) 208 | 209 | self.collisionBehaviour.removeItem(sender) 210 | self.dynamicItemBehaviour.allowsRotation = true 211 | 212 | for (_, element) in items!.enumerate(){ 213 | 214 | if !element .isEqual(sender) { 215 | let push = UIPushBehavior(items: [element], mode: UIPushBehaviorMode.Instantaneous) 216 | 217 | push.angle = (CGFloat) ((-0.7 * M_PI) + (Double) (arc4random()%25 / 10)); 218 | push.magnitude = 1; 219 | self.animator.addBehavior(push) 220 | } 221 | 222 | } 223 | 224 | self.gravityBehaviour.action = {() in 225 | 226 | } 227 | 228 | selected = true 229 | 230 | sender.transform = CGAffineTransformMakeScale(2.0, 2.0) 231 | self.animator.updateItemUsingCurrentState(sender) 232 | 233 | 234 | _ = NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: Selector("closeMenu"), userInfo: nil, repeats: false) 235 | 236 | 237 | } 238 | 239 | //MARK: ## Delegates 240 | 241 | 242 | func collisionBehavior(behavior: UICollisionBehavior, endedContactForItem item: UIDynamicItem, withBoundaryIdentifier identifier: NSCopying?) { 243 | 244 | print("collision ended") 245 | 246 | 247 | 248 | } 249 | func collisionBehavior(behavior: UICollisionBehavior, beganContactForItem item: UIDynamicItem, withBoundaryIdentifier identifier: NSCopying?, atPoint p: CGPoint) { 250 | 251 | print("collision began") 252 | 253 | 254 | } 255 | func collisionBehavior(behavior: UICollisionBehavior, beganContactForItem item1: UIDynamicItem, withItem item2: UIDynamicItem, atPoint p: CGPoint) { 256 | 257 | 258 | } 259 | 260 | func collisionBehavior(behavior: UICollisionBehavior, endedContactForItem item1: UIDynamicItem, withItem item2: UIDynamicItem) { 261 | 262 | 263 | 264 | } 265 | 266 | func closeDidClicked(){ 267 | 268 | playReverseAction(); 269 | 270 | UIView.animateWithDuration(0.8, animations: { () -> Void in 271 | 272 | self.alpha = 0.0 273 | 274 | }) { (completed) -> Void in 275 | 276 | self.removeMenu() 277 | } 278 | 279 | 280 | } 281 | 282 | func playReverseAction(){ 283 | 284 | self.closeButtonAnimator.removeAllBehaviors() 285 | self.animator.removeAllBehaviors() 286 | 287 | addSnapBehaviour(CGPointMake(-100, self.frame.height/4)) 288 | 289 | let g = UIGravityBehavior(items: [self.closeButton]) 290 | // g.gravityDirection = CGVectorMake(0,) 291 | g.magnitude = -0.5 292 | self.closeButtonAnimator.addBehavior(g) 293 | let attachmentBehaviour = UIAttachmentBehavior(item: closeButton, attachedToAnchor: CGPointMake(self.closeButton.center.x, self.closeButton.center.y)) 294 | 295 | attachmentBehaviour.length = 300 296 | attachmentBehaviour.frequency = 2.0 297 | attachmentBehaviour.damping = 0.4 298 | self.closeButtonAnimator.addBehavior(attachmentBehaviour) 299 | 300 | } 301 | 302 | 303 | func dynamicAnimatorDidPause(animator: UIDynamicAnimator) { 304 | 305 | 306 | self .removeFromSuperview() 307 | 308 | 309 | } 310 | 311 | func closeMenu(){ 312 | 313 | playReverseAction() 314 | 315 | UIView.animateWithDuration(0.8, animations: { () -> Void in 316 | 317 | self.alpha = 0.0 318 | 319 | }) { (completed) -> Void in 320 | 321 | self.removeMenu() 322 | } 323 | } 324 | 325 | 326 | 327 | 328 | func removeMenu(){ 329 | 330 | self.removeFromSuperview() 331 | } 332 | 333 | } 334 | -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // MSDynamicMenu 4 | // 5 | // Created by Midhun on 3/4/16. 6 | // Copyright © 2016 InApp. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | @IBAction func menuDidClicked(sender: AnyObject) { 24 | 25 | let menu:MSDynamicMenu = MSDynamicMenu(frame: self.view.frame) 26 | 27 | let button1 : UIButton = UIButton(frame: CGRectMake(0, 150, 50, 50)) 28 | // button1.backgroundColor = UIColor.greenColor() 29 | button1.setImage(UIImage(named: "fb"), forState: UIControlState.Normal) 30 | 31 | 32 | let button2 : UIButton = UIButton(frame: CGRectMake(0, 250, 50, 50)) 33 | button2.setImage(UIImage(named: "google+"), forState: UIControlState.Normal) 34 | 35 | let button3 : UIButton = UIButton(frame: CGRectMake(0, 350, 50, 50)) 36 | button3.setImage(UIImage(named: "twitter"), forState: UIControlState.Normal) 37 | 38 | let button4 : UIButton = UIButton(frame: CGRectMake(0, 350, 50, 50)) 39 | button4.setImage(UIImage(named: "linkdin"), forState: UIControlState.Normal) 40 | 41 | let button5 : UIButton = UIButton(frame: CGRectMake(0, 350, 50, 50)) 42 | button5.setImage(UIImage(named: "messenger"), forState: UIControlState.Normal) 43 | 44 | menu.items = [button1,button2,button3,button4,button5] 45 | 46 | menu.show() 47 | 48 | 49 | // self.view.addSubview(menu) 50 | } 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/images/Dandelions.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/images/Dandelions.jpg -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/images/RebellionRider-googleplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/images/RebellionRider-googleplus.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/images/apple.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/images/apple.jpg -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/images/close_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/images/close_red.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/images/facebook-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/images/facebook-icon.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/images/facebook-messenger-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/images/facebook-messenger-icon.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/images/landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/images/landscape.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/images/linkedin-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/images/linkedin-icon.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/images/penguin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/images/penguin.jpg -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/images/share-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/images/share-icon.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/images/twitter-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/images/twitter-icon.png -------------------------------------------------------------------------------- /MSDynamicMenu/MSDynamicMenu/images/whatsapp-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midhun73s/MSDynamicMenu/5600be63851b9d1987c49c279e95c6e312c7e8a1/MSDynamicMenu/MSDynamicMenu/images/whatsapp-icon.png --------------------------------------------------------------------------------