Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.
Edit Xcode Scheme and add a pre-action script.
Copy the contents of preaction.sh
into the pre-action script box.
/** | |
* How to setup push notifications in Swift | |
* http://stackoverflow.com/questions/24899257/how-to-setup-push-notifications-in-swift | |
*/ | |
import UIKit | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { |
// | |
// AppDelegate.swift | |
// pushtest | |
// | |
// Created by sawapi on 2014/06/08. | |
// Copyright (c) 2014年 sawapi. All rights reserved. | |
// | |
// iOS8用 | |
import UIKit |
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()") | |
} |
/* | |
* Solution - https://github.com/daveanderson/TableViewHeader | |
*/ | |
class DynamicTableViewController: UITableViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
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, |
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) |
lazy var icon: UIImage = { [unowned self] in | |
guard let iconName = self.iconName, icon = UIImage(named: iconName) else { | |
return UIImage() | |
} | |
return icon | |
} |
import Foundation | |
public struct Meter { | |
fileprivate var value: Double | |
public init(_ value: Double) { | |
self.value = value | |
} | |
public init(_ value: Int) { |
// Fonts | |
for family in UIFont.familyNames | |
{ | |
print("\(family)") | |
for names in UIFont.fontNames(forFamilyName: family) | |
{ | |
print("== \(names)") | |
} | |
} |
Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.
Edit Xcode Scheme and add a pre-action script.
Copy the contents of preaction.sh
into the pre-action script box.