This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func imageWithColor(_ color: UIColor) -> UIImage { | |
let rect = CGRect(x: 0, y: 0, width: 1, height: 1) | |
UIGraphicsBeginImageContext(rect.size) | |
let context = UIGraphicsGetCurrentContext() | |
context!.setFillColor(color.cgColor) | |
context!.fill(rect) | |
let image = UIGraphicsGetImageFromCurrentImageContext()! | |
UIGraphicsEndImageContext() | |
return image | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TestSHA1Digest.swift | |
// SwiftPlayground | |
// | |
// Created by Enix Yu on 31/10/2016. | |
// Copyright © 2016 RobotBros. All rights reserved. | |
// | |
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
// !! Be sure to #import <CommonCrypto/CommonCrypto.h> in the bridging header file !! | |
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |