This file contains 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
// | |
// ResizableLineView.swift | |
// YourProjectName | |
// | |
// Created by conath on 09/12/20. Should work on iOS 12 and later. | |
// | |
// This is free and unencumbered software released into the public domain. | |
// | |
// Anyone is free to copy, modify, publish, use, compile, sell, or | |
// distribute this software, either in source code form or as a compiled |
This file contains 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 Foundation | |
extension Data { | |
init?(hexString: String) { | |
let len = hexString.count / 2 | |
var data = Data(capacity: len) | |
for i in 0..<len { | |
let j = hexString.index(hexString.startIndex, offsetBy: i*2) | |
let k = hexString.index(j, offsetBy: 2) | |
let bytes = hexString[j..<k] |
This file contains 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 | |
extension UIView { | |
func animateWiggle(withDuration duration: TimeInterval, delay: TimeInterval, completion: @escaping((Bool) -> ())) { | |
UIView.animate(withDuration: duration/4, delay: delay, usingSpringWithDamping: 0.5, initialSpringVelocity: 10, options: [], animations: { | |
self.transform = CGAffineTransform.identity.translatedBy(x: 8, y: 0) | |
}) { _ in | |
UIView.animate(withDuration: duration/4, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 10, options: [], animations: { | |
self.transform = CGAffineTransform.identity.translatedBy(x: -7, y: 0) | |
}) { _ in |
This file contains 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
# Licensed under "The Unlicense" | |
# Created by CONATH on 03 Feb 2017 | |
def repeatStr(string, times): | |
ausgabe = str(string) | |
for i in range(times): | |
ausgabe += string | |
return ausgabe | |
def maxLength(matrix): |