This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class XOREncryptionAndDecryption { | |
static func encript(_ text: String, cipher: String) -> String { | |
let text = [UInt8](text.utf8) | |
let cipher = [UInt8](cipher.utf8) | |
var encripted = [UInt8]() | |
for (index, item) in text.enumerated() { | |
encripted.append(item ^ cipher[index]) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private var badge = BadgeBarButtonItem() | |
var counterItem = 0 | |
@objc | |
func didTappedAddToCart(with imageView: UIImageView?) { | |
guard let imageView = imageView else { return } | |
let bounds = imageView.bounds | |
let size = imageView.frame.size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// PaddedLabel.swift | |
// PaddedLabel | |
// | |
// Created by Mohammad Farhan on 4/27/19. | |
// Copyright © 2019 PaddedLabel. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
struct AppFontName { | |
static let regular = "CourierNewPSMT" | |
static let bold = "CourierNewPS-BoldMT" | |
static let italic = "CourierNewPS-ItalicMT" | |
} | |
extension UIFontDescriptor.AttributeName { | |
static let nsctFontUIUsage = UIFontDescriptor.AttributeName(rawValue: "NSCTFontUIUsageAttribute") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Protocal that copyable class should conform | |
protocol Copying { | |
init(original: Self) | |
} | |
//Concrete class extension | |
extension Copying { | |
func copy() -> Self { | |
return Self.init(original: self) | |
} |
NewerOlder