Navigation Menu

Skip to content

Commit

Permalink
Fixing codesigning and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Sargent committed Nov 21, 2016
1 parent 587cdbf commit b119b9e
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 68 deletions.
5 changes: 5 additions & 0 deletions Example/LKAlertController.xcodeproj/project.pbxproj
Expand Up @@ -135,6 +135,7 @@
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0800;
ProvisioningStyle = Manual;
};
};
};
Expand Down Expand Up @@ -317,6 +318,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = AFD22BCE96848D83ACE1F30D /* Pods-LKAlertController_Tests.debug.xcconfig */;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
Expand All @@ -337,6 +340,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 647D944FA91F9A5394FAC146 /* Pods-LKAlertController_Tests.release.xcconfig */;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
34 changes: 29 additions & 5 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

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.

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.

26 changes: 7 additions & 19 deletions Pod/Classes/LKAlertController.swift
Expand Up @@ -220,7 +220,6 @@ public class LKAlertController {

///Alert controller
public class Alert: LKAlertController {

///Create a new alert without a title or message
public init() {
super.init(style: .alert)
Expand Down Expand Up @@ -266,9 +265,9 @@ public class Alert: LKAlertController {
*/
@discardableResult
public func addAction(_ title: String) -> Alert {
return addAction(title, style: .cancel, preferredAction: false, handler: nil)
return addAction(title, style: .default, preferredAction: false, handler: nil)
}
/**
Add a new button to the alert.
Expand All @@ -277,7 +276,7 @@ public class Alert: LKAlertController {
- parameter handler: Closure to call when the button is pressed
*/
@discardableResult
public override func addAction(_ title: String, style: UIAlertActionStyle, handler: actionHandler?) -> Alert {
public override func addAction(_ title: String, style: UIAlertActionStyle, handler: actionHandler? = nil) -> Alert {
return addAction(title, style: style, preferredAction: false, handler: handler)
}

Expand All @@ -290,10 +289,7 @@ public class Alert: LKAlertController {
- parameter preferredAction: The preferred action for the user to take from an alert.
*/
@discardableResult
public override func addAction(_ title: String, style: UIAlertActionStyle, preferredAction: Bool, handler: actionHandler?) -> Alert {
if(hasRequiredTextfield){

}
public override func addAction(_ title: String, style: UIAlertActionStyle, preferredAction: Bool, handler: actionHandler? = nil) -> Alert {
return super.addAction(title, style: style, preferredAction: preferredAction, handler: handler) as! Alert
}

Expand All @@ -319,7 +315,7 @@ public class Alert: LKAlertController {
field = tf
}

if(required){
if(required) {
NotificationCenter.default.addObserver(forName: NSNotification.Name.UITextFieldTextDidChange, object: field, queue: OperationQueue.main) { (notification) in
if let actionButton = self.alertPrimaryAction {
actionButton.isEnabled = (!(field?.text?.isEmpty)!) ?? false
Expand All @@ -334,14 +330,7 @@ public class Alert: LKAlertController {

return self
}

public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
print("text changing")
if let actionButton = self.alertPrimaryAction {
actionButton.isEnabled = (!(textField.text?.isEmpty)!) ?? false
}
return true
}

///Set the view controller to present the alert in. By default this is the top controller in the window.
@discardableResult
public override func presentIn(_ source: UIViewController) -> Alert {
Expand Down Expand Up @@ -427,7 +416,7 @@ public class ActionSheet: LKAlertController {
- parameter handler: Closure to call when the button is pressed
*/
@discardableResult
public override func addAction(_ title: String, style: UIAlertActionStyle, handler: actionHandler?) -> ActionSheet {
public override func addAction(_ title: String, style: UIAlertActionStyle, handler: actionHandler? = nil) -> ActionSheet {
return super.addAction(title, style: style, preferredAction: false, handler: handler) as! ActionSheet
}

Expand All @@ -444,7 +433,6 @@ public class ActionSheet: LKAlertController {
}

///Set the tint color for the action sheet

public func tint(_ color: UIColor) -> ActionSheet {
tintColor = color
return self
Expand Down

0 comments on commit b119b9e

Please sign in to comment.