Giter Site home page Giter Site logo

sprinkle-of-yeezus's People

Contributors

andrewboryk avatar emb4 avatar

Stargazers

Chris Corrado avatar

Forkers

andrewboryk

sprinkle-of-yeezus's Issues

Refactor of Settings.swift

class SettingsPage: UIViewController {
@IBOutlet weak var InfoLabel: UILabel!
@IBOutlet weak var DescButton: UIButton!
@IBOutlet weak var DescLabel: UILabel!
@IBOutlet weak var Switch: UISwitch!
var notificationsOn = Bool()
@IBAction func NotificationSwitch(_ sender: UISwitch) {
if Switch.isOn == true{
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound], completionHandler: {didAllow, error in})
DescLabel.isHidden = false
DescButton.isHidden = false
notificationsOn = true
} else {
DescLabel.isHidden = true
DescButton.isHidden = true
notificationsOn = false
}
}
@IBOutlet weak var TimePicked: UIDatePicker!
var sprinkleTimePicked = Date()
@IBAction func TimePicker(_ sender: UIDatePicker){
sprinkleTimePicked = TimePicked.date
}
func sprinkleNotifications(_ sprinkleList: Array<Sprinkle>) {
if notificationsOn == true{
let notification = UNMutableNotificationContent()
let notificationText = pickRandomQuote(sprinkleList)
notification.body = " \"\(notificationText.quote)\" \(notificationText.quoteSource), \(notificationText.date)"
let timeForSprinkle = TimePicked.date
let components = Calendar.current.dateComponents([.hour, .minute], from: timeForSprinkle)
InfoLabel.text = "Sprinkles will be sent every day at \(components.hour):\(components.minute)"
let notificationTime = UNCalendarNotificationTrigger(dateMatching: components, repeats: true)
}
}
override func viewDidLoad() {
sprinkleNotifications(sprinkleList)
}
}

Hey Eric! I looked over the file you asked me to, and I'm available to walk you through ways you can go about accomplishing this task.

I figured that first we could go over the structure of your code, so that way we could build a consistency across the project so that if other people submit code then they will do so in the format you desire.

Let me know what you'd like to do!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.