Number: 013, Date: 2024-04-01

2024.03.25 ~ 2024.03.31

๐Ÿ“ฑ Xcode Preview Feature


Using the Preview feature in Xcode allows you to display the latest view content without using actual devices or simulators, which is convenient for developing screens through code.

However, in actual projects that involve adding multiple libraries and have long build times, sometimes it is faster to build on a real device. Therefore, I think this feature is mainly convenient for projects with shorter build times.

This feature is commonly used in SwiftUI, and although there is a method for using it in UIKit, it requires adopting a protocol and implementing it, leading to the inconvenience of adding code every time a new project is created.

Starting from iOS 17, you can use Swift Macro functionality to easily utilize this feature in UIKit as well, which I organized on my blog.

๐Ÿ˜… systemLayoutSizeFitting


When the footer of a UITableView changes based on status, the height of the footer must be dynamically adjusted. Therefore, I used the method systemLayoutSizeFitting(_:withHorizontalFittingPriority:verticalFittingPriority:) to return the optimal size and determine the height, but I encountered an issue where the content area was being cut off.

The reason is that while it is possible to calculate the optimal size even when only the targetSize is specified, I set the parameter values for the vertical constraints to obtain a more accurate size.

๐Ÿ”” Notification Service Extension


By default, iOS can receive remote notifications through APNs to display push notifications.

Thus, when sending to APNs, you provide the necessary settings and information in the payload.

I wanted to implement a feature that groups notifications by type and removes previous notifications when a new one arrives. I checked if this could be applied using an extension, but I found that this task can only be done through payload settings when the server delivers data.

Upon learning this, I explored the tasks that can be performed using Service Extension.

In summary, it is responsible for changing the content delivered to the alert (changing text and adding images).

๐Ÿ™‹๐Ÿปโ€โ™‚๏ธ Other Notes


  1. I am organizing all writings, except for blog posts, in my personal Notion. Since my Notion account was created with a Naver email due to student verification, I no longer need to use it. I am in the process of migrating all pages to my Gmail account. Additionally, to manage the pages more conveniently, I utilized Notionโ€™s database feature to create my own templates for organization.
  2. I looked at the Hyundai Card iOS app, which has a card-swiping UI, to explore how it is implemented. Among the related libraries, I found VerticalCardSwiper. I reviewed the code of this library to see how it was implemented.
  3. In finance and card apps, the app screen may get obscured when going to the background, so I looked into how this is implemented. I found that there is a state defined for when the app is brought up in the App Switcher.