Skip to content

Instantly share code, notes, and snippets.

@gingofthesouth
gingofthesouth / CardView.swift
Last active June 23, 2020 03:45
An Apple like card view in SwiftUI
//
// CardView.swift
//
// Created by Ernest Cunningham on 27/05/20.
//
import SwiftUI
struct CardView<CardContent: View>: View {
@Environment(\.colorScheme) var mode
@gingofthesouth
gingofthesouth / RandomString.swift
Last active August 23, 2016 11:07
Swift 2.2 Random String Generation
// based on https://gist.github.com/samuel-mellert/20b3c99dec168255a046
// which is based on https://gist.github.com/szhernovoy/276e69eb90a0de84dd90
// Updated to work on Swift 2.2
func randomString(length: Int) -> String {
let charactersString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
let charactersArray : [Character] = Array(charactersString.characters)
var string = ""
for _ in 0..<length {