Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created July 27, 2018 17:43
Show Gist options
  • Save azamsharp/1500a4179bc822d4577b26ef88b6ee0c to your computer and use it in GitHub Desktop.
Save azamsharp/1500a4179bc822d4577b26ef88b6ee0c to your computer and use it in GitHub Desktop.
private func displayInvoice(name :String, deliveryLocation :CLPlacemark) -> CGSize {
self.invoiceView.coffeeNameLabel.text = name
self.invoiceView.deliveryLocationLabel.text = deliveryLocation.name
self.view.addSubview(self.invoiceView)
let width = self.extensionContext?.hostedViewMaximumAllowedSize.width ?? 320
let frame = CGRect(origin: .zero, size: CGSize(width: width, height: 170))
self.invoiceView.frame = frame
return frame.size
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment