This file contains hidden or 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 getPathPayer(arrPathPoints:[CGPoint]) throws -> CAShapeLayer { | |
enum PathError : Error{ | |
case moreThan2PointsNeeded | |
} | |
guard arrPathPoints.count > 2 else { | |
throw PathError.moreThan2PointsNeeded | |
} | |
let lineColor = UIColor.blue |
This file contains hidden or 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
import Foundation | |
import UIKit | |
func getWidth() -> CGFloat{ | |
return UIScreen.main.bounds.width | |
} | |
func getHeight() -> CGFloat{ | |
return UIScreen.main.bounds.height |
This file contains hidden or 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
//: Playground - noun: a place where people can play | |
import UIKit | |
do{ | |
func compressImage(_ img:UIImage) -> UIImage? { | |
// Reducing file size to a 10th | |
var actualHeight: CGFloat = img.size.height | |
var actualWidth: CGFloat = img.size.width | |
let maxHeight: CGFloat = 1136.0 |
NewerOlder