├── LeftDemo.gif ├── RightDemo.gif ├── SSASideMenuCover.png ├── Examples ├── Simple │ ├── .DS_Store │ ├── SSASideMenuExample │ │ ├── Images.xcassets │ │ │ ├── IconHome.imageset │ │ │ │ ├── IconHome@2x.png │ │ │ │ └── Contents.json │ │ │ ├── IconEmpty.imageset │ │ │ │ ├── IconEmpty@2x.png │ │ │ │ └── Contents.json │ │ │ ├── Background.imageset │ │ │ │ ├── Background@2x.png │ │ │ │ └── Contents.json │ │ │ ├── IconCalendar.imageset │ │ │ │ ├── IconCalendar@2x.png │ │ │ │ └── Contents.json │ │ │ ├── IconProfile.imageset │ │ │ │ ├── IconProfile@2x.png │ │ │ │ └── Contents.json │ │ │ ├── IconSettings.imageset │ │ │ │ ├── IconSettings@2x.png │ │ │ │ └── Contents.json │ │ │ ├── LaunchImage.launchimage │ │ │ │ ├── Default-4.7.png │ │ │ │ ├── Default-5.5.png │ │ │ │ ├── Default-568h@2x.png │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── FirstViewController.swift │ │ ├── SecondViewController.swift │ │ ├── Info.plist │ │ ├── AppDelegate.swift │ │ ├── RightMenuViewController.swift │ │ └── LeftMenuViewController.swift │ ├── SSASideMenuExample.xcodeproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ ├── xcuserdata │ │ │ │ ├── tech-amber.xcuserdatad │ │ │ │ │ └── UserInterfaceState.xcuserstate │ │ │ │ ├── SebastianSA.xcuserdatad │ │ │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ │ │ └── WorkspaceSettings.xcsettings │ │ │ │ └── PhamHoan.xcuserdatad │ │ │ │ │ └── WorkspaceSettings.xcsettings │ │ │ └── xcshareddata │ │ │ │ ├── SSASideMenuExample.xccheckout │ │ │ │ └── SSASideMenuExample.xcscmblueprint │ │ ├── xcuserdata │ │ │ ├── PhamHoan.xcuserdatad │ │ │ │ └── xcschemes │ │ │ │ │ ├── xcschememanagement.plist │ │ │ │ │ └── SSASideMenuExample.xcscheme │ │ │ ├── SebastianSA.xcuserdatad │ │ │ │ └── xcschemes │ │ │ │ │ ├── xcschememanagement.plist │ │ │ │ │ └── SSASideMenuExample.xcscheme │ │ │ └── tech-amber.xcuserdatad │ │ │ │ └── xcschemes │ │ │ │ ├── xcschememanagement.plist │ │ │ │ └── SSASideMenuExample.xcscheme │ │ └── project.pbxproj │ └── SSASideMenuExampleTests │ │ ├── Info.plist │ │ └── SSASideMenuExampleTests.swift └── Storyboard │ ├── .DS_Store │ ├── SSASideMenuStoryboardExample │ ├── Images.xcassets │ │ ├── Contents.json │ │ ├── IconHome.imageset │ │ │ ├── IconHome@2x.png │ │ │ └── Contents.json │ │ ├── Background.imageset │ │ │ ├── Background@2x.png │ │ │ └── Contents.json │ │ ├── IconEmpty.imageset │ │ │ ├── IconEmpty@2x.png │ │ │ └── Contents.json │ │ ├── IconProfile.imageset │ │ │ ├── IconProfile@2x.png │ │ │ └── Contents.json │ │ ├── IconCalendar.imageset │ │ │ ├── IconCalendar@2x.png │ │ │ └── Contents.json │ │ ├── IconSettings.imageset │ │ │ ├── IconSettings@2x.png │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── FirstViewController.swift │ ├── SecondViewController.swift │ ├── Info.plist │ ├── AppDelegate.swift │ ├── RightMenuViewController.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ └── LeftMenuViewController.swift │ ├── SSASideMenuStoryboardExample.xcodeproj │ ├── xcuserdata │ │ ├── SebastianSA.xcuserdatad │ │ │ ├── xcdebugger │ │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ │ ├── xcschememanagement.plist │ │ │ │ └── SSASideMenuStoryboardExample.xcscheme │ │ └── tech-amber.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── xcschememanagement.plist │ │ │ └── SSASideMenuStoryboardExample.xcscheme │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcuserdata │ │ │ ├── SebastianSA.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── tech-amber.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcshareddata │ │ │ ├── SSASideMenuStoryboardExample.xccheckout │ │ │ └── SSASideMenuStoryboardExample.xcscmblueprint │ └── project.pbxproj │ └── SSASideMenuStoryboardExampleTests │ ├── Info.plist │ └── SSASideMenuStoryboardExampleTests.swift ├── LICENSE ├── README.md └── SSASideMenu └── SSASideMenu.swift /LeftDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/LeftDemo.gif -------------------------------------------------------------------------------- /RightDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/RightDemo.gif -------------------------------------------------------------------------------- /SSASideMenuCover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/SSASideMenuCover.png -------------------------------------------------------------------------------- /Examples/Simple/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Simple/.DS_Store -------------------------------------------------------------------------------- /Examples/Storyboard/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Storyboard/.DS_Store -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/IconHome.imageset/IconHome@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Simple/SSASideMenuExample/Images.xcassets/IconHome.imageset/IconHome@2x.png -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/IconEmpty.imageset/IconEmpty@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Simple/SSASideMenuExample/Images.xcassets/IconEmpty.imageset/IconEmpty@2x.png -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/Background.imageset/Background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Simple/SSASideMenuExample/Images.xcassets/Background.imageset/Background@2x.png -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/IconCalendar.imageset/IconCalendar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Simple/SSASideMenuExample/Images.xcassets/IconCalendar.imageset/IconCalendar@2x.png -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/IconProfile.imageset/IconProfile@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Simple/SSASideMenuExample/Images.xcassets/IconProfile.imageset/IconProfile@2x.png -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/IconSettings.imageset/IconSettings@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Simple/SSASideMenuExample/Images.xcassets/IconSettings.imageset/IconSettings@2x.png -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/LaunchImage.launchimage/Default-4.7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Simple/SSASideMenuExample/Images.xcassets/LaunchImage.launchimage/Default-4.7.png -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/LaunchImage.launchimage/Default-5.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Simple/SSASideMenuExample/Images.xcassets/LaunchImage.launchimage/Default-5.5.png -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Simple/SSASideMenuExample/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample.xcodeproj/xcuserdata/SebastianSA.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconHome.imageset/IconHome@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconHome.imageset/IconHome@2x.png -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/Background.imageset/Background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/Background.imageset/Background@2x.png -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconEmpty.imageset/IconEmpty@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconEmpty.imageset/IconEmpty@2x.png -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconProfile.imageset/IconProfile@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconProfile.imageset/IconProfile@2x.png -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconCalendar.imageset/IconCalendar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconCalendar.imageset/IconCalendar@2x.png -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconSettings.imageset/IconSettings@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconSettings.imageset/IconSettings@2x.png -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample.xcodeproj/project.xcworkspace/xcuserdata/tech-amber.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Simple/SSASideMenuExample.xcodeproj/project.xcworkspace/xcuserdata/tech-amber.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample.xcodeproj/project.xcworkspace/xcuserdata/SebastianSA.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Simple/SSASideMenuExample.xcodeproj/project.xcworkspace/xcuserdata/SebastianSA.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample.xcodeproj/project.xcworkspace/xcuserdata/SebastianSA.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Storyboard/SSASideMenuStoryboardExample.xcodeproj/project.xcworkspace/xcuserdata/SebastianSA.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample.xcodeproj/project.xcworkspace/xcuserdata/tech-amber.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSA111/SSASideMenu/HEAD/Examples/Storyboard/SSASideMenuStoryboardExample.xcodeproj/project.xcworkspace/xcuserdata/tech-amber.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/IconEmpty.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "IconEmpty@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/IconHome.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "IconHome@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/Background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Background@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/IconProfile.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "IconProfile@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/IconCalendar.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "IconCalendar@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/IconSettings.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "IconSettings@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconEmpty.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "IconEmpty@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconHome.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "IconHome@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample.xcodeproj/project.xcworkspace/xcuserdata/PhamHoan.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample.xcodeproj/project.xcworkspace/xcuserdata/SebastianSA.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/Background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Background@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconCalendar.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "IconCalendar@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconProfile.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "IconProfile@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/IconSettings.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "IconSettings@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample.xcodeproj/xcuserdata/PhamHoan.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SSASideMenuExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | DC4C1A8B1AA7461E00ACD446 16 | 17 | primary 18 | 19 | 20 | DC4C1AA01AA7461E00ACD446 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample.xcodeproj/xcuserdata/SebastianSA.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SSASideMenuExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | DC4C1A8B1AA7461E00ACD446 16 | 17 | primary 18 | 19 | 20 | DC4C1AA01AA7461E00ACD446 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample.xcodeproj/xcuserdata/tech-amber.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SSASideMenuExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | DC4C1A8B1AA7461E00ACD446 16 | 17 | primary 18 | 19 | 20 | DC4C1AA01AA7461E00ACD446 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample.xcodeproj/xcuserdata/tech-amber.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SSASideMenuStoryboardExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | DC00C7621ACC65CD00BB4A99 16 | 17 | primary 18 | 19 | 20 | DC00C7771ACC65CD00BB4A99 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample.xcodeproj/xcuserdata/SebastianSA.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SSASideMenuStoryboardExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | DC00C7621ACC65CD00BB4A99 16 | 17 | primary 18 | 19 | 20 | DC00C7771ACC65CD00BB4A99 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExampleTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExampleTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/FirstViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.swift 3 | // SSASideMenuExample 4 | // 5 | // Created by Sebastian Andersen on 20/10/14. 6 | // Copyright (c) 2015 Sebastian Andersen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class FirstViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | view.backgroundColor = UIColor.white 17 | title = "Home" 18 | navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Left", style: .plain, target: self, action: #selector(SSASideMenu.presentLeftMenuViewController)) 19 | navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Right", style: .plain, target: self, action: #selector(SSASideMenu.presentRightMenuViewController)) 20 | 21 | } 22 | 23 | override func didReceiveMemoryWarning() { 24 | super.didReceiveMemoryWarning() 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | 29 | } 30 | 31 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/FirstViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.swift 3 | // SSASideMenuExample 4 | // 5 | // Created by Sebastian Andersen on 20/10/14. 6 | // Copyright (c) 2015 Sebastian Andersen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class FirstViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | view.backgroundColor = UIColor.white 17 | title = "Home" 18 | navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Left", style: .plain, target: self, action: #selector(SSASideMenu.presentLeftMenuViewController)) 19 | navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Right", style: .plain, target: self, action: #selector(SSASideMenu.presentRightMenuViewController)) 20 | 21 | } 22 | 23 | override func didReceiveMemoryWarning() { 24 | super.didReceiveMemoryWarning() 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | 29 | } 30 | 31 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/SecondViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.swift 3 | // SSASideMenuExample 4 | // 5 | // Created by Sebastian Andersen on 20/10/14. 6 | // Copyright (c) 2015 Sebastian Andersen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class SecondViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | view.backgroundColor = UIColor.white 17 | 18 | title = "Calender" 19 | navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Left", style: .plain, target: self, action: #selector(SSASideMenu.presentLeftMenuViewController)) 20 | navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Right", style: .plain, target: self, action: #selector(SSASideMenu.presentRightMenuViewController)) 21 | 22 | } 23 | 24 | 25 | override func didReceiveMemoryWarning() { 26 | super.didReceiveMemoryWarning() 27 | // Dispose of any resources that can be recreated. 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/SecondViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.swift 3 | // SSASideMenuExample 4 | // 5 | // Created by Sebastian Andersen on 20/10/14. 6 | // Copyright (c) 2015 Sebastian Andersen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class SecondViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | view.backgroundColor = UIColor.white 17 | 18 | title = "Calender" 19 | navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Left", style: .plain, target: self, action: #selector(SSASideMenu.presentLeftMenuViewController)) 20 | navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Right", style: .plain, target: self, action: #selector(SSASideMenu.presentRightMenuViewController)) 21 | 22 | } 23 | 24 | 25 | override func didReceiveMemoryWarning() { 26 | super.didReceiveMemoryWarning() 27 | // Dispose of any resources that can be recreated. 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Sebastian Andersen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExampleTests/SSASideMenuExampleTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SSASideMenuExampleTests.swift 3 | // SSASideMenuExampleTests 4 | // 5 | // Created by Sebastian S. Andersen on 04/03/15. 6 | // Copyright (c) 2015 SebastianAndersen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class SSASideMenuExampleTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "736h", 7 | "filename" : "Default-5.5.png", 8 | "minimum-system-version" : "8.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "667h", 16 | "filename" : "Default-4.7.png", 17 | "minimum-system-version" : "8.0", 18 | "orientation" : "portrait", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "orientation" : "portrait", 23 | "idiom" : "iphone", 24 | "extent" : "full-screen", 25 | "minimum-system-version" : "7.0", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "extent" : "full-screen", 30 | "idiom" : "iphone", 31 | "subtype" : "retina4", 32 | "filename" : "Default-568h@2x.png", 33 | "minimum-system-version" : "7.0", 34 | "orientation" : "portrait", 35 | "scale" : "2x" 36 | } 37 | ], 38 | "info" : { 39 | "version" : 1, 40 | "author" : "xcode" 41 | } 42 | } -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/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 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExampleTests/SSASideMenuStoryboardExampleTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SSASideMenuStoryboardExampleTests.swift 3 | // SSASideMenuStoryboardExampleTests 4 | // 5 | // Created by Sebastian S. Andersen on 01/04/15. 6 | // Copyright (c) 2015 SebastianAndersen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class SSASideMenuStoryboardExampleTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/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 | 40 | 41 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample.xcodeproj/project.xcworkspace/xcshareddata/SSASideMenuExample.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 9C49F0EF-EE49-4ECA-901B-35DE183ECA09 9 | IDESourceControlProjectName 10 | SSASideMenuExample 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 5ECD6CE71315213E6CE31D275677265DCB8CE98E 14 | https://github.com/SSA111/SSASideMenu.git 15 | 16 | IDESourceControlProjectPath 17 | Examples/Simple/SSASideMenuExample.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 5ECD6CE71315213E6CE31D275677265DCB8CE98E 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/SSA111/SSASideMenu.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 5ECD6CE71315213E6CE31D275677265DCB8CE98E 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 5ECD6CE71315213E6CE31D275677265DCB8CE98E 36 | IDESourceControlWCCName 37 | SSASideMenuExample 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample.xcodeproj/project.xcworkspace/xcshareddata/SSASideMenuStoryboardExample.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 09A6035E-9360-4E63-99B5-785E16F4244A 9 | IDESourceControlProjectName 10 | SSASideMenuStoryboardExample 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 5ECD6CE71315213E6CE31D275677265DCB8CE98E 14 | https://github.com/SSA111/SSASideMenu.git 15 | 16 | IDESourceControlProjectPath 17 | Examples/Storyboard/SSASideMenuStoryboardExample.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 5ECD6CE71315213E6CE31D275677265DCB8CE98E 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/SSA111/SSASideMenu.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 5ECD6CE71315213E6CE31D275677265DCB8CE98E 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 5ECD6CE71315213E6CE31D275677265DCB8CE98E 36 | IDESourceControlWCCName 37 | SSASideMenuExample 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample.xcodeproj/project.xcworkspace/xcshareddata/SSASideMenuExample.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "8C5B49DA32D8F06B9E0E0039B9D631C42442FDE3", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "8C5B49DA32D8F06B9E0E0039B9D631C42442FDE3" : 0, 8 | "5ECD6CE71315213E6CE31D275677265DCB8CE98E" : 0 9 | }, 10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "9C49F0EF-EE49-4ECA-901B-35DE183ECA09", 11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 12 | "8C5B49DA32D8F06B9E0E0039B9D631C42442FDE3" : "SSASideMenu\/", 13 | "5ECD6CE71315213E6CE31D275677265DCB8CE98E" : "SSASideMenuExample" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "SSASideMenuExample", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Examples\/Simple\/SSASideMenuExample.xcodeproj", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/SSA111\/SSASideMenu.git", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "5ECD6CE71315213E6CE31D275677265DCB8CE98E" 23 | }, 24 | { 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/sairamkotha\/SSASideMenu.git", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "8C5B49DA32D8F06B9E0E0039B9D631C42442FDE3" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample.xcodeproj/project.xcworkspace/xcshareddata/SSASideMenuStoryboardExample.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "9FEA581D8521A45C56BB24911C78023B5515C0B9", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "5ECD6CE71315213E6CE31D275677265DCB8CE98E" : 0, 8 | "8C5B49DA32D8F06B9E0E0039B9D631C42442FDE3" : 0, 9 | "9FEA581D8521A45C56BB24911C78023B5515C0B9" : 0 10 | }, 11 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "09A6035E-9360-4E63-99B5-785E16F4244A", 12 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 13 | "5ECD6CE71315213E6CE31D275677265DCB8CE98E" : "SSASideMenuExample", 14 | "8C5B49DA32D8F06B9E0E0039B9D631C42442FDE3" : "SSASideMenu-master\/", 15 | "9FEA581D8521A45C56BB24911C78023B5515C0B9" : "SSASideMenu\/" 16 | }, 17 | "DVTSourceControlWorkspaceBlueprintNameKey" : "SSASideMenuStoryboardExample", 18 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 19 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Examples\/Storyboard\/SSASideMenuStoryboardExample.xcodeproj", 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 21 | { 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/SSA111\/SSASideMenu.git", 23 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 24 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "5ECD6CE71315213E6CE31D275677265DCB8CE98E" 25 | }, 26 | { 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/SSA111\/SSASideMenu.git", 28 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 29 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "8C5B49DA32D8F06B9E0E0039B9D631C42442FDE3" 30 | }, 31 | { 32 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/SSA111\/SSASideMenu.git", 33 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 34 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "9FEA581D8521A45C56BB24911C78023B5515C0B9" 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SSASideMenuExample 4 | // 5 | // Created by Sebastian Andersen on 20/10/14. 6 | // Copyright (c) 2014 Sebastian Andersen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate, SSASideMenuDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 17 | 18 | window = UIWindow(frame: UIScreen.main.bounds) 19 | 20 | //MARK : Setup SSASideMenu 21 | 22 | let sideMenu = SSASideMenu(contentViewController: UINavigationController(rootViewController: FirstViewController()), leftMenuViewController: LeftMenuViewController(), rightMenuViewController: RightMenuViewController()) 23 | sideMenu.backgroundImage = UIImage(named: "Background.jpg") 24 | sideMenu.configure(SSASideMenu.MenuViewEffect(fade: true, scale: true, scaleBackground: false)) 25 | sideMenu.configure(SSASideMenu.ContentViewEffect(alpha: 1.0, scale: 0.7)) 26 | sideMenu.configure(SSASideMenu.ContentViewShadow(enabled: true, color: UIColor.black, opacity: 0.6, radius: 6.0)) 27 | sideMenu.delegate = self 28 | 29 | window?.rootViewController = sideMenu 30 | window?.makeKeyAndVisible() 31 | 32 | return true 33 | } 34 | 35 | func sideMenuWillShowMenuViewController(_ sideMenu: SSASideMenu, menuViewController: UIViewController) { 36 | print("Will Show \(menuViewController)") 37 | } 38 | 39 | func sideMenuDidShowMenuViewController(_ sideMenu: SSASideMenu, menuViewController: UIViewController) { 40 | print("Did Show \(menuViewController)") 41 | } 42 | 43 | func sideMenuDidHideMenuViewController(_ sideMenu: SSASideMenu, menuViewController: UIViewController) { 44 | print("Did Hide \(menuViewController)") 45 | } 46 | 47 | func sideMenuWillHideMenuViewController(_ sideMenu: SSASideMenu, menuViewController: UIViewController) { 48 | print("Will Hide \(menuViewController)") 49 | } 50 | func sideMenuDidRecognizePanGesture(_ sideMenu: SSASideMenu, recongnizer: UIPanGestureRecognizer) { 51 | print("Did Recognize PanGesture \(recongnizer)") 52 | } 53 | 54 | } 55 | 56 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SSASideMenuStoryboardExample 4 | // 5 | // Created by Sebastian S. Andersen on 01/04/15. 6 | // Copyright (c) 2015 SebastianAndersen. 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: [UIApplicationLaunchOptionsKey: Any]?) -> 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 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/RightMenuViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RightMenuViewController.swift 3 | // SSASideMenuExample 4 | // 5 | // Created by Sebastian Andersen on 06/03/15. 6 | // Copyright (c) 2015 Sebastian Andersen. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | class RightMenuViewController: UIViewController { 13 | 14 | lazy var tableView: UITableView = { 15 | let tableView = UITableView() 16 | tableView.delegate = self 17 | tableView.dataSource = self 18 | tableView.separatorStyle = .none 19 | tableView.frame = CGRect(x: 180, y: (self.view.frame.size.height - 54 * 2) / 2.0, width: self.view.frame.size.width, height: 54 * 2) 20 | tableView.autoresizingMask = [.flexibleTopMargin, .flexibleBottomMargin, .flexibleWidth] 21 | tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") 22 | tableView.isOpaque = false 23 | tableView.backgroundColor = UIColor.clear 24 | tableView.backgroundView = nil 25 | tableView.bounces = false 26 | return tableView 27 | }() 28 | 29 | override func viewDidAppear(_ animated: Bool) { 30 | super.viewDidAppear(animated) 31 | 32 | 33 | } 34 | override func viewDidLoad() { 35 | super.viewDidLoad() 36 | 37 | view.backgroundColor = UIColor.clear 38 | view.addSubview(tableView) 39 | 40 | } 41 | 42 | override func didReceiveMemoryWarning() { 43 | super.didReceiveMemoryWarning() 44 | // Dispose of any resources that can be recreated. 45 | } 46 | 47 | 48 | } 49 | 50 | 51 | // MARK : TableViewDataSource & Delegate Methods 52 | 53 | extension RightMenuViewController: UITableViewDelegate, UITableViewDataSource { 54 | 55 | 56 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 57 | return 2 58 | } 59 | 60 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 61 | return 54 62 | } 63 | 64 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 65 | 66 | let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) 67 | 68 | let titles: [String] = ["Home", "Calendar"] 69 | 70 | cell.backgroundColor = UIColor.clear 71 | cell.textLabel?.font = UIFont(name: "HelveticaNeue", size: 21) 72 | cell.textLabel?.textColor = UIColor.white 73 | cell.textLabel?.text = titles[indexPath.row] 74 | cell.selectionStyle = .none 75 | 76 | 77 | 78 | return cell 79 | } 80 | 81 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 82 | 83 | tableView.deselectRow(at: indexPath, animated: true) 84 | 85 | switch indexPath.row { 86 | case 0: 87 | 88 | sideMenuViewController?.contentViewController = UINavigationController(rootViewController: FirstViewController()) 89 | sideMenuViewController?.hideMenuViewController() 90 | break 91 | case 1: 92 | 93 | sideMenuViewController?.contentViewController = UINavigationController(rootViewController: SecondViewController()) 94 | sideMenuViewController?.hideMenuViewController() 95 | break 96 | default: 97 | break 98 | } 99 | 100 | 101 | } 102 | 103 | } 104 | 105 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/RightMenuViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RightMenuViewController.swift 3 | // SSASideMenuExample 4 | // 5 | // Created by Sebastian Andersen on 06/03/15. 6 | // Copyright (c) 2015 Sebastian Andersen. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | class RightMenuViewController: UIViewController { 13 | 14 | lazy var tableView: UITableView = { 15 | let tableView = UITableView() 16 | tableView.delegate = self 17 | tableView.dataSource = self 18 | tableView.separatorStyle = .none 19 | tableView.frame = CGRect(x: 180, y: (self.view.frame.size.height - 54 * 2) / 2.0, width: self.view.frame.size.width, height: 54 * 2) 20 | tableView.autoresizingMask = [.flexibleTopMargin, .flexibleBottomMargin, .flexibleWidth] 21 | tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") 22 | tableView.isOpaque = false 23 | tableView.backgroundColor = UIColor.clear 24 | tableView.backgroundView = nil 25 | tableView.bounces = false 26 | return tableView 27 | }() 28 | 29 | override func viewDidAppear(_ animated: Bool) { 30 | super.viewDidAppear(animated) 31 | 32 | 33 | } 34 | override func viewDidLoad() { 35 | super.viewDidLoad() 36 | 37 | view.backgroundColor = UIColor.clear 38 | view.addSubview(tableView) 39 | 40 | } 41 | 42 | override func didReceiveMemoryWarning() { 43 | super.didReceiveMemoryWarning() 44 | // Dispose of any resources that can be recreated. 45 | } 46 | 47 | 48 | } 49 | 50 | 51 | // MARK : TableViewDataSource & Delegate Methods 52 | 53 | extension RightMenuViewController: UITableViewDelegate, UITableViewDataSource { 54 | 55 | 56 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 57 | return 2 58 | } 59 | 60 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 61 | return 54 62 | } 63 | 64 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 65 | 66 | let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) 67 | 68 | let titles: [String] = ["Home", "Calendar"] 69 | 70 | cell.backgroundColor = UIColor.clear 71 | cell.textLabel?.font = UIFont(name: "HelveticaNeue", size: 21) 72 | cell.textLabel?.textColor = UIColor.white 73 | cell.textLabel?.text = titles[indexPath.row] 74 | cell.selectionStyle = .none 75 | 76 | 77 | 78 | return cell 79 | } 80 | 81 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 82 | 83 | tableView.deselectRow(at: indexPath, animated: true) 84 | 85 | switch indexPath.row { 86 | case 0: 87 | 88 | sideMenuViewController?.contentViewController = UINavigationController(rootViewController: FirstViewController()) 89 | sideMenuViewController?.hideMenuViewController() 90 | break 91 | case 1: 92 | 93 | sideMenuViewController?.contentViewController = UINavigationController(rootViewController: SecondViewController()) 94 | sideMenuViewController?.hideMenuViewController() 95 | break 96 | default: 97 | break 98 | } 99 | 100 | 101 | } 102 | 103 | } 104 | 105 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample/LeftMenuViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LeftMenuViewController.swift 3 | // SSASideMenuExample 4 | // 5 | // Created by Sebastian Andersen on 20/10/14. 6 | // Copyright (c) 2015 Sebastian Andersen. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | class LeftMenuViewController: UIViewController { 13 | 14 | lazy var tableView: UITableView = { 15 | let tableView = UITableView() 16 | tableView.delegate = self 17 | tableView.dataSource = self 18 | tableView.separatorStyle = .none 19 | tableView.frame = CGRect(x: 20, y: (self.view.frame.size.height - 54 * 5) / 2.0, width: self.view.frame.size.width, height: 54 * 5) 20 | tableView.autoresizingMask = [.flexibleTopMargin, .flexibleBottomMargin, .flexibleWidth] 21 | tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") 22 | tableView.isOpaque = false 23 | tableView.backgroundColor = UIColor.clear 24 | tableView.backgroundView = nil 25 | tableView.bounces = false 26 | return tableView 27 | }() 28 | 29 | override func viewDidAppear(_ animated: Bool) { 30 | super.viewDidAppear(animated) 31 | 32 | 33 | } 34 | override func viewDidLoad() { 35 | super.viewDidLoad() 36 | 37 | view.backgroundColor = UIColor.clear 38 | view.addSubview(tableView) 39 | 40 | } 41 | 42 | override func didReceiveMemoryWarning() { 43 | super.didReceiveMemoryWarning() 44 | // Dispose of any resources that can be recreated. 45 | } 46 | 47 | 48 | } 49 | 50 | 51 | // MARK : TableViewDataSource & Delegate Methods 52 | 53 | extension LeftMenuViewController: UITableViewDelegate, UITableViewDataSource { 54 | 55 | 56 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 57 | return 5 58 | } 59 | 60 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 61 | return 54 62 | } 63 | 64 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 65 | 66 | let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) 67 | 68 | let titles: [String] = ["Home", "Calendar", "Profile", "Settings", "Log Out"] 69 | 70 | let images: [String] = ["IconHome", "IconCalendar", "IconProfile", "IconSettings", "IconEmpty"] 71 | 72 | cell.backgroundColor = UIColor.clear 73 | cell.textLabel?.font = UIFont(name: "HelveticaNeue", size: 21) 74 | cell.textLabel?.textColor = UIColor.white 75 | cell.textLabel?.text = titles[indexPath.row] 76 | cell.selectionStyle = .none 77 | cell.imageView?.image = UIImage(named: images[indexPath.row]) 78 | 79 | 80 | return cell 81 | } 82 | 83 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 84 | 85 | tableView.deselectRow(at: indexPath, animated: true) 86 | 87 | switch indexPath.row { 88 | case 0: 89 | 90 | sideMenuViewController?.contentViewController = UINavigationController(rootViewController: FirstViewController()) 91 | sideMenuViewController?.hideMenuViewController() 92 | break 93 | case 1: 94 | 95 | sideMenuViewController?.contentViewController = UINavigationController(rootViewController: SecondViewController()) 96 | sideMenuViewController?.hideMenuViewController() 97 | break 98 | default: 99 | break 100 | } 101 | 102 | 103 | } 104 | 105 | } 106 | 107 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/LeftMenuViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LeftMenuViewController.swift 3 | // SSASideMenuExample 4 | // 5 | // Created by Sebastian Andersen on 20/10/14. 6 | // Copyright (c) 2015 Sebastian Andersen. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | class LeftMenuViewController: UIViewController { 13 | 14 | lazy var tableView: UITableView = { 15 | let tableView = UITableView() 16 | tableView.delegate = self 17 | tableView.dataSource = self 18 | tableView.separatorStyle = .none 19 | tableView.frame = CGRect(x: 20, y: (self.view.frame.size.height - 54 * 5) / 2.0, width: self.view.frame.size.width, height: 54 * 5) 20 | tableView.autoresizingMask = [.flexibleTopMargin, .flexibleBottomMargin, .flexibleWidth] 21 | tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") 22 | tableView.isOpaque = false 23 | tableView.backgroundColor = UIColor.clear 24 | tableView.backgroundView = nil 25 | tableView.bounces = false 26 | return tableView 27 | }() 28 | 29 | override func viewDidAppear(_ animated: Bool) { 30 | super.viewDidAppear(animated) 31 | 32 | 33 | } 34 | override func viewDidLoad() { 35 | super.viewDidLoad() 36 | 37 | view.backgroundColor = UIColor.clear 38 | view.addSubview(tableView) 39 | 40 | } 41 | 42 | override func didReceiveMemoryWarning() { 43 | super.didReceiveMemoryWarning() 44 | // Dispose of any resources that can be recreated. 45 | } 46 | 47 | 48 | } 49 | 50 | 51 | // MARK : TableViewDataSource & Delegate Methods 52 | 53 | extension LeftMenuViewController: UITableViewDelegate, UITableViewDataSource { 54 | 55 | 56 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 57 | return 5 58 | } 59 | 60 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 61 | return 54 62 | } 63 | 64 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 65 | 66 | let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) 67 | 68 | let titles: [String] = ["Home", "Calendar", "Profile", "Settings", "Log Out"] 69 | 70 | let images: [String] = ["IconHome", "IconCalendar", "IconProfile", "IconSettings", "IconEmpty"] 71 | 72 | cell.backgroundColor = UIColor.clear 73 | cell.textLabel?.font = UIFont(name: "HelveticaNeue", size: 21) 74 | cell.textLabel?.textColor = UIColor.white 75 | cell.textLabel?.text = titles[indexPath.row] 76 | cell.selectionStyle = .none 77 | cell.imageView?.image = UIImage(named: images[indexPath.row]) 78 | 79 | 80 | return cell 81 | } 82 | 83 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 84 | 85 | tableView.deselectRow(at: indexPath, animated: true) 86 | 87 | switch indexPath.row { 88 | case 0: 89 | 90 | sideMenuViewController?.contentViewController = UINavigationController(rootViewController: FirstViewController()) 91 | sideMenuViewController?.hideMenuViewController() 92 | break 93 | case 1: 94 | 95 | sideMenuViewController?.contentViewController = UINavigationController(rootViewController: SecondViewController()) 96 | sideMenuViewController?.hideMenuViewController() 97 | break 98 | default: 99 | break 100 | } 101 | 102 | 103 | } 104 | 105 | } 106 | 107 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample.xcodeproj/xcuserdata/tech-amber.xcuserdatad/xcschemes/SSASideMenuExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample.xcodeproj/xcuserdata/tech-amber.xcuserdatad/xcschemes/SSASideMenuStoryboardExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample.xcodeproj/xcuserdata/PhamHoan.xcuserdatad/xcschemes/SSASideMenuExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample.xcodeproj/xcuserdata/SebastianSA.xcuserdatad/xcschemes/SSASideMenuExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample.xcodeproj/xcuserdata/SebastianSA.xcuserdatad/xcschemes/SSASideMenuStoryboardExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![SSASideMenu](https://github.com/SSA111/SSASideMenu/blob/master/SSASideMenuCover.png) 2 | 3 | [![](http://img.shields.io/badge/iOS-8.0%2B-blue.svg)]() [![](http://img.shields.io/badge/Swift-3.0-blue.svg)]() 4 | 5 | SSASideMenu is a reimplementation of 6 | [romaonthego/RESideMenu](https://github.com/romaonthego/RESideMenu) in 7 | Swift. A iOS 7/8 style side menu with parallax effect. 8 | 9 | ![](https://github.com/SSA111/SSASideMenu/blob/master/LeftDemo.gif) 10 | ![](https://github.com/SSA111/SSASideMenu/blob/master/RightDemo.gif) 11 | 12 | 13 | ###Usage 14 | 15 | ```swift 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 17 | 18 | window = UIWindow(frame: UIScreen.main.bounds) 19 | 20 | //MARK : Setup SSASideMenu 21 | 22 | let sideMenu = SSASideMenu(contentViewController: UINavigationController(rootViewController: FirstViewController()), leftMenuViewController: LeftMenuViewController(), rightMenuViewController: RightMenuViewController()) 23 | sideMenu.backgroundImage = UIImage(named: "Background.jpg") 24 | sideMenu.configure(SSASideMenu.MenuViewEffect(fade: true, scale: true, scaleBackground: false)) 25 | sideMenu.configure(SSASideMenu.ContentViewEffect(alpha: 1.0, scale: 0.7)) 26 | sideMenu.configure(SSASideMenu.ContentViewShadow(enabled: true, color: UIColor.black, opacity: 0.6, radius: 6.0)) 27 | sideMenu.delegate = self 28 | 29 | window?.rootViewController = sideMenu 30 | window?.makeKeyAndVisible() 31 | 32 | return true 33 | } 34 | ``` 35 | ###Installation 36 | As for now please clone the repository and drag the source folder into your project to use SSASideMenu. (Cocoapods & Carthage 37 | support coming soon) 38 | ###Customization 39 | ```swift 40 | 41 | enum SSASideMenuPanDirection: Int { 42 | case edge = 0 43 | case everyWhere = 1 44 | } 45 | 46 | enum SSASideMenuType: Int { 47 | case scale = 0 48 | case slip = 1 49 | } 50 | 51 | enum SSAStatusBarStyle: Int { 52 | case hidden = 0 53 | case black = 1 54 | case light = 2 55 | } 56 | 57 | 58 | struct ContentViewShadow { 59 | 60 | var enabled: Bool = true 61 | var color: UIColor = UIColor.black 62 | var offset: CGSize = CGSize.zero 63 | var opacity: Float = 0.4 64 | var radius: Float = 8.0 65 | 66 | } 67 | 68 | struct MenuViewEffect { 69 | 70 | var fade: Bool = true 71 | var scale: Bool = true 72 | var scaleBackground: Bool = true 73 | var parallaxEnabled: Bool = true 74 | var bouncesHorizontally: Bool = true 75 | var statusBarStyle: SSAStatusBarStyle = .black 76 | } 77 | 78 | struct ContentViewEffect { 79 | 80 | var alpha: Float = 1.0 81 | var scale: Float = 0.7 82 | var landscapeOffsetX: Float = 30 83 | var portraitOffsetX: Float = 30 84 | var minParallaxContentRelativeValue: Float = -25.0 85 | var maxParallaxContentRelativeValue: Float = 25.0 86 | var interactivePopGestureRecognizerEnabled: Bool = true 87 | } 88 | 89 | struct SideMenuOptions { 90 | 91 | var animationDuration: Float = 0.35 92 | var panGestureEnabled: Bool = true 93 | var panDirection: SSASideMenuPanDirection = .edge 94 | var type: SSASideMenuType = .scale 95 | var panMinimumOpenThreshold: UInt = 60 96 | var menuViewControllerTransformation: CGAffineTransform = CGAffineTransform.init(scaleX: 1.5, y: 1.5) 97 | var backgroundTransformation: CGAffineTransform = CGAffineTransform.init(scaleX: 1.7, y: 1.7) 98 | var endAllEditing: Bool = false 99 | } 100 | 101 | 102 | // MARK : Storyboard Support 103 | @IBInspectable var contentViewStoryboardID: String? 104 | @IBInspectable var leftMenuViewStoryboardID: String? 105 | @IBInspectable var rightMenuViewStoryboardID: String? 106 | 107 | // MARK : Private Properties: MenuView & BackgroundImageView 108 | @IBInspectable var fadeMenuView: Bool = true 109 | @IBInspectable var scaleMenuView: Bool = true 110 | @IBInspectable var scaleBackgroundImageView: Bool = true 111 | @IBInspectable var parallaxEnabled: Bool = false 112 | @IBInspectable var bouncesHorizontally: Bool = true 113 | 114 | // MARK : Public Properties: MenuView 115 | @IBInspectable var statusBarStyle: SSAStatusBarStyle = .black 116 | 117 | // MARK : Private Properties: ContentView 118 | @IBInspectable var contentViewScaleValue: Float = 0.7 119 | @IBInspectable var contentViewFadeOutAlpha: Float = 1.0 120 | @IBInspectable var contentViewInLandscapeOffsetCenterX: Float = 30.0 121 | @IBInspectable var contentViewInPortraitOffsetCenterX: Float = 30.0 122 | @IBInspectable var parallaxContentMinimumRelativeValue: Float = -25.0 123 | @IBInspectable var parallaxContentMaximumRelativeValue: Float = 25.0 124 | 125 | // MARK : Public Properties: ContentView 126 | @IBInspectable var interactivePopGestureRecognizerEnabled: Bool = true 127 | @IBInspectable var endAllEditing: Bool = false 128 | 129 | // MARK : Private Properties: Shadow for ContentView 130 | @IBInspectable var contentViewShadowEnabled: Bool = true 131 | @IBInspectable var contentViewShadowColor: UIColor = UIColor.black 132 | @IBInspectable var contentViewShadowOffset: CGSize = CGSize.zero 133 | @IBInspectable var contentViewShadowOpacity: Float = 0.4 134 | @IBInspectable var contentViewShadowRadius: Float = 8.0 135 | 136 | // MARK : Public Properties: SideMenu 137 | @IBInspectable var animationDuration: Float = 0.35 138 | @IBInspectable var panGestureEnabled: Bool = true 139 | @IBInspectable var panDirection: SSASideMenuPanDirection = .edge 140 | @IBInspectable var type: SSASideMenuType = .scale 141 | @IBInspectable var panMinimumOpenThreshold: UInt = 60 142 | @IBInspectable var menuViewControllerTransformation: CGAffineTransform = CGAffineTransform(scaleX: 1.5, y:1.5) 143 | @IBInspectable var backgroundTransformation: CGAffineTransform = CGAffineTransform(scaleX: 1.7, y:1.7) 144 | 145 | // MARK : Public Properties 146 | weak var delegate: SSASideMenuDelegate? 147 | var backgroundImage: UIImage? 148 | var contentViewController: UIViewController? 149 | var leftMenuViewController: UIViewController? 150 | var rightMenuViewController: UIViewController? 151 | ``` 152 | 153 | ###Author 154 | 155 | Sebastian Andersen 156 | 157 | [romaonthego/RESideMenu](https://github.com/romaonthego/RESideMenu) was 158 | authored by Roman Efimov 159 | 160 | ###License 161 | 162 | SSASideMenu is available under the MIT license. See the LICENSE file for more info. 163 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample/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 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /Examples/Simple/SSASideMenuExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | DC4C1AA81AA7461E00ACD446 /* SSASideMenuExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC4C1AA71AA7461E00ACD446 /* SSASideMenuExampleTests.swift */; }; 11 | DC4C1AB81AA7465B00ACD446 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC4C1AB21AA7465B00ACD446 /* AppDelegate.swift */; }; 12 | DC4C1AB91AA7465B00ACD446 /* FirstViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC4C1AB31AA7465B00ACD446 /* FirstViewController.swift */; }; 13 | DC4C1ABA1AA7465B00ACD446 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DC4C1AB41AA7465B00ACD446 /* Images.xcassets */; }; 14 | DC4C1ABB1AA7465B00ACD446 /* LeftMenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC4C1AB51AA7465B00ACD446 /* LeftMenuViewController.swift */; }; 15 | DC4C1ABC1AA7465B00ACD446 /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC4C1AB61AA7465B00ACD446 /* SecondViewController.swift */; }; 16 | DC69ABD81AAA075F00CD5D7A /* RightMenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC69ABD71AAA075F00CD5D7A /* RightMenuViewController.swift */; }; 17 | DC8F15FF1AE94740009CC3C3 /* SSASideMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC8F15FE1AE94740009CC3C3 /* SSASideMenu.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | DC4C1AA21AA7461E00ACD446 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = DC4C1A841AA7461E00ACD446 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = DC4C1A8B1AA7461E00ACD446; 26 | remoteInfo = SSASideMenuExample; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | DC4C1A8C1AA7461E00ACD446 /* SSASideMenuExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SSASideMenuExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | DC4C1AA11AA7461E00ACD446 /* SSASideMenuExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SSASideMenuExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | DC4C1AA71AA7461E00ACD446 /* SSASideMenuExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSASideMenuExampleTests.swift; sourceTree = ""; }; 34 | DC4C1AB21AA7465B00ACD446 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 35 | DC4C1AB31AA7465B00ACD446 /* FirstViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FirstViewController.swift; sourceTree = ""; }; 36 | DC4C1AB41AA7465B00ACD446 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 37 | DC4C1AB51AA7465B00ACD446 /* LeftMenuViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LeftMenuViewController.swift; sourceTree = ""; }; 38 | DC4C1AB61AA7465B00ACD446 /* SecondViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = ""; }; 39 | DC69ABD71AAA075F00CD5D7A /* RightMenuViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RightMenuViewController.swift; sourceTree = ""; }; 40 | DC8F15FE1AE94740009CC3C3 /* SSASideMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SSASideMenu.swift; sourceTree = ""; }; 41 | DCC042591AA8BE1C008428B0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 42 | DCC0425B1AA8BE31008428B0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | DC4C1A891AA7461E00ACD446 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | DC4C1A9E1AA7461E00ACD446 /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | /* End PBXFrameworksBuildPhase section */ 61 | 62 | /* Begin PBXGroup section */ 63 | DC4C1A831AA7461E00ACD446 = { 64 | isa = PBXGroup; 65 | children = ( 66 | DC4C1A8E1AA7461E00ACD446 /* SSASideMenuExample */, 67 | DC4C1AA41AA7461E00ACD446 /* SSASideMenuExampleTests */, 68 | DC4C1A8D1AA7461E00ACD446 /* Products */, 69 | ); 70 | sourceTree = ""; 71 | }; 72 | DC4C1A8D1AA7461E00ACD446 /* Products */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | DC4C1A8C1AA7461E00ACD446 /* SSASideMenuExample.app */, 76 | DC4C1AA11AA7461E00ACD446 /* SSASideMenuExampleTests.xctest */, 77 | ); 78 | name = Products; 79 | sourceTree = ""; 80 | }; 81 | DC4C1A8E1AA7461E00ACD446 /* SSASideMenuExample */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | DC8F15FD1AE94738009CC3C3 /* SSASideMenu */, 85 | DC4C1AB21AA7465B00ACD446 /* AppDelegate.swift */, 86 | DC4C1AB31AA7465B00ACD446 /* FirstViewController.swift */, 87 | DC4C1AB61AA7465B00ACD446 /* SecondViewController.swift */, 88 | DC4C1AB51AA7465B00ACD446 /* LeftMenuViewController.swift */, 89 | DC69ABD71AAA075F00CD5D7A /* RightMenuViewController.swift */, 90 | DC4C1AB41AA7465B00ACD446 /* Images.xcassets */, 91 | DC4C1A8F1AA7461E00ACD446 /* Supporting Files */, 92 | ); 93 | path = SSASideMenuExample; 94 | sourceTree = ""; 95 | }; 96 | DC4C1A8F1AA7461E00ACD446 /* Supporting Files */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | DCC0425B1AA8BE31008428B0 /* Info.plist */, 100 | ); 101 | name = "Supporting Files"; 102 | sourceTree = ""; 103 | }; 104 | DC4C1AA41AA7461E00ACD446 /* SSASideMenuExampleTests */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | DC4C1AA71AA7461E00ACD446 /* SSASideMenuExampleTests.swift */, 108 | DC4C1AA51AA7461E00ACD446 /* Supporting Files */, 109 | ); 110 | path = SSASideMenuExampleTests; 111 | sourceTree = ""; 112 | }; 113 | DC4C1AA51AA7461E00ACD446 /* Supporting Files */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | DCC042591AA8BE1C008428B0 /* Info.plist */, 117 | ); 118 | name = "Supporting Files"; 119 | sourceTree = ""; 120 | }; 121 | DC8F15FD1AE94738009CC3C3 /* SSASideMenu */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | DC8F15FE1AE94740009CC3C3 /* SSASideMenu.swift */, 125 | ); 126 | name = SSASideMenu; 127 | sourceTree = ""; 128 | }; 129 | /* End PBXGroup section */ 130 | 131 | /* Begin PBXNativeTarget section */ 132 | DC4C1A8B1AA7461E00ACD446 /* SSASideMenuExample */ = { 133 | isa = PBXNativeTarget; 134 | buildConfigurationList = DC4C1AAB1AA7461E00ACD446 /* Build configuration list for PBXNativeTarget "SSASideMenuExample" */; 135 | buildPhases = ( 136 | DC4C1A881AA7461E00ACD446 /* Sources */, 137 | DC4C1A891AA7461E00ACD446 /* Frameworks */, 138 | DC4C1A8A1AA7461E00ACD446 /* Resources */, 139 | ); 140 | buildRules = ( 141 | ); 142 | dependencies = ( 143 | ); 144 | name = SSASideMenuExample; 145 | productName = SSASideMenuExample; 146 | productReference = DC4C1A8C1AA7461E00ACD446 /* SSASideMenuExample.app */; 147 | productType = "com.apple.product-type.application"; 148 | }; 149 | DC4C1AA01AA7461E00ACD446 /* SSASideMenuExampleTests */ = { 150 | isa = PBXNativeTarget; 151 | buildConfigurationList = DC4C1AAE1AA7461E00ACD446 /* Build configuration list for PBXNativeTarget "SSASideMenuExampleTests" */; 152 | buildPhases = ( 153 | DC4C1A9D1AA7461E00ACD446 /* Sources */, 154 | DC4C1A9E1AA7461E00ACD446 /* Frameworks */, 155 | DC4C1A9F1AA7461E00ACD446 /* Resources */, 156 | ); 157 | buildRules = ( 158 | ); 159 | dependencies = ( 160 | DC4C1AA31AA7461E00ACD446 /* PBXTargetDependency */, 161 | ); 162 | name = SSASideMenuExampleTests; 163 | productName = SSASideMenuExampleTests; 164 | productReference = DC4C1AA11AA7461E00ACD446 /* SSASideMenuExampleTests.xctest */; 165 | productType = "com.apple.product-type.bundle.unit-test"; 166 | }; 167 | /* End PBXNativeTarget section */ 168 | 169 | /* Begin PBXProject section */ 170 | DC4C1A841AA7461E00ACD446 /* Project object */ = { 171 | isa = PBXProject; 172 | attributes = { 173 | LastSwiftMigration = 0700; 174 | LastSwiftUpdateCheck = 0700; 175 | LastUpgradeCheck = 0820; 176 | ORGANIZATIONNAME = SebastianAndersen; 177 | TargetAttributes = { 178 | DC4C1A8B1AA7461E00ACD446 = { 179 | CreatedOnToolsVersion = 6.1.1; 180 | LastSwiftMigration = 0820; 181 | }; 182 | DC4C1AA01AA7461E00ACD446 = { 183 | CreatedOnToolsVersion = 6.1.1; 184 | LastSwiftMigration = 0820; 185 | TestTargetID = DC4C1A8B1AA7461E00ACD446; 186 | }; 187 | }; 188 | }; 189 | buildConfigurationList = DC4C1A871AA7461E00ACD446 /* Build configuration list for PBXProject "SSASideMenuExample" */; 190 | compatibilityVersion = "Xcode 3.2"; 191 | developmentRegion = English; 192 | hasScannedForEncodings = 0; 193 | knownRegions = ( 194 | en, 195 | Base, 196 | ); 197 | mainGroup = DC4C1A831AA7461E00ACD446; 198 | productRefGroup = DC4C1A8D1AA7461E00ACD446 /* Products */; 199 | projectDirPath = ""; 200 | projectRoot = ""; 201 | targets = ( 202 | DC4C1A8B1AA7461E00ACD446 /* SSASideMenuExample */, 203 | DC4C1AA01AA7461E00ACD446 /* SSASideMenuExampleTests */, 204 | ); 205 | }; 206 | /* End PBXProject section */ 207 | 208 | /* Begin PBXResourcesBuildPhase section */ 209 | DC4C1A8A1AA7461E00ACD446 /* Resources */ = { 210 | isa = PBXResourcesBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | DC4C1ABA1AA7465B00ACD446 /* Images.xcassets in Resources */, 214 | ); 215 | runOnlyForDeploymentPostprocessing = 0; 216 | }; 217 | DC4C1A9F1AA7461E00ACD446 /* Resources */ = { 218 | isa = PBXResourcesBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | /* End PBXResourcesBuildPhase section */ 225 | 226 | /* Begin PBXSourcesBuildPhase section */ 227 | DC4C1A881AA7461E00ACD446 /* Sources */ = { 228 | isa = PBXSourcesBuildPhase; 229 | buildActionMask = 2147483647; 230 | files = ( 231 | DC4C1AB81AA7465B00ACD446 /* AppDelegate.swift in Sources */, 232 | DC4C1ABC1AA7465B00ACD446 /* SecondViewController.swift in Sources */, 233 | DC4C1AB91AA7465B00ACD446 /* FirstViewController.swift in Sources */, 234 | DC8F15FF1AE94740009CC3C3 /* SSASideMenu.swift in Sources */, 235 | DC69ABD81AAA075F00CD5D7A /* RightMenuViewController.swift in Sources */, 236 | DC4C1ABB1AA7465B00ACD446 /* LeftMenuViewController.swift in Sources */, 237 | ); 238 | runOnlyForDeploymentPostprocessing = 0; 239 | }; 240 | DC4C1A9D1AA7461E00ACD446 /* Sources */ = { 241 | isa = PBXSourcesBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | DC4C1AA81AA7461E00ACD446 /* SSASideMenuExampleTests.swift in Sources */, 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | }; 248 | /* End PBXSourcesBuildPhase section */ 249 | 250 | /* Begin PBXTargetDependency section */ 251 | DC4C1AA31AA7461E00ACD446 /* PBXTargetDependency */ = { 252 | isa = PBXTargetDependency; 253 | target = DC4C1A8B1AA7461E00ACD446 /* SSASideMenuExample */; 254 | targetProxy = DC4C1AA21AA7461E00ACD446 /* PBXContainerItemProxy */; 255 | }; 256 | /* End PBXTargetDependency section */ 257 | 258 | /* Begin XCBuildConfiguration section */ 259 | DC4C1AA91AA7461E00ACD446 /* Debug */ = { 260 | isa = XCBuildConfiguration; 261 | buildSettings = { 262 | ALWAYS_SEARCH_USER_PATHS = NO; 263 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 264 | CLANG_CXX_LIBRARY = "libc++"; 265 | CLANG_ENABLE_MODULES = YES; 266 | CLANG_ENABLE_OBJC_ARC = YES; 267 | CLANG_WARN_BOOL_CONVERSION = YES; 268 | CLANG_WARN_CONSTANT_CONVERSION = YES; 269 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 270 | CLANG_WARN_EMPTY_BODY = YES; 271 | CLANG_WARN_ENUM_CONVERSION = YES; 272 | CLANG_WARN_INFINITE_RECURSION = YES; 273 | CLANG_WARN_INT_CONVERSION = YES; 274 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 275 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 276 | CLANG_WARN_UNREACHABLE_CODE = YES; 277 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 278 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 279 | COPY_PHASE_STRIP = NO; 280 | ENABLE_STRICT_OBJC_MSGSEND = YES; 281 | ENABLE_TESTABILITY = YES; 282 | GCC_C_LANGUAGE_STANDARD = gnu99; 283 | GCC_DYNAMIC_NO_PIC = NO; 284 | GCC_NO_COMMON_BLOCKS = YES; 285 | GCC_OPTIMIZATION_LEVEL = 0; 286 | GCC_PREPROCESSOR_DEFINITIONS = ( 287 | "DEBUG=1", 288 | "$(inherited)", 289 | ); 290 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 291 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 292 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 293 | GCC_WARN_UNDECLARED_SELECTOR = YES; 294 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 295 | GCC_WARN_UNUSED_FUNCTION = YES; 296 | GCC_WARN_UNUSED_VARIABLE = YES; 297 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 298 | MTL_ENABLE_DEBUG_INFO = YES; 299 | ONLY_ACTIVE_ARCH = YES; 300 | SDKROOT = iphoneos; 301 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 302 | }; 303 | name = Debug; 304 | }; 305 | DC4C1AAA1AA7461E00ACD446 /* Release */ = { 306 | isa = XCBuildConfiguration; 307 | buildSettings = { 308 | ALWAYS_SEARCH_USER_PATHS = NO; 309 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 310 | CLANG_CXX_LIBRARY = "libc++"; 311 | CLANG_ENABLE_MODULES = YES; 312 | CLANG_ENABLE_OBJC_ARC = YES; 313 | CLANG_WARN_BOOL_CONVERSION = YES; 314 | CLANG_WARN_CONSTANT_CONVERSION = YES; 315 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 316 | CLANG_WARN_EMPTY_BODY = YES; 317 | CLANG_WARN_ENUM_CONVERSION = YES; 318 | CLANG_WARN_INFINITE_RECURSION = YES; 319 | CLANG_WARN_INT_CONVERSION = YES; 320 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 321 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 322 | CLANG_WARN_UNREACHABLE_CODE = YES; 323 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 324 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 325 | COPY_PHASE_STRIP = YES; 326 | ENABLE_NS_ASSERTIONS = NO; 327 | ENABLE_STRICT_OBJC_MSGSEND = YES; 328 | GCC_C_LANGUAGE_STANDARD = gnu99; 329 | GCC_NO_COMMON_BLOCKS = YES; 330 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 331 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 332 | GCC_WARN_UNDECLARED_SELECTOR = YES; 333 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 334 | GCC_WARN_UNUSED_FUNCTION = YES; 335 | GCC_WARN_UNUSED_VARIABLE = YES; 336 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 337 | MTL_ENABLE_DEBUG_INFO = NO; 338 | SDKROOT = iphoneos; 339 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 340 | VALIDATE_PRODUCT = YES; 341 | }; 342 | name = Release; 343 | }; 344 | DC4C1AAC1AA7461E00ACD446 /* Debug */ = { 345 | isa = XCBuildConfiguration; 346 | buildSettings = { 347 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 348 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 349 | CLANG_ENABLE_MODULES = YES; 350 | CODE_SIGN_IDENTITY = "iPhone Developer"; 351 | INFOPLIST_FILE = SSASideMenuExample/Info.plist; 352 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 353 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 354 | PRODUCT_BUNDLE_IDENTIFIER = "SebastianAndersen.$(PRODUCT_NAME:rfc1034identifier)"; 355 | PRODUCT_NAME = "$(TARGET_NAME)"; 356 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 357 | SWIFT_VERSION = 3.0; 358 | }; 359 | name = Debug; 360 | }; 361 | DC4C1AAD1AA7461E00ACD446 /* Release */ = { 362 | isa = XCBuildConfiguration; 363 | buildSettings = { 364 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 365 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 366 | CLANG_ENABLE_MODULES = YES; 367 | CODE_SIGN_IDENTITY = "iPhone Developer"; 368 | INFOPLIST_FILE = SSASideMenuExample/Info.plist; 369 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 370 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 371 | PRODUCT_BUNDLE_IDENTIFIER = "SebastianAndersen.$(PRODUCT_NAME:rfc1034identifier)"; 372 | PRODUCT_NAME = "$(TARGET_NAME)"; 373 | SWIFT_VERSION = 3.0; 374 | }; 375 | name = Release; 376 | }; 377 | DC4C1AAF1AA7461E00ACD446 /* Debug */ = { 378 | isa = XCBuildConfiguration; 379 | buildSettings = { 380 | BUNDLE_LOADER = "$(TEST_HOST)"; 381 | FRAMEWORK_SEARCH_PATHS = ( 382 | "$(SDKROOT)/Developer/Library/Frameworks", 383 | "$(inherited)", 384 | ); 385 | GCC_PREPROCESSOR_DEFINITIONS = ( 386 | "DEBUG=1", 387 | "$(inherited)", 388 | ); 389 | INFOPLIST_FILE = SSASideMenuExampleTests/Info.plist; 390 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 391 | PRODUCT_BUNDLE_IDENTIFIER = "SebastianAndersen.$(PRODUCT_NAME:rfc1034identifier)"; 392 | PRODUCT_NAME = "$(TARGET_NAME)"; 393 | SWIFT_VERSION = 3.0; 394 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SSASideMenuExample.app/SSASideMenuExample"; 395 | }; 396 | name = Debug; 397 | }; 398 | DC4C1AB01AA7461E00ACD446 /* Release */ = { 399 | isa = XCBuildConfiguration; 400 | buildSettings = { 401 | BUNDLE_LOADER = "$(TEST_HOST)"; 402 | FRAMEWORK_SEARCH_PATHS = ( 403 | "$(SDKROOT)/Developer/Library/Frameworks", 404 | "$(inherited)", 405 | ); 406 | INFOPLIST_FILE = SSASideMenuExampleTests/Info.plist; 407 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 408 | PRODUCT_BUNDLE_IDENTIFIER = "SebastianAndersen.$(PRODUCT_NAME:rfc1034identifier)"; 409 | PRODUCT_NAME = "$(TARGET_NAME)"; 410 | SWIFT_VERSION = 3.0; 411 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SSASideMenuExample.app/SSASideMenuExample"; 412 | }; 413 | name = Release; 414 | }; 415 | /* End XCBuildConfiguration section */ 416 | 417 | /* Begin XCConfigurationList section */ 418 | DC4C1A871AA7461E00ACD446 /* Build configuration list for PBXProject "SSASideMenuExample" */ = { 419 | isa = XCConfigurationList; 420 | buildConfigurations = ( 421 | DC4C1AA91AA7461E00ACD446 /* Debug */, 422 | DC4C1AAA1AA7461E00ACD446 /* Release */, 423 | ); 424 | defaultConfigurationIsVisible = 0; 425 | defaultConfigurationName = Release; 426 | }; 427 | DC4C1AAB1AA7461E00ACD446 /* Build configuration list for PBXNativeTarget "SSASideMenuExample" */ = { 428 | isa = XCConfigurationList; 429 | buildConfigurations = ( 430 | DC4C1AAC1AA7461E00ACD446 /* Debug */, 431 | DC4C1AAD1AA7461E00ACD446 /* Release */, 432 | ); 433 | defaultConfigurationIsVisible = 0; 434 | defaultConfigurationName = Release; 435 | }; 436 | DC4C1AAE1AA7461E00ACD446 /* Build configuration list for PBXNativeTarget "SSASideMenuExampleTests" */ = { 437 | isa = XCConfigurationList; 438 | buildConfigurations = ( 439 | DC4C1AAF1AA7461E00ACD446 /* Debug */, 440 | DC4C1AB01AA7461E00ACD446 /* Release */, 441 | ); 442 | defaultConfigurationIsVisible = 0; 443 | defaultConfigurationName = Release; 444 | }; 445 | /* End XCConfigurationList section */ 446 | }; 447 | rootObject = DC4C1A841AA7461E00ACD446 /* Project object */; 448 | } 449 | -------------------------------------------------------------------------------- /Examples/Storyboard/SSASideMenuStoryboardExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | DC00C7691ACC65CD00BB4A99 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC00C7681ACC65CD00BB4A99 /* AppDelegate.swift */; }; 11 | DC00C76E1ACC65CD00BB4A99 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DC00C76C1ACC65CD00BB4A99 /* Main.storyboard */; }; 12 | DC00C7701ACC65CD00BB4A99 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DC00C76F1ACC65CD00BB4A99 /* Images.xcassets */; }; 13 | DC00C7731ACC65CD00BB4A99 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = DC00C7711ACC65CD00BB4A99 /* LaunchScreen.xib */; }; 14 | DC00C77F1ACC65CD00BB4A99 /* SSASideMenuStoryboardExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC00C77E1ACC65CD00BB4A99 /* SSASideMenuStoryboardExampleTests.swift */; }; 15 | DC00C78E1ACC661F00BB4A99 /* FirstViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC00C78A1ACC661F00BB4A99 /* FirstViewController.swift */; }; 16 | DC00C78F1ACC661F00BB4A99 /* LeftMenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC00C78B1ACC661F00BB4A99 /* LeftMenuViewController.swift */; }; 17 | DC00C7901ACC661F00BB4A99 /* RightMenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC00C78C1ACC661F00BB4A99 /* RightMenuViewController.swift */; }; 18 | DC00C7911ACC661F00BB4A99 /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC00C78D1ACC661F00BB4A99 /* SecondViewController.swift */; }; 19 | DC8F15FA1AE94723009CC3C3 /* SSASideMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC8F15F91AE94723009CC3C3 /* SSASideMenu.swift */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | DC00C7791ACC65CD00BB4A99 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = DC00C75B1ACC65CD00BB4A99 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = DC00C7621ACC65CD00BB4A99; 28 | remoteInfo = SSASideMenuStoryboardExample; 29 | }; 30 | /* End PBXContainerItemProxy section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | DC00C7631ACC65CD00BB4A99 /* SSASideMenuStoryboardExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SSASideMenuStoryboardExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | DC00C7671ACC65CD00BB4A99 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | DC00C7681ACC65CD00BB4A99 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 36 | DC00C76D1ACC65CD00BB4A99 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 37 | DC00C76F1ACC65CD00BB4A99 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 38 | DC00C7721ACC65CD00BB4A99 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 39 | DC00C7781ACC65CD00BB4A99 /* SSASideMenuStoryboardExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SSASideMenuStoryboardExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | DC00C77D1ACC65CD00BB4A99 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 41 | DC00C77E1ACC65CD00BB4A99 /* SSASideMenuStoryboardExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSASideMenuStoryboardExampleTests.swift; sourceTree = ""; }; 42 | DC00C78A1ACC661F00BB4A99 /* FirstViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FirstViewController.swift; sourceTree = ""; }; 43 | DC00C78B1ACC661F00BB4A99 /* LeftMenuViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LeftMenuViewController.swift; sourceTree = ""; }; 44 | DC00C78C1ACC661F00BB4A99 /* RightMenuViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RightMenuViewController.swift; sourceTree = ""; }; 45 | DC00C78D1ACC661F00BB4A99 /* SecondViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = ""; }; 46 | DC8F15F91AE94723009CC3C3 /* SSASideMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SSASideMenu.swift; sourceTree = ""; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | DC00C7601ACC65CD00BB4A99 /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | ); 55 | runOnlyForDeploymentPostprocessing = 0; 56 | }; 57 | DC00C7751ACC65CD00BB4A99 /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | /* End PBXFrameworksBuildPhase section */ 65 | 66 | /* Begin PBXGroup section */ 67 | DC00C75A1ACC65CD00BB4A99 = { 68 | isa = PBXGroup; 69 | children = ( 70 | DC00C7651ACC65CD00BB4A99 /* SSASideMenuStoryboardExample */, 71 | DC00C77B1ACC65CD00BB4A99 /* SSASideMenuStoryboardExampleTests */, 72 | DC00C7641ACC65CD00BB4A99 /* Products */, 73 | ); 74 | sourceTree = ""; 75 | }; 76 | DC00C7641ACC65CD00BB4A99 /* Products */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | DC00C7631ACC65CD00BB4A99 /* SSASideMenuStoryboardExample.app */, 80 | DC00C7781ACC65CD00BB4A99 /* SSASideMenuStoryboardExampleTests.xctest */, 81 | ); 82 | name = Products; 83 | sourceTree = ""; 84 | }; 85 | DC00C7651ACC65CD00BB4A99 /* SSASideMenuStoryboardExample */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | DC8F15F81AE946DA009CC3C3 /* SSASideMenu */, 89 | DC00C78A1ACC661F00BB4A99 /* FirstViewController.swift */, 90 | DC00C78B1ACC661F00BB4A99 /* LeftMenuViewController.swift */, 91 | DC00C78C1ACC661F00BB4A99 /* RightMenuViewController.swift */, 92 | DC00C78D1ACC661F00BB4A99 /* SecondViewController.swift */, 93 | DC00C7681ACC65CD00BB4A99 /* AppDelegate.swift */, 94 | DC00C76C1ACC65CD00BB4A99 /* Main.storyboard */, 95 | DC00C76F1ACC65CD00BB4A99 /* Images.xcassets */, 96 | DC00C7711ACC65CD00BB4A99 /* LaunchScreen.xib */, 97 | DC00C7661ACC65CD00BB4A99 /* Supporting Files */, 98 | ); 99 | path = SSASideMenuStoryboardExample; 100 | sourceTree = ""; 101 | }; 102 | DC00C7661ACC65CD00BB4A99 /* Supporting Files */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | DC00C7671ACC65CD00BB4A99 /* Info.plist */, 106 | ); 107 | name = "Supporting Files"; 108 | sourceTree = ""; 109 | }; 110 | DC00C77B1ACC65CD00BB4A99 /* SSASideMenuStoryboardExampleTests */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | DC00C77E1ACC65CD00BB4A99 /* SSASideMenuStoryboardExampleTests.swift */, 114 | DC00C77C1ACC65CD00BB4A99 /* Supporting Files */, 115 | ); 116 | path = SSASideMenuStoryboardExampleTests; 117 | sourceTree = ""; 118 | }; 119 | DC00C77C1ACC65CD00BB4A99 /* Supporting Files */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | DC00C77D1ACC65CD00BB4A99 /* Info.plist */, 123 | ); 124 | name = "Supporting Files"; 125 | sourceTree = ""; 126 | }; 127 | DC8F15F81AE946DA009CC3C3 /* SSASideMenu */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | DC8F15F91AE94723009CC3C3 /* SSASideMenu.swift */, 131 | ); 132 | name = SSASideMenu; 133 | sourceTree = ""; 134 | }; 135 | /* End PBXGroup section */ 136 | 137 | /* Begin PBXNativeTarget section */ 138 | DC00C7621ACC65CD00BB4A99 /* SSASideMenuStoryboardExample */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = DC00C7821ACC65CD00BB4A99 /* Build configuration list for PBXNativeTarget "SSASideMenuStoryboardExample" */; 141 | buildPhases = ( 142 | DC00C75F1ACC65CD00BB4A99 /* Sources */, 143 | DC00C7601ACC65CD00BB4A99 /* Frameworks */, 144 | DC00C7611ACC65CD00BB4A99 /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | ); 150 | name = SSASideMenuStoryboardExample; 151 | productName = SSASideMenuStoryboardExample; 152 | productReference = DC00C7631ACC65CD00BB4A99 /* SSASideMenuStoryboardExample.app */; 153 | productType = "com.apple.product-type.application"; 154 | }; 155 | DC00C7771ACC65CD00BB4A99 /* SSASideMenuStoryboardExampleTests */ = { 156 | isa = PBXNativeTarget; 157 | buildConfigurationList = DC00C7851ACC65CD00BB4A99 /* Build configuration list for PBXNativeTarget "SSASideMenuStoryboardExampleTests" */; 158 | buildPhases = ( 159 | DC00C7741ACC65CD00BB4A99 /* Sources */, 160 | DC00C7751ACC65CD00BB4A99 /* Frameworks */, 161 | DC00C7761ACC65CD00BB4A99 /* Resources */, 162 | ); 163 | buildRules = ( 164 | ); 165 | dependencies = ( 166 | DC00C77A1ACC65CD00BB4A99 /* PBXTargetDependency */, 167 | ); 168 | name = SSASideMenuStoryboardExampleTests; 169 | productName = SSASideMenuStoryboardExampleTests; 170 | productReference = DC00C7781ACC65CD00BB4A99 /* SSASideMenuStoryboardExampleTests.xctest */; 171 | productType = "com.apple.product-type.bundle.unit-test"; 172 | }; 173 | /* End PBXNativeTarget section */ 174 | 175 | /* Begin PBXProject section */ 176 | DC00C75B1ACC65CD00BB4A99 /* Project object */ = { 177 | isa = PBXProject; 178 | attributes = { 179 | LastSwiftMigration = 0700; 180 | LastSwiftUpdateCheck = 0700; 181 | LastUpgradeCheck = 0820; 182 | ORGANIZATIONNAME = SebastianAndersen; 183 | TargetAttributes = { 184 | DC00C7621ACC65CD00BB4A99 = { 185 | CreatedOnToolsVersion = 6.3; 186 | LastSwiftMigration = 0820; 187 | }; 188 | DC00C7771ACC65CD00BB4A99 = { 189 | CreatedOnToolsVersion = 6.3; 190 | LastSwiftMigration = 0820; 191 | TestTargetID = DC00C7621ACC65CD00BB4A99; 192 | }; 193 | }; 194 | }; 195 | buildConfigurationList = DC00C75E1ACC65CD00BB4A99 /* Build configuration list for PBXProject "SSASideMenuStoryboardExample" */; 196 | compatibilityVersion = "Xcode 3.2"; 197 | developmentRegion = English; 198 | hasScannedForEncodings = 0; 199 | knownRegions = ( 200 | en, 201 | Base, 202 | ); 203 | mainGroup = DC00C75A1ACC65CD00BB4A99; 204 | productRefGroup = DC00C7641ACC65CD00BB4A99 /* Products */; 205 | projectDirPath = ""; 206 | projectRoot = ""; 207 | targets = ( 208 | DC00C7621ACC65CD00BB4A99 /* SSASideMenuStoryboardExample */, 209 | DC00C7771ACC65CD00BB4A99 /* SSASideMenuStoryboardExampleTests */, 210 | ); 211 | }; 212 | /* End PBXProject section */ 213 | 214 | /* Begin PBXResourcesBuildPhase section */ 215 | DC00C7611ACC65CD00BB4A99 /* Resources */ = { 216 | isa = PBXResourcesBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | DC00C76E1ACC65CD00BB4A99 /* Main.storyboard in Resources */, 220 | DC00C7731ACC65CD00BB4A99 /* LaunchScreen.xib in Resources */, 221 | DC00C7701ACC65CD00BB4A99 /* Images.xcassets in Resources */, 222 | ); 223 | runOnlyForDeploymentPostprocessing = 0; 224 | }; 225 | DC00C7761ACC65CD00BB4A99 /* Resources */ = { 226 | isa = PBXResourcesBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | }; 232 | /* End PBXResourcesBuildPhase section */ 233 | 234 | /* Begin PBXSourcesBuildPhase section */ 235 | DC00C75F1ACC65CD00BB4A99 /* Sources */ = { 236 | isa = PBXSourcesBuildPhase; 237 | buildActionMask = 2147483647; 238 | files = ( 239 | DC00C7691ACC65CD00BB4A99 /* AppDelegate.swift in Sources */, 240 | DC00C78E1ACC661F00BB4A99 /* FirstViewController.swift in Sources */, 241 | DC00C7911ACC661F00BB4A99 /* SecondViewController.swift in Sources */, 242 | DC8F15FA1AE94723009CC3C3 /* SSASideMenu.swift in Sources */, 243 | DC00C7901ACC661F00BB4A99 /* RightMenuViewController.swift in Sources */, 244 | DC00C78F1ACC661F00BB4A99 /* LeftMenuViewController.swift in Sources */, 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | }; 248 | DC00C7741ACC65CD00BB4A99 /* Sources */ = { 249 | isa = PBXSourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | DC00C77F1ACC65CD00BB4A99 /* SSASideMenuStoryboardExampleTests.swift in Sources */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | /* End PBXSourcesBuildPhase section */ 257 | 258 | /* Begin PBXTargetDependency section */ 259 | DC00C77A1ACC65CD00BB4A99 /* PBXTargetDependency */ = { 260 | isa = PBXTargetDependency; 261 | target = DC00C7621ACC65CD00BB4A99 /* SSASideMenuStoryboardExample */; 262 | targetProxy = DC00C7791ACC65CD00BB4A99 /* PBXContainerItemProxy */; 263 | }; 264 | /* End PBXTargetDependency section */ 265 | 266 | /* Begin PBXVariantGroup section */ 267 | DC00C76C1ACC65CD00BB4A99 /* Main.storyboard */ = { 268 | isa = PBXVariantGroup; 269 | children = ( 270 | DC00C76D1ACC65CD00BB4A99 /* Base */, 271 | ); 272 | name = Main.storyboard; 273 | sourceTree = ""; 274 | }; 275 | DC00C7711ACC65CD00BB4A99 /* LaunchScreen.xib */ = { 276 | isa = PBXVariantGroup; 277 | children = ( 278 | DC00C7721ACC65CD00BB4A99 /* Base */, 279 | ); 280 | name = LaunchScreen.xib; 281 | sourceTree = ""; 282 | }; 283 | /* End PBXVariantGroup section */ 284 | 285 | /* Begin XCBuildConfiguration section */ 286 | DC00C7801ACC65CD00BB4A99 /* Debug */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | ALWAYS_SEARCH_USER_PATHS = NO; 290 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 291 | CLANG_CXX_LIBRARY = "libc++"; 292 | CLANG_ENABLE_MODULES = YES; 293 | CLANG_ENABLE_OBJC_ARC = YES; 294 | CLANG_WARN_BOOL_CONVERSION = YES; 295 | CLANG_WARN_CONSTANT_CONVERSION = YES; 296 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 297 | CLANG_WARN_EMPTY_BODY = YES; 298 | CLANG_WARN_ENUM_CONVERSION = YES; 299 | CLANG_WARN_INFINITE_RECURSION = YES; 300 | CLANG_WARN_INT_CONVERSION = YES; 301 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 302 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 303 | CLANG_WARN_UNREACHABLE_CODE = YES; 304 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 305 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 306 | COPY_PHASE_STRIP = NO; 307 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 308 | ENABLE_STRICT_OBJC_MSGSEND = YES; 309 | ENABLE_TESTABILITY = YES; 310 | GCC_C_LANGUAGE_STANDARD = gnu99; 311 | GCC_DYNAMIC_NO_PIC = NO; 312 | GCC_NO_COMMON_BLOCKS = YES; 313 | GCC_OPTIMIZATION_LEVEL = 0; 314 | GCC_PREPROCESSOR_DEFINITIONS = ( 315 | "DEBUG=1", 316 | "$(inherited)", 317 | ); 318 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 319 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 320 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 321 | GCC_WARN_UNDECLARED_SELECTOR = YES; 322 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 323 | GCC_WARN_UNUSED_FUNCTION = YES; 324 | GCC_WARN_UNUSED_VARIABLE = YES; 325 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 326 | MTL_ENABLE_DEBUG_INFO = YES; 327 | ONLY_ACTIVE_ARCH = YES; 328 | SDKROOT = iphoneos; 329 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 330 | }; 331 | name = Debug; 332 | }; 333 | DC00C7811ACC65CD00BB4A99 /* Release */ = { 334 | isa = XCBuildConfiguration; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 338 | CLANG_CXX_LIBRARY = "libc++"; 339 | CLANG_ENABLE_MODULES = YES; 340 | CLANG_ENABLE_OBJC_ARC = YES; 341 | CLANG_WARN_BOOL_CONVERSION = YES; 342 | CLANG_WARN_CONSTANT_CONVERSION = YES; 343 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 344 | CLANG_WARN_EMPTY_BODY = YES; 345 | CLANG_WARN_ENUM_CONVERSION = YES; 346 | CLANG_WARN_INFINITE_RECURSION = YES; 347 | CLANG_WARN_INT_CONVERSION = YES; 348 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 349 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 350 | CLANG_WARN_UNREACHABLE_CODE = YES; 351 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 352 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 353 | COPY_PHASE_STRIP = NO; 354 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 355 | ENABLE_NS_ASSERTIONS = NO; 356 | ENABLE_STRICT_OBJC_MSGSEND = YES; 357 | GCC_C_LANGUAGE_STANDARD = gnu99; 358 | GCC_NO_COMMON_BLOCKS = YES; 359 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 360 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 361 | GCC_WARN_UNDECLARED_SELECTOR = YES; 362 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 363 | GCC_WARN_UNUSED_FUNCTION = YES; 364 | GCC_WARN_UNUSED_VARIABLE = YES; 365 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 366 | MTL_ENABLE_DEBUG_INFO = NO; 367 | SDKROOT = iphoneos; 368 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 369 | VALIDATE_PRODUCT = YES; 370 | }; 371 | name = Release; 372 | }; 373 | DC00C7831ACC65CD00BB4A99 /* Debug */ = { 374 | isa = XCBuildConfiguration; 375 | buildSettings = { 376 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 377 | INFOPLIST_FILE = SSASideMenuStoryboardExample/Info.plist; 378 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 379 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 380 | PRODUCT_BUNDLE_IDENTIFIER = "SebastianAndersen.$(PRODUCT_NAME:rfc1034identifier)"; 381 | PRODUCT_NAME = "$(TARGET_NAME)"; 382 | SWIFT_VERSION = 3.0; 383 | }; 384 | name = Debug; 385 | }; 386 | DC00C7841ACC65CD00BB4A99 /* Release */ = { 387 | isa = XCBuildConfiguration; 388 | buildSettings = { 389 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 390 | INFOPLIST_FILE = SSASideMenuStoryboardExample/Info.plist; 391 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 392 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 393 | PRODUCT_BUNDLE_IDENTIFIER = "SebastianAndersen.$(PRODUCT_NAME:rfc1034identifier)"; 394 | PRODUCT_NAME = "$(TARGET_NAME)"; 395 | SWIFT_VERSION = 3.0; 396 | }; 397 | name = Release; 398 | }; 399 | DC00C7861ACC65CD00BB4A99 /* Debug */ = { 400 | isa = XCBuildConfiguration; 401 | buildSettings = { 402 | BUNDLE_LOADER = "$(TEST_HOST)"; 403 | FRAMEWORK_SEARCH_PATHS = ( 404 | "$(SDKROOT)/Developer/Library/Frameworks", 405 | "$(inherited)", 406 | ); 407 | GCC_PREPROCESSOR_DEFINITIONS = ( 408 | "DEBUG=1", 409 | "$(inherited)", 410 | ); 411 | INFOPLIST_FILE = SSASideMenuStoryboardExampleTests/Info.plist; 412 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 413 | PRODUCT_BUNDLE_IDENTIFIER = "SebastianAndersen.$(PRODUCT_NAME:rfc1034identifier)"; 414 | PRODUCT_NAME = "$(TARGET_NAME)"; 415 | SWIFT_VERSION = 3.0; 416 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SSASideMenuStoryboardExample.app/SSASideMenuStoryboardExample"; 417 | }; 418 | name = Debug; 419 | }; 420 | DC00C7871ACC65CD00BB4A99 /* Release */ = { 421 | isa = XCBuildConfiguration; 422 | buildSettings = { 423 | BUNDLE_LOADER = "$(TEST_HOST)"; 424 | FRAMEWORK_SEARCH_PATHS = ( 425 | "$(SDKROOT)/Developer/Library/Frameworks", 426 | "$(inherited)", 427 | ); 428 | INFOPLIST_FILE = SSASideMenuStoryboardExampleTests/Info.plist; 429 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 430 | PRODUCT_BUNDLE_IDENTIFIER = "SebastianAndersen.$(PRODUCT_NAME:rfc1034identifier)"; 431 | PRODUCT_NAME = "$(TARGET_NAME)"; 432 | SWIFT_VERSION = 3.0; 433 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SSASideMenuStoryboardExample.app/SSASideMenuStoryboardExample"; 434 | }; 435 | name = Release; 436 | }; 437 | /* End XCBuildConfiguration section */ 438 | 439 | /* Begin XCConfigurationList section */ 440 | DC00C75E1ACC65CD00BB4A99 /* Build configuration list for PBXProject "SSASideMenuStoryboardExample" */ = { 441 | isa = XCConfigurationList; 442 | buildConfigurations = ( 443 | DC00C7801ACC65CD00BB4A99 /* Debug */, 444 | DC00C7811ACC65CD00BB4A99 /* Release */, 445 | ); 446 | defaultConfigurationIsVisible = 0; 447 | defaultConfigurationName = Release; 448 | }; 449 | DC00C7821ACC65CD00BB4A99 /* Build configuration list for PBXNativeTarget "SSASideMenuStoryboardExample" */ = { 450 | isa = XCConfigurationList; 451 | buildConfigurations = ( 452 | DC00C7831ACC65CD00BB4A99 /* Debug */, 453 | DC00C7841ACC65CD00BB4A99 /* Release */, 454 | ); 455 | defaultConfigurationIsVisible = 0; 456 | defaultConfigurationName = Release; 457 | }; 458 | DC00C7851ACC65CD00BB4A99 /* Build configuration list for PBXNativeTarget "SSASideMenuStoryboardExampleTests" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | DC00C7861ACC65CD00BB4A99 /* Debug */, 462 | DC00C7871ACC65CD00BB4A99 /* Release */, 463 | ); 464 | defaultConfigurationIsVisible = 0; 465 | defaultConfigurationName = Release; 466 | }; 467 | /* End XCConfigurationList section */ 468 | }; 469 | rootObject = DC00C75B1ACC65CD00BB4A99 /* Project object */; 470 | } 471 | -------------------------------------------------------------------------------- /SSASideMenu/SSASideMenu.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SSASideMenu.swift 3 | // SSASideMenuExample 4 | // 5 | // Created by Sebastian Andersen on 06/10/14. 6 | // Copyright (c) 2015 Sebastian Andersen. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | extension UIViewController { 13 | 14 | var sideMenuViewController: SSASideMenu? { 15 | get { 16 | return getSideViewController(self) 17 | } 18 | } 19 | 20 | fileprivate func getSideViewController(_ viewController: UIViewController) -> SSASideMenu? { 21 | if let parent = viewController.parent { 22 | if parent is SSASideMenu { 23 | return parent as? SSASideMenu 24 | }else { 25 | return getSideViewController(parent) 26 | } 27 | } 28 | return nil 29 | } 30 | 31 | @IBAction func presentLeftMenuViewController() { 32 | 33 | sideMenuViewController?._presentLeftMenuViewController() 34 | } 35 | 36 | @IBAction func presentRightMenuViewController() { 37 | 38 | sideMenuViewController?._presentRightMenuViewController() 39 | } 40 | } 41 | 42 | @objc protocol SSASideMenuDelegate: class { 43 | @objc optional func sideMenuDidRecognizePanGesture(_ sideMenu: SSASideMenu, recongnizer: UIPanGestureRecognizer) 44 | @objc optional func sideMenuWillShowMenuViewController(_ sideMenu: SSASideMenu, menuViewController: UIViewController) 45 | @objc optional func sideMenuDidShowMenuViewController(_ sideMenu: SSASideMenu, menuViewController: UIViewController) 46 | @objc optional func sideMenuWillHideMenuViewController(_ sideMenu: SSASideMenu, menuViewController: UIViewController) 47 | @objc optional func sideMenuDidHideMenuViewController(_ sideMenu: SSASideMenu, menuViewController: UIViewController) 48 | } 49 | 50 | class SSASideMenu: UIViewController, UIGestureRecognizerDelegate { 51 | 52 | enum SSASideMenuPanDirection: Int { 53 | case edge = 0 54 | case everyWhere = 1 55 | } 56 | 57 | enum SSASideMenuType: Int { 58 | case scale = 0 59 | case slip = 1 60 | } 61 | 62 | enum SSAStatusBarStyle: Int { 63 | case hidden = 0 64 | case black = 1 65 | case light = 2 66 | } 67 | 68 | fileprivate enum SSASideMenuSide: Int { 69 | case left = 0 70 | case right = 1 71 | } 72 | 73 | struct ContentViewShadow { 74 | 75 | var enabled: Bool = true 76 | var color: UIColor = UIColor.black 77 | var offset: CGSize = CGSize.zero 78 | var opacity: Float = 0.4 79 | var radius: Float = 8.0 80 | 81 | init(enabled: Bool = true, color: UIColor = UIColor.black, offset: CGSize = CGSize.zero, opacity: Float = 0.4, radius: Float = 8.0) { 82 | 83 | self.enabled = false 84 | self.color = color 85 | self.offset = offset 86 | self.opacity = opacity 87 | self.radius = radius 88 | } 89 | } 90 | 91 | struct MenuViewEffect { 92 | 93 | var fade: Bool = true 94 | var scale: Bool = true 95 | var scaleBackground: Bool = true 96 | var parallaxEnabled: Bool = true 97 | var bouncesHorizontally: Bool = true 98 | var statusBarStyle: SSAStatusBarStyle = .black 99 | 100 | init(fade: Bool = true, scale: Bool = true, scaleBackground: Bool = true, parallaxEnabled: Bool = true, bouncesHorizontally: Bool = true, statusBarStyle: SSAStatusBarStyle = .black) { 101 | 102 | self.fade = fade 103 | self.scale = scale 104 | self.scaleBackground = scaleBackground 105 | self.parallaxEnabled = parallaxEnabled 106 | self.bouncesHorizontally = bouncesHorizontally 107 | self.statusBarStyle = statusBarStyle 108 | } 109 | } 110 | 111 | struct ContentViewEffect { 112 | 113 | var alpha: Float = 1.0 114 | var scale: Float = 0.7 115 | var landscapeOffsetX: Float = 30 116 | var portraitOffsetX: Float = 30 117 | var minParallaxContentRelativeValue: Float = -25.0 118 | var maxParallaxContentRelativeValue: Float = 25.0 119 | var interactivePopGestureRecognizerEnabled: Bool = true 120 | 121 | init(alpha: Float = 1.0, scale: Float = 0.7, landscapeOffsetX: Float = 30, portraitOffsetX: Float = 30, minParallaxContentRelativeValue: Float = -25.0, maxParallaxContentRelativeValue: Float = 25.0, interactivePopGestureRecognizerEnabled: Bool = true) { 122 | 123 | self.alpha = alpha 124 | self.scale = scale 125 | self.landscapeOffsetX = landscapeOffsetX 126 | self.portraitOffsetX = portraitOffsetX 127 | self.minParallaxContentRelativeValue = minParallaxContentRelativeValue 128 | self.maxParallaxContentRelativeValue = maxParallaxContentRelativeValue 129 | self.interactivePopGestureRecognizerEnabled = interactivePopGestureRecognizerEnabled 130 | } 131 | } 132 | 133 | struct SideMenuOptions { 134 | 135 | var animationDuration: Float = 0.35 136 | var panGestureEnabled: Bool = true 137 | var panDirection: SSASideMenuPanDirection = .edge 138 | var type: SSASideMenuType = .scale 139 | var panMinimumOpenThreshold: UInt = 60 140 | var menuViewControllerTransformation: CGAffineTransform = CGAffineTransform.init(scaleX: 1.5, y: 1.5) 141 | var backgroundTransformation: CGAffineTransform = CGAffineTransform.init(scaleX: 1.7, y: 1.7) 142 | var endAllEditing: Bool = false 143 | 144 | init(animationDuration: Float = 0.35, panGestureEnabled: Bool = true, panDirection: SSASideMenuPanDirection = .edge, type: SSASideMenuType = .scale, panMinimumOpenThreshold: UInt = 60, menuViewControllerTransformation: CGAffineTransform = CGAffineTransform(scaleX: 1.5, y: 1.5), backgroundTransformation: CGAffineTransform = CGAffineTransform(scaleX: 1.7, y: 1.7), endAllEditing: Bool = false) { 145 | 146 | self.animationDuration = animationDuration 147 | self.panGestureEnabled = panGestureEnabled 148 | self.panDirection = panDirection 149 | self.type = type 150 | self.panMinimumOpenThreshold = panMinimumOpenThreshold 151 | self.menuViewControllerTransformation = menuViewControllerTransformation 152 | self.backgroundTransformation = backgroundTransformation 153 | self.endAllEditing = endAllEditing 154 | } 155 | } 156 | 157 | func configure(_ configuration: MenuViewEffect) { 158 | fadeMenuView = configuration.fade 159 | scaleMenuView = configuration.scale 160 | scaleBackgroundImageView = configuration.scaleBackground 161 | parallaxEnabled = configuration.parallaxEnabled 162 | bouncesHorizontally = configuration.bouncesHorizontally 163 | } 164 | 165 | func configure(_ configuration: ContentViewShadow) { 166 | contentViewShadowEnabled = configuration.enabled 167 | contentViewShadowColor = configuration.color 168 | contentViewShadowOffset = configuration.offset 169 | contentViewShadowOpacity = configuration.opacity 170 | contentViewShadowRadius = configuration.radius 171 | } 172 | 173 | func configure(_ configuration: ContentViewEffect) { 174 | contentViewScaleValue = configuration.scale 175 | contentViewFadeOutAlpha = configuration.alpha 176 | contentViewInLandscapeOffsetCenterX = configuration.landscapeOffsetX 177 | contentViewInPortraitOffsetCenterX = configuration.portraitOffsetX 178 | parallaxContentMinimumRelativeValue = configuration.minParallaxContentRelativeValue 179 | parallaxContentMaximumRelativeValue = configuration.maxParallaxContentRelativeValue 180 | } 181 | 182 | func configure(_ configuration: SideMenuOptions) { 183 | animationDuration = configuration.animationDuration 184 | panGestureEnabled = configuration.panGestureEnabled 185 | panDirection = configuration.panDirection 186 | type = configuration.type 187 | panMinimumOpenThreshold = configuration.panMinimumOpenThreshold 188 | menuViewControllerTransformation = configuration.menuViewControllerTransformation 189 | backgroundTransformation = configuration.backgroundTransformation 190 | endAllEditing = configuration.endAllEditing 191 | } 192 | 193 | // MARK : Storyboard Support 194 | @IBInspectable var contentViewStoryboardID: String? 195 | @IBInspectable var leftMenuViewStoryboardID: String? 196 | @IBInspectable var rightMenuViewStoryboardID: String? 197 | 198 | // MARK : Private Properties: MenuView & BackgroundImageView 199 | @IBInspectable var fadeMenuView: Bool = true 200 | @IBInspectable var scaleMenuView: Bool = true 201 | @IBInspectable var scaleBackgroundImageView: Bool = true 202 | @IBInspectable var parallaxEnabled: Bool = false 203 | @IBInspectable var bouncesHorizontally: Bool = true 204 | 205 | // MARK : Public Properties: MenuView 206 | @IBInspectable var statusBarStyle: SSAStatusBarStyle = .black 207 | 208 | // MARK : Private Properties: ContentView 209 | @IBInspectable var contentViewScaleValue: Float = 0.7 210 | @IBInspectable var contentViewFadeOutAlpha: Float = 1.0 211 | @IBInspectable var contentViewInLandscapeOffsetCenterX: Float = 30.0 212 | @IBInspectable var contentViewInPortraitOffsetCenterX: Float = 30.0 213 | @IBInspectable var parallaxContentMinimumRelativeValue: Float = -25.0 214 | @IBInspectable var parallaxContentMaximumRelativeValue: Float = 25.0 215 | 216 | // MARK : Public Properties: ContentView 217 | @IBInspectable var interactivePopGestureRecognizerEnabled: Bool = true 218 | @IBInspectable var endAllEditing: Bool = false 219 | 220 | // MARK : Private Properties: Shadow for ContentView 221 | @IBInspectable var contentViewShadowEnabled: Bool = true 222 | @IBInspectable var contentViewShadowColor: UIColor = UIColor.black 223 | @IBInspectable var contentViewShadowOffset: CGSize = CGSize.zero 224 | @IBInspectable var contentViewShadowOpacity: Float = 0.4 225 | @IBInspectable var contentViewShadowRadius: Float = 8.0 226 | 227 | // MARK : Public Properties: SideMenu 228 | @IBInspectable var animationDuration: Float = 0.35 229 | @IBInspectable var panGestureEnabled: Bool = true 230 | @IBInspectable var panDirection: SSASideMenuPanDirection = .edge 231 | @IBInspectable var type: SSASideMenuType = .scale 232 | @IBInspectable var panMinimumOpenThreshold: UInt = 60 233 | @IBInspectable var menuViewControllerTransformation: CGAffineTransform = CGAffineTransform(scaleX: 1.5, y:1.5) 234 | @IBInspectable var backgroundTransformation: CGAffineTransform = CGAffineTransform(scaleX: 1.7, y:1.7) 235 | 236 | // MARK : Internal Private Properties 237 | 238 | weak var delegate: SSASideMenuDelegate? 239 | 240 | fileprivate var visible: Bool = false 241 | fileprivate var leftMenuVisible: Bool = false 242 | fileprivate var rightMenuVisible: Bool = false 243 | fileprivate var originalPoint: CGPoint = CGPoint() 244 | fileprivate var didNotifyDelegate: Bool = false 245 | 246 | fileprivate let iOS8: Bool = kCFCoreFoundationVersionNumber > kCFCoreFoundationVersionNumber_iOS_7_1 247 | 248 | fileprivate let menuViewContainer: UIView = UIView() 249 | fileprivate let contentViewContainer: UIView = UIView() 250 | fileprivate let contentButton: UIButton = UIButton() 251 | 252 | fileprivate let backgroundImageView: UIImageView = UIImageView() 253 | 254 | // MARK : Public Properties 255 | 256 | @IBInspectable var backgroundImage: UIImage? { 257 | willSet { 258 | if let bckImage = newValue { 259 | backgroundImageView.image = bckImage 260 | } 261 | } 262 | } 263 | 264 | var contentViewController: UIViewController? { 265 | willSet { 266 | setupViewController(contentViewContainer, targetViewController: newValue) 267 | } 268 | didSet { 269 | if let controller = oldValue { 270 | hideViewController(controller) 271 | } 272 | setupContentViewShadow() 273 | if visible { 274 | setupContentViewControllerMotionEffects() 275 | } 276 | } 277 | } 278 | 279 | var leftMenuViewController: UIViewController? { 280 | willSet { 281 | setupViewController(menuViewContainer, targetViewController: newValue) 282 | } 283 | didSet { 284 | if let controller = oldValue { 285 | hideViewController(controller) 286 | } 287 | setupMenuViewControllerMotionEffects() 288 | view.bringSubview(toFront: contentViewContainer) 289 | } 290 | } 291 | 292 | var rightMenuViewController: UIViewController? { 293 | willSet { 294 | setupViewController(menuViewContainer, targetViewController: newValue) 295 | } 296 | didSet { 297 | if let controller = oldValue { 298 | hideViewController(controller) 299 | } 300 | setupMenuViewControllerMotionEffects() 301 | view.bringSubview(toFront: contentViewContainer) 302 | } 303 | } 304 | 305 | 306 | // MARK : Initializers 307 | 308 | required init?(coder aDecoder: NSCoder) { 309 | super.init(coder: aDecoder) 310 | } 311 | 312 | override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { 313 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 314 | } 315 | 316 | convenience init(contentViewController: UIViewController, leftMenuViewController: UIViewController) { 317 | self.init() 318 | self.contentViewController = contentViewController 319 | self.leftMenuViewController = leftMenuViewController 320 | 321 | } 322 | 323 | convenience init(contentViewController: UIViewController, rightMenuViewController: UIViewController) { 324 | self.init() 325 | self.contentViewController = contentViewController 326 | self.rightMenuViewController = rightMenuViewController 327 | } 328 | 329 | convenience init(contentViewController: UIViewController, leftMenuViewController: UIViewController, rightMenuViewController: UIViewController) { 330 | self.init() 331 | self.contentViewController = contentViewController 332 | self.leftMenuViewController = leftMenuViewController 333 | self.rightMenuViewController = rightMenuViewController 334 | } 335 | 336 | //MARK : Present / Hide Menu ViewControllers 337 | 338 | func _presentLeftMenuViewController() { 339 | presentMenuViewContainerWithMenuViewController(leftMenuViewController) 340 | showLeftMenuViewController() 341 | } 342 | 343 | func _presentRightMenuViewController() { 344 | presentMenuViewContainerWithMenuViewController(rightMenuViewController) 345 | showRightMenuViewController() 346 | } 347 | 348 | func hideMenuViewController() { 349 | hideMenuViewController(true) 350 | } 351 | 352 | fileprivate func showRightMenuViewController() { 353 | 354 | if let viewController = rightMenuViewController { 355 | 356 | showMenuViewController(.right, menuViewController: viewController) 357 | 358 | UIView.animate(withDuration: TimeInterval(animationDuration), animations: {[unowned self] () -> Void in 359 | 360 | self.animateMenuViewController(.right) 361 | 362 | self.menuViewContainer.alpha = 1 363 | self.contentViewContainer.alpha = CGFloat(self.contentViewFadeOutAlpha) 364 | 365 | 366 | }, completion: {[unowned self] (Bool) -> Void in 367 | self.animateMenuViewControllerCompletion(.right, menuViewController: viewController) 368 | }) 369 | statusBarNeedsAppearanceUpdate() 370 | } 371 | 372 | } 373 | 374 | fileprivate func showLeftMenuViewController() { 375 | 376 | if let viewController = leftMenuViewController { 377 | 378 | showMenuViewController(.left, menuViewController: viewController) 379 | 380 | UIView.animate(withDuration: TimeInterval(animationDuration), animations: {[unowned self] () -> Void in 381 | 382 | self.animateMenuViewController(.left) 383 | 384 | self.menuViewContainer.alpha = 1 385 | self.contentViewContainer.alpha = CGFloat(self.contentViewFadeOutAlpha) 386 | 387 | }, completion: {[unowned self] (Bool) -> Void in 388 | self.animateMenuViewControllerCompletion(.left, menuViewController: viewController) 389 | }) 390 | 391 | statusBarNeedsAppearanceUpdate() 392 | 393 | } 394 | } 395 | 396 | fileprivate func showMenuViewController(_ side: SSASideMenuSide, menuViewController: UIViewController) { 397 | 398 | menuViewController.view.isHidden = false 399 | 400 | switch side { 401 | case .left: 402 | leftMenuViewController?.beginAppearanceTransition(true, animated: true) 403 | rightMenuViewController?.view.isHidden = true 404 | case .right: 405 | rightMenuViewController?.beginAppearanceTransition(true, animated: true) 406 | leftMenuViewController?.view.isHidden = true 407 | } 408 | 409 | if endAllEditing { 410 | view.window?.endEditing(true) 411 | }else { 412 | setupUserInteractionForContentButtonAndTargetViewControllerView(true, targetViewControllerViewInteractive: false) 413 | } 414 | 415 | setupContentButton() 416 | setupContentViewShadow() 417 | resetContentViewScale() 418 | 419 | UIApplication.shared.beginIgnoringInteractionEvents() 420 | } 421 | 422 | 423 | fileprivate func animateMenuViewController(_ side: SSASideMenuSide) { 424 | 425 | if type == .scale { 426 | contentViewContainer.transform = CGAffineTransform(scaleX: CGFloat(contentViewScaleValue), y: CGFloat(contentViewScaleValue)) 427 | } else { 428 | contentViewContainer.transform = CGAffineTransform.identity 429 | } 430 | 431 | if side == .left { 432 | let centerXLandscape = CGFloat(contentViewInLandscapeOffsetCenterX) + (iOS8 ? CGFloat(view.frame.width) : CGFloat(view.frame.height)) 433 | let centerXPortrait = CGFloat(contentViewInPortraitOffsetCenterX) + CGFloat(view.frame.width) 434 | 435 | let centerX = UIInterfaceOrientationIsLandscape(UIApplication.shared.statusBarOrientation) ? centerXLandscape : centerXPortrait 436 | 437 | contentViewContainer.center = CGPoint(x: centerX, y: contentViewContainer.center.y) 438 | // contentViewContainer.frame.origin.x = self.view.frame.width * 0.75 439 | 440 | } else { 441 | 442 | let centerXLandscape = -CGFloat(self.contentViewInLandscapeOffsetCenterX) 443 | let centerXPortrait = CGFloat(-self.contentViewInPortraitOffsetCenterX) 444 | 445 | let centerX = UIInterfaceOrientationIsLandscape(UIApplication.shared.statusBarOrientation) ? centerXLandscape : centerXPortrait 446 | 447 | contentViewContainer.center = CGPoint.init(x: centerX, y: contentViewContainer.center.y) 448 | } 449 | 450 | menuViewContainer.transform = CGAffineTransform.identity 451 | 452 | if scaleBackgroundImageView { 453 | if let _ = backgroundImage { 454 | backgroundImageView.transform = CGAffineTransform.identity 455 | } 456 | } 457 | } 458 | 459 | fileprivate func animateMenuViewControllerCompletion(_ side: SSASideMenuSide, menuViewController: UIViewController) { 460 | 461 | if !visible { 462 | self.delegate?.sideMenuDidShowMenuViewController?(self, menuViewController: menuViewController) 463 | } 464 | 465 | visible = true 466 | 467 | switch side { 468 | case .left: 469 | leftMenuViewController?.endAppearanceTransition() 470 | leftMenuVisible = true 471 | case .right: 472 | if contentViewContainer.frame.size.width == view.bounds.size.width && 473 | contentViewContainer.frame.size.height == view.bounds.size.height && 474 | contentViewContainer.frame.origin.x == 0 && 475 | contentViewContainer.frame.origin.y == 0 { 476 | visible = false 477 | } 478 | rightMenuVisible = visible 479 | rightMenuViewController?.endAppearanceTransition() 480 | } 481 | 482 | 483 | UIApplication.shared.endIgnoringInteractionEvents() 484 | setupContentViewControllerMotionEffects() 485 | } 486 | 487 | fileprivate func presentMenuViewContainerWithMenuViewController(_ menuViewController: UIViewController?) { 488 | 489 | menuViewContainer.transform = CGAffineTransform.identity 490 | menuViewContainer.frame = view.bounds 491 | 492 | if scaleBackgroundImageView { 493 | if backgroundImage != nil { 494 | backgroundImageView.transform = CGAffineTransform.identity 495 | backgroundImageView.frame = view.bounds 496 | backgroundImageView.transform = backgroundTransformation 497 | } 498 | } 499 | 500 | if scaleMenuView { 501 | menuViewContainer.transform = menuViewControllerTransformation 502 | } 503 | menuViewContainer.alpha = fadeMenuView ? 0 : 1 504 | 505 | if let viewController = menuViewController { 506 | delegate?.sideMenuWillShowMenuViewController?(self, menuViewController: viewController) 507 | } 508 | 509 | } 510 | 511 | fileprivate func hideMenuViewController(_ animated: Bool) { 512 | 513 | let isRightMenuVisible: Bool = rightMenuVisible 514 | 515 | let visibleMenuViewController: UIViewController? = isRightMenuVisible ? rightMenuViewController : leftMenuViewController 516 | 517 | visibleMenuViewController?.beginAppearanceTransition(true, animated: true) 518 | 519 | if isRightMenuVisible, let viewController = rightMenuViewController { 520 | delegate?.sideMenuWillHideMenuViewController?(self, menuViewController: viewController) 521 | } 522 | 523 | if !isRightMenuVisible, let viewController = leftMenuViewController { 524 | delegate?.sideMenuWillHideMenuViewController?(self, menuViewController: viewController) 525 | } 526 | 527 | if !endAllEditing { 528 | setupUserInteractionForContentButtonAndTargetViewControllerView(false, targetViewControllerViewInteractive: true) 529 | } 530 | 531 | visible = false 532 | leftMenuVisible = false 533 | rightMenuVisible = false 534 | contentButton.removeFromSuperview() 535 | 536 | let animationsClosure: () -> () = {[unowned self] () -> () in 537 | 538 | self.contentViewContainer.transform = CGAffineTransform.identity 539 | self.contentViewContainer.frame = self.view.bounds 540 | 541 | if self.scaleMenuView { 542 | self.menuViewContainer.transform = self.menuViewControllerTransformation 543 | } 544 | self.menuViewContainer.alpha = self.fadeMenuView ? 0 : 1 545 | self.contentViewContainer.alpha = CGFloat(self.contentViewFadeOutAlpha) 546 | 547 | if self.scaleBackgroundImageView { 548 | if self.backgroundImage != nil { 549 | self.backgroundImageView.transform = self.backgroundTransformation 550 | } 551 | } 552 | if self.parallaxEnabled { 553 | self.removeMotionEffects(self.contentViewContainer) 554 | } 555 | } 556 | 557 | let completionClosure: () -> () = {[unowned self] () -> () in 558 | 559 | visibleMenuViewController?.endAppearanceTransition() 560 | 561 | if isRightMenuVisible, let viewController = self.rightMenuViewController { 562 | self.delegate?.sideMenuDidHideMenuViewController?(self, menuViewController: viewController) 563 | } 564 | 565 | if !isRightMenuVisible, let viewController = self.leftMenuViewController { 566 | self.delegate?.sideMenuDidHideMenuViewController?(self, menuViewController: viewController) 567 | } 568 | } 569 | 570 | if animated { 571 | 572 | UIApplication.shared.beginIgnoringInteractionEvents() 573 | UIView.animate(withDuration: TimeInterval(animationDuration), animations: { () -> Void in 574 | 575 | animationsClosure() 576 | 577 | }, completion: { (Bool) -> Void in 578 | completionClosure() 579 | 580 | UIApplication.shared.endIgnoringInteractionEvents() 581 | }) 582 | }else { 583 | 584 | animationsClosure() 585 | completionClosure() 586 | } 587 | 588 | statusBarNeedsAppearanceUpdate() 589 | } 590 | 591 | // MARK : ViewController life cycle 592 | 593 | override func awakeFromNib() { 594 | super.awakeFromNib() 595 | 596 | if iOS8 { 597 | if let cntentViewStoryboardID = contentViewStoryboardID { 598 | contentViewController = storyboard?.instantiateViewController(withIdentifier: cntentViewStoryboardID) 599 | 600 | } 601 | if let lftViewStoryboardID = leftMenuViewStoryboardID { 602 | leftMenuViewController = storyboard?.instantiateViewController(withIdentifier: lftViewStoryboardID) 603 | } 604 | if let rghtViewStoryboardID = rightMenuViewStoryboardID { 605 | rightMenuViewController = storyboard?.instantiateViewController(withIdentifier: rghtViewStoryboardID) 606 | } 607 | } 608 | } 609 | 610 | override func viewDidLoad() { 611 | super.viewDidLoad() 612 | 613 | view.autoresizingMask = [.flexibleWidth, .flexibleHeight] 614 | 615 | menuViewContainer.frame = view.bounds; 616 | menuViewContainer.autoresizingMask = [.flexibleWidth, .flexibleHeight]; 617 | menuViewContainer.alpha = fadeMenuView ? 0 : 1 618 | 619 | contentViewContainer.frame = view.bounds 620 | contentViewContainer.autoresizingMask = [.flexibleWidth, .flexibleHeight] 621 | 622 | setupViewController(contentViewContainer, targetViewController: contentViewController) 623 | setupViewController(menuViewContainer, targetViewController: leftMenuViewController) 624 | setupViewController(menuViewContainer, targetViewController: rightMenuViewController) 625 | 626 | if panGestureEnabled { 627 | view.isMultipleTouchEnabled = false 628 | let panGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(panGestureRecognized(_:))) 629 | panGestureRecognizer.delegate = self 630 | view.addGestureRecognizer(panGestureRecognizer) 631 | } 632 | 633 | if let _ = backgroundImage { 634 | if scaleBackgroundImageView { 635 | backgroundImageView.transform = backgroundTransformation 636 | } 637 | backgroundImageView.frame = view.bounds 638 | backgroundImageView.contentMode = .scaleAspectFill; 639 | backgroundImageView.autoresizingMask = [.flexibleWidth, .flexibleHeight]; 640 | view.addSubview(backgroundImageView) 641 | } 642 | 643 | view.addSubview(menuViewContainer) 644 | view.addSubview(contentViewContainer) 645 | 646 | setupMenuViewControllerMotionEffects() 647 | setupContentViewShadow() 648 | 649 | } 650 | 651 | // MARK : Setup 652 | 653 | fileprivate func setupViewController(_ targetView: UIView, targetViewController: UIViewController?) { 654 | if let viewController = targetViewController { 655 | 656 | addChildViewController(viewController) 657 | viewController.view.frame = view.bounds 658 | viewController.view.autoresizingMask = [.flexibleWidth, .flexibleHeight] 659 | targetView.addSubview(viewController.view) 660 | viewController.didMove(toParentViewController: self) 661 | } 662 | } 663 | 664 | fileprivate func hideViewController(_ targetViewController: UIViewController) { 665 | targetViewController.willMove(toParentViewController: nil) 666 | targetViewController.view.removeFromSuperview() 667 | targetViewController.removeFromParentViewController() 668 | } 669 | 670 | // MARK : Layout 671 | 672 | fileprivate func setupContentButton() { 673 | 674 | if let _ = contentButton.superview { 675 | return 676 | } else { 677 | contentButton.addTarget(self, action: #selector(SSASideMenu.hideMenuViewController as (SSASideMenu) -> () -> ()), for:.touchUpInside) 678 | contentButton.autoresizingMask = UIViewAutoresizing() 679 | contentButton.frame = contentViewContainer.bounds 680 | contentButton.autoresizingMask = [.flexibleWidth, .flexibleHeight] 681 | contentButton.tag = 101 682 | contentViewContainer.addSubview(contentButton) 683 | } 684 | 685 | } 686 | 687 | fileprivate func statusBarNeedsAppearanceUpdate() { 688 | 689 | if self.responds(to: #selector(UIViewController.setNeedsStatusBarAppearanceUpdate)) { 690 | 691 | UIView.animate(withDuration: 0.3, animations: { () -> Void in 692 | self.setNeedsStatusBarAppearanceUpdate() 693 | }) 694 | } 695 | } 696 | 697 | fileprivate func setupContentViewShadow() { 698 | 699 | if contentViewShadowEnabled { 700 | let layer: CALayer = contentViewContainer.layer 701 | let path: UIBezierPath = UIBezierPath(rect: layer.bounds) 702 | layer.shadowPath = path.cgPath 703 | layer.shadowColor = contentViewShadowColor.cgColor 704 | layer.shadowOffset = contentViewShadowOffset 705 | layer.shadowOpacity = contentViewShadowOpacity 706 | layer.shadowRadius = CGFloat(contentViewShadowRadius) 707 | } 708 | 709 | } 710 | 711 | //MARK : Helper Functions 712 | 713 | fileprivate func resetContentViewScale() { 714 | let t: CGAffineTransform = contentViewContainer.transform 715 | let scale: CGFloat = sqrt(t.a * t.a + t.c * t.c) 716 | let frame: CGRect = contentViewContainer.frame 717 | contentViewContainer.transform = CGAffineTransform.identity 718 | contentViewContainer.transform = CGAffineTransform(scaleX: scale, y: scale) 719 | contentViewContainer.frame = frame 720 | } 721 | 722 | fileprivate func setupUserInteractionForContentButtonAndTargetViewControllerView(_ contentButtonInteractive: Bool, targetViewControllerViewInteractive: Bool) { 723 | 724 | if let viewController = contentViewController { 725 | for view in viewController.view.subviews { 726 | if view.tag == 101 { 727 | view.isUserInteractionEnabled = contentButtonInteractive 728 | }else { 729 | view.isUserInteractionEnabled = targetViewControllerViewInteractive 730 | } 731 | } 732 | } 733 | } 734 | 735 | // MARK : Motion Effects (Private) 736 | 737 | fileprivate func removeMotionEffects(_ targetView: UIView) { 738 | let targetViewMotionEffects = targetView.motionEffects 739 | for effect in targetViewMotionEffects { 740 | targetView.removeMotionEffect(effect) 741 | } 742 | } 743 | 744 | fileprivate func setupMenuViewControllerMotionEffects() { 745 | 746 | if parallaxEnabled { 747 | removeMotionEffects(menuViewContainer) 748 | 749 | // We need to refer to self in closures! 750 | UIView.animate(withDuration: 0.2, animations: { [unowned self] () -> Void in 751 | 752 | let interpolationHorizontal: UIInterpolatingMotionEffect = UIInterpolatingMotionEffect(keyPath: "center.x", type: .tiltAlongHorizontalAxis) 753 | interpolationHorizontal.minimumRelativeValue = self.parallaxContentMinimumRelativeValue 754 | interpolationHorizontal.maximumRelativeValue = self.parallaxContentMaximumRelativeValue 755 | 756 | let interpolationVertical: UIInterpolatingMotionEffect = UIInterpolatingMotionEffect(keyPath: "center.y", type: .tiltAlongVerticalAxis) 757 | interpolationHorizontal.minimumRelativeValue = self.parallaxContentMinimumRelativeValue 758 | interpolationHorizontal.maximumRelativeValue = self.parallaxContentMaximumRelativeValue 759 | 760 | self.menuViewContainer.addMotionEffect(interpolationHorizontal) 761 | self.menuViewContainer.addMotionEffect(interpolationVertical) 762 | }) 763 | } 764 | } 765 | 766 | fileprivate func setupContentViewControllerMotionEffects() { 767 | 768 | if parallaxEnabled { 769 | 770 | removeMotionEffects(contentViewContainer) 771 | 772 | // We need to refer to self in closures! 773 | UIView.animate(withDuration: 0.2, animations: { [unowned self] () -> Void in 774 | 775 | let interpolationHorizontal: UIInterpolatingMotionEffect = UIInterpolatingMotionEffect(keyPath: "center.x", type: .tiltAlongHorizontalAxis) 776 | interpolationHorizontal.minimumRelativeValue = self.parallaxContentMinimumRelativeValue 777 | interpolationHorizontal.maximumRelativeValue = self.parallaxContentMaximumRelativeValue 778 | 779 | let interpolationVertical: UIInterpolatingMotionEffect = UIInterpolatingMotionEffect(keyPath: "center.y", type: .tiltAlongVerticalAxis) 780 | interpolationHorizontal.minimumRelativeValue = self.parallaxContentMinimumRelativeValue 781 | interpolationHorizontal.maximumRelativeValue = self.parallaxContentMaximumRelativeValue 782 | 783 | self.contentViewContainer.addMotionEffect(interpolationHorizontal) 784 | self.contentViewContainer.addMotionEffect(interpolationVertical) 785 | }) 786 | } 787 | } 788 | 789 | // MARK : View Controller Rotation handler 790 | 791 | override var shouldAutorotate: Bool { 792 | 793 | if let cntViewController = contentViewController { 794 | 795 | return cntViewController.shouldAutorotate 796 | } 797 | return false 798 | } 799 | 800 | override func willAnimateRotation(to toInterfaceOrientation: UIInterfaceOrientation, duration: TimeInterval) { 801 | 802 | if visible { 803 | 804 | menuViewContainer.bounds = view.bounds 805 | contentViewContainer.transform = CGAffineTransform.identity 806 | contentViewContainer.frame = view.bounds 807 | 808 | if type == .scale { 809 | contentViewContainer.transform = CGAffineTransform(scaleX: CGFloat(contentViewScaleValue), y: CGFloat(contentViewScaleValue)) 810 | } else { 811 | contentViewContainer.transform = CGAffineTransform.identity 812 | } 813 | 814 | var center: CGPoint 815 | if leftMenuVisible { 816 | 817 | let centerXLandscape = CGFloat(contentViewInLandscapeOffsetCenterX) + (iOS8 ? CGFloat(view.frame.width) : CGFloat(view.frame.height)) 818 | let centerXPortrait = CGFloat(contentViewInPortraitOffsetCenterX) + CGFloat(view.frame.width) 819 | 820 | let centerX = UIInterfaceOrientationIsLandscape(UIApplication.shared.statusBarOrientation) ? centerXLandscape : centerXPortrait 821 | 822 | center = CGPoint.init(x: centerX, y: contentViewContainer.center.y) 823 | 824 | } else { 825 | 826 | let centerXLandscape = -CGFloat(self.contentViewInLandscapeOffsetCenterX) 827 | let centerXPortrait = CGFloat(-self.contentViewInPortraitOffsetCenterX) 828 | 829 | let centerX = UIInterfaceOrientationIsLandscape(UIApplication.shared.statusBarOrientation) ? centerXLandscape : centerXPortrait 830 | 831 | center = CGPoint.init(x: centerX, y: contentViewContainer.center.y) 832 | } 833 | 834 | contentViewContainer.center = center 835 | } 836 | 837 | setupContentViewShadow() 838 | } 839 | 840 | // MARK : Status Bar Appearance Management 841 | override var preferredStatusBarStyle: UIStatusBarStyle{ 842 | var style: UIStatusBarStyle 843 | 844 | switch statusBarStyle { 845 | case .hidden: 846 | style = .default 847 | case .black: 848 | style = .default 849 | case .light: 850 | style = .lightContent 851 | } 852 | 853 | if visible || contentViewContainer.frame.origin.y <= 0, let cntViewController = contentViewController { 854 | style = cntViewController.preferredStatusBarStyle 855 | } 856 | 857 | return style 858 | } 859 | 860 | override var prefersStatusBarHidden: Bool{ 861 | var statusBarHidden: Bool 862 | 863 | switch statusBarStyle { 864 | case .hidden: 865 | statusBarHidden = true 866 | default: 867 | statusBarHidden = false 868 | } 869 | 870 | if visible || contentViewContainer.frame.origin.y <= 0, let cntViewController = contentViewController { 871 | statusBarHidden = cntViewController.prefersStatusBarHidden 872 | } 873 | 874 | return statusBarHidden 875 | } 876 | 877 | override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation{ 878 | 879 | var statusBarAnimation: UIStatusBarAnimation = .none 880 | 881 | if let cntViewController = contentViewController, let leftMenuViewController = leftMenuViewController { 882 | 883 | statusBarAnimation = visible ? leftMenuViewController.preferredStatusBarUpdateAnimation : cntViewController.preferredStatusBarUpdateAnimation 884 | 885 | if contentViewContainer.frame.origin.y > 10 { 886 | statusBarAnimation = leftMenuViewController.preferredStatusBarUpdateAnimation 887 | } else { 888 | statusBarAnimation = cntViewController.preferredStatusBarUpdateAnimation 889 | } 890 | } 891 | 892 | if let cntViewController = contentViewController, let rghtMenuViewController = rightMenuViewController { 893 | 894 | statusBarAnimation = visible ? rghtMenuViewController.preferredStatusBarUpdateAnimation : cntViewController.preferredStatusBarUpdateAnimation 895 | 896 | if contentViewContainer.frame.origin.y > 10 { 897 | statusBarAnimation = rghtMenuViewController.preferredStatusBarUpdateAnimation 898 | } else { 899 | statusBarAnimation = cntViewController.preferredStatusBarUpdateAnimation 900 | } 901 | } 902 | 903 | return statusBarAnimation 904 | } 905 | 906 | // MARK : UIGestureRecognizer Delegate (Private) 907 | 908 | 909 | func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { 910 | 911 | if interactivePopGestureRecognizerEnabled, 912 | let viewController = contentViewController as? UINavigationController 913 | , viewController.viewControllers.count > 1 && viewController.interactivePopGestureRecognizer!.isEnabled { 914 | return false 915 | } 916 | 917 | if gestureRecognizer is UIPanGestureRecognizer && !visible { 918 | 919 | switch panDirection { 920 | case .everyWhere: 921 | return true 922 | case .edge: 923 | let point = touch.location(in: gestureRecognizer.view) 924 | if point.x < 20.0 || point.x > view.frame.size.width - 20.0 { return true } 925 | else { return false } 926 | } 927 | } 928 | 929 | return true 930 | } 931 | 932 | func panGestureRecognized(_ recognizer: UIPanGestureRecognizer) { 933 | 934 | delegate?.sideMenuDidRecognizePanGesture?(self, recongnizer: recognizer) 935 | 936 | if !panGestureEnabled { 937 | return 938 | } 939 | 940 | var point: CGPoint = recognizer.translation(in: view) 941 | 942 | if recognizer.state == .began { 943 | setupContentViewShadow() 944 | 945 | originalPoint = CGPoint.init(x: contentViewContainer.center.x - contentViewContainer.bounds.width / 2.0, y: contentViewContainer.center.y - contentViewContainer.bounds.height / 2.0) 946 | menuViewContainer.transform = CGAffineTransform.identity 947 | 948 | if (scaleBackgroundImageView) { 949 | backgroundImageView.transform = CGAffineTransform.identity 950 | backgroundImageView.frame = view.bounds 951 | } 952 | 953 | menuViewContainer.frame = view.bounds 954 | setupContentButton() 955 | 956 | if endAllEditing { 957 | view.window?.endEditing(true) 958 | }else { 959 | setupUserInteractionForContentButtonAndTargetViewControllerView(true, targetViewControllerViewInteractive: false) 960 | } 961 | 962 | didNotifyDelegate = false 963 | } 964 | 965 | if recognizer.state == .changed { 966 | 967 | var delta: CGFloat = 0.0 968 | if visible { 969 | delta = originalPoint.x != 0 ? (point.x + originalPoint.x) / originalPoint.x : 0 970 | } else { 971 | delta = point.x / view.frame.size.width 972 | } 973 | 974 | delta = min(fabs(delta), 1.6) 975 | 976 | var contentViewScale: CGFloat = type == .scale ? 1 - ((1 - CGFloat(contentViewScaleValue)) * delta) : 1 977 | 978 | var backgroundViewScale: CGFloat = backgroundTransformation.a - ((backgroundTransformation.a - 1) * delta) 979 | var menuViewScale: CGFloat = menuViewControllerTransformation.a - ((menuViewControllerTransformation.a - 1) * delta) 980 | 981 | if !bouncesHorizontally { 982 | contentViewScale = max(contentViewScale, CGFloat(contentViewScaleValue)) 983 | backgroundViewScale = max(backgroundViewScale, 1.0) 984 | menuViewScale = max(menuViewScale, 1.0) 985 | } 986 | 987 | menuViewContainer.alpha = fadeMenuView ? delta : 0 988 | contentViewContainer.alpha = 1 - (1 - CGFloat(contentViewFadeOutAlpha)) * delta 989 | 990 | if scaleBackgroundImageView { 991 | backgroundImageView.transform = CGAffineTransform(scaleX: backgroundViewScale, y: backgroundViewScale) 992 | } 993 | 994 | if scaleMenuView { 995 | menuViewContainer.transform = CGAffineTransform(scaleX: menuViewScale, y: menuViewScale) 996 | } 997 | 998 | if scaleBackgroundImageView && backgroundViewScale < 1 { 999 | backgroundImageView.transform = CGAffineTransform.identity 1000 | } 1001 | 1002 | if bouncesHorizontally && visible { 1003 | if contentViewContainer.frame.origin.x > contentViewContainer.frame.size.width / 2.0 { 1004 | point.x = min(0.0, point.x) 1005 | } 1006 | 1007 | if contentViewContainer.frame.origin.x < -(contentViewContainer.frame.size.width / 2.0) { 1008 | point.x = max(0.0, point.x) 1009 | } 1010 | } 1011 | 1012 | // Limit size 1013 | if point.x < 0 { 1014 | point.x = max(point.x, -UIScreen.main.bounds.size.height) 1015 | } else { 1016 | point.x = min(point.x, UIScreen.main.bounds.size.height) 1017 | } 1018 | 1019 | recognizer.setTranslation(point, in: view) 1020 | 1021 | if !didNotifyDelegate { 1022 | if point.x > 0 && !visible, let viewController = leftMenuViewController { 1023 | delegate?.sideMenuWillShowMenuViewController?(self, menuViewController: viewController) 1024 | } 1025 | if point.x < 0 && !visible, let viewController = rightMenuViewController { 1026 | delegate?.sideMenuWillShowMenuViewController?(self, menuViewController: viewController) 1027 | } 1028 | didNotifyDelegate = true 1029 | } 1030 | 1031 | if contentViewScale > 1 { 1032 | let oppositeScale: CGFloat = (1 - (contentViewScale - 1)) 1033 | contentViewContainer.transform = CGAffineTransform(scaleX: oppositeScale, y: oppositeScale) 1034 | contentViewContainer.transform = contentViewContainer.transform.translatedBy(x: point.x, y: 0) 1035 | } else { 1036 | contentViewContainer.transform = CGAffineTransform(scaleX: contentViewScale, y: contentViewScale) 1037 | contentViewContainer.transform = contentViewContainer.transform.translatedBy(x: point.x, y: 0) 1038 | } 1039 | leftMenuViewController?.view.isHidden = contentViewContainer.frame.origin.x < 0 1040 | rightMenuViewController?.view.isHidden = contentViewContainer.frame.origin.x > 0 1041 | 1042 | if leftMenuViewController == nil && contentViewContainer.frame.origin.x > 0 { 1043 | contentViewContainer.transform = CGAffineTransform.identity 1044 | contentViewContainer.frame = view.bounds 1045 | visible = false 1046 | leftMenuVisible = false 1047 | } else if self.rightMenuViewController == nil && contentViewContainer.frame.origin.x < 0 { 1048 | contentViewContainer.transform = CGAffineTransform.identity 1049 | contentViewContainer.frame = view.bounds 1050 | visible = false 1051 | rightMenuVisible = false 1052 | } 1053 | statusBarNeedsAppearanceUpdate() 1054 | } 1055 | 1056 | if recognizer.state == .ended { 1057 | 1058 | didNotifyDelegate = false 1059 | if panMinimumOpenThreshold > 0 && 1060 | contentViewContainer.frame.origin.x < 0 && 1061 | contentViewContainer.frame.origin.x > -CGFloat(panMinimumOpenThreshold) || 1062 | contentViewContainer.frame.origin.x > 0 && 1063 | contentViewContainer.frame.origin.x < CGFloat(panMinimumOpenThreshold) { 1064 | 1065 | hideMenuViewController() 1066 | } 1067 | else if contentViewContainer.frame.origin.x == 0 { 1068 | hideMenuViewController(false) 1069 | } 1070 | 1071 | else if recognizer.velocity(in: view).x > 0 { 1072 | if contentViewContainer.frame.origin.x < 0 { 1073 | hideMenuViewController() 1074 | } else if leftMenuViewController != nil { 1075 | showLeftMenuViewController() 1076 | } 1077 | } 1078 | else { 1079 | if contentViewContainer.frame.origin.x < 20 && rightMenuViewController != nil{ 1080 | showRightMenuViewController() 1081 | } else { 1082 | hideMenuViewController() 1083 | } 1084 | } 1085 | } 1086 | } 1087 | } 1088 | --------------------------------------------------------------------------------