Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
🥺

Ambas Chobsanti ambas

🤔
🥺
View GitHub Profile
View CartWithIGListKit.markdown
  • Start with Classes -> Modules -> Cart -> Section

  • In this folder you can see all section type that we have in cart. ( PS. LACartSection is legacy class)

  • I use IGListBindingSectionController for SectionController with this way it will automatically bind viewModel and cell for us.

  • in sectionController class, we have to implement some dataSource methods

    • First we need to return all viewModel for section
    • Each viewModel will map to cell so relationship for viewModel and cell will be 1 to 1. So its mean a viewModel will have a cell to show.
    • I use category to separate logic for build viewModels , for the final result we will return array of viewModel to IGListKit and all of this viewModel will be mapped to cell.
    • You can check category in folder Classes -> Modules -> Cart -> Categories
    • If you start reading code at sectionController you will see category of viewModel try to ask a list of viewModel from child viewModel . I use this way because I try to separate viewModel bui
View DictionaryDeepMerge.swift
extension Dictionary {
mutating func merge<S>(_ other: S) where S: Sequence, S.Iterator.Element == (key: Key, value: Value) {
for (k, v) in other {
let old = self[k]
self[k] = merge(old, r: v)
}
}
}
extension Dictionary {
@ambas
ambas / gist:dd5240e3b843d6608990
Last active Aug 29, 2015
FetechedResultsController for TableView
View gist:dd5240e3b843d6608990
- (void)controllerWillChangeContent {
[self.tableView beginUpdates];
}
- (void)controllerDidChangeSection:(RBQFetchedResultsSectionInfo *)section atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type {
switch (type) {
case NSFetchedResultsChangeInsert:
[self.insertSections addObject:@(sectionIndex)];
break;
case NSFetchedResultsChangeDelete:
View MySed
sed -i '' 's/nullable//g' $(grep -lr --exclude-dir=".git" -e "nullable" .)
View Sed
sed -i '' 's/nullable//g' $(grep -lr --exclude-dir=".git" -e "nullable" .)
View -
Podfile
Podfile.lock
Pods
Resources
Scripts
TWMappingKit
TaskKit
TaskKitTests
TaskReactiveKit
TaskReactiveKitTests
View -
This is Brazil
We couldn’t find that file to show.
@ambas
ambas / public key
Last active Nov 14, 2017
for generate public key
View public key
ssh-keygen -t rsa -C "ambaschobsanti@gmail.com" && pbcopy < ~/.ssh/id_rsa.pub