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
extension Sequence { | |
func asyncMap<T>(_ transform: (Element) async throws -> T) async rethrows -> [T] { | |
var values = [T]() | |
for element in self { | |
try await values.append(transform(element)) | |
} | |
return values | |
} | |
func asyncParallelMap<T>(_ transform:@escaping (Element) async throws -> T) async rethrows -> [T] { |
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 | |
class BorderedLabel: UILabel { | |
@IBInspectable var strokeSize: CGFloat = 0 | |
@IBInspectable var strokeColor: UIColor = .clear | |
@IBInspectable var leftPadding: CGFloat = 0 | |
@IBInspectable var rightPadding: CGFloat = 0 | |
@IBInspectable var topPadding: CGFloat = 0 | |
@IBInspectable var bottomPadding: CGFloat = 0 | |