Skip to content

Instantly share code, notes, and snippets.

View mkeremkeskin's full-sized avatar

Mehmet Kerem Keskin mkeremkeskin

View GitHub Profile
public enum FilterType: String, BaseSelectionType, CaseIterable {
case colorDocument = "colorDocumentLocalization"
case blackAndWhite = "blackAndWhiteLocalization"
case colorPhoto = "colorPhotoLocalization"
case greyscale = "greyscaleLocalization"
case general = "generalLocalization"
func localizedString() -> String {
return NSLocalizedString(self.rawValue, comment: "")
}
public enum FilterType: String, BaseSelectionType, CaseIterable {
case colorDocument = "Color Document"
case blackAndWhite = "Black And White"
case colorPhoto = "Color Photo"
case greyscale = "Greyscale"
}
// getting the raw value
FilterType.allCases.map({ (type) -> String in
print type.rawValue
public enum FilterType: String, BaseSelectionType, CaseIterable {
case colorDocument
case blackAndWhite
case colorPhoto
case greyscale
var getDisplayText: String {
switch self {
case .colorDocument:
return Localizable.filterColorDocument
enum InfoEndpointItem: Endpoint {
case sendInfo(request: [String: Any])
case getInfo(perPage: Int)
var path: String {
switch self {
case .sendInfo:
return "sendInfo"
case .getInfo(let perPage):
public enum FilterType: String, BaseSelectionType {
case colorDocument
case blackAndWhite
case colorPhoto
case greyscale
func getDisplayText(endingText: String) -> String {
switch self {
case .colorDocument:
return Localizable.filterColorDocument + endingText
public enum FilterType: String, BaseSelectionType {
case colorDocument
case blackAndWhite
case colorPhoto
case greyscale
var getDisplayText: String {
switch self {
case .colorDocument:
return Localizable.filterColorDocument
public enum SelectionType {
case filter
case size
}
public protocol BaseSelectionType {
var selectionType: SelectionType { get }
}
public enum FilterType: String, BaseSelectionType {
@mkeremkeskin
mkeremkeskin / post-action-script.sh
Created November 13, 2017 13:01
post action script for building framework for all archtitectures and devices
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
@mkeremkeskin
mkeremkeskin / build-framework-script.sh
Created November 13, 2017 12:46
external build script for building framework for all architectures and devices
set -e
set +u
# Avoid recursively calling this script.
if [[ $SF_MASTER_SCRIPT_RUNNING ]]
then
exit 0
fi
set -u
export SF_MASTER_SCRIPT_RUNNING=1
@mkeremkeskin
mkeremkeskin / UIAlertController+Orientation.h
Created April 16, 2015 21:13
iOS 8.3 UIAlertController orientation bug
#import <UIKit/UIKit.h>
@interface UIAlertController (Orientation)
@end