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
xcodebuild -workspace <workspace-name> -scheme <target-name> -configuration 'Release' -derivedDataPath <build-location> |
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
source '<URL_TO_REPOSITORY>' |
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
pod repo push <REPO_NAME> <SPEC_NAME>.podspec |
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
pod repo add <REPO_NAME> <SOURCE_URL> |
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
DispatchQueue.global(qos: .userInitiated).async { | |
let decodedImage = decodedImage(image) | |
DispatchQueue.main.async { | |
self.layer.contents = decodedImage?.cgImage | |
} | |
} |
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 decodedImage(_ image: UIImage) -> UIImage? { | |
guard let newImage = image.cgImage else { return nil } | |
let colorSpace = CGColorSpaceCreateDeviceRGB() | |
let context = CGContext(data: nil, width: newImage.width, height: newImage.height, bitsPerComponent: 8, bytesPerRow: newImage.width * 4, space: colorSpace, bitmapInfo: CGImageAlphaInfo.noneSkipFirst.rawValue) | |
context?.draw(newImage, in: CGRect(x: 0, y: 0, width: newImage.width, height: newImage.height)) | |
let drawnImage = context?.makeImage() | |
if let drawnImage = drawnImage { |
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
imageView.image = UIImage(named: imagePath) |
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
extension UIImage { | |
func circularImage(withSize size: CGSize) -> UIImage { | |
let scale = UIScreen.main.scale | |
let circleRect = CGRect(x: 0, y: 0, width: size.width * scale, height: size.height * scale) | |
UIGraphicsBeginImageContextWithOptions(circleRect.size, false, scale) | |
let circlePath = UIBezierPath(roundedRect: circleRect, cornerRadius: circleRect.width/2.0) | |
circlePath.addClip() | |
draw(in: circleRect) |
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
class RoundView: UIView { | |
override func draw(_ rect: CGRect) { | |
let ctx = UIGraphicsGetCurrentContext() | |
let bezierPath = UIBezierPath(roundedRect: rect, cornerRadius: 100) | |
bezierPath.addClip() | |
ctx?.addPath(bezierPath.cgPath) | |
image.draw(in: rect) | |
} |
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
let insets = UIEdgeInsets(top: 5.0, left: 5.0, bottom: 5.0, right: 5.0) | |
let image = UIImage(named: "shadow")?.resizableImage(withCapInsets: insets, resizingMode: .stretch) | |
shadowView.image = image |