Skip to content

Instantly share code, notes, and snippets.

@richy486
Forked from anonymous/new app stuff.txt
Last active October 18, 2019 17:38
Show Gist options
  • Save richy486/bc5b158583e4ec1f831dd99f9834a7e5 to your computer and use it in GitHub Desktop.
Save richy486/bc5b158583e4ec1f831dd99f9834a7e5 to your computer and use it in GitHub Desktop.
Stuff to put in each new app project.
# Add a carthage Cartfile
github "username/Project" ~> 1.0
git "https://github.com/username/Project.git" "branch"
# Update carthage
carthage update --platform ios
# Run script
/usr/local/bin/carthage copy-frameworks
$(SRCROOT)/Carthage/Build/iOS/[framework]
# Xcode <= 10
# Also AppDelegate.swift didFinishLaunchingWithOptions (Swift)
window = UIWindow(frame: UIScreen.main.bounds)
if let window = window {
let viewController = ViewController()
window.rootViewController = viewController
window.backgroundColor = UIColor.white
window.makeKeyAndVisible()
}
# Xcode >= 11 (Obj-C)
# SceneDelegate.h
UIWindowScene *windowScene = (UIWindowScene*)scene;
if (windowScene == nil) { return; }
_window = [[UIWindow alloc] initWithFrame: UIScreen.mainScreen.bounds];
_window.windowScene = windowScene;
_window.rootViewController = [[ViewController alloc] init];
_window.rootViewController.view.backgroundColor = UIColor.whiteColor;
[_window makeKeyAndVisible];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment