Welcome to DrinkKit! DrinkKit is a small framework written in Swift which can easily calculate your Blood Alcohol Content or check how long until you're sober. Cheers!
Download the latest release and open up the playground workspace. Then build iOS target.
import Foundation
import DrinkKit
// Create User
let john = User(sex: .male)
let BAC = BloodAlcoholContent(user: john)
// Set Started Drinking Time
let thirtyMinsAgo = Calendar.current.date(byAdding: .minute, value: -30, to: Date())!
let drinks : [Drink] = [Drink(alcohol: .wine)]
let currentBAC = BAC.get(with: drinks, started: thirtyMinsAgo)
print(currentBAC.percantage)
print(drinks)🥃 Calculate your Blood Alcohol Content
import DrinkKitis required.
let oneHourAgo = Calendar.current.date(byAdding: .hour, value: -1, to: Date())!
let drinks : [Drink] = [Drink(Alcohol: .beer)]
let janice = User(sex: .female, weight: 120, feet: 5, inches: 2)
let BAC = BloodAlcoholContent(user: janice)
let currentBAC = BAC.Get(with: drinks, started: thirtyMinsAgo)
print(currentBAC)⏱ See When you'll be Sober
import DrinkKitis required.
let john = User(sex: .male)
let BAC = BloodAlcoholContent(user: john)
let soberAt = BAC.time(when: .sober, current: 0.08)
print(soberAt)You can download the latest frameworks from the release section or use Carthage. Please follow their instructions for downloading.
This is my first open source project, I hope you enjoy it and I would appreciate any feedback. Let me know what you think on Twitter 😊