Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

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

21 changes: 21 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// swift-tools-version:5.3

import PackageDescription

let package = Package(
name: "LKAlertController",
platforms: [.iOS(.v9), .tvOS(.v9)],
products: [
.library(
name: "LKAlertController",
targets: ["LKAlertController"]
),
],
targets: [
.target(
name: "LKAlertController",
path: "Pod/Classes"
)
],
swiftLanguageVersions: [.v5]
)
6 changes: 3 additions & 3 deletions Pod/Classes/LKAlertController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ public class LKAlertController {
let popoverController = alertController.popoverPresentationController {

var topController = presentedController
while (topController.children.last != nil) {
topController = topController.children.last!
while (topController.children.last != nil) {
topController = topController.children.last!
}

popoverController.sourceView = topController.view
Expand Down Expand Up @@ -315,7 +315,7 @@ public class Alert: LKAlertController {
field = tf
}

if(required) {
if (required) {
NotificationCenter.default.addObserver(forName: UITextField.textDidChangeNotification, object: field, queue: OperationQueue.main) { (notification) in
if let actionButton = self.alertPrimaryAction {
actionButton.isEnabled = field?.text?.isEmpty == false
Expand Down