I'm trying to use Google Maps SDK for iOS in Swift. I have been following these steps from google developers website. The problem is when I tried to import GoogleMaps in AppDelegate.swift, it's showing an error like..No such module 'GoogleMaps'.
I have added all the frameworks and made necessary changes to Linking and Build settings. Is there anything I'm missing out?
The steps on that website are still for Objective-C apps. To write an app in Swift with the Google Maps API, you need to add a bridging header, and then you can import the module in that header using #import <GoogleMaps/GoogleMaps.h>.
In application:didFinishLaunchingWithOptions: instead of using [GMSServices provideAPIKey:#"API_KEY"]; then you use GMSServices.provideAPIKey("API_KEY").
Delete your all of your pod files including workspace except podinstall and lock and install pod again
Related
I've been using cocoapods in a few projects before, but never with use_frameworks! enabled. In my new app, I am perfectly able to use the frameworks through cocoapods, but I am not able to CMD+click any objects or functions from any of the frameworks. Xcode immediately says this:
Couldn't Generate Swift Representation
Error (from SourceKit):
"Could not load module: Google Maps"
The framework is functioning properly. I can use it. When searching for this, I only found answers for those with the problem that the framework wasn't found at all, and didn't work. Why is my framework working, but Xcode unable to show it to me?
My target's Framework search path is automatically set up to this (through Cocoapods):
Running Xcode version 8.2.1, Swift 3, and Cocoapods version 1.1.1 and I can't for the life of me figure out how to resolve this issue. I need to use the analytics library but can't get past this error in the UIViewController+SEGScreen.m class:
Without forking, is there another solution here?
What exactly do you need to figure out? The API is not available when targeting iOS extensions. There is no solution but fixing the API. If this is an open source, the fix looks really simple (wrapping in a custom macro such #ifdef TARGET_EXTENSION). If not, time to use a properly written analytics framework, that takes into account all aspects of iOS development, not the most trivial ones only.
I've developed an application using Apple Swift but when I try to integrate AdColony in my project when I write this line of code in my AppDelegate.swift:
import AdColony
I receive the error: no module available.
How can I solve this issue? I've followed all the steps in the AdColony guide (also integrating the other frameworks).
Since the AdColony framework is Objective-C-based, you'll need to create a bridging header for your project. Here's Apple’s documentation. You’ll want to look at the section called Importing Objective-C into Swift.
Note that you’ll need to import AdColony using Objective-C syntax in the bridging header file itself, not in your Swift classes:
#import <AdColony/AdColony.h>
Once you’ve accomplished that, the framework will now be visible in any of your Swift classes.
Am very new to iPhone development and also am looking to work with PhoneGap Framework to create iPhone apps. I have created HTML, JavaScript in my PhoneGap project. I have imported those files in my project. When i compile my project the XCode shows the below error,
'PhoneGapDelegate.h' file not found
I have searched google to solve this error, but i can't find any single ideas from there. And also am very fresher in development. I have found this below link from google search i don't know how to use this in my project,
http://ldt.stanford.edu/~educ39109/yaac/lab3/iphone/Classes/PhoneGapDelegate.h
In project i don't have any PhoneGap Framework. And I have downloaded the sample app from PhonGap site.
Could you please help me to solve this issue and run the project?
Did you say it was inside a framework? You may need to do something on the lines of
#import <PhoneGap/PhoneGapDelegate.h>
I am new to iOS Development and am now venturing into adding different features into my Apps and now would like to be able to implement Push Notifications into iOS5 apps with Xcode 4.2.
I have tried my hardest to understand the iPhone Developer instructions regarding Push Notifications, but found that the easiest method (according to many sources around the internet) would be to use Urban Airship!
I have gone over this for quite a number of days now and tried and tried my hardest to be able to complete the steps required in the Set Up A New Application part of the document.
It states:
The core library requires your application to link against the following Frameworks (sample UIs have additional linking requirements):
libUAirship-.a
CFNetwork.framework
CoreGraphics.framework
etc, etc, etc
http://www.youtube.com/watch?v=EwqM4wfaYNU
The link just above is a YouTube video of what steps I took to follow these instructions and it's really starting to get to me. I would like someone to be able to provide me with some assistance and explain what I am doing wrong, and how to better understand the way you link against the following Frameworks because I have tried my hardest, and never managed to understand it.
Any help would be GREATLY appreciated from anyone.
You are trying to #import a static library in your code. The .a file is a library, not an include file. You just need to add them to your project and then include the .h file in your project.
Search Google for adding static library to xcode, or similar. For example, A quick Google search found this