Igor Delovski Board Forum Index Igor Delovski Board
My Own Personal Slashdot!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

iPhone X

 
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Mac Cocoa
Mac Cocoa  
Author Message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3136
Location: Europe

PostPosted: Fri Sep 15, 2017 7:54 pm    Post subject: iPhone X Reply with quote

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
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Tue Sep 26, 2017 3:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3136
Location: Europe

PostPosted: Mon Nov 06, 2017 8:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3136
Location: Europe

PostPosted: Fri Dec 01, 2017 11:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3136
Location: Europe

PostPosted: Wed Feb 07, 2018 12:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3136
Location: Europe

PostPosted: Sun Jul 22, 2018 4:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3136
Location: Europe

PostPosted: Sun Jul 22, 2018 4:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Mac Cocoa All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Delovski.hr
Powered by php-B.B. © 2001, 2005 php-B.B. Group