iPad Apps for Mac - kirseia/study GitHub Wiki
iPad Apps for Mac
AppKit Apps(Mac) vs UIKit Apps(iOS)
- ๊ฑฐ์ ๋๊ฐ์. Twin ๊ตฌ์กฐ
์ด๋ค ์์ดํจ๋ ์ฑ์ Mac์์ ๋๋ฆด ๊ฒ์ธ๊ฐ
- ๋ชจ๋ฐ์ผ ํผ์ณ (Arkit๋ NFC ๋ฑ๋ฑ?)์ด ํฌํจ๋ ์ฑ์ ๊ณ ๋ ค ๋์ ์๋
- iPhone only ์ฑ๋ ๋น์ฐํ ์๋
๋ชฉํ
- ์ฝ๊ฒ ์์ํ ์ ์์
- ํ๋์ ํ๋ก์ ํธ, ํ๋์ ์์ค, ํ๋์ ํ๊ฒ
- iPad App on the inside, Mac app on the outside
๋ฌด๋ฃ๋ก ์์ ํ ์ ์๋ ๊ฒ(?) - iPad์ฑ์ ๋งฅ์์ ๋๋ฆด ๋
- ๋ฉ๋ด ๋ฐ๋ฅผ ๋ฐ๋ก ์ฌ์ฉ ํ ์ ์์
- ๋ฉ๋ด ๋ฐ๋ฅผ ํตํด 'iPad'์์ ์คํ ๊ฐ๋ฅ
- Dark mode
- scroll bars
- settings - iPad setting ์์ ๋ณด๋ ๊ฒ์ Mac preference ์์ ๋ณผ ์ ์๊ฒ ๋จ
- ํฐ์น๋ฐ
- Open and save panels
- Control ์์ญ
- Text ํฌ๊ธฐ๋ ์๋์ผ๋ก scale ๋จ
- Copy and paste
- drag and drop
- ํ๋ฆฐํธ
- ๋ฉํฐ ์๋์ฐ
- application ์๋ช ์ฃผ๊ธฐ
API ๋ค๋ฅธ ์
- ๊ฑฐ์ ๋์ผ ํจ
- ๋ถ๊ฐ๋ฅ ํ ๊ฒ
- deprecated frameworks ๋ ์ฌ์ฉ ์๋จ - OpenGLES, GLKit, AssetsLibrary ๋ฑ๋ฑ
- iOS์์๋ง ๋๋ framework - ClassKit, Healthkit, HomeKit
- hardware ํน์ ํ framework - ARKit, CarPlay, VisionKit
- ๋ค๋ฅธ framework - Core Location, Core Motion, Core Telephony, Core NFC, Core Bluetooth, AVFoudation, AudioToolbox
๋ถ๊ธฐ์ฒ๋ฆฌ
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0)
์ด ์๋์ฒ๋ผ ๋ฐ๋์์
@available(macOS 10.10, UIKitForMac 13.0) @unavailable(iOS, watchOS, tvOS)
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0) @unavailable(UIKitForMac)
๋ฐ๋ผ์ ์๋์ฒ๋ผ #if ์ด์ฉํด์ ๋ถ๊ธฐ์ฒ๋ฆฌํด์ค์ผ ํจ
```swift
#if !targetEnvironment(UIKitForMac)
// iOS-specific code
let recognizer = MyGestureRecognizer(target: self, action: #selector(myAction(recognizer:)))
recognizer.delegate = self
view.addGestureRecognizer(recognizer)
#endif
#if !TARGET_OS_UIKITFORMAC
// iOS-specific code
id recognizer = [[MyGestureRecognizer alloc] initWithTarget:self action:@selector(myAction:)];
recognizer.delegate = self;
[view addGestureRecognizer:recognizer];
#endif
Taking iPad Apps for Mac to the Next Level
๋ ์ ๋ง๋ค๊ธฐ
- ๋ค์ํ ํ๋ฉด ํฌ๊ธฐ๋ฅผ ์ง์ํ๊ธฐ
- ํค๋ณด๋ ์ง์์ ๊ตฌํํ๊ธฐ - UIKeyCommand ๋ฅผ ์ฌ์ฉํ๊ธฐ
- ๋๋๊ทธ ์ค ๋๋กญ ์ง์ - UIKit์ ์๋ UIDragInteraction, UIDropInteraction ์ ๊ตฌํํ๊ธฐ
- ์ต์ API ์ฌ์ฉํ๊ธฐ - Not OpenGL ES, use Metal
- iOS13 ํผ์ณ ์ง์ํ๊ธฐ - ๋ฉํฐ ์๋์ฐ, ๋คํฌ ๋ชจ๋, ์ฌ๋ณผ ์ด๋ฏธ์ง ๋ฑ
- UIHoverGestureRecognizer ๊ตฌํํ๊ธฐ (๋ง์ฐ์ค ์ค๋ฒ ํ์ ๋ ๋์ ์ฒ๋ฆฌ)
- ํฐ์น๋ฐ ์ฒ๋ฆฌํ๊ธฐ
๋ค๋น๊ฒ์ด์
- sidebar๋ฅผ ์ฌ์ฉ
- tab bars ์ฌ์ฉ์ ๋ค์ ์๊ฐ
- ๋งฅ ํด๋ฐ๋ฅผ ์ฌ์ฉํ๊ธฐ
๋ ์ด์์
- ํฐ ํ๋ฉด์์ ์ ๋ณด์ด๊ฒ ์ ๊ตฌํํ๊ธฐ
- layout flexible ํด์ผ ํจ
ํ์ดํฌ๊ทธ๋ํผ
- ๋งฅ์์ 13ํฌ์ธํธ, Pad์์๋ 17ํฌ์ธํธ
- UIKit ์ 77% ๋ก ์ค์ผ์ผ ๋จ
์ ๋ ฅ
- iPad๋ ๋ฉํฐํฐ์น์ ์ต์ ํ๋์ด์์
- ๋งฅ์ ํค๋ณด๋๊ฐ ํญ์ ์์, ํธ๋ํจ๋์ ๋ง์ฐ์ค๊ฐ ์์
- ์ ๊ทผ์ฑ๋ ๊ณ ๋ คํด์ผ ํจ
์ฑ ์๋ช ์ฃผ๊ธฐ
- iOS App ๊ณผ macOS App ์๋ช ์ฃผ๊ธฐ๊ฐ ๋ค๋ฆ
๋ฐฐํฌ
- xcode์ mac ๋น๋๋ ์ถ๊ฐ ๋จ
- ํ๋์ provisioning profile ๋ก iOS, iPadOS, macOS ์ ๋ถ ๋น๋ ๊ฐ๋ฅํจ