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 | |
| /** | |
| * Example: | |
| * let label: VerticalAlignedLabel = UILabel() | |
| * label.contentMode = .bottom | |
| * Ref: https://stackoverflow.com/questions/18247934/how-to-align-uilabel-text-from-bottom | |
| * TODO: ⚠️️ Maybe we could just do sizeThatFits fitToSize etc or just us TextField? | |
| * Todo: this is cool but its not precise enough. this is more precise: https://stackoverflow.com/a/51761518 | |
| * let size = text.size(withAttributes:[.font: UIFont.systemFont(ofSize:18.0)]) | |
| */ |
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 Foundation | |
| final class QRVersionTableTest {} | |
| extension QRVersionTableTest { | |
| /** | |
| * convertQRVersionTable | |
| * - Note: a small method to convert qrversion table to a more machine readable format | |
| */ | |
| static func convertQRVersionTable() { | |
| Swift.print("convertQRVersionTable") |
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
| struct Employee { | |
| let name: String | |
| let sallary: Double | |
| let role: Role | |
| enum Role: String { | |
| case it, hr, managment | |
| } | |
| } | |
| func payMonthly(employees: [Employee]) { | |
| employees.forEach { payMonthly(employee: $0) } |
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
| extension UIViewController { | |
| /** | |
| * Traverses the entire VC hirearchy downwards and collects VC'w that are of speccific PARAM: type | |
| * - Fixme: ⚠️️ this can be written more elegantly with flatMap | |
| * ## Example: | |
| * let vc: CustomVC? = UIApplication.shared.delegate?.window?.rootViewController?.descendants().first | |
| */ | |
| func descendants<T>(type: T.Type? = nil) -> [T] { | |
| var childrenOfType: [T] = [] | |
| self.children.forEach { |
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 | |
| extension UITableViewDataSource where Self: UITableView { | |
| /** | |
| * Returns a cells in table | |
| * - Note: Unlike native cell(for index) or visibleCells calls, this call wont break/complain even when called before the cells are available | |
| */ | |
| var availableCells: [UITableViewCell] { | |
| self.subviews.compactMap { $0 as? UITableViewCell } | |
| } |
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
| # CheapFlights (Mobility challenge) | |
| - Use api's from top 3 flight aggregators (use google to find them) 💻 | |
| - Searchbar with: input destination and departure, input time 🗺 | |
| - Get cheapest tickets (direct flight only) ✈️ | |
| - Present with basic info in table view 📝 | |
| - Present detail view if item is pressed 👇 | |
| - Pull table to refresh (or refresh button if web-app) ⬇️ | |
| ## Challenges: |
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
| /** | |
| * Asserter | |
| */ | |
| extension Array { | |
| /** | |
| * Asserts if array has nil values | |
| * ## Examples: | |
| * let someArr: [Int?] = [1,2,nil] | |
| * someArr.hasNil() // true | |
| * [1,2,2].hasNil() // false |
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
| Pink | |
| #ff2d55 | |
| Purple | |
| #5856d6 | |
| Orange | |
| #ff9500 | |
| Yellow |
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
| .text-transparent color: transparent; Aa | |
| .text-current color: currentColor; Aa | |
| .text-black color: #000; Aa | |
| .text-white color: #fff; Aa | |
| .text-gray-100 color: #f7fafc; Aa | |
| .text-gray-200 color: #edf2f7; Aa | |
| .text-gray-300 color: #e2e8f0; Aa | |
| .text-gray-400 color: #cbd5e0; Aa | |
| .text-gray-500 color: #a0aec0; Aa | |
| .text-gray-600 color: #718096; Aa |