LMDropdownView icon indicating copy to clipboard operation
LMDropdownView copied to clipboard

Please Update the demo for Swift

Open jefferyleo opened this issue 8 years ago • 4 comments

We need to refer on swift tutorial on how to implement this drop down view into our project.

jefferyleo avatar Nov 27 '15 01:11 jefferyleo

@jefferyleo I don't have time. Do it yourself !

lminhtm avatar Nov 27 '15 04:11 lminhtm

Here is how I implemented it in Swift:

 var table: UITableView?
 var barButton: BBBadgeBarButtonItem?

if self.table == nil {
                    self.table = UITableView()
                    self.table!.frame = CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), min(CGRectGetHeight(self.view.bounds)/2, CGFloat(InstanceReferences.userChildren!.count * 44)));
                    self.table!.dataSource = self
                    self.table!.delegate = self
                    self.table!.registerNib(UINib(nibName: "ChildTableViewCell", bundle: NSBundle.mainBundle()), forCellReuseIdentifier: "cell")
                    self.table!.separatorStyle = .None
                    self.table!.backgroundColor = UIColor(red: 250.0/255.0, green: 250.0/255.0, blue: 250.0/255.0, alpha: 1.0)
                }

                if self.drop.isOpen {
                    self.drop.hide()
                }else{
                    self.table!.reloadData()
                    self.drop.showInView(self.view!, withContentView: self.table!, atOrigin: CGPoint(x: 0, y: self.navigationController!.navigationBar.frame.size.height + UIApplication.sharedApplication().statusBarFrame.size.height))
                }

And here is the output:

simulator screen shot nov 27 2015 10 20 00 am

for Navigationbar badge I used: https://github.com/TanguyAladenise/BBBadgeBarButtonItem

OmarBizreh avatar Nov 27 '15 08:11 OmarBizreh

@OmarBizreh make a pull request....

jefferyleo avatar Nov 27 '15 09:11 jefferyleo

@OmarBizreh can you please provide the sample swift code/project?

famictech2000 avatar Dec 22 '16 02:12 famictech2000