Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

Migrate to Swift 3.2 #62

Closed
wants to merge 4 commits into from
Closed

Conversation

loudmouth
Copy link
Contributor

This pull requests migrates the project to be compatible with Swift 4. Though the codebase is now compatible to be marked with the Swift 4 build setting, the compiler flag is set to Swift 3.2 for now so that backwards compatibility may be maintained with Xcode 8.3

As Xcode 9 has the nice new feature to mirror the xcodeproj directory structure to that of the on-disk structure, the directory structure has changed a bit (this was also necessary as Xcode 9 saw dead file references when opening the existing project).

Currently, the module structure mimics the conceptual structure of the podspec:

Source code for Interstellar lives in Sources/Interstellar and since Warpdrive is really an extension for Interstellar, the code lives at Sources/Interstellar/Warpdrive

@JensRavens
Copy link
Owner

Hey, thanks for your commit. I just have to check backwards compatibility with Xcode 8 and then I'm ready to merge!

@JensRavens
Copy link
Owner

Hey, I've checked the project on Xcode 8. Somehow the playgrounds don't work anymore (Xcode 8 complains about missing files, Xcode 9 gives some errors in the logs).

@loudmouth
Copy link
Contributor Author

Ahh, I forgot to check the playgrounds. I can attend to that sometime before the weeks end. Thanks for checking out my branch ;-)

@loudmouth
Copy link
Contributor Author

Hey @JensRavens, Looks like they were just missing the import statements. They should be working for both Xcode 8.3.3 and Xcode 9-beta now.

@loudmouth
Copy link
Contributor Author

Hey @JensRavens , I'll be on vacation for the next 2 weeks, so just wanted to revisit this before I leave and see if there were any additional changes you'd like to see.

Cheers.

@JensRavens
Copy link
Owner

Just a note regarding your last change: The import statement was left out intentionally - This way you need to build the project before you can use the playground. Instead the playground had a copy of all source files included, therefore it can be distributed independently.

@loudmouth
Copy link
Contributor Author

Hi @JensRavens , I didn't fully understand your last comment. Without the import statement, the playground spits out the following error message with Xcode 8 (after building the OSX target and executing the playground)

error: 0 Preface.xcplaygroundpage:2:18: error: use of unresolved identifier 'Observable'
let observable = Observable("User")

Even with the imports, the project needs to be built before the playground will run, so I'm not sure what optimization you are describing when saying "it can be distributed independently".

@loudmouth
Copy link
Contributor Author

Hey @JensRavens . I wanted to circle back and see about getting this merged. I'm very happy to make the necessary changes so that the codebase is in the state you'd like it to be in. I'm unsure about what should be changed at this point as, to me, it seems without the import that the playgrounds don't execute.

@loudmouth
Copy link
Contributor Author

Hi @JensRavens sorry to keep bothering, but I'd like to revisit this PR and see what the next steps are on my end. As I mentioned in my comment above, I'm unsure about what the desired fix is for the playground and the import statements, which I believe are necessary to execute the playground.

@JensRavens JensRavens mentioned this pull request Jul 31, 2017
@JensRavens
Copy link
Owner

Thanks for insisting on this! 👍
I've merged this manually after some changes via #63.

The issue basically came to life by a change on how playgrounds work: Before code from the sources dir was automatically loaded, now it's done via an explicit import. To keep backwards compatibility I just referenced the files in the source-dir of each page (which still have the old behaviour of not needing the import). This way you can just copy the playground file and distribute it independently (which I need for my teaching classes).

Thanks for all your work!

@JensRavens JensRavens closed this Jul 31, 2017
@loudmouth
Copy link
Contributor Author

I see! Thanks for revisiting this, and also thanks for the explanation about the change to playgrounds. Hope you have a nice week!

@loudmouth loudmouth deleted the Swift3.2 branch July 31, 2017 13:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants