Skip to content

Workshop handbook

Pedro Piñera Buendía edited this page Jan 26, 2018 · 15 revisions

Emoji cheatsheet

  • 📖: Theory, introduction of concepts.
  • ❓: Questions for the attendees.
  • 👨‍💻: Developers working on their own.
  • 👭: Attendees and mentor pairing together.

Requirements

  • Homebrew
  • Xcode 9.2
  • Ruby 2.x.x

1. Workshop introduction

📖 About the workshop

  • Encourage people to participate.
  • Invite them to give feedback after the workshop.
  • Ask them to raise their hands if they get lost or can't follow.

📖 Modular apps

  • Why modular apps.
  • What are the advantages and disadvantages of modular apps.
  • Multi-target vs multi-project.
  • Static and dynamic linking.
  • Embedding dynamic frameworks.

📖 Goals

  • Have a better understanding of a modular architecture (frameworks, libraries, linking, dependencies)
  • Getting rid of Xcode projects in your repos using XcodeGen
  • Sharing code and UI components across different products.
  • Automate tasks in Swift using Sake

📖 How

  • Building Issues app.
  • Features and structure.
  • External dependencies.
  • Workshop plan.

2. Getting the project running

  • 👭 Checkout the project and go to tag 0.1.0.
  • 👭 Install bundle dependencies bundle install.
  • 👭 Fetch dependencies with bundle exec rake dependencies.
  • 👭 Register a new app on GitHub and update Constants.swift.
  • 👭 Check the App Groups settings (entitlements file) and app signing.
  • 👭 Run the app using Xcode.

Am I ready to continue?

  • ✅ Your app compiles.
  • ✅ You are able to login using GitHub.
  • ✅ You see the issues assigned to you on the screen.

3. Automating the generation of the GitHubKit project

  • 👭 Install XcodeGen if they don't have it installed.
  • 👭 Create a base Projects/project.yml file.
  • 👭 Create a Projects/GitHubKit/project.yml file.
  • 👭 Add a Rake task to generate projects.
  • 👭 Add the Xcode project to the .gitignore.

Am I ready to continue?

  • ✅ GitHubKit project is not part of the git repository anymore (git rm -r --cached .).
  • ✅ GitHubKit scheme compiles and the tests run.
  • ✅ Issues app compiles and runs on the simulator.

If you couldn't complete this step, you can checkout the tag 0.2.0 and continue the workshop.

4. Automating the generation of the IssuesKit project

  • 👨‍💻 Automate the generation of IssuesKit:
    • 👨‍💻 Create a project.yml.
    • 👨‍💻 Update the Rake task.
    • 👨‍💻 Add the project to the .gitignore.
  • 👭 Define the dependency between IssuesKit and GitHubKit.

Am I ready to continue?

  • ✅ IssuesKit project is not part of the git repository anymore (git rm -r --cached .).
  • ✅ IssuesKit scheme compiles and the tests run.
  • ✅ Issues app compiles and runs on the simulator.

If you couldn't complete this step, you can checkout the tag 0.3.0 and continue the workshop.

5. Automating the generation of the App project

  • 👨‍💻 Automate the generation of the App:
    • 👨‍💻 Create a project.yml.
    • 👨‍💻 Update the Rake task.
    • 👨‍💻 Add the project to the .gitignore.

Am I ready to continue?

  • ✅ App project is not part of the git repository anymore (git rm -r --cached .).
  • ✅ App scheme compiles and the tests run.

If you couldn't complete this step, you can checkout the tag 0.4.0 and continue the workshop.

6. Creating an iMessage application

  • 👭 Create a new target using Xcode.
  • 👭 Enable app groups to generate the iMessage.entitlements file.
  • 👭 Reorganize target sources and resources.
  • 👭 Add the new target to the app project.yml.
  • 👭 Generate Xcode project.

Am I ready to continue?

  • ✅ iOS app should compile and run.
  • ✅ iMessage extension should compile and run.

If you couldn't complete this step, you can checkout the tag 0.5.0 and continue the workshop.

7. Creating IssuesUI

  • 👨‍💻 Create IssuesUI that depends on IssuesKit and extract IssueCell:
    • 👨‍💻 Copy IssuesKit.
    • 👨‍💻 Remove sources and tests.
    • 👨‍💻 Remove the test target.
    • 👨‍💻 Move the cell from the main app.
    • 👨‍💻 Link the framework from the main app.
    • 👨‍💻 Update the imports and make sure that the cell can be used from the app.
    • 👨‍💻 Update Rakefile to include the new project.

Am I ready to continue?

  • ✅ iOS app should compile and run (with the IssueCell in the new IssueView)
  • ✅ iMessage extension should compile and run.

If you couldn't complete this step, you can checkout the tag 0.6.0 and continue the workshop.

8. Creating ShareIssue view controller

  • 👭 Update SecureStore's keychain to use the shared group.
  • 👭 Verify that the entitlements and signing are ok.
  • 👭 Implement the view controller.

Am I ready to continue?

  • ✅ The iMessage extension should compile and run and you should be able to share issues from the list.

If you couldn't complete this step, you can checkout the tag 0.7.0 and continue the workshop.

9. From Rake to Sake

  • 👭 Install Sake if you didn't have it installed.
  • 👭 Create a new Sakefile.swift.
  • 👭 Generate Xcode project to edit the Sakefile.swift.
  • 👭 Migrate tasks from the Rakefile.

Common issues. // TODO

  • Crashes because of an invalid group.
  • The app cannot be built right now.
    • Ensure the info.plist is properly setup.