last day (14 days later) » 

4:28 PM
0
A: my app on iPhone 6,6s,6p and 6sp is stretched after upgrade to iOS9

SobermanProvide LaunchScreen.xib file for your Xcode instead of launch images. This way you will eliminate your problem for sure. After creation of this xib file, navigate to your project file and to Target -> Info -> App Icons and Launch Images -> Launch Screen File -> select your created LaunchScreen.x...

 
Should't we use Storyboards instead of xibs these days? Just curious.
 
Depends. I sometimes create xibs when I need only UIView object. No point of creating the whole storyboard file for it. And keeping everything in one single storyboard is a bad idea as well in case you don't work on the project alone - just wait till you get those conflicts...
And btw, you can't create just the UIView object in storyboard...
 
Good point. I don't use them both, except for the LaunchScreen. Everything is done only with code. :)
 
well, not using AutoLayout makes things run faster, that's for sure, in case you don't use it. But other than that - it just saves time. But, in case you know how to use it wisely :)
 
My point is that you have no control of how your objects are constructed behind the scenes, thats why I prefer to build everything from inside my code. ;) Anyways, I'm not the person who asked the question here, I just was curios about XIBs.
 
4:28 PM
Well, depends on what exactly you want to controll
 
There was something like this all the time oO How did you created that chat?
 
I can't think of a good example right now, of what I would like to control during object creation of, say, UIButton
lol
there's this button there in the comments
was there when I wanted to reply
plus I have enough XP to create chat rooms
you have it too actually
 
Din't know about the chat at all.
 
neat thing
 
Anyways let's say you want to construct your ViewController with all its Views from Storyboard.
 
4:31 PM
yep
 
You never know that will be constructed, how it will be build, which not necessary properties will be set and at which time that will happen.
 
actually you can
just override awakeFromNib method in your ViewController
 
It's like you don't know what happens inside loadView of the UIViewController.
 
it will be called as soon as storyboard instantiates you ViewController
it is very rarely when you need to override loadView method
 
It says it will build an UIView for you, but it also could set some properties of it you don't want to be set. Just a simple example.
 
4:33 PM
like which ones?
can't think of any
 
I don't have some good examples. I only wanted you to catch the point I mean. Constructing an object by your self is much safer than let some function (or Storyboards in our case) build it, because you can't be sure what will happen under the hood.
 
i disagree
you are in a complete control
just ran over the properties that are being set in Stroyboard - you can see all of them
other properties - they will be default
with same values as you create it programmatically
I am working with storyboards and Xib files almost for two years now. I am also creating a lot of them programmatically. I have never encountered an issue of some properties being silently set to some non-default values
don't be scared to use xibs and storyboards, they will save you a lot of boilerplate code
 
Hmm maybe you're right and it's just the way I was reached to code back then. :D Btw. if you're creating some of the layout constraints from inside the code and also using the new iOS 9 syntax you might be interested in my little syntax wrapper here: github.com/DevAndArtist/NSLayoutConstraint-Extension
 
already promoting your stuff, huh? :D
 
A little. ^^
 
4:43 PM
I am still writing apps for clients in Objective-C
so, sorry mate, no use for me at the moment
 
Ahh ok, I switched to Swift. And no problem.
 
besides, when I have complex design with a lot of constraints - I remove all of them completely and go 'AutoLayout'-free
speeds up the app incredibly
 
Depends on what you want to build.
 
i mean no autolayout just for that complex scree, don't get me wrong
trust me, I have experienced how slow it might be :)
AutoLayout is a complex thing
very complex
so many equations under the hood
you save a lot of CPU power without them
complex UIs stop lagging
 
Complex but really powerful.
 
4:46 PM
true
but not suatable for complex UI
did you know that Papers app uses no autoLayout at all?
for the very reason I have described - too many calculations for complex UI
 
Papers?
 
Facebook Papers app
 
It's not available here in my Appstore but I do know about it, just wasn't sure if it was the papers App i had on my mind
Does the app support landscape on any device?
 
no
not that I am aware of
 
so this also will ease up the layout calculation
 
4:50 PM
a lot
but
trust me
even with no landscape mode - autolayout is not you panacea
 
maybe they switched over to their own layout mechanism called Components
 
nope
all with code
they had no compnents back in the time
 
so the Facebook app, but in the devtalk about the components they talked about the main Facebook app. I assume they switched over to it by the time, but I might be wrong here.
 
facebook app and Paper app are two completely different apps bruh
 
I know but both are developed by facebook
 
4:57 PM
but the point is, that sometimes it is best not to use it at all
true
but I do 99% of the time :(
:)
 
not using AutoLayout?
 
nah, 99% of the time I do use it
 
btw. does opening the chatroom cost any credits ? ... yeah, I switched over to AutoLayout because I was kinda disappointed about the apps at my workplace were build, so much ugly code and weird calculations.
 
yeah, nice choice
nope, not costimng anything
free
 
ok great
what is your opinion about size classes?
 
5:15 PM
neat thing
makes you being able to adapt to different screen sizes with minimal code
you?
 
i like them, but I thing there should be a few more of them.
 
maybe, haven't used them for 100% yet
 
I mean on the iPad both classes are regular, so you might need a custom mechanism if you want to differ your layout by the device orientation
 
well, you have a neat macros that tells you which orientation you have, no?
 
next thing is the new splitscreen on an iPad, if you'll go by the screen size you'll end up with vertical layout.
I build a custom mechanism for the rootviewcontroller and children view controller so they will be notified when my app may use horizontal or vertical layout
it was interesting to find that [self.view layoutIfNeeded] will call traitCollectionDidChange under the hood
even if willTransitionWithTransitionCoordinator was not fired at all
 
5:33 PM
hm
interesting
 

last day (14 days later) »