Skip to content

Instantly share code, notes, and snippets.

View iOSdev-klimov's full-sized avatar

Nurkanat Klimov iOSdev-klimov

View GitHub Profile
@nelglez
nelglez / validation
Created April 1, 2020 12:49
Validation of emails, usernames, passwords and phone numbers in swift
import Foundation
class Validation {
//Validate email address logic
func isValidMailInput(input: String) -> Bool {
let emailFormat = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}"
let emailPredicate = NSPredicate(format:"SELF MATCHES %@", emailFormat)
return emailPredicate.evaluate(with: input)
}
@darrarski
darrarski / CustomIntensityVisualEffectView.swift
Last active January 22, 2026 10:52
UIVisualEffectView subclass that allows to customise effect intensity
// MIT License
//
// Copyright (c) 2017 Dariusz Rybicki Darrarski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@kunikullaya
kunikullaya / Date+Extension.swift
Created January 18, 2017 05:21
Date Extension for Swift
import Foundation
extension Date {
func toString(format: String = "yyyy-MM-dd") -> String {
let formatter = DateFormatter()
formatter.dateStyle = .short
formatter.dateFormat = format
return formatter.string(from: self)
}