How to Embed Mapbox in iOS WidgetKit - cocoapods

I have been attempting to embed a mapbox view into an iOS widget using WidgetKit but am hung up on the following error:
Application extensions and any libraries they link to must be built with the APPLICATION_EXTENSION_API_ONLY build setting set to YES.
We are using CocoaPods for package management, and we have been using Mapbox in our main application for some time.
As far as I can tell, this is referring to the Mapbox POD and I don't believe I have the ability to modify that build setting. Can someone help set me straight here?

While you can't embed https://github.com/mapbox/mapbox-maps-ios in a Widget, you can use https://github.com/mapbox/MapboxStatic.swift to fetch Maps image and display it in a Widget.

Related

SwiftUI Preview Canvas Build Fails but Project Build does Not

I am working on a project to add SwiftUI to a legacy app that uses Cocoapods. When I try to run the preview canvas the build fails and the canvas cannot run.
The cause is an issue building one of the included pods in the project (we’ll call this pod ‘LibraryX’). When XCode tries to build LibraryX it encounters a segmentation fault. But when I build the project itself there is no problem building LibraryX and starting the app.
I have tried looking for SwiftUI-preview-specific build settings in the XCode project build settings and have not been able to find anything. I have double checked the build path settings (as in this answer) and also verified that I am building on the correct device (as in this answer). In general, Googling for others who are facing similar issues has not turned up anything like my issue so far.
What I am wondering then is this: Does XCode use different build settings for building the project for use in creating the preview canvas? If so is there some way to configure how the preview canvas build works?
Because LibraryX is proprietary and the SwiftUI view I’m trying to add is simply the default “hello world” view that XCode creates there is not much I can share in the way of code samples for this question.
SwiftUI has still some bugs and is not perfect yet.
The canvas is part of SwiftUI and "shares" some of these bugs.
Sometimes you find yourself in a situation, where (a.) something does not work on Canvas or (b.) does not work correct on the simulator but (c.) works on a real device perfectly.
Most likely everything will get better over time, because SwiftUI is quite new (less then a year old) and Apple is pushing it.
My "solution" for the moment in similar situations is to not rely on canvas and just test on simulator.

Are Lottie animations supported in Xamarin.Forms UWP projects?

I am trying to add Lottie animations to my project.
So far I've only tested on android and I got it working.
Now I'm also trying to add them to my UWP app but I can't find a guide on how to do this.
There is this link that tells me lottie is supported on UWP.
And this post and (probably as a reaction) this post suggests it is possible within xamarin forms uwp.
I can't find a clear reference (or a tutorial) online if this is supported for Xamarin.Forms UWP projects. I'm mainly in doubt because I'm not sure if the Xamarin.Forms.UWP 'flavor' is the same as a 'normal' UWP application.
I could really appreciate a nudge in the right direction.
I think it has something to do with this bug.
Although this sample with an older version (2.5.4) was not built with "support" for UWP
I did get it working by adding the resources to the root dir and setting the build action to Content.
Downgrading the library in my own project to 2.5.4 fixed the problem for me.

Appcelerator App Conversion iOS to Android.

One of our developer developed an app in appcelerator using alloy framework for iOS which works fine. Now we want to run the same app in Android, since the appcelerator is a cross platform tool, we wish to make the Android version of the App. I tried searching about it and explored the applcelerator ide for options but couldn't find it. Can some one please guide me into the right direction?
First of all have a look at this link : http://docs.appcelerator.com/platform/latest/#!/guide/Supporting_Multiple_Platforms_in_a_Single_Codebase this will guide you to update the application for multiple platforms.
Their are basically two different ways to port any application from android to iOS or vise-versa, but before that just let me clear one more thing to you about tiapp.xml.
In the tiapp.xml of your project you need to updated the Development Target by checking for which platform you are developing the application for (iPhone, iPad, android, Mobile Web).
Option 1 :
Cross Platform is build to make code re-usable (i.e. re-use same code for all the platforms), but we have exceptions with many things. Their are lot of components that work fine in iOS but when you use them in android then you will face errors. So in that case you just need to apply conditions for android and iOS like below :
if(OS_ANDROID)
// do something
else if(OS_IOS)
// do something
What you need to do is that you need run the application in android simulator and test the application for these changes and then apply the changes accordingly.
Basically a developer has to target the UI for both the platforms, as their will not be any logical differences between the two. Also their will be UI changes between the same components, like for example a picker in iOS will not look the same as it will when you look it in an android application.
Option 2 :
Now in the project you have assets folder with the platform that you have selected in the tiapp.xml (i.e. iPhone, android etc).
You can create similar structure in the style and view folder, create two folders iOS and android in both the directory (i.e. style and view).
First, move .tss of style folder (except app.tss and index.tss) in the iOS folder, then copy the files in the android folder also.
Repeat the similar process with the View folder also.
Now you have two different structures (i.e. view and styles) according to their platform. Now you can run the application in android simulators and resolve the error that you face.
Hope this small information helps the cause, you can also have look at the documentation of all the components from below link :
http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView

AR vuforia integration with xcode

I have two projects. One is native iOS app (UIKIT) and the other is AR Vuforia project which was made by Unity3D.
I can export AR project into XCODE project, but I am wondering how to link them together.
For example, I have a button on native iOS app. I want to trigger AR project when button is pressed and it can go back to native iOS app as well.
Are you saying that you want to have one app launch another (and vice-versa)?
If that is the case, then you just need to learn about Apple's URL scheme, which is described here:
https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html
It is really quite easy to use. You'll need to edit the PList for each app to give them a custom URL, which you can then invoke via the openURL method:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/UIApplication/openURL:

Using WebKit.framework from WebKit nightly in Cocoa app?

I'm currently using WebView in a Cocoa app, I'd also like to use the HTML5 File API, within webview (specifically FileReader). FileReader is not supported in the latest version of WebKit, but it is supported in WebKit nightly. How would I go about using the WebKit.framework from webkit nightly for my app?
I've tried:
1. installing webkit nightly and adding the WebKit.framework within WebKit.app to my cocoa app, that did not enable FileReader...
2. Changing the import statement to point to the WebKit.framework within WebKit.app... that did not work either.
If you mount the WebKit nightly build disk image, you can temporarily tell your app to use that library instead of the built-in WebKit by setting this environment variable:
DYLD_FRAMEWORK_PATH=/Volumes/WebKit/WebKit.app/Contents/Frameworks/10.9
To set this in Xcode 4, click on the Scheme popup and choose Edit Scheme. Next, click the Arguments tab and add a new environment variable, with the name DYLD_FRAMEWORK_PATH and the value /Volumes/WebKit/WebKit.app/Contents/Frameworks/10.9.
Note that this is for development only, and will not work for end users.
It is generally a really bad idea to use a custom version of WebKit in a shipping app, but if you absolutely must ship a development version of WebKit to your users, you should build it from source and link directly to that code. You would probably need to build WebCore as well. Yay, fun times! :-/

Resources