Giter Site home page Giter Site logo

philippeboisney / alertonboarding Goto Github PK

View Code? Open in Web Editor NEW
843.0 25.0 110.0 10.37 MB

A simple and attractive AlertView to onboard your users in your amazing world.

License: MIT License

Swift 98.38% Ruby 1.62%
onboarding alertview swift ios popup dialog swift4

alertonboarding's People

Contributors

mattmcneeney avatar philippeboisney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alertonboarding's Issues

Broken on iOS 12 (center of alert is in bottom-right corner of device)

Thanks Philippe for the pod!

A quick heads-up, the alert is broken on iOS 12 beta.

Since I had to manually install the pod anyway to include all the nice PRs that people have pushed, here's how I replaced the constraints to fix the issue (only tested on iPhone X). Won't be pushing a PR because there is already a list of a few ones waiting, plus I am using a UIView convenience extension to create my anchors in a few lines.

In AlertOnboarding, after removing the constraints (keep those lines), here are the constraints to create:


  • view width anchored to its superview width, multiplier = percentageRatioWidth
  • view height anchored to its superview height, multiplier = percentageRatioHeight
  • view centered in its superview, on X and Y axis

  • buttomButton width anchored to view width, multiplier 1
  • buttomButton height anchored to view height, multiplier 0.1
  • buttomButton's bottom anchored to view bottom
  • buttomButton centered in its superview on X axis

  • container's view width anchored to view width, multiplier 1
  • container's view height anchored to view height, multiplier 0.9
  • container's view top anchored to view top
  • container's view centered in its superview on X axis

  • background fills its superview (pinned to all edges)

For anyone using LBTAComponents's UIView extension, here's a ready-to-use snippet to replace AlertOnboarding' configureConstraints function:

fileprivate func configureConstraints(_ superView: UIView) {
    
    removeConstraints(constraints)
    buttonBottom.removeConstraints(buttonBottom.constraints)
    container.view.removeConstraints(container.view.constraints)
    
    equal(width: superView.widthAnchor, widthMultiplier: percentageRatioWidth,
          height: superView.heightAnchor, heightMultiplier: percentageRatioHeight)
    anchorCenterSuperview()
    
    buttonBottom.equal(width: widthAnchor, height: heightAnchor, heightMultiplier: 0.1)
    buttonBottom.anchor(bottom: bottomAnchor)
    buttonBottom.anchorCenterXToSuperview()
    
    //Constraints for container
    container.view.equal(width: widthAnchor, height: heightAnchor, heightMultiplier: 0.9)
    container.view.anchor(top: topAnchor)
    container.view.anchorCenterXToSuperview()
    
    //Constraints for background
    background.fillSuperview()
}

alertView.show() not working in UIViewController

Following the usage I can't get this to work. Calling it from my viewDidLoad() in iOS 9.0 installed using cocoapods.

After calling alertView.show(), print(alertView) shows:

<AlertOnboarding.AlertOnboarding: 0x144d43e00; frame = (0 0; 0 0); clipsToBounds = YES; layer = <CALayer: 0x144d338f0>>

Am I doing anything wrong or do I need to do something else?

Showing without pressing button

Hello. How can I show this without pressing a button in the first page? Actually I wrote self.alertView.show() in viewDidLoad() but it does not work. I would appreciate it if you could help me to do it.

How to access the child page view content?

The following line in the code is preventing me from tinting the color of my icons. Is there a workaround to accessing the child page view controllers?

Thanks!

    fileprivate var container: AlertPageViewController!

Swift Legacy Problems

Getting the following error. Was wondering if this happens to anybody else too when using xcode 8 and swift 3.

Is there something that needs to be changed inside of cocoapod file to prevent this from happening? Thanks!

“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

Alert dark background incorrect size after rotation

When I rotate the device the background doesn't size correctly.

I made the next changes to fix the issue:

    //Constraints for background
    let widthContraintsForBackground = NSLayoutConstraint(item: self.background, attribute:.Width, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: UIScreen.mainScreen().bounds.width)
    let heightConstraintForBackground = NSLayoutConstraint.init(item: self.background, attribute: .Height, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: UIScreen.mainScreen().bounds.height)

to

    //Constraints for background
    let widthContraintsForBackground = NSLayoutConstraint(item: self.background, attribute:.Width, relatedBy: .Equal, toItem: superView, attribute: .Width, multiplier: 1, constant: 0)
    let heightConstraintForBackground = NSLayoutConstraint.init(item: self.background, attribute: .Height, relatedBy: .Equal, toItem: superView, attribute: .Height, multiplier: 1, constant: 0)

Remove pagecontrol when max step is 1

Would be swell to add an option to remove the page control when items being used in the AlertOnboarding is only 1, so this can also be used as an alert.

WEB APP

Hello I really liked the idea and would like to use it in my web app, would have some version for webapp, with (javascript, html and css)

Swift 3 Support

Are there plans to upgrade this library to support Swift 3? Thanks!

Loading images from the Web

I see AlertOnboarding uses UIImage(named: ) to load images and wants arrayOfImages as Strings from the user but I can’t seem to load images from the web as UIImage(named: “URLString of an image”). Nor do I have an option to download the image as NSData and then use UIImage(data: ) to show my image. What do I do?

PageControl Indicator not showing

PageControl indicator doesn't show when purcentageRatioHeight is less than default (0.8).

The error seems to be on AlertPageViewController:

    let alertViewSizeHeight = UIScreen.mainScreen().bounds.height*0.8

It must be:

    let alertViewSizeHeight = UIScreen.mainScreen().bounds.height*alertview.purcentageRatioHeight

Thanks

Carthage support

Hey, nice and simple library - thx for sharing!

Any plans or desire to support Carthage?

CocoaPods please!

I'd be cool to also add Cocoapods support. I done this implementation myself last week for my library. Just follow this post and this checklist.
Lemme know if you need any help! 😄

Could not cast value of type 'AlertOnboarding.AlertChildPageViewController'

Hi Philippe and thank You for Your job.

I'm trying to use AlertOnboarding on my project but I receive the error:

Could not cast value of type 'AlertOnboarding.AlertChildPageViewController' (0x10d8b53f8) to 'Surf_Shop.AlertChildPageViewController' (0x10d2a6da8).

on:

pageContentViewController = UINib(nibName: "AlertChildPageViewController", bundle: nil).instantiateWithOwner(nil, options: nil)[0] as! AlertChildPageViewController

while the master project works fine.

Could You help me please to solve it?
Thank You very much
Kind regards
Fabio

Double page control

I wanted to show the alert with some transparency so I used the next settings:

        let alpha: CGFloat = 0.82
        let blueAlpha = UIColor(red: 3/255, green: 169/255, blue: 244/255, alpha: alpha)

        alertView.colorForAlertViewBackground = UIColor(white: 0, alpha: alpha)
        alertView.colorButtonText = UIColor(white: 1, alpha: alpha)
        alertView.colorButtonBottomBackground = blueAlpha
        alertView.colorTitleLabel = UIColor(white: 1, alpha: alpha)
        alertView.colorDescriptionLabel =  UIColor(white: 1, alpha: alpha)
        alertView.colorPageIndicator =  UIColor(white: 1, alpha: alpha)
        alertView.colorCurrentPageIndicator = blueAlpha

But then the page control background area was darkened. I realized that the backgroundColor of the page control was the same used in the alert view, so I made a quick mod to the next line in AlertPageViewController:

    self.pageControl.backgroundColor = alertview.colorForAlertViewBackground

to

    self.pageControl.backgroundColor = UIColor.clearColor()

Now it seems like there are two page controls overlapped.

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.