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
struct InspectableComponent { | |
var isHideBackBarButtonTitle = true | |
} | |
protocol HasInspectableComponent { | |
var inspectableComponent: InspectableComponent { get set } | |
} | |
protocol InspectableAttribute: HasInspectableComponent { } |
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
// Fonts | |
for family in UIFont.familyNames | |
{ | |
print("\(family)") | |
for names in UIFont.fontNames(forFamilyName: family) | |
{ | |
print("== \(names)") | |
} | |
} |
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 Foundation | |
import GoogleMaps | |
func getShadowMarker() -> GMSMarker { | |
let marker = GMSMarker() | |
let image = UIImageView(image: UIImage(named: "marker")) | |
marker.iconView = image | |
marker.iconView?.contentMode = .center | |
marker.iconView?.bounds.size.width *= 2 |
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 Foundation | |
public struct Meter { | |
fileprivate var value: Double | |
public init(_ value: Double) { | |
self.value = value | |
} | |
public init(_ value: Int) { |
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
lazy var icon: UIImage = { [unowned self] in | |
guard let iconName = self.iconName, icon = UIImage(named: iconName) else { | |
return UIImage() | |
} | |
return icon | |
} |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 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
mr Marathi | |
bs Bosnian | |
ee_TG Ewe (Togo) | |
ms Malay | |
kam_KE Kamba (Kenya) | |
mt Maltese | |
ha Hausa | |
es_HN Spanish (Honduras) | |
ml_IN Malayalam (India) | |
ro_MD Romanian (Moldova) |
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
extension NSDate { | |
var stringFormattedAsRFC3339: String { | |
return rfc3339formatter.stringFromDate(self) | |
} | |
class func dateFromRFC3339FormattedString(rfc3339FormattedString:String) -> NSDate? | |
{ | |
/* | |
NOTE: will replace this with a failible initializer when Apple fixes the bug | |
that requires the initializer to initialize all stored properties before returning nil, |
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
/* | |
* Solution - https://github.com/daveanderson/TableViewHeader | |
*/ | |
class DynamicTableViewController: UITableViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
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 Foundation | |
var token: dispatch_once_t = 0 | |
func test() { | |
dispatch_once(&token) { | |
println("This is printed only on the first call to test()") | |
} | |
println("This is printed for each call to test()") | |
} |
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
// | |
// AppDelegate.swift | |
// pushtest | |
// | |
// Created by sawapi on 2014/06/08. | |
// Copyright (c) 2014年 sawapi. All rights reserved. | |
// | |
// iOS8用 | |
import UIKit |