SwiftUI
-
Swift/SwiftUI os 버전별 분기SwiftUI 2023. 7. 17. 20:47
Swift - 기존 코드에서 os 버전별로 분기치는 방법 if #available(iOS 16.4, *) { // iOS 버전이 16.4 이상인 경우 해당 로직 처리 } else { // iOS 버전이 16.4 미만인 경우 해당 로직 처리 } SwiftUI ViewModifier 로 os 버전별 분기치는 방법 1번 방법 : if ViewModifier 와 함께 사용하는 방법 //ios 16.4인지 아닌지 판단하는 변수 extension Bool { static var iOS16_4: Bool { guard #available(iOS 16.4, *) else { return false } return true } } // 사용 예시 // Bool을 extension 하여 가독성을 올린다. CustomVie..
-
Framework not found FBLPromises (Swift Package Manager) 이슈SwiftUI 2023. 5. 2. 11:30
지금껏 개발하면서 처음 마주한 이슈로 기록용으로 남긴다. (아마 원인은 cocoapods 에서 spm 으로 옮기면서 생긴 이슈같음) https://stackoverflow.com/questions/71495510/framework-not-found-fblpromises-swift-package-manager Framework not found FBLPromises (Swift Package Manager) I've seen this problem listed elsewhere, but it always seems to be linked to a Cocoapods installation of Firebase. My problem is the opposite - trying to upgrade from po..
-
Handling User Input 예제 정리SwiftUI/Document 예제 2020. 12. 19. 10:00
In the Landmarks app, a user can flag their favorite places, and filter the list to show just their favorites. To create this feature, you’ll start by adding a switch to the list so users can focus on just their favorites, and then you’ll add a star-shaped button that a user taps to flag a landmark as a favorite. Download the starter project and follow along with this tutorial, or open the finis..
-
Building Lists and Navigation 예제 정리SwiftUI/Document 예제 2020. 12. 18. 10:00
이전에 만든 Landmarks 앱에서 랜드마크 리스트와 각각의 위치를 보여주는 디테일 뷰를 추가해 볼 것이다. 각 랜드마크의 정보를 보여주는 뷰를 만들고 랜드마크를 보여주는 detail view를 볼 수 있는 scroll 가능한 리스트를 동적으로 만들어 볼 것이다. UI를 위해, 사이즈가 다른 device 들을 다수의 preview로 볼 것이다. 지금 보니 애플이 다운받으라는 프로젝트를 다운받아도 쓸건 이미지 밖에 없는 것 같다. 완성하면 나중에 지워도 될 것 같다, *참고 예제 : developer.apple.com/tutorials/swiftui/building-lists-and-navigation 위 예제를 보면서 진행해주세요 :) Section 1 Create a Landmark Model In ..
-
Offset과 Padding의 차이SwiftUI 2020. 12. 17. 10:00
Offset 정의 /// Offset this view by the specified horizontal and vertical distances. /// /// Use `offset(x:y:)` to to shift the displayed contents by the amount /// specified in the `x` and `y` parameters. /// /// The original dimensions of the view aren't changed by offsetting the /// contents; in the example below the gray border drawn by this view /// surrounds the original position of the text..
-
Introducing Swift UI 예제 정리SwiftUI/Document 예제 2020. 12. 16. 10:00
SwiftUI is a modern way to declare user interfaces for any Apple platform. Create beautiful, dynamic apps faster than ever before. 해석 : 스유는 애플 플랫폼을 위해 UI를 선언하는 현대적인 방법이다. 아름답고, 전래없이 빠른 동적 앱들을 창조해보세요. 생각 : 흠.. 역시 애플. 아름다움을 강조하는 구만. 근데 스유의 어떤게 아름다운진 모르겠다만 ㅋㅋ *애플 예제를 보면서 참고해주세요 :)* - 예제 링크 : developer.apple.com/tutorials/swiftui/creating-and-combining-views Creating and Combining Views This tutoria..
-
App Structure and Behavior 해석SwiftUI/Essential 2020. 12. 15. 10:00
App Structure and Behavior Define the entry point and top-level organization of your app. 앱의 진입점과 최상위 구조를 정의하라 Overview Declare your app by creating a structure that conforms to the App protocol and add one or more scenes to it. You can use built-in scenes, like WindowGroup, or you can compose custom scenes that conform to the Scene protocol. Scenes contain the view hierarchies that define the u..
-
SwiftUI란? - Document 해석 및 정리SwiftUI/Essential 2020. 12. 14. 22:02
SwiftUI - Framework Declare the user interface and behavior for your app on every platform. 모든 platform에서 당신의 앱의 UI와 행동을 선언하라. Overview SwiftUI provides views, controls, and layout structures for declaring your app’s user interface. The framework provides event handlers for delivering taps, gestures, and other types of input to your app, and tools to manage the flow of data from your app’s model..