Skip to content

Instantly share code, notes, and snippets.

View katiesmillie's full-sized avatar

Katie Smillie katiesmillie

  • brooklyn
View GitHub Profile
@katiesmillie
katiesmillie / CustomNavBar.swift
Last active November 10, 2021 21:49
Transition nav bar from translucent to white when scrolling
// Add to View Controller
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
customNavBar?.makeTransparent = true
// Match the style based scroll view position on the page everytime view appears
styleNavBarBasedOnScrollViewPosition(tableView)
}
@katiesmillie
katiesmillie / URLRoute.swift
Last active May 1, 2019 22:07
Parsing a deep link like urbanarchive://posts/9987
// Call from App Delegate
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
guard let components = URLComponents(string: url.absoluteString), let scheme = components.scheme else { return true }
let absolute = url.absoluteString
let path = absolute.replacingOccurrences(of: "\(scheme)://", with: "")
launchCoordinator.appCoordinator.deepLink(path: path)
return true