Xcode5 ( 3.5" screen to 4 inch ) - iphone

Recently I had upgraded to Xcode 5 and opened a project that had been created in Xcode 4.6.1. All the images and buttons had moved around so I went back and re-arranged everything. Now a new problem has occurred, when I switch from the 4" simulator to 3.5 inch images get cut off, buttons and toolbars move around as well. I been searching for an answer for days and Im new to stackoverflow so I hope I have follow all rules and my question in the correct section.
Few notes on the project:
Using Autolayout, Size - Inferred, Orientation - Inferred
Opens in: Default 5.0, Project Deployment Target 7.0, View as: iOS 7.0 and Later

It sounds like you do not have any constraints on your objects. You will need to add them in order for autolayout to work the way you want.
If you are not wanting to add constraints programmatically than you can simply add them to objects in IB.
Click the object you want to add constraints to:
Editor -> Resolve Autolayout Issues -> Add Missing Constraints.
That will give you a good place to start with and you can further adjust the constraints from there.

Related

autocorrectType is not working on iOS 13 using swift

I know this is quiet simple and straight forward to disable autocorrection on iPhone and it worlds pretty much fine, but until now. Surprisingly, suggestion bar appear for text field even I have disabled it from storyboard and even programmatically.
self.textField.autocorrectionType = .no
Done that in sotoryboard as well.
But it does appear on iOS 13, not on previous versions and simulator.
There are many answers already for this one but none is working on iOS 13 so no need to mark the question as duplicate.
Cheers!
If you are using a Storyboard you can disable autocorrection on the attributes inspector (the down arrow icon) under the Text input traits. See the image below for details.

Xcode Storyboard not updating custom class Designables

I have had many problems after closing Xcode which one of them is that Xcode Storyboard is not updating Custom Class Designables anymore and do not show the content. For example I use "SkyFloatingLabelTextField" which worked perfeclty before so I can't blame the library. Is there some way so I can force it to update it?
What I mean illustration:
As you can see, in the first picture I have assigned the custom class and there is actually textField inside my viewController which for some reason doesn't show up anymore in Storyboard but works on real device or simulator.
So can I force it somehow?
I tried removing the class and all runtime values, clean, build close Xcode but nothing is working.
Huhh... Enabling "Automatically refresh views" did the trick. For some reason it was turned off in my case. If you do not know what I mean, then it is the setting in Editor -> Automatically refresh views

How to reuse UIControl from iPhone xib to iPad xib

I am converting my application into Universal, So I have created iPad xib with ~ipad.xib extension. Now I want to use all the old UIControls used in iPhone.xib in iPad.xib without recreating and connecting, Is there any way to reuse it? I have checked in one SO question he mentioned copied and used it in iPad. How to do it?
First take back up of your application.GO to your app target section and right click there u will get three option like Duplicate, Delete, Project Editor Help....Now Select Duplicate it will show alert like below image. Now select "Duplicate and Transition to iPad".Xcode will generate all xib's for iPad with connections.Copy all xibs of iPad to original application.
just select all controls make copy & paste in new .Xib .

How To Port an iPhone Application to the iPad (Storyboard)

I just finished my iPhone app and I want to make it Universal. I've read a few posts already but they're a bit old (2010 or so).
What I got:
Simple iPhone app, recently created (iOS 5 - Storyboard), with three screens.
My app represents a table with three cards that you can flip touching them. The user can input (on the second screen) text to be displayed on the cards.
When I created the project I checked "Universal" so I have two Storyboards. After that nothing else I did had to do with iPad (except for a line on my "contact support" email option where I used UIModalPresentationPageSheet).
What I'd like to accomplish:
Same app on the iPad: my application is so straightforward I don't have any use for split views or details. I just want the same objects and layout but with bigger and better graphics (table, cards, etc).
I like it because it'd make a great introduction-level migration.
I have no idea where to start. When I run the iPad simulator a white screen comes up and that's it.
Well this is done.
As with almost everything, this is pretty easy once you know what to do.
I'd say that for those cases like mine, where the UI doesn't change in more than sizes or (x,y) coordinates the process could be summarized like this:
Replicate every UI element on the iPad Storyboard (copy and paste will do) and adjust position and size as you see fit
Re-wire everything again. Every button, segue (you'll have to add the segue name again too), etc.
Verify within your code every place where your UI is affected (e.g. x,y coordinates), identify whether the app is running on an iPhone or iPad, and divide your code accordingly
If you have any localization on the application you'll have to update the new UI elements on the iPad Storyboard
Select the target for testing on the simulator and try it out
In order to identify in which device the app is running you can use the following:
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
//I'm running on the iPad
} else {
//I'm running on the iPhone
}
And that's it. Again, in a simple case like mine the reuse of code is absolute (100%), the new code you'll have to add is minimum (basically IF statements where needed), and the UI elements duplication is as easy as copy and paste.
I hope this is useful to someone else and if you have recommendations to improve this they're more than welcomed.
Open the Storyboard file in finder,Copy your iPhone-Storyboard and rename it Main-iPad.storyboard
Inside xCode, right click on the storyboard -> “open as” -> “Source Code”
Search for targetRuntime="iOS.CocoaTouch"and make it targetRuntime="iOS.CocoaTouch.iPad"
Now save everything and reopen Xcode -> the iPad-Storyboard contains the same as the iPhone-file but everyting could be disarranged you have to arrange it by your self.
Finally to get the iPad format also change the code in the MainStoryboard_iPad.storyboard from: to
Then go to your "StroryBoardEx-Info.plist" file,search for "Main nib file base name (iPad)" and make it "Main-iPad.storyboard"
If you just want to reuse your iphone storyboard, just go to your project settings. In TARGETS tab Info, there are rows 'Main storyboard file base name' and 'Main storyboard file base name (iPad)'. Just edit the iPad one to have the same value as the other. In my case I had to edit it as 'Main storyboard file base name (iPad)' with value 'MainStoryboard_iPhone'.

XCode 4.2 and SDK 4.3 have Custom button font issue?

I'm using custom button (label button). Works fine on SDK 5.0 but when I simulate to SDK 4.3 it gives me bigger font. Does anyone know what would be the issue is?
Yes, fonts have changed beetween SDK4.3 and SDK5. SDK4.3 default fonts where bolder/bigger that the one set by default in SDK5. What is the reason of this... I don't know. You should set yourself the wanted font instead of using the default system one to have a similar rendering in both case.