Skip to content

Instantly share code, notes, and snippets.

@djfumberger
Created September 10, 2016 01:13
Show Gist options
  • Save djfumberger/c15466be47970d4b45ec0bd51e9819a1 to your computer and use it in GitHub Desktop.
Save djfumberger/c15466be47970d4b45ec0bd51e9819a1 to your computer and use it in GitHub Desktop.
override init(frame: CGRect) {
super.init(frame: frame)
self.effectView.frame = self.bounds
self.effectView.effect = UIVibrancyEffect.widgetPrimary()
self.addSubview(self.effectView)
self.effectView2.frame = self.bounds
self.effectView2.effect = UIVibrancyEffect.widgetSecondary()
self.effectView2.translatesAutoresizingMaskIntoConstraints = false
self.effectView2.autoresizingMask = [.flexibleWidth , .flexibleHeight]
self.addSubview(self.effectView2)
self.title.font = UIFont.systemFont(ofSize: 15, weight: UIFontWeightBold )
self.title.text = "Activity Score"
self.title.alpha = 1.0
self.title.spacingHeight = 5
self.descriptionLabel.font = UIFont.systemFont(ofSize: 15, weight: UIFontWeightRegular )
self.descriptionLabel.alpha = 1.0
self.descriptionLabel.spacingHeight = 5
self.descriptionLabel.kerningOffset = -0.1
self.descriptionLabel.autoresizingMask = []
self.descriptionLabel.text = "Your activity is up 4 from last week"
self.descriptionLabel.numberOfLines = 4
self.effectView.contentView.addSubview(self.title)
self.effectView2.contentView.addSubview(self.descriptionLabel)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment