Skip to content

Instantly share code, notes, and snippets.

View mrazam110's full-sized avatar

Muhammad Raza Master mrazam110

View GitHub Profile
@mrazam110
mrazam110 / log.swift
Created October 19, 2018 05:52
Detail logging or debugPrint in swift
func log(_ message: Any, _ file: String = #file, _ line: Int = #line, _ function: String = #function) {
debugPrint("[\(file):\(line)] \(function)")
debugPrint(message)
debugPrint()
}
@mrazam110
mrazam110 / UIImage+Project.swift
Created October 19, 2018 05:48
UIImage Extension for Swift
extension UIImage {
/// Merging two images into one
class func imageByCombiningImage(firstImage: UIImage, withImage secondImage: UIImage) -> UIImage {
let newImageWidth = max(firstImage.size.width, secondImage.size.width )
let newImageHeight = max(firstImage.size.height, secondImage.size.height)
let newImageSize = CGSize(width : newImageWidth, height: newImageHeight)
UIGraphicsBeginImageContextWithOptions(newImageSize, false, UIScreen.main.scale)
@mrazam110
mrazam110 / UIDevice+Project.swift
Created October 19, 2018 05:42
UIDevice Extension for Swift
extension UIDevice {
var isSimulator: Bool {
#if arch(i386) || arch(x86_64)
return true
#else
return false
#endif
}