Apple Messages & Color Contrast

Well, color me this! I was griping to myself last night about just how gosh dang hard it is to read text messages in Apple Messages. You know, not the blue bubbles that you get when messaging other iPhone users. Those are iMessages.

What I’m talking about are the green bubbles you get when messaging non-iPhone users. Those are standard text messages.

iMessage (left) and text message (right)

Let’s run the green through a contrast checker to see what’s up.

Permalink

Oomph. Now I know why I always reach for my reading glasses when a text message pops up. That 2.17:1 ratio is below the WCAG 2.0 AA requirement of 4.5:1 and wayyyyy below the AAA level of 7:1.

Turns out I’m not the only one griping. A quick search turned up a little trove of news and blog posts — some as recent as last week — about the readability of those green text message bubbles.

I’m no conspiracy theorist and like to give benefit to doubt. Buuuuut…

Apple Messages in iOS 6 (left) and iOS 7 (right)
Credit: Phoceis
  • iOS 6: Dark text on a green gradient background
  • iOS 7: White text on a #5AB539 background (or something close to it)
  • iOS 16.1: White text on a #6ACC46 background

That second one is based on old screenshots and might not be the most accurate color value. But still, the transition from iOS 6 with dark text to what we have today in iOS 16.1 shows a clear regression. I’d like think the design team checked the updated values against WCAG guidelines, sure, but at least against their own Human Interface Guidelines.

The current green background (#65C466) appears to be different than what is listed as the green “system color” (#30D158, converted from a RGB of 48, 209, 88) in the iOS palette listed in the guidelines. But it’s not like that gets us any closer to a passing WCAG AA or AAA rating.

Permalink

🤷‍♂️


Apple Messages & Color Contrast originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

6 iOS and Swift Projects to Learn iOS App Development

Hello folks, if you are learning iOS App development and looking for some project ideas to understand the concepts better and apply your existing knowledge, you have come to the right place. 

Earlier, I have shared the best iOS and Swift courses, and today, I will talk about five cool projects you can do to learn iOS app development and master several key concepts like UI, Core ML, Speech to text, and other APIs. 

Safari 15: New UI, Theme Colors, and… a CSS-Tricks Cameo!

There’s a 33-minute video (and resources) over on apple.com covering the upcoming Safari changes we saw in the WWDC keynote this year in much more detail. Look who’s got a little cameo in there:

Perhaps the most noticeable thing there in Safari 15 on iOS is URL bar at the bottom! Dave was speculating in our little Discord watch party that this probably fixes the weird issues with 100vh stuff on iOS. But I really just don’t know, we’ll have to see when it comes out and we can play with it. I’d guess the expectation is that, in order for us to do our own fixed-bottom-UI stuff, we’d be doing:

.bottom-nav { 
  position: fixed; /* maybe sticky is better if part of overall page layout? */
  bottom: 100vh; /* fallback? */
  bottom: calc(100vh - env(safe-area-inset-bottom)); /* new thing */
}

On desktop, the most noticeable visual feature is probably the theme-color meta tags.

This isn’t even a brand new Apple-only thing. This is the same <meta> tag that Chrome’s Android app has used since 2014, so you might already be sporting it on your own site. The addition is that it supports media queries.

<meta name="theme-color" 
      content="#ecd96f" 
      media="(prefers-color-scheme: light)">
<meta name="theme-color" 
      content="#0b3e05" 
      media="(prefers-color-scheme: dark)">

It’s great to see Safari get aspect-ratio and the new fancy color systems like lab() and lch() as well. Top-level await in JavaScript is great as it makes patterns like conditional imports easier.

I don’t think all this would satisfy Alex. We didn’t exactly get alternative browser engines on iOS or significant PWA enhancements (both of which would be really great to see). But I applaud it all—it’s good stuff. While I do think Google generally takes privacy more seriously than what general internet chatter would have to believe, it’s notable to compare each company’s newly-released features. If you’ll forgive a bit of cherry-picking, Google is working on FLoC, a technology very specifically designed to help targeted advertising. Apple is working on Private Relay, a technology very specifically to making web browsing untrackable.


The post Safari 15: New UI, Theme Colors, and… a CSS-Tricks Cameo! appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

iOS App Security Cheatsheet

In a previous article, we saw an example of how an attacker could analyze an app in the search of vulnerabilities, and perform an XSS attack through the misuse of a web view. Hopefully after reading that, if you weren’t aware of how easy it is to at least get into some source code of an app published on the AppStore, now you are and you might be wondering if there are other ways to hack an iOS application and how to prevent it.

In this article, I will try to make a compilation of stuff to check if you want to ensure your app handles the most common security flaws. We will cover the following topics: system APIs, Data Handling, Data transportation, and App Hardening.

Debugging iOS Safari

How do I debug Safari on iOS?

These are my general steps, starting with not even using iOS Safari.

1. Is this just a small-screen problem?

Lemme just use the device mode in Chrome quick.

Note that this does a smidge more than just display your site in a smaller area: it sends the correct User Agent String and Client Hints for that device.

2. Does it seem actually specific to Safari? Lemme check Desktop Safari first since that’s just a few clicks away.

Now you’re actually using Safari, which is way closer to iOS Safari than desktop Chrome is.

3. Problem not showing here? Then the problem is actually unique to iOS Safari. Try emulation.

I happen to have a Mac, so I can have XCode installed and thus have an iOS simulator that is pretty easy to pop open. And if you can run the iOS simulator, that means you can run desktop Safari as well, and thus even have access to DevTools that can reach into the simulator.

4. I’ve seen real-device-only bugs. Sometimes you need a real device.

If you have a Mac, doing this is pretty similar to what we just did. You have to have the phone plugged in via USB (no wireless charging connection or whatever) and then you’ll see the device in that same Develop menu. Select the real device (which must have Safari open on some website) and you’ll get a DevTools instance of that website.

5. No Mac? Use an online emulator.

I have heard of people running over to Best Buy or an Apple Store to quick debug something on a display machine. But that’s — uhhhh — not super practical. You can use something like CrossBrowserTesting to do this right on the web.

They even jack Chrome DevTools in there somehow. I just did a little testing and I found the Chrome DevTools a little janky to use (a giant left panel renders, the click-to-select element feature didn’t work, and I kept losing WebSocket connection). But hey, it’s cool that it’s possible.

6. No Mac and still need to test on a real device?

I didn’t think this was really possible, but then I saw Inspect. (This is not an ad, I’m just shouting this out as a very cool tool.) With Inspect, I can plug in my real iOS device via USB and get a Chrome DevTools instance for it.

Remember to change this iOS Safari (Advanced) Setting to make it work with Inspect (and probably the “normal” Safari debugging described above).

I’m running Inspect on my Mac there. I guess the only real reason I would do that is to use Chrome DevTools instead of Safari DevTools (which, fair play, I might). And it looks like there will be more reasons soon enough. For example, it will bundle React, Vue, and Angular DevTools so you even have those for on-device testing, plus Wi-Fi testing, meaning you don’t have to plug in at all.

But I feel like the real clutch feature here is that it runs on Windows. So now there is a really clear answer for web developers on Windows who need to test on a real iOS device.


The post Debugging iOS Safari appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

16px or Larger Text Prevents iOS Form Zoom

This was a great “Today I Learned” for me from Josh W. Comeau. If the font-size of an <input> is 16px or larger, Safari on iOS will focus into the input normally. But as soon as the font-size is 15px or less, the viewport will zoom into that input. Presumably, because it considers that type too small and wants you to see what you are doing. So it zooms in to help you. Accessibility. If you don’t want that, make the font big enough.

Here’s Josh’s exact Pen if you want to have a play yourself.

In general, I’d say I like this feature. It helps people see what they are doing and discourages super-tiny font sizes. What is a slight bummer — and I really don’t blame anyone here — is that not all typefaces are created equal in terms of readability at different sizes. For example, here’s San Francisco versus Caveat at 16px.

San Francisco on the left, Cavet on the right. Caveat looks visually much smaller even though the font-size is the same.

You can view that example in Debug Mode to see for yourself and change the font size to see what does and doesn’t zoom.


The post 16px or Larger Text Prevents iOS Form Zoom appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

Connecting Expo Built Mobile Apps to Localhost Deployed APIs

When connecting an iOS or Android app built using Expo to your data endpoints hosted on your localhost, you might hit a couple of roadblocks in terms of connectivity. This article covers ways to fix that issue in the subsections below.

SAME Wi-Fi

Talking about the obvious, you need to make sure you are connected to the same Wi-Fi on both the device and your machine, so that 192.168 means the same thing.

How to Make Icons for Applications on Android and iOS

Make stunning, attention-grabbing icons for your mobile applications.

Icons for Android and iOS are graphics for a mobile application required to display the program on the screen of a mobile device. Almost all objects in the interface of mobile platforms are displayed using icons, as they simplify identification and visual search.

A quick glance at a graphic element is often enough to make a decision about downloading an application. Ideally, the icon should explain the purpose of the program without having to read the description.

Tips for Data Persistence in iOS With Swift

One of the most crucial features of apps today is data persistence. If you don’t quite understand why, a fundamental definition of the concept will help. Data persistence refers to the mechanism of storage of data, irrelevant of its type, to a disk. The point is to make sure that this data can then be retrieved later whenever users open the app and allow them to continue from precisely where they left off. 

This guide, however, will focus on techniques and methods exclusively in the context of storing data locally in an iOS app. And before we get started with that, it is essential to understand that local storage in iOS apps is not the default setting. Instead, what happens is that all the constants and variables assigned in Swift are stored in memory by default. 

Why Mobile Needs Its Own DevOps

Developing for mobile has unique challenges, and therefore, it requires an approach that differs from traditional DevOps methods. Here are four of the main reasons why developing for mobile is different — compared to developing web applications — and some of the ways in which incorporating a unique set of practices, collectively referred to as Mobile DevOps, can help app companies tackle these specific challenges.

Mobile Apps Require Faster Iterations

When it comes to mobile app iterations, speed is everything: there is a strong correlation between the frequency of updates and the rating in the app stores. The more agile the approach, the faster and more iterative the code release process becomes. 

Build Chatbots with Dialogflow – Step By Step Guidelines

Dialogflow from Google (earlier known as API.ai) is a great platform for developing chatbots for multiple platforms. Earlier when Dialogflow was known as API.ai, they had an Android and iOS client library to integrate chatbot into mobile apps. But after merging into Google, the existing library is not getting updated; rather we are seeing Dialogflow added to Google’s Cloud platform and a new Java-based client API is being developed.

In this article, I will show you how you can integrate a chatbot developed in Dialogflow using the new Java client API. 

The Step-by-Step Process of Mobile App Development

According to the Survey Reports, there are almost 1.84 million apps available on iOS and on Google Play there are 2.9 million apps. However, the usage of mobile applications is increasing constantly. Due to the high demand for Android and iOS applications, it leads mobile app development services to high competition.

In the digital world, mobile app developers don’t only have to focus on the backend and frontend coding process and functionalities. Apart from this, to launch successful apps, they have to be creative and require knowledge about market trends and guidelines.

iOS 13 Design Guidelines, Templates, and Downloads

Erik Kennedy wrote up a bunch of design advice for designing for the iPhone. Like Apple's Human Interface Guidelines, only illustrated and readable, says Erik.

This is mostly for native iOS apps kinda stuff, but it makes me wonder how much of this is expected when doing a mobile Progressive Web App. On one hand, this kind of stuff looks fun to try to build on the web, and it would be kinda cool to make your web app feel super native. On the other hand, doesn't that make it extra awkward for Android and other non-iOS platforms?

A few other thoughts:

  • How much of this stuff do you get "for free" with SwiftUI?
  • As I understand it, when you build apps with Flutter / Material, the native apps that get built do some smart cross-platform stuff, mimicking how that platform does things.

Erik also does very in-depth design training with enrollment only opening once in a while, the next opens March 4th.

Direct Link to ArticlePermalink

The post iOS 13 Design Guidelines, Templates, and Downloads appeared first on CSS-Tricks.

iOS Developers’ Alert: Apple Unleashes the Power of Progressive Web Apps

Technology giant Apple Inc. is in an endeavor to extend support for web apps in its default browser Safari. Experts are already working to introduce support for Service Workers in this browser. This move from Apple is a clear hint that they are moving ahead with the growing concept of Progressive Web Apps (PWA). 

How will the extended support of Service Workers in Safari browser impact enterprises? Are mobile apps being challenged by progressive web apps for the iOS platform? How does the future of iOS app development for the App Store look after this move by Apple? Let’s dig deeper to understand the intention behind this massive move by Apple.

The Best Xcode Tips and Tricks Every Developer Should Know

Continuous Integration (CI), is a development practice requiring developers to integrate code into a shared repository multiple times a day. Each and every check-in is then verified by an automated build which allows teams to detect problems early. This practice of integrating regularly helps detects errors quickly, and locate them easily.

In Xcode, you ensure that you are continuously automating and streamlining the building, analyzing, testing, and archiving of your Mac and iOS apps, in order to ensure that they are always in a releasable state.