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
Logger.log(message: "This is a DEBUG message", event: .d) // DEBUG log | |
Logger.log(message: "This is an ERROR message", event: .e) // ERROR log | |
Logger.log(message: "This is an INFO message", event: .i) // INFO log | |
Logger.log(message: "This is a VERBOSE message", event: .v) // VERBOSE log | |
Logger.log(message: "This is a WARNING message", event: .w) // WARNING log | |
Logger.log(message: "This is a SEVERE message", event: .s) // SEVERE Error log | |
// LOG ON XCODE CONSOLE | |
2017-05-13 12:56:34445 [💬][AppDelegate.swift]:20 19 application(_:didFinishLaunchingWithOptions:) -> This is a DEBUG message | |
2017-05-13 12:56:34463 [‼️][AppDelegate.swift]:21 19 application(_:didFinishLaunchingWithOptions:) -> This is an ERROR message |
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
import UIKit | |
class ShimmerView: UIView { | |
var primaryColor: UIColor = UIColor(red: 214.0/255.0, green: 214.0/255.0, blue: 214.0/255.0, alpha: 1.0) | |
var animationColor: UIColor = .white | |
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
[ | |
{ | |
"id":"4kQA1aQK8-Y", | |
"created_at":"2016-05-29T15:42:02-04:00", | |
"width":2448, | |
"height":1836, | |
"color":"#060607", | |
"likes":12, | |
"liked_by_user":false, | |
"user":{ |
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
[{ | |
"title": "Apple MacBook Pro MF839HN/A 13-inch Laptop (Core i5/8GB/128GB/OS X Yosemite/Intel Iris Graphics 6100)", | |
"desc": "A groundbreaking Retina display. Powerful dual-core and quad-core Intel processors. Fast flash storage. High-performance graphics. Great built-in apps. And now in the 13-inch model, a revolutionary new Force Touch trackpad and even longer battery life.1 Whatever you can imagine, MacBook Pro with Retina display gives you the power to create.", | |
"priceInUSDollar": 1290.0, | |
"imageURL": "http://ecx.images-amazon.com/images/I/61R5Fro8r3L._SL100_.jpg" | |
}, { | |
"title": "Apple Macbook Pro MD101HN/A 13-inch Laptop (Core i5/4GB/500GB/Mac OS Mavericks/Intel HD Graphics), Silver", | |
"desc": "The Apple Macbook Pro has a design that can only come from the artists at apple. The lightweight grey-white shiny finish with a simplistic apple logo is something that will turn heads wherever you go. The design uses lightweight but strong aluminium to make sure that your system weighs only 1.35kg to ensure tha |
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
# Convert the .cer file into a .pem file: | |
$ openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem | |
# Convert the private key’s .p12 file into a .pem file: | |
$ openssl pkcs12 -nocerts -in PushChatKey.p12 -out PushChatKey.pem | |
# Finally, combine the certificate and key into a single .pem file | |
$ cat PushChatCert.pem PushChatKey.pem > ck.pem | |
# At this point it’s a good idea to test whether the certificate works. |
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
import Foundation | |
import UIKit | |
// Usage Examples | |
let system12 = Font(.system, size: .standard(.h5)).instance | |
let robotoThin20 = Font(.installed(.RobotoThin), size: .standard(.h1)).instance | |
let robotoBlack14 = Font(.installed(.RobotoBlack), size: .standard(.h4)).instance | |
let helveticaLight13 = Font(.custom("Helvetica-Light"), size: .custom(13.0)).instance | |
struct Font { |
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
let system12 = Font(.system, size: .standard(.h5)).instance | |
let robotoThin20 = Font(.installed(.RobotoThin), size: .standard(.h1)).instance | |
let robotoBlack14 = Font(.installed(.RobotoBlack), size: .standard(.h4)).instance | |
let helveticaLight13 = Font(.custom("Helvetica-Light"), size: .custom(13.0)).instance |
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
let system12 = UIFont.systemFont(ofSize: 12.0) // Hard coded literals -> 1 | |
let robotoThin20 = UIFont(name: "Roboto-Thin", size: 20.0) // Hard coded literals -> 2 | |
let robotoBlack14 = UIFont(name: "Roboto-Black", size: 14.0) // Hard coded literals -> 2 | |
let helveticaLight13 = UIFont(name: "Helvetica-Light", size: 13.0) // Hard coded literals -> 2 |
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
extension Font { | |
var instance: UIFont { | |
var instanceFont: UIFont! | |
switch type { | |
case .custom(let fontName): | |
guard let font = UIFont(name: fontName, size: CGFloat(size.value)) else { | |
fatalError("\(fontName) font is not installed, make sure it is added in Info.plist and logged with Utility.logAllAvailableFonts()") | |
} | |
instanceFont = font | |
case .installed(let fontName): |
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
struct Font { | |
enum FontType { | |
case installed(FontName) | |
// ... | |
} | |
enum FontSize { | |
case standard(StandardSize) | |
// ... | |
} | |
enum FontName: String { |
NewerOlder