GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - SnapKit/SnapKit: A Swift Autolayout DSL for iOS & OS X

BranchesTags
Open more actions menu

Latest commit

 

History

542 Commits
542 Commits

Folders and files

NameName
Last commit message
Last commit date
CodeSnippets
CodeSnippets
 
 
Example-iOS
Example-iOS
 
 
SnapKit.xcworkspace
SnapKit.xcworkspace
 
 
Sources
Sources
 
 
Supporting Files
Supporting Files
 
 
Tests/SnapKitTests
Tests/SnapKitTests
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
ISSUE_TEMPLATE.md
ISSUE_TEMPLATE.md
 
 
LICENSE
LICENSE
 
 
Package.swift
Package.swift
 
 
README.md
README.md
 
 

Repository files navigation

SnapKit is a DSL to make Auto Layout easy on both iOS and OS X.

Build Status Platform

⚠️ To use with Swift 5.x please ensure you are using >= 5.0.0 ⚠️

Contents

  • Requirements
  • Migration Guides
  • Communication
  • Installation
  • Usage
  • Credits
  • License

Requirements

  • iOS 14.0+ / macOS 12.0+ / tvOS 14.0+
  • Xcode 26.0+
  • Swift 6.0+ (Toolchain, not syntax)

Communication

  • If you need help, use Stack Overflow. (Tag 'snapkit')
  • If you'd like to ask a general question, use Stack Overflow.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Installation

Swift Package Manager

Swift Package Manager 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.

Xcode 26+ is required to build SnapKit using Swift Package Manager.

To integrate SnapKit into your Xcode project using Swift Package Manager, add it to the dependencies value of your Package.swift:

dependencies: [
    .package(url: "https://github.com/SnapKit/SnapKit.git", .upToNextMajor(from: "6.0.0"))
]

Manually

If you prefer not to use either of the aforementioned dependency managers, you can integrate SnapKit into your project manually.


Usage

Quick Start

import SnapKit

class MyViewController: UIViewController {

    lazy var box = UIView()

    override func viewDidLoad() {
        super.viewDidLoad()

        self.view.addSubview(box)
        box.backgroundColor = .green
        box.snp.makeConstraints { (make) -> Void in
           make.width.height.equalTo(50)
           make.center.equalTo(self.view)
        }
    }

}

Resources

  • Documentation
  • F.A.Q.

Credits

  • Robert Payne (@robertjpayne)
  • Many other contributors

License

SnapKit is released under the MIT license. See LICENSE for details.

About

A Swift Autolayout DSL for iOS & OS X

snapkit.github.io/SnapKit/

Topics

autoautolayoutcocoapodsconstraintsdsllayoutsnapkitswiftuixcode

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

20.3k stars

Watchers

385 watching

Forks

2.0k forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.