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 | |
extension NSClipView { | |
open override var isFlipped: Bool { | |
return true | |
} | |
} |
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
// | |
// ___FILENAME___ | |
// ___PROJECTNAME___ | |
// | |
// Created by ___FULLUSERNAME___ on ___DATE___. | |
// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. | |
// | |
// This file was generated by http://www.popcornomnom.com | |
// |
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 Reachability | |
//Reachability | |
//declare this property where it won't go out of scope relative to your listener | |
fileprivate var reachability: Reachability! | |
protocol ReachabilityActionDelegate { | |
func reachabilityChanged(_ isReachable: Bool) |
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
class ReachabilityHandler: ReachabilityObserverDelegate { | |
//MARK: Lifecycle | |
required init() { | |
try? addReachabilityObserver() | |
} | |
deinit { | |
removeReachabilityObserver() |
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
//"<key>" = "<localized value>"; | |
"welcomeTitle" = "Welcome!"; | |
"start" = "Start"; |
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
protocol LocalizableDelegate { | |
var rawValue: String { get } //localize key | |
var table: String? { get } | |
var localized: String { get } | |
} | |
extension LocalizableDelegate { | |
//returns a localized value by specified key located in the specified table | |
var localized: String { | |
return Bundle.main.localizedString(forKey: rawValue, value: nil, table: table) |
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
enum InApp: String, LocalizableDelegate { | |
case title = "inAppTitle" | |
case subtitle = "inAppSubtitle" | |
case description = "inAppDescription" | |
var table: String? { | |
return "InApps" | |
} | |
} |
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.text = Localizable.WelcomePage.title.localized // Welcome! |
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
enum WelcomePage: String, LocalizableDelegate { | |
case title = "welcomeTitle" | |
case ctaButtonTitle = "start" | |
case next | |
} |
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
enum WelcomePage: String { | |
case title | |
case ctaButtonTitle | |
} |
OlderNewer