Coder Social home page Coder Social logo

bhavingupta / custompopupview Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 210 KB

Custom Pop Up View for iPad and iPhone using Auto Layout

License: MIT License

Objective-C 87.12% Ruby 12.88%
ipad iphone ios8 popviewcontroller autolayout popup framework dynamic podspec cocoapods cocoa-touch

custompopupview's Introduction

CustomPopUpView

Custom Pop Up View for iPad and iPhone using Auto Layout

A simple custom pop up view using dynamic framework for all views and devices using pod and autolayout from iOS8 and greater. Use it in your project using pod for this custom pop up view.

Install Cocoa Pods as below:

Step 1 : Enter this below:

     pod 'CustomPopUpView', :git => 'https://github.com/BhavinGupta/CustomPopUpView.git'
     in your pod file of your project.

Step 2 : Write in terminal the following command:

     pod install

That's it you are now installed with custom pop up view

In your view controller where you want to show the pop up import this line below:

     #import <CustomPopUpView/CustomPopUp.h>

Write the following line of code in your action event to open and close custom pop up as below:

     #pragma mark - Button Action Method
     - (IBAction)onClickShowPopUp:(id)sender{
         UIWindow *window = [[UIApplication sharedApplication] keyWindow];
         CustomPopUp *customPopUp = [[CustomPopUp alloc]initWithFrame:window.frame];
         [customPopUp setCustomPopUpDelegate:self];
         [window addSubview:customPopUp];
     }

There is also one CustomPopUpDelegate Method which gives you in hand to make changes in data after the pop up is dismissed as below:

     #import "ViewController.h"
     #import <CustomPopUpView/CustomPopUp.h>
     @interface ViewController ()<CustomPopUpDelegate>
     @end

Add this below method after assigning the [customPopUp setCustomPopUpDelegate:self];

     #pragma mark - Custom pop view delegate
       - (void)dismissCustomPopUpView:(CustomPopUp *)customPopView{
           UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Pop Up View" message:@"Submission Successful." preferredStyle:UIAlertControllerStyleAlert];
           [alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
           [self presentViewController:alertController animated:YES completion:nil];
       }

custompopupview's People

Contributors

bhavingupta avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.