├── LICENSE ├── PopMenu.gif ├── README.md ├── Simulator Screen Shot 2016年2月23日 上午12.20.19.png ├── TumblrPopMenu.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ ├── liuchuan.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── lu.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── liuchuan.xcuserdatad │ └── xcschemes │ │ ├── TumblrPopMenu.xcscheme │ │ └── xcschememanagement.plist │ └── lu.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── TumblrPopMenu.xcscheme │ └── xcschememanagement.plist ├── TumblrPopMenu ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── PopMenu │ ├── PopMenu.swift │ ├── PopMenu.xcassets │ │ ├── button-chat.imageset │ │ │ ├── Contents.json │ │ │ ├── button-chat1x90x126.png │ │ │ ├── button-chat2x150x210.png │ │ │ └── button-chat3x220x308.png │ │ ├── button-link.imageset │ │ │ ├── Contents.json │ │ │ └── button-link.png │ │ ├── button-photo.imageset │ │ │ ├── Contents.json │ │ │ └── button-photo.png │ │ ├── button-quote.imageset │ │ │ ├── Contents.json │ │ │ └── button-quote.png │ │ ├── button-text.imageset │ │ │ ├── Contents.json │ │ │ └── button-text.png │ │ └── button-video.imageset │ │ │ ├── Contents.json │ │ │ └── button-video.png │ └── PopMenuDelegate.swift ├── TumblrPopMenu.xcdatamodeld │ ├── .xccurrentversion │ └── TumblrPopMenu.xcdatamodel │ │ └── contents └── ViewController.swift ├── TumblrPopMenuTests ├── Info.plist └── TumblrPopMenuTests.swift └── TumblrPopMenuUITests ├── Info.plist └── TumblrPopMenuUITests.swift /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Zefeng Lu 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. 22 | -------------------------------------------------------------------------------- /PopMenu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luzefeng/TumblrPopMenu/020fe36fc40edef87c0e39e6fa689d9afce59cf2/PopMenu.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TumblrPopMenu 2 | 模仿tumblr的弹出菜单,效果和tumblr一样 3 | 4 | ##用法 5 | 把PopMenu文件夹拖到项目工程里 6 | ```swift 7 | class ViewController: UIViewController, PopMenuDelegate { 8 | //ViewController实现PopMenuDelegate协议 9 | var menuView: PopMenu! 10 | @IBOutlet weak var button: UIButton! 11 | override func viewDidLoad() { 12 | super.viewDidLoad() 13 | // Do any additional setup after loading the view, typically from a nib. 14 | //创建PopMenu,并添加到view 15 | menuView = PopMenu(frame: self.view.frame) 16 | menuView.delegate = self 17 | self.view.addSubview(menuView) 18 | } 19 | //点击显示popmenu 20 | @IBAction func handleTap(sender: AnyObject) { 21 | menuView.showMenuView() 22 | } 23 | 24 | //点击图标回调函数 25 | func didClickMenu(index: Int) { 26 | print("click at \(index)") 27 | } 28 | ``` 29 | 30 | ##效果图 31 | ![](https://github.com/luzefeng/TumblrPopMenu/blob/master/PopMenu.gif) 32 | 33 | ![](https://github.com/luzefeng/TumblrPopMenu/blob/master/Simulator%20Screen%20Shot%202016%E5%B9%B42%E6%9C%8823%E6%97%A5%20%E4%B8%8A%E5%8D%8812.20.19.png) 34 | -------------------------------------------------------------------------------- /Simulator Screen Shot 2016年2月23日 上午12.20.19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luzefeng/TumblrPopMenu/020fe36fc40edef87c0e39e6fa689d9afce59cf2/Simulator Screen Shot 2016年2月23日 上午12.20.19.png -------------------------------------------------------------------------------- /TumblrPopMenu.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 89C66C491C7B3D8100A900EF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89C66C481C7B3D8100A900EF /* AppDelegate.swift */; }; 11 | 89C66C4B1C7B3D8100A900EF /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89C66C4A1C7B3D8100A900EF /* ViewController.swift */; }; 12 | 89C66C4E1C7B3D8100A900EF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 89C66C4C1C7B3D8100A900EF /* Main.storyboard */; }; 13 | 89C66C511C7B3D8100A900EF /* TumblrPopMenu.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 89C66C4F1C7B3D8100A900EF /* TumblrPopMenu.xcdatamodeld */; }; 14 | 89C66C531C7B3D8100A900EF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 89C66C521C7B3D8100A900EF /* Assets.xcassets */; }; 15 | 89C66C561C7B3D8100A900EF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 89C66C541C7B3D8100A900EF /* LaunchScreen.storyboard */; }; 16 | 89C66C611C7B3D8200A900EF /* TumblrPopMenuTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89C66C601C7B3D8200A900EF /* TumblrPopMenuTests.swift */; }; 17 | 89C66C6C1C7B3D8200A900EF /* TumblrPopMenuUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89C66C6B1C7B3D8200A900EF /* TumblrPopMenuUITests.swift */; }; 18 | 89C66C7D1C7B3E0A00A900EF /* PopMenu.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 89C66C7C1C7B3E0A00A900EF /* PopMenu.xcassets */; }; 19 | 89C66C7F1C7B3F0800A900EF /* PopMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89C66C7E1C7B3F0800A900EF /* PopMenu.swift */; }; 20 | 89C66C811C7B5CE200A900EF /* PopMenuDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89C66C801C7B5CE200A900EF /* PopMenuDelegate.swift */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | 89C66C5D1C7B3D8200A900EF /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = 89C66C3D1C7B3D8100A900EF /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = 89C66C441C7B3D8100A900EF; 29 | remoteInfo = TumblrPopMenu; 30 | }; 31 | 89C66C681C7B3D8200A900EF /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = 89C66C3D1C7B3D8100A900EF /* Project object */; 34 | proxyType = 1; 35 | remoteGlobalIDString = 89C66C441C7B3D8100A900EF; 36 | remoteInfo = TumblrPopMenu; 37 | }; 38 | /* End PBXContainerItemProxy section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 89C66C451C7B3D8100A900EF /* TumblrPopMenu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TumblrPopMenu.app; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 89C66C481C7B3D8100A900EF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 43 | 89C66C4A1C7B3D8100A900EF /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 44 | 89C66C4D1C7B3D8100A900EF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 89C66C501C7B3D8100A900EF /* TumblrPopMenu.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = TumblrPopMenu.xcdatamodel; sourceTree = ""; }; 46 | 89C66C521C7B3D8100A900EF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | 89C66C551C7B3D8100A900EF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | 89C66C571C7B3D8100A900EF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 89C66C5C1C7B3D8200A900EF /* TumblrPopMenuTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TumblrPopMenuTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 89C66C601C7B3D8200A900EF /* TumblrPopMenuTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TumblrPopMenuTests.swift; sourceTree = ""; }; 51 | 89C66C621C7B3D8200A900EF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 89C66C671C7B3D8200A900EF /* TumblrPopMenuUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TumblrPopMenuUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 89C66C6B1C7B3D8200A900EF /* TumblrPopMenuUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TumblrPopMenuUITests.swift; sourceTree = ""; }; 54 | 89C66C6D1C7B3D8200A900EF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 89C66C7C1C7B3E0A00A900EF /* PopMenu.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = PopMenu.xcassets; sourceTree = ""; }; 56 | 89C66C7E1C7B3F0800A900EF /* PopMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PopMenu.swift; sourceTree = ""; }; 57 | 89C66C801C7B5CE200A900EF /* PopMenuDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PopMenuDelegate.swift; sourceTree = ""; }; 58 | /* End PBXFileReference section */ 59 | 60 | /* Begin PBXFrameworksBuildPhase section */ 61 | 89C66C421C7B3D8100A900EF /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | 89C66C591C7B3D8200A900EF /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | 89C66C641C7B3D8200A900EF /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | /* End PBXFrameworksBuildPhase section */ 83 | 84 | /* Begin PBXGroup section */ 85 | 89C66C3C1C7B3D8100A900EF = { 86 | isa = PBXGroup; 87 | children = ( 88 | 89C66C471C7B3D8100A900EF /* TumblrPopMenu */, 89 | 89C66C5F1C7B3D8200A900EF /* TumblrPopMenuTests */, 90 | 89C66C6A1C7B3D8200A900EF /* TumblrPopMenuUITests */, 91 | 89C66C461C7B3D8100A900EF /* Products */, 92 | ); 93 | sourceTree = ""; 94 | }; 95 | 89C66C461C7B3D8100A900EF /* Products */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 89C66C451C7B3D8100A900EF /* TumblrPopMenu.app */, 99 | 89C66C5C1C7B3D8200A900EF /* TumblrPopMenuTests.xctest */, 100 | 89C66C671C7B3D8200A900EF /* TumblrPopMenuUITests.xctest */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | 89C66C471C7B3D8100A900EF /* TumblrPopMenu */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 89C66C7B1C7B3DFC00A900EF /* PopMenu */, 109 | 89C66C481C7B3D8100A900EF /* AppDelegate.swift */, 110 | 89C66C4A1C7B3D8100A900EF /* ViewController.swift */, 111 | 89C66C4C1C7B3D8100A900EF /* Main.storyboard */, 112 | 89C66C521C7B3D8100A900EF /* Assets.xcassets */, 113 | 89C66C541C7B3D8100A900EF /* LaunchScreen.storyboard */, 114 | 89C66C571C7B3D8100A900EF /* Info.plist */, 115 | 89C66C4F1C7B3D8100A900EF /* TumblrPopMenu.xcdatamodeld */, 116 | ); 117 | path = TumblrPopMenu; 118 | sourceTree = ""; 119 | }; 120 | 89C66C5F1C7B3D8200A900EF /* TumblrPopMenuTests */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 89C66C601C7B3D8200A900EF /* TumblrPopMenuTests.swift */, 124 | 89C66C621C7B3D8200A900EF /* Info.plist */, 125 | ); 126 | path = TumblrPopMenuTests; 127 | sourceTree = ""; 128 | }; 129 | 89C66C6A1C7B3D8200A900EF /* TumblrPopMenuUITests */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 89C66C6B1C7B3D8200A900EF /* TumblrPopMenuUITests.swift */, 133 | 89C66C6D1C7B3D8200A900EF /* Info.plist */, 134 | ); 135 | path = TumblrPopMenuUITests; 136 | sourceTree = ""; 137 | }; 138 | 89C66C7B1C7B3DFC00A900EF /* PopMenu */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 89C66C7C1C7B3E0A00A900EF /* PopMenu.xcassets */, 142 | 89C66C7E1C7B3F0800A900EF /* PopMenu.swift */, 143 | 89C66C801C7B5CE200A900EF /* PopMenuDelegate.swift */, 144 | ); 145 | path = PopMenu; 146 | sourceTree = ""; 147 | }; 148 | /* End PBXGroup section */ 149 | 150 | /* Begin PBXNativeTarget section */ 151 | 89C66C441C7B3D8100A900EF /* TumblrPopMenu */ = { 152 | isa = PBXNativeTarget; 153 | buildConfigurationList = 89C66C701C7B3D8200A900EF /* Build configuration list for PBXNativeTarget "TumblrPopMenu" */; 154 | buildPhases = ( 155 | 89C66C411C7B3D8100A900EF /* Sources */, 156 | 89C66C421C7B3D8100A900EF /* Frameworks */, 157 | 89C66C431C7B3D8100A900EF /* Resources */, 158 | ); 159 | buildRules = ( 160 | ); 161 | dependencies = ( 162 | ); 163 | name = TumblrPopMenu; 164 | productName = TumblrPopMenu; 165 | productReference = 89C66C451C7B3D8100A900EF /* TumblrPopMenu.app */; 166 | productType = "com.apple.product-type.application"; 167 | }; 168 | 89C66C5B1C7B3D8200A900EF /* TumblrPopMenuTests */ = { 169 | isa = PBXNativeTarget; 170 | buildConfigurationList = 89C66C731C7B3D8200A900EF /* Build configuration list for PBXNativeTarget "TumblrPopMenuTests" */; 171 | buildPhases = ( 172 | 89C66C581C7B3D8200A900EF /* Sources */, 173 | 89C66C591C7B3D8200A900EF /* Frameworks */, 174 | 89C66C5A1C7B3D8200A900EF /* Resources */, 175 | ); 176 | buildRules = ( 177 | ); 178 | dependencies = ( 179 | 89C66C5E1C7B3D8200A900EF /* PBXTargetDependency */, 180 | ); 181 | name = TumblrPopMenuTests; 182 | productName = TumblrPopMenuTests; 183 | productReference = 89C66C5C1C7B3D8200A900EF /* TumblrPopMenuTests.xctest */; 184 | productType = "com.apple.product-type.bundle.unit-test"; 185 | }; 186 | 89C66C661C7B3D8200A900EF /* TumblrPopMenuUITests */ = { 187 | isa = PBXNativeTarget; 188 | buildConfigurationList = 89C66C761C7B3D8200A900EF /* Build configuration list for PBXNativeTarget "TumblrPopMenuUITests" */; 189 | buildPhases = ( 190 | 89C66C631C7B3D8200A900EF /* Sources */, 191 | 89C66C641C7B3D8200A900EF /* Frameworks */, 192 | 89C66C651C7B3D8200A900EF /* Resources */, 193 | ); 194 | buildRules = ( 195 | ); 196 | dependencies = ( 197 | 89C66C691C7B3D8200A900EF /* PBXTargetDependency */, 198 | ); 199 | name = TumblrPopMenuUITests; 200 | productName = TumblrPopMenuUITests; 201 | productReference = 89C66C671C7B3D8200A900EF /* TumblrPopMenuUITests.xctest */; 202 | productType = "com.apple.product-type.bundle.ui-testing"; 203 | }; 204 | /* End PBXNativeTarget section */ 205 | 206 | /* Begin PBXProject section */ 207 | 89C66C3D1C7B3D8100A900EF /* Project object */ = { 208 | isa = PBXProject; 209 | attributes = { 210 | LastSwiftUpdateCheck = 0720; 211 | LastUpgradeCheck = 0720; 212 | ORGANIZATIONNAME = lu; 213 | TargetAttributes = { 214 | 89C66C441C7B3D8100A900EF = { 215 | CreatedOnToolsVersion = 7.2.1; 216 | }; 217 | 89C66C5B1C7B3D8200A900EF = { 218 | CreatedOnToolsVersion = 7.2.1; 219 | TestTargetID = 89C66C441C7B3D8100A900EF; 220 | }; 221 | 89C66C661C7B3D8200A900EF = { 222 | CreatedOnToolsVersion = 7.2.1; 223 | TestTargetID = 89C66C441C7B3D8100A900EF; 224 | }; 225 | }; 226 | }; 227 | buildConfigurationList = 89C66C401C7B3D8100A900EF /* Build configuration list for PBXProject "TumblrPopMenu" */; 228 | compatibilityVersion = "Xcode 3.2"; 229 | developmentRegion = English; 230 | hasScannedForEncodings = 0; 231 | knownRegions = ( 232 | en, 233 | Base, 234 | ); 235 | mainGroup = 89C66C3C1C7B3D8100A900EF; 236 | productRefGroup = 89C66C461C7B3D8100A900EF /* Products */; 237 | projectDirPath = ""; 238 | projectRoot = ""; 239 | targets = ( 240 | 89C66C441C7B3D8100A900EF /* TumblrPopMenu */, 241 | 89C66C5B1C7B3D8200A900EF /* TumblrPopMenuTests */, 242 | 89C66C661C7B3D8200A900EF /* TumblrPopMenuUITests */, 243 | ); 244 | }; 245 | /* End PBXProject section */ 246 | 247 | /* Begin PBXResourcesBuildPhase section */ 248 | 89C66C431C7B3D8100A900EF /* Resources */ = { 249 | isa = PBXResourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | 89C66C7D1C7B3E0A00A900EF /* PopMenu.xcassets in Resources */, 253 | 89C66C561C7B3D8100A900EF /* LaunchScreen.storyboard in Resources */, 254 | 89C66C531C7B3D8100A900EF /* Assets.xcassets in Resources */, 255 | 89C66C4E1C7B3D8100A900EF /* Main.storyboard in Resources */, 256 | ); 257 | runOnlyForDeploymentPostprocessing = 0; 258 | }; 259 | 89C66C5A1C7B3D8200A900EF /* Resources */ = { 260 | isa = PBXResourcesBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | 89C66C651C7B3D8200A900EF /* Resources */ = { 267 | isa = PBXResourcesBuildPhase; 268 | buildActionMask = 2147483647; 269 | files = ( 270 | ); 271 | runOnlyForDeploymentPostprocessing = 0; 272 | }; 273 | /* End PBXResourcesBuildPhase section */ 274 | 275 | /* Begin PBXSourcesBuildPhase section */ 276 | 89C66C411C7B3D8100A900EF /* Sources */ = { 277 | isa = PBXSourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | 89C66C7F1C7B3F0800A900EF /* PopMenu.swift in Sources */, 281 | 89C66C4B1C7B3D8100A900EF /* ViewController.swift in Sources */, 282 | 89C66C491C7B3D8100A900EF /* AppDelegate.swift in Sources */, 283 | 89C66C511C7B3D8100A900EF /* TumblrPopMenu.xcdatamodeld in Sources */, 284 | 89C66C811C7B5CE200A900EF /* PopMenuDelegate.swift in Sources */, 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | }; 288 | 89C66C581C7B3D8200A900EF /* Sources */ = { 289 | isa = PBXSourcesBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | 89C66C611C7B3D8200A900EF /* TumblrPopMenuTests.swift in Sources */, 293 | ); 294 | runOnlyForDeploymentPostprocessing = 0; 295 | }; 296 | 89C66C631C7B3D8200A900EF /* Sources */ = { 297 | isa = PBXSourcesBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | 89C66C6C1C7B3D8200A900EF /* TumblrPopMenuUITests.swift in Sources */, 301 | ); 302 | runOnlyForDeploymentPostprocessing = 0; 303 | }; 304 | /* End PBXSourcesBuildPhase section */ 305 | 306 | /* Begin PBXTargetDependency section */ 307 | 89C66C5E1C7B3D8200A900EF /* PBXTargetDependency */ = { 308 | isa = PBXTargetDependency; 309 | target = 89C66C441C7B3D8100A900EF /* TumblrPopMenu */; 310 | targetProxy = 89C66C5D1C7B3D8200A900EF /* PBXContainerItemProxy */; 311 | }; 312 | 89C66C691C7B3D8200A900EF /* PBXTargetDependency */ = { 313 | isa = PBXTargetDependency; 314 | target = 89C66C441C7B3D8100A900EF /* TumblrPopMenu */; 315 | targetProxy = 89C66C681C7B3D8200A900EF /* PBXContainerItemProxy */; 316 | }; 317 | /* End PBXTargetDependency section */ 318 | 319 | /* Begin PBXVariantGroup section */ 320 | 89C66C4C1C7B3D8100A900EF /* Main.storyboard */ = { 321 | isa = PBXVariantGroup; 322 | children = ( 323 | 89C66C4D1C7B3D8100A900EF /* Base */, 324 | ); 325 | name = Main.storyboard; 326 | sourceTree = ""; 327 | }; 328 | 89C66C541C7B3D8100A900EF /* LaunchScreen.storyboard */ = { 329 | isa = PBXVariantGroup; 330 | children = ( 331 | 89C66C551C7B3D8100A900EF /* Base */, 332 | ); 333 | name = LaunchScreen.storyboard; 334 | sourceTree = ""; 335 | }; 336 | /* End PBXVariantGroup section */ 337 | 338 | /* Begin XCBuildConfiguration section */ 339 | 89C66C6E1C7B3D8200A900EF /* Debug */ = { 340 | isa = XCBuildConfiguration; 341 | buildSettings = { 342 | ALWAYS_SEARCH_USER_PATHS = NO; 343 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 344 | CLANG_CXX_LIBRARY = "libc++"; 345 | CLANG_ENABLE_MODULES = YES; 346 | CLANG_ENABLE_OBJC_ARC = YES; 347 | CLANG_WARN_BOOL_CONVERSION = YES; 348 | CLANG_WARN_CONSTANT_CONVERSION = YES; 349 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 350 | CLANG_WARN_EMPTY_BODY = YES; 351 | CLANG_WARN_ENUM_CONVERSION = YES; 352 | CLANG_WARN_INT_CONVERSION = YES; 353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 354 | CLANG_WARN_UNREACHABLE_CODE = YES; 355 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 356 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 357 | COPY_PHASE_STRIP = NO; 358 | DEBUG_INFORMATION_FORMAT = dwarf; 359 | ENABLE_STRICT_OBJC_MSGSEND = YES; 360 | ENABLE_TESTABILITY = YES; 361 | GCC_C_LANGUAGE_STANDARD = gnu99; 362 | GCC_DYNAMIC_NO_PIC = NO; 363 | GCC_NO_COMMON_BLOCKS = YES; 364 | GCC_OPTIMIZATION_LEVEL = 0; 365 | GCC_PREPROCESSOR_DEFINITIONS = ( 366 | "DEBUG=1", 367 | "$(inherited)", 368 | ); 369 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 370 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 371 | GCC_WARN_UNDECLARED_SELECTOR = YES; 372 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 373 | GCC_WARN_UNUSED_FUNCTION = YES; 374 | GCC_WARN_UNUSED_VARIABLE = YES; 375 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 376 | MTL_ENABLE_DEBUG_INFO = YES; 377 | ONLY_ACTIVE_ARCH = YES; 378 | SDKROOT = iphoneos; 379 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 380 | }; 381 | name = Debug; 382 | }; 383 | 89C66C6F1C7B3D8200A900EF /* Release */ = { 384 | isa = XCBuildConfiguration; 385 | buildSettings = { 386 | ALWAYS_SEARCH_USER_PATHS = NO; 387 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 388 | CLANG_CXX_LIBRARY = "libc++"; 389 | CLANG_ENABLE_MODULES = YES; 390 | CLANG_ENABLE_OBJC_ARC = YES; 391 | CLANG_WARN_BOOL_CONVERSION = YES; 392 | CLANG_WARN_CONSTANT_CONVERSION = YES; 393 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 394 | CLANG_WARN_EMPTY_BODY = YES; 395 | CLANG_WARN_ENUM_CONVERSION = YES; 396 | CLANG_WARN_INT_CONVERSION = YES; 397 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 398 | CLANG_WARN_UNREACHABLE_CODE = YES; 399 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 400 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 401 | COPY_PHASE_STRIP = NO; 402 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 403 | ENABLE_NS_ASSERTIONS = NO; 404 | ENABLE_STRICT_OBJC_MSGSEND = YES; 405 | GCC_C_LANGUAGE_STANDARD = gnu99; 406 | GCC_NO_COMMON_BLOCKS = YES; 407 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 408 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 409 | GCC_WARN_UNDECLARED_SELECTOR = YES; 410 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 411 | GCC_WARN_UNUSED_FUNCTION = YES; 412 | GCC_WARN_UNUSED_VARIABLE = YES; 413 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 414 | MTL_ENABLE_DEBUG_INFO = NO; 415 | SDKROOT = iphoneos; 416 | VALIDATE_PRODUCT = YES; 417 | }; 418 | name = Release; 419 | }; 420 | 89C66C711C7B3D8200A900EF /* Debug */ = { 421 | isa = XCBuildConfiguration; 422 | buildSettings = { 423 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 424 | CODE_SIGN_IDENTITY = "iPhone Developer"; 425 | INFOPLIST_FILE = TumblrPopMenu/Info.plist; 426 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 427 | PRODUCT_BUNDLE_IDENTIFIER = com.lu.free.test; 428 | PRODUCT_NAME = "$(TARGET_NAME)"; 429 | }; 430 | name = Debug; 431 | }; 432 | 89C66C721C7B3D8200A900EF /* Release */ = { 433 | isa = XCBuildConfiguration; 434 | buildSettings = { 435 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 436 | CODE_SIGN_IDENTITY = "iPhone Developer"; 437 | INFOPLIST_FILE = TumblrPopMenu/Info.plist; 438 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 439 | PRODUCT_BUNDLE_IDENTIFIER = com.lu.free.test; 440 | PRODUCT_NAME = "$(TARGET_NAME)"; 441 | }; 442 | name = Release; 443 | }; 444 | 89C66C741C7B3D8200A900EF /* Debug */ = { 445 | isa = XCBuildConfiguration; 446 | buildSettings = { 447 | BUNDLE_LOADER = "$(TEST_HOST)"; 448 | INFOPLIST_FILE = TumblrPopMenuTests/Info.plist; 449 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 450 | PRODUCT_BUNDLE_IDENTIFIER = com.lu.free.tumblrpopmenu.TumblrPopMenuTests; 451 | PRODUCT_NAME = "$(TARGET_NAME)"; 452 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TumblrPopMenu.app/TumblrPopMenu"; 453 | }; 454 | name = Debug; 455 | }; 456 | 89C66C751C7B3D8200A900EF /* Release */ = { 457 | isa = XCBuildConfiguration; 458 | buildSettings = { 459 | BUNDLE_LOADER = "$(TEST_HOST)"; 460 | INFOPLIST_FILE = TumblrPopMenuTests/Info.plist; 461 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 462 | PRODUCT_BUNDLE_IDENTIFIER = com.lu.free.tumblrpopmenu.TumblrPopMenuTests; 463 | PRODUCT_NAME = "$(TARGET_NAME)"; 464 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TumblrPopMenu.app/TumblrPopMenu"; 465 | }; 466 | name = Release; 467 | }; 468 | 89C66C771C7B3D8200A900EF /* Debug */ = { 469 | isa = XCBuildConfiguration; 470 | buildSettings = { 471 | INFOPLIST_FILE = TumblrPopMenuUITests/Info.plist; 472 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 473 | PRODUCT_BUNDLE_IDENTIFIER = com.lu.free.tumblrpopmenu.TumblrPopMenuUITests; 474 | PRODUCT_NAME = "$(TARGET_NAME)"; 475 | TEST_TARGET_NAME = TumblrPopMenu; 476 | USES_XCTRUNNER = YES; 477 | }; 478 | name = Debug; 479 | }; 480 | 89C66C781C7B3D8200A900EF /* Release */ = { 481 | isa = XCBuildConfiguration; 482 | buildSettings = { 483 | INFOPLIST_FILE = TumblrPopMenuUITests/Info.plist; 484 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 485 | PRODUCT_BUNDLE_IDENTIFIER = com.lu.free.tumblrpopmenu.TumblrPopMenuUITests; 486 | PRODUCT_NAME = "$(TARGET_NAME)"; 487 | TEST_TARGET_NAME = TumblrPopMenu; 488 | USES_XCTRUNNER = YES; 489 | }; 490 | name = Release; 491 | }; 492 | /* End XCBuildConfiguration section */ 493 | 494 | /* Begin XCConfigurationList section */ 495 | 89C66C401C7B3D8100A900EF /* Build configuration list for PBXProject "TumblrPopMenu" */ = { 496 | isa = XCConfigurationList; 497 | buildConfigurations = ( 498 | 89C66C6E1C7B3D8200A900EF /* Debug */, 499 | 89C66C6F1C7B3D8200A900EF /* Release */, 500 | ); 501 | defaultConfigurationIsVisible = 0; 502 | defaultConfigurationName = Release; 503 | }; 504 | 89C66C701C7B3D8200A900EF /* Build configuration list for PBXNativeTarget "TumblrPopMenu" */ = { 505 | isa = XCConfigurationList; 506 | buildConfigurations = ( 507 | 89C66C711C7B3D8200A900EF /* Debug */, 508 | 89C66C721C7B3D8200A900EF /* Release */, 509 | ); 510 | defaultConfigurationIsVisible = 0; 511 | defaultConfigurationName = Release; 512 | }; 513 | 89C66C731C7B3D8200A900EF /* Build configuration list for PBXNativeTarget "TumblrPopMenuTests" */ = { 514 | isa = XCConfigurationList; 515 | buildConfigurations = ( 516 | 89C66C741C7B3D8200A900EF /* Debug */, 517 | 89C66C751C7B3D8200A900EF /* Release */, 518 | ); 519 | defaultConfigurationIsVisible = 0; 520 | defaultConfigurationName = Release; 521 | }; 522 | 89C66C761C7B3D8200A900EF /* Build configuration list for PBXNativeTarget "TumblrPopMenuUITests" */ = { 523 | isa = XCConfigurationList; 524 | buildConfigurations = ( 525 | 89C66C771C7B3D8200A900EF /* Debug */, 526 | 89C66C781C7B3D8200A900EF /* Release */, 527 | ); 528 | defaultConfigurationIsVisible = 0; 529 | defaultConfigurationName = Release; 530 | }; 531 | /* End XCConfigurationList section */ 532 | 533 | /* Begin XCVersionGroup section */ 534 | 89C66C4F1C7B3D8100A900EF /* TumblrPopMenu.xcdatamodeld */ = { 535 | isa = XCVersionGroup; 536 | children = ( 537 | 89C66C501C7B3D8100A900EF /* TumblrPopMenu.xcdatamodel */, 538 | ); 539 | currentVersion = 89C66C501C7B3D8100A900EF /* TumblrPopMenu.xcdatamodel */; 540 | path = TumblrPopMenu.xcdatamodeld; 541 | sourceTree = ""; 542 | versionGroupType = wrapper.xcdatamodel; 543 | }; 544 | /* End XCVersionGroup section */ 545 | }; 546 | rootObject = 89C66C3D1C7B3D8100A900EF /* Project object */; 547 | } 548 | -------------------------------------------------------------------------------- /TumblrPopMenu.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TumblrPopMenu.xcodeproj/project.xcworkspace/xcuserdata/liuchuan.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luzefeng/TumblrPopMenu/020fe36fc40edef87c0e39e6fa689d9afce59cf2/TumblrPopMenu.xcodeproj/project.xcworkspace/xcuserdata/liuchuan.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /TumblrPopMenu.xcodeproj/project.xcworkspace/xcuserdata/lu.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luzefeng/TumblrPopMenu/020fe36fc40edef87c0e39e6fa689d9afce59cf2/TumblrPopMenu.xcodeproj/project.xcworkspace/xcuserdata/lu.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /TumblrPopMenu.xcodeproj/xcuserdata/liuchuan.xcuserdatad/xcschemes/TumblrPopMenu.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /TumblrPopMenu.xcodeproj/xcuserdata/liuchuan.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TumblrPopMenu.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 89C66C441C7B3D8100A900EF 16 | 17 | primary 18 | 19 | 20 | 89C66C5B1C7B3D8200A900EF 21 | 22 | primary 23 | 24 | 25 | 89C66C661C7B3D8200A900EF 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /TumblrPopMenu.xcodeproj/xcuserdata/lu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /TumblrPopMenu.xcodeproj/xcuserdata/lu.xcuserdatad/xcschemes/TumblrPopMenu.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /TumblrPopMenu.xcodeproj/xcuserdata/lu.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TumblrPopMenu.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 89C66C441C7B3D8100A900EF 16 | 17 | primary 18 | 19 | 20 | 89C66C5B1C7B3D8200A900EF 21 | 22 | primary 23 | 24 | 25 | 89C66C661C7B3D8200A900EF 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /TumblrPopMenu/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // TumblrPopMenu 4 | // 5 | // Created by lu on 16/2/22. 6 | // Copyright © 2016年 lu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CoreData 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | 18 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 19 | // Override point for customization after application launch. 20 | return true 21 | } 22 | 23 | func applicationWillResignActive(application: UIApplication) { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | func applicationDidEnterBackground(application: UIApplication) { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | func applicationWillEnterForeground(application: UIApplication) { 34 | // 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. 35 | } 36 | 37 | func applicationDidBecomeActive(application: UIApplication) { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | func applicationWillTerminate(application: UIApplication) { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | // Saves changes in the application's managed object context before the application terminates. 44 | self.saveContext() 45 | } 46 | 47 | // MARK: - Core Data stack 48 | 49 | lazy var applicationDocumentsDirectory: NSURL = { 50 | // The directory the application uses to store the Core Data store file. This code uses a directory named "com.lu.free.tumblrpopmenu.TumblrPopMenu" in the application's documents Application Support directory. 51 | let urls = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask) 52 | return urls[urls.count-1] 53 | }() 54 | 55 | lazy var managedObjectModel: NSManagedObjectModel = { 56 | // The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model. 57 | let modelURL = NSBundle.mainBundle().URLForResource("TumblrPopMenu", withExtension: "momd")! 58 | return NSManagedObjectModel(contentsOfURL: modelURL)! 59 | }() 60 | 61 | lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator = { 62 | // The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. 63 | // Create the coordinator and store 64 | let coordinator = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel) 65 | let url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("SingleViewCoreData.sqlite") 66 | var failureReason = "There was an error creating or loading the application's saved data." 67 | do { 68 | try coordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil) 69 | } catch { 70 | // Report any error we got. 71 | var dict = [String: AnyObject]() 72 | dict[NSLocalizedDescriptionKey] = "Failed to initialize the application's saved data" 73 | dict[NSLocalizedFailureReasonErrorKey] = failureReason 74 | 75 | dict[NSUnderlyingErrorKey] = error as NSError 76 | let wrappedError = NSError(domain: "YOUR_ERROR_DOMAIN", code: 9999, userInfo: dict) 77 | // Replace this with code to handle the error appropriately. 78 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 79 | NSLog("Unresolved error \(wrappedError), \(wrappedError.userInfo)") 80 | abort() 81 | } 82 | 83 | return coordinator 84 | }() 85 | 86 | lazy var managedObjectContext: NSManagedObjectContext = { 87 | // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) This property is optional since there are legitimate error conditions that could cause the creation of the context to fail. 88 | let coordinator = self.persistentStoreCoordinator 89 | var managedObjectContext = NSManagedObjectContext(concurrencyType: .MainQueueConcurrencyType) 90 | managedObjectContext.persistentStoreCoordinator = coordinator 91 | return managedObjectContext 92 | }() 93 | 94 | // MARK: - Core Data Saving support 95 | 96 | func saveContext () { 97 | if managedObjectContext.hasChanges { 98 | do { 99 | try managedObjectContext.save() 100 | } catch { 101 | // Replace this implementation with code to handle the error appropriately. 102 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 103 | let nserror = error as NSError 104 | NSLog("Unresolved error \(nserror), \(nserror.userInfo)") 105 | abort() 106 | } 107 | } 108 | } 109 | 110 | } 111 | 112 | -------------------------------------------------------------------------------- /TumblrPopMenu/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /TumblrPopMenu/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /TumblrPopMenu/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 | 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 | -------------------------------------------------------------------------------- /TumblrPopMenu/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 | -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PopMenu.swift 3 | // TumblrPopMenu 4 | // 5 | // Created by lu on 16/2/22. 6 | // Copyright © 2016年 lu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | class PopMenu: UIView{ 13 | var textButton: UIButton! 14 | var photoButton: UIButton! 15 | var quoteButton: UIButton! 16 | var linkButton: UIButton! 17 | var chatButton: UIButton! 18 | var videoButton: UIButton! 19 | var backgroundView: UIView! 20 | var nevermindButton: UIButton! 21 | var centerHigh: [CGPoint]! 22 | var centerLow: [CGPoint]! 23 | var centerMenu: [CGPoint]! 24 | var delegate: PopMenuDelegate? 25 | var isHidding: Bool = false 26 | 27 | override init(frame: CGRect) { 28 | super.init(frame: frame) 29 | initImageView() 30 | initCenterArray(frame) 31 | setupView() 32 | } 33 | 34 | required init?(coder aDecoder: NSCoder) { 35 | fatalError("init(coder:) has not been implemented") 36 | } 37 | 38 | private func initCenterArray(frame: CGRect){ 39 | let widthUnit = frame.width/4 40 | let heightHigh = frame.origin.y - textButton.frame.height/2 41 | let heightLow = frame.height + textButton.frame.height/2 42 | let gap = textButton.frame.height/2 + 5 43 | centerHigh = [CGPoint]() 44 | centerHigh.append(CGPoint(x: widthUnit, y: heightHigh)) 45 | centerHigh.append(CGPoint(x: widthUnit*2, y: heightHigh)) 46 | centerHigh.append(CGPoint(x: widthUnit*3, y: heightHigh)) 47 | 48 | centerLow = [CGPoint]() 49 | centerLow.append(CGPoint(x: widthUnit, y: heightLow)) 50 | centerLow.append(CGPoint(x: widthUnit*2, y: heightLow)) 51 | centerLow.append(CGPoint(x: widthUnit*3, y: heightLow)) 52 | centerLow.append(CGPoint(x: widthUnit*2, y: frame.height + nevermindButton.frame.height/2)) 53 | 54 | centerMenu = [CGPoint]() 55 | centerMenu.append(CGPoint(x: widthUnit, y: frame.height/2 - gap)) 56 | centerMenu.append(CGPoint(x: widthUnit*2, y: frame.height/2 - gap)) 57 | centerMenu.append(CGPoint(x: widthUnit*3, y: frame.height/2 - gap)) 58 | centerMenu.append(CGPoint(x: widthUnit, y: frame.height/2 + gap)) 59 | centerMenu.append(CGPoint(x: widthUnit*2, y: frame.height/2 + gap)) 60 | centerMenu.append(CGPoint(x: widthUnit*3, y: frame.height/2 + gap)) 61 | centerMenu.append(CGPoint(x: widthUnit*2, y: frame.height - nevermindButton.frame.height/2)) 62 | } 63 | 64 | private func initImageView(){ 65 | let image = UIImage(named: "button-chat") 66 | let frame = CGRectMake(0, 0, image!.size.width, image!.size.height) 67 | textButton = UIButton(frame: frame) 68 | textButton.setBackgroundImage(UIImage(named: "button-text")!, forState: .Normal) 69 | 70 | photoButton = UIButton(frame: frame) 71 | photoButton.setBackgroundImage(UIImage(named: "button-photo")!, forState: .Normal) 72 | 73 | quoteButton = UIButton(frame: frame) 74 | quoteButton.setBackgroundImage(UIImage(named: "button-quote")!, forState: .Normal) 75 | 76 | linkButton = UIButton(frame: frame) 77 | linkButton.setBackgroundImage(UIImage(named: "button-link")!, forState: .Normal) 78 | 79 | chatButton = UIButton(frame: frame) 80 | chatButton.setBackgroundImage(UIImage(named: "button-chat")!, forState: .Normal) 81 | 82 | videoButton = UIButton(frame: frame) 83 | videoButton.setBackgroundImage(UIImage(named: "button-video")!, forState: .Normal) 84 | 85 | nevermindButton = UIButton(type: .System) 86 | nevermindButton.frame = CGRectMake(0, 0, self.frame.width, textButton.frame.height/2) 87 | nevermindButton.setTitle("Nevermind", forState: .Normal) 88 | nevermindButton.backgroundColor = UIColor.redColor() 89 | backgroundView = UIView(frame: self.frame) 90 | 91 | textButton.tag = 0 92 | photoButton.tag = 1 93 | quoteButton.tag = 2 94 | linkButton.tag = 3 95 | chatButton.tag = 4 96 | videoButton.tag = 5 97 | } 98 | 99 | private func setupView(){ 100 | self.hidden = true 101 | backgroundView.backgroundColor = UIColor(red: 61/255, green: 77/255, blue: 100/255, alpha: 0.95) 102 | backgroundView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(PopMenu.handleTap(_:)))) 103 | backgroundView.userInteractionEnabled = true 104 | 105 | nevermindButton.hidden = true 106 | nevermindButton.userInteractionEnabled = true 107 | nevermindButton.backgroundColor = UIColor(red: 61/255, green: 77/255, blue: 97/255, alpha: 1.0) 108 | nevermindButton.tintColor = UIColor(red: 133/255, green: 141/255, blue: 152/255, alpha: 1.0) 109 | nevermindButton.addTarget(self, action: #selector(PopMenu.handleTap(_:)), forControlEvents: .TouchUpInside) 110 | 111 | textButton.addTarget(self, action: #selector(PopMenu.clickMenu(_:)), forControlEvents: .TouchUpInside) 112 | photoButton.addTarget(self, action: #selector(PopMenu.clickMenu(_:)), forControlEvents: .TouchUpInside) 113 | quoteButton.addTarget(self, action: #selector(PopMenu.clickMenu(_:)), forControlEvents: .TouchUpInside) 114 | linkButton.addTarget(self, action: #selector(PopMenu.clickMenu(_:)), forControlEvents: .TouchUpInside) 115 | chatButton.addTarget(self, action: #selector(PopMenu.clickMenu(_:)), forControlEvents: .TouchUpInside) 116 | videoButton.addTarget(self, action: #selector(PopMenu.clickMenu(_:)), forControlEvents: .TouchUpInside) 117 | 118 | self.addSubview(backgroundView) 119 | self.addSubview(textButton) 120 | self.addSubview(photoButton) 121 | self.addSubview(quoteButton) 122 | self.addSubview(chatButton) 123 | self.addSubview(linkButton) 124 | self.addSubview(videoButton) 125 | self.addSubview(nevermindButton) 126 | } 127 | 128 | func clickMenu(sender: AnyObject){ 129 | print("clickMenu") 130 | let index = (sender as! UIButton).tag 131 | hideMenuView() 132 | delegate?.didClickMenu(index) 133 | } 134 | 135 | func handleTap(sender: AnyObject){ 136 | print("handleTap") 137 | hideMenuView() 138 | } 139 | 140 | private func hideMenuView(){ 141 | print("hideMenuView") 142 | if isHidding{ 143 | return 144 | } 145 | 146 | isHidding = true 147 | //Nevermind button 148 | nevermindButton.center = centerMenu[6] 149 | UIView.animateWithDuration(0.3, delay: 0.3, options: UIViewAnimationOptions.CurveEaseOut, animations: { () -> Void in 150 | self.nevermindButton.center = self.centerLow[3] 151 | }) { (finished) -> Void in 152 | self.nevermindButton.hidden = true 153 | self.isHidding = false 154 | } 155 | 156 | // Photo Image 157 | UIView.animateWithDuration(0.6, delay: 0.0, usingSpringWithDamping: 0.7, initialSpringVelocity: 1.0, options: UIViewAnimationOptions.CurveEaseOut, animations: { () -> Void in 158 | self.photoButton.center = self.centerHigh[1] 159 | }) { (finished) -> Void in 160 | self.hidden = true 161 | } 162 | 163 | // Text | Chat | Quote Image 164 | UIView.animateWithDuration(0.6, delay: 0.1, usingSpringWithDamping: 0.7, initialSpringVelocity: 1.0, options: UIViewAnimationOptions.CurveEaseOut, animations: { () -> Void in 165 | self.textButton.center = self.centerHigh[0] 166 | self.quoteButton.center = self.centerHigh[2] 167 | self.chatButton.center = self.centerHigh[1] 168 | }) { (finished) -> Void in 169 | } 170 | 171 | // Link | Video Image 172 | UIView.animateWithDuration(0.6, delay: 0.2, usingSpringWithDamping: 0.7, initialSpringVelocity: 1.0, options: UIViewAnimationOptions.CurveEaseOut, animations: { () -> Void in 173 | self.linkButton.center = self.centerHigh[0] 174 | self.videoButton.center = self.centerHigh[2] 175 | }) { (finished) -> Void in 176 | } 177 | } 178 | 179 | func showMenuView(){ 180 | print("showMenuView") 181 | 182 | self.hidden = false 183 | 184 | nevermindButton.center = centerLow[3] 185 | nevermindButton.hidden = false 186 | UIView.animateWithDuration(0.3, delay: 0.3, options: UIViewAnimationOptions.CurveEaseOut, animations: { () -> Void in 187 | self.nevermindButton.center = self.centerMenu[6] 188 | }) { (finished) -> Void in 189 | } 190 | 191 | // Photo Image 192 | photoButton.center = centerLow[1] 193 | UIView.animateWithDuration(0.6, delay: 0.0, usingSpringWithDamping: 0.7, initialSpringVelocity: 1.0, options: UIViewAnimationOptions.CurveEaseOut, animations: { () -> Void in 194 | self.photoButton.center = self.centerMenu[1] 195 | }) { (finished) -> Void in 196 | } 197 | 198 | // Text | Chat | Quote Image 199 | textButton.center = centerLow[0] 200 | quoteButton.center = centerLow[2] 201 | chatButton.center = centerLow[1] 202 | UIView.animateWithDuration(0.6, delay: 0.1, usingSpringWithDamping: 0.7, initialSpringVelocity: 1.0, options: UIViewAnimationOptions.CurveEaseOut, animations: { () -> Void in 203 | self.textButton.center = self.centerMenu[0] 204 | self.quoteButton.center = self.centerMenu[2] 205 | self.chatButton.center = self.centerMenu[4] 206 | }) { (finished) -> Void in 207 | } 208 | 209 | // Link | Video Image 210 | linkButton.center = centerLow[0] 211 | videoButton.center = centerLow[2] 212 | UIView.animateWithDuration(0.6, delay: 0.2, usingSpringWithDamping: 0.7, initialSpringVelocity: 1.0, options: UIViewAnimationOptions.CurveEaseOut, animations: { () -> Void in 213 | self.linkButton.center = self.centerMenu[3] 214 | self.videoButton.center = self.centerMenu[5] 215 | }) { (finished) -> Void in 216 | } 217 | } 218 | } 219 | 220 | 221 | 222 | -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.xcassets/button-chat.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "button-chat1x90x126.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "button-chat2x150x210.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "button-chat3x220x308.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.xcassets/button-chat.imageset/button-chat1x90x126.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luzefeng/TumblrPopMenu/020fe36fc40edef87c0e39e6fa689d9afce59cf2/TumblrPopMenu/PopMenu/PopMenu.xcassets/button-chat.imageset/button-chat1x90x126.png -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.xcassets/button-chat.imageset/button-chat2x150x210.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luzefeng/TumblrPopMenu/020fe36fc40edef87c0e39e6fa689d9afce59cf2/TumblrPopMenu/PopMenu/PopMenu.xcassets/button-chat.imageset/button-chat2x150x210.png -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.xcassets/button-chat.imageset/button-chat3x220x308.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luzefeng/TumblrPopMenu/020fe36fc40edef87c0e39e6fa689d9afce59cf2/TumblrPopMenu/PopMenu/PopMenu.xcassets/button-chat.imageset/button-chat3x220x308.png -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.xcassets/button-link.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "button-link.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.xcassets/button-link.imageset/button-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luzefeng/TumblrPopMenu/020fe36fc40edef87c0e39e6fa689d9afce59cf2/TumblrPopMenu/PopMenu/PopMenu.xcassets/button-link.imageset/button-link.png -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.xcassets/button-photo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "button-photo.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.xcassets/button-photo.imageset/button-photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luzefeng/TumblrPopMenu/020fe36fc40edef87c0e39e6fa689d9afce59cf2/TumblrPopMenu/PopMenu/PopMenu.xcassets/button-photo.imageset/button-photo.png -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.xcassets/button-quote.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "button-quote.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.xcassets/button-quote.imageset/button-quote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luzefeng/TumblrPopMenu/020fe36fc40edef87c0e39e6fa689d9afce59cf2/TumblrPopMenu/PopMenu/PopMenu.xcassets/button-quote.imageset/button-quote.png -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.xcassets/button-text.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "button-text.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.xcassets/button-text.imageset/button-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luzefeng/TumblrPopMenu/020fe36fc40edef87c0e39e6fa689d9afce59cf2/TumblrPopMenu/PopMenu/PopMenu.xcassets/button-text.imageset/button-text.png -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.xcassets/button-video.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "button-video.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenu.xcassets/button-video.imageset/button-video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luzefeng/TumblrPopMenu/020fe36fc40edef87c0e39e6fa689d9afce59cf2/TumblrPopMenu/PopMenu/PopMenu.xcassets/button-video.imageset/button-video.png -------------------------------------------------------------------------------- /TumblrPopMenu/PopMenu/PopMenuDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PopMenuDelegate.swift 3 | // TumblrPopMenu 4 | // 5 | // Created by lu on 16/2/22. 6 | // Copyright © 2016年 lu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol PopMenuDelegate { 12 | func didClickMenu(index: Int) 13 | } -------------------------------------------------------------------------------- /TumblrPopMenu/TumblrPopMenu.xcdatamodeld/.xccurrentversion: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _XCCurrentVersionName 6 | TumblrPopMenu.xcdatamodel 7 | 8 | 9 | -------------------------------------------------------------------------------- /TumblrPopMenu/TumblrPopMenu.xcdatamodeld/TumblrPopMenu.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /TumblrPopMenu/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // TumblrPopMenu 4 | // 5 | // Created by lu on 16/2/22. 6 | // Copyright © 2016年 lu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController, PopMenuDelegate { 12 | var menuView: PopMenu! 13 | @IBOutlet weak var button: UIButton! 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | // Do any additional setup after loading the view, typically from a nib. 17 | menuView = PopMenu(frame: self.view.frame) 18 | menuView.delegate = self 19 | self.view.addSubview(menuView) 20 | } 21 | 22 | @IBAction func handleTap(sender: AnyObject) { 23 | menuView.showMenuView() 24 | } 25 | 26 | func didClickMenu(index: Int) { 27 | print("click at \(index)") 28 | } 29 | 30 | override func didReceiveMemoryWarning() { 31 | super.didReceiveMemoryWarning() 32 | // Dispose of any resources that can be recreated. 33 | } 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /TumblrPopMenuTests/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 | -------------------------------------------------------------------------------- /TumblrPopMenuTests/TumblrPopMenuTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TumblrPopMenuTests.swift 3 | // TumblrPopMenuTests 4 | // 5 | // Created by lu on 16/2/22. 6 | // Copyright © 2016年 lu. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import TumblrPopMenu 11 | 12 | class TumblrPopMenuTests: 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 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /TumblrPopMenuUITests/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 | -------------------------------------------------------------------------------- /TumblrPopMenuUITests/TumblrPopMenuUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TumblrPopMenuUITests.swift 3 | // TumblrPopMenuUITests 4 | // 5 | // Created by lu on 16/2/22. 6 | // Copyright © 2016年 lu. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class TumblrPopMenuUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | --------------------------------------------------------------------------------