Skip to content

Commit

Permalink
Add playground with live view controller
Browse files Browse the repository at this point in the history
This playground can be used to easily build a quick SDCAlertView alert to try
out its functionality.
  • Loading branch information
sberrevoets committed Nov 2, 2015
1 parent e84a510 commit 30b8841
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 12 deletions.
14 changes: 14 additions & 0 deletions Example.playground/Contents.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import XCPlayground
import SDCAlertView

let viewController = UIViewController()
viewController.view.backgroundColor = UIColor.whiteColor()

XCPlaygroundPage.currentPage.liveView = viewController
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true

/*** Create, customize, and present your alert below ***/

let alert = AlertController(title: "Title", message: "Hey user, you're being alerted about something")
alert.addAction(AlertAction(title: "OK", style: .Preferred))
alert.present()
4 changes: 4 additions & 0 deletions Example.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='ios'>
<timeline fileName='timeline.xctimeline'/>
</playground>
6 changes: 6 additions & 0 deletions Example.playground/timeline.xctimeline
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Timeline
version = "3.0">
<TimelineItems>
</TimelineItems>
</Timeline>
9 changes: 2 additions & 7 deletions Example/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="uvy-DI-gcx">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="uvy-DI-gcx">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -261,11 +261,6 @@
</tableView>
<navigationItem key="navigationItem" id="nNM-ph-wei">
<nil key="title"/>
<barButtonItem key="leftBarButtonItem" title="Custom" style="done" id="RcL-qa-89v">
<connections>
<action selector="presentCustomAlert" destination="z1T-n9-iqs" id="7op-iO-5zy"/>
</connections>
</barButtonItem>
<barButtonItem key="rightBarButtonItem" title="Show" style="done" id="lz1-K7-S4y">
<connections>
<action selector="presentAlert" destination="z1T-n9-iqs" id="eCc-m4-Gl7"/>
Expand Down
5 changes: 0 additions & 5 deletions Example/DemoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ class DemoViewController: UITableViewController {
}
}


@IBAction private func presentCustomAlert() {
// This method can be used as a playground. Will be called from the Custom button.
}

private func presentSDCAlertController() {
let title = self.titleTextField.content
let message = self.messageTextField.content
Expand Down
3 changes: 3 additions & 0 deletions SDCAlertView.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 30b8841

Please sign in to comment.