Swift – Convert String to Double

Standard

Swift has conventions to convert a string into an int

But for doubles, lets say you want var dblString = “5.559” converted from a string to a double. You can’t just do dblString.toDouble()!, not going to happen it just gives an error. So the solution for now is to use Objective-C

Home made Poo Pourri

Standard

My wife brought home some poo poo spray one night and I asked her how much it cost for this 2 oz bottle of water and fragrance oils. $10 for a 2 oz bottle of what I assume is mostly tap water and essential oils. Now I have to admit I used it and it does work but I know I can make something similar. And at a better price point which would make it so much better. I knew I needed an emulsifier to mix the water and fragrances together.

Research:

Alcohol is an oil emulsifier but so is something called Polysorbate 20. I found that industries use Polysorbate 20 to mix fragrances into liquids like bleach and cleansers. It’s also used in cosmetics. Continue reading