Skip to content

Instantly share code, notes, and snippets.

View emanShedeed's full-sized avatar

Eman Shedeed emanShedeed

  • Jumia Egypt
  • Cairo, Egypt
View GitHub Profile
@emanShedeed
emanShedeed / Disable Alert Button.swift
Last active September 6, 2018 09:45 — forked from TheCodedSelf/Disable Alert Button.swift
Disable Alert Controller button if Alert Controller text field is empty or whitespace
import UIKit
// Create an alert controller
let alertController = UIAlertController(title: "Alert", message: "Please enter text", preferredStyle: .alert)
// Create an OK Button
let okAction = UIAlertAction(title: "OK", style: .default) { (_) in
// Print "OK Tapped" to the screen when the user taps OK
print("OK Tapped")
}