You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let package = Package( name: "ImmutableState", products: [ // Products define the executables and libraries a package produces, making them visible to other packages. .library( name: "ImmutableState", targets: ["ImmutableState"]), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. // Targets can depend on other targets in this package and products from dependencies. .target( name: "ImmutableState"), .testTarget( name: "ImmutableStateTests", dependencies: ["ImmutableState"] ), ] ) 上方展示了创建时的工程结构和模板生成Package.swift。 其次在ImmutableState.swift 旁边创建 ImmutableDemo 文件夹安放接下来的整套代码,也就在ImmutableDemo文件夹下使用 SwiftUIView 模板创建代码,然后右键struct的名称,refactor重构rename改名为 ImmutableView。
<aclass="entry-link" aria-label="post link to 基于MVVM模式手把手写出可测试性强的SwiftUI代码" href="https://winterarch.github.io/posts/%E5%9F%BA%E4%BA%8Emvvm%E6%A8%A1%E5%BC%8F%E6%89%8B%E6%8A%8A%E6%89%8B%E5%86%99%E5%87%BA%E5%8F%AF%E6%B5%8B%E8%AF%95%E6%80%A7%E5%BC%BA%E7%9A%84swiftui%E4%BB%A3%E7%A0%81/"></a>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Products define the executables and libraries a package produces, making them visible to other packages.</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Targets are the basic building blocks of a package, defining a module or a test suite.</span>
38
+
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Targets can depend on other targets in this package and products from dependencies.</span>
let package = Package( name: "ImmutableState", products: [ // Products define the executables and libraries a package produces, making them visible to other packages. .library( name: "ImmutableState", targets: ["ImmutableState"]), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. // Targets can depend on other targets in this package and products from dependencies. .target( name: "ImmutableState"), .testTarget( name: "ImmutableStateTests", dependencies: ["ImmutableState"] ), ] ) 上方展示了创建时的工程结构和模板生成Package.swift。 其次在ImmutableState.swift 旁边创建 ImmutableDemo 文件夹安放接下来的整套代码,也就在ImmutableDemo文件夹下使用 SwiftUIView 模板创建代码,然后右键struct的名称,refactor重构rename改名为 ImmutableView。
<aclass="entry-link" aria-label="post link to 基于MVVM模式手把手写出可测试性强的SwiftUI代码" href="https://winterarch.github.io/posts/%E5%9F%BA%E4%BA%8Emvvm%E6%A8%A1%E5%BC%8F%E6%89%8B%E6%8A%8A%E6%89%8B%E5%86%99%E5%87%BA%E5%8F%AF%E6%B5%8B%E8%AF%95%E6%80%A7%E5%BC%BA%E7%9A%84swiftui%E4%BB%A3%E7%A0%81/"></a>
0 commit comments