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 | |
public extension UICollectionView { | |
/** | |
Register nibs faster by passing the type - if for some reason the `identifier` is different then it can be passed | |
- Parameter type: UICollectionView.Type | |
- Parameter identifier: String? | |
*/ | |
func registerCell(type: UICollectionViewCell.Type, identifier: String? = nil) { | |
let cellId = String(describing: type) |
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
let arrayOfTuples = [(0, 1), (0, 1), (0, 1), (0, 1), (0, 1), (0, 1), (0, 1), (0, 1), (0, 1), (0, 1)] | |
let flattenedArray = arrayOfTuples.flatMap{ [$0.0, $0.1] } | |
security find-generic-password -ga WIFI NAME | |
https://developer.usebutton.com/guides/merchants/universal-links | |
https://johncodeos.com/how-to-add-uicollectionview-inside-uitableviewcell-using-swift/ | |
https://github.com/johncodeos-blog |
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
First of all rather than multiple arrays use a struct for the data source. | |
And don't use extra arrays or dictionaries to maintain the selection either, this is error-prone and unnecessarily expensive. | |
Add a boolean member to the struct for the selected state. | |
struct Course : Codable { | |
let name : String | |
let image : String | |
var isSelected : Bool |
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 | |
struct RequestType { | |
static let POST = "POST" | |
static let GET = "GET" | |
} | |
enum HtttpType: String { | |
case POST = "POST" | |
case GET = "GET" |