GithubHelp home page GithubHelp logo

Comments (6)

iHunterX avatar iHunterX commented on May 13, 2024 3

I mean how can I change the sizes, frames of the pop up, thanks

from presentr.

danlozano avatar danlozano commented on May 13, 2024 3

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.

niklassaers avatar niklassaers commented on May 13, 2024 1

Wonderful. :-) Thanks! :-)

from presentr.

danlozano avatar danlozano commented on May 13, 2024

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.

danlozano avatar danlozano commented on May 13, 2024

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.

iHunterX avatar iHunterX commented on May 13, 2024

Wonderful

from presentr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.