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

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.

Related

How to create a popup window in Xcode Swift?

I have an iOS info app. The main screen of the app consists of rows of icons. I want that after tap on certain icon card with information appears and background blurs. To close the card I need to swipe up or down. It is very similar to Instagram's imageviewer.
Please help me create that.
P.S. This is my first project so please keep this in mind when you going to describe the method.
It should look like this
The answer to your question is probably hidden beneath the layers of how you can segue between the scenes of a storyboard. First, you create a scene like this in the storyboard and use some third party libraries to present it as a 'pop-up'. It is not possible for you to do that natively as Apple has not added any segue style showing the scene like a pop-up on the iPhone screens (On iPad it's possible - check how Apple presents choose Wi-fi network in Settings). For that purpose, you can use BlurryModalSegue or CNPPopupController to perform such operations.
Thank You!

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)

Converting from a Window based application to a view based application in Ipad

I would like to know if it is possible for me to convert from a window based application to a view based appln... The reason is because I had already developed a part of my app but am getting some orientation issues which I was told would be solved only by using a view based application.
I was unable to find online any documentation regarding this..
It would be be great if anyone could help me out in this...
"Window based application" and "view based application" are just two of the templates you can use to start a project, anything you can actually do with one you can do with the other.
In the version of XCode I have handy here, the only difference between the two is that "view based" gives you an empty view controller and hooks it up to be displayed on app startup.
add a view controller subclass to your project, and then create an instance and add its view as the subview of your UIWindow in application:didFinishLaunchingWithOptions:, you've basically done it- anomie
it's the best and easiest thing you can do as of now

iPhone OS Utility App - Flipside View and Main View communication

I am currently working on an iPhone 2.1 application. I am new to Objective C, coming from a Java background.
My application has as a base the Utility Application template available in Xcode with the iPhone SDK. Currently I have some controls, such as an UISlider and text box, in the FlipsideView. The UISlider already has a method which is being called when the value changes, using targets and selectors. However, I would also like to be able to read, from the MainView, the current (or last) value of the UISlider and textbox.
Keep in mind I am new to development on a Mac, and would appreciate any guidance as to where I should look up such information, be it through the use of delegates or perhaps I am missing something obvious in the structure of the template.
UPDATE:
I am taking a look at the structure and have some more details: The UISlider is being created in FlipsideView.m. I noticed that the Done button is created from RootViewController.m and probably I should move the UISlider code over there. I may incorrectly be using the View to keep code that would be more appropiate in a Controller.
Ultimately you should be updating some underlying object with the values from the controller. In general, the slider belongs in the view layer - it's a display element. The action that adjusting the slider produces, however, is a component of the controller and it should fire back into your model to update a value. I highly recommend drawing boxes on a sheet of paper and trying to produce a clean a separation as possible for your application's layers - doing so in this case would produce two views for each "side" of the utility which would, via a controller, relate to a model. Then, the act of moving the slider would "instantly" update the model on the back. The Cocoa Fundamental video on the iPhone developer site demonstrates this to great effect.
I'm in exactly the same situation: first iphone app, new to mac programming, creating a utility, sliders on the flipside.
By following the example and the free tutorial here (http://www.bestechvideos.com/2008/11/13/writing-iphone-app-free-episode) I determined that the sliders and other controls should be declared on the flipsideviewcontroller. (Which leave the view pretty empty - I guess the use of the Nib resource file for the UI leaves the ...View.m class pretty much redundant?)
Wisequark's answer is a bit to general to help me though.
In terms of specifics:
- I can't find that video is there a link?
- Could we see some code showing the Controller-Model code?
- How do I persist the values set on the slider without having to build UI to go in the system settings?
(BTW is an Answer the right place to add to the question?)

Resources