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 ์ „๋ถ€ ๋นŒ๋“œ ๊ฐ€๋Šฅํ•จ