(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
import Alamofire | |
import RxSwift | |
extension Request: ReactiveCompatible {} | |
extension Reactive where Base: DataRequest { | |
func responseJSON() -> Observable<Any> { | |
return Observable.create { observer in | |
let request = self.base.responseJSON { response in |
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { | |
cell.contentView.layer.cornerRadius = 2.0 | |
cell.contentView.layer.borderWidth = 1.0 | |
cell.contentView.layer.borderColor = UIColor.clear.cgColor | |
cell.contentView.layer.masksToBounds = true; | |
cell.layer.shadowColor = UIColor.lightGray.cgColor | |
cell.layer.shadowOffset = CGSize(width:0,height: 2.0) | |
cell.layer.shadowRadius = 2.0 | |
cell.layer.shadowOpacity = 1.0 |
let myDictionary = [ | |
"20" : "banna", | |
"60" : "apple", | |
"30" : "cucumber", | |
"10" : "starfruit" | |
] | |
//assume that sort() kinda takes 2 arguments i.e. sort(dictionary element a, dictionary element b) | |
//woriking its way down the array (http://www.sorting-algorithms.com/bubble-sort) | |
//compare the 0th assumed parameter(a) with the 1st assumed parameter (b), using the key (0 after decimal) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.