Closed kgDe35NjrC closed 8 years ago
In general subclassing MaterialKit components is not necessary. The easiest way would be to use a CardView and set the appropriate properties. Something like this:
let cardView: CardView = CardView() cardView.titleLabel = UILabel() cardView.titleLabel!.text = "Use Google's location service?" // ... add styling
cardView.detailLabel = UILabel() cardView.detailLabel!.text = "Let Google help ... running." // ... add styling
// make flat buttons (disagree, agree) cardView.rightButtons = [disagree, agree]
When you do the positioning, MaterialLayout would make this easy.
When you do the depth, probably looking for .Depth5 cardView.shadowDepth = .Depth5
If you have any further questions, feel free to re-open or create a new ticket :)
How do I actually turn this cardview into an alert? Do I make a UILaertVieeController and set its view to the cardview?
Here's my current UIAlertController code:
let alert = UIAlertController(title: title, message: message, preferredStyle: .Alert)
let action = UIAlertAction(title: "Dismiss", style: .Default, handler: nil)
alert.addAction(action)
presentViewController(alert, animated: true, completion: nil)
I haven’t played with what you are trying to do enough to have an accurate answer. Are you required to use an AlertView?
Daniel Dahan
M: +1 647.627.0770 Skype: djondahan
On Dec 20, 2015, at 12:01 AM, Paul Van Wieren notifications@github.com wrote:
Here's my current UIAlertController code:
let alert = UIAlertController(title: title, message: message, preferredStyle: .Alert) let action = UIAlertAction(title: "Dismiss", style: .Default, handler: nil) alert.addAction(action) presentViewController(alert, animated: true, completion: nil)
— Reply to this email directly or view it on GitHub https://github.com/CosmicMind/MaterialKit/issues/104#issuecomment-166067423.
Was going to open such a ticket. As you know, alerts are required in almost every app (logout prompts, single choice or multiple choice lists and so on) so it's great if you guys have that in mind
I will put it in upcoming :)
What would be the best way to make a card-like alert view? Should I subclass CardView?