Skip to content

Commit

Permalink
0.1.1 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
gokulgovind committed Apr 13, 2017
1 parent b20cdd4 commit dc56435
Show file tree
Hide file tree
Showing 34 changed files with 1,360 additions and 159 deletions.
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3
1 change: 1 addition & 0 deletions Example/.swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3
38 changes: 19 additions & 19 deletions Example/GLInAppPurchase/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
//
// AppDelegate.swift
// GLInAppPurchase
// GLInAppPurchaseUI
//
// Created by gokulgovind on 04/12/2017.
// Copyright (c) 2017 gokulgovind. All rights reserved.
// Created by VividMacmini7 on 18/11/16.
// Copyright © 2016 vivid. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
return true
}

func applicationWillResignActive(_ application: UIApplication) {
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(_ application: UIApplication) {
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(_ application: UIApplication) {
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(_ application: UIApplication) {
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(_ application: UIApplication) {
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


}

58 changes: 53 additions & 5 deletions Example/GLInAppPurchase/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,25 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="iYI-eG-V0w">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--View Controller-->
<!--GLInAppPurchase-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="GLInAppPurchase_Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="BG" translatesAutoresizingMaskIntoConstraints="NO" id="3al-wN-Pah">
<rect key="frame" x="0.0" y="-65" width="320" height="569"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="u1u-3R-zzU">
<rect key="frame" x="0.0" y="0.0" width="320" height="504"/>
<connections>
<action selector="Check:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="Pgz-Jo-fW3"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="u1u-3R-zzU" secondAttribute="trailing" id="bAW-pQ-wuh"/>
<constraint firstItem="3al-wN-Pah" firstAttribute="top" secondItem="kh9-bI-dsS" secondAttribute="top" constant="-65" id="d5b-dR-Kma"/>
<constraint firstItem="3al-wN-Pah" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" id="es9-5J-Olo"/>
<constraint firstItem="u1u-3R-zzU" firstAttribute="top" secondItem="jyV-Pf-zRb" secondAttribute="bottom" id="gOa-VC-VxY"/>
<constraint firstAttribute="trailing" secondItem="3al-wN-Pah" secondAttribute="trailing" id="haO-EW-6EC"/>
<constraint firstItem="u1u-3R-zzU" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" id="ohq-U8-CIv"/>
<constraint firstItem="2fi-mo-0CV" firstAttribute="top" secondItem="u1u-3R-zzU" secondAttribute="bottom" id="tPI-hA-DHL"/>
<constraint firstItem="2fi-mo-0CV" firstAttribute="top" secondItem="3al-wN-Pah" secondAttribute="bottom" id="xYb-rz-8Il"/>
</constraints>
</view>
<navigationItem key="navigationItem" title="GLInAppPurchase" id="fCE-bR-A5X"/>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" translucent="NO" prompted="NO"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1115" y="351"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="PQx-20-0n6">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="iYI-eG-V0w" sceneMemberID="viewController">
<toolbarItems/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="DhK-fj-4c8">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="vXZ-lx-hvc" kind="relationship" relationship="rootViewController" id="yxa-RO-cj3"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="LWC-wn-nvR" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="730" y="351"/>
</scene>
</scenes>
<resources>
<image name="BG" width="750" height="1334"/>
</resources>
</document>
21 changes: 21 additions & 0 deletions Example/GLInAppPurchase/Images.xcassets/BG.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "IMG_2812.PNG",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Example/GLInAppPurchase/Images.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Screen Shot 2016-11-18 at 4.07.02 PM.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "IMG_2.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "IMG_3.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "IMG_4.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "IMG_5.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions Example/GLInAppPurchase/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import GLInAppPurchase

class ViewController: UIViewController {

Expand All @@ -20,5 +21,67 @@ class ViewController: UIViewController {
// Dispose of any resources that can be recreated.
}

@IBAction func Check(sender: AnyObject) {
let appBanner = GLInAppPurchaseUI(title: "Skip The Line", subTitle: "Be first in the queue", bannerBackGroundStyle: .TransparentStyle)

appBanner.displayContent(imageSetWithDescription:
[
UIImage(named:"IMG_1")!:"Rewind Your Last Swipe##Go back and swipe again",
UIImage(named:"IMG_2")!:"",
UIImage(named:"IMG_3")!:"Send More Super Likes##Let them know you are interested",
])
appBanner.addButtonWith("BOOST ME", cancelTitle: "NO, THANKS") { (str) in
print(str)
if str == "NO, THANKS" {
}
appBanner.dismissBanner()
self.showSimpleAlert("\(str) Button Clicked")
}
appBanner.setBannerTheme([UIColor.whiteColor()], headerTextColor: UIColor.blackColor())
appBanner.setButtomTheme([UIColor.blueColor(),UIColor(netHex:0x2375F8)], buttonTextColor: UIColor.whiteColor())

appBanner.addAction(GLInAppAction(title: "10", subTitle: "Boosts", price: "₹155.00/ea", handler: { (actin) in
print("Completion handler called \(actin.actionSubTitle) Boost For \(actin.actionPrice)")
}))

appBanner.addAction(GLInAppAction(title: "5", subTitle: "Boosts", price: "₹184.00/ea", handler: { (action) in
print("Completion handler called \(action.actionSubTitle) Boost For \(action.actionPrice)")
}))

appBanner.addAction(GLInAppAction(title: "1", subTitle: "Boosts", price: "₹250.00/ea", handler: { (action) in
print("Completion handler called \(action.actionSubTitle) Boost For \(action.actionPrice)")
}))
appBanner.addAction(GLInAppAction(title: "6", subTitle: "Boosts", price: "₹184.00/ea", handler: { (action) in
print("Completion handler called \(action.actionSubTitle) Boost For \(action.actionPrice)")
}))
appBanner.addAction(GLInAppAction(title: "7", subTitle: "Boosts", price: "₹250.00/ea", handler: { (action) in
print("Completion handler called \(action.actionSubTitle) Boost For \(action.actionPrice)")
}))


appBanner.presentBanner()
}

func showSimpleAlert(message:String) {
dispatch_async(dispatch_get_main_queue()) {
let alert = UIAlertController(title: "Completion Handler", message: message, preferredStyle: .Alert)
alert.addAction(UIAlertAction(title: "OK", style: .Cancel, handler: nil))
self.navigationController?.presentViewController(alert, animated: true, completion: nil)
}

}
}

extension UIColor {
convenience init(red: Int, green: Int, blue: Int) {
assert(red >= 0 && red <= 255, "Invalid red component")
assert(green >= 0 && green <= 255, "Invalid green component")
assert(blue >= 0 && blue <= 255, "Invalid blue component")

self.init(red: CGFloat(red) / 255.0, green: CGFloat(green) / 255.0, blue: CGFloat(blue) / 255.0, alpha: 1.0)
}

convenience init(netHex:Int) {
self.init(red:(netHex >> 16) & 0xff, green:(netHex >> 8) & 0xff, blue:netHex & 0xff)
}
}
2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: ../

SPEC CHECKSUMS:
GLInAppPurchase: 688d2cb6585a33edae2e0626a6158c2ea5d25c08
GLInAppPurchase: 78c3701e86a484bd2dee27adfb0ad8ada3575d6f

PODFILE CHECKSUM: f3f41a0cb7d475687a0ed1be251038745fba0d45

Expand Down
Loading

0 comments on commit dc56435

Please sign in to comment.