Component in iOS to make a selector option - ios

I wonder which component is being used to create a selector option like the one used in iBooks where we can adjust the Font Size and also the Theme, but without moving to a new view controller.
In my application I would like to implement it giving 3 small options to the user to choose, but without moving the view controller being presented. Its a small square area with an arrow at the bottom or top side giving the impression where it's coming from. (Let me know if I am not clear with the explanation).
Does anybody know how to use it??
Thank you all in advance

ibooks is using UIView. In that UIView you can add any controls you like. You need to use delegate methods so that I can perform communication between two objects(send message to another object). You will be able to make you custom UIView as controls.

Related

Which control should I use to display an ActionSheet-like view at the top of the screen?

I was asked to display a list of three options for the user in a View sliding from the top to bottom. They say it should slide from the top because the action is initiated from a dropdown-like button on the navigation bar.
Most of what I found on that subject mentions the deprecated UIActionSheet class.
The "new" way using UIAlertController doesn't seem to allow us to change position of the view. At the least from what I've found.
The end result I'm trying to get can be seen on the image below,
From what I've learned about iOS programming, one method I could think to achieve that would be to create a new UIViewController and to use a custom class to control the transition. But it just seems so much. And I think it wouldn't not look like a dropdown afterall.
The other option would be to create the TableView with options and leave it on the Controller where it should be displayed, configuring its height to zero. And then Animating when necessary. I also have such a bad feeling doing it this way.
Is there a right way to do this on iOS? Does one of the options I've found seems acceptable?
Thanks.
Following the suggestion given by #Losiowaty on the comments, I started looking for a custom View/Control on cocoapods and ended up finding quite a few that did what I was looking.
The one I decided to use is this:
https://github.com/lminhtm/LMDropdownView

Place image on top of all "layers" on iOS screen

What are the constraints/alternatives to place an image that stays on top of all iOS "layers" and windows. Think of it as a lock screen but that still allows you to interact with you phone, meaning browse, answer calls, etc. The image will be displayed in a transparent way (say 40%) and will be launched by an application.
Not really sure what you are asking for but if you are looking for a way to add some code once and it shows everywhere on each of your ViewController then there really is no way to do that.
What you can do is
Use UIToolBar
add buttons to that tool bar
Add that tool bar to each ViewController in storyboard (where you need them)
Create a global function / method that you can call in from any ViewController that has the button actions in it. That way you edit the code once in one place and use it every where.
If you don't like UIToolBar then
you can add your own UIImageView and add a transparent background to it
Add your buttons on the UIImageView. (You will have to add constraints)
then show that on every ViewController
If all this seems to much work then you can use existing controls HERE and see which one fits your needs.
This maybe a good one - FCVerticalMenu

How to load another UIViewController to a UIView Example Like UITabbarController

I have a 2 UIViewController(s), I need to be able to change the views at the bottom of the Airtime and Data Plan Upon tap gesture on Airtime and Data Plan!
The yellow line will indicate the active view controller. some thing like tab bar.
Perhaps, the image attached is an android version
Could anyone provide a help on how to go about this.
Thanks
I personally use a library called ICVIewPager
https://github.com/iltercengiz/ICViewPager
This is pretty simple and easy to use with examples. It should put you in the right direction without writing a lot of code.

Single view iOS app with custom drawRect

I though I understood this, but I can't get it to work:
I'm trying to create a very simple app, to test various things (OK - it's an app to estimate Pi using the Monte Carlo technique by simulating throwing darts at a board).
I have a single view iOS app (e.g. from the single view template) on which I've simply got one UIButton (to launch the app) at the bottom and a UILabel at the top to show the results.
The view controller is a custom subclass of UIViewController call PiCalcViewController; the view is a standard UIView filling the whole screen.
The app works but now I want to be able to draw a graphic representation of how the simulation is going the middle of the screen, which I'll do in my view's drawRect (right?). So I thought that I'd create a new file (PiCalcView) an Objective-C class, make it a subclass of UIView and then, in IB, drag out a new view in the middle of my view controller and change it's class to PiCalcView.
Great, except that PiCalcView does not appear in the drop-down class list in the inspector.
Questions : Any idea what's wrong and is creating a subview of my UIView like this the right way to do it?
Type the class into the custom class section in the Identity Inspector.
OK - quitting and restarting Xcode appeared to do the trick.
Thanks for the tips - being new to Xcode & ObjC, I didn't know if I had the right technique.At least I know now.

Create custom UIButton with multiple images and shift Label and maybe add properties

for an iPad application in ios5.0 and arc, I need to create a button that has an image covering the entire button, and needs to have another transparent image at the bottom half of this button image OR have the button text label covering the bottom half of this button image.
In posts on this site I've read that using button subclass to just change the appearance of the UiButton should not be done. However, if I don't subclass, can I add these transparent image/and shift the button label? if so, how?
In case I need to add properties to the button, what is the best way to go about it.
If subclassing is the only option, can you also pls give pointers on what are the methods that i must absolutely override and any other such memory/performance considerations that I must keep in mind
Pointers to Any tutorials or third party libraries would be most appreciated.. Thanks in advance for all your help
I don't agree on "subclassing UIButton is not good". That's exactly why inheritance and subclassing mechanisms exist. In all platforms, the framework provides a base foundation for general needs, and you do extend them in the case standard stuff does not satisfy your needs. And you do it by subclassing.
As long as you know what you do, and what you do works for you and solves your problem, you're fine.
When you subclass UIButton, depending on what you actually want to achieve, you may want to override init:, initWithRect:, layoutSubviews:, awakeFromNib: methods.
Inspecting some subclasses would also help:
https://github.com/ardalahmet/SSCheckBoxView
https://github.com/ardalahmet/CopyableCell
For UIButton, you can inspect this component. Source code may help a lot.

Resources