Skip to content

Commit

Permalink
working pod
Browse files Browse the repository at this point in the history
  • Loading branch information
Ondrej Rafaj committed Mar 26, 2016
1 parent 3041940 commit 0ef4dcc
Show file tree
Hide file tree
Showing 205 changed files with 16,539 additions and 24 deletions.
2 changes: 1 addition & 1 deletion DialogView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ Pod::Spec.new do |s|

# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
s.dependency 'SnapKit', '~> 0.19.1'
end
10 changes: 10 additions & 0 deletions Example/DialogView.xcworkspace/contents.xcworkspacedata

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

37 changes: 34 additions & 3 deletions Example/DialogView/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,21 +1,52 @@
<?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="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</dependencies>
<scenes>
<!--View Controller-->
<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="DialogView_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"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MfG-fv-q0T">
<rect key="frame" x="211.5" y="242" width="177" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="177" id="4oD-0K-LnU"/>
<constraint firstAttribute="height" constant="30" id="6Ra-np-xO8"/>
</constraints>
<state key="normal" title="Give me basic DialogView"/>
<connections>
<action selector="giveMeDialogView:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="xEE-cU-FAN"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MMK-cf-fkC">
<rect key="frame" x="196.5" y="288" width="207" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="MeZ-h9-egl"/>
<constraint firstAttribute="width" constant="207" id="mY6-gv-TkH"/>
</constraints>
<state key="normal" title="Give me advanced DialogView"/>
<connections>
<action selector="giveMeAdvancedDialogView:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="kmL-Oq-Pu9"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="MfG-fv-q0T" firstAttribute="top" secondItem="jyV-Pf-zRb" secondAttribute="bottom" constant="222" id="DsB-v4-CWc"/>
<constraint firstItem="MMK-cf-fkC" firstAttribute="top" secondItem="MfG-fv-q0T" secondAttribute="bottom" constant="16" id="I5C-x7-AJZ"/>
<constraint firstItem="MMK-cf-fkC" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="KYG-7m-LSX"/>
<constraint firstItem="MfG-fv-q0T" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="MjT-wS-PI0"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
Expand Down
57 changes: 48 additions & 9 deletions Example/DialogView/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,57 @@
//

import UIKit
import DialogView

class ViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
class ViewController: UIViewController {


@IBAction func giveMeDialogView(sender: UIButton) {
let alert: DialogView = DialogView()
alert.setTitle("Dialog Title")
alert.setMessage("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque a augue eget felis dictum ultrices ac a arcu.")

let button: DialogButton = alert.addButton("Ok", type: .Done)
button.addTarget(self, action: "myAlertAction:", forControlEvents: .TouchUpInside)
alert.showInController(self)
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.

@IBAction func giveMeAdvancedDialogView(sender: UIButton) {
let alert: DialogView = DialogView()

var attr: [String: AnyObject] = [String: AnyObject]();
attr[NSFontAttributeName] = UIFont.init(name: "HelveticaNeue-Light", size: 16)!
alert.setTitle("Dialog Title", attributes: attr)

attr[NSFontAttributeName] = UIFont.init(name: "HelveticaNeue-UltraLight", size: 14)!
alert.setMessage("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque a augue eget felis dictum ultrices ac a arcu.", attributes: attr)

var button: DialogButton = alert.addButton("Accept", type: .Accept)
button.addTarget(self, action: "myAlertAction:", forControlEvents: .TouchUpInside)
button.titleLabel?.font = UIFont.init(name: "HelveticaNeue-Light", size: 14)!

button = alert.addButton("Delete", type: .Destruct)
button.addTarget(self, action: "myAlertAction:", forControlEvents: .TouchUpInside)
button.titleLabel?.font = UIFont.init(name: "HelveticaNeue-Light", size: 14)!

button = alert.addButton("Done", type: .Done)
button.addTarget(self, action: "myAlertAction:", forControlEvents: .TouchUpInside)
button.titleLabel?.font = UIFont.init(name: "HelveticaNeue-Light", size: 14)!

button = alert.addButton("Default", type: .Default)
button.addTarget(self, action: "myAlertAction:", forControlEvents: .TouchUpInside)
button.titleLabel?.font = UIFont.init(name: "HelveticaNeue-Light", size: 14)!

alert.showInController(self)
}


// MARK: Alert actions

func myAlertAction(sender: DialogButton) {
sender.dialogView.hide(true)
}


}

2 changes: 2 additions & 0 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use_frameworks!

target 'DialogView_Example', :exclusive => true do
pod 'DialogView', :path => '../'
pod 'SnapKit', '~> 0.19.1'
end

target 'DialogView_Tests', :exclusive => true do
Expand All @@ -12,4 +13,5 @@ target 'DialogView_Tests', :exclusive => true do
pod 'Nimble', '~> 3.0'
pod 'FBSnapshotTestCase'
pod 'Nimble-Snapshots'
pod 'SnapKit', '~> 0.19.1'
end
37 changes: 37 additions & 0 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
PODS:
- DialogView (0.1.0):
- SnapKit (~> 0.19.1)
- FBSnapshotTestCase (2.0.7):
- FBSnapshotTestCase/SwiftSupport (= 2.0.7)
- FBSnapshotTestCase/Core (2.0.7)
- FBSnapshotTestCase/SwiftSupport (2.0.7):
- FBSnapshotTestCase/Core
- Nimble (3.2.0)
- Nimble-Snapshots (3.0.0):
- FBSnapshotTestCase (~> 2.0.7)
- Nimble
- Quick
- Quick (0.9.1)
- SnapKit (0.19.1)

DEPENDENCIES:
- DialogView (from `../`)
- FBSnapshotTestCase
- Nimble (~> 3.0)
- Nimble-Snapshots
- Quick (~> 0.8)
- SnapKit (~> 0.19.1)

EXTERNAL SOURCES:
DialogView:
:path: "../"

SPEC CHECKSUMS:
DialogView: b9c00d641890646dc5a4b7bba705633131f61f94
FBSnapshotTestCase: 7e85180d0d141a0cf472352edda7e80d7eaeb547
Nimble: 703854335d181df169bbca9c97117b5cf8c47c1d
Nimble-Snapshots: ab41dd737dcd33a0b0cb005a30465fef70b7207a
Quick: a5221fc21788b6aeda934805e68b061839bc3165
SnapKit: eff58d6e3451bf2f482db2eccf86aecf371dc62d

COCOAPODS: 0.39.0
15 changes: 15 additions & 0 deletions Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase.modulemap

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

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

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

Loading

0 comments on commit 0ef4dcc

Please sign in to comment.