Skip to content

Commit

Permalink
Added a new viewcontroller to example project and updated storyboard …
Browse files Browse the repository at this point in the history
…layout
dkcas11 committed Sep 9, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 0a7d202 commit 36a53aa
Showing 4 changed files with 103 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CRNotificationsExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
AF4AA2CA1E831B6500BE9043 /* CRNotificationsMedia.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AF4AA2C91E831B6500BE9043 /* CRNotificationsMedia.xcassets */; };
AF3C46C71F0EB36300CA7DE8 /* PushViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF3C46C61F0EB36300CA7DE8 /* PushViewController.swift */; };
AF9017931E817E2600F4D8F8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF9017921E817E2600F4D8F8 /* AppDelegate.swift */; };
AF9017951E817E2600F4D8F8 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF9017941E817E2600F4D8F8 /* ViewController.swift */; };
AF9017981E817E2600F4D8F8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AF9017961E817E2600F4D8F8 /* Main.storyboard */; };
@@ -19,6 +20,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
AF3C46C61F0EB36300CA7DE8 /* PushViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PushViewController.swift; sourceTree = "<group>"; };
AF4AA2C91E831B6500BE9043 /* CRNotificationsMedia.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = CRNotificationsMedia.xcassets; sourceTree = "<group>"; };
AF90178F1E817E2600F4D8F8 /* CRNotificationsExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CRNotificationsExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
AF9017921E817E2600F4D8F8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -65,6 +67,7 @@
AF9017AD1E817FDB00F4D8F8 /* CRNotifications */,
AF9017921E817E2600F4D8F8 /* AppDelegate.swift */,
AF9017941E817E2600F4D8F8 /* ViewController.swift */,
AF3C46C61F0EB36300CA7DE8 /* PushViewController.swift */,
AF9017961E817E2600F4D8F8 /* Main.storyboard */,
AF9017991E817E2600F4D8F8 /* Assets.xcassets */,
AF90179B1E817E2600F4D8F8 /* LaunchScreen.storyboard */,
@@ -179,6 +182,7 @@
AF9017931E817E2600F4D8F8 /* AppDelegate.swift in Sources */,
AF9017BD1E817FDB00F4D8F8 /* CRNotifications.swift in Sources */,
AF9017BB1E817FDB00F4D8F8 /* CRNotification.swift in Sources */,
AF3C46C71F0EB36300CA7DE8 /* PushViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
84 changes: 70 additions & 14 deletions CRNotificationsExample/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="cgU-iY-bff">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="CRNotifications" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="CRNotificationsExample" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
@@ -22,40 +22,96 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="i48-R5-0AR">
<rect key="frame" x="150" y="318" width="76" height="30"/>
<state key="normal" title="Show error"/>
<rect key="frame" x="166" y="266.5" width="44" height="34"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
<state key="normal" title="Error">
<color key="titleColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="showError:" destination="BYZ-38-t0r" eventType="touchUpInside" id="qR3-WY-8rT"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VH0-uo-A2x">
<rect key="frame" x="138" y="228" width="98" height="30"/>
<state key="normal" title="Show success"/>
<rect key="frame" x="155.5" y="207.5" width="64" height="34"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
<state key="normal" title="Succes">
<color key="titleColor" red="0.0" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="showSuccess:" destination="BYZ-38-t0r" eventType="touchUpInside" id="b5q-2Q-u3E"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="d4B-VL-ogg">
<rect key="frame" x="154" y="408" width="68" height="30"/>
<state key="normal" title="Show info"/>
<rect key="frame" x="171" y="325.5" width="34" height="34"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
<state key="normal" title="Info">
<color key="titleColor" red="0.29803922770000002" green="0.29803922770000002" blue="0.29803922770000002" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="showInfo:" destination="BYZ-38-t0r" eventType="touchUpInside" id="0F7-yG-2rg"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="81M-2e-SRi">
<rect key="frame" x="119" y="434.5" width="137" height="30"/>
<state key="normal" title="Next ViewController"/>
<connections>
<action selector="nextViewControllerButton:" destination="BYZ-38-t0r" eventType="touchUpInside" id="cmw-Tl-541"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<constraints>
<constraint firstItem="i48-R5-0AR" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="5go-4j-WZe"/>
<constraint firstItem="i48-R5-0AR" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" constant="-50" id="5go-4j-WZe"/>
<constraint firstItem="d4B-VL-ogg" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="96u-dy-my2"/>
<constraint firstItem="VH0-uo-A2x" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="R76-q6-Zkw"/>
<constraint firstItem="i48-R5-0AR" firstAttribute="top" secondItem="VH0-uo-A2x" secondAttribute="bottom" constant="60" id="VhZ-Dk-Z1I"/>
<constraint firstItem="i48-R5-0AR" firstAttribute="top" secondItem="VH0-uo-A2x" secondAttribute="bottom" constant="25" id="VhZ-Dk-Z1I"/>
<constraint firstItem="81M-2e-SRi" firstAttribute="top" secondItem="d4B-VL-ogg" secondAttribute="bottom" constant="75" id="gbN-tg-XRd"/>
<constraint firstItem="i48-R5-0AR" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="h90-dx-Fsh"/>
<constraint firstItem="d4B-VL-ogg" firstAttribute="top" secondItem="i48-R5-0AR" secondAttribute="bottom" constant="60" id="rB0-1T-9GM"/>
<constraint firstItem="d4B-VL-ogg" firstAttribute="top" secondItem="i48-R5-0AR" secondAttribute="bottom" constant="25" id="rB0-1T-9GM"/>
<constraint firstItem="81M-2e-SRi" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="wM7-Sy-LIk"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="IPT-cX-ycH"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1056.8" y="122.78860569715144"/>
</scene>
<!--Push View Controller-->
<scene sceneID="b5I-bg-ZGU">
<objects>
<viewController id="ZJy-nQ-zoH" customClass="PushViewController" customModule="CRNotificationsExample" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="8GU-cS-XhA"/>
<viewControllerLayoutGuide type="bottom" id="Ogy-sI-Vhc"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="yb9-sf-JWV" customClass="Added">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dfN-um-erm" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2038" y="123"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="duP-rL-uTG">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="cgU-iY-bff" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="cKU-Vt-ORl">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="oG3-5S-Gv0"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="mxm-5G-xCC" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="126" y="123"/>
</scene>
</scenes>
</document>
</document>
25 changes: 25 additions & 0 deletions CRNotificationsExample/PushViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// PushViewController.swift
// CRNotificationsExample
//
// Created by Casper Riboe on 06/07/2017.
// Copyright © 2017 Criboe. All rights reserved.
//

import UIKit
import CRNotifications

class PushViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor.groupTableViewBackground
}

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

CRNotifications.showNotification(type: .success, title: "Pushed through!", message: "I'm right here.", dismissDelay: 3)
}

}
4 changes: 4 additions & 0 deletions CRNotificationsExample/ViewController.swift
Original file line number Diff line number Diff line change
@@ -27,4 +27,8 @@ class ViewController: UIViewController {
CRNotifications.showNotification(type: .info, title: "Did you know?", message: "This notification will dismiss itself in 3 seconds.", dismissDelay: 3)
}

@IBAction func nextViewControllerButton(_ sender: Any) {
navigationController?.pushViewController(PushViewController(), animated: true)
}

}

0 comments on commit 36a53aa

Please sign in to comment.