Key Features
Xcode Preview
UIKit에서도 Preview를 사용할 수 있다.
// UIViewController
class LibraryViewController: UIViewController {
// ...
}
#Preview("Library") {
let controller = LibraryViewController()
controller.displayCuratedContent = true
return controller
}
// UIView
class SlideshowView: UIView {
// ...
}
#Preview("Memories") {
let view = SlideshowView()
view.title = "Memories"
view.subtitle = "Highlights from the past year"
view.images = ...
return view
}
View Controller lifecycle updates
viewIsAppearing 메소드 추가
viewcontroller Lifecycle
Trait system enhancements
Animated symbol images
SFSymbol에 animation지원 추가
imageView.addSymbolEffect(.bounce)
imageView.addSymbolEffect(.variableColor.iterative)
imageView.removeSymbolEffect(ofType: .variableColor)
Empty States
앱이 보여줄 수 있는 컨텐츠가 없는 상황에서 사용가능
예시
empty
var config = UIContentUnavailableConfiguration.empty()
config.image = UIImage(systemName: "star.fill")
config.text = "No Favorites"
config.secondaryText =
"Your favorite translations will appear here."
viewController.contentUnavailableConfiguration = config
loading
var config = UIContentUnavailableConfiguration.loading()
viewController.contentUnavailableConfiguration = config
SwiftUI
let config = UIHostingConfiguration {
VStack {
ProgressView(value: progress)
Text("Downloading file...")
.foregroundStyle(.secondary)
}
}
viewController.contentUnavailableConfiguration = config
업데이트 하기
override func updateContentUnavailableConfiguration(
using state: UIContentUnavailableConfigurationState
) {
var config: UIContentUnavailableConfiguration?
if searchResults.isEmpty {
config = .search()
}
contentUnavailableConfiguration = config
}
// Update search results for query
searchResults = backingStore.results(for: query)
setNeedsUpdateContentUnavailableConfiguration()
Internationalization
Dynamic line-height adjustments
용어
아랍어, 힌디 문자 등에서는 라틴 문자보다 더 많은 세로 공간을 요구한다.
그래서 UILable등의 텍스트 요소들에 가독성을 위해 자동으로 line-height 및 세로 영역을 조정해주는 기능이 추가되었다.
Improved line-breaking and hyphenation
중국어, 독일어, 일본어, 한국어에 대한 line-breaking 개선
어떤 Text Style을 적용했냐에 따라서 다르게 동작
대부분은 자동적으로 동작하나 자세한 정보는 관련 세션 참조
let label = UILabel()
label.text = ~태국어~
label.traitOverrides.typeSettingLanguage = Locale.Language(identifier: "th")
Retrieve UIImages by locale
이미지도 localization이 적용된다.
기본적으로는 디바이스의 언어 설정을 따라간다.
iOS 17부터 특정 locale을 지정할 수 있는 기능 추가
let locale = Locale(languageCode: .japanese)
imageView.image = UIImage(
systemName: "character.textbox",
withConfiguration: UIImage.SymbolConfiguration(locale: locale)
)
Improvements for iPad
총 4종
다만 신규 잉크는 이전 버전에서 로드할 수 없다.
General enhancements
collection view improvements
전체적인 성능 개선
compositionalLayout 기능 추가
spring animation parameters