Tag: uikit

UIAppearance's “when not contained in”

I am currently spinning a complex web of UIAppearance modifiers*, and have come across a problem. My usage of FlatUIKit’s custom UIBarButton appearance protocol is causing MFMailComposerViewController to complain and stop working. Therefore, instead of using UIAppearance‘s whenContainedIn method to specify classes that cause modification to occur, is there a way to exclude certain classes, […]

How to set iPhone tab bar icon in code?

I am using the same ViewController for several different views. When instantiating the ViewController for a specific view, is there an easy way to specify the tab bar icon via code?

what's called after returning from presentModalViewController / dismissModalViewControllerAnimated:

to show a modal uiview out of my mainView I use: [self presentModalViewController:myController animated:YES]; and in MyController I close that view with: [self dismissModalViewControllerAnimated:YES]; But how can I know in the mainView that the modal was finished (to redraw my table)? Currently I set a local variable to YES in my mainView after starting the […]

CAGradientLayer and scrollViewTexturedBackgroundColor

I’m trying to use CAGradientLayer to fade foreground controls against the background textured view. So in a nutshell, I have a view with the bg color as scrollViewTexturedBackgroundColor. I have a view on top of that, whose contents I’d like to fade at the border into the background view’s color. CAGradientLayer* gradient = [CAGradientLayer layer]; […]

Different StoryBoard for each screen size swift

How do I set Different Storyboards for each possible screen size in Swift? I already have the Objective-C code. Please, no Auto Layout, I don’t need it. But how do I convert it to Swift? I am new to Swift. Here is code for Objective-C: AppDelgate.m file – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override […]

Weird MFMailComposeViewController Crash

Following lines are crashing on iPad. I am using Xcode 4.6.3 (4H1503) with 6.0 as target OS platform. It used to work just fine! if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init]; [self presentViewController:mailViewController animated:YES completion:nil]; } With following exceptions: 2013-09-04 02:30:47.489 MyProject[38633:5b0b] * Assertion failure in NSDictionary *_UIRecordArgumentOfInvocationAtIndex(NSInvocation *, NSUInteger, BOOL)(), /SourceCache/UIKit_Sim/UIKit-2380.17/UIAppearance.m:1118 […]

Always getting the same height using sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode:

The CGSize returned by sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode: contains always the same height. Why is that, and is there a way around this? I want to align a string vertically and it may not be truncated, unless it can’t fit on a single line using the minimum font size. So I try to use this method to get […]

How do I truncate a string within a string in a UILabel?

Say I have The Dark Knight Rises at 7:45pm and I need to fit that into a fixed-width UILabel (for iPhone). How would I make that truncate as “The Dark Knight Ris… at 7:45pm” rather than “The Dark Knight Rises at 7:4…”?

Resizing Images Objective-C

This question already has an answer here: How to resize the image programmatically in objective-c in iphone 8 answers

Modal view controller size with master-detail controller

My app has a split master-detail interface: when the user hits a particular button in the detail side of the screen, I use a UIModalTransitionStyleFlipHorizontal modalTransitionStyle so that I can just present a new controller modally and have it appear as if the details panel has “flipped” to the new interface. While this works fine […]