Mac Cocoa |
Author |
Message |
delovski
Joined: 14 Jun 2006 Posts: 3522 Location: Zagreb
|
Posted: Wed Jan 14, 2009 9:41 pm Post subject: Views & View Controllers |
|
|
iphonedevbook.com - Tab Bar with Switch Views
"I've created a TabBar project with three views. I want the SwitchViews to be
one of my views. I've managed to incorporate a button in the switch views
project instead of the toolbar, very easy. I've incorporated two other different
views in the project as views 2 and 3 but can't seem to incorporate the Switch-
Views as view 1." |
|
Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 3522 Location: Zagreb
|
Posted: Sat Jan 24, 2009 4:03 pm Post subject: |
|
|
iphonedevbook - Using a method in a different file. Obj-C Question
"It's a lot simpler to use one of apple's root controllers. Navigation bar, tab
bar and so on. But this is for when you do not want any visible controller to
remain on the screen." |
|
Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 3522 Location: Zagreb
|
Posted: Mon Apr 06, 2009 10:01 pm Post subject: |
|
|
Matt Gallagher - Recreating UITableViewController to increase code reuse
"I'll show you what UITableViewController does by recreating its functionality
on top of UIViewController and show you why doing this can provide a richer
base controller class that you can use throughout your iPhone application." |
|
Back to top |
|
 |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 2634 Location: Europe
|
Posted: Wed Sep 23, 2009 6:13 pm Post subject: |
|
|
so - Get Position of UIView within entire UIWindow
"I need to determine the position of the UIView in the entire 320x480 co-
ordinate system. For example, if the UIView is in a UITableViewCell it's
position within the window could change dramatically irregardless of the
superview." |
|
Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 3522 Location: Zagreb
|
Posted: Sun Jul 04, 2010 3:15 am Post subject: |
|
|
iphonedevsdk.com - Put something behind a translucent status bar?
"I am trying to more or less re-create the built-in Photos app functionality
as part of my app. What I am stuck on right at this moment is getting a full
screen image to show up behind a translucent status bar." |
|
Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 3522 Location: Zagreb
|
Posted: Thu Oct 14, 2010 7:41 pm Post subject: |
|
|
MF - Popping Modal UINavigationController
"I have a separate XIB file containing a UINavigationController. It's in a se-
parate XIB so it can be loaded and displayed from a number of different po-
ints in my app." |
|
Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 3522 Location: Zagreb
|
|
Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 3522 Location: Zagreb
|
|
Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 3522 Location: Zagreb
|
|
Back to top |
|
 |
XNote Kapetan
Joined: 16 Jun 2006 Posts: 520
|
Posted: Thu Dec 20, 2012 1:34 pm Post subject: |
|
|
so - Presenting a view controller in Universal app, iOS 4 to 6
Code: | @interface MasterViewController ()
@property (nonatomic, retain) UIPopoverController *popoverController;
- (void)presentViewController:(UIViewController *)viewController origin:(id)origin;
@end
@implementation MasterViewController
@synthesize popoverController;
- (void)presentViewController:(UIViewController *)viewController origin:(id)origin {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
if ([self respondsToSelector:@selector(presentViewController:animated:completion:)]) {
[self presentViewController:viewController animated:NO completion:nil];//iOS 5 and above
} else {
[self presentModalViewController:viewController animated:NO]; //iOS 4, deprecated in iOS 6
}
} else {
if (!self.popoverController) {
self.popoverController = [[[UIPopoverController alloc] initWithContentViewController:viewController] autorelease];
} else {
[self.popoverController setContentViewController:viewController];
}
if(![self.popoverController isPopoverVisible]) {
if([origin isKindOfClass:[UIBarButtonItem class]]) {
[self.popoverController presentPopoverFromBarButtonItem:origin
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
} else {
[self.popoverController presentPopoverFromRect:CGRectZero inView:origin permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
}
}
}
@end |
|
|
Back to top |
|
 |
XNote Kapetan
Joined: 16 Jun 2006 Posts: 520
|
Posted: Thu Dec 20, 2012 2:05 pm Post subject: |
|
|
so - dismissViewControllerAnimated:completion: method not working
"This should work for you. Check it."
Code: | MainController *mainController = (MainController *)self.parentViewController;
[self dismissViewControllerAnimated:YES completion:^{
[mainController aMethod];
}]; |
|
|
Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 3522 Location: Zagreb
|
Posted: Wed Jul 30, 2014 5:37 pm Post subject: |
|
|
github.com - RKSwipeBetweenViewControllers
"Swipe between ViewControllers like in the Spotify or Twitter app with an
interactive Segmented Control in the Navigation Bar"
 |
|
Back to top |
|
 |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 2634 Location: Europe
|
|
Back to top |
|
 |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 2634 Location: Europe
|
|
Back to top |
|
 |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 2634 Location: Europe
|
Posted: Mon Mar 02, 2020 9:48 pm Post subject: |
|
|
sarun - How to create a new Xcode project without Storyboard
"When you create a new project in Xcode, the default boilerplate includes the
Main.storyboard. If you are going with a no storyboard approach and want to
set everything up in code, there are a few steps you need to do." |
|
Back to top |
|
 |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 2634 Location: Europe
|
Posted: Fri Jul 03, 2020 8:29 pm Post subject: |
|
|
so - Set UIViewController view property to custom UIView class without storyboard
"You can override this method in order to create your views manually. If you
choose to do so, assign the root view of your view hierarchy to the view
property. The views you create should be unique instances and should not be
shared with any other view controller object. Your custom implementation of
this method should not call super." |
|
Back to top |
|
 |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 2634 Location: Europe
|
Posted: Sat Jul 04, 2020 3:49 pm Post subject: |
|
|
so - Get to UIViewController from UIView?
Code: | @interface UIView (FindUIViewController)
- (UIViewController *) firstAvailableUIViewController;
- (id) traverseResponderChainForUIViewController;
@end
@implementation UIView (FindUIViewController)
- (UIViewController *) firstAvailableUIViewController {
// convenience function for casting and to "mask" the recursive function
return (UIViewController *)[self traverseResponderChainForUIViewController];
}
- (id) traverseResponderChainForUIViewController {
id nextResponder = [self nextResponder];
if ([nextResponder isKindOfClass:[UIViewController class]]) {
return nextResponder;
} else if ([nextResponder isKindOfClass:[UIView class]]) {
return [nextResponder traverseResponderChainForUIViewController];
} else {
return nil;
}
}
@end |
|
|
Back to top |
|
 |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 2634 Location: Europe
|
Posted: Fri Jun 17, 2022 9:06 am Post subject: |
|
|
r - Any good sources to learn how to build UI programmatically?
"The Let's Build That App site has tons of good tutorial videos. He usually
follows a programmatic approach. He has paid courses, but quite a few of
the standalone videos are free. The paid courses are quite good." |
|
Back to top |
|
 |
|