ios개발/프로젝트 17

<watchOS> WKInterfaceController : watchOs에서는 뷰컨트롤러 대신 컨트롤러가 있다....?

와치 개발중에 스토리 보드를 이용하는데, 기존과 다르게 뷰컨트롤러 관련 클래스랑 메소드들이 없어서, 찾아보니 워치는 다른걸 사용한다. WKInterfaceController An interface controller serves the same purpose as a UIViewController object in a UIKit app, except that it does not manage any actual views. It runs in your WatchKit extension and remotely manages the behavior associated with an interface controller in your Watch app’s storyboard file. You subclass ..

<ios프로젝트2> GCD - Dispatch Queue 사용해 보자.

[https://magi82.github.io/gcd-01/] 이게 깔금한거 같다. DispatchQueue GCD를 사용하기전에 먼저 알아야 할 클래스가 있습니다. 바로 DispatchQueue라는 클래스인데요. 실제로 해야할 Task를 담아두면 선택된 스레드에서 실행을 해주는 역할을 합니다. DispatchQueue는 2가지로 종류로 나눌수 있습니다. Serial Dispatch Queue와 Concurrent Dispatch Queue입니다. Serial Dispatch Queue Serial Queue는 등록된 작업을 한번에 하나씩 차례대로 처리 합니다. 처리중인 작업이 완료되면 다음 작업을 처리합니다. Concurrent Dispatch Queue Concurrent Queue는 등록된 작업을 ..

<ios프로젝트2>뷰컨 참조해 보기, UIStoryBoard , LayoutSubView

class nDetailVC: UIViewController { var nview = DetailImgView() //MARK: - Model , 해당 클래스 스태틱 인스턴스로 옮기자. //var GalleryDetailInstance = GalleryDetail() override func viewDidLoad() { super.viewDidLoad() print("in viewDidLoad \(self)") in viewDidLoad public class DetailHttpElement{ //MARK: - 여기서 프로퍼티 옵저버 사용이 가능한가? 예제랑 조금 다른게, 여기 값들은 한개의 라벨에서만 사용되지 않을 수도 있긴하다. 용도가 다양할수도. var href = "" var productTitl..

<ios프로젝트2> Customizing Collection View Layouts

이걸 시도해 보려 한다. [https://developer.apple.com/documentation/uikit/uicollectionview/customizing_collection_view_layouts] 일단 엄청 길다. 결론부터 말하면, 너무 길어서 이해가 힘들어 일단 보류 했다. Overview To lay out UICollectionView cells in a simple grid, you can use UICollectionViewFlowLayout directly. For more flexibility, you can subclass UICollectionViewLayout to create advanced layouts. uicollectionView 셀들을 간단한 그리드로 표현하려면,..

<ios프로젝트2> prepare vs 메모리에 직접 저장(객체)

prepare는 한 뷰컨트롤러에서 다른 뷰컨으로 넘겨주는건데, 음 이게 한 객체에서 다른 객체로 넘겨주는 개념인거 같은데 그럼 한 뷰컨에서 다른 모델에 저장했다가 다른 뷰컨에서 저장한 모델 값을 가져오는거랑 결과는 같고, 원리도 같은건가?? Instance Method prepare(for:sender:) Notifies the view controller that a segue is about to be performed. 음 근데 문서를 읽어보니, 디폴트는 미리 준비하는 목적이 아니라 어쨋든 해당 새그가 일어나기 전에 호출되는 개념이다. Discussion The default implementation of this method does nothing. Subclasses override this ..

<ios 프로젝트2> UICollectionView by Code

[https://itnext.io/programmatic-custom-collectionview-cell-subclass-in-swift-5-xcode-10-291f8d41fdb1] 그냥 이대로 하면 된다. 한가지 몰라서 실수 한 부분은 cv.register(UICollectionViewcell.self , forCellWithReuseIdentifier: "cell") 콜렉션 뷰에 셀을 등록 안하면 func collectionView( _ collectionView : UICollectionView, cellForItemAt indexPath : IndexPath) -> UICollectionViewCell{ let cell = collectionView.dequeueReusableCell(withRe..

<ios 프로젝트2> 2. UICollectionView의 사용, About Views, layouts

1. uicollectionView vs uiCollectionReusableView 둘이 뭐가 다르지,, uicollectionview도 리유저블 하게 사용할 수 있는거 아니였나..? [https://stackoverflow.com/questions/44268014/what-is-the-difference-between-uicollectionviewcell-and-uicollectionreusableview] 아닌 뉘앙스로 말하는데 잘 모르겠다. UICollectionViewCell [https://developer.apple.com/documentation/uikit/uicollectionview] A single data item when that item is within the collectio..

<스위프트 프로젝트> alamofire와 데이터 파싱 (downcasting)

DowCasting DispatchQueue.global(qos: .userInteractive).async(group: group, execute: { [unowned self] in Alamofire.request(weatherURL).responseJSON(completionHandler: { (response) in guard response.result.isSuccess else { group.leave() fatalError("❌ Error, Not Receive Data From Dark SKY Server.") } switch response.response?.statusCode { case .none : print("❌ Error, Not Receive Data From Dark SKY ..