-
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
0d743ab
commit 71b7eb5
Showing
11 changed files
with
305 additions
and
46 deletions.
There are no files selected for viewing
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
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
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...ystemSampleApp/ViewControllers/File.swift → ...llers/Sub/BottomSheetViewController.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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
59 changes: 59 additions & 0 deletions
59
...SystemSampleApp/DealiDesignSystemSampleApp/ViewControllers/Sub/SwitchViewController.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,59 @@ | ||
// | ||
// SwitchViewController.swift | ||
// DealiDesignSystemSampleApp | ||
// | ||
// Created by 윤조현 on 2023/11/09. | ||
// Copyright © 2023 Dealicious Inc. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import DealiDesignKit | ||
|
||
final class SwitchViewController: UIViewController { | ||
let enableSwitch = DealiSwitch() | ||
|
||
override func loadView() { | ||
self.view = .init() | ||
|
||
self.view.backgroundColor = .systemBackground | ||
|
||
self.view.addSubview(enableSwitch) | ||
enableSwitch.style = .iosSystem | ||
enableSwitch.addTarget(self, action: #selector(systemSwitchValueChanged), for: .valueChanged) | ||
enableSwitch.snp.makeConstraints { | ||
$0.center.equalToSuperview() | ||
} | ||
|
||
let disableOffSwitch = DealiSwitch() | ||
self.view.addSubview(disableOffSwitch) | ||
disableOffSwitch.then { | ||
$0.isEnabled = false | ||
}.snp.makeConstraints { | ||
$0.centerX.equalToSuperview() | ||
$0.top.equalTo(enableSwitch.snp.bottom).offset(20.0) | ||
} | ||
|
||
|
||
let disableOnSwitch = DealiSwitch(style: .andriodSystem) | ||
self.view.addSubview(disableOnSwitch) | ||
disableOnSwitch.then { | ||
$0.setOn(false, animated: true) | ||
}.snp.makeConstraints { | ||
$0.centerX.equalToSuperview() | ||
$0.top.equalTo(disableOffSwitch.snp.bottom).offset(20.0) | ||
} | ||
} | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
|
||
} | ||
|
||
@objc func systemSwitchValueChanged() { | ||
print(self.enableSwitch.isOn) | ||
} | ||
} | ||
|
||
|
||
|
File renamed without changes.
Oops, something went wrong.