How to write UIView to a projector? - objective-c

How do I write a UIView to a projector that can work off the iPhone?

You can use the UIScreen class to present content on an external display (including a projector). You'll need to create a new UIWindow. Here is some relevant sample code from Apple as well.

Related

Integrating EgoImageLoader by using UIImageView instead of egoimageview

I'm new to objective c. Want to implement EGOIMAGELOADER for my customised tableview, but as i have mutliple uiimageview and that has to be in their respective fix position so i have created uitablecell in xib and placed the uiimageview in the alignment i want it.
I went through the ego example but there the egoimageview is being used to create imageview dynamically.
I want to use my uiimageview with egoimageloader and not use egoimageview as i have fixed placement of imageviews in uitablecell.
I want to implement lazyloading and caching of images using egoimageview.
Can anyone help me with example or sample code to achieve above requirement.
As i'm using normal code for loading images in uiimageview for tablecell. So don't know what to include for code snippet.

iOS, objective C - good example of application without XIB with MVC

I'm totally new with iOS development, having background with ActionScript3 with MVC. I love to code and I don't want to use any NIB/XIB files for my project (I've been told I will learn Objective C faster then) and I'm looking for a good example of iOS application using MVC pattern from scratch.
I know there is a bunch of good examples (like Good example code for Objective-C) but I haven't found any with no NIB/XIB usage.
Any ideas?
I'll try to give you some guidelines.
First of all. If you need some good tutorials, I suggest you to watch Brad Larson or Standford courses on iTunes. They are absolutely fantastic.
Then, if you want to create your MVC from scratch, I suggest you to take a look at UIViewController class reference.
Each UIViewController is a controller as the name suggest. The model could be contained in the controller itself (e.g. a NSArray) or provided by an "external" entity (e.g. Core Data). Each controller has a view property. The view is that element that is presented on screen. Usually could be provided by XIB or Storyboard files. As the apple documentation suggested:
If you cannot define your views in a storyboard or a nib file,
override the loadView method to manually instantiate a view hierarchy
and assign it to the view property.
In other words, within your view controller class you need to add this:
- (void)loadView
{
UIView* myCustomView = ...
self.view = myCustomView;
}
By means of this, you have a full control of the view presented on screen. This means that you need to provide the sizing and the positioning of the elements of your view. While a similar arrangement can be done by means of an user friendly interface in XIB or Storyboard files, you need to do it manually in other cases (e.g. deal with frame, autosizing mask, etc.).
Hope it helps.

Replicate apple's mailComposer UITextView?

I want to replicate apple's default mail composer for my app. I don't want to use default mailcomposer because I'm having a lot of other things. Does anybody have solution for this? Main thing I want to implement is attachments. Like when you select a image and tap on email on photos app. The image preview is displayed in body part and also we can enter text and the cursor also detects the image when you press return or back. That functionality I want to achieve.
The TTMessageComposer in the Three20 library is a good start... it doesn't have attachment support but will save you time on the standard layout.
Three20 library
Check out this source code https://github.com/thermogl/TITokenFieldView, it's a custom UI class for token fields but there is a exact replica of Apple's mail UITextView. Heres a snippet from the source. All you have to do is create an normal text view and add it to your view.
// Creating the text view
messageView = [[UITextView alloc] initWithFrame:yourView.contentView.bounds];
// Adding it as a subview
[yourView.contentView addSubview:messageView];
// Set the frame so it resizes with the view.
[messageView setFrame:yourView.contentView.bounds];

Add additional UIImage to TTPhotoViewController

I am using the Three20 framework to implement a photo viewer. However, I also intend to customize it by doing the following:
1) Add a profile photo on top of each photo displayed and add some text to it (I assume I have to add a subview)
2) Add additional buttons on the side of the photo to allow users to delete or star the photo.
I have looked into the code for TTPhotoViewController but am not sure the place where I can make all these customizations. Do I make the changes to a subclass of photo view? And where exactly in photo view can I do it?
First you have to subclass TTPhotoViewController (see the sample code in TTCatalog). Then make a subclass of TTPhotoView. In this subclass there are a lot of points, where you can add another Image or Label to the PhotoView. I just tested adding a new Label inside the
- (void)showCaption:(NSString*)caption
method and it worked great.
The next step is to override the following method.
- (TTPhotoView*)createPhotoView {
return [[[TTPhotoView alloc] init] autorelease];
}
In this method you can just alloc, init and autrelease your own subclass of TTPhotoView. This way the photo shown in the TTPhotoViewController will be your own custom photo.
I think my answer is a little bit confusing. If you need additional help, just post a comment.

How do I add custom UIButton to nib file in XCode?

I've just begin delving in to the world of iOS development. I am also a newbie to XCode. I've built several little test apps nows using the default UIComponents available by dragging and dropping them from the Objects library on to my .xib file and hooking up outlets and actions just to see how it all works. I wanted to take it to the next step and create my own custom painted button. I have a class named CustomButton that extends UIButton and I can programmatically add it to a view, but I would like to know how to drag and drop it on to a nib file so I can lay it out visually rather than programmatically. I know this is a beginner question but I've searched all night trying to find an example of how to do it with no success. Any help is greatly appreciated.
Drop in a UIView into your nib and set its Custom Class to your UIButton subclass.