Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
peterprokop committed Mar 27, 2016
1 parent 779d672 commit be4a06b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,19 @@ SwiftOverlays.removeAllBlockingOverlays()

```

### Using with UITableViewController
### Using with UITableViewController/UICollectionViewController

You can't use SwiftOverlays convenience methods directly with UITableViewController - because its view is, well, an UITableView, and overlay will be scrolled along with it.

Instead I suggest using UIViewController instead of UITableViewController and adding UITableView as a subview.
(the same applies to UICollectionViewController)

If for some reason you can't use UIViewController, you can do something like:
```swift
SwiftOverlays.showCenteredWaitOverlayWithText(self.view.superview!, text: "Please wait...")
SwiftOverlays.removeAllOverlaysFromView(self.view.superview!)
if let superview = self.view.superview {
SwiftOverlays.showCenteredWaitOverlayWithText(superview, text: "Please wait...")
SwiftOverlays.removeAllOverlaysFromView(superview)
}
```

(but in that case overlay will be added to the superview, and you should obviously do that only if superview is available - for example in viewDidAppear method of your controller.).
Expand Down

0 comments on commit be4a06b

Please sign in to comment.