Skip to content

Commit

Permalink
release(0.3.0): upgraded Snapkit to 5.x / SwiftPM
Browse files Browse the repository at this point in the history
  • Loading branch information
CedricGatay committed Nov 16, 2020
1 parent 902e090 commit d5a267e
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 92 deletions.
16 changes: 16 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "SnapKit",
"repositoryURL": "https://github.com/SnapKit/SnapKit.git",
"state": {
"branch": null,
"revision": "d458564516e5676af9c70b4f4b2a9178294f1bc6",
"version": "5.0.1"
}
}
]
},
"version": 1
}
28 changes: 28 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "UIKitExtensions",
platforms: [
.iOS(.v10)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "UIKitExtensions",
targets: ["UIKitExtensions"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/SnapKit/SnapKit.git", .upToNextMajor(from: "5.0.1"))
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "UIKitExtensions",
dependencies: ["SnapKit"]),
]
)
5 changes: 5 additions & 0 deletions Sources/UIKitExtensions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ public extension UIColor {
- Returns: UIColor
*/
public convenience init?(hexString: String) {
convenience init?(hexString: String) {
let r, g, b, a: CGFloat

if hexString.hasPrefix("#") {
let start = hexString.index(hexString.startIndex, offsetBy: 1)
let hexColor = hexString.substring(from: start)
let hexColor = hexString[start...]

if hexColor.characters.count == 8 {
let scanner = Scanner(string: hexColor)
if hexColor.count == 8 {
let scanner = Scanner(string: String(hexColor))
var hexNumber: UInt64 = 0

if scanner.scanHexInt64(&hexNumber) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public extension UIFont {
- Return: UIFont
*/
public static func fontNamed(_ customFontName: String, ofSize fontSize: CGFloat) -> UIFont {
static func fontNamed(_ customFontName: String, ofSize fontSize: CGFloat) -> UIFont {
return UIFont(name: customFontName, size: fontSize)!
}
}
File renamed without changes.
8 changes: 4 additions & 4 deletions UIKitExtensions.podspec