Skip to content

Trouble Shooting

HyeonJeong edited this page Jul 4, 2024 · 2 revisions

CoreData

๐Ÿ’ก CoreData ์–ด๋ ค์› ๋˜ ์ 

  • ์ถœ์‹œ ํ›„ CoreData ๋ชจ๋ธ ๋ณ€๊ฒฝ์‹œ Migration ํ•„์š” โ†’ ์ ์€ ์ •๋ณด๋Ÿ‰์œผ๋กœ ์ธํ•œ ์–ด๋ ค์›€

๐Ÿ’ก CoreData ํ•ด๊ฒฐ ๋ฐฉ์•ˆ

  • ํ•˜๋‚˜์˜ Entity๋ฅผ ๋‘ ๊ฐœ์˜ Entity๋กœ ๋‚˜๋ˆ„๊ธฐ ๋•Œ๋ฌธ์— โ€จ โ†’ Migration Policy ์„ค์ • ํ•„์š”
  • ์›ํ™œํ•˜์ง€ ์•Š์•˜๋˜ ์ด์œ โ€จ : ํŒŒ์ผ ์ด๋ฆ„์ด ์•„๋‹Œ ํŒŒ์ผ ๊ฒฝ๋กœ๋ฅผ ์ ์–ด์•ผ ๋ฐ˜์˜๋จ
image



RxSwift

๐Ÿ’ก RxSwift ์–ด๋ ค์› ๋˜ ์  Subscribe, DisposeBag

  • ํ™ˆ ํ™”๋ฉด์—์„œ ๊ตฌ๋…์„ ํ•ด์ œ ํ•˜๋Š” ์‹œ์ ์„ ์ œ๋Œ€๋กœ ์•Œ์ง€ ๋ชปํ•˜์—ฌ, ๊ฐ™์€ ๋ฐ์ดํ„ฐ๋ฅผ ๋‹ค๋ฃจ๊ณ  ์žˆ๋Š” ๊ตฌ์ ˆ ํ™”๋ฉด์—์„œ ํ™ˆ ํ™”๋ฉด์— ์˜ํ–ฅ์„ ๋ผ์นจ

  • ย Life Cycle์— ๋Œ€ํ•ด ๊ณต๋ถ€ ํ›„ TabBar๋Š” ๋‹ค๋ฅธ ํ™”๋ฉด์œผ๋กœ ์ „ํ™˜ ๋˜๋”๋ผ๋„ ๋ฉ”๋ชจ๋ฆฌ์—์„œ ํ•ด์ œ๋˜์ง€ ์•Š๋Š”๋‹ค๋Š” ๊ฑธ ์•Œ๊ฒŒ ๋˜์—ˆ๊ณ , ์˜ค๋Š˜์˜ ๊ตฌ์ ˆ์— ๋“ค์–ด๊ฐ€๋Š” ๋ฐ์ดํ„ฐ๋ฅผ passageData์™€ ๋ถ„๋ฆฌํ•˜๊ฒŒ ๋˜์—ˆ๋‹ค.

๐Ÿ’ก RxSwift ํ•ด๊ฒฐ ๋ฐฉ์•ˆ

// ๊ตฌ์ ˆ ์ถ”๊ฐ€ ์—…๋ฐ์ดํŠธ
CoreDataManager.shared.passageData
  .subscribe(onNext: { [weak self] passages in
      DispatchQueue.main.async {
         self?.passages.accept(passages)
         self?.loadTodayVerses()
      }
   })
   .disposed(by: disposeBag)



OCR

๐Ÿ’ก OCR ์–ด๋ ค์› ๋˜ ์ 

  1. LiveText
  • ๋ณ€๊ฒฝํ•˜๋ ค๋˜ ์ด์œ 
    • LiveText์˜ ๊ตฌํ˜„์ด ๋” ๊ฐ„๋‹จ
    • ์„ ํƒํ•œ ๋ฌธ๋‹จ์˜ ์บก์ณ์ด๋ฏธ์ง€ ์ œ๊ณต โ†’ TextSelection ๊ฐ€๋Šฅ โ†’ ์ง๊ด€์ 
    • ์‚ฌ์šฉ์ž๊ฐ€ ์›ํ•˜๋Š” ํ…์ŠคํŠธ๋งŒ ๊ณ ๋ฅด๊ธฐ ์šฉ์ด
  • ์„ ํƒํ•˜์ง€ ์•Š์€ ์ด์œ 
    • LiveText ๊ธฐ๋Šฅ์„ ๋ชจ๋ฅด๋Š” ์‚ฌ์šฉ์ž ์žˆ์„ ๊ฐ€๋Šฅ์„ฑ
  1. ๊ธฐ์กด VNDocumentCameraViewController ์— LiveText ๊ฒฐํ•ฉ
  • ์ด์œ 
    • ๊ธฐ์กด ์Šค์บ” ๋ฐฉ์‹์— LiveText ๊ธฐ๋Šฅ์„ ๊ฒฐํ•ฉ โ†’ ์ง๊ด€์ ์ด๊ณ , ์šฐ๋ฆฌ๊ฐ€ ์›ํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ์„๊ฒƒ์ด๋ผ ์˜ˆ์ƒ
  • ์„ ํƒํ•˜์ง€ ์•Š์€ ์ด์œ 
    • ๊ตฌํ˜„์˜ ์–ด๋ ค์›€
    • ๊ด€๋ จ ์ž๋ฃŒ์˜ ๋ถ€์กฑ

๐Ÿ’ก OCR ํ•ด๊ฒฐ ๋ฐฉ์•ˆ : DataScannerViewController ์‚ฌ์šฉ

  • ์ด์œ 
    • ๋ฌธ์„œ ์ „์ฒด๋ฅผ ์Šค์บ”ํ•˜์ง€ ์•Š๋Š”๋‹ค
      1. ๊ฐ๋„์— ๋”ฐ๋ฅธ ๋ฌธ์„œ ์ธ์‹๋ฌธ์ œ ์™„ํ™”
      2. ์›ํ•˜๋Š” ๋ฌธ๋‹จ ์„ ํƒ ๊ฐ€๋Šฅ
    • ๊ธฐ๋ณธ ๋ฉ”์„œ๋“œ ์ œ๊ณต
      1. pinchToZoom ์ด๋‚˜ guidance ๊ฐ™์€ ๊ธฐ๋Šฅ โ†’ ํŽธ์˜์„ฑ ์ฆ๊ฐ€
      2. isHighlightingEnabled ์ธ์‹๋œ ๋ฌธ๋‹จ ํ‘œ์‹œ
      3. recognizesMultipleItems : false โ†’ ํ•œ๋ฒˆ์— ํ•˜๋‚˜์˜ ๋ฌธ๋‹จ๋งŒ ์ธ์‹ & tap์œผ๋กœ ์›ํ•˜๋Š” ๋ฌธ๋‹จ ์„ ํƒ ๊ฐ€๋Šฅ
Clone this wiki locally