I hereby claim:
- I am denisoliveira on github.
- I am denisoliveira (https://keybase.io/denisoliveira) on keybase.
- I have a public key ASBiPhpaUXFh3daVSkOxLUROFgQZ8_8hQBnZ0gRu7HO8Bwo
To claim this, I am signing this object:
// | |
// ViewController.swift | |
// IntroAnimation | |
// | |
// Created by Denis Oliveira on 4/19/17. | |
// Copyright © 2017 Denis Oliveira. All rights reserved. | |
// | |
import UIKit |
extension UILabel { | |
func letterSpacing(spacing: CGFloat) { | |
guard let text = self.text else { | |
return | |
} | |
var attributedText: NSMutableAttributedString? | |
if self.attributedText == nil { | |
attributedText = NSMutableAttributedString(string: text) | |
} |
class GradientHelper { | |
/// Set gradient background on view use this method on *draw(_ rect:* **CGRect...***)* | |
/// | |
/// - Parameter colours: A grandient colors args | |
func setGradientBackground(angle: CGFloat = 0, colours: CGColor...) { | |
let colours = colours as CFArray | |
let context = UIGraphicsGetCurrentContext() | |
let gradient = CGGradient(colorsSpace: CGColorSpaceCreateDeviceRGB(), colors: colours, locations: nil)! | |
// Make the right degree |
extension Optional { | |
func map(_ clojure: (Wrapped) -> () -> Wrapped) -> Wrapped? { | |
guard let self = self else { return nil } | |
return clojure(self)() | |
} | |
func map<T>(_ keyPath: KeyPath<Wrapped, T>) -> T? { | |
guard let self = self else { return nil } | |
return self[keyPath: keyPath] |
I hereby claim:
To claim this, I am signing this object:
print("Device Token \(deviceToken.reduce("", {$0 + String(format: "%02x", $1)}))") |
import Foundation | |
struct AnyKey: CodingKey { | |
var stringValue: String | |
var intValue: Int? | |
init?(stringValue: String) { | |
self.stringValue = stringValue | |
self.intValue = nil | |
} |
// By Gui Rambo | |
// https://rambo.codes/ios/quick-tip/2019/12/09/clearing-your-apps-launch-screen-cache-on-ios.html | |
// Note: Tested on iOS 13 only | |
import UIKit | |
public extension UIApplication { | |
func clearLaunchScreenCache() { | |
do { |
#As was mentioned, you can use xcrun to do a few things: | |
#to list all simulators | |
xcrun simctl list devices | |
# or | |
xcrun simctl list --json | |
# to delete specific device | |
xcrun simctl delete # <device udid> |
// UIApplication+SplashOptions.h | |
#import <UIKit/UIKit.h> | |
@interface UIApplication (SplashOptions) | |
- (void)clearLaunchScreenCache; | |
@end | |