-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathViewController.swift
More file actions
56 lines (46 loc) · 1.67 KB
/
ViewController.swift
File metadata and controls
56 lines (46 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// ViewController.swift
// StackCardView
//
// Created by Badarinath Venkatnarayansetty on 01/29/2024.
// Copyright (c) 2024 Badarinath Venkatnarayansetty. All rights reserved.
//
import UIKit
import SwiftUI
import StackCardView
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let stackCardView = UIHostingController(rootView: ContentView())
stackCardView.view.translatesAutoresizingMaskIntoConstraints = false
self.view.addSubview(stackCardView.view)
//set constraints
NSLayoutConstraint.activate([
stackCardView.view.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 50),
stackCardView.view.bottomAnchor.constraint(equalTo: self.view.bottomAnchor),
stackCardView.view.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
stackCardView.view.trailingAnchor.constraint(equalTo: self.view.trailingAnchor),
])
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
struct ContentView: View {
var body: some View {
TabView {
StackCardDemoView()
.tabItem {
Image(systemName: "square.stack.3d.up.fill")
Text("First Tab")
}
StackCardButtonView()
.tabItem {
Image(systemName: "square.stack.3d.up.fill")
Text("Second Tab")
}
}
}
}