Does tvOS have any UIViewController subclasses I can use instead of replicating standard functionality? - ios

I've started developing for tvOS recently, and discovered that while TVML isn't ideal for our use case, we'd still like to display a number of screens that display the same types of content as I've seen in existing Apple apps, and which I know can be created with TVML.
As an example, I want to display a page of terms, the same way that the Apple TV displays information as a scrollable page of text.
I could do this custom, where I place my own textView on a UIViewController, and setup the width and positioning myself. But it's scenarios like this, where I'm wondering if there's some already existing standard control for it, such as a UIViewController subclass already setup for displaying Terms? Is there a set of these I could be looking at?

UIAlertController should solve what you're looking for. You configure the text, buttons, and then present it.
More info in the docs:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIAlertController_class/

Related

iOS - Is there a programmatically way to create multiple windows that don't split the screen?

I'm using UIScenes and SwiftUI to create a simple app.
I need to create multiple windows programmatically, but not with the same design outcome from requestSceneSessionActivation, that splits the screen into 2 pieces. I need the other one, like the image...
I didn't find anything in the UIScene documentation for it.
If you know a way to close it too, it would be awesome!
Unfortunately UISceneActivationRequestOptions (passed to requestSceneSessionActivation) doesn't provide an option to specify how the new scene should be presented. Oddly there is a UIWindowSceneDestructionRequestOptions class for indicating how a scene can be dismissed. There should be a UIWindowSceneActivationRequestOptions class that allows you specify how it is shown. I suggest filing an enhancement request with Apple using the Feedback app on iOS 13.
Closing a scene can be done using UIApplication requestSceneSessionDestruction.

How to make Custom GIF Keyboard in ios

I have one doubt that how exactly GIF images loaded into Custom keyboard and user can send it. I am new in iOS so want some link which i can refer and will be helpful for me.
Read Apple docs for this, especially this one https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/Keyboard.html is a good strating point
You can set any UIView as the view for the keyboard layout, so an UIImageView is suitable for your purpose. The real difficulty in custom keyboarding is the management of events. As you are new to iOS dev, I would like to encourage you to try much simpler things first.

The Correct Way to do Custom Keyboards in iOS?

I am looking to implement a custom toolbar that sits above my keyboard for a text field with some custom values. I've found a ton of tutorials online but this question is for asking what's the best way to do this.
This tutorial here http://blog.carbonfive.com/2012/03/12/customizing-the-ios-keyboard/ provides the most common way I can see across many tutorials, with creating a new subclass of UIView and using delegates to get that information across.
That's the commonality. However, I came across this tutorial which in the view controller itself just creates the toolbar, assigns it to the textField inputAccessory and it's good to go. In fact, I tried out the code and without any effort, I have now a custom keyboard.
http://easyplace.wordpress.com/2013/03/29/adding-custom-buttons-to-ios-keyboard/
This just seems a bit too easy to me though and I'd think the proper, Apple recommended way would be to create that UIView subclass and use delegates so that the view controller with the text fields acts as that delegate.
I'm specifically targeting iOS 7 in my app.
What are people's thoughts on this? If the second easier link is supported and is likely to pass Apple's guidelines, it's a good starting point but if delegates are the way to go, I'd rather look into that from the start.
Your thoughts will be appreciated.
There is no 'Apple Approved' way to do this, and its hard to believe anything you do here would get your app rejected. The custom keyboard you reference in your post has the iOS6 look and will appear outdated in an iOS6 app. I'll mention some iOS7 suggestions shortly, but the constant danger of mimicking what the System looks like today is guaranteed to look outdated later. In Mac/Cocoa development, Apple use to say at the WWDC that if you did something custom, make it look custom, don't take a standard Apple widget and try to duplicate it. But that advice is mostly ignored.
For iOS 7, you can create buttons that appear just like the system ones do (not pressed), but of course when someone presses them, they won't act like system buttons (i.e. animate up and "balloon" out.
I'm currently using a fantastic add-on keyboard, my fork of KOKeyboard (which uses the buttons above). This is such a cool addition. While the buttons look like iPad buttons, each one has 5 keys in it. By dragging to a corner you select one of the four, and tapping in the middle gives you that key. This might be overkill for your app, but it really helped me with mine. It looks like this:
(the Key / Value is in the under laying view.) The center control lets you move the cursor - its like a joy stick - and can be used to both move and select text. Amazing class, I wish I'd invented it!
Also, for any solution, you want to use a UIToolbar as the view holding the keys, for the reason that it supports blur of the view it overlays, just like the keyboard does. You can use the UIToolbar with no bar button items in it (if you want), and just add subviews. This is a "trick" I learned here, as there is no other way to get blur!
David's KOKeyboard (er…, the one he used - see David's comment below) looks nice. I suspect that he is using the official Apple mechanism:
inputAccessoryView
Typically, you'd set that value on a UITextView, but it can be any class that allows itself to become the first responder.
The provided view will be placed above the default apple keyboard.
It is correct that there is no official mechanism (and it is suggested against) to modify any system provided keyboard. You can add to it, as above. You can also entirely replace it for with your own mechanism. Apply will forgo the keyboard setting on your view and use a custom input mechanism if you set
inputView
set it to any view - Apple will still manage its appearance and dismissal as it does the custom keyboards.
Edit: Of course, iOS 8.x added significant access to keyboards. (not mentioned here)

UIScrollView messaging app behaviour

I've been wondering how apps like Facebook Messenger, Whatsapp or the Messages app on iOS itself work (from the UI perspective).
I assume they're using a UIScrollView and add UILabels at the bottom of view with the message and/or info of the message itself, giving a fixed space between labels, and so on...
Am I right or my approach is completely wrong?
In iOS6 and above, you have UICollectionView, which inherits from UIScrollView, but gives you tableview-like cell management without being restricted to one row. For example, both the iOS7 Messages app and the new Facebook Messenger use collection views to implement what you look for.
There are several open-source solution that implement a similar behavior, which you can take a look at for use or ideas. THSpringyCollectionView, JSMessagesViewController and others.

Can we develop a custom UITababar?

Is this possible for us to customize the UITabbar as it is in the attached image for an iPAd App?
My App is only meant for Landscape orientation..
Will apple allow this?
I know that this same can be done using a UIToolbar and having tab like buttons. Since the number of tabs I will have in my app is around 5, I can not think of implementing them in a single view using UIToolbar.
I came to know that even if this kind customization is done, Apple will not approve the App.
I have actually used UIView to place different UIButtons in them and produce similar effects as that of UITabbar.

Resources