Problem 1:
When I open resource folder for chapter 13 it looks like that:
So there is no folder extensions.
Workaround for problem 1:
In same directory where resource folder is located, there is another folder called source code. There you can navigate to 13-Editing Items → chapter-13-final.zip. If you unzip this folder you will get content of final project for Chapter 13. I used this extensions folder that is located in Checklist folder of unzipped file and copied it to my project. And yes I checked “Copy items if needed”, “Create groups” and “Checklist” target . I think this shouldn’t make any effect for my next problem.
Problem 2:
Now folder extensions is copied to my project, so now I change ForEach loop to what it says in the book. Then I run the project and I get this two errors:
Here is error log for “Segmentation fault: 11”:
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/lukacefarin/Documents/Tutorials/iOS Apprentice/My Exercises/TodoApp/TodoApp/Checklist.swift /Users/lukacefarin/Documents/Tutorials/iOS Apprentice/My Exercises/TodoApp/TodoApp/AppDelegate.swift -primary-file /Users/lukacefarin/Documents/Tutorials/iOS Apprentice/My Exercises/TodoApp/TodoApp/Extensions/ForEach.swift -primary-file /Users/lukacefarin/Documents/Tutorials/iOS Apprentice/My Exercises/TodoApp/TodoApp/Extensions/IndexedCollection.swift /Users/lukacefarin/Documents/Tutorials/iOS Apprentice/My Exercises/TodoApp/TodoApp/SceneDelegate.swift /Users/lukacefarin/Documents/Tutorials/iOS Apprentice/My Exercises/TodoApp/TodoApp/RowView.swift /Users/lukacefarin/Documents/Tutorials/iOS Apprentice/My Exercises/TodoApp/TodoApp/ChecklistView.swift /Users/lukacefarin/Documents/Tutorials/iOS Apprentice/My Exercises/TodoApp/TodoApp/EditChecklistItemView.swift /Users/lukacefarin/Documents/Tutorials/iOS Apprentice/My Exercises/TodoApp/TodoApp/NewChecklistItemView.swift /Users/lukacefarin/Documents/Tutorials/iOS Apprentice/My Exercises/TodoApp/TodoApp/ChecklistItem.swift /Users/lukacefarin/Documents/Tutorials/iOS Apprentice/My Exercises/TodoApp/TodoApp/Extensions/Binding.swift -emit-module-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/ForEach~partial.swiftmodule -emit-module-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/IndexedCollection~partial.swiftmodule -emit-module-doc-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/ForEach~partial.swiftdoc -emit-module-doc-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/IndexedCollection~partial.swiftdoc -serialize-diagnostics-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/ForEach.dia -serialize-diagnostics-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/IndexedCollection.dia -emit-dependencies-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/ForEach.d -emit-dependencies-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/IndexedCollection.d -emit-reference-dependencies-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/ForEach.swiftdeps -emit-reference-dependencies-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/IndexedCollection.swiftdeps -target x86_64-apple-ios13.2-simulator -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk -I /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Products/Debug-iphonesimulator -F /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Products/Debug-iphonesimulator -enable-testing -g -module-cache-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -Xcc -working-directory -Xcc /Users/lukacefarin/Documents/Tutorials/iOS Apprentice/My Exercises/TodoApp -enable-anonymous-context-mangled-names -Xcc -I/Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/TodoApp-generated-files.hmap -Xcc -I/Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/TodoApp-own-target-headers.hmap -Xcc -I/Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/TodoApp-all-target-headers.hmap -Xcc -iquote -Xcc /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/TodoApp-project-headers.hmap -Xcc -I/Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/DerivedSources-normal/x86_64 -Xcc -I/Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/DerivedSources/x86_64 -Xcc -I/Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/DerivedSources -Xcc -DDEBUG=1 -module-name TodoApp -o /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/ForEach.o -o /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/IndexedCollection.o -index-store-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Index/DataStore -index-system-modules
- While silgen emitConstructor SIL function “@$s7SwiftUI7ForEachV7TodoAppAA4ViewR0_rlE_7contentACyAD17IndexedCollectionVyqd__Gq_q0_Gqd___q0_AI5IndexQactcAIRsz7Element_2IDQYd__Rs_SkRd__s12IdentifiableAMRpd__lufC”.
for ‘init(_:content:)’ (at /Users/lukacefarin/Documents/Tutorials/iOS Apprentice/My Exercises/TodoApp/TodoApp/Extensions/ForEach.swift:16:3)
0 swift 0x00000001058b2a63 PrintStackTraceSignalHandler(void*) + 51
1 swift 0x00000001058b2236 SignalHandler(int) + 358
2 libsystem_platform.dylib 0x00007fff7417bb1d _sigtramp + 29
3 swift 0x00000001024a6c80 llvm::Optionalswift::Type llvm::function_ref<llvm::Optionalswift::Type (swift::TypeBase*)>::callback_fn<substType(swift::Type, llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<llvm::Optionalswift::ProtocolConformanceRef (swift::CanType, swift::Type, swift::ProtocolDecl*)>, swift::SubstOptions)::$_17>(long, swift::TypeBase*) + 0
4 swift 0x0000000101915898 (anonymous namespace)::SILGenApply::visitApplyExpr(swift::ApplyExpr*) + 6952
5 swift 0x00000001019143c9 (anonymous namespace)::SILGenApply::visitApplyExpr(swift::ApplyExpr*) + 1625
6 swift 0x0000000101905ccd swift::Lowering::SILGenFunction::emitApplyExpr(swift::Expr*, swift::Lowering::SGFContext) + 189
7 swift 0x000000010196cb6a (anonymous namespace)::RValueEmitter::visitRebindSelfInConstructorExpr(swift::RebindSelfInConstructorExpr*, swift::Lowering::SGFContext) + 698
8 swift 0x0000000101972a7f swift::Lowering::SILGenFunction::emitIgnoredExpr(swift::Expr*) + 799
9 swift 0x00000001019d2563 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 3139
10 swift 0x000000010193b6b7 swift::Lowering::SILGenFunction::emitValueConstructor(swift::ConstructorDecl*) + 8583
11 swift 0x00000001018ef939 swift::Lowering::SILGenModule::emitConstructor(swift::ConstructorDecl*) + 1385
12 swift 0x00000001019e3b27 swift::Lowering::SILGenModule::visitExtensionDecl(swift::ExtensionDecl*) + 247
13 swift 0x00000001018f8316 swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*) + 1238
14 swift 0x00000001018f9d76 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*) + 1238
15 swift 0x00000001014fb974 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 28340
16 swift 0x00000001014f12b4 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6820
17 swift 0x000000010147e7b3 main + 1219
18 libdyld.dylib 0x00007fff73f7a2e5 start + 1
error: Segmentation fault: 11 (in target ‘TodoApp’ from project ‘TodoApp’)
And here is error log for “Command CompileSwift failed with a nonzero exit code”:
CompileSwift normal x86_64 /Users/lukacefarin/Documents/Tutorials/iOS\ Apprentice/My\ Exercises/TodoApp/TodoApp/SceneDelegate.swift (in target ‘TodoApp’ from project ‘TodoApp’)
cd /Users/lukacefarin/Documents/Tutorials/iOS\ Apprentice/My\ Exercises/TodoApp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/lukacefarin/Documents/Tutorials/iOS\ Apprentice/My\ Exercises/TodoApp/TodoApp/Checklist.swift /Users/lukacefarin/Documents/Tutorials/iOS\ Apprentice/My\ Exercises/TodoApp/TodoApp/AppDelegate.swift /Users/lukacefarin/Documents/Tutorials/iOS\ Apprentice/My\ Exercises/TodoApp/TodoApp/Extensions/ForEach.swift /Users/lukacefarin/Documents/Tutorials/iOS\ Apprentice/My\ Exercises/TodoApp/TodoApp/Extensions/IndexedCollection.swift -primary-file /Users/lukacefarin/Documents/Tutorials/iOS\ Apprentice/My\ Exercises/TodoApp/TodoApp/SceneDelegate.swift /Users/lukacefarin/Documents/Tutorials/iOS\ Apprentice/My\ Exercises/TodoApp/TodoApp/RowView.swift /Users/lukacefarin/Documents/Tutorials/iOS\ Apprentice/My\ Exercises/TodoApp/TodoApp/ChecklistView.swift /Users/lukacefarin/Documents/Tutorials/iOS\ Apprentice/My\ Exercises/TodoApp/TodoApp/EditChecklistItemView.swift /Users/lukacefarin/Documents/Tutorials/iOS\ Apprentice/My\ Exercises/TodoApp/TodoApp/NewChecklistItemView.swift /Users/lukacefarin/Documents/Tutorials/iOS\ Apprentice/My\ Exercises/TodoApp/TodoApp/ChecklistItem.swift /Users/lukacefarin/Documents/Tutorials/iOS\ Apprentice/My\ Exercises/TodoApp/TodoApp/Extensions/Binding.swift -emit-module-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/SceneDelegate~partial.swiftmodule -emit-module-doc-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/SceneDelegate~partial.swiftdoc -serialize-diagnostics-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/SceneDelegate.dia -emit-dependencies-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/SceneDelegate.d -emit-reference-dependencies-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/SceneDelegate.swiftdeps -target x86_64-apple-ios13.2-simulator -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk -I /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Products/Debug-iphonesimulator -F /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Products/Debug-iphonesimulator -enable-testing -g -module-cache-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -Xcc -working-directory -Xcc /Users/lukacefarin/Documents/Tutorials/iOS\ Apprentice/My\ Exercises/TodoApp -enable-anonymous-context-mangled-names -Xcc -I/Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/TodoApp-generated-files.hmap -Xcc -I/Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/TodoApp-own-target-headers.hmap -Xcc -I/Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/TodoApp-all-target-headers.hmap -Xcc -iquote -Xcc /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/TodoApp-project-headers.hmap -Xcc -I/Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/DerivedSources-normal/x86_64 -Xcc -I/Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/DerivedSources/x86_64 -Xcc -I/Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/DerivedSources -Xcc -DDEBUG=1 -module-name TodoApp -o /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Build/Intermediates.noindex/TodoApp.build/Debug-iphonesimulator/TodoApp.build/Objects-normal/x86_64/SceneDelegate.o -index-store-path /Users/lukacefarin/Library/Developer/Xcode/DerivedData/TodoApp-ebkeemjdmphbmlcpxrgboaqzyfyw/Index/DataStore -index-system-modules
It is interesting that when I run project from source code everything works perfectly.