Skip to content

Instantly share code, notes, and snippets.

extension StringProtocol {
var isValidCNPJ: Bool {
let numbers = compactMap(\.wholeNumberValue)
guard numbers.count == 14 && Set(numbers).count != 1 else { return false }
return numbers.prefix(12).digitoCNPJ == numbers[12] &&
numbers.prefix(13).digitoCNPJ == numbers[13]
}
//
// UITextField.swift
//
// Created by Bruno Scheltzke on 07/06/20.
// Copyright © 2020 Bruno Scheltzke. All rights reserved.
//
import UIKit
extension UITextField {
//
// UIScrollView.swift
//
// Created by Bruno Scheltzke on 07/06/20.
// Copyright © 2020 Bruno Scheltzke. All rights reserved.
//
import UIKit
extension UIScrollView {
//
// String.swift
//
// Created by Bruno Scheltzke on 04/06/20.
// Copyright © 2020 Bruno Scheltzke All rights reserved.
//
import UIKit
extension String {
//
// UIColor+Extension.swift
//
// Created by Bruno Scheltzke on 04/06/20.
// Copyright © 2020 Bruno Scheltzke All rights reserved.
//
import UIKit
extension UIColor {
//
// UIView+Extension.swift
//
// Created by Bruno Scheltzke on 04/06/20.
// Copyright © 2020 Bruno Scheltzke All rights reserved.
//
import UIKit
/// Tag used to remove lock view when requested
//
// UIViewController.swift
//
// Created by Bruno Scheltzke on 04/06/20.
// Copyright © 2020 Bruno Scheltzke All rights reserved.
//
import UIKit
extension UIViewController {
//
// GradientView.swift
//
// Created by Bruno Scheltzke on 19/06/20.
// Copyright © 2020 Bruno Scheltzke All rights reserved.
//
import UIKit
@IBDesignable
@BrunoScheltzke
BrunoScheltzke / RoundButton.swift
Created July 6, 2020 21:37
Round button with intrinsic content size
//
// RoundButton.swift
//
// Created by Bruno Scheltzke on 04/06/20.
// Copyright © 2020 Bruno Scheltzke All rights reserved.
//
import UIKit
@IBDesignable
//
// ShadowView.swift
//
// Created by Bruno Scheltzke on 14/06/20.
// Copyright © Bruno Scheltzke. All rights reserved.
//
import UIKit
@IBDesignable
class ShadowView: UIView {