uikit

Advantages, problems, examples of adding another UIWindow to an iOS app?

安稳与你 提交于 2020-01-18 05:46:33
问题 Recently I've been wondering about the fact that that an iOS app only has one UIWindow . It does not seem to be an issue to create another UIWindow and place it on screen. My question is kind of vague, but I'm interested in: What could I potentially achieve with a second UIWindow that cannot be done in other ways? What can go wrong when using multiple UIWindow instances? I have seen that people use a 2nd UIWindow to display popover like views on iPhone. Is this a good way of doing it? Why?

How do I set up a proxy object in the main application NIB?

非 Y 不嫁゛ 提交于 2020-01-17 03:27:05
问题 I would like to set up a proxy object in the application NIB file. The problem is that the NIB file is the main application NIB that gets loaded automatically by the application and therefore I cannot set up the UINibProxiedObjectsKey dictionary as described in the documentation. Is there a way to set up a proxy object in the main application NIB? Or can I tap into the code that loads the main application NIB? 回答1: My main problem was that I was trying to use Interface Builder as a dependency

UIKit Dynamics in a Custom Segue

こ雲淡風輕ζ 提交于 2020-01-16 19:14:27
问题 I'm trying to make a view fall as a custom segue transition, but when the perform method is called in the UIStoryboardSegue implementation, it does not fall. I have tried moving the view to be dropped into the source's view to see if it does anything, but it doesn't. -(void)perform { UIViewController *src = (UIViewController *)self.sourceViewController; UIViewController *dest = (UIViewController *)self.destinationViewController; UIView *viewdrop = [dest.view snapshotViewAfterScreenUpdates:YES

Applying just the scale component of a CGAffineTransform to a UIView

徘徊边缘 提交于 2020-01-16 07:12:10
问题 I have a UIView to which various scale and rotation CGAffineTransforms have been applied, in response to touch screen gestures. When a scale operation completes, I want to adjust the bounds of the view to the new size, then have view to re-draw itself at a scale of 1.0, while keeping all other components of the transform the same. To adjust the bounds of the view, I'm using: self.myView.bounds = CGRectApplyAffineTransform(self.myView.bounds, self.myView.transform); To "undo" the scale

Applying just the scale component of a CGAffineTransform to a UIView

戏子无情 提交于 2020-01-16 07:11:20
问题 I have a UIView to which various scale and rotation CGAffineTransforms have been applied, in response to touch screen gestures. When a scale operation completes, I want to adjust the bounds of the view to the new size, then have view to re-draw itself at a scale of 1.0, while keeping all other components of the transform the same. To adjust the bounds of the view, I'm using: self.myView.bounds = CGRectApplyAffineTransform(self.myView.bounds, self.myView.transform); To "undo" the scale

UIButton event 'Touch Up Inside' not working. 'Touch Down' works fine

我是研究僧i 提交于 2020-01-15 05:33:26
问题 I've got a UIButton in a UIView, which is in a UIViewController that I've allocated and inited from a .xib file. When hooking an IBAction up to the 'Touch Down' event of a UIButton it triggers correctly. But if I hook it up to the 'Touch Up Inside' event it doesn't respond. Other events don't work either. 'Touch Drag Enter', 'Touch Drag Exit', 'Touch Up Outside' etc. Only Touch Down. Does anyone have any idea why this might be? Rich 回答1: First, I can absolutely, positively guarantee you that

iOS Development: What are some reasons that [[self navigationController] viewControllers]; would return nil?

拈花ヽ惹草 提交于 2020-01-15 04:58:45
问题 the following statement is returning an nil... NSArray *viewControllersInNavStack = [[self navigationController] viewControllers]; and this statement is being called in a view controller that's about four levels deep in the navigation stack, so I don't understand how or why it would ever return nil. Your thoughts? Thanks so much for your wisdom! 回答1: Doesn't sound like its your issue, but docs say "Only returns a navigation controller if the view controller is in its stack. This property is

iOS Change alpha of UIButton when there is an EventTouchDown

别等时光非礼了梦想. 提交于 2020-01-15 03:34:10
问题 I would like the change the alpha of a UIButton when there is an EventTouchDown on it. I'm was hoping there was a way to do it similar to the below code: [self.myButton setImage:<#(UIImage *)#> forState:UIControlEventTouchDown]; Is there a way to do something like this with "setAlpha"? Thanks you!!! 回答1: You could subclass your UIButton (not recommended, but since all you'd end up doing is overriding setHighlighted or setSelected it shouldn't be much of an issue here) and override the tapping

Shadow UIview and clipsToBounds

£可爱£侵袭症+ 提交于 2020-01-14 11:25:42
问题 I would like to set the shadow to my container UIView. I use this code to make it: - (id)initWithCoder:(NSCoder*)aDecoder { self = [super initWithCoder:aDecoder]; if (self) { //-> drop shadow [self.layer setShadowColor:[UIColor blackColor].CGColor]; [self.layer setShadowOpacity:0.6]; [self.layer setShadowRadius:2.0]; [self.layer setShadowOffset:CGSizeMake(2.0, 2.0)]; } return self; } This works well. But, when I use _containerView.clipsToBounds = YES; on this container UIView, I can't see my

The use of UIApplicationDidFinishLaunchingNotification

风格不统一 提交于 2020-01-13 10:24:10
问题 Posted immediately after the application finishes launching. That's what the Apple docs state. But I don't see how an object could receive this notification. It would have to add itself as an observer, but the earliest it could do this is in the application:didFinishLaunchingWithOptions: method. At that moment, the notification has already been posted. I don't see any use for this notification, or am I overlooking something? 回答1: Assume you have some object of class "MyController" in the root