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
// Does not work on iOS 14.0 or later, keeping the gist just for reference. | |
extension UITabBar { | |
override open func sizeThatFits(size: CGSize) -> CGSize { | |
super.sizeThatFits(size) | |
var sizeThatFits = super.sizeThatFits(size) | |
sizeThatFits.height = 71 | |
return sizeThatFits | |
} | |
} |
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
// GuestCellView.swift | |
import UIKit | |
import DynamicColor | |
class GuestCellView:UIView { | |
override func awakeFromNib() { | |
//applyCustomShadow(self) |
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 Cocoa | |
import XCPlayground | |
import XCTest | |
/* | |
shadow.shadowColor = NSColor.blackColor().colorWithAlphaComponent(1.0) | |
shadow.shadowOffset = NSMakeSize(0.1, 0.1) | |
shadow.shadowBlurRadius = 15 | |
*/ | |
extension NSShadow{ |
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
func appendToPath(path: CGMutablePath) | |
{ | |
let textPath = CGPathCreateMutable() | |
let attributedString = NSAttributedString(string: string) | |
let line = CTLineCreateWithAttributedString(attributedString) | |
// direct cast to typed array fails for some reason | |
let runs = (CTLineGetGlyphRuns(line) as [AnyObject]) as! [CTRun] |
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
UIGraphicsBeginImageContextWithOptions(CGSize(width: 200, height: 200), false, 0.0) | |
let context = UIGraphicsGetCurrentContext() | |
let rectPath = UIBezierPath(roundedRect: CGRectMake(0, 0, 200, 200), cornerRadius: 10) | |
var cutoutPath = UIBezierPath(roundedRect: CGRectMake(30, 30, 140, 140), cornerRadius: 10) | |
rectPath.appendPath(cutoutPath.bezierPathByReversingPath()) | |
UIColor.orangeColor().set() | |
outerForegroundPath.fill() |
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 CoreGraphics | |
private typealias CGPathDumpUtility = CGPath | |
extension CGPathDumpUtility { | |
func dump() { | |
self.apply(info: nil) { info, unsafeElement in | |
let element = unsafeElement.pointee | |
switch element.type { |
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 CGRect | |
{ | |
/** Creates a rectangle with the given center and dimensions | |
- parameter center: The center of the new rectangle | |
- parameter size: The dimensions of the new rectangle | |
*/ | |
init(center: CGPoint, size: CGSize) | |
{ | |
self.init(x: center.x - size.width / 2, y: center.y - size.height / 2, width: size.width, height: size.height) |
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
// | |
// ViewController.swift | |
// PageViewController | |
// | |
// Created by Miguel Fermin on 5/8/17. | |
// Copyright © 2017 MAF Software LLC. All rights reserved. | |
// | |
import UIKit |
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
#!/bin/bash | |
CONFIG_PASSWORD="BE5D2905-0625-4EBF-BCA2-7F6F5D138425" | |
REQUIRED_CONFIG_FILE_PATH="${SRCROOT}/YourProject/App/Config/Configurations/Config-${CONFIGURATION}.plist" | |
CONFIG_OUTPUT_PATH="${SRCROOT}/YourProject/App/Config/Configurations/Config.json" | |
CONFIG_EXTENSION_OUTPUT_PATH="${SRCROOT}/YourProject/App/Config/Configurations/Config+Extension.swift" | |
set -e | |
if [ -z "${CONFIGURATION}" ] |
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
// | |
// UserDefaults.swift | |
// | |
// Created by Shaps Benkau on 24/05/2018. | |
// Copyright © 2018 152percent Ltd. All rights reserved. | |
// | |
import Foundation | |
#if os(iOS) |
OlderNewer