Custom UINavigationBar Shape in iOS 7 - iphone

I am new to iOS development. How can I create a UINavigationBar like the one below? Which method do I need to override and how could I achieve a shape like that one?

You can't change the shape of the navigation bar. You can however create the illusion of the shape with custom controls and images.

Related

Gradient on a UILabel? [duplicate]

This question already has answers here:
How to Apply Gradient to background view of iOS Swift App
(30 answers)
Closed 4 years ago.
I am trying to create a UILabel that will have a gradient background color. I am wondering if there is a way to do this through the interface builder. If not, is there a way to accomplish this programmatically using the Swift programming language?
Any input or suggestions are greatly appreciated.
Thanks in advance.
You actually can't put directly a gradient layer in a UILabel, since the text will dissapear. See Adding a CGGradient as sublayer to UILabel hides the text of label
You can use an UIView, put your UILabel inside it, and then add the gradient layer to the UIView like this.
How to Apply Gradient to background view of iOS Swift App
While not the same question, it seems the answer to this may help:
How to Apply Gradient to background view of iOS Swift App
You have to create a gradient layer and insert it as a sublayer programmatically.

Creating a view with notch at the edge in iPhone

Is there any possibility of creating a view like the following image? I do not want to keep a image like that I want iOS native coding functionality to achieve these notches.
Set your UIView background color to clear color from the code (or from the interface builder with alpha 0.0), add an UIImageView and use your image.

Shadow inside UIView

I am working on iPhone application development and have come across shadows of UIView.
I know how to show shadows to a UIView but what I am actually interested in is to drop shadow inside the UIView.
Like when I set shadow properties of a UIView the shadow is dropped behind the view. I want it to come over the view so that the view looks as if it is pressed inside.
Example of such view is UITextField with roundedRect styling.
Thanks,
It depends a lot on the final effect you want to achieve.
The easies way would be a custom image with a prebacked shadow as background. This will give the illusion of a recession in the surface of the view. You can then add subviews to it as usual.
Alternatively, you can override the drawRect: method and draw the view as you like there, "inverted drop shadow" included.

How to build knob like spinner in iOS sdk?

I want to build a spinner for menu selection like the one in where to? IPhone app as shown in image below. Any hints?
Doesn't need to be very hard. The easiest is probably a UIImageView with the image of the actual spinner, and another UIImageView with the yellow selection highlight (a transparent PNG) overlaying. The rotation can then be controlled with the transform property of the first UIImageView.
This should of course be nicely encapsulated in a custom UIView subclass.

iPhone HUD style progress bar

I've been wanting to create a HUD style loading bar like the SMS app on the iPhone used to have but I don't know how to. I was wondering if anyone has done this before or if there is a tutorial somewhere for it? I just think it looks so nice and would like to use it rather than the built in loading progress bar.
It should be very simple to implement using Core Animation layers (the CALayer class).
The bar would be a layer with rounded corners and the fill could be drawn by a custom drawing method.