This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "name": "Alabama", | |
| "abbreviation": "AL" | |
| }, | |
| { | |
| "name": "Alaska", | |
| "abbreviation": "AK" | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "id": 0, | |
| "singer": "Ciara", | |
| "title": "Level Up" | |
| }, | |
| { | |
| "id": 1, | |
| "singer": "U2", | |
| "title": "Elevation" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if #available(iOS 11, *) { | |
| self.clipsToBounds = true | |
| self.layer.cornerRadius = radius | |
| var masked = CACornerMask() | |
| if corners.contains(.topLeft) { masked.insert(.layerMinXMinYCorner) } | |
| if corners.contains(.topRight) { masked.insert(.layerMaxXMinYCorner) } | |
| if corners.contains(.bottomLeft) { masked.insert(.layerMinXMaxYCorner) } | |
| if corners.contains(.bottomRight) { masked.insert(.layerMaxXMaxYCorner) } | |
| self.layer.maskedCorners = masked | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import AVFoundation | |
| class AudioHelper: NSObject, AVAudioPlayerDelegate { | |
| var player: AVAudioPlayer? | |
| class var defaultHelper: AudioHelper { | |
| struct Static { | |
| static let instance: AudioHelper = AudioHelper() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var today = "Wednesday" | |
| //1. if | |
| if today == "Friday" { | |
| print("Play 'Last Friday Night' by Katy Perry") | |
| } | |
| //2. if-else | |
| if today == "Friday" { | |
| print("Play 'Last Friday Night' by Katy Perry") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| /* 1. | |
| Some people LOVE music. They listen to music almost all the time, more than 50 times per day. Let's call them the 'Music Junkie'. | |
| Some other occasionally listen to music. They listen to music 10 to 50 times per day. Let's call them the 'Music Enjoyer'. | |
| And some other choose not to have music at all. So, zero times. Let's call them 'No-music Folk'. | |
| |-------------------- |--------------------------------- | | |
| |numberOfPlayedMusic | Print Result | | |
| |-------------------- |--------------------------------- | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* 1. | |
| This is the lyric of Finger Family: | |
| ----- | |
| daddy finger, daddy finger | |
| where are you? | |
| here I am, here I am | |
| how do you do? | |
| mommy finger, mommy finger |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| This is the lyric of Baby Shark: | |
| ----- | |
| Baby shark, doo doo doo doo doo doo | |
| Baby shark, doo doo doo doo doo doo | |
| Baby shark, doo doo doo doo doo doo | |
| Baby shark! | |
| Mommy shark, doo doo doo doo doo doo | |
| Mommy shark, doo doo doo doo doo doo |
OlderNewer