simsaens / menu Goto Github PK
View Code? Open in Web Editor NEWThe iOS Menu
License: MIT License
The iOS Menu
License: MIT License
Congratulations on the menu, it looks stunning and I believe this should be a standard UIKit control.
I have been playing with it in one of my apps and tried to add it to the navigation bar as UIBarButtonItem. The menu shows up correctly and it opens up as it should when tapping on it. However, it does not let you select any option.
This is because options are outside its superview(navbar) bounds. I am guessing I could override hittest and point(inside:), I haven't tried it yet. I just wanted to ask if I am missing something or this is the only way to go.
Thank you,
Hi,
First off, huge fan of the project! Best menu option for iOS that I've seen by far.
This may be a me problem, but I've been trying to create a dark theme based on your struct layout in MenuTheme.swift. For whatever reason, the menu title (UILabel) won't respect the set UIColor.
I see that, in MenuView.swift, you have the following setup:
public func applyTheme(_ theme: MenuTheme) {
self.theme = theme
titleLabel.font = theme.font
titleLabel.textColor = theme.darkTintColor
gestureBarView.backgroundColor = theme.gestureBarTint
tintView.backgroundColor = theme.backgroundTint
effectView.effect = theme.blurEffect
contents?.applyTheme(theme)
}
public override func tintColorDidChange() {
titleLabel.textColor = tintColor
}
}
The title label should always reflect either theme.darkTintColor
(or alternatively, tintColor
), correct?
I have the following set for my custom dark theme (in MenuTheme.swift):
public struct DarkMenuTheme: MenuTheme {
public let font = UIFont.systemFont(ofSize: 16, weight: .medium)
public let textColor = UIColor.white
public let brightTintColor = UIColor.white
public let darkTintColor = UIColor.white
public let highlightedTextColor = UIColor.white
public let highlightedBackgroundColor = UIColor(red: 0/255.0, green: 122/255.0, blue: 255/255.0, alpha: 1.0)
public let backgroundTint = UIColor(white: 0.0, alpha: 0.15)
public let gestureBarTint = UIColor(red: 255/255.0, green: 255/255.0, blue: 255/255.0, alpha: 0.7)
public let blurEffect = UIBlurEffect(style: .dark)
public let shadowColor = UIColor.black
public let shadowOpacity: Float = 0.3
public let shadowRadius: CGFloat = 7.0
public let separatorColor = UIColor(white: 1, alpha: 0.1)
public init() {}
}
However, regardless of what I do, the menu title will appear as UIColor.black
(or something very similar)ย โ as opposed to the set UIColor.white
value. When I select the menu title, it will turn white; however, at rest (non-interaction), it remains dark and I'm unable to change it without changing the core code.
Similarly, do you plan on adding the other three layout options to your project? ie. Menu dropdown to:
Thank you again for the project! It added such an elegant beauty to my simple web browser project.
EDIT: Also, are you planning on adding disabled menu options? ie. When a user can't go back in a WKWebView, disabling the "Back" menu option.
EDIT 2: Since SF Symbols were released relatively recently, is there any possibility of adding those as a menu title or adding an SF glyph next to the left of a menu item? Thanks!
As it currently stands, the code is released as "all rights reserved". Would you consider releasing under an open license to allow others to incorporate this into our own apps?
Can you please provide Adobe XD design as well? I can open the .sketch file with XD but some stuff are missing.
Many thanks.
As the title says, it's not pushed. And it's better to hurry up while the name is (surprisingly) available.
hi, how to disappear the menu while scrolling or something else pls.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.