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
public enum UploadStatus<Value> { | |
case progress(Progress) | |
case completion(Value) | |
case error(Error) | |
} | |
public protocol DataListner: AnyObject { | |
func remove() | |
} |
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
킹피셔 crash issue 및 pull request | |
크래시 이슈 | |
https://github.com/onevcat/Kingfisher/issues/1226 | |
풀 리퀘 | |
https://github.com/onevcat/Kingfisher/pull/1220 | |
이슈 코멘트에 따르면 수정은 된것으로 보임? |
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
class CustomPhotoPickerViewController: TLPhotosPickerViewController { | |
open func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { | |
if let image = (info[.originalImage] as? UIImage) { | |
var placeholderAsset: PHObjectPlaceholder? = nil | |
// Here!! 👇👇👇👇👇 | |
PHPhotoLibrary.shared().performChanges({ | |
let newAssetRequest = PHAssetChangeRequest.creationRequestForAsset(from: image) | |
placeholderAsset = newAssetRequest.placeholderForCreatedAsset | |
}, completionHandler: { [weak self] (sucess, error) in | |
if sucess, let `self` = self, let identifier = placeholderAsset?.localIdentifier { |
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
extension TLPhotosPickerViewController: PHPhotoLibraryChangeObserver { | |
public func photoLibraryDidChange(_ changeInstance: PHChange) { | |
guard getfocusedIndex() == 0 else { return } | |
let addIndex = self.usedCameraButton ? 1 : 0 | |
DispatchQueue.main.sync { | |
guard let changeFetchResult = self.focusedCollection?.fetchResult else { return } | |
guard let changes = changeInstance.changeDetails(for: changeFetchResult) else { return } | |
if changes.hasIncrementalChanges { | |
var deletedSelectedAssets = false | |
var order = 0 |
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
func disposablesSample() { | |
//noOp | |
Observable<String>.create { (observer) -> Disposable in | |
observer.on(.next("observable start")) | |
observer.on(.next("observable end")) | |
return Disposables.create() | |
} | |
.subscribe().disposed(by: disposeBag) | |
//op | |
let timer = Observable<Int>.create { observer in |
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
//스냅샷 테스트: 물품 목록화면 | |
//snapshottest : coordinator (present) ListOfPurchasesViewController | |
func test_AppCoordinator() { | |
let addButtonMatcher = grey_allOf([grey_accessibilityID("addButton"),grey_sufficientlyVisible()]) | |
EarlGrey.select(elementWithMatcher: addButtonMatcher).perform(grey_tap()) | |
EarlGrey.select(elementWithMatcher: CustomMatcher.allOfsufficiently(id: "PriceTextField").matcher).perform(grey_replaceText("600")) | |
EarlGrey.select(elementWithMatcher: CustomMatcher.allOfsufficiently(id: "PurchaseInputConfirm").matcher).perform(grey_tap()) | |
EarlGrey.select(elementWithMatcher: grey_allOf([grey_accessibilityID("ListOfPurchasesViewController"),grey_sufficientlyVisible()])).assert(grey_sufficientlyVisible()) | |
EarlGrey.select(elementWithMatcher: addButtonMatcher).perform(grey_tap()) | |
EarlGrey.select(elementWithMatcher: CustomMatcher.allOfsufficiently(id: "PriceTextField").matcher).perform(grey_replaceText("100")) |
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
class ListOfPurchasesViewController: BaseTestableViewController,RxTableViewBindProtocol { | |
//... | |
var viewModel: ListOfPurchasesViewModel! | |
var listOfPurchasesCoordinator: ListOfPurchasesCoordinator! | |
} | |
extension ListOfPurchasesViewController { | |
func bindViewModel() { | |
//... | |
//UI action |
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
protocol ListOfPurchasesCoordinatorProtocol: Coordinator { | |
func presentInputView() | |
func presentModifyView(item: Item) | |
func presentCustomsInformationView(viewModel: ListOfPurchasesViewModel) | |
} | |
class ListOfPurchasesCoordinator: ListOfPurchasesCoordinatorProtocol { | |
weak var viewController: UIViewController? | |
let disposeBag = DisposeBag() | |
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
EarlGrey.select(elementWithMatcher: Matches.displayLabel(text: "캠코더").matcher) | |
EarlGrey.select(elementWithMatcher: grey_text("캠코더")) | |
//- 요것들은 성공하지만 | |
EarlGrey.select(elementWithMatcher: Matches.displayLabel(text: "고급 가방").matcher) | |
EarlGrey.select(elementWithMatcher: grey_text("고급 가방")) | |
//- 요건 실패한다 | |
//공백이 있으면 찾지 못하는 듯 하다. |
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
//"카드 뷰모델 생성 테스트" | |
context("card") { | |
beforeEach { | |
self.initItems() | |
self.viewModel.estimatedCardViewModels | |
.asObservable().map{ [AnimatableSectionModel(model: "section\(0)", items: $0 )] }.debug().bind(to: self.bindProperty.bindViewModels).disposed(by: self.disposeBag) | |
} | |
it("db insert test") { | |
//DB에 아이템 입력시 카드 뷰모델이 생성되면 ok | |
let expectViewModel = PurchaseCardViewModel(item: self.item1) |
NewerOlder