-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring: addWord -> addFlashcard. Added new models
- Loading branch information
Ilya Denisov
authored and
Ilya Denisov
committed
Sep 3, 2016
1 parent
9127812
commit eb746b2
Showing
51 changed files
with
481 additions
and
351 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
27 changes: 27 additions & 0 deletions
27
DigDic/Modules/AddWord/Interactor/IDAddFlashcardInteractor.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// IDAddFlashcardIDAddFlashcardInteractor.swift | ||
// DigDic | ||
// | ||
// Created by ls on 26/08/2016. | ||
// Copyright © 2016 Ilya Denisov. All rights reserved. | ||
// | ||
|
||
class IDAddFlashcardInteractor: IDAddFlashcardInteractorInput { | ||
|
||
weak var output: IDAddFlashcardInteractorOutput! | ||
lazy var service: IDDictionaryService = IDDictionaryService(source: IDLocalDataBaseSource()) | ||
|
||
func addFlashcardWithDataHolders(dataHolders: [IDAddFlashcardDataHolder]) -> IDFlashcard { | ||
let flashcard = service.flashcardModelForFilling() | ||
// dataHolders.map{ dataHolder in | ||
// switch dataHolder { | ||
// case let imageDataHolder as IDAddFlashcardImageDataHolder: | ||
// if let image = imageDataHolder.image { | ||
// | ||
// } | ||
// } | ||
// } | ||
return flashcard | ||
} | ||
|
||
} |
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
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
16 changes: 0 additions & 16 deletions
16
DigDic/Modules/AddWord/Interactor/IDAddWordInteractor.swift
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...Word/Presenter/IDAddWordModuleInput.swift → ...Presenter/IDAddFlashcardModuleInput.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// | ||
// AddWordIDAddWordModuleInput.swift | ||
// AddFlashcardIDAddFlashcardModuleInput.swift | ||
// DigDic | ||
// | ||
// Created by ls on 26/08/2016. | ||
// Copyright © 2016 Ilya Denisov. All rights reserved. | ||
// | ||
|
||
protocol IDAddWordModuleInput: IDBaseModuleInput { | ||
protocol IDAddFlashcardModuleInput: IDBaseModuleInput { | ||
|
||
} |
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
4 changes: 2 additions & 2 deletions
4
...ules/AddWord/Router/IDAddWordRouter.swift → ...AddWord/Router/IDAddFlashcardRouter.swift
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
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
15 changes: 15 additions & 0 deletions
15
...d/View/CellObjectBuilder/ConcreteCellObjectBuilders/IDAddFlashcardCellObjectBuilder.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// IDAddFlashcardCellObjectBuilder.swift | ||
// DigDic | ||
// | ||
// Created by Ilya Denisov on 8/31/16. | ||
// Copyright © 2016 Ilya Denisov. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol IDAddFlashcardCellObjectBuilder { | ||
|
||
func cellObjectForDataHolder(dataHolder: IDAddFlashcardDataHolder) -> IDAddFlashcardCell | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
...ObjectBuilder/ConcreteCellObjectBuilders/IDAddFlashcardSelectImageCellObjectBuilder.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// IDAddFlashcardSelectImageCellObjectBuilder.swift | ||
// DigDic | ||
// | ||
// Created by Ilya Denisov on 8/31/16. | ||
// Copyright © 2016 Ilya Denisov. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class IDAddFlashcardSelectImageCellObjectBuilder: IDAddFlashcardCellObjectBuilder { | ||
|
||
func cellObjectForDataHolder(dataHolder: IDAddFlashcardDataHolder) -> IDAddFlashcardCell { | ||
let view = NSBundle.mainBundle().loadNibNamed(String(IDAddFlashcardSelectImageCell), owner: nil, options: nil).last | ||
let cell = view as! IDAddFlashcardSelectImageCell | ||
if let imageDataHolder = dataHolder as? IDAddFlashcardImageDataHolder { | ||
cell.loadFromDataHolder(imageDataHolder) | ||
} | ||
return cell | ||
} | ||
|
||
} |
15 changes: 0 additions & 15 deletions
15
...ddWord/View/CellObjectBuilder/ConcreteCellObjectBuilders/IDAddWordCellObjectBuilder.swift
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
.../CellObjectBuilder/ConcreteCellObjectBuilders/IDAddWordSelectImageCellObjectBuilder.swift
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
DigDic/Modules/AddWord/View/CellObjectBuilder/IDAddFlashcardCellObjectBuilderFactory.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// IDAddFlashcardCellObjectBuilderFactory.swift | ||
// DigDic | ||
// | ||
// Created by Ilya Denisov on 8/31/16. | ||
// Copyright © 2016 Ilya Denisov. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class IDAddFlashcardCellObjectBuilderFactory { | ||
|
||
class func builderForDataHolder(dataHolder: IDAddFlashcardDataHolder) -> IDAddFlashcardCellObjectBuilder? { | ||
switch dataHolder { | ||
case _ as IDAddFlashcardImageDataHolder: | ||
return IDAddFlashcardSelectImageCellObjectBuilder() | ||
default: | ||
return nil | ||
} | ||
} | ||
|
||
} |
22 changes: 0 additions & 22 deletions
22
DigDic/Modules/AddWord/View/CellObjectBuilder/IDAddWordCellObjectBuilderFactory.swift
This file was deleted.
Oops, something went wrong.
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
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
3 changes: 1 addition & 2 deletions
3
...ectImageCell/IDAddWordSelectImageCell.xib → ...ageCell/IDAddFlashcardSelectImageCell.xib
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
Oops, something went wrong.