[iOS] 코드베이스 프로젝트 세팅 / Codebase Project
2024. 12. 30. 20:45ㆍ🍏/Xcode
1. Main.storyboard(Main) 삭제(move trash)
![]() |
![]() |
![]() |
2. Info.plist에서 Storyboard Name 삭제
- 를 눌러 삭제하자
3. UIKit Main Storyboard File Base Name 삭제
Module > TARGETS > Build Settings > filter(story)
delete 키를 눌러 삭제하자
4. SceneDelegate의 willConnectTo 파라미터 함수 수정
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
let window = UIWindow(windowScene: windowScene)
let vc = ViewController()
window.rootViewController = vc
self.window = window
window.makeKeyAndVisible()
}
5. 테스트
아래 코드를 넣어 화면이 제대로 나오는지 Build & Run 해봅시다. (command + r)
import UIKit
final class ViewController: UIViewController {
private let testLabel: UILabel = {
let label = UILabel()
label.text = "초기세팅 테스트"
label.font = .systemFont(ofSize: 32)
return label
}()
override func viewDidLoad() {
super.viewDidLoad()
setUI()
setLayout()
}
private func setUI() {
view.addSubview(testLabel)
view.backgroundColor = .green
}
private func setLayout() {
testLabel.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
testLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor),
testLabel.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 300)
])
}
}
'🍏 > Xcode' 카테고리의 다른 글
[SwiftLint] Xcode에서 프로젝트에 lint 적용하기. (0) | 2025.02.04 |
---|---|
[Xcode Cloud] 토이프로젝트에 CI / CD 적용하기 (1) | 2024.11.11 |
[Xcode / Swift] 빌드 시스템에 대한 이해 / 증분 빌드 / 병렬 처리 / Eager Linking / Incremental (1) | 2024.10.29 |
[Tuist+Fastlane+GithubAction] App 배포 CI/CD 과정 (0) | 2024.04.28 |
[Tuist] Version 4 / config / package / dependencies (0) | 2024.03.29 |