Skip to content

Instantly share code, notes, and snippets.

@stfalconaleks
Created November 22, 2017 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stfalconaleks/a11453dbb2ae0f9f552596abbf370d15 to your computer and use it in GitHub Desktop.
Save stfalconaleks/a11453dbb2ae0f9f552596abbf370d15 to your computer and use it in GitHub Desktop.
func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) {
if activeDisplayMode == .compact {
self.preferredContentSize = maxSize
} else if activeDisplayMode == .expanded {
self.preferredContentSize = CGSize(width: maxSize.width, height: 150)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment