-
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,671 additions
and
587 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.27 KB
ExampleiOS/Assets.xcassets/rocket.imageset/816c77975b4ccce940d41933081b19d7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "816c77975b4ccce940d41933081b19d7.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// UIKit+Extensions.swift | ||
// ExampleiOS | ||
// | ||
// Created by daniele on 21/12/2019. | ||
// Copyright © 2019 SwiftRichString. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIColor { | ||
|
||
public static func randomColors(_ count: Int) -> [UIColor] { | ||
return (0..<count).map { _ -> UIColor in | ||
randomColor() | ||
} | ||
} | ||
|
||
public static func randomColor() -> UIColor { | ||
let redValue = CGFloat.random(in: 0...1) | ||
let greenValue = CGFloat.random(in: 0...1) | ||
let blueValue = CGFloat.random(in: 0...1) | ||
|
||
let randomColor = UIColor(red: redValue, green: greenValue, blue: blueValue, alpha: 1.0) | ||
return randomColor | ||
} | ||
|
||
} | ||
|
||
extension UIFont { | ||
|
||
/// Return the same font with given weight. | ||
/// | ||
/// - Parameter weight: weight you want to get | ||
public func withWeight(_ weight: UIFont.Weight) -> UIFont { | ||
let descriptor = fontDescriptor.addingAttributes([UIFontDescriptor.AttributeName.traits: [UIFontDescriptor.TraitKey.weight: weight]]) | ||
return UIFont(descriptor: descriptor, size: 0) // size 0 means keep the size as it is | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.