Netease-Music-Demo by sss
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

README.md 3.5KB

il y a 3 ans
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <img src="http://snapkit.io/images/banner.jpg" alt="" />
  2. SnapKit is a DSL to make Auto Layout easy on both iOS and OS X.
  3. [![Build Status](https://travis-ci.org/SnapKit/SnapKit.svg)](https://travis-ci.org/SnapKit/SnapKit)
  4. [![Platform](https://img.shields.io/cocoapods/p/SnapKit.svg?style=flat)](https://github.com/SnapKit/SnapKit)
  5. [![Cocoapods Compatible](https://img.shields.io/cocoapods/v/SnapKit.svg)](https://cocoapods.org/pods/SnapKit)
  6. [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
  7. #### ⚠️ **To use with Swift 4.x please ensure you are using >= 4.0.0** ⚠️
  8. #### ⚠️ **To use with Swift 5.x please ensure you are using >= 5.0.0** ⚠️
  9. ## Contents
  10. - [Requirements](#requirements)
  11. - [Migration Guides](#migration-guides)
  12. - [Communication](#communication)
  13. - [Installation](#installation)
  14. - [Usage](#usage)
  15. - [Credits](#credits)
  16. - [License](#license)
  17. ## Requirements
  18. - iOS 10.0+ / Mac OS X 10.12+ / tvOS 10.0+
  19. - Xcode 10.0+
  20. - Swift 4.0+
  21. ## Communication
  22. - If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/snapkit). (Tag 'snapkit')
  23. - If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/snapkit).
  24. - If you **found a bug**, open an issue.
  25. - If you **have a feature request**, open an issue.
  26. - If you **want to contribute**, submit a pull request.
  27. ## Installation
  28. ### CocoaPods
  29. [CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
  30. ```bash
  31. $ gem install cocoapods
  32. ```
  33. > CocoaPods 1.1.0+ is required to build SnapKit 4.0.0+.
  34. To integrate SnapKit into your Xcode project using CocoaPods, specify it in your `Podfile`:
  35. ```ruby
  36. source 'https://github.com/CocoaPods/Specs.git'
  37. platform :ios, '10.0'
  38. use_frameworks!
  39. target '<Your Target Name>' do
  40. pod 'SnapKit', '~> 5.0.0'
  41. end
  42. ```
  43. Then, run the following command:
  44. ```bash
  45. $ pod install
  46. ```
  47. ### Carthage
  48. [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
  49. You can install Carthage with [Homebrew](http://brew.sh/) using the following command:
  50. ```bash
  51. $ brew update
  52. $ brew install carthage
  53. ```
  54. To integrate SnapKit into your Xcode project using Carthage, specify it in your `Cartfile`:
  55. ```ogdl
  56. github "SnapKit/SnapKit" ~> 5.0.0
  57. ```
  58. Run `carthage update` to build the framework and drag the built `SnapKit.framework` into your Xcode project.
  59. ### Manually
  60. If you prefer not to use either of the aforementioned dependency managers, you can integrate SnapKit into your project manually.
  61. ---
  62. ## Usage
  63. ### Quick Start
  64. ```swift
  65. import SnapKit
  66. class MyViewController: UIViewController {
  67. lazy var box = UIView()
  68. override func viewDidLoad() {
  69. super.viewDidLoad()
  70. self.view.addSubview(box)
  71. box.snp.makeConstraints { (make) -> Void in
  72. make.width.height.equalTo(50)
  73. make.center.equalTo(self.view)
  74. }
  75. }
  76. }
  77. ```
  78. ### Playground
  79. You can try SnapKit in Playground.
  80. **Note:**
  81. > To try SnapKit in playground, open `SnapKit.xcworkspace` and build SnapKit.framework for any simulator first.
  82. ### Resources
  83. - [Documentation](http://snapkit.io/docs/)
  84. - [F.A.Q.](http://snapkit.io/faq/)
  85. ## Credits
  86. - Robert Payne ([@robertjpayne](https://twitter.com/robertjpayne))
  87. - Many other contributors
  88. ## License
  89. SnapKit is released under the MIT license. See LICENSE for details.