Author: Chris Lattner
| import UIKit | |
| @UIApplicationMain | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
| let window = UIWindow(frame: UIScreen.main.bounds) |
| // Created by Marlon Monroy on 5/19/18. | |
| // Copyright © 2018 Monroy.io All rights reserved. | |
| // | |
| import Foundation | |
| import UIKit | |
| protocol Shimmerable { | |
| func start(count: Int) -> Void |
| git show-branch | grep '*' | grep -v "$(git rev-parse --abbrev-ref HEAD)" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//' |
| // Example Usage | |
| func openLocation() { | |
| guard let workspaceClass = NSClassFromString("LSApplicationWorkspace") else { return } | |
| let workspace: AnyObject = execute(workspaceClass, "defaultWorkspace") | |
| let url = URL(string: "Prefs:root=Privacy&path=LOCATION")! | |
| execute(workspace, "openSensitiveURL:withOptions:", with: url) | |
| } | |
| private func getImplementation(_ owner: AnyObject, _ name: String) -> IMP { | |
| let selector = Selector(name) |
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.
Replica of owl hiding his hands when going on password field from readme.io
A Pen by Vincenzo Chianese on CodePen.
| let styles: [UIFont.TextStyle] = [ | |
| // iOS 17 | |
| .extraLargeTitle, .extraLargeTitle2, | |
| // iOS 11 | |
| .largeTitle, | |
| // iOS 9 | |
| .title1, .title2, .title3, .callout, | |
| // iOS 7 | |
| .headline, .subheadline, .body, .footnote, .caption1, .caption2, | |
| ] |
Greetings and salutations, NSHipsters!
As the year winds down, it's a tradition here at NSHipster to ask you, dear readers, to offer up your favorite tricks and tips from the past year as gifts to your fellow hipsters. With iOS 9, El Capitan, brand new watch- and tvOS's, and the open-sourcing of some minor Apple-related tech, there's bound to be lots to share.
Submit your favorite piece of Swift or @objc trivia, helpful hints, unexpected discoveries, useful workarounds, useless fascinations, or anything else you found cool this year. Just comment below!
If you need inspiration, try [the list from last year][2015], or [from the year before][2014], or [from the year before that][2013].
