Nativescript iOS Action Bar Subtitle - ios

I'm attempting to put a subtitle under a title in the action bar on iOS. While there is this solution for Android it doesn't work on iOS at all. Is there any way to do this on iOS?
<ActionBar [title]="This works" [subTitle]="I want a subtitle here"></ActionBar>

iOS doesn't have a subtitle option. But you could use a custom title view and wrap two labels one below another.

iOS has some sort of subtitle, but it is named as prompt (for more detail, you can see the doc for UINavigationBar).
Unfortunately, you can't set its value from XML, so you need to use some handler - I create simple playground to demonstrate prompt property.

Related

How to style GCKUIMiniMediaControlsViewController in iOS?

I'm upgrading current Cast SDK to V3 and want to use build-in UI components and remove deprecated functions.
Currently, the GCKUIMiniMediaControlsViewController has a white/light theme but I'd like to change it to a darker theme. However, I couldn't find any function/propert/protocol that I can use to change the style. The document Add Advanced Cast v3 Features to your iOS App says:
The Cast framework widgets supports the Apple UIAppearance Protocol in
UIKit to change the appearance of the widgets across your app, such as
the position or border of a button. Use this protocol to style the
Cast framework widgets to match an existing apps styling.
This makes me feel like I can change the appearance but I'm not quite sure what does The Cast framework widgets supports the Apple UIAppearance Protocol in UIKit mean :(
I also find a previous question which also related to Cast SDK's UI component. How can I get access to Introductory Overlay?
Can anyone help me how to change the style for GCKUIMiniMediaControlsViewController?
Cast SDK v3 for iOS introduced GCKUIStyle.
This makes styling of all cast views very easy (which includes mini controller, expanded controller, etc). As it contains pretty much all properties for customization.
For GCKUIMiniMediaControlsViewController specifically
GCKUIStyle *castStyle = [GCKUIStyle sharedInstance];
// customize Mini Controller
GCKUIStyleAttributesMiniController *miniCtrlStyle = [[[castStyle castViews] mediaControl] miniController];
[miniCtrlStyle setBackgroundColor:backColor];
[miniCtrlStyle setIconTintColor:[UIColor whiteColor]];
[miniCtrlStyle setHeadingTextColor:[UIColor whiteColor]];
[castStyle applyStyle];
https://developer.apple.com/reference/uikit/uiappearance
For example if you want to change the background color of every UILabel that is contained in GCKUIExpandedMediaControlsViewController.
ex in Swift:
UILabel.appearance(whenContainedInInstancesOf:[GCKUIExpandedMediaControlsViewController.self]).backgroundColor = URColors.URStrawberryRed
You need to follow Apple's instructions on using the UIAppearance protocol. Note that any changes you make to the styling will happen across the entire app.

What type of UI component is this?

I see this type of action sheet on iOS devices using the Google Drive application.
I want to know if it is already supported on iOS SDK or if it is a custom UI?
If it is already a standard component, what's name of it?
It was called UIActionSheet before iOS8 and after you can find this UI component under the UIAlerController. You can use this component to make some UI like this but development target should be more that iOS8.
You can check here for documentation.
I'm not aware of any custom components, but it looks to me like a standard UIAlertController with a ActionSheet style. As the alert controller extends UIViewController, you may add subviews to it.
The screenshots indicate that they added a UITableView as a subview to the alert controller:
Ok, got it. It's only for iOS 8 and later. It's named UIDocumentPickerExtensionViewController.

Does iOS storyboard have a feature equivalent to tools:text in android?

I've just moved from android to iOS with swift.
android provides tools namespace that supports this kind of requirement. I just use tools:text="fake string" so that the string only appears on the IDE screen.
When it comes to iOS storyboard, while I'm drawing layout with storyboard, one question is remaining in my mind.
Can I have a fake string that only appears on the storyboard but not on iOS screen?
Please let me know if I can use the same feature in iOS programming.
No, there is no fake text available. The text which you are setting in storyboard for a label will display while you are running the application. You can create reset/change this text in viewDidLoad of the corresponding view controller by creating an outlet of the label. Like
self.label.text = "New text"

iOS 8.3: UIActivityViewController shows extraneous row

I have a UIActivityViewController for which I have excluded (using excludedActivityTypes) all the UIActivityCategoryAction activity types.
In iOS 8.2, the UIActivityViewController would only show one line, for the UIActivityCategoryShare activity types.
In iOS 8.3, I get an empty line for UIActivityCategoryAction. See the screenshot below where the second line just has "More".
How can I remove the UIActivityCategoryAction in a UIActivityViewController in iOS 8.3?
In iOS 8, UIActivityViewController is still an API that only provides custom functions, but not custom UI. You can't change the way it looks. The only part of the visual style you can change is the icon of your custom UIActivity subclasses. (ref)
This is how Apple implements this, and it cannot be changed as of 8.3. If you really want to avoid the extra row and the "More" button, you can implement a UIActivityViewController replacement. Here are a couple that have been recently maintained:
OvershareKit
URBNShareKit
References:
UIActivityViewController Hide More from Actions
UIActivityViewController on iOS 8 show "more" button with custom activities
Can I exclude "More" Button in UIActivityViewController?
http://getnotebox.com/developer/uiactivityviewcontroller-ios-8/
This is by-design so that users can add back system and third-party actions that they've hidden.
The More is system default. that is used to reordering the application. and for extension(introduce in IOS 8), More button is used to reorder the app as well add application in dialogue. we don't have any control over it.
Hope this help you.
I find a away to remove the UIActivityCategoryAction .
Like that:
demo
As the UIActivityCategoryAction is the second section of a CollectionView ,
You can find collectionView's dataSource and change the implement of the "numberOfSectionsInCollectionView:" by method swizzling.
here is the demo:enter link description here
UIActivityCategoryAction is the second section of a UIColletionView , change the number of section equal to 1 ,and the UIActivityCategoryAction will disappear.
Here is the demo

Custom Keyboard in iOS 8

iOS 8 lets us create our own custom keyboards.
Is it possible to make a custom keyboard output anything other than unattributed NSStrings?
Can I make a keyboard that outputs images to say the Messages app, or is it impossible?
No, this would be too difficult since most UITextField / UITextView can only handle NSString object.
As described in the UITextDocumentProxy only NSStrings are allowed.
UITextDocumentProxy is the communication object used by UIInputViewController. UIInputViewController seems to be the base for creating custom keyboards.
Also have a look at App Extension Programming Guide
- Custom Keyboard
You can create a twitter-style workaround: when the user selects an image, you upload it to your server and send a shortened url in reponse. this shortened url will be inserted to the text view of the host app and good luck :)

Resources