Swift: implementing a new item dialogue like 'add alarm' in clock app - ios

I want to implement an add new item dialogue in my app similar to add alarm dialogue in the clock app (screenshot). Prior to this moment I always used the same storyboard scene design for iphone and ipad with autolayout to make it look good on both devices. But I'm wondering how can I implement a view similar to Add Alarm dialogue - it looks very compact on both iphone and ipad especially because on ipad it's a separate small view that is not stretched across the screen. Can somebody please point me how to implement it? I don't really need the code, just some directions that can help me.

Found it in the apple documentation:
https://developer.apple.com/library/content/featuredarticles/ViewControllerPGforiPhoneOS/PresentingaViewController.html

Related

How to turn iPhone style table view into iPad style table view (Swift)

I apologise in advance if this is a really simple thing to do, but I have searched and searched for answers and cannot find anything anywhere.
I have made an iPhone app that has a similar sort of interface to the built-in iPhone Mail app. It has a table view, and when you tap on an item it segues to the corresponding document. When I build it for iPadOS it works in the same way, as you would expect.
But this isn't how iPad apps are supposed to look. I want my app to look like the Mail app does when running on an iPad, with the table view to the left of the content when in landscape, and the ability to slide it in when in portrait. I simply have no idea how to even get started though. If anyone can help, I'd really appreciate it! Thanks!

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!

All iOS screen size compatibility?

New to iOS developing here. Basically I am creating a soundboard app. I have the app essentially working (aka buttons returning sounds).
However my app only looks proper on the iPhone 6. I just have one ViewController in my main storyboard. When I run the simulator for the 4S/5/6+ or iPads, my buttons are pretty much everywhere.
I tried playing with size classes/autolayout through Apple's documentation, but couldn't get it working properly. What's the best (easiest ;) ) route I can follow to have it basically looking the same on ALL devices?
PS: I have one background placed too, I don't mind if it looks different on all devices since it's pretty minimalistic, but if someone can shed some light here too, that would be great.
Thanks!
You have a few options:
1) Continue your plan spending time getting friendly with Auto Layout and Size Classes. This might be difficult at first, but it will really pay off later. You should use the Assistant Editor's Preview mode to let you see iPhone 4, 5 and 6 side-by-side as you work so you can make sure your layouts look great everywhere.
2) Use a component like UIStackView where layouts are automatically adjusted to fit various devices. If your soundboard is as simple as a grid of buttons, you can do that in just a few minutes using a stack view.
3) Use a component like UITableView or UICollectionView where content is designed to scroll. Using this method you design only one sound button of your app (i.e., enough to play one sound) then have iOS replicate that across all the sounds you want. When your interface is presented on a device of a different size iOS will just make the content scroll.
Very roughly, option 1 makes you do all the work; option 2 makes your layout shrink down until it fits the available space; and option 3 makes your layout stay the same size no matter what, but you should expect it to scroll on some devices.
There is no right solution; it's entirely down how you want your app to work.

Show a view on main screen while the app is in background in ios

Thanks in advance.
Is it possible to show a capture screen like assistive touch view in ios when we click on application icon.Means i want to show the iPad screen and top on the with transparent background a view need to display.
I want to create an app like this after clicking the app icon i want a screen like this on my main screen and i can able to customize it and capture the selected area. is it possible to do that. and is there any api for that.
i don't think you are allowed to capture the home screen in public api. this question had similar request.
How can I take a screenshot of the iPhone home screen programmatically
UIGetScreenImage() mentioned in the answer is very useful, if you only targeting Jailbroken phones.
However, i found an open source library called "Record My screen", which claim can
Record the display even on non-jailbroken iPhones.
I personally didn't test that, since i believe Apple would somehow find that and pull the app off (that happened to several apps before). If you really interested in it, maybe you can learn something from that library.
Hope that helps you.

Recreating the iOS 5 Mail.app sidebar (iPad)

iOS 5's Mail app has a nifty little swipe gesture that brings up the sidebar in portrait mode. Now it seems like that gesture would be useful in other apps that use the master/detail layout, but as far as I can tell Apple hasn't released any sample code or documentation to show how the effect was created.
I've thought about how to replicate the effect in my own app but I'm not super experienced in view programming. Has anyone managed to recreate this effect in their own apps or would anyone know how to do so?
Here's a downloadable project that pretty well reverse engineers everything the Mail app is doing with its split view interface: https://github.com/mattneub/Programming-iOS-4-Book-Examples/blob/master/convertedToIOS5/p560p575splitViewNoPopover/p560p575splitViewNoPopover/MySplitViewController.m
Here you go: http://useyourloaf.com/blog/2011/11/16/mail-app-style-split-view-controller-with-a-sliding-master-v.html

Resources