Skip to content

Commit

Permalink
Adjust preferredContentSize using customView by HUDProgressViewContro…
Browse files Browse the repository at this point in the history
…ller
  • Loading branch information
Tomohiro Mitsumune committed Mar 17, 2016
1 parent a7d42fe commit 581b096
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion HUDKit/Classes/Progress/HUDProgressViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ public class HUDProgressViewController: UIViewController {
self.customView = customView
self.status = status

preferredContentSize = CGSizeMake(100.0, 100.0)
if let customView = customView {
let insets = UIEdgeInsets(top: -30, left: -30, bottom: -30, right: -30)
preferredContentSize = UIEdgeInsetsInsetRect(customView.bounds, insets).size
} else {
preferredContentSize = CGSizeMake(100.0, 100.0)
}

modalPresentationStyle = .Custom
transitioningDelegate = self
Expand Down

0 comments on commit 581b096

Please sign in to comment.