Search results

  1. fukurou

    🐦swift swift grimoire

    Ternary Operator in Swift condition ? expression1 : expression2
  2. fukurou

    XCode grimoire

    defraculating a label set lines to 0 to have it add lines instead of trumping long strings and auto shrink to a minimum font size (15 in this example) the bigger the string the smaller the font will be
  3. fukurou

    XCode grimoire

    defraculating a progress bar set the height to > 1 to make it fatter than set the color and BG color with the tint property : :hmm: to see what a var type is select it and click option key
  4. fukurou

    XCode grimoire

    timer import UIKit class ViewController: UIViewController { let times: [String: Int] = ["soft":300, "medium":420,"hard":720] var secondsRamaining = 60 var timer = Timer() // declare the timer @IBAction func hardnessSelected(_ sender: UIButton) { secondsRamaining =...
  5. fukurou

    🐦swift swift grimoire

    switch with range switch x { case 80...90: print("x in range") case x..<10: print("x is small") case 50: print("50") default: print("Have you done something new?") } :hmm: ...10 can replace x..<10
  6. fukurou

    XCode grimoire

    link many buttons to one action drag click from the circle left to the code to the extra button while in assistant view (main->adjust editor options->assistant) import UIKit import AVFoundation class ViewController: UIViewController { var player: AVAudioPlayer! var tempSender...
  7. fukurou

    XCode grimoire

    re indent the code select the code->editor->structure->re-indent :hmm: in swift functions can have inner functions to see a functions scope choose a {} or move <> around the curly brackets
  8. fukurou

    XCode grimoire

    swift API Application Programming Interface https://developer.apple.com/documentation
  9. fukurou

    XCode grimoire

    play audio import UIKit import AVFoundation class ViewController: UIViewController { var player: AVAudioPlayer! override func viewDidLoad() { super.viewDidLoad() } @IBAction func keyPressed(_ sender: UIButton) { playSound() } func playSound()...
  10. fukurou

    How the hell do i get rid of this ugly font?

    and choose 2 or default
  11. fukurou

    XCode grimoire

    to pad a button set it's width to a value and address the error :
  12. fukurou

    XCode grimoire

    inside the views set the views constraints
  13. fukurou

    XCode grimoire

    setting stack view attributes set distribution to fill equally and play with the spacing : set embedding views background to default (which is see through) :
  14. fukurou

    XCode grimoire

    stack view constraints naming views : embed in a stack view finally add pin constraints to the stack view and set the pins relative to the safe area :
  15. fukurou

    XCode grimoire

    embedding views method 1 :add a UIView (+ btn from upper tool bar) and drag a view in to it : method 2 : select views->editor->embed in->view method 3 :select views and then click the embed button an error will prompt you to set the containing views constraints or a constraint embedding it:
  16. fukurou

    XCode grimoire

    pinned constraints if you place views without sufficient constraints it will err : setting alignment constraint (marked in the bottom toolbar with 2 rectangles) for the label : adding a pinned constraint (marked in the bottom toolbar with a square with 4 lines around it) so the view is...
  17. fukurou

    XCode grimoire

    alignment constraints these set an axis for a view so that it stays situated when the phone is rotated
  18. fukurou

    XCode grimoire

    constraints these glue the views using rules pin constraints ( background ) ^ set the trailing and leading attributes of the background constraints to the superview to stretchmax it all over the screen
  19. fukurou

    [MEDIA]

Top