Skip to content

Instantly share code, notes, and snippets.

View uy's full-sized avatar
👊
improvement.

Utku Y. uy

👊
improvement.
View GitHub Profile
@uy
uy / gist:3d9f4bd9c28063416f9da42425bb9430
Last active September 28, 2021 15:33
Custom Checkbox iOS Swift
import UIKit
class CheckBox: UIButton {
// Images
let checkedImage = UIImage(named: "ic_check_box")! as UIImage
let uncheckedImage = UIImage(named: "ic_check_box_outline_blank")! as UIImage
// Bool property
var isChecked: Bool = false {
didSet{
@uy
uy / MoveScreenDependsOnKeyboard.swift
Created October 14, 2018 11:29
Move a view up only when the keyboard covers an input field
class Welcome: UIViewController {
@IBOutlet weak var tfEMail: TextField!
@IBOutlet weak var tfPassword: TextField!
private var activeTextField: UITextField?
override func viewDidLoad() {
super.viewDidLoad()
registerForKeyboardNotifications()
@uy
uy / a.swift
Created June 1, 2022 09:55
get days in given date's month
import Foundation
struct MCalendarDate {
let weekOfYear: Int
let weekday: Int
let day: Int
let month: Int
let year: Int
let date: Date