Titanium: Notification with download status - titanium

I want to create a notification that will include a download status, such as the photo below (marked in yellow:
Is there a special way of doing these? A code sample would be nice...

There indeed is a special way of doing it. Usually these kind of features require a module to be included. This can easily be done by using Gitt.io.
The module in question is nc.progressnotification
You can find the module on Github, or through Gitt.io.
An example is added to the app.js file in the example folder

Related

How do I use Objective-C code from Github in my Swift program?

Summary of problem
I'm building a calendar app in Swift, and I'd like to start with the UI in this repo: https://github.com/erichoracek/MSCollectionViewCalendarLayout
This repo is written in Objective-C.
However, I'm not sure how to build on top of this Github repo using Swift.
Example of the UI I'd like to use in my calendar:
What I've tried
I successfully installed this library with CocoaPods.
I ran $pod install.
I successfully ran import MSCollectionViewCalendarLayout.
I added a new CollectionViewController on my Storyboard, and assigned it to my custom CalendarViewController class
I tried (dumbly) with the code below in class CalendarViewController,but I get this error message:
"Cannot assign value of type 'MSCollectionViewCalendarLayout.Type' to type 'UICollectionViewLayout'"
override func viewDidLoad() {
super.viewDidLoad()
self.collectionView.collectionViewLayout = MSCollectionViewCalendarLayout
}
I understand I probably have to use self.collectionView.register(cellClass:forCellWithReuseIdentifier:)...but how?
There's some documentation titled "Usage" in the Github, but unfortunately I'm still lost as to how to use it:
There's also an Example.xcworkspace included, written in Objective-C. I've gone through most of it. They include header (.h) and implementation (.m) files for each of the elements that they use.
There's a good answer to a tangential problem here: https://stackoverflow.com/a/45540130/3979651, but this doesn't directly solve my problem. I'd like to import this Cocoapods library, instead of writing on top of Objective-C files. But I'm also not entirely sure if this is the right / best way to do it.
Summary of questions
How do I link my CollectionViewController to MSCollectionViewCalendarLayout so that it has the same UI?
How do I use self.collectionView.register(cellClass:forCellWithReuseIdentifier:) in this case?
Do I have to write a new file for each element, like in the Example? (Event cell, Day Column Header, etc.)
Or, would it be easier to just copy and paste the Example element files (.h and .m) into my app? If so, how do I build on top of those files?
What I'd like to accomplish
I would like to import MSCollectionViewLayout like a library, attach it to my own CollectionViewControllers, and build my own functionality on top of this, all using Swift.
Thank you all in advance! Hopefully I can commit the correct answers here to the repo's README.md file.
You can better use one of the below repos which are purely written in Swift and has the same UI as of MSCollectionViewLayout
1) CalendarKit
2) Calendar
Note: I personally used these libraries and these are easy to
integrate with your existing application.

Custom widget in thingworx

Could any body let me know how to create custom widget in thingworx.
I don't have any idea how to create custom widget.
Please help me.
I have to build drag drop custom widget and we can use that custom widget with other widget. e.g with tree widget,... etc.
I would recommend reading the official Extension Package Development Guide:
However, the best way to start making a new widget is to take an existing widget that does something like you want, and modify it. Built in widgets exist at
TomcatRoot\webapps\Thingworx\Common\thingworx\widgets
Here's a very brief guide to getting started with that. If you were to want to copy Textbox:
Open the metadata.xml and change the "TextBox" to "MyWidget".
There are two sections in this file. The "ExtensionPackage" section holds metadata for the pacakge (version, vendor, etc.)
The second section , "Widgets" defines the widget files. Change the name of all these files to use your name e.g. MyWidget.ide.js Don’t forget to change name in the “Widget” xml tag too.
Rename all necessary folder and files, replacing "TextBox" with "MyWidget"
Open the both .js files and change the definition in each to reflect "MyWidget"
In the ide file, change the icon path "widgetIconUrl" and the "name" property.
Select the "ui" folder and the metadata.xml file and package them both into a new zip file. This file should import into Thingworx.
I would suggest searching for or asking this question in the PTC IoT Community, which is much more active for Thingworx developers than StackExchange.
UPDATE: The latest documentation for ThingWorx 9 Extension Package Development Guide can be found here

WhirlyMaply missing MaplyBridge.h

I am trying to use WhirlyMaply for a personal project.
Am trying to follow their tutorial and they mention I have to have a bridge file since the code is written in Objective-C and I am writing my project in Swift.
However there is no MaplyBridge.h file found as per their instructions ...
The following is the link http://mousebird.github.io/WhirlyGlobe/tutorial/building_from_source.html
The description on page http://mousebird.github.io/WhirlyGlobe/tutorial/building_from_source.html is bad.
You need to create MaplyBridge.h yourself. You may decide to not create it in the "BinaryDirectory/WhirlyGlobeMaplyComponent.framework/Headers/" folder but instead create it somewhere in your project. As described in the tutorial, you still need to go to Build Settings and look for “Objective-C Bridging Header” then correctly set the path to your new MaplyBridge.h".
In a later path of the tutorial, such as in http://mousebird.github.io/WhirlyGlobe/tutorial/ios/your_first_globe.html, you will add code to MaplyBridge.h. For example, to get the tutorial's swift code to compile you'll add the line "#import " to MaplyBridge.h.
See http://www.learnswiftonline.com/getting-started/adding-swift-bridging-header/ for some more background information

How to Automatically Link Frameworks or Libraries

I am building an app, that I want to create a template out of. In that app I manually create links to several Frameworks/Libraries.
Is there a way to automatically create those links?
Thank you,
-- Eric
There is no automatic way to add those links. You just need to add them one by one. If you need to import some header files in almost all your source code file, you can consider to add them in your *-Prefix.pch file.

QuickLook Plugin: how does it work when 2 plugins handle the same file type?

If a user has 2 or more quicklook plugins that handle the same kMDItemContentType what happens? Which plugin gets priority to do that actual work? Can that be set programmatically?
From a quick reading of the docs (Installing Quick Look Generators), the Quick Look daemon chooses a generator based on the following search order:
Inside the app bundle: MyApp.app/Content/Library/QuickLook
In ~/Library/QuickLook
In /Library/QuickLook
In /System/Library/QuickLook
They finish by saying that if there is more than one generator for a UTI, the one that ranks highest on that list is chosen. If there are two or more for the same UTI at the same level, Apple says there is no way to know which will be chosen; the generator that is found first in their search is used.
I've found you can modify the Info.plist file within a .qlgenerator plugin and remove a UTI entry from UTImportedTypeDeclarations to force Quicklook to use another generator for that UTI. You may need to run qlmanage -r afterward for changes to take effect.