Skip to content

Instantly share code, notes, and snippets.

View amannayak0007's full-sized avatar
🏠
Working from home

Aman Jain amannayak0007

🏠
Working from home
View GitHub Profile
@EnesKaraosman
EnesKaraosman / RandomColor.swift
Last active May 9, 2024 22:41
Generatin random color in SwiftUI & UIKit
#if canImport(UIKit)
import UIKit
extension UIColor {
static var random: UIColor {
return UIColor(
red: .random(in: 0...1),
green: .random(in: 0...1),
blue: .random(in: 0...1)
)
@amannayak0007
amannayak0007 / UITableView.swift
Created October 29, 2018 06:00
Method for dequeueReusableCell
// UITableView.swift
import UIKit
/**
* Extension to provide extra capabilities to existing UITableView.
*/
extension UITableView{
/**
extension UITextField{
@IBInspectable var doneAccessory: Bool{
get{
return self.doneAccessory
}
set (hasDone) {
if hasDone{
addDoneButtonOnKeyboard()
}
}
@dylankbuckley
dylankbuckley / LearnSwiftPartOne.playground
Created September 18, 2016 19:05
Learn Swift 3.0 & Xcode 8 (Part 1 - Swift Basics)
// Basic Operators
35 + 98
62 - 14
50 / 10
463 * 173
// Types
var age: Int = 21 // Int = Integer = Any whole number
var milesCanRun: Double = 0.75 // Double = Float = Decimal Number