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 SwiftUI | |
struct ViewControllerProvider: PreviewProvider { | |
static var previews: some View { | |
ContainerView().edgesIgnoringSafeArea(.all) | |
} | |
struct ContainerView:UIViewControllerRepresentable { | |
let viewController = ViewController() |
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
//1. Open info.plist | |
//2.Remove unnecesary storyboard settings from info.plist | |
import UIKit | |
class SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
var window: UIWindow? | |
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 UIKit | |
extension UIView { | |
func anchor(top: NSLayoutYAxisAnchor? = nil, | |
left: NSLayoutXAxisAnchor? = nil, | |
bottom: NSLayoutYAxisAnchor? = nil, | |
right: NSLayoutXAxisAnchor? = nil, | |
paddingTop: CGFloat = 0, | |
paddingLeft: CGFloat = 0, | |
paddingBottom: CGFloat = 0, |
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
struct UIFactory { | |
struct Utility { | |
static func box(color: NSColor = .white, superview: NSView? = nil) -> NSBox { | |
let box = NSBox(frame: .zero) | |
box.boxType = .custom | |
box.borderColor = .clear | |
box.titlePosition = .noTitle | |
box.fillColor = color |
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? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]?) | |
-> Bool { | |
// if self.window is nil then set a new UIWindow object to self.window. | |
/* self.window = self.window ?? UIWindow() | |
// Set self.window's background color to red. | |
self.window!.backgroundColor = UIColor.red |
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 UIKit | |
class MainTabBarController: UITabBarController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let listViewController = ListViewController() | |
let peopleViewController = PeopleViewController() | |
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 UIKit | |
class MainTabBarController: UITabBarController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
view.backgroundColor = .white | |
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
extension UIFont { | |
static func avenir20() -> UIFont? { | |
return UIFont.init(name: "avenir", size: 20) | |
} | |
static func avenir26() -> UIFont? { | |
return UIFont.init(name: "avenir", size: 26) | |
} | |
} |
OlderNewer