Skip to content

Instantly share code, notes, and snippets.

@angelabauer
Created August 13, 2019 11:57
Show Gist options
  • Select an option

  • Save angelabauer/9d94ee98153b84681a63e7744077c9f0 to your computer and use it in GitHub Desktop.

Select an option

Save angelabauer/9d94ee98153b84681a63e7744077c9f0 to your computer and use it in GitHub Desktop.
//
// ViewController.swift
// Dicee-iOS13
//
// Created by Angela Yu on 11/06/2019.
// Copyright © 2019 London App Brewery. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var diceImageView1: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
diceImageView1.image = #imageLiteral(resourceName: "DiceSix")
//Who What Value
diceImageView1.alpha = 0.5
}
}
@juraabdullaev

Copy link
Copy Markdown

Keep Learning!!!
Screenshot 2022-11-08 at 07 53 01

@hi-pela

hi-pela commented Dec 13, 2022

Copy link
Copy Markdown

cool!
Screenshot 2022-12-13 at 23 12 05

@asherginting

Copy link
Copy Markdown

Good

image

@moldirs429

Copy link
Copy Markdown

Screenshot 2023-02-05 at 16 43 56

works!

@ITsarik22

ITsarik22 commented Feb 27, 2023

Copy link
Copy Markdown

Снимок экрана 2023-02-27 в 22 08 14

@ERaff83

ERaff83 commented May 28, 2023

Copy link
Copy Markdown

I'm getting a Thread1: breakpoint 1.6 (1) any guidance on how to fix it?

@nobalking

Copy link
Copy Markdown

I couldn't even prompt the imageliteral code, it's not exactly same as what showed on the tutorial. Anyone knows what code to type? Running on Xcode 14.3.1

@melekzurnaci

Copy link
Copy Markdown

@nobalking you can use like below

diceImageViewOne.image = UIImage(imageLiteralResourceName:"DiceSix");

@codebwoy

Copy link
Copy Markdown

Screenshot 2023-06-26 at 00 26 36

I am now starting to learn iOS development and finding it interesting. I hope i am not alone and not too late here!

@codebwoy

Copy link
Copy Markdown

I couldn't even prompt the imageliteral code, it's not exactly same as what showed on the tutorial. Anyone knows what code to type? Running on Xcode 14.3.1

@nobalking you are correct! i also experienced your problem. I think the problem was as a result of the newer version of xcode you are using, since it is newer than the one Angela used in the tutorial.

The real code should be diceImageView1.image = #imageLiteral()

You can also find more answers to your problems using stackoverflow.com. I hope this will help!

@codebwoy

Copy link
Copy Markdown

Screenshot 2023-06-26 at 01 14 28

new challlenge for rolling to dice 2 successful!

@wellbegen

Copy link
Copy Markdown

Screenshot 2023-07-06 at 5 34 19 PM

@wellbegen

Copy link
Copy Markdown

was great until i started the Alpha step , green background took over everything !?

@Polyrhythmik

Copy link
Copy Markdown

@wellbegen In the document outline pane you can sort the layers of objects by dragging each object. It looks like you need to move the background image to the back so that the other objects are visible.

@ShriGaneshPurohit

Copy link
Copy Markdown

Screenshot 2023-10-09 at 8 12 52 PM

new challenge for rolling to dice 2 successfully completed!

@Ayushjhax

Copy link
Copy Markdown

image
Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

i am getting this error

@Aadileb

Aadileb commented Feb 7, 2024

Copy link
Copy Markdown

can someone explain why its showing Five dots instead of four while doing opaq
Screenshot 2024-02-07 at 1 57 16 PM

@lilianaBasak

Copy link
Copy Markdown

Screenshot 2024-02-28 at 11 08 56 PM (2)
I'm trying to do this, but since the course is from 2019, it's not the same now, can someone show how they did it?

@Nandha2403

Nandha2403 commented Apr 4, 2024

Copy link
Copy Markdown

Screenshot 2024-04-04 at 4 46 15 PM
Haha

@Aryanmittal23

Copy link
Copy Markdown

import UIKit

class ViewController: UIViewController {

@IBOutlet weak var diceImageView1: UIImageView!

/// <#Description#>
override func viewDidLoad() {
    super.viewDidLoad()
    
    diceImageView1.image = #imageLiteral(resourceName: "DiceSix")
    diceImageView1.alpha = 0.5
}

}

@Instamac2891

Copy link
Copy Markdown

class ViewController: UIViewController {

@IBOutlet weak var diceImageView1: UIImageView!

override func viewDidLoad() {
    super.viewDidLoad()
   
    diceImageView1.image = #imageLiteral(resourceName: "DiceSix")
   diceImageView1.layer.opacity = 0.5
}

It works :)

@hansblockchain

Copy link
Copy Markdown

//
// ViewController.swift
// Dicee-iOS13
//
// Created by Angela Yu on 11/06/2019.
// Copyright © 2019 London App Brewery. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

@IBOutlet weak var diceImageView1: UIImageView!

override func viewDidLoad() {
    super.viewDidLoad()
   
    diceImageView1.image = UIImage(imageLiteralResourceName: "DiceSix")
    diceImageView1.alpha = 0.5
}

}

@PolunLin

Copy link
Copy Markdown
image

@White1689

Copy link
Copy Markdown
Screenshot 2024-10-04 at 22 30 49 The course is a nice course but it needs to be updated because Xcode has been updated and some features have changed.

@Rishuraj2003-cmd

Copy link
Copy Markdown
Screenshot 2024-12-28 at 22 26 44

i am just started learning ios development.

import UIKit

class ViewController: UIViewController {

@IBOutlet weak var diceImageView1: UIImageView!
@IBOutlet weak var diceImageView2: UIImageView!
override func viewDidLoad() {
    super.viewDidLoad()
    //Who           .What   Value
    diceImageView1.image = #imageLiteral(resourceName: "DiceFive")
    diceImageView1.alpha = 0.5
    
    diceImageView2.image=#imageLiteral(resourceName: "DiceTwo")
    diceImageView2.alpha=0.3
    
}

}

@nilcamprubi

Copy link
Copy Markdown

Captura de Pantalla 2022-07-08 a la(s) 14 42 22 "imageliteral" didn't work for me but using "UIImage" worked.

I believe it was deprecated after Xcode 14, now you need the UIImage constructor with the "named" parameter as you said.

@AshJ341

AshJ341 commented Apr 2, 2025

Copy link
Copy Markdown

Image 4-2-25 at 6 44 PM
I am really enjoying this class.

@sharmanityam252

Copy link
Copy Markdown

what the hack there is coming an error it dosen't come to the las vegas page i made

@Caioeduardo2104

Copy link
Copy Markdown
Captura de Tela 2025-09-23 às 17 36 26 This is my code in 2025, im so happy for this course, thanks Dr. Angela!!

@elbarbaryy

Copy link
Copy Markdown

the solution
Uploading Screenshot 2025-10-29 at 10.38.55 PM.png…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment