Enums
The following enums are available globally.
-
Describes the transition animation for presenting the view controller. Includes the default system transitions and custom ones.
- CoverVertical: System provided transition style. UIModalTransitionStyle.CoverVertical
- CrossDissolve: System provided transition style. UIModalTransitionStyle.CrossDissolve
- FlipHorizontal: System provided transition style. UIModalTransitionStyle.FlipHorizontal
- CoverVerticalFromTop: Custom transition animation. Slides in vertically from top.
- CoverHorizontalFromLeft: Custom transition animation. Slides in horizontally from left.
- CoverHorizontalFromRight: Custom transition animation. Slides in horizontally from right.
Declaration
Swift
public enum TransitionType
-
Describes the presented presented view controller’s center position. It is meant to be non-specific, but we can use the ‘calculatePoint’ method when we want to calculate the exact point by passing in the ‘containerBounds’ rect that only the presentation controller should be aware of.
- Center: Center of the screen.
- TopCenter: Center of the top half of the screen.
- BottomCenter: Center of the bottom half of the screen.
- Custom: A custom center position using a CGPoint which represents the center point of the presented view controller.
- Custom: A custom center position to be calculated, using a CGPoint which represents the origin of the presented view controller.
Declaration
Swift
public enum ModalCenterPosition
-
Describes the style for an action, that will be used to style a button in the alert controller.
- Default: Green text label. Meant to draw attention to the action.
- Cancel: Gray text label. Meant to be neutral.
- Destructive: Red text label. Meant to warn the user about the action.
Declaration
Swift
public enum AlertActionStyle
-
Descibes a presented modal’s size dimension (width or height). It is meant to be non-specific, but the exact position can be calculated by calling the ‘calculate’ methods, passing in the ‘parentSize’ which only the Presentation Controller should be aware of.
- Default: Default size. Will use Presentr’s default margins to calculate size of presented controller. This is the size the .Popup presentation type uses.
- Half: Half of the screen.
- Full: Full screen.
- Custom: Custom fixed size.
Declaration
Swift
public enum ModalSize
-
Basic Presentr type. Its job is to describe the ‘type’ of presentation. The type describes the size and position of the presented view controller.
- Alert: This is a small 270 x 180 alert which is the same size as the default iOS alert.
- Popup: This is a average/default size ‘popup’ modal.
- TopHalf: This takes up half of the screen, on the top side.
- BottomHalf: This takes up half of the screen, on the bottom side.
- Custom: Provide a custom width, height and center position.
Declaration
Swift
public enum PresentationType