tigase / Martin

(M) Martin - XMPP client library for Swift
Other
69 stars 27 forks source link

iOS 14: 'nil' literal cannot be force unwrapped #6

Closed vikingosegundo closed 4 years ago

vikingosegundo commented 4 years ago

I installed tigase-swift via the TigaseSwiftOMEMO package.

In MucModule.swift the line 303

return nil!;

raises the compile time error

/[…]/SourcePackages/checkouts/tigase-swift/Sources/TigaseSwift/modules/muc/MucModule.swift:303:20: 'nil' literal cannot be force unwrapped

I am using Xcode 14 beta 3

hantu85 commented 4 years ago

TigaseSwift was not adjusted to beta version of XCode. We will look into that while we will test support for newer XCode - a lot can still change in the next 2 months.

vikingosegundo commented 4 years ago

TigaseSwift was not adjusted to beta version of XCode. We will look into that while we will test support for newer XCode - a lot can still change in the next 2 months.

Well, I hope you don't wait for the final iOS14 release, as projects that want to migrate to iOS 14 depend on you. and BTW:

func somename() -> Room { 
    return nil!
}

Was that ever legal, or worked it because of a compiler glitch?

woj-tek commented 4 years ago

Just a little tip here: we do accept contribution and Pull Requests :-)

vikingosegundo commented 4 years ago

@woj-tek I happily would do that — but why does the code come with an incomplete and unusable Xcode project file? I had to recreate that just to fix the code. I checked that in so that my team can work with it, but I guess, you would not like that.

hantu85 commented 4 years ago

@vikingosegundo We are in progress of migration from XCode project to SwiftPM (actually SwiftPM project is ready in mix branch) which can be directly imported into XCode and is far easier to manage. You should expect XCode project files to be gone soon.

If the XCode project file is incomplete (I've not experienced any issues with it) I'm sorry.

vikingosegundo commented 4 years ago

directly imported into XCode and is far easier to manage

if it compiles. if not, your users are stuck, as they cannot easily change anything.

With other package manger I could still import it as a development package. I have not seen something like this for SwiftPackages.

If the XCode project file is incomplete (I've not experienced any issues with it) I'm sorry.

well, it is. Xcode won't open it. And also I had to force add the project file to the git repository. Although it was not excluded in .gitignore or .git/config/exclude

hantu85 commented 4 years ago

Either way, we are not going to resurrect XCode project (as it was, is and most likely will be problematic) but it will be replaced by SwiftPM really soon and in the next version of SwiftPM, AFAIK, it should be possible to import binary version of frameworks.

Moreover, SwiftPM allows you to generate XCode project file.

vikingosegundo commented 4 years ago

but I would it be possible, to create project file, make any change, and create PR for you to merge?

hantu85 commented 4 years ago

Xcode is able to open SwiftPM package file (folder with that file) as a project - no other things are needed. Moreover, SwiftPM allows you to generate XCode project files as well with following command line: swift package generate-xcodeproj

hantu85 commented 4 years ago

The issue is now fixed with a latest commit.