Cannot access "Parse.setApplicationId()" - swift

I'm trying to make an app with swift/Obj-c (Bridging Header) with parse.com
So here's my question:
I saw on many sites that you can use Parse.setApplicationId("appid","clientid")
When I try this code it says Use of unresolved Identifier 'Parse'
I imported the framework and set the bridging header in the properties.
I also imported the frameworks which are required like it's written on parse.com
All other Classes/Objects from parse can be used by swift in the code.

This problem was because of a bug in xcode... (I think the compiler failed)
After I restarted Xcode the error was gone.

Related

ITMS-90334: Invalid Code Signature Identifier when building via Xcode Cloud

I have started a small collection of helper code in a Swift Package for my own needs. If i include this package in my main project using Swift Package Manger and try to build it using Xcode Cloud, i get the following error:
ITMS-90334: Invalid Code Signature Identifier - The identifier
'AppulizeStandardTools-55554944b34e30d285943c0fa8b9aecb5744a53e'
in your code signature for 'AppulizeStandardTools_BFA0AAD86B154A1_PackageProduct'
must match its Bundle Identifier 'AppulizeStandardTools'
I haven't set any identifiers or code signing manually with regards to the package and the Package.swift is very simple.
What am i doing wrong here?
I lost half a day trying to figure this out, documentation is not plentiful on it atm.
It appears to be related to how XCode Cloud handles the signing for dynamically embedded frameworks... Not ideal if you are using a microcomponent architectural pattern.
Fix for this:
Go into your main target (executable) -> Frameworks, Libraries and Embedded Content section -> Change your frameworks to:
Embed & Sign => Do Not Embed
Go to Build Settings for each Framework and change the Mach-O Type from Dynamic to Static
There are some implications about how this would effect device memory, I found it to be pretty negligible in my case.

Google Calendar API - No such module 'GoogleAPIClientForREST'

I'm trying to integrate the Google Calendar API on iOS. I've followed the iOS Quickstart. I've managed to get the objective-c version to run but I need to get it to work in Swift. I'm getting an error loading the module 'GoogleAPIClientForREST'
I'm using cocoapods as shown in the example. All looks to be loaded fine on the pod side, as you can see in the screenshot.
Has someone succeeded to run the google example in swift ?
THANKS!
Linking the library with the binary resolved the module not found error.
I then ran into another error "Value of type 'GTLRCalendarService' has no member 'authorizer'" in the signin method (Two instances of the error). Found a solution to this error here
Solved this by creating a bridging header where I included these lines
#import <GTMSessionFetcher/GTMSessionFetcher.h>
#import <GTMSessionFetcher/GTMSessionFetcherService.h>
Here's my Xcode project incase it can help someone.
Thanks

Import third party C library into swift causes error "Include of non-modular header inside framework module"

This question is a continuation of a previous one I'm currently migrating this (https://github.com/emilwojtaszek/leveldb-swift) library from swift 2 to swift 3/4. Here is the link to my fork https://github.com/lu4/leveldb-swift/tree/MigrationFromSwift2ToSwift3 (please note that the target branch is MigrationFromSwift2ToSwift3)
I was able to resolve (with many thanks to #Ruslan Serebriakov) all of the issues with initial code base and check that the code is running.
However after trying to update LevelDB C code to latest master I got new type of error which I don't understand how to resolve:
Include of non-modular header inside framework module 'LevelDB.c': '/Path/to/Project/leveldb-swift-migration/vendor/leveldb/include/leveldb/export.h'
I've did some research on the internet but the issues described there seem non-related with one I've stumbled on. Here is an image of the issue
Any help is appreciated, thank you in advance!
I'm never 100% certain with mixed language frameworks. But an error like this happens in Swift projects when:
since you cannot use a Bridging Header in frameworks,
you #import a C header in the Foo-Framework.h to expose it so the Swift code, and
the header is not itself marked "Public" to the target.
"Non-modular" seems to indicate "not part of the published module interface". At least with Swift--C mixes, you can only combine both through making the C headers public; no way to import private header files there, which is weird.
Give it a shot: Since you are obviously importing the file in non-Swift code, try to locate the export.h header file in your Xcode project, open the File inspector (⌘⌥1), and ensure public visibility in the framework target:
This issue is because the SDK u are importing is not modular or u can say modulemap file is missing. So make sure modulemap file should be available inside the framework folder. Also make sure that all public headers are listed explicitly in the modulemap. This issue will be resolve 100% if module map file will be include in the third party framework.

Compiler error when using AlwaysRightInstitute/SwiftSockets

I'm try to write a small game on IOS using socket and I've had a java socket server running with Flash client, but I got complier errors when I add the AlwaysRightInstitute/SwiftSockets source code to my swift project, and I did nothing after doing this
Here is the project structure:
the selected group "ARISockets" is the source code I drag into my project
and here are the errors(Use of unresolved identifier 'ari_fcntIVi'):
It seems that the errors cause by lack of some import file and I found "ari_fcntIVi" in ARISockets/UnixBridge.c,but I'm a really newer to Swift/Objective-C/C (I'm a AS3 developer), so that sucks me :/
I had the same problem with this library.
You need to create a Bridge file similar to "Import Objective-C into Swift" but this is C:
How to call Objective-C code from Swift
The issue was that you just copied over the sources instead of embedding the SwiftSockets framework. The ari_ prefixed functions used to required the bridging header of the SwiftSockets framework.
Having said that, the current SwiftSockets doesn't use bridging headers anymore, and you can directly embed the sources.

Building reusable libraries with Swift that use bridging headers

I'm trying to get the hang of Swift, and am beginning by just doing a dumb port of a few applications I've written.
These applications have some core logic in common, for which I've used a Framework target in Xcode to share this with those projects. I'm having trouble coming up with an equivalent in Swift.
I know Swift compiles down to modules, which seems like what I want. I want a Swift module that I can share with my other projects. the major problem I seem to be having though, is that you cannot have a Framework with Swift if it also uses a bridging header starting in Beta 4, which I need to call some APIs (like Security.framework) that don't have Swift bindings. The compiler (Beta 5) fails with this error message:
<unknown>:0: error: using bridging headers with framework targets is unsupported
What can I do to create a reusable Swift module that also needs to use bridging headers? Alternatively, how can I use things in Security.framework without a bridging header? (Alternatively Aternatively, is there something other than a Framework I should be using to create a module that doesn't have any of these problems?)
To import Objective-C code to swift within the same framework target, just import each Objective-C header file in the umbrella header file. Apple's official document has mentioned that already: https://developer.apple.com/library/ios/documentation/swift/conceptual/buildingcocoaapps/MixandMatch.html#//apple_ref/doc/uid/TP40014216-CH10-XID_81 see the Importing Code from Within the Same Framework Target part.
The cocoa built in frameworks have been migrated as modules in swift. To use the Objective-C's Security.framework, you just need to add a line:
import Security
at the header of the swift file.