Upgrade to Pro — share decks privately, control downloads, hide ads and more …

パッケージ管理でモバイル開発を安全に進める.pdf

entaku
May 20, 2024
520

 パッケージ管理でモバイル開発を安全に進める.pdf

entaku

May 20, 2024
Tweet

Transcript

  1. ࣗݾ঺հ • Name: entaku(ԕ౻୓໻) • Work: גࣜձࣾVoicyɹ • Twitter: https://twitter.com/entaku_0818

    • Hobby: • ԻָϑΣε • ݸਓ։ൃ • https://apps.apple.com/jp/developer/takuya-endo/id1601100107 • Other: SwiftѪ޷ձӡӦ https://love-swift.connpass.com/
  2. νʔϜͷมԽ • ϦϦʔε౰ॳ • ΦϑγϣΞͰϕτφϜνʔ Ϝ͕։ൃ • iOS/AndroidͰಉ͡νʔϜ ͩͬͨ •

    ݱࡏ(2024/05/21) • iOS: 5໊(಺1໊ۀ຿ҕୗ) • Android: 1໊ • ͦΕͧΕ3ͭͷνʔϜʹ෼͔Ε ͯ։ൃ͍ͯ͠Δ
  3. ա౓ͳڞ௨Խ class VoicyChannel: Codable { var id: Int64 var channelViewId:

    String var personalityID: Int64 var name: String ʙʙ …100͘Β͍ύϥϝʔλ͕͋Δ ྫ͑͹…Channelͷσʔλ
  4. ա౓ͳڞ௨Խ class VoicyChannel: Codable { var id: Int64 var channelViewId:

    String var personalityID: Int64 var name: String ʙʙ …100͘Β͍ύϥϝʔλ͕͋Δ var is_premium: Bool ྫ͑͹…Channelͷσʔλ
  5. Package Manager The Swift Package Manager (SwiftPM) is a tool

    for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies. The Package Manager is included in Swift 3.0 and above. https://www.swift.org/documentation/package-manager/
  6. UIPackage ͷPackage.swift let package = Package( name: "UIPackage", platforms: [

    .iOS(.v15), ], products: [ .library( name: "UIPackage", targets: ["XXXXScreen", "XXXXScreen"]), ], dependencies: [ .package(path: "../UseCase") ], targets: [ .target( name: "XXXXScreen", dependencies: ["UseCase"]), .target( name: "XXXXScreen", dependencies: ["UseCase"]), .testTarget( name: "UIPackageTests", dependencies: ["XXXXScreen", "XXXXScreen"]), ] ) ໌ࣔతʹͲͷPackageΛར༻͢Δ͔Λࢦఆ͢Δ
  7. UseCase ͷPackage.swift let package = Package( name: "UseCase", platforms: [

    .iOS(.v15), ], products: [ .library( name: "UseCase", targets: ["Interactor"]), ], targets: [ .target( name: "Interactor", dependencies: ["Service", "Domain"]), .target( name: "Domain", dependencies: []), .target( name: "Noah", dependencies: []), .target( name: "Service", dependencies: ["Domain", “Noah"]), .testTarget( name: "InteractorTests", dependencies: ["Interactor", "Service", "Noah"]), ] ) ໌ࣔతʹͲͷPackageΛར༻͢Δ͔Λࢦఆ͢Δ
  8. طଘͷApp͔Β͸ೖΓޱͷΈެ։͢Δ final public class XXXXScreen { var router: Router public

    init(useCase: UseCase) { self.router = Router(useCase: useCase) } public func factory(channelId: String) -> UIViewController { let xxx = xxxx let hostingController = UIHostingController(rootView: xxx) return hostingController } } PackageͰ͸ඞཁͳPublicͰҙਤతʹެ։͢Δ
  9. Unitςετ class XXX: XCTestCase { func νϟϯωϧͰڐՄ͞Ε͍ͯΔػೳΛऔಘ͢Δ() async { let

    mockUsecase = ChannelFeatureUsecaseMock() mockUsecase.getChannelFeatureHandler = { _, _ in return [] } let presenter = MainTabViewPresenter(usecase: mockUsecase) await presenter.getChannelFeature() XCTAssertTrue(presenter.state.canXXXXXX) } } UsecaseʹΑΔεςʔλεͷมԽΛςετ͢Δ