Mac Cocoa |
Author |
Message |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Fri Sep 15, 2017 7:54 pm Post subject: iPhone X |
|
|
erminesoft.com - How to Design Apps for iPhone X
"A revolutionary combination of a large screen and usability is also possible
thanks to a reinterpreted user interface. In addition to the screen size, the
new iPhone impresses with soft bends of the case and rounded corners of
the display." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue Sep 26, 2017 3:28 pm Post subject: |
|
|
r - How are we supposed to handle the space above table section headers? It's showing through the content.
"I still stand by my solution of not hiding the status bar and using a solid
background color for it. It will solve your problem and look better than the
current implementation. It doesn't bring attention to the notch because it's
just the way your app looks. If your app had a lighter theme I'd still provide
the same answer but just using a white background with the status bar visible." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Mon Nov 06, 2017 8:37 pm Post subject: |
|
|
mf - Designing for the top and botton of the iPhone x?
"You can extend the backgrounds by pinning the background view to the
superview size, then make sure the content doesn't hit the notch by pinning
the content view to the safe area. For example if you have black text on a
red background, pin the red background to the superview, and the text field
to the safe area. It's up to you to decide what is background and what is
content." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Fri Dec 01, 2017 11:38 pm Post subject: |
|
|
rw - Development Tutorial for iPhone X
"If you're new to auto layout, or just need to brush up, check out our tutorial
and video course:
Auto Layout Tutorial in iOS 11: Getting Started: Updated to iOS 11, Xcode 9
and Swift 4, but pre-iPhone X-announcement.
Beginning Auto Layout video course: At the time of writing this tutorial, this
video course was up-to-date for iOS 10, Xcode 8 and Swift 3.
Adaptive Layout Tutorial in iOS 11: Getting Started: Updated to iOS 11, Xcode
9 and Swift 4, but pre-iPhone X-announcement. Create a single layout that
works on all iOS devices, without platform-specific code. Adaptive layout will
also look good on future devices that haven't even been released yet." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Wed Feb 07, 2018 12:43 pm Post subject: |
|
|
https://blog.instabug.com/2018/02/ios-11-developer-features/
iOS 11 is arguably one of the biggest operating system releases in Apple history. Not only did it come packed with tons of updates, but it also included a bunch of new features, as well as APIs, frameworks, and integrations that can help developers build better and more intelligent apps. |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Sun Jul 22, 2018 4:16 pm Post subject: |
|
|
so - Detect if the device is iPhone X
Code: | #define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_IPHONE_4 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 480.0)
#define IS_IPHONE_5 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0)
#define IS_IPHONE_6 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 667.0)
#define IS_IPHONE_6PLUS (IS_IPHONE && [[UIScreen mainScreen] nativeScale] == 3.0f)
#define IS_IPHONE_6_PLUS (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 736.0)
#define IS_IPHONE_X (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 812.0)
#define IS_RETINA ([[UIScreen mainScreen] scale] == 2.0)
#define IS_IPAD_DEVICE [(NSString*)[UIDevice currentDevice].model hasPrefix:@"iPad"]
|
In Landscape mode you need to adjust those numbers. The magic number of iPhoneX in Landscape mode is 375.0
Code: | if([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPhone) {
switch ((int)[[UIScreen mainScreen] nativeBounds].size.height) {
case 1136:
printf("iPhone 5 or 5S or 5C");
break;
case 1334:
printf("iPhone 6/6S/7/8");
break;
case 1920, 2208:
printf("iPhone 6+/6S+/7+/8+");
break;
case 2436:
printf("iPhone X");
break;
default:
printf("unknown");
}
} |
Code: | if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone && UIScreen.mainScreen.nativeBounds.size.height == 2436) {
//iPhone X
} |
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Sun Jul 22, 2018 4:27 pm Post subject: |
|
|
ADF - Safe Area Constraints without AutoLayout?
I also do not use autolayout or storyboards and never plan to unless
absolutely forced to. I grab the safeAreaInsets from the application window
and simply adjust the position of my views in viewWillLayoutSubviews. What
I will probably do in future is just make subclass of UIViewController which
adds a container UIView that adheres to safe area and just align my controls
with respect to the container view."
Code: |
- (void)viewWillLayoutSubviews
{
float bottomSafeAreaInset = 0;
if (@available(iOS 11, *)) {
UIEdgeInsets inset = [[UIApplication sharedApplication] delegate].window.safeAreaInsets;
bottomSafeAreaInset = inset.bottom;
}
[palette setFrame:CGRectMake(0, self.view.frame.size.height-(palette.frame.size.height+bottomSafeAreaInset), self.view.frame.size.width, palette.frame.size.height)];
} |
|
|
Back to top |
|
|
|