{"id":16551343,"url":"https://github.com/nicoelayda/uikitlivepreview","last_synced_at":"2025-10-28T18:31:31.272Z","repository":{"id":56924958,"uuid":"362514544","full_name":"nicoelayda/UIKitLivePreview","owner":"nicoelayda","description":"Xcode live previews for UIKit.","archived":false,"fork":false,"pushed_at":"2022-02-23T19:44:24.000Z","size":53,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T17:11:13.261Z","etag":null,"topics":["ios","live-preview","preview","swift","swiftui","uikit","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nicoelayda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-28T15:15:11.000Z","updated_at":"2024-05-27T15:57:12.000Z","dependencies_parsed_at":"2022-08-21T05:20:37.722Z","dependency_job_id":null,"html_url":"https://github.com/nicoelayda/UIKitLivePreview","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicoelayda%2FUIKitLivePreview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicoelayda%2FUIKitLivePreview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicoelayda%2FUIKitLivePreview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicoelayda%2FUIKitLivePreview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicoelayda","download_url":"https://codeload.github.com/nicoelayda/UIKitLivePreview/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238700303,"owners_count":19515900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","live-preview","preview","swift","swiftui","uikit","xcode"],"created_at":"2024-10-11T19:37:02.851Z","updated_at":"2025-10-28T18:31:30.888Z","avatar_url":"https://github.com/nicoelayda.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UIKitLivePreview\n\nEnables SwiftUI live previews for UIKit views and view controllers.\n\n![uikitlivepreview720](https://user-images.githubusercontent.com/4868132/116438635-377b3100-a881-11eb-9a6c-34698b524848.gif)\n\n## Requirements\n\n- macOS Catalina or later\n- Xcode 12 or later\n- iOS Deployment Target 12.0 or later\n\n## Installation\n\n### Swift Package Manager (Recommended)\n\nIn Xcode 13 or later, select **File \u003e Add Packages...** \n\nIn Xcode 12, select **File \u003e Swift Packages \u003e Add Package Dependency...**\n\nAdd `https://github.com/nicoelayda/UIKitLivePreview.git` as the package repository URL.\n\n**or**\n\nIf you have an existing `Package.swift` file, add `UIKitLivePreview` package to your target's dependencies.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/nicoelayda/UIKitLivePreview.git\", .upToNextMajor(from: \"1.3.1\"))\n]\n```\n\n### Carthage\n\n1. Add `UIKitLivePreview` to your `Cartfile`.\n\n    ```\n    github \"nicoelayda/UIKitLivePreview\" ~\u003e 1.3.1\n    ```\n\n2. Run `carthage update --use-xcframeworks`\n3. Drag `UIKitLivePreview.xcframework` in `Carthage/Build` into your application target's **Frameworks, Libraries and Embedded Content**.\n\n### Cocoapods\n\n1. Add `UIKitLivePreview` to your `Podfile`.\n\n    ```ruby\n    pod 'UIKitLivePreview', '~\u003e 1.3.1'\n    ```\n\n2. Run `pod install`\n\n### Manual Install\n\nCopy the contents of [`Sources/UIKitLivePreview`](https://github.com/nicoelayda/UIKitLivePreview/tree/main/Sources/UIKitLivePreview) to your project.\n\nA prebuilt [XCFramework binary](https://github.com/nicoelayda/UIKitLivePreview/releases/latest) is also available\n\n## Usage\n1. Import `UIKitLivePreview` in your view or view controller.\n2. In the same Swift file, define a new struct conforming to `PreviewProvider`.\n3. Inside the `previews` property:\n    - Initialise your UIKit view or view controller.\n    - Call `preview()` on it to create a wrapped SwiftUI `View` instance.\n    - Return the preview instance.\n4. Optionally, you may chain `ViewModifier`s to customise the preview. See example below.\n    \n#### Example\n    \n```swift\n\nfinal class MyViewController: UIViewController { /* ... */ }\n\n#if DEBUG \u0026\u0026 canImport(SwiftUI)\nimport SwiftUI\n\n@available(iOS 13.0, *)\nstruct MyViewController_Preview: PreviewProvider {\n    static var previews: some View {\n        MyViewController()\n            .preview()\n            .device(.iPhone11)\n            .landscape()\n    }\n}\n#endif\n```\n\n**NOTE:** If your project is targeting iOS 12, it is recommended to wrap the `PreviewProvider` struct in a `#if canImport(SwiftUI)` directive and add the `@available(iOS 13.0, *)` attribute to it.\n\nCheck out [**UIKitLivePreview-Examples**](https://github.com/nicoelayda/UIKitLivePreview-Examples) for a sample project.\n\n## License\n\nMIT. See [LICENSE](https://github.com/nicoelayda/UIKitLivePreview/blob/main/LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicoelayda%2Fuikitlivepreview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicoelayda%2Fuikitlivepreview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicoelayda%2Fuikitlivepreview/lists"}