# Enable internal menu
defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES
# Enable project build time
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 | |
| class Localizer { | |
| class func doExtchangeLang() { | |
| ExtchangeMEthodsForClass(className: Bundle.self, originalSelector: #selector(Bundle.localizedString(forKey:value:table:)), overrideSelector: #selector(Bundle.customLocalizedString(forKey:value:table:))) | |
| } | |
| } | |
| extension Bundle { | |
| @objc func customLocalizedString(forKey key: String, value: String?, table tableName: String?) -> String |
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
| post_install do |installer| | |
| installer.pods_project.targets.each do |target| | |
| target.build_configurations.each do |config| | |
| config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = 'YES' | |
| end | |
| end | |
| end |
You can do it like this:
In your main view controller:
func showModal() {
let modalViewController = ModalViewController()
modalViewController.modalPresentationStyle = .OverCurrentContext
presentViewController(modalViewController, animated: true, completion: 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
| protocol NibInstantiatable { | |
| static var NibName: String { get } | |
| } | |
| extension NibInstantiatable { | |
| static var NibName: String { return String(Self) } | |
| static func instantiate() -> Self { | |
| return instantiateWithName(NibName) |
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
| //***************************************************************** | |
| // MARK: - Helper Functions | |
| //***************************************************************** | |
| public func delay(_ delay:Double, closure:@escaping ()->()) { | |
| DispatchQueue.main.asyncAfter( | |
| deadline: DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: closure) | |
| } |
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
| for family: String in UIFont.familyNames() | |
| { | |
| print("\(family)") | |
| for names: String in UIFont.fontNamesForFamilyName(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
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? | |
| let gcmMessageIDKey = "gcm.message_id" | |
| func application(_ application: UIApplication, | |
| didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
| self.registerForRemotrNotification(); |
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
| -(void)registerForRemoteNotification{ | |
| // Register for remote notifications. This shows a permission dialog on first run, to | |
| // show the dialog at a more appropriate time move this registration accordingly. | |
| if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_7_1) { | |
| // iOS 7.1 or earlier. Disable the deprecation warnings. | |
| #pragma clang diagnostic push | |
| #pragma clang diagnostic ignored "-Wdeprecated-declarations" | |
| UIRemoteNotificationType allNotificationTypes = | |
| (UIRemoteNotificationTypeSound | |
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
| post_install do |installer| | |
| installer.pods_project.targets.each do |target| | |
| target.build_configurations.each do |config| | |
| config.build_settings['SWIFT_VERSION'] = '3.0' | |
| end | |
| end | |
| end |