Files
2021-04-23 09:51:10 +02:00

56 lines
2.2 KiB
Swift
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// Copyright (c) 2021 Related Code - https://relatedcode.com
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import UIKit
//-----------------------------------------------------------------------------------------------------------------------------------------------
class NotificationView: UIViewController {
@IBOutlet var labelTitle: UILabel!
@IBOutlet var labelSubTitle: UILabel!
@IBOutlet var switchNotification: UISwitch!
@IBOutlet var labelDescription: UILabel!
//-------------------------------------------------------------------------------------------------------------------------------------------
override func viewDidLoad() {
super.viewDidLoad()
navigationItem.titleView = UIImageView(image: UIImage(systemName: "circles.hexagongrid.fill"))
navigationItem.rightBarButtonItem = UIBarButtonItem(image: UIImage(systemName: "xmark"), style: .done, target: self, action: #selector(actionClose))
loadData()
}
// MARK: - Data methods
//-------------------------------------------------------------------------------------------------------------------------------------------
func loadData() {
labelTitle.text = "Turn on\nnotifications"
labelSubTitle.text = "Meet new people, create posts, find friends and more."
switchNotification.isOn = true
labelDescription.text = "Enable notifications to make sure you don’t miss out the post from your friend"
}
// MARK: - User actions
//-------------------------------------------------------------------------------------------------------------------------------------------
@objc func actionClose() {
dismiss(animated: true)
}
//-------------------------------------------------------------------------------------------------------------------------------------------
@IBAction func actionNotification(_ sender: Any) {
print(#function)
}
}