This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
// =============== 1 ===================== | |
func changeItem<T>(_ array: [T]) -> [T] { | |
guard !array.isEmpty else { | |
print("\(array) -> Array is Empty!") | |
return array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
//================ # 1 ================== | |
let stringArray = ["Mr. Smith", "antony", "2", "cat Mr. Jons", "17", "other", "Mr.", "27", "home"] | |
func isInsertText(_ text: String) -> Bool { | |
return text.contains("Mr.") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import PlaygroundSupport | |
//1 | |
print("=============== # 1 ===============\n") | |
enum Rank: Int { | |
case ace = 1, two, three, four, five | |
case six, seven, eight, nine, ten | |
case jack, queen, king |