-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.md
56 lines (41 loc) · 2.29 KB
/
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# ANPopUpContainer
[![CI Status](http://img.shields.io/travis/abdallahnh/ANPopUpContainer.svg?style=flat)](https://travis-ci.org/abdallahnh/ANPopUpContainer)
[![Version](https://img.shields.io/cocoapods/v/ANPopUpContainer.svg?style=flat)](http://cocoapods.org/pods/ANPopUpContainer)
[![License](https://img.shields.io/cocoapods/l/ANPopUpContainer.svg?style=flat)](http://cocoapods.org/pods/ANPopUpContainer)
[![Platform](https://img.shields.io/cocoapods/p/ANPopUpContainer.svg?style=flat)](http://cocoapods.org/pods/ANPopUpContainer)
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
ANPopUpContainer is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'ANPopUpContainer'
```
## How to use
### Normal Display
```Swift
let storyBoard = UIStoryboard(name: "Main", bundle: nil)
let popUpContainer = storyBoard.instantiateViewController(withIdentifier: "PopUPStoryId") as! ANPopUpContainerViewController
popUpContainer.parentView = self
let firstView = storyBoard.instantiateViewController(withIdentifier: "FirstPopupStoryBoardId") as! FirstPopupViewController
firstView.view.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 220)
firstView.inPopUpContainer = popUpContainer
popUpContainer.displayContentController(for: firstView)
self.present(popUpContainer, animated: true, completion: nil)
```
### Fade Display
```Swift
let storyBoard = UIStoryboard(name: "Main", bundle: nil)
let popUpContainer = storyBoard.instantiateViewController(withIdentifier: "PopUPStoryId") as! ANPopUpContainerViewController
popUpContainer.parentView = self
let firstView = storyBoard.instantiateViewController(withIdentifier: "FirstPopupStoryBoardId") as! FirstPopupViewController
firstView.view.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 220)
firstView.inPopUpContainer = popUpContainer
popUpContainer.displayContentControllerWithFadeAnimation(for: firstView)
self.present(popUpContainer, animated: true, completion: nil)
```
## Author
abdallahnh, [email protected]
## License
ANPopUpContainer is available under the MIT license. See the LICENSE file for more info.