!-- 스터디 https://developer.apple.com/tutorials/swiftui/tutorials

스냅킷 안써도 되어서 좋다. 물론, 스냅킷 좋긴 해도 라이브러리고 최신 기술은
아류들이 자꾸 개선하는 것 보다 한 곳에 통합 관리하는게 좋다.

    // MARK: UISceneSession Lifecycle

    func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
        // Called when a new scene session is being created.
        // Use this method to select a configuration to create the new scene with.
        return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
    }

앱 델리게이트는 요렇

//  UISceneSession.h
//  UIKit
//
//  Copyright © 2019 Apple Inc. All rights reserved.
//

@available(iOS 13.0, *)
open class UISceneConfiguration : NSObject, NSCopying, NSSecureCoding {

쟨 요렇게

UIApplicationSceneManifest

UIApplicationSupportsMultipleScenes

UISceneConfigurations

UIWindowSceneSessionRoleApplication


UISceneConfigurationName
Default Configuration
UISceneDelegateClassName
$(PRODUCT_MODULE_NAME).SceneDelegate






얜 또 이렇게 씬은 또

{
        // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
        // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
        // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).

        // Get the managed object context from the shared persistent container.
        let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext

        // Create the SwiftUI view and set the context as the value for the managedObjectContext environment keyPath.
        // Add `@Environment(\.managedObjectContext)` in the views that will need the context.
        let contentView = ContentView().environment(\.managedObjectContext, context)

        // Use a UIHostingController as window root view controller.
        if let windowScene = scene as? UIWindowScene {
            let window = UIWindow(windowScene: windowScene)
            window.rootViewController = UIHostingController(rootView: contentView)
            self.window = window
            window.makeKeyAndVisible()
        }
    }

이렇게 가는 것을 보며, SiwftUI 최종판은 3D 와 애니매이션이 자연스레 결합된 것이겠구나 라는 생가이 들었다.

NS 이름을 여전히 쓰는 것을 보면, 결국 Objective-C 의 잔재가 남는 다는 거고 3D 영역은 C에서 벗어나기가 상당히

어려운 분야다.


뭐, 앱 연동이 되고 3D 앱이던 게임이던 서버/클라이언트 모델이던 메신저던 webRTC 던...
임베디드 운영체제의 제약 덕에 효율적인 "나눔"이 가능했고 하드웨어가 더 발전하더라도
그 효율성은 그대로 것이 좋다.
쓸대없는 통합보다 카테고리라이즈가 잘 된 앱들이 유기적으로 연결되는 것이 사용성에 더 도움이 된다는 뜻이다.
가령 카카오톡과 가가오 스토리는 앱 자체는 나눠져 있는게 더 편하지 않은가?

내가 생각한 방향성이 틀리지는 않았을테지만 flat UI 도 좀 질려가던 차에 잘되었다는 생각이다.


import Foundation
import UIKit
import _SwiftUIKitOverlayShims


@available(iOS 13.0, *)
open class UIWindowScene : UIScene {

    
    open var screen: UIScreen { get }

    open var interfaceOrientation: UIInterfaceOrientation { get }

    open var coordinateSpace: UICoordinateSpace { get }

    open var traitCollection: UITraitCollection { get }

    
    // Restrictions which the system should use when resizing the scene. This property will be NULL on platforms which don't support scene resize, else a mutable object is returned which the client may customize.
    @available(iOS 13.0, *)
    open var sizeRestrictions: UISceneSizeRestrictions? { get }

    
    // The array of all windows associated with this UIWindowScene
    open var windows: [UIWindow] { get }
}

@available(iOS 13.0, *)
public protocol UIWindowSceneDelegate : UISceneDelegate {

    
    optional var window: UIWindow? { get set }

    
    optional func windowScene(_ windowScene: UIWindowScene, didUpdate previousCoordinateSpace: UICoordinateSpace, interfaceOrientation previousInterfaceOrientation: UIInterfaceOrientation, traitCollection previousTraitCollection: UITraitCollection)

    
    // Called when the user activates your application by selecting a shortcut on the home screen,
    // and the window scene is already connected.
    optional func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void)

    
    // Called after the user indicates they want to accept a CloudKit sharing invitation in your application
    // and the window scene is already connected.
    // You should use the CKShareMetadata object's shareURL and containerIdentifier to schedule a CKAcceptSharesOperation, then start using
    // the resulting CKShare and its associated record(s), which will appear in the CKContainer's shared database in a zone matching that of the record's owner.
    optional func windowScene(_ windowScene: UIWindowScene, userDidAcceptCloudKitShareWith cloudKitShareMetadata: CKShareMetadata)
}
extension UISceneSession.Role {

    
    @available(iOS 13.0, *)
    public static let windowApplication: UISceneSession.Role

    
    // A session role which defines an interface for a non-main external display
    @available(iOS 13.0, *)
    public static let windowExternalDisplay: UISceneSession.Role
}
extension UIWindowScene {

    
    @available(iOS 13.0, *)
    public enum DismissalAnimation : Int {

        
        case standard

        case commit

        case decline
    }
}

@available(iOS 13.0, *)
open class UIWindowSceneDestructionRequestOptions : UISceneDestructionRequestOptions {

    open var windowDismissalAnimation: UIWindowScene.DismissalAnimation
}

@available(iOS 13.0, *)
open class UISceneSizeRestrictions : NSObject {

    
    open var minimumSize: CGSize

    open var maximumSize: CGSize
}

이래나 저래나 신규 과제는 iOS 13+ 로 타게팅을 해야 겠네.



!-- 명기(名器)


- 스트라디바리우스, 과르니에리, 아마티, 스타인웨이앤선스 등 음악의 세계에서는 명기(名器)가 있고 이들만 고집하는 아티스트들이 있다.
개발자도 많은 툴들을 이용하는데 왜 멀티플랫폼만 하라고 할까?


!-- 에러 해결 keyword
[sourceString dataUsingEncoding:NSUTF8StringEncoding];




upload(multipartFormData: { (multipartFormData) in
if let i = image, let imageData = i.jpegData(compressionQuality: 0.5), let name = imageName {
multipartFormData.append(imageData,
withName: name,
fileName: "swift_file\(arc4random_uniform(100)).jpeg",
mimeType: "image/jpeg"
)


NSCameraUsageDescription
카메라를 사용합니다.
NSPhotoLibraryUsageDescription
앨범을 사용합니다.

+ NSPhotoLibraryAddUsageDescription

https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW73


!-- 사진 여러장

https://github.com/hyperoslo/Gallery



'Blog History' 카테고리의 다른 글

개 발 일 지 025  (0) 2019.11.20
개 발 일 지 024  (0) 2019.11.18
개 발 일 지 022  (0) 2019.11.17
개 발 일 지 021  (0) 2019.11.15
개 발 일 지 020  (0) 2019.11.13

+ Recent posts