Skip to content

Instantly share code, notes, and snippets.

@NeoSPU
NeoSPU / hw_26_swift
Last active December 23, 2017 19:20
//: 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
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.")
}
@NeoSPU
NeoSPU / hw_7.swift
Last active October 22, 2017 10:53
HomeWork_7
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