Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please Update the demo for Swift #10

Open
jefferyleo opened this issue Nov 27, 2015 · 4 comments
Open

Please Update the demo for Swift #10

jefferyleo opened this issue Nov 27, 2015 · 4 comments

Comments

@jefferyleo
Copy link

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

@lminhtm
Copy link
Owner

lminhtm commented Nov 27, 2015

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

@OmarBizreh
Copy link

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

@jefferyleo
Copy link
Author

@OmarBizreh make a pull request....

@famictech2000
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants