├── PopBar ├── PopBar.swift ├── PopBarButton.swift ├── PopBarSimple.swift └── PopBarSimpleButton.swift ├── PopBarDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── caydyn.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── caydyn.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── PopBarDemo.xcscheme │ └── xcschememanagement.plist ├── PopBarDemo ├── AppDelegate.swift ├── Assets.xcassets │ ├── Action_Delete.imageset │ │ ├── Contents.json │ │ ├── Fav_Multi_Delete@3x-1.png │ │ └── Fav_Multi_Delete@3x.png │ ├── AlbumLikeHL.imageset │ │ ├── AlbumDetailsPgeLikeBig@3x-1.png │ │ ├── AlbumDetailsPgeLikeBig@3x.png │ │ └── Contents.json │ ├── AlbumOperateMore.imageset │ │ ├── AlbumOperateMore@3x-1.png │ │ ├── AlbumOperateMore@3x-2.png │ │ ├── AlbumOperateMore@3x.png │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── Session_Multi_Forward.imageset │ │ ├── Contents.json │ │ ├── Fav_Multi_Forward@3x-1.png │ │ └── Fav_Multi_Forward@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── DemoView.swift ├── Info.plist ├── PopView.xib └── popView.swift ├── README.md └── demonstrate.gif /PopBar/PopBar.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PopBarView.swift 3 | // 4 | // Created by 史凯迪 on 15/8/14. 5 | // Copyright © 2015年 msy. All rights reserved. 6 | // 7 | 8 | import UIKit 9 | 10 | /* 用于外部关闭最后一个打开的 */ 11 | var _lastPopBarView: PopBar? 12 | /* 自动关闭弹出条菜单 */ 13 | func _autoClosePopBarView() { 14 | _lastPopBarView?.togglePopBar(nil) 15 | } 16 | 17 | /* 弹出的方向 */ 18 | enum PopToDirection: Int { 19 | case popToLeft = 1; 20 | case popToRight = 2; 21 | } 22 | 23 | /* 弹出的大小设定, 更具需要修改 */ 24 | struct PopBarOptions { 25 | static var popbarNibName: String = "" 26 | static var popBarWidth: CGFloat = 198 27 | static var popBarHeight: CGFloat = 30 28 | static var popbarDistance: CGFloat = 1 29 | static var popBarBGColor: UIColor = 30 | UIColor(red: 76/255, green: 81/255, blue: 84/255, alpha: 1) 31 | static var popToDirection: PopToDirection = .popToLeft 32 | } 33 | 34 | class PopBar: UIView { 35 | 36 | /* 监测 */ 37 | private var popBarViewHasShow: Bool = false 38 | private var initCalculate: Bool = false 39 | 40 | /* 参数 */ 41 | var nibView: UIView? 42 | private var collapseFrame: CGRect? //缩小 43 | private var expansionFrame: CGRect? //展开 44 | 45 | /* 默认初始化(默认传入展开后的frame) */ 46 | override init(frame: CGRect) { 47 | super.init(frame: frame) 48 | 49 | self.layer.masksToBounds = true 50 | self.layer.cornerRadius = 5.0 51 | /* 纪录相关的frame */ 52 | self.expansionFrame = frame 53 | self.collapseFrame = 54 | CGRect(x: frame.origin.x, y: frame.origin.y, 55 | width: 0, height: frame.height) 56 | /* 默认未展开, X/Y均为0 */ 57 | self.frame = self.collapseFrame! 58 | self.backgroundColor = PopBarOptions.popBarBGColor 59 | self.initView() 60 | /* 默认隐藏 */ 61 | self.hidden = true 62 | } 63 | 64 | private func initView() { 65 | if PopBarOptions.popbarNibName.isEmpty { 66 | return 67 | } else { 68 | let nib: UINib = 69 | UINib(nibName: PopBarOptions.popbarNibName, bundle: nil) 70 | self.nibView = 71 | nib.instantiateWithOwner(self, options: nil)[0] as? UIView 72 | self.nibView?.frame = CGRectMake(0, 0, 73 | PopBarOptions.popBarWidth, PopBarOptions.popBarHeight) 74 | self.nibView?.hidden = true 75 | self.addSubview(self.nibView!) 76 | } 77 | } 78 | 79 | required init?(coder aDecoder: NSCoder) { 80 | super.init(coder: aDecoder) 81 | } 82 | 83 | private func initCalculateRelativePosition(actionFrame: CGRect) { 84 | 85 | var pointY: CGFloat = 0 86 | var pointXOfCollapse: CGFloat = 0 87 | var pointXOfExpansion: CGFloat = 0 88 | 89 | /* 计算Y */ 90 | let originalY: CGFloat = actionFrame.origin.y 91 | if actionFrame.height > self.frame.height { 92 | /* 居中下移 */ 93 | pointY = 94 | originalY + ((actionFrame.height - self.frame.height) / 2) 95 | } else { 96 | /* 居中上移 */ 97 | pointY = 98 | originalY - ((self.frame.height - actionFrame.height) / 2) 99 | } 100 | /* 计算X */ 101 | let originalX: CGFloat = actionFrame.origin.x 102 | switch PopBarOptions.popToDirection { 103 | case .popToLeft:/* 向左展开 */ 104 | pointXOfCollapse = originalX - PopBarOptions.popbarDistance 105 | pointXOfExpansion = originalX - 106 | (self.expansionFrame!.width + PopBarOptions.popbarDistance) 107 | case .popToRight:/* 向右展开 */ 108 | pointXOfCollapse = originalX + PopBarOptions.popbarDistance 109 | pointXOfExpansion = originalX + 110 | (self.expansionFrame!.width + PopBarOptions.popbarDistance) 111 | } 112 | 113 | /* 将计算机的结果重新赋值 */ 114 | self.collapseFrame = CGRect(x: pointXOfCollapse, y: pointY, 115 | width: 0, height: self.frame.height) 116 | self.expansionFrame = CGRect(x: pointXOfExpansion, y: pointY, 117 | width: self.expansionFrame!.width, height: self.frame.height) 118 | self.frame = self.collapseFrame! 119 | } 120 | 121 | private func dismissPopBarView() { 122 | self.nibView?.hidden = true 123 | 124 | UIView.animateWithDuration(0.3, animations: { () -> Void in 125 | self.frame = self.collapseFrame! 126 | }, completion: { (finish) -> Void in 127 | self.popBarViewHasShow = false 128 | self.hidden = true 129 | }) 130 | } 131 | 132 | private func showPopBarView() { 133 | self.hidden = false 134 | 135 | UIView.animateWithDuration(0.3, delay: 0.0, 136 | options: UIViewAnimationOptions.CurveEaseInOut, animations: { () -> Void in 137 | self.frame = self.expansionFrame! 138 | }) { (finish) -> Void in 139 | self.nibView?.hidden = false 140 | self.popBarViewHasShow = true 141 | _lastPopBarView = self 142 | } 143 | } 144 | 145 | internal func togglePopBar(frame: CGRect?) { 146 | 147 | if !self.initCalculate { 148 | if let _ = frame { 149 | self.initCalculateRelativePosition(frame!) 150 | } 151 | self.initCalculate = true 152 | } 153 | 154 | if self.popBarViewHasShow { 155 | self.dismissPopBarView() 156 | _lastPopBarView = nil 157 | } else { 158 | _autoClosePopBarView() 159 | self.showPopBarView() 160 | } 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /PopBar/PopBarButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PopBarButton.swift 3 | // 4 | // Created by 史凯迪 on 15/8/17. 5 | // Copyright © 2015年 msy. All rights reserved. 6 | // 7 | 8 | import UIKit 9 | 10 | class PopBarButton: UIButton { 11 | 12 | private var popBar: PopBar? 13 | private var addPopBar: Bool = false 14 | var popBarView: AnyObject? 15 | 16 | override init(frame: CGRect) { 17 | super.init(frame: frame) 18 | self.initPopBar() 19 | } 20 | 21 | required init?(coder aDecoder: NSCoder) { 22 | super.init(coder: aDecoder) 23 | self.initPopBar() 24 | } 25 | 26 | private func initPopBar() { 27 | let popBarFrame: CGRect = CGRectMake(0, 0, 28 | PopBarOptions.popBarWidth, PopBarOptions.popBarHeight) 29 | self.popBar = PopBar(frame: popBarFrame) 30 | self.popBarView = self.popBar?.nibView 31 | } 32 | 33 | internal func togglePopBar() { 34 | if !self.addPopBar { 35 | self.superview?.addSubview(self.popBar!) 36 | self.addPopBar = true 37 | } 38 | self.popBar?.togglePopBar(self.frame) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /PopBar/PopBarSimple.swift: -------------------------------------------------------------------------------- 1 | // 2 | // popBarView.swift 3 | // 4 | // Created by 史凯迪 on 15/8/12. 5 | // Copyright © 2015年 msy. All rights reserved. 6 | // 7 | 8 | import UIKit 9 | 10 | class popViewBase: UIView { 11 | /* 激活按钮 */ 12 | internal var ActiveBtn: PopBarButtonSimple? 13 | } 14 | 15 | class PopBarViewSimple: popViewBase { 16 | 17 | /* 大小 */ 18 | private var viewFrameBeforePop: CGRect! 19 | private var viewFrameAfterPop: CGRect! 20 | 21 | /* 默认按钮 (赞和分享)*/ 22 | private var useDefaultButton: Bool = true 23 | private var greatButton: UIButton! 24 | private var shareButton: UIButton! 25 | internal var greatBtnAction: (() -> Void)! 26 | internal var shareBtnAction: (() -> Void)! 27 | 28 | override init(frame: CGRect) { 29 | super.init(frame: frame) 30 | self.viewFrameBeforePop = frame 31 | /* 圆角边框 */ 32 | self.layer.masksToBounds = true 33 | self.layer.cornerRadius = 5.0 34 | } 35 | 36 | /* 使用默认按钮的初始化方法 */ 37 | convenience init(frame: CGRect, useDefault: Bool) { 38 | self.init(frame: frame) 39 | /* 默认仅仅添加两个按钮,赞和分享 */ 40 | self.addDefaultButton() 41 | } 42 | 43 | /* 传入自定义的Buttons,仅仅处理添加 */ 44 | convenience init(frame: CGRect, afterPopFrame: CGRect, 45 | buttons: [UIButton]?) { 46 | self.init(frame: frame) 47 | self.viewFrameAfterPop = afterPopFrame 48 | 49 | if let addButtons = buttons { 50 | /* 计算每个Button的布局(平均分布) */ 51 | let buttonWidth: CGFloat = 52 | (afterPopFrame.width / CGFloat(addButtons.count)) 53 | let buttonHeight: CGFloat = afterPopFrame.height 54 | /* 添加自定义的按钮 */ 55 | var buttonXOffset: CGFloat = 0 56 | for button in addButtons { 57 | button.frame = CGRect(x: buttonXOffset, y: 0, 58 | width: buttonWidth, height: buttonHeight) 59 | self.addSubview(button) 60 | buttonXOffset += buttonWidth 61 | } 62 | } 63 | } 64 | 65 | /* 添加默认的按钮 */ 66 | private func addDefaultButton() { 67 | let defaultButtonAction: Selector = Selector("defaultBtnAction:") 68 | 69 | let greateButtonFrame: CGRect = CGRect(x: 0, y: 0, 70 | width: 50, height: 30) 71 | self.greatButton = self.createButton(greateButtonFrame, 72 | btnAction: defaultButtonAction) 73 | self.greatButton.tag = 0 74 | 75 | let shareButtonFrame: CGRect = CGRect(x: 50, y: 0, 76 | width: 50, height: 30) 77 | self.shareButton = self.createButton(shareButtonFrame, 78 | btnAction: defaultButtonAction) 79 | self.shareButton.tag = 1 80 | 81 | self.addSubview(greatButton) 82 | self.addSubview(shareButton) 83 | } 84 | 85 | /* 移除默认的按钮 */ 86 | private func removeDefaultButton() { 87 | self.greatButton.removeFromSuperview() 88 | self.shareButton.removeFromSuperview() 89 | 90 | self.greatButton = nil 91 | self.shareButton = nil 92 | } 93 | 94 | /* 公共方法设置默认按钮标题 */ 95 | internal func setDefaultButtonSetTitle() { 96 | if let _ = self.greatButton { 97 | self.greatButton.setTitle("赞", forState: .Normal) 98 | } 99 | if let _ = self.shareButton { 100 | self.shareButton.setTitle("分享", forState: .Normal) 101 | } 102 | } 103 | 104 | /* 创建按钮 */ 105 | private func createButton(frame: CGRect, btnAction: Selector) -> UIButton { 106 | let button: UIButton = UIButton(type: .Custom) 107 | button.frame = frame 108 | button.titleLabel?.font = UIFont.boldSystemFontOfSize(12) 109 | button.addTarget(self, action: btnAction, forControlEvents: .TouchUpInside) 110 | return button 111 | } 112 | 113 | required init?(coder aDecoder: NSCoder) { 114 | super.init(coder: aDecoder) 115 | } 116 | 117 | enum defaultBtnType: Int { 118 | case greatBtn = 0; 119 | case shareBtn = 1; 120 | } 121 | 122 | /* 默认按钮激活事件 */ 123 | func defaultBtnAction(sender: UIButton) { 124 | let btnType: defaultBtnType = defaultBtnType(rawValue: sender.tag)! 125 | switch btnType { 126 | case .greatBtn: 127 | if let greatAction = self.greatBtnAction { 128 | greatAction() 129 | } 130 | case .shareBtn: 131 | if let shareAction = self.shareBtnAction { 132 | shareAction() 133 | } 134 | } 135 | } 136 | } -------------------------------------------------------------------------------- /PopBar/PopBarSimpleButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // popBarViewButton.swift 3 | // 4 | // Created by 史凯迪 on 15/8/12. 5 | // Copyright © 2015年 msy. All rights reserved. 6 | // 7 | 8 | import UIKit 9 | 10 | /* 用于外部关闭最后一个打开的 */ 11 | var _lastPopBarButtomView: popViewBase? 12 | /* 自动关闭弹出条菜单 */ 13 | func _autoClosePopBarButtonView() { 14 | if let _ = _lastPopBarButtomView { 15 | if let _ = _lastPopBarButtomView?.ActiveBtn { 16 | _lastPopBarButtomView?.ActiveBtn?.togglePopView(nil) 17 | } 18 | } 19 | } 20 | 21 | /* 弹出的方向 */ 22 | enum popViewDirection: Int { 23 | case popToLeft = 1; 24 | case popToRight = 2; 25 | } 26 | /* 开启的弹出条类型 */ 27 | enum popViewType: Int { 28 | case defaultPopBarView = 1; 29 | case customPopBarView = 2; 30 | } 31 | /* 传入的弹出条类型 */ 32 | enum setPopViewType: Int { 33 | case nib = 1; 34 | case view = 2; 35 | } 36 | 37 | /* 弹出的大小设定, 更具需要修改 */ 38 | struct PopBarSimpleOptions { 39 | static var popBarViewWidth: CGFloat = 100 40 | static var popBarViewHeight: CGFloat = 30 41 | static var popbarViewDistanceWithButton: CGFloat = 1 42 | static var popDirection: popViewDirection = .popToLeft 43 | } 44 | 45 | class PopBarButtonSimple: UIButton { 46 | 47 | /* 开启的弹出条 */ 48 | private var xpopViewType: popViewType! 49 | private var xpopBarView: PopBarViewSimple? 50 | private var xcusPopView: popViewBase? 51 | 52 | /* 计算弹出的Frame */ 53 | private var popBarViewOriginalFrame: CGRect! 54 | private var popBarViewFrame: CGRect! 55 | 56 | /* 判断 */ 57 | private var popBarViewHasInit: Bool = false 58 | private var popBarViewHasShow: Bool = false 59 | private var customPopBarView: Bool = false 60 | private var actionAfterPop: (() -> Void)! 61 | 62 | /* 标准初始化方法 */ 63 | override init(frame: CGRect) { 64 | super.init(frame: frame) 65 | self.xpopViewType = .defaultPopBarView 66 | } 67 | 68 | /* 默认仅有两个Button的View */ 69 | convenience init(frame: CGRect, greateAction: (() -> Void), 70 | shareAction: (() -> Void)) { 71 | self.init(frame: frame) 72 | self.initDefaultSimplePopBarView(frame) 73 | self.setDefaultAction(greateAction, shareAction: shareAction) 74 | } 75 | 76 | /* 自定义多个Button的View */ 77 | convenience init(frame: CGRect, afterPopFrame: CGRect, 78 | popBarViewBtns: [UIButton]?, actionAfterPop: (() -> Void)?) { 79 | self.init(frame: frame) 80 | 81 | if let buttons = popBarViewBtns { 82 | self.customPopBarView = true 83 | self.actionAfterPop = actionAfterPop 84 | self.xpopBarView = PopBarViewSimple(frame: self.popBarViewOriginalFrame, 85 | afterPopFrame: self.popBarViewFrame, buttons: buttons) 86 | } 87 | } 88 | 89 | /* 自定义一个View显示 */ 90 | convenience init(frame: CGRect, popView: UIView, popViewFrame: CGRect) { 91 | self.init(frame: frame) 92 | self.initPopViewWithView(popView, setViewFrame: popViewFrame) 93 | } 94 | 95 | /* 自定义一个NIB文件的View显示 */ 96 | convenience init(frame: CGRect, popNib: UINib, nibIndex: Int, popViewFrame: CGRect) { 97 | self.init(frame: frame) 98 | 99 | self.initPopViewWithNib(popNib, setIndex: nibIndex, setViewFrame: popViewFrame) 100 | } 101 | 102 | private func initPopViewWithView(setView: UIView, setViewFrame: CGRect) { 103 | self.xpopViewType = .customPopBarView 104 | 105 | self.xcusPopView = (setView as! popViewBase) 106 | self.xcusPopView?.frame = setViewFrame 107 | } 108 | 109 | private func initPopViewWithNib(setNib: UINib, setIndex: Int, setViewFrame: CGRect) { 110 | self.xpopViewType = .customPopBarView 111 | 112 | let Xview: UIView = 113 | setNib.instantiateWithOwner(nil, options: nil)[setIndex] as! popViewBase 114 | Xview.frame = setViewFrame 115 | 116 | self.xcusPopView = (Xview as! popViewBase) 117 | self.xcusPopView?.frame = setViewFrame 118 | } 119 | 120 | private func initDefaultSimplePopBarView(buttonFrame: CGRect) { 121 | 122 | var popBarViewOriginalX: CGFloat = 0 123 | var popBarViewX: CGFloat = 0 124 | var popBarViewY: CGFloat = 0 125 | 126 | /* 计算弹出视图的位置 */ 127 | if buttonFrame.height > PopBarSimpleOptions.popBarViewHeight{ 128 | popBarViewY = buttonFrame.origin.y + 129 | ((buttonFrame.height - PopBarSimpleOptions.popBarViewHeight) / 2) 130 | } else { 131 | popBarViewY = buttonFrame.origin.y - 132 | ((PopBarSimpleOptions.popBarViewHeight - buttonFrame.height) / 2) 133 | } 134 | switch PopBarSimpleOptions.popDirection { 135 | case .popToLeft: 136 | popBarViewOriginalX = 137 | buttonFrame.origin.x - PopBarSimpleOptions.popbarViewDistanceWithButton 138 | popBarViewX = 139 | buttonFrame.origin.x - 140 | (PopBarSimpleOptions.popbarViewDistanceWithButton + PopBarSimpleOptions.popBarViewWidth) 141 | case .popToRight: 142 | popBarViewOriginalX = 143 | buttonFrame.origin.x + PopBarSimpleOptions.popbarViewDistanceWithButton 144 | popBarViewX = 145 | buttonFrame.origin.x + 146 | (PopBarSimpleOptions.popbarViewDistanceWithButton + PopBarSimpleOptions.popBarViewWidth) 147 | break 148 | } 149 | 150 | /* 初始化的位置 */ 151 | self.popBarViewOriginalFrame = 152 | CGRect(x: popBarViewOriginalX, y: popBarViewY, 153 | width: 0, height: PopBarSimpleOptions.popBarViewHeight) 154 | /* 弹出后的位置 */ 155 | self.popBarViewFrame = 156 | CGRect(x: popBarViewX, y: popBarViewY, 157 | width: PopBarSimpleOptions.popBarViewWidth, 158 | height: PopBarSimpleOptions.popBarViewHeight) 159 | /* 默认初始化 */ 160 | self.xpopBarView = PopBarViewSimple(frame: self.popBarViewOriginalFrame, 161 | useDefault: true) 162 | self.xpopBarView?.ActiveBtn = self 163 | 164 | /* 已初始化标记 */ 165 | self.popBarViewHasInit = true 166 | } 167 | 168 | 169 | /* waitting.... */ 170 | private func initCustomPopBarView(buttonFrame: CGRect) { 171 | 172 | } 173 | 174 | private func initPopBarView(buttonFrame: CGRect) { 175 | switch self.xpopViewType! { 176 | case .customPopBarView: 177 | self.initCustomPopBarView(buttonFrame) 178 | case .defaultPopBarView: 179 | self.initDefaultSimplePopBarView(buttonFrame) 180 | } 181 | } 182 | 183 | required init?(coder aDecoder: NSCoder) { 184 | super.init(coder: aDecoder) 185 | self.xpopViewType = .defaultPopBarView 186 | } 187 | 188 | private func showPopBarView() { 189 | self.popBarViewHasShow = true 190 | 191 | _lastPopBarButtomView = self.xpopBarView 192 | 193 | self.xpopBarView!.backgroundColor = UIColor.grayColor() 194 | self.superview?.addSubview(self.xpopBarView!) 195 | 196 | UIView.animateWithDuration(0.3, delay: 0.0, 197 | options: UIViewAnimationOptions.CurveEaseInOut, animations: { () -> Void in 198 | self.xpopBarView!.frame = self.popBarViewFrame 199 | }) { (finish) -> Void in 200 | if self.customPopBarView { 201 | self.actionAfterPop() 202 | } else { 203 | self.xpopBarView?.setDefaultButtonSetTitle() 204 | } 205 | } 206 | } 207 | 208 | private func dismissPopBarView() { 209 | self.popBarViewHasShow = false 210 | 211 | UIView.animateWithDuration(0.3, animations: { () -> Void in 212 | self.xpopBarView!.frame = self.popBarViewOriginalFrame 213 | }, completion: { (finish) -> Void in 214 | self.xpopBarView?.removeFromSuperview() 215 | }) 216 | } 217 | 218 | internal func setDefaultAction(greatAction: (() -> Void)?, 219 | shareAction: (() -> Void)?) { 220 | self.xpopBarView?.greatBtnAction = greatAction 221 | self.xpopBarView?.shareBtnAction = shareAction 222 | } 223 | 224 | internal func togglePopView(buttonFrame: CGRect?) { 225 | 226 | if !self.popBarViewHasInit { 227 | if let Bframe = buttonFrame { 228 | self.initPopBarView(Bframe) 229 | } 230 | } 231 | 232 | if self.popBarViewHasShow { 233 | self.dismissPopBarView() 234 | _lastPopBarButtomView = nil 235 | } else { 236 | if let _ = _lastPopBarButtomView { 237 | _autoClosePopBarButtonView() 238 | } 239 | self.showPopBarView() 240 | } 241 | } 242 | 243 | deinit { 244 | self.xpopBarView = nil 245 | } 246 | } -------------------------------------------------------------------------------- /PopBarDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 782F14EF1B7B147B00B6D772 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 782F14EE1B7B147B00B6D772 /* AppDelegate.swift */; }; 11 | 782F14F11B7B147B00B6D772 /* DemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 782F14F01B7B147B00B6D772 /* DemoView.swift */; }; 12 | 782F14F41B7B147B00B6D772 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 782F14F21B7B147B00B6D772 /* Main.storyboard */; }; 13 | 782F14F61B7B147B00B6D772 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 782F14F51B7B147B00B6D772 /* Assets.xcassets */; }; 14 | 782F14F91B7B147B00B6D772 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 782F14F71B7B147B00B6D772 /* LaunchScreen.storyboard */; }; 15 | 78394C741B7DD98B0047D1FF /* PopBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78394C731B7DD98B0047D1FF /* PopBar.swift */; }; 16 | 78AD73AD1B7D81C300391778 /* PopBarSimple.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78AD73AB1B7D81C300391778 /* PopBarSimple.swift */; }; 17 | 78AD73AE1B7D81C300391778 /* PopBarSimpleButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78AD73AC1B7D81C300391778 /* PopBarSimpleButton.swift */; }; 18 | 78AD73B41B7D840600391778 /* PopView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 78AD73B31B7D840600391778 /* PopView.xib */; }; 19 | 78EA56FE1B8184F90015A971 /* popView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78EA56FD1B8184F90015A971 /* popView.swift */; }; 20 | 78EA57021B818C920015A971 /* PopBarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78EA57011B818C920015A971 /* PopBarButton.swift */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | 782F14EB1B7B147B00B6D772 /* PopBarDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PopBarDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 782F14EE1B7B147B00B6D772 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 26 | 782F14F01B7B147B00B6D772 /* DemoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoView.swift; sourceTree = ""; }; 27 | 782F14F31B7B147B00B6D772 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 28 | 782F14F51B7B147B00B6D772 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 29 | 782F14F81B7B147B00B6D772 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 30 | 782F14FA1B7B147B00B6D772 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | 78394C731B7DD98B0047D1FF /* PopBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PopBar.swift; path = PopBar/PopBar.swift; sourceTree = SOURCE_ROOT; }; 32 | 78AD73AB1B7D81C300391778 /* PopBarSimple.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PopBarSimple.swift; path = PopBar/PopBarSimple.swift; sourceTree = SOURCE_ROOT; }; 33 | 78AD73AC1B7D81C300391778 /* PopBarSimpleButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PopBarSimpleButton.swift; path = PopBar/PopBarSimpleButton.swift; sourceTree = SOURCE_ROOT; }; 34 | 78AD73B31B7D840600391778 /* PopView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PopView.xib; sourceTree = ""; }; 35 | 78EA56FD1B8184F90015A971 /* popView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = popView.swift; sourceTree = ""; }; 36 | 78EA57011B818C920015A971 /* PopBarButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PopBarButton.swift; path = PopBar/PopBarButton.swift; sourceTree = SOURCE_ROOT; }; 37 | /* End PBXFileReference section */ 38 | 39 | /* Begin PBXFrameworksBuildPhase section */ 40 | 782F14E81B7B147B00B6D772 /* Frameworks */ = { 41 | isa = PBXFrameworksBuildPhase; 42 | buildActionMask = 2147483647; 43 | files = ( 44 | ); 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | /* End PBXFrameworksBuildPhase section */ 48 | 49 | /* Begin PBXGroup section */ 50 | 782F14E21B7B147B00B6D772 = { 51 | isa = PBXGroup; 52 | children = ( 53 | 782F14ED1B7B147B00B6D772 /* PopViewDemo */, 54 | 782F14EC1B7B147B00B6D772 /* Products */, 55 | ); 56 | sourceTree = ""; 57 | }; 58 | 782F14EC1B7B147B00B6D772 /* Products */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 782F14EB1B7B147B00B6D772 /* PopBarDemo.app */, 62 | ); 63 | name = Products; 64 | sourceTree = ""; 65 | }; 66 | 782F14ED1B7B147B00B6D772 /* PopViewDemo */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 782F14EE1B7B147B00B6D772 /* AppDelegate.swift */, 70 | 782F14F51B7B147B00B6D772 /* Assets.xcassets */, 71 | 782F14F01B7B147B00B6D772 /* DemoView.swift */, 72 | 782F14FA1B7B147B00B6D772 /* Info.plist */, 73 | 782F14F71B7B147B00B6D772 /* LaunchScreen.storyboard */, 74 | 782F14F21B7B147B00B6D772 /* Main.storyboard */, 75 | 78AD73AA1B7D816900391778 /* PopBarButton */, 76 | 78AD73B31B7D840600391778 /* PopView.xib */, 77 | 78EA56FD1B8184F90015A971 /* popView.swift */, 78 | ); 79 | name = PopViewDemo; 80 | path = PopBarDemo; 81 | sourceTree = ""; 82 | }; 83 | 78AD73AA1B7D816900391778 /* PopBarButton */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 78AD73AB1B7D81C300391778 /* PopBarSimple.swift */, 87 | 78AD73AC1B7D81C300391778 /* PopBarSimpleButton.swift */, 88 | 78394C731B7DD98B0047D1FF /* PopBar.swift */, 89 | 78EA57011B818C920015A971 /* PopBarButton.swift */, 90 | ); 91 | name = PopBarButton; 92 | path = ../PopBar; 93 | sourceTree = ""; 94 | }; 95 | /* End PBXGroup section */ 96 | 97 | /* Begin PBXNativeTarget section */ 98 | 782F14EA1B7B147B00B6D772 /* PopBarDemo */ = { 99 | isa = PBXNativeTarget; 100 | buildConfigurationList = 782F14FD1B7B147B00B6D772 /* Build configuration list for PBXNativeTarget "PopBarDemo" */; 101 | buildPhases = ( 102 | 782F14E71B7B147B00B6D772 /* Sources */, 103 | 782F14E81B7B147B00B6D772 /* Frameworks */, 104 | 782F14E91B7B147B00B6D772 /* Resources */, 105 | ); 106 | buildRules = ( 107 | ); 108 | dependencies = ( 109 | ); 110 | name = PopBarDemo; 111 | productName = PopViewWithButton; 112 | productReference = 782F14EB1B7B147B00B6D772 /* PopBarDemo.app */; 113 | productType = "com.apple.product-type.application"; 114 | }; 115 | /* End PBXNativeTarget section */ 116 | 117 | /* Begin PBXProject section */ 118 | 782F14E31B7B147B00B6D772 /* Project object */ = { 119 | isa = PBXProject; 120 | attributes = { 121 | LastUpgradeCheck = 0700; 122 | ORGANIZATIONNAME = msy; 123 | TargetAttributes = { 124 | 782F14EA1B7B147B00B6D772 = { 125 | CreatedOnToolsVersion = 7.0; 126 | }; 127 | }; 128 | }; 129 | buildConfigurationList = 782F14E61B7B147B00B6D772 /* Build configuration list for PBXProject "PopBarDemo" */; 130 | compatibilityVersion = "Xcode 3.2"; 131 | developmentRegion = English; 132 | hasScannedForEncodings = 0; 133 | knownRegions = ( 134 | en, 135 | Base, 136 | ); 137 | mainGroup = 782F14E21B7B147B00B6D772; 138 | productRefGroup = 782F14EC1B7B147B00B6D772 /* Products */; 139 | projectDirPath = ""; 140 | projectRoot = ""; 141 | targets = ( 142 | 782F14EA1B7B147B00B6D772 /* PopBarDemo */, 143 | ); 144 | }; 145 | /* End PBXProject section */ 146 | 147 | /* Begin PBXResourcesBuildPhase section */ 148 | 782F14E91B7B147B00B6D772 /* Resources */ = { 149 | isa = PBXResourcesBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | 782F14F91B7B147B00B6D772 /* LaunchScreen.storyboard in Resources */, 153 | 782F14F61B7B147B00B6D772 /* Assets.xcassets in Resources */, 154 | 78AD73B41B7D840600391778 /* PopView.xib in Resources */, 155 | 782F14F41B7B147B00B6D772 /* Main.storyboard in Resources */, 156 | ); 157 | runOnlyForDeploymentPostprocessing = 0; 158 | }; 159 | /* End PBXResourcesBuildPhase section */ 160 | 161 | /* Begin PBXSourcesBuildPhase section */ 162 | 782F14E71B7B147B00B6D772 /* Sources */ = { 163 | isa = PBXSourcesBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | 78AD73AE1B7D81C300391778 /* PopBarSimpleButton.swift in Sources */, 167 | 78394C741B7DD98B0047D1FF /* PopBar.swift in Sources */, 168 | 78EA56FE1B8184F90015A971 /* popView.swift in Sources */, 169 | 78AD73AD1B7D81C300391778 /* PopBarSimple.swift in Sources */, 170 | 782F14F11B7B147B00B6D772 /* DemoView.swift in Sources */, 171 | 782F14EF1B7B147B00B6D772 /* AppDelegate.swift in Sources */, 172 | 78EA57021B818C920015A971 /* PopBarButton.swift in Sources */, 173 | ); 174 | runOnlyForDeploymentPostprocessing = 0; 175 | }; 176 | /* End PBXSourcesBuildPhase section */ 177 | 178 | /* Begin PBXVariantGroup section */ 179 | 782F14F21B7B147B00B6D772 /* Main.storyboard */ = { 180 | isa = PBXVariantGroup; 181 | children = ( 182 | 782F14F31B7B147B00B6D772 /* Base */, 183 | ); 184 | name = Main.storyboard; 185 | sourceTree = ""; 186 | }; 187 | 782F14F71B7B147B00B6D772 /* LaunchScreen.storyboard */ = { 188 | isa = PBXVariantGroup; 189 | children = ( 190 | 782F14F81B7B147B00B6D772 /* Base */, 191 | ); 192 | name = LaunchScreen.storyboard; 193 | sourceTree = ""; 194 | }; 195 | /* End PBXVariantGroup section */ 196 | 197 | /* Begin XCBuildConfiguration section */ 198 | 782F14FB1B7B147B00B6D772 /* Debug */ = { 199 | isa = XCBuildConfiguration; 200 | buildSettings = { 201 | ALWAYS_SEARCH_USER_PATHS = NO; 202 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 203 | CLANG_CXX_LIBRARY = "libc++"; 204 | CLANG_ENABLE_MODULES = YES; 205 | CLANG_ENABLE_OBJC_ARC = YES; 206 | CLANG_WARN_BOOL_CONVERSION = YES; 207 | CLANG_WARN_CONSTANT_CONVERSION = YES; 208 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 209 | CLANG_WARN_EMPTY_BODY = YES; 210 | CLANG_WARN_ENUM_CONVERSION = YES; 211 | CLANG_WARN_INT_CONVERSION = YES; 212 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 213 | CLANG_WARN_UNREACHABLE_CODE = YES; 214 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 215 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 216 | COPY_PHASE_STRIP = NO; 217 | DEBUG_INFORMATION_FORMAT = dwarf; 218 | ENABLE_STRICT_OBJC_MSGSEND = YES; 219 | ENABLE_TESTABILITY = YES; 220 | GCC_C_LANGUAGE_STANDARD = gnu99; 221 | GCC_DYNAMIC_NO_PIC = NO; 222 | GCC_NO_COMMON_BLOCKS = YES; 223 | GCC_OPTIMIZATION_LEVEL = 0; 224 | GCC_PREPROCESSOR_DEFINITIONS = ( 225 | "DEBUG=1", 226 | "$(inherited)", 227 | ); 228 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 229 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 230 | GCC_WARN_UNDECLARED_SELECTOR = YES; 231 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 232 | GCC_WARN_UNUSED_FUNCTION = YES; 233 | GCC_WARN_UNUSED_VARIABLE = YES; 234 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 235 | MTL_ENABLE_DEBUG_INFO = YES; 236 | ONLY_ACTIVE_ARCH = YES; 237 | SDKROOT = iphoneos; 238 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 239 | }; 240 | name = Debug; 241 | }; 242 | 782F14FC1B7B147B00B6D772 /* Release */ = { 243 | isa = XCBuildConfiguration; 244 | buildSettings = { 245 | ALWAYS_SEARCH_USER_PATHS = NO; 246 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 247 | CLANG_CXX_LIBRARY = "libc++"; 248 | CLANG_ENABLE_MODULES = YES; 249 | CLANG_ENABLE_OBJC_ARC = YES; 250 | CLANG_WARN_BOOL_CONVERSION = YES; 251 | CLANG_WARN_CONSTANT_CONVERSION = YES; 252 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 253 | CLANG_WARN_EMPTY_BODY = YES; 254 | CLANG_WARN_ENUM_CONVERSION = YES; 255 | CLANG_WARN_INT_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_UNREACHABLE_CODE = YES; 258 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 259 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 260 | COPY_PHASE_STRIP = NO; 261 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 262 | ENABLE_NS_ASSERTIONS = NO; 263 | ENABLE_STRICT_OBJC_MSGSEND = YES; 264 | GCC_C_LANGUAGE_STANDARD = gnu99; 265 | GCC_NO_COMMON_BLOCKS = YES; 266 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 267 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 268 | GCC_WARN_UNDECLARED_SELECTOR = YES; 269 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 270 | GCC_WARN_UNUSED_FUNCTION = YES; 271 | GCC_WARN_UNUSED_VARIABLE = YES; 272 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 273 | MTL_ENABLE_DEBUG_INFO = NO; 274 | SDKROOT = iphoneos; 275 | VALIDATE_PRODUCT = YES; 276 | }; 277 | name = Release; 278 | }; 279 | 782F14FE1B7B147B00B6D772 /* Debug */ = { 280 | isa = XCBuildConfiguration; 281 | buildSettings = { 282 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 283 | INFOPLIST_FILE = "$(SRCROOT)/PopBarDemo/Info.plist"; 284 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 285 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 286 | PRODUCT_BUNDLE_IDENTIFIER = com.msy.PopViewDemo; 287 | PRODUCT_NAME = PopBarDemo; 288 | }; 289 | name = Debug; 290 | }; 291 | 782F14FF1B7B147B00B6D772 /* Release */ = { 292 | isa = XCBuildConfiguration; 293 | buildSettings = { 294 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 295 | INFOPLIST_FILE = "$(SRCROOT)/PopBarDemo/Info.plist"; 296 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 297 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 298 | PRODUCT_BUNDLE_IDENTIFIER = com.msy.PopViewDemo; 299 | PRODUCT_NAME = PopBarDemo; 300 | }; 301 | name = Release; 302 | }; 303 | /* End XCBuildConfiguration section */ 304 | 305 | /* Begin XCConfigurationList section */ 306 | 782F14E61B7B147B00B6D772 /* Build configuration list for PBXProject "PopBarDemo" */ = { 307 | isa = XCConfigurationList; 308 | buildConfigurations = ( 309 | 782F14FB1B7B147B00B6D772 /* Debug */, 310 | 782F14FC1B7B147B00B6D772 /* Release */, 311 | ); 312 | defaultConfigurationIsVisible = 0; 313 | defaultConfigurationName = Release; 314 | }; 315 | 782F14FD1B7B147B00B6D772 /* Build configuration list for PBXNativeTarget "PopBarDemo" */ = { 316 | isa = XCConfigurationList; 317 | buildConfigurations = ( 318 | 782F14FE1B7B147B00B6D772 /* Debug */, 319 | 782F14FF1B7B147B00B6D772 /* Release */, 320 | ); 321 | defaultConfigurationIsVisible = 0; 322 | defaultConfigurationName = Release; 323 | }; 324 | /* End XCConfigurationList section */ 325 | }; 326 | rootObject = 782F14E31B7B147B00B6D772 /* Project object */; 327 | } 328 | -------------------------------------------------------------------------------- /PopBarDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PopBarDemo.xcodeproj/project.xcworkspace/xcuserdata/caydyn.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geek0x0/PopBarView-Swift/5781872861a777d0b302c556ec43dba88aff3d31/PopBarDemo.xcodeproj/project.xcworkspace/xcuserdata/caydyn.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PopBarDemo.xcodeproj/xcuserdata/caydyn.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /PopBarDemo.xcodeproj/xcuserdata/caydyn.xcuserdatad/xcschemes/PopBarDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /PopBarDemo.xcodeproj/xcuserdata/caydyn.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PopBarDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 782F14EA1B7B147B00B6D772 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /PopBarDemo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // PopViewWithButton 4 | // 5 | // Created by 史凯迪 on 15/8/12. 6 | // Copyright © 2015年 msy. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | PopBarOptions.popbarNibName = "PopView" 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 | } 44 | 45 | 46 | } 47 | 48 | -------------------------------------------------------------------------------- /PopBarDemo/Assets.xcassets/Action_Delete.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Fav_Multi_Delete@3x-1.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "Fav_Multi_Delete@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PopBarDemo/Assets.xcassets/Action_Delete.imageset/Fav_Multi_Delete@3x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geek0x0/PopBarView-Swift/5781872861a777d0b302c556ec43dba88aff3d31/PopBarDemo/Assets.xcassets/Action_Delete.imageset/Fav_Multi_Delete@3x-1.png -------------------------------------------------------------------------------- /PopBarDemo/Assets.xcassets/Action_Delete.imageset/Fav_Multi_Delete@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geek0x0/PopBarView-Swift/5781872861a777d0b302c556ec43dba88aff3d31/PopBarDemo/Assets.xcassets/Action_Delete.imageset/Fav_Multi_Delete@3x.png -------------------------------------------------------------------------------- /PopBarDemo/Assets.xcassets/AlbumLikeHL.imageset/AlbumDetailsPgeLikeBig@3x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geek0x0/PopBarView-Swift/5781872861a777d0b302c556ec43dba88aff3d31/PopBarDemo/Assets.xcassets/AlbumLikeHL.imageset/AlbumDetailsPgeLikeBig@3x-1.png -------------------------------------------------------------------------------- /PopBarDemo/Assets.xcassets/AlbumLikeHL.imageset/AlbumDetailsPgeLikeBig@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geek0x0/PopBarView-Swift/5781872861a777d0b302c556ec43dba88aff3d31/PopBarDemo/Assets.xcassets/AlbumLikeHL.imageset/AlbumDetailsPgeLikeBig@3x.png -------------------------------------------------------------------------------- /PopBarDemo/Assets.xcassets/AlbumLikeHL.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "AlbumDetailsPgeLikeBig@3x-1.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "AlbumDetailsPgeLikeBig@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PopBarDemo/Assets.xcassets/AlbumOperateMore.imageset/AlbumOperateMore@3x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geek0x0/PopBarView-Swift/5781872861a777d0b302c556ec43dba88aff3d31/PopBarDemo/Assets.xcassets/AlbumOperateMore.imageset/AlbumOperateMore@3x-1.png -------------------------------------------------------------------------------- /PopBarDemo/Assets.xcassets/AlbumOperateMore.imageset/AlbumOperateMore@3x-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geek0x0/PopBarView-Swift/5781872861a777d0b302c556ec43dba88aff3d31/PopBarDemo/Assets.xcassets/AlbumOperateMore.imageset/AlbumOperateMore@3x-2.png -------------------------------------------------------------------------------- /PopBarDemo/Assets.xcassets/AlbumOperateMore.imageset/AlbumOperateMore@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geek0x0/PopBarView-Swift/5781872861a777d0b302c556ec43dba88aff3d31/PopBarDemo/Assets.xcassets/AlbumOperateMore.imageset/AlbumOperateMore@3x.png -------------------------------------------------------------------------------- /PopBarDemo/Assets.xcassets/AlbumOperateMore.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AlbumOperateMore@3x-2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "AlbumOperateMore@3x-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "AlbumOperateMore@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /PopBarDemo/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 | } -------------------------------------------------------------------------------- /PopBarDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /PopBarDemo/Assets.xcassets/Session_Multi_Forward.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Fav_Multi_Forward@3x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "Fav_Multi_Forward@3x-1.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PopBarDemo/Assets.xcassets/Session_Multi_Forward.imageset/Fav_Multi_Forward@3x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geek0x0/PopBarView-Swift/5781872861a777d0b302c556ec43dba88aff3d31/PopBarDemo/Assets.xcassets/Session_Multi_Forward.imageset/Fav_Multi_Forward@3x-1.png -------------------------------------------------------------------------------- /PopBarDemo/Assets.xcassets/Session_Multi_Forward.imageset/Fav_Multi_Forward@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geek0x0/PopBarView-Swift/5781872861a777d0b302c556ec43dba88aff3d31/PopBarDemo/Assets.xcassets/Session_Multi_Forward.imageset/Fav_Multi_Forward@3x.png -------------------------------------------------------------------------------- /PopBarDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /PopBarDemo/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 | 29 | 37 | 44 | 51 | 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 | -------------------------------------------------------------------------------- /PopBarDemo/DemoView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // PopViewWithButton 4 | // 5 | // Created by 史凯迪 on 15/8/12. 6 | // Copyright © 2015年 msy. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | } 16 | 17 | func delay(delay:Double, closure:()->()) { 18 | dispatch_after( 19 | dispatch_time( 20 | DISPATCH_TIME_NOW, 21 | Int64(delay * Double(NSEC_PER_SEC)) 22 | ), 23 | dispatch_get_main_queue(), closure) 24 | } 25 | 26 | @IBAction func ShowMenu(sender: UIButton) { 27 | if let button: PopBarButtonSimple = sender as? PopBarButtonSimple { 28 | button.togglePopView(sender.frame) 29 | button.setDefaultAction({ () -> Void in 30 | button.togglePopView(sender.frame) 31 | }, shareAction: { () -> Void in 32 | button.togglePopView(sender.frame) 33 | }) 34 | } 35 | } 36 | 37 | @IBAction func CAction1(sender: PopBarButton) { 38 | sender.togglePopBar() 39 | } 40 | 41 | @IBAction func CAction2(sender: PopBarButton) { 42 | sender.togglePopBar() 43 | } 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /PopBarDemo/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 | -------------------------------------------------------------------------------- /PopBarDemo/PopView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 61 | 62 | 63 | 70 | 71 | 72 | 73 | 74 | 75 | 82 | 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 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /PopBarDemo/popView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // popView.swift 3 | // PopBarButtonDemo 4 | // 5 | // Created by 史凯迪 on 15/8/17. 6 | // Copyright © 2015年 msy. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class popView: UIView { 12 | @IBAction func GreatAction(sender: AnyObject) { 13 | print("点赞") 14 | _autoClosePopBarView() 15 | } 16 | @IBAction func DeleteAction(sender: AnyObject) { 17 | print("删除") 18 | _autoClosePopBarView() 19 | } 20 | @IBAction func ShareAction(sender: AnyObject) { 21 | print("分享") 22 | _autoClosePopBarView() 23 | } 24 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PopBarView-Swift 2 | [![WeiBo](http://img.shields.io/badge/contact-@Caydyn-orange.svg?style=flat)](http://weibo.com/372145087) 3 | [![ghit.me](https://ghit.me/badge.svg?repo=caydyn-skd/PopBarView-Swift)](https://ghit.me/repo/caydyn-skd/PopBarView-Swift) 4 | [![Language](http://img.shields.io/badge/language-swift-orange.svg?style=flat)](https://developer.apple.com/swift) 5 | [![Platform](https://img.shields.io/badge/platform-ios-lightgrey.svg?style=flat)](https://developer.apple.com/resources/) 6 | [![Issues](https://img.shields.io/github/issues/caydyn-skd/PopBarView-Swift.svg?style=flat)](https://github.com/caydyn-skd/PopBarView-Swift/issues) 7 | 8 | 基于Swift 2.0的弹出层按钮,类似于微信朋友圈的弹出按钮
9 | The popup button on Swift 2.0, similar to WeChat's Timeline eject button
10 | 实际效果如下图(Renderings):
11 | ![image](https://raw.githubusercontent.com/caydyn-skd/PopBarView-Swift/master/demonstrate.gif) 12 |
13 | #如何使用 14 | 1. 必须指定PopBarSimpleOptions或者PopBarOptions的参数,用于定义弹出的PopBar的大小
15 | 2. 可以直接指定StoryBoard的控件Class为PopBarButtonSimple或者PopBarButton
16 | 3. 可以使用对PopBarButtonSimple或者PopBar实例化创建PopBar
17 | 更多请参照Demo 18 |


19 | 20 | -------------------------------------------------------------------------------- /demonstrate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Geek0x0/PopBarView-Swift/5781872861a777d0b302c556ec43dba88aff3d31/demonstrate.gif --------------------------------------------------------------------------------