[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1099":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":8,"totalLinesOfCode":8,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":8,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":17,"compositeScore":19,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":8,"pushedAt":8,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":15,"starSnapshotCount":15,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},1099,"SnapKit","SnapKit\u002FSnapKit","A Swift Autolayout DSL for iOS & OS X",null,"https:\u002F\u002Fgithub.com\u002FSnapKit\u002FSnapKit","Swift",20338,2048,385,43,0,1,4,12,44.93,false,"main",[23,24,25,26,27,28,29,30,31,32],"auto","autolayout","snapkit","swift","xcode","dsl","cocoapods","constraints","layout","ui","2026-06-12 02:00:23","\u003Cimg src=\"https:\u002F\u002Fsnapkit.github.io\u002FSnapKit\u002Fimages\u002Fbanner.jpg\" alt=\"\" \u002F>\n\nSnapKit is a DSL to make Auto Layout easy on both iOS and OS X.\n\n[![Build Status](https:\u002F\u002Ftravis-ci.org\u002FSnapKit\u002FSnapKit.svg)](https:\u002F\u002Ftravis-ci.org\u002FSnapKit\u002FSnapKit)\n[![Platform](https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fp\u002FSnapKit.svg?style=flat)](https:\u002F\u002Fgithub.com\u002FSnapKit\u002FSnapKit)\n[![Cocoapods Compatible](https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fv\u002FSnapKit.svg)](https:\u002F\u002Fcocoapods.org\u002Fpods\u002FSnapKit)\n[![Carthage compatible](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCarthage-compatible-4BC51D.svg?style=flat)](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage)\n\n#### ⚠️ **To use with Swift 4.x please ensure you are using >= 4.0.0** ⚠️\n#### ⚠️ **To use with Swift 5.x please ensure you are using >= 5.0.0** ⚠️\n\n## Contents\n\n- [Requirements](#requirements)\n- [Migration Guides](#migration-guides)\n- [Communication](#communication)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Credits](#credits)\n- [License](#license)\n\n## Requirements\n\n- iOS 12.0+ \u002F Mac OS X 10.13+ \u002F tvOS 10.0+\n- Xcode 10.0+\n- Swift 4.0+\n\n## Migration Guides\n\n- [SnapKit 3.0 Migration Guide](Documentation\u002FSnapKit%203.0%20Migration%20Guide.md)\n\n## Communication\n\n- If you **need help**, use [Stack Overflow](http:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Fsnapkit). (Tag 'snapkit')\n- If you'd like to **ask a general question**, use [Stack Overflow](http:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Fsnapkit).\n- If you **found a bug**, open an issue.\n- If you **have a feature request**, open an issue.\n- If you **want to contribute**, submit a pull request.\n\n\n## Installation\n\n### CocoaPods\n\n[CocoaPods](http:\u002F\u002Fcocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\n> CocoaPods 1.1.0+ is required to build SnapKit 4.0.0+.\n\nTo integrate SnapKit into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https:\u002F\u002Fgithub.com\u002FCocoaPods\u002FSpecs.git'\nplatform :ios, '12.0'\nuse_frameworks!\n\ntarget '\u003CYour Target Name>' do\n    pod 'SnapKit', '~> 5.7.0'\nend\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### Carthage\n\n[Carthage](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http:\u002F\u002Fbrew.sh\u002F) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate SnapKit into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"SnapKit\u002FSnapKit\" ~> 5.0.0\n```\n\nRun `carthage update` to build the framework and drag the built `SnapKit.framework` into your Xcode project.\n\n### Swift Package Manager\n\n[Swift Package Manager](https:\u002F\u002Fswift.org\u002Fpackage-manager\u002F) is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.\n\n> Xcode 11+ is required to build SnapKit using Swift Package Manager.\n\nTo integrate SnapKit into your Xcode project using Swift Package Manager, add it to the dependencies value of your `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https:\u002F\u002Fgithub.com\u002FSnapKit\u002FSnapKit.git\", .upToNextMajor(from: \"5.0.1\"))\n]\n```\n\n### Manually\n\nIf you prefer not to use either of the aforementioned dependency managers, you can integrate SnapKit into your project manually.\n\n---\n\n## Usage\n\n### Quick Start\n\n```swift\nimport SnapKit\n\nclass MyViewController: UIViewController {\n\n    lazy var box = UIView()\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        self.view.addSubview(box)\n        box.backgroundColor = .green\n        box.snp.makeConstraints { (make) -> Void in\n           make.width.height.equalTo(50)\n           make.center.equalTo(self.view)\n        }\n    }\n\n}\n```\n\n### Playground\nYou can try SnapKit in Playground.\n\n**Note:**\n\n> To try SnapKit in playground, open `SnapKit.xcworkspace` and build SnapKit.framework for any simulator first.\n\n### Resources\n\n- [Documentation](https:\u002F\u002Fsnapkit.github.io\u002FSnapKit\u002Fdocs\u002F)\n- [F.A.Q.](https:\u002F\u002Fsnapkit.github.io\u002FSnapKit\u002Ffaq\u002F)\n\n## Credits\n\n- Robert Payne ([@robertjpayne](https:\u002F\u002Ftwitter.com\u002Frobertjpayne))\n- Many other contributors\n\n## License\n\nSnapKit is released under the MIT license. See LICENSE for details.\n","SnapKit 是一个用于 iOS 和 macOS 的 Swift 自动布局 DSL，旨在简化 Auto Layout 的使用。它通过提供简洁的语法来定义和管理视图之间的约束条件，使得界面布局代码更加清晰易读。SnapKit 支持通过 CocoaPods、Carthage 或 Swift Package Manager 进行集成，并且兼容最新的 Swift 版本及 Xcode 开发环境。适用于需要快速高效地构建复杂用户界面的应用场景，特别适合于那些希望减少布局代码冗余并提高开发效率的开发者。",2,"2026-06-11 02:41:36","trending"]