This file contains hidden or 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 | |
class FadeInOut: UIStoryboardSegue { | |
override func perform() { | |
let sourceView: UIView = self.source.view as UIView! | |
let destinationView: UIView = self.destination.view as UIView! | |
sourceView.alpha = 1.0 |
This file contains hidden or 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
if let path = Bundle.main.path(forResource: "FeedFile", ofType: "json") { | |
do { | |
let data = try Data(contentsOf: URL(fileURLWithPath: path), options: .alwaysMapped) | |
let jsonData = JSON(data: data) | |
if jsonData != JSON.null { | |
if let arrOfFeed = Mapper<GlynkFeed>().mapArray(JSONObject: jsonData["feed"].arrayObject) { | |
if arrOfFeed.count > 0 { | |
if self.arrOfGlynkFeed == nil || self.refreshControl.isRefreshing { | |
self.arrOfGlynkFeed = arrOfFeed |
This file contains hidden or 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
localeIdentifier | Description | |
---|---|---|
eu | Basque | |
hr_BA | Croatian (Bosnia & Herzegovina) | |
en_CM | English (Cameroon) | |
rw_RW | Kinyarwanda (Rwanda) | |
en_SZ | English (Swaziland) | |
tk_Latn | Turkmen (Latin) | |
he_IL | Hebrew (Israel) | |
ar | Arabic | |
uz_Arab | Uzbek (Arabic) |
This file contains hidden or 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 NotificationType { | |
var name: Notification.Name { get } | |
static var name: Notification.Name { get } | |
var userInfo: [AnyHashable : Any] { get } | |
init?(notification: Notification?) | |
} | |
struct Notifications { } |
This file contains hidden or 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 BaseURL { | |
class func getFromEnvironment() -> String { | |
#if DEBUG | |
return "http://192.168.1.126" | |
#else | |
return "https://judgecardx.com" | |
#endif | |
} |
This file contains hidden or 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 BaseURL { | |
class func getFromEnvironment() -> String { | |
#if DEBUG | |
return "http://192.168.1.126" | |
#else | |
return "https://judgecardx.com" | |
#endif | |
} |
This file contains hidden or 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
#!/usr/bin/env bash | |
rm -rf "${HOME}/Library/Caches/CocoaPods" | |
rm -rf "`pwd`/Pods/" | |
pod update |
This file contains hidden or 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
- (UIImage *)compressImage:(UIImage *)image{ | |
float actualHeight = image.size.height; | |
float actualWidth = image.size.width; | |
float maxHeight = 600.0; | |
float maxWidth = 800.0; | |
float imgRatio = actualWidth/actualHeight; | |
float maxRatio = maxWidth/maxHeight; | |
float compressionQuality = 0.5;//50 percent compression | |
if (actualHeight > maxHeight || actualWidth > maxWidth) { |
This file contains hidden or 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
// Do you often find yourself writing lines of code that look like this? | |
// let viewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("ViewController") as! ViewController | |
// Here's a simpler way, using generics and Swift type-casting (as long as the viewcontroller's storyboard identifier is its class name). | |
// Now you can write: let viewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController() as ViewController | |
extension UIStoryboard { | |
func instantiateViewController<T: UIViewController>() -> T { | |
guard let vc = instantiateViewControllerWithIdentifier(String(T)) as? T else { | |
fatalError("Could not locate viewcontroller with with identifier \(String(T)) in storyboard.") | |
} |
This file contains hidden or 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
// | |
// NSDate+Ago.swift | |
// Created by Jesse Ziegler on 5/27/15. | |
// Copyright (c) 2015 Jesse Ziegler. All rights reserved. | |
// | |
// http://www.jesseziegler.com | |
// | |
// http://github.com/jdziegler/SwiftAgo | |
// | |
import Foundation |