-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a005c39
commit 142fbca
Showing
19 changed files
with
1,005 additions
and
0 deletions.
There are no files selected for viewing
367 changes: 367 additions & 0 deletions
367
SwiftUI-Segment/SwiftUI-SegmentControl/SwiftUI-SegmentControl.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
...mentControl/SwiftUI-SegmentControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
...wiftUI-SegmentControl.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
6 changes: 6 additions & 0 deletions
6
...tControl.xcodeproj/xcuserdata/swasalunke.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Bucket | ||
uuid = "7B60D7D1-9E13-46FF-B64C-FBDE76ED66FF" | ||
type = "1" | ||
version = "2.0"> | ||
</Bucket> |
14 changes: 14 additions & 0 deletions
14
...entControl.xcodeproj/xcuserdata/swasalunke.xcuserdatad/xcschemes/xcschememanagement.plist
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SchemeUserState</key> | ||
<dict> | ||
<key>SwiftUI-SegmentControl.xcscheme_^#shared#^_</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>0</integer> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
37 changes: 37 additions & 0 deletions
37
SwiftUI-Segment/SwiftUI-SegmentControl/SwiftUI-SegmentControl/AppDelegate.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// AppDelegate.swift | ||
// SwiftUI-SegmentControl | ||
// | ||
// Created by Salunke, Swapnil Uday (US - Mumbai) on 26/07/20. | ||
// Copyright © 2020 Swapnil Salunke. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
@UIApplicationMain | ||
class AppDelegate: UIResponder, UIApplicationDelegate { | ||
|
||
|
||
|
||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | ||
// Override point for customization after application launch. | ||
return true | ||
} | ||
|
||
// MARK: UISceneSession Lifecycle | ||
|
||
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { | ||
// Called when a new scene session is being created. | ||
// Use this method to select a configuration to create the new scene with. | ||
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) | ||
} | ||
|
||
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { | ||
// Called when the user discards a scene session. | ||
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. | ||
// Use this method to release any resources that were specific to the discarded scenes, as they will not return. | ||
} | ||
|
||
|
||
} | ||
|
98 changes: 98 additions & 0 deletions
98
...UI-SegmentControl/SwiftUI-SegmentControl/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "60x60" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "60x60" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "76x76" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "76x76" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "83.5x83.5" | ||
}, | ||
{ | ||
"idiom" : "ios-marketing", | ||
"scale" : "1x", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
SwiftUI-Segment/SwiftUI-SegmentControl/SwiftUI-SegmentControl/Assets.xcassets/Contents.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...-Segment/SwiftUI-SegmentControl/SwiftUI-SegmentControl/Base.lproj/LaunchScreen.storyboard
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<!--View Controller--> | ||
<scene sceneID="EHf-IW-A2E"> | ||
<objects> | ||
<viewController id="01J-lp-oVM" sceneMemberID="viewController"> | ||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> | ||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> | ||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> | ||
</view> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="53" y="375"/> | ||
</scene> | ||
</scenes> | ||
</document> |
26 changes: 26 additions & 0 deletions
26
SwiftUI-Segment/SwiftUI-SegmentControl/SwiftUI-SegmentControl/ContactDetails.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// ContactDetails.swift | ||
// SwiftUI-SegmentControl | ||
// | ||
// Created by Salunke, Swapnil Uday (US - Mumbai) on 26/07/20. | ||
// Copyright © 2020 Swapnil Salunke. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ContactDetails: View { | ||
var contactDetail: ContactInfo | ||
var body: some View { | ||
VStack { | ||
Text(contactDetail.name) | ||
Text(contactDetail.email) | ||
Text(contactDetail.number) | ||
} | ||
} | ||
} | ||
|
||
struct ContactDetails_Previews: PreviewProvider { | ||
static var previews: some View { | ||
ContactDetails(contactDetail: ContactInfo(name: "Robert", email: "robert@apple.com", number: "1234567890")) | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
SwiftUI-Segment/SwiftUI-SegmentControl/SwiftUI-SegmentControl/ContactInfo.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// ContactInfo.swift | ||
// SwiftUI-SegmentControl | ||
// | ||
// Created by Salunke, Swapnil Uday (US - Mumbai) on 26/07/20. | ||
// Copyright © 2020 Swapnil Salunke. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ContactInfo: Identifiable, Hashable { | ||
let id = UUID() | ||
let name: String | ||
let email: String | ||
let number: String | ||
|
||
static func getDummyData() -> [ContactInfo] { | ||
return [ContactInfo(name: "John", email: "john@apple.com", number: "1234567890"), | ||
ContactInfo(name: "Robert", email: "robert@apple.com", number: "1234567890"), | ||
ContactInfo(name: "Albert", email: "ablert@apple.com", number: "1234567890"), | ||
ContactInfo(name: "Tim", email: "tim@apple.com", number: "1234567890"), | ||
ContactInfo(name: "Steve", email: "steve@apple.com", number: "1234567890"), | ||
ContactInfo(name: "Bruce", email: "john@apple.com", number: "1234567890"), | ||
ContactInfo(name: "Stephanie", email: "stephanie@apple.com", number: "1234567890"), | ||
ContactInfo(name: "Michelle", email: "michelle@apple.com", number: "1234567890"), | ||
ContactInfo(name: "Dorothy", email: "dorothy@apple.com", number: "1234567890")] | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
SwiftUI-Segment/SwiftUI-SegmentControl/SwiftUI-SegmentControl/ContactsUI.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// ContactsUI.swift | ||
// SwiftUI-SegmentControl | ||
// | ||
// Created by Salunke, Swapnil Uday (US - Mumbai) on 26/07/20. | ||
// Copyright © 2020 Swapnil Salunke. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ContactsUICell: View { | ||
@State private var isShowingAlert = false | ||
|
||
let contactInfo: ContactInfo | ||
var body: some View { | ||
HStack { | ||
VStack(alignment: .leading, spacing: 5) { | ||
Text(contactInfo.name) | ||
.fontWeight(.bold) | ||
.font(.system(size: 18)) | ||
Text(contactInfo.email) | ||
.fontWeight(.semibold) | ||
.font(.system(size: 16)) | ||
} | ||
Spacer() | ||
Button(action: makeVideoCall){ | ||
Image(systemName: "message.fill") | ||
.frame(width: 40, height: 40, alignment: .center) | ||
.font(.body) | ||
.foregroundColor(Color.green) | ||
}.alert(isPresented: $isShowingAlert) { | ||
Alert(title: Text("In Progress"), message: Text("Once completed you will be able to send messages and make a call"), dismissButton: .default(Text("Got it"))) | ||
} | ||
} | ||
} | ||
|
||
func makeVideoCall() { | ||
|
||
} | ||
} | ||
|
||
struct ContactsUI_Previews: PreviewProvider { | ||
static var previews: some View { | ||
ContactsUICell(contactInfo: <#ContactInfo#>) | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
SwiftUI-Segment/SwiftUI-SegmentControl/SwiftUI-SegmentControl/ContactsUICell.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// | ||
// ContactsUICell.swift | ||
// SwiftUI-SegmentControl | ||
// | ||
// Created by Salunke, Swapnil Uday (US - Mumbai) on 26/07/20. | ||
// Copyright © 2020 Swapnil Salunke. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ContactsUICell: View { | ||
@State private var isShowingAlert = false | ||
|
||
let contactInfo: ContactInfo | ||
var body: some View { | ||
HStack { | ||
VStack(alignment: .leading, spacing: 5) { | ||
Text(contactInfo.name) | ||
.fontWeight(.bold) | ||
.font(.system(size: 18)) | ||
.foregroundColor(Color.black) | ||
Text(contactInfo.email) | ||
.fontWeight(.semibold) | ||
.font(.system(size: 14)) | ||
.foregroundColor(Color.black) | ||
} | ||
Spacer() | ||
Button(action: sendMessages){ | ||
Image(systemName: "message.fill") | ||
.frame(width: 40, height: 40, alignment: .center) | ||
.font(.body) | ||
.foregroundColor(Color.green) | ||
}.alert(isPresented: $isShowingAlert) { | ||
Alert(title: Text("In Progress"), message: Text("Once completed you will be able to send messages"), dismissButton: .default(Text("Got it"))) | ||
} | ||
|
||
Button(action: makeVideoCall){ | ||
Image(systemName: "video.fill") | ||
.frame(width: 40, height: 40, alignment: .center) | ||
.font(.body) | ||
.foregroundColor(Color.blue) | ||
}.alert(isPresented: $isShowingAlert) { | ||
Alert(title: Text("In Progress"), message: Text("Once completed you will be able to make a video call"), dismissButton: .default(Text("Got it"))) | ||
} | ||
}.padding(10) | ||
} | ||
|
||
func sendMessages() { | ||
self.isShowingAlert = true | ||
} | ||
|
||
func makeVideoCall() { | ||
self.isShowingAlert = true | ||
} | ||
} | ||
|
||
struct ContactsUI_Previews: PreviewProvider { | ||
static var previews: some View { | ||
ContactsUICell(contactInfo: ContactInfo(name: "John", email: "john@apple.com", number: "1234567890")) | ||
} | ||
} |
Oops, something went wrong.