SKTilemap icon indicating copy to clipboard operation
SKTilemap copied to clipboard

Swift 3

Open ravenshore opened this issue 9 years ago • 14 comments

Hi, m8

just wanted to see if you have already tried this on Xcode8 and Swift 3. I am getting an error on loading the map, but can't figure it out why.

ravenshore avatar Jun 25 '16 17:06 ravenshore

whats the error ?

I have it working on Xcode 8 / Swift 3.0

riklowe avatar Jun 26 '16 08:06 riklowe

Here is what I got, it fails to load the map for some reason. http://prntscr.com/blbfjc http://prntscr.com/blbfjc

ravenshore avatar Jun 26 '16 16:06 ravenshore

Hi. So this is an issue either with the file not being found or some problem during parsing the xml inside the .tmx file. Check that your tilemap is actually linked to your project. Also check that you haven't put your tilemap inside a folder and used a folder reference, that might mess it up also. If you want it in a folder add the folder as a group when you add it to the project. The tmx xml should be fine unless you've hand edited it or maybe it got corrupted some how? Does the map load in Tiled?

TomLinthwaite avatar Jun 26 '16 16:06 TomLinthwaite

I was just thinking of importing one of my maps, but now Xcode is telling me there are 102 more errors to fix. I installed your project 3 times now. First got converted to Swift 3.0 and it looked OK, only a few things for me to fix, but then the error you saw. The other 2 got converted and come up with 100+ fixes needed... I ma guessing the converter didn't do it all, despite Xcode was telling me so...

ravenshore avatar Jun 26 '16 16:06 ravenshore

How much work did the converter for you ?

ravenshore avatar Jun 26 '16 17:06 ravenshore

To be honest I haven't even tried to convert it. I'll have a go in a minute and create a new branch for swift 3 for the time being.

TomLinthwaite avatar Jun 26 '16 17:06 TomLinthwaite

Ok, was able to finish converting it. It's working fine now, also had to delete all my provisioning profiles as they seemed to messed up my Xcode somehow... Thanks!

ravenshore avatar Jun 26 '16 17:06 ravenshore

Btw, did you figure out how to remove the black lines when zooming in/out ? Occasionally mine would stay on the screen, but I remember that was gone last time I tested on Xcode 7.

ravenshore avatar Jun 26 '16 17:06 ravenshore

Glad its working for you. I just converted it but still have some strange behaviour. The simulator won't switch to landscape for some reason and the touchesBegan method is never fired for a single touch. It works if I zoom though... Too tired to look into it now but if anyone has any ideas I'm all ears. I'll upload what I have since it seems to be working, it is beta after all :P

TomLinthwaite avatar Jun 26 '16 18:06 TomLinthwaite

I have it fully working on Swift 3.0 Let me know if you want me to upload it for you on GH.

ravenshore avatar Jun 27 '16 14:06 ravenshore

You have the full example project working? If so yea create a pull request and I'll test it. If it works I'll merge it thanks :)

TomLinthwaite avatar Jun 27 '16 14:06 TomLinthwaite

It wouldn't let me submit the pull request, I just uploaded another repo, so you can just clone, test and then manually merge if you want: https://github.com/ravenshore/SKTilemap-master-2

ravenshore avatar Jun 27 '16 15:06 ravenshore

Sorry for getting back to you so late. I downloaded your project and I still have the issues I stated above which is weird :/ The beta is so unstable at the moment I think it's best we wait until another release and things get better before committing anything.

TomLinthwaite avatar Jun 29 '16 10:06 TomLinthwaite

Hi Guys,

I have not seen this before so I did the Swift3 switch as well and submitted a pull request. I added also a fix for loading the sprite sheets correctly.

@TomLinthwaite : If you managed to get everything from @ravenshore pull request, please reject my request and I will update and re-issue with the missing changes.

ghost avatar Oct 27 '16 08:10 ghost