Rotation of the button animation does not work

I have a button, when it's tapped, it should rotate itself, here's my code: @IBAction func calculateButtonTapped(_ sender: UIButton) { let rotateAnimation = CABasicAnimation(keyPath: "transform.rotation") rotateAnimation.fromValue = 0.0 rotateAn

UIView with tags at the top of UITableviewcontroller Swift

I am trying to keep a UIView with a label, segmentedControl and a button at the top of my UITableViewController as it scrolls. I cannot use a ViewController with UITableView because my TableViewCells are static with UITextFields in them. I know this

IOS autolayout: are size constraints for UIView mandatory?

I am trying to arrange controls in the storyboard using constrains via Interface Builder ("Any Width, Any Height" case). I add there UIView, however, when I press update frames for this element (Selected Views case) according to the given constr

How to iOS VoiceOver read View and Subview as a whole

I have a UITableView that displays a list of items, with a subclass of UITableViewCell. In that cell, I have a hierarchy of UILabels and subviews like so: UITableViewCell subclass - UILabel a - UILabel b - UILabel c - UIView subclass 1 - UILabel 1a -

animateWithDuration is not displayed

I'm learning Swift and I'm having problems moving a UIView from different functions. If I use this: ViewController: let boardView = BoardView() @IBAction func startButtonTapped(sender: UIButton) { view.addSubview(boardView.background) } The class Boa

UINavigationBar titleView larger than the bar itself

So I'm trying to do a center button on a UINavigationBar similar to the popular UITabBar customization. But its got a small problem. Basically everything is working well, I've got the bar adjusting is size, showing the titleView properly, working wit

Put a UIScrollview in a viewcontroller (storyboard)

Hey I want to add a scroll view to my view controller, I have dragged a UIScrollView onto the canvas, it is the required size (228*128). I want this scrollview to scroll a view of size (576*128), i.e. double width. I'm not sure how to go about doing

Defining CALayer masks hiding the disappearance of the layer

I am trying to create a circle which is filled depending upon a certain percentage. Here is pic of the effect I am going for: I have a UIView and to this I add a CAShapeLayer which draws the circle. I am then creating another UIShapeLayer as a square

Background UIView.beginAnimations - Swift

I'm having trouble getting a UIView (UIButton) to animate in Swift. Can anyone help? Here is my code. I'm mainly having trouble with the method [UIView.beginAnimations]. It requires me to pass in a String and a CMutableVoidPointer. This currently cra

How to pass the EAGLView UIButton frame to viewcontroller

I have EAGLView and it's UIButton. In ViewController i need to display the same button in landscape mode with click event what it has in EAGLView. I tried to set [eaglView.save setFrame:CGRectMake(360, 10, 40, 40)]; but the size is not changing in la

Can I get an instance of a view by ID, as in Android?

I have a table view, which was added in Interface Builder. How can I get its instance in the view controller? Is there a way like getViewById() in Android? Where do I give the view its id?Create and Add UITableView Programetically and use it object.(

UIView does not appear in both header views

I am developing an iPad application. For some reasons, I need to show a two tableviews in the same view controller. I have created a UIView in a xib and connected a outlet to that view controller. I need to show that view in those two tableviews as a

How can I set the size of a UIView init with storyboard?

I am currently using iOS 6.0. I have a custom UIView that needs to have a certain size. If I programmatically init the view and add it it's fine. However, I can't find a place where I can set the size of the view in the storyboard. Setting its size i

Drag a UIView from one UIScrollView to another

I have two UIScrollViews on my screen and I need to be able to drag a UIView from one scrollview to the other. At the moment, I have a UILongGestureRecognizer on the UIView that I want to move, such that when the user starts dragging it, I make the v

How to clear the contents of the subview before drawing

i use two blocks to draw some buttons on my subview dynamically. One calculates frames for Portrait mode and the other does for Landscape. It works well but when i rotate, it writes over the old ones. Hence, some of my buttons come twice. Here is my

Switch from UIView to UIView in another class

Here is a small problem I am having. I am not too good at programmatically changing views, but this is what I have: //(.h) #import <UIKit/UIKit.h> #import "Detail.h" @interface List : UIViewController <UITableViewDelegate, UITableViewDa

Where do you programmatically program UILabels in a UIView?

where do you programmatically set text for UILabels in a UIView? I tried in the init method and this doesn't work. It doesn't set the text. I've put the code in the parent controller that uses the UIView within it, but to me it would make more sense

UIView alpha = 0 causes spillover on the view below

So I created a glass pane or a custom UIView to handle touches. This glass pane sits on top of other views such as dummy UIButtons. When I set the alpha to be 0, the touches actually get intercepted by the views underneath the glass view. This is wro

Load XIB into a UIView

I have a UIView that is not covering the entire screen of an iPhone... about 200 pixels by 300 pixels. I'm trying to load a xib into this view, but it seems to have an issue. The code works, but the UIView takes over everything at fullscreen... not a

UIView simple drawRect is not called

I can't figure out what the problem is here. I have a very simple UIViewController with a very simple viewDidLoad method: -(void)viewDidLoad { NSLog(@"making game view"); GameView *v = [[GameView alloc] initWithFrame:CGRectMake(0,0,320,460)]; [s

IOS View controller shifts after rotation

I am working on an iOS application. My app delegate loads my view controller onto the window and displays it correctly, except for one caveat: the views on my view controller are not down far enough on the Y-axis and the status bar clips my top view.