For example, you want to set 40% alpha transparence to #000000
(black color), you need to add 66
like this #66000000
.
This file contains hidden or 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
// | |
// ZSWFileTester.m | |
// Image Size Test | |
// | |
// Created by Zachary West on 3/4/14. | |
// Copyright (c) 2014 Zachary West. All rights reserved. | |
// | |
#import "ZSWFileTester.h" |
This file contains hidden or 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
let styles: [UIFont.TextStyle] = [ | |
// iOS 17 | |
.extraLargeTitle, .extraLargeTitle2, | |
// iOS 11 | |
.largeTitle, | |
// iOS 9 | |
.title1, .title2, .title3, .callout, | |
// iOS 7 | |
.headline, .subheadline, .body, .footnote, .caption1, .caption2, | |
] |
This file contains hidden or 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
indirect enum LinkedListNode { | |
case head(value: Int, node: LinkedListNode) | |
case node(value: Int, next: LinkedListNode) | |
case tail(value: Int) | |
} | |
let linkedList = LinkedListNode | |
.head(value: 0, node: | |
.node(value: 1, next: | |
.node(value: 2, next: |
One file for each domain, both www.example.com and example.com need separate files:
{
"applinks": {
"apps": [],
"details": {
"9JA89QQLNQ.com.apple.wwdc": {
This file contains hidden or 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
import LocalAuthentication | |
class BiometricAuth { | |
var context = LAContext() | |
var error: NSError? | |
func auth(_ completion: @escaping (_ success: Bool) -> ()) { | |
// Get the supported biometry |
This file contains hidden or 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
import RealmSwift | |
extension Results { | |
func toArray() -> [T] { | |
return self.map{ $0 } | |
} | |
} |
This file contains hidden or 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
import RealmSwift | |
internal struct RealmService { | |
private static var realm: Realm? { | |
do { | |
return try Realm() | |
} catch let error as NSError { | |
print(error) | |
return nil |
This file contains hidden or 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
import UIKit | |
extension UIColor { | |
/// Creates image from color | |
/// - Parameter size: size of returned image | |
/// - Returns: UIImage | |
func image(_ size: CGSize = CGSize(width: 1, height: 1)) -> UIImage { | |
return UIGraphicsImageRenderer(size: size).image { rendererContext in | |
self.setFill() |
This file contains hidden or 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
import Foundation | |
public extension Date { | |
// MARK: - Convert from String | |
/* | |
Creates a new Date based on a string of a specified format. Supports optional timezone and locale. | |
*/ | |
init?(fromString string: String, format: DateFormatType, timeZone: TimeZoneType = .local, locale: Locale = Foundation.Locale.current, isLenient: Bool = true) { |
NewerOlder