Skip to content

Commit

Permalink
Merge pull request #29 from ChoiysApple/Develop
Browse files Browse the repository at this point in the history
Version 1.3.0
  • Loading branch information
ChoiysApple committed Jun 17, 2021
2 parents 3bd5a57 + dd9254d commit 9a9e72d
Show file tree
Hide file tree
Showing 35 changed files with 862 additions and 116 deletions.
11 changes: 11 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Popcat' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for Popcat
pod 'MaterialComponents/BottomSheet'

end
44 changes: 44 additions & 0 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
PODS:
- MaterialComponents/Availability (124.2.0)
- MaterialComponents/BottomSheet (124.2.0):
- MaterialComponents/Elevation
- MaterialComponents/private/KeyboardWatcher
- MaterialComponents/private/Math
- MaterialComponents/ShadowElevations
- MaterialComponents/ShadowLayer
- MaterialComponents/ShapeLibrary
- MaterialComponents/Shapes
- MaterialComponents/Elevation (124.2.0):
- MaterialComponents/Availability
- MaterialComponents/private/Color
- MaterialComponents/private/Math
- MaterialComponents/private/Application (124.2.0)
- MaterialComponents/private/Color (124.2.0):
- MaterialComponents/Availability
- MaterialComponents/private/KeyboardWatcher (124.2.0):
- MaterialComponents/private/Application
- MaterialComponents/private/Math (124.2.0)
- MaterialComponents/ShadowElevations (124.2.0)
- MaterialComponents/ShadowLayer (124.2.0):
- MaterialComponents/ShadowElevations
- MaterialComponents/ShapeLibrary (124.2.0):
- MaterialComponents/private/Math
- MaterialComponents/Shapes
- MaterialComponents/Shapes (124.2.0):
- MaterialComponents/private/Color
- MaterialComponents/private/Math
- MaterialComponents/ShadowLayer

DEPENDENCIES:
- MaterialComponents/BottomSheet

SPEC REPOS:
trunk:
- MaterialComponents

SPEC CHECKSUMS:
MaterialComponents: 1a9b2d9d45b1601ae544de85089adc4c464306d4

PODFILE CHECKSUM: 03dfe97db818d3ffbe607abec6c89e84caa670e4

COCOAPODS: 1.10.1
112 changes: 97 additions & 15 deletions Popcat.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions Popcat.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Popcat.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file modified Popcat/.DS_Store
Binary file not shown.
56 changes: 56 additions & 0 deletions Popcat/Assets.xcassets/Github_logo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"images" : [
{
"filename" : "github-light.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "github-dark.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions Popcat/Assets.xcassets/instagram_logo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "instagram.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions Popcat/Assets.xcassets/testflight_logo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "testflight.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
183 changes: 135 additions & 48 deletions Popcat/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

19 changes: 18 additions & 1 deletion Popcat/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ struct Identifier {
static let settingSegue = "mainToSettings"
static let mainViewController = "MainViewController"
static let SettingsTableViewCell = "SettingsCell"
static let DeveloperPageViewController = "DeveloperView"
static let DeveloperPageCell = "developerCell"
}

struct UserDataKey {
Expand All @@ -23,8 +25,23 @@ struct UserDataKey {
static let currentCatName = "current_cat"
static let touchDownImage = "touchdown_image"
static let touchUpImage = "touchup_image"
static let popSound = "pop_sound"
static let mainImage = "main_image"

static let popSound = "pop_sound"
static let popVolume = "pop_volume"

static let background = "background"
}

struct DeveloperInfo {
static let name = "Daegun Choi"
static let description = "Visit GitHub for more"
}

var currentVersion: String {
guard let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String else { return "unidentified" }
let currentVersion: String = "\(version)"

return currentVersion
}

80 changes: 80 additions & 0 deletions Popcat/Contoller/DeveloperInfoViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
//
// DeveloperInfoViewController.swift
// Popcat
//
// Created by Daegeon Choi on 2021/06/16.
//

import UIKit

class DeveloperInfoViewController: UIViewController {

@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var descriptionLabel: UILabel!
@IBOutlet weak var tableView: UITableView!

override func viewDidLoad() {
super.viewDidLoad()

nameLabel.text = DeveloperInfo.name
descriptionLabel.text = DeveloperInfo.description

tableView.isScrollEnabled = false
// Do any additional setup after loading the view.
}

}

extension DeveloperInfoViewController: UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}

func numberOfSections(in tableView: UITableView) -> Int {
return DeveloperInfoSection.allCases.count
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = UITableViewCell(style: UITableViewCell.CellStyle.subtitle, reuseIdentifier: Identifier.DeveloperPageCell)
guard let section = DeveloperInfoSection(rawValue: indexPath.section) else { return UITableViewCell() }

cell.textLabel?.text = section.title
cell.detailTextLabel?.text = section.subtitle
cell.imageView?.image = UIImage(named: section.imageSourceName)
cell.imageView?.layer.cornerRadius = 13
cell.imageView?.layer.masksToBounds = true

return cell
}

}

extension DeveloperInfoViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 50
}

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

guard let section = DeveloperInfoSection(rawValue: indexPath.section) else { return }

if let url = URL(string: section.pageURL) {
UIApplication.shared.open(url)
}

tableView.cellForRow(at: indexPath)?.isSelected = false
}

func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0.0
}

func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if section != DeveloperInfoSection.allCases.count - 1 {
return 10
}else{
return 0
}

}
}
10 changes: 6 additions & 4 deletions Popcat/Contoller/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MainViewController: UIViewController {
private var touchUpImageSource: UIImage?

//MARK: Helper Classes
private var touchEvent = TouchEventManager()
private var touchEvent = TouchEventManager(source: defaultAssetData.audioSourceName, volume: 1.0)
private let dataManager = UserDataManager()

// Timer related
Expand All @@ -39,15 +39,15 @@ class MainViewController: UIViewController {
dataManager.setIsInitialLaunch(isFirst: true)

dataManager.setCatData(catData: defaultAssetData)
dataManager.setPopSoundVolume(volume: 1.0)
}

touchEvent.delegate = self
}

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

updateViewSettings()
touchEvent.delegate = self
}

}
Expand Down Expand Up @@ -119,7 +119,9 @@ extension MainViewController {
touchDownImageSource = UIImage(named: catData.openedImageName)
popcatImage.image = touchUpImageSource

touchEvent.setAudioSource(audioSource: catData.audioSourceName)
let popSoundVolume = dataManager.getPopSoundVolume()

touchEvent = TouchEventManager(source: catData.audioSourceName, volume: popSoundVolume)
timer.invalidate()
}

Expand Down
Loading

0 comments on commit 9a9e72d

Please sign in to comment.