Comments (6)
I mean how can I change the sizes, frames of the pop up, thanks
from presentr.
Done!
You should be able to use a Custom Presentation Type in the new 0.1.6 release, which should be available via Cocoapods now.
I will update the Readme to provide detailed instructions on how to create a custom presentation, but for now I'll share some example code for creating a 'Top Banner' type alert.
let customPresenter: Presentr = {
let width = ModalSize.Full // Can still use Presentr's automatically calculated sizes
let height = ModalSize.Custom(size: 150) // But can use custom ones when needed
let center = ModalCenterPosition.CustomOrigin(origin: CGPoint(x: 0, y: 0))
// let center = ModalCenterPosition.Center // Could also use something like this
// let center = ModalCenterPosition.Custom(centerPoint: CGPoint(x: 50, y: 50)) // or this
let customType = PresentationType.Custom(width: width, height: height, center: center)
let customPresenter = Presentr(presentationType: customType)
customPresenter.transitionType = .CoverVerticalFromTop
customPresenter.roundCorners = false
return customPresenter
}()
from presentr.
Wonderful. :-) Thanks! :-)
from presentr.
You can present any custom View Controller you create either through code, xibs or interface builder.
Are you referring to the AlertViewController I include in the framework? If so, it is currently only customizable in that you can supply the title text, body text and 1 or 2 buttons which have a title, an action block and a style, which can be .Default, .Destructive or .Cancel, which use green, red or gray text color.
What kinds of things would you like to be able to customize on the AlertViewController? I could look into adding this in the next release.
from presentr.
Oh, got it!
Right now the only presentation types (which deal with sizing and positioning the presented controller on screen) are the 4 included. Popup, Alert, TopHalf and BottomHalf.
My idea was that that would be enough for the typical cases, and any other case which I missed could be added on via a pull request by someone else.
But, it might be a good idea to have a "Custom" presentation type, which allows you to set the set the size and position, without having to change code inside the framework.
I like this idea. Will get working on this for the next release.
from presentr.
Wonderful
from presentr.
Related Issues (20)
- Please let me know when v 2 comes out
- Need elastic resistance when swiping in opposite direction to dismiss
- White background behind navigation bar HOT 1
- Popup with compress keyboard translation type on X/XS/XS Max
- ViewController not showing in real device iPhone Xs
- How to display over tabs?
- How to manage safe area constraints on presented view controller during interactive presentation? HOT 3
- How to present a controller by giving some margin from Y axis?
- delegate for onDismiss? HOT 1
- Alert view disappear when i use Swift5 in Example project HOT 1
- Expand View Controller to Full Screen
- Swift Package Manager Support HOT 2
- Manual Installation Not Working HOT 1
- [Xcode 11] [iOS 13] Present view with presentationType .fullScreen shows black background
- Displaying presentr view over animating view behind causes full screen HOT 1
- Presentr with Coordinator HOT 3
- [Touch] unexpected nil HOT 1
- `dismissTransitionType` set `.crossDissolve` no effect HOT 2
- Controller Moves up
- wish to be smarter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from presentr.