Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amanda/ui features #30

Open
wants to merge 9 commits into
base: pheonix
Choose a base branch
from
Open

Amanda/ui features #30

wants to merge 9 commits into from

Conversation

ahinchman1
Copy link
Member

@ahinchman1 ahinchman1 commented Mar 12, 2017

Added KDIC image. Closes #29

@alexthemitchell alexthemitchell changed the base branch from master to pheonix March 12, 2017 17:43
Copy link
Member

@alexthemitchell alexthemitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll get you higher resolution images today at the meeting, so I'm going to withhold approval for now until these changes are made.

@@ -7,16 +7,22 @@ class PlayerViewController: UIViewController {
@IBOutlet weak var subtitleLabel: UILabel!
@IBOutlet weak var imageView: UIImageView!

@IBOutlet weak var KDICPhoto: UIImageView!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the same as imageView.

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
print("About to play")
KDICPlayer.play()
print("Playing!")
}


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Extraneous newline

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -20,6 +20,7 @@ open class KDICPlayer {
player.pause()
}

/** to fix **/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've made a ticket, so you can remove this comment.

Alternatively, if you'd like to keep it, we should use proper Swift documentation syntax. You can find information on that here. (Hint: There is a tag called Bug.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you choose to do the documentation, make sure you reference the github issue number in the comment (#29).

@alexthemitchell
Copy link
Member

Also, make sure that you submit pull requests which merge into the pheonix branch. This one originally was trying to merge into master.

Copy link
Member

@alexthemitchell alexthemitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also remove the Screen Shot file from the repository (git rm --cached KDIC/Base.lproj/Screen\ Shot\ 2017-03-08\ at\ 5.54.02\ PM.png). Otherwise this looks really great!

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
print("About to play")
KDICPlayer.play()
print("Playing!")
}


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix.

open class KDICPlayer {
private static var player: AVPlayer = {
let asset = AVURLAsset(url: streamURL)
let playerItem = AVPlayerItem(asset: asset)
//
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}

/** to fix **/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

open class func toggle() {
if isPlaying {
if isPlaying == true {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must we use == here? Can't we just do if isPlaying?

@@ -3,29 +3,40 @@ import AVFoundation

private let streamURL = URL(string: "http://kdic.grinnell.edu/stream")!

let kdicInstance = KDICPlayer();

private var isPlaying = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try private(set) var isPlaying = false This will resolve my comment below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

pause()
} else {
play()
}
}

open func currentlyPlaying() -> Bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a semi-public property above to make a private setter with a public getter. I put some code above. Please then remove this function.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done(?) Please check this one real quick

@@ -3,29 +3,40 @@ import AVFoundation

private let streamURL = URL(string: "http://kdic.grinnell.edu/stream")!

let kdicInstance = KDICPlayer();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just call this variable player?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, do you ever use this variable? I don't think we need it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, you're right I don't even use it lol

@ahinchman1 ahinchman1 self-assigned this Mar 13, 2017
Copy link
Member

@alexthemitchell alexthemitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also use the git command I posted earlier to remove the screenshot.

}

open class func toggle() {
if isPlaying {
if isPlaying == true {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to have == true here? Please remove if it compiles without it. isPlaying is a Bool.

open class KDICPlayer {
private static var player: AVPlayer = {
let asset = AVURLAsset(url: streamURL)
let playerItem = AVPlayerItem(asset: asset)
let currentlyPlaying = isPlaying;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You never use this binding.

@@ -3,25 +3,28 @@ import AVFoundation

private let streamURL = URL(string: "http://kdic.grinnell.edu/stream")!

private(set) var isPlaying = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in the class, like on line 9.

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
print("About to play")
KDICPlayer.play()
print("Playing!")
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Extraneous newline.

@RoyHarvey
Copy link

Hi -- just pulled latest and hit this issue... Please ignore if this is known and/or already in progress:

"Type ANY has no subscript members..."

File: FeedViewController.swift

func loadTableData(_ day: String){
    let scheduleDictionary = self.kdicScrapperReqs!.jsonDictionary!["data"]![day]! as! NSDictionary as Dictionary
    
    self.dayScheduleKeysArray = Array(scheduleDictionary.keys)
    self.dayScheduleValuesArray = Array(scheduleDictionary.values)
    
    scheduleDataLoadingIndicator.stopAnimating()
    scheduleDataLoadingIndicator.isHidden = true
    
    self.scheduleTableView.reloadData()
}

===

Thanks

@alexthemitchell alexthemitchell mentioned this pull request Apr 9, 2017
Copy link
Member

@alexthemitchell alexthemitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KDIC/Base.lproj/Screen Shot 2017-03-08 at 5.54.02 PM.png still needs to be removed


self.imageView.image = UIImage(named: "Equalizer")

button.setImage(imgShell1, forState:.Normal);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work? Where is imgShell1 coming from? Same for coin in the next line.

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
print("About to play")
KDICPlayer.play()
print("Playing!")
}

func resizeImageWithAspect(image: UIImage,size: CGSize)->UIImage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this. You can use the Aspect Fill setting I showed you on the storyboard to adjust how the image appears in the UIImage view.

@Laelson
Copy link

Laelson commented May 8, 2017

How to solve this?
"Type ANY has no subscript members..."

File: FeedViewController.swift

thanks,

func loadTableData(_ day: String){
let scheduleDictionary = self.kdicScrapperReqs!.jsonDictionary!["data"]![day]! as! NSDictionary as Dictionary

self.dayScheduleKeysArray = Array(scheduleDictionary.keys)
self.dayScheduleValuesArray = Array(scheduleDictionary.values)

scheduleDataLoadingIndicator.stopAnimating()
scheduleDataLoadingIndicator.isHidden = true

self.scheduleTableView.reloadData()

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants