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
// | |
// UIAnimatableLabel.swift | |
// | |
// Created by Abhishek Maurya on 04/04/23. | |
// | |
import UIKit | |
// MARK: - UIAnimatableLabel | |
final class UIAnimatableLabel: UILabel { |
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
// | |
// AutolayoutHelper.swift | |
// | |
// Created by Pawan on 30/07/19. | |
// Copyright © 2019 Pawan. All rights reserved. | |
// | |
import Foundation |
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
view.subviews.compactMap({ $0 as? UITextField }).forEach { textfield in | |
if let text = textfield.text, text.isEmpty { | |
textfield.backgroundColor = .yellow // highlight | |
} else { | |
textfield.backgroundColor = .white // default | |
} | |
} |
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
// | |
// AudioPlayer.swift | |
// | |
// Created by MDobekidis | |
// | |
import Foundation | |
import AVFoundation | |
import UIKit | |
import Signals |
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
// Numerical matrix examples | |
let x: Matrix = [[10, 9, 8], [3, 2, 1]] | |
let y: Matrix = [[1, 2, 3], [4, 5, 6]] | |
let z: Matrix = [[1, 2], [3, 4], [5, 6]] | |
x + y // [[11, 11, 11], [7, 7, 7]] | |
x * y // [[10, 18, 24], [12, 10, 6]] | |
2 * x // [[20, 18, 16], [6, 4, 2]] | |
y ** z // [[22, 28], [49, 64]] |