Skip to content

Latest commit

 

History

History
56 lines (36 loc) · 1.42 KB

README.md

File metadata and controls

56 lines (36 loc) · 1.42 KB

Saystack

Saystack is a collection of simple classes and extensions for most common uses in any iOS Swift project. It is a Swift counterpart to Haystack. Saystack currently supports Swift 2.x. Swift 3.x version will be released once apps can be deployed to the App Store.

Saystack adds convenience Swift API's to multiple frameworks, including UIKit and Foundation.

Few examples:

  • UIImage resizing and loading
  • Searching for parent view types in UIView
@IBAction func tableCellButtonTap(sender: UIButton) {
    guard let cell = sender.parentTableViewCell() else { return }
    
    let indexPath = self.tableView.indexPathForCell(cell)
    
    // Use IndexPath
}
  • Random number generation
// Random Integer between 0 and 1000
let rand1 = Int.random(0, upper: 1000)

// Random Float between 0.00 and 1.00
let rand2 = Float.random()
  • Shuffling arrays
var array = [ 1, 2, 3, 4, 5 ]
array.shuffle()

print(array) // Prints [ 5, 2, 3, 1, 4 ]

let shuffled = [ 1, 2, 3, 4, 5 ].shuffled()

Contact

Dal Rupnik

License

Saystack is available under the MIT license. See LICENSE file for more information.