Skip to content

Instantly share code, notes, and snippets.

@yogeshmanghnani
yogeshmanghnani / GradientWrapperView.swift
Last active February 24, 2019 12:59
Gradients in iOS using Swift
import UIKit
class GradientWrapperView: UIView {
private let gradientLayer: CAGradientLayer = {
let layer = CAGradientLayer()
layer.borderColor = UIColor.black.cgColor
layer.borderWidth = CGFloat(0.5)
return layer
}()
@yogeshmanghnani
yogeshmanghnani / CircularProgressBar.swift
Last active June 23, 2021 11:04
This is a Circular Progress Bar View. Demo application at :- http://github.com/yogeshmanghnani/circularProgressBar
//
// CircularProgressBar.swift
// attendance-manager
//
// Created by Yogesh Manghnani on 02/05/18.
// Copyright © 2018 Yogesh Manghnani. All rights reserved.
//
import UIKit
@yogeshmanghnani
yogeshmanghnani / movableArray.swift
Last active April 10, 2018 01:42
This is a demonstration of Movable array using conditional conformances
extension Array: Movable where Element: Movable {
func move() {
for item in self {
item.move()
}
}
}
@yogeshmanghnani
yogeshmanghnani / vehicleStructure.swift
Created April 9, 2018 18:54
This is a vehicle structure in Swift for demonstration of Conditional Conformances
struct Vehicele: Movable {
var wheels: Int
var doors: Int
var tankCapacity: Double
var isMoving = false
func move() {
isMoving = true
print("The car is moving")
}
@yogeshmanghnani
yogeshmanghnani / protocolMovable.swift
Created April 9, 2018 18:46
Simple example of Protocol
protocol Movable {
func move()
}