Skip to content

Instantly share code, notes, and snippets.

@MathVasc
Last active February 8, 2018 20:18
Show Gist options
  • Save MathVasc/14de892a81b1064236308d09e9fe6ec7 to your computer and use it in GitHub Desktop.
Save MathVasc/14de892a81b1064236308d09e9fe6ec7 to your computer and use it in GitHub Desktop.
func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) {
if activeDisplayMode == .expanded {
//1
preferredContentSize = CGSize(width: maxSize.width, height: maxSize.width)
} else if activeDisplayMode == .compact {
//2
preferredContentSize = maxSize
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment