Skip to content

Commit

Permalink
Merge pull request #2 from hryk224/feature/swift2.2
Browse files Browse the repository at this point in the history
Feature/swift2.2
  • Loading branch information
hryk224 committed Apr 27, 2016
2 parents b99a5e4 + 694ad88 commit 6e9eded
Show file tree
Hide file tree
Showing 13 changed files with 2,176 additions and 1,075 deletions.
1,398 changes: 917 additions & 481 deletions Example/Example.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
PCLBlurEffectAlert: e1b1dd96e6a401f9d7916789057760afe66f9eae

COCOAPODS: 0.38.2
COCOAPODS: 0.39.0
2 changes: 1 addition & 1 deletion Example/Pods/Manifest.lock

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

1,700 changes: 1,181 additions & 519 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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

This file was deleted.

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

58 changes: 45 additions & 13 deletions Example/Pods/Target Support Files/Pods/Pods-frameworks.sh

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

2 changes: 1 addition & 1 deletion Example/Pods/Target Support Files/Pods/Pods-resources.sh

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

1 change: 1 addition & 0 deletions Example/Pods/Target Support Files/Pods/Pods.debug.xcconfig

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.

2 changes: 1 addition & 1 deletion PCLBlurEffectAlert.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "PCLBlurEffectAlert"
s.version = "1.0.1"
s.version = "1.0.2"
s.summary = "Custom Swift AlertController."
s.homepage = "https://github.com/hryk224/PCLBlurEffectAlert"
s.screenshots = "https://raw.githubusercontent.com/wiki/hryk224/PCLBlurEffectAlert/images/sample1.gif"
Expand Down
49 changes: 11 additions & 38 deletions PCLBlurEffectAlert/PCLBlurEffectAlert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// PCLBlurEffectAlert.swift
// Pods
//
// Created by hiroyuki yoshida on 2015/10/14.
// Created by hryk224 on 2015/10/14.
//
//

Expand Down Expand Up @@ -101,7 +101,7 @@ public class PCLBlurEffectAlert {

// UI
public var cornerRadius: CGFloat = 0
public var thin: CGFloat = 0.5
public var thin: CGFloat = 0.5 * (2 / UIScreen.mainScreen().scale)

// OverlayView
private var overlayView = UIView()
Expand Down Expand Up @@ -715,7 +715,7 @@ public class PCLBlurEffectAlert {
action.button.frame.size.width -= thin
}
action.button.addTarget(self,
action: Selector("buttonWasTouchUpInside:"),
action: #selector(Controller.buttonWasTouchUpInside(_:)),
forControlEvents: .TouchUpInside)
cornerView.addSubview(action.button)
}
Expand All @@ -737,7 +737,7 @@ public class PCLBlurEffectAlert {
action.button.setTitleColor(buttonDisableTextColor[action.style], forState: .Disabled)
action.button.titleLabel?.font = buttonFont[action.style]
action.button.addTarget(self,
action: Selector("buttonWasTouchUpInside:"),
action: #selector(Controller.buttonWasTouchUpInside(_:)),
forControlEvents: .TouchUpInside)
cornerView.addSubview(action.button)
cornerViewHeight += buttonHeight
Expand All @@ -764,7 +764,7 @@ public class PCLBlurEffectAlert {
action.button.setTitleColor(buttonDisableTextColor[action.style], forState: .Disabled)
action.button.titleLabel?.font = buttonFont[action.style]
action.button.addTarget(self,
action: Selector("buttonWasTouchUpInside:"),
action: #selector(Controller.buttonWasTouchUpInside(_:)),
forControlEvents: .TouchUpInside)
cornerView.addSubview(action.button)
cornerViewHeight += buttonHeight
Expand All @@ -789,7 +789,7 @@ public class PCLBlurEffectAlert {
action.button.setTitleColor(buttonDisableTextColor[action.style], forState: .Disabled)
action.button.titleLabel?.font = buttonFont[action.style]
action.button.addTarget(self,
action: Selector("buttonWasTouchUpInside:"),
action: #selector(Controller.buttonWasTouchUpInside(_:)),
forControlEvents: .TouchUpInside)

action.backgroundView.clipsToBounds = true
Expand Down Expand Up @@ -837,33 +837,6 @@ public class PCLBlurEffectAlert {

}




























// MARK: - TransitionAnimator
public class TransitionAnimator: NSObject, UIViewControllerAnimatedTransitioning {
private typealias TransitionAnimator = Alert.TransitionAnimator
Expand Down Expand Up @@ -1050,16 +1023,16 @@ extension PCLBlurEffectAlert.Controller : PCLAlertKeyboardNotificationObserver,
}

// MARK: - keyboard
protocol PCLAlertKeyboardNotificationObserver: class {
@objc protocol PCLAlertKeyboardNotificationObserver: class {
func keyboardWillShow(notification: NSNotification)
func keyboardWillHide(notification: NSNotification)
}

private extension PCLBlurEffectAlert.NotificationManager {

func addKeyboardNotificationObserver(observer: PCLAlertKeyboardNotificationObserver) {
notificationCenter.addObserver(observer, selector: "keyboardWillShow:", name: UIKeyboardWillShowNotification, object: nil)
notificationCenter.addObserver(observer, selector: "keyboardWillHide:", name: UIKeyboardWillHideNotification, object: nil)
notificationCenter.addObserver(observer, selector: #selector(PCLAlertKeyboardNotificationObserver.keyboardWillShow(_:)), name: UIKeyboardWillShowNotification, object: nil)
notificationCenter.addObserver(observer, selector: #selector(PCLAlertKeyboardNotificationObserver.keyboardWillHide(_:)), name: UIKeyboardWillHideNotification, object: nil)
}

func removeKeyboardNotificationObserver(observer: PCLAlertKeyboardNotificationObserver) {
Expand All @@ -1077,7 +1050,7 @@ private extension PCLBlurEffectAlert.NotificationManager {
}

// MARK: - AlertActionEnabledDidChange
protocol PCLAlertActionEnabledDidChangeNotificationObserver: class {
@objc protocol PCLAlertActionEnabledDidChangeNotificationObserver: class {
func didAlertActionEnabledDidChange(notification: NSNotification)
}

Expand All @@ -1086,7 +1059,7 @@ private extension PCLBlurEffectAlert.NotificationManager {
static let DidAlertActionEnabledDidChangeNotification = "DidAlertActionEnabledDidChangeNotification"

func addAlertActionEnabledDidChangeNotificationObserver(observer: PCLAlertActionEnabledDidChangeNotificationObserver) {
notificationCenter.addObserver(observer, selector: "didAlertActionEnabledDidChange:", name: Manager.DidAlertActionEnabledDidChangeNotification , object: nil)
notificationCenter.addObserver(observer, selector: #selector(PCLAlertActionEnabledDidChangeNotificationObserver.didAlertActionEnabledDidChange(_:)), name: Manager.DidAlertActionEnabledDidChangeNotification , object: nil)
}

func removeAlertActionEnabledDidChangeNotificationObserver(observer: PCLAlertActionEnabledDidChangeNotificationObserver) {
Expand Down

0 comments on commit 6e9eded

Please sign in to comment.