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 | |
# I made this script to convert SVG icons for an iOS app into PNG. | |
# The script will create icons in 3 sizes for different screen DPIs. | |
find . -type f -name "*.svg" | while read f | |
do | |
echo '---' | |
FILENAME="${f%.*}" | |
echo $FILENAME |
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
final class CornerInsideView: UIView { | |
var corner: UIRectCorner? { | |
didSet { | |
setup() | |
} | |
} | |
var radius: CGFloat = 0 | |
private func setup() { |
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
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
final class StripedGradientView: UIView { | |
@available(*, unavailable, message: "This property is reserved for Interface Builder. Use 'direction' instead.") | |
@IBInspectable var directionName: String? { | |
willSet { |
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 | |
final class AlertViewControllerBuilder { | |
var title: String? | |
var message: String? | |
var okHandler: AnonymousActionClosure? | |
var cancelHandler: AnonymousActionClosure? | |
typealias BuilderClosure = (AlertViewControllerBuilder) -> Void |
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 | |
extension Dictionary where Key == Range<Float> { | |
subscript(bmi bmi: Float) -> Value? { | |
guard let k = keys.filter({$0 ~= bmi}).first else { | |
return nil | |
} | |
return self[k] | |
} | |
} |
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 | |
final class Action: NSObject { | |
private let _action: () -> () | |
init(action: @escaping () -> ()) { | |
_action = action | |
super.init() | |
} | |
func action() { | |
_action() |
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 | |
extension Dictionary { | |
static func contentsOf(url: URL) -> Dictionary<Key, Value>? { | |
do { | |
let data = try Data(contentsOf:url) | |
let properties = try PropertyListSerialization.propertyList(from: data, options: [], format: nil) as? [Key: Value] | |
return properties | |
} catch { | |
return nil | |
} |
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
// | |
// AlertControllerFabric.swift | |
// Mapa Turystyczna | |
// | |
// Created by Roman Barzyczak on 05.04.2016. | |
// | |
import Foundation | |
class AlertHelper { |
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
mkdir MyIcon | |
sips -z 29 29 Icon1024.png --out MyIcon/icon_29x29.png | |
sips -z 58 58 Icon1024.png --out MyIcon/icon_29x29@2x.png | |
sips -z 87 87 Icon1024.png --out MyIcon/icon_29x29@3x.png | |
sips -z 40 40 Icon1024.png --out MyIcon/icon_40x40.png | |
sips -z 80 80 Icon1024.png --out MyIcon/icon_40x40@2x.png | |
sips -z 120 120 Icon1024.png --out MyIcon/icon_40x40@3x.png | |
sips -z 50 50 Icon1024.png --out MyIcon/icon_50x50.png |
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
// | |
// Stack.h | |
// testing | |
// | |
// Created by Roman Barzyczak on 16.02.2014. | |
// | |
// | |
#import <Foundation/Foundation.h> |
NewerOlder