iOS panoramic app: PanoramaView porting on swift - ios

I need to show some 360 degree spherical photos and was trying to use the RobbyCraft's Panorama repository on Github. I'm able to get the Obj-C project running well, but I don't understand on how use the swift example described by Fabien here.
(By the way I know that I can also use the Google Maps API to render panoramic photos, but I'm afraid that it's a more complicated approach for my needs...)
I made a swift app with a GLKitViewController. Obviously I get "Use of unresolved identifier 'panoramaView'...
Must I use the "Bridging-Header.h" declaration ? (I mean #import "PanoramaView.h")?
I tried to do so, but then I'll get many errors on PanoramaView.h itself.
(PS. I added the needed frameworks to my project, too)

In the Bridging-Header.h file add the following line on top
#import "PanoramaView.m"

In PanoramaView.h, at the top add
#import <GLKit/GLKit.h>
I had same problem and this solved it

Related

how to use SPGooglePlacesAutocomplete in ios

i am using this objective-c wrapper to get the Google Places Autocomplete API result in search bar. i am able to use this sample .but when i copied all file in my project and want to use it i am getting lots of error. how to use it in iOS 8.to make to get Google Places Autocomplete . i am missing something here or what is this error .how to solve this.
import uikit.h into your header file.
#import <UIKit/UIKit.h>
and remove all autorelease statement. they are not allowed in to arc.
that will rectify your general issues.
I'm the one who created that CocoaPods repo you mentioned. It's out of maintenance, as you can find a better solution in Google Places SDK for iOS

How to implement AVCam for Swift

Hello I have found two links about AVCam
Apple: https://developer.apple.com/library/ios/samplecode/AVCam/History/History.html
alex-chan/AVCamSwift: https://github.com/alex-chan/AVCamSwift
The first link has demo files that work perfectly, but its in Object-C - can someone show me documentation on converting Object-C to Swift?
The second link I have downloaded the files but it will not run in my 4s - can someone tell me why?
I would like to have a swift version so I can easily adopt it into my swift build + thanks again SO!
if you have a working objc version why not just import it with a bridging header? there is no one document about converting obj-c to swift, if you really want to convert it you are going to need to do it line by line.
also what exactly are you trying to do? get a live camera feed displayed? these docs have been ported to swift and would suit that purpose but you would need to get the input port first.
https://developer.apple.com/library/mac/documentation/AVFoundation/Reference/AVCaptureVideoPreviewLayer_Class/index.html#//apple_ref/occ/clm/AVCaptureVideoPreviewLayer/layerWithSession:
Update: how to import obj-c headers, a newer way to create them that isnt quite as talked about yet is to just create any normal .m file or objective c file then select yes to creating a briding header, it configures everything for you.
That being said it may be worth while to play around with the basics a bit more and maybe follow a few guides before attempting to implement this type of feature if you are having issues with following the links.
Here is a random application creation guide http://www.ioscreator.com/tutorials/calculator-tutorial-in-ios8-with-swift that should teach you alot. i would recommend following and reading through stuff like this until you have a bit more of a footing and can come up with more of an exact question. no one here is going to rewrite the apple program for you and your questions are extremely broad.

How to implement RabbitMq for ios?

I'm trying to implement RabbitMQ into my ios project.
First of all, I tried it with https://github.com/profmaad/librabbitmq-objc
However, after several steps and it still didn't work, I got frustrated and switched to this one
https://github.com/EFEducationFirstMobile/librabbitmq-objc
It's like pre-support for IOS (Foundation insteads of Cocoa, ARC supported ...) and I just copied rabbitmq-c folder and wapper classes. It builds successfully.
Then I tried to run it with these line of codes:
AMQPConnection *connection = [[AMQPConnection alloc] init];
[connection connectToHost:#"123.45.678.90" onPort:12345];
[connection loginAsUser:#"test" withPassword:#"test" onVHost:#"/"];
AMQPChannel *channel = [connection openChannel];
but it throws this error at the second line:
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
fcntl$UNIX2003 called from function amqp_open_socket_noblock in image MyApp.
can anybody help me with this error ? thanks in advanced.
I am also using Objective-C wrapper for librabbitmq-c library. I am able to connect, create exchange, create queue, bind queue publish message using this library:
For using in iOS
Delete:
#import <Cocoa/Cocoa.h>
Use:
#import <Foundation/Foundation.h>
And if file not found using this:
# import <amqp.h>
Use this:
# import "amqp.h"
I hope this will almost solve your problem. You may get some error on uint64 fix it as Xcode suggests you. And it will work fine.
bug has been fixed by Dmitry Makarenko (lib's owner)
For a correct answer you can use this for iOS using objective-c, it's a pain but it's doable.
From my own research it seems like there have been a lot of people that have pulled this off, but they are all closed source projects that they will not share source code.
For your question you have to make sure you include the rabbitMQ-c source code in your project along with the wrapper. Take out all of the dealloc stuff that conflicts with ARC or turn ARC off for the wrapper.
And to answer your question, just change the cocoa\cocoa import lines to foundation\foundation.h.
The really hard to find ready, easy setup library for rabbitmq on iOS platform the problem is with implementation rabbitmq-c, so I try created own implementation wrapper with usage cocoapods. OLRabbitMQ ( https://github.com/open-rnd/OLRabbitMQ) is also wrapper but you can use cocoapods.

MobFox iOS integration "Cannot find protocol declaration"

I have been trying to integrate MobFox in one of my iOS apps and I'm stuck with a problem.
I have added the framework to the project, and all the other necessary files as well but when I try to add MobFoxVideoInterstitialViewControllerDelegate under #interface MainViewController : UIViewController<UIAlertViewDelegate, MobFoxVideoInterstitialViewControllerDelegate>{ /*...*/ } in my MainViewController.h file, it says Cannot find protocol declaration for MobFoxVideoInterstitialViewControllerDelegate. All the files are there. What might be the problem?
It's old, but I want to answer it. The problem was that someone tried to integrate MobFox already without video and didn't remove the files. So the library used those files instead of new ones. Removing old files has resolved my problem

iOS help: math.h? Where is this?

I am following a tutorial out of a book and in the .h file of where some of my code is, I have to type in: #import . Where is this file located? Is it part of some framework or do I have to download it somewhere? I've googled this and found a question about math.h on MacRumors, so I know that it has something to do with iOS programming and probably isn't specific to the book.
It's part of the SDK that you have already installed if you are doing iOS development. All you need to do is put the line
#import <math.h>
in your code. You don't need to download anything. You don't need to link against anything (the math library, libm, is part of libSystem on both iOS and OS X, and is linked by default).
Note that this has nothing to do with "iOS programming". <math.h> is part of the C standard library, not specific to any platform.
Have you tried this? Did you encounter a problem?
Well, it depends. In the tutorial you're following, if it imports that header like so:
#import "math.h"
That means it is in the user header search path. In other words, it's not a system library, but something the author created. If that is the case, you'll have to find it online, or maybe in the back of the book you're reading.
If the library instead appears like this:
#import <accelerate/math.h>
Then it's a system library(note the '< >' instead of quotes), in the accelerate framework (just an example, I don't know if there is a math.h in accelerate or not). The first part of the path of the import indicates the framework you'll find the header in.
If you change your question to include the full #import statement in the book, I can more accurately help you.

Resources