Removing unnecessary titles and icons at the top of iOS Simulators - ios

I'm new to iOS and my question will seem little bit confusing to you but it make sense I'm working on a project where I have to use a custom NavigationBar while I was working on that I saw these icons and title at the top
and as the requirement of my project I need a Bar like this
and you can see the word slightly overriding my button (the red bar is not a part of my button). so my question is, is there any way we can remove these buttons from our simulator because I noticed when i click on the back button sometimes it'll not work due the fact I was clicking on the that "Carrier" title. Soo is there anyone who knows something about it and please don't suggest me to resize the button or something like that it's not my point if you understand.

As Nobody have Answered it yet let me tell you the answer that I find working:-
To hide status bar in iOS7 you need 2 lines of code
in application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions write
[[UIApplication sharedApplication] setStatusBarHidden:YES];
in info.plist add this
View-Controller Based Status Bar Appearance = NO

Related

Master-Detail-Application change the "Back" Button iPad(Objective-C)

To show you my issue I created a new Master-Detail-Application in Xcode 10.1 and with the deployment target iOS 12.1 (I tried other iOS versions too)
I want to change the text of the "Back" Button in the top left corner at the Detail View, which is by default "Master".
I have come up with the following code, which I wrote in the -(void)viewDidLoad method in DetailViewController.m .
self.navigationItem.leftBarButtonItem.title = NSLocalizedString(#"Menu", #"Menu");
[self.navigationItem setLeftBarButtonItem:self.navigationItem.leftBarButton animated:YES];
When I know start the App, the Button is how it should be, but as soon as I press it, it changes back to "Master" and stays that way.
I have tried to put this code anywhere you can imagine, but nothing worked.
I tried several other methods I found online and nothing else worked for me.
EDIT:
I just found out, it only affects iPad, when I test it on iPhone, the button displays correctly.

Objective-C code for iOS QuickAction

I've an iOS app with a Tab Bar Controller and five ViewControllers written in Objective-C.
Now, I declared QuickActions in Info.plist file.
But cause I'm new at coding and there are only Swift codes to find in the internet I don't know how to do it.
Can anyone provide the code snippet for AppDelegate.m in Objective-C to open an specific ViewController?
Thank you for help!
Greetings,
David.
if your application is launched fresh...then its launchOptions will contain shortcut item pressed which you can access using key UIApplicationLaunchOptionsShortcutItemKey.Find the type UIApplicationShortcutItem to perform action accordingly.
If your application is in background and your user selected shortcut item
- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void(^)(BOOL succeeded))completionHandler
will be called.As you can see you get pressed shortcut item directly you can get type of pressed item and perform action accordingly.Hope it helps :)
Edit
You can check out https://github.com/dakeshi/3D_Touch_HomeQuickAction this will help you alot only difference is he has used dynamic quick actions.And one note about quick actions (both dynamic and static) is that unless you launch your app at least once quick options won't show up on 3D touch.

UITabBar has NO background color after transition

I've got this app. When it launches, it asks the user to log in. When you log in, it uses UIViewAnimationOptionTransitionFlipFromRight to transition to a new UIViewController. The issue is, the UITabBar on the view controller has no background color. It is completely transparent. The UITabBar icons are there and it is otherwise fully functional, except that it has no background color.
This happened after I updated for iOS 7.1. Has anyone see this happen? If so, do you know how to fix it?
Apparently this issue has a "fix". This is obviously a bug on Apple's side.
Here is it
This is a bug in iOS 7.1 on Apples's side. The work around is to toggle the translucency on and off. Not the best fix, but it works. We will have to wait until Apple fixes this in 7.2 or later.
tabBar.translucent = NO;
tabBar.translucent = YES;
As answered in this question

Disabling the Personal hotspot notification

Enabling personal hot spot pushing down the view and related subviews pushing down. How to disable the personal hotspot notification programmatically? (how can i restrict iPhone status bar to original size even when HOT SPOT is on?)
I found rather late that the Personal Hotspot doesn't just add 20points to the status bar, it messes up views that rely on drop points in an animator with gravity. I added code that checks the status bar height before laying out the views. If it's not 20, then it's probably the hotspot, so I just hide the status bar. Not an ideal solution, but works so far.
- (BOOL)prefersStatusBarHidden {
if ([UIApplication sharedApplication].statusBarFrame.size.height == 20) {
NSLog(#"Status bar is 20 so returning NO for hidden");
return NO;
}
NSLog(#"Status bar is not 20 so returning YES for hidden");
return YES;
}
If you disable statusbar then automatically disable Hotspot bar.
The Apple documentation is not very descriptive of the status bar, esp. the 2nd row that appears when you are using hotspot, map, calls, etc.
Even if more than one is running, there is only one additional row.
I don't know how 3rd party apps appear, but the questioner asked specifically about Personal Hotspot which is a system service.
I doubt the display can be controlled by anybody, except when the user turns the service off.
You probably have to do it the "hard" way". You should hide the main status bar, then draw your own custom status bar.
BTW, Apple says not to do this:
Use the system-provided status bar. People expect the status bar to be consistent systemwide. Don’t replace it with a custom status bar.
https://developer.apple.com/ios/human-interface-guidelines/bars/status-bars/
It's an alternative way but it works.
First include a new key in your project's Info.plist:
Status bar is initially hidden: YES
And then, in your AppDelegate, at didFinishLaunchingWithOptions you can set:
[application setStatusBarHidden:NO];
This will hide the hotspot bar during launch screen and then show it again when the app launches.

UIImageView in appDelegate displayed in simulator, but not on device

I've got a weird problem: I want to have a icon in one of my apps that stays above every other Controller/View. My idea was to create a UIImageView in the main XIB-File (the project started pre-iOS-5) above the UITabBarController that handles the Content Views.
I added the ImageView in the didFinishLaunchingWithOptions of the appDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
// Add the icon view that shows current working status (working/pause)
[self.window addSubview:self.statusIcon];
...
}
Initially the ImageView is hidden, it will only be shown when a button is pressed. Then i will assign the UIImage and unhide it:
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[delegate.statusIcon setImage:statusIconWorking];
[delegate.statusIcon setHidden:NO];
This works in the simulator, but not on a device (tested it on iPod touch 4. generation and iPad 3. generation (retina)).
Could someone please tell my it doesn't work that way? It's not a image problem (it exists on the device, and i tried to load other Image in the ImageView that are displayed correctly in other parts of the app).
Thank you.
I observed the same problem once and did not find a solution here. Some hints were helpful though, so I finally nailed it down. It happened only once and I noticed it some days after an xcode version change. However, I never found out what the solution was and if that was really caused somehow by the version migration.
The reason was that the image file was not part of the bundle. Check your boundle settings. Do so for every target that you may have.
My observation was: The image file was included in the bundle on the simulator. It did not only remain there from one version to the next. It was re-installed even when I removed the app from the simulator. I did so either removing it using the simulator's gui as if removing from a real device and I manually removed it from the simulator's file system - just to be sure. In any case the file was re-installed.
On the device it was different. Create an IPA or APP bundle as if you would do for beta testers of for submitting to the store. Have a look into it. (Changing the file name to .zip and unzipping may help to look into the bundle.) I bet that you will not find your image there.
Solution: doublecheck your project settings and ensure that all resources are properly included for all targets respectively.

Resources