Skip to content

Commit

Permalink
Merge branch 'iOS/release' into iOS/task/SpotScene-Resolve-Conflict
Browse files Browse the repository at this point in the history
# Conflicts:
#	iOS/MSCoreKit/Sources/MSNetworking/APIURL.swift
#	iOS/MusicSpot/MusicSpot/SceneDelegate.swift
  • Loading branch information
SwiftyJunnos committed Nov 30, 2023
2 parents 4b1bde4 + 059828d commit 700d0fc
Show file tree
Hide file tree
Showing 44 changed files with 2,628 additions and 15 deletions.
48 changes: 48 additions & 0 deletions iOS/Features/Home/Sources/NavigateMap/Model/NavigateMapModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// NavigateMapModel.swift
// Home
//
// Created by 윤동주 on 11/26/23.
//

import Foundation

struct Song {
var id: UUID
var title: String
var atrwork: String
}

struct JourneyMetadata {
var date: Date
}

struct Coordinate {
var latitude: Double
var longitude: Double
}

struct Spot {
var id: UUID
var coordinate: Coordinate
var photo: String?
var w3w: String
}

public struct Journey {
var id: UUID
var title: String
var metadata: JourneyMetadata
var spots: [Spot]
var coordinates: [Coordinate]
var song: Song
var lineColor: String

}

public struct User {
var email: String
var journeys: [Journey]
public var isRecording: Bool
var coordinate: Coordinate
}
8 changes: 0 additions & 8 deletions iOS/Features/Home/Sources/NavigateMap/NavigateMap.swift

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// CustomMarkerAnnotation.swift
// Home
//
// Created by 윤동주 on 11/23/23.
//

import Foundation
import CoreLocation
import MapKit

class CustomMarkerAnnotation: NSObject, MKAnnotation {

// MARK: - Properties

var id: UUID
var coordinate: CLLocationCoordinate2D
var timestamp: String
var photo: Data

// MARK: - Initializer

init(id: UUID,
coordinate: CLLocationCoordinate2D,
timestamp: String,
photo: Data) {
self.id = id
self.coordinate = coordinate
self.timestamp = timestamp
self.photo = photo
}

}
43 changes: 43 additions & 0 deletions iOS/Features/Home/Sources/NavigateMap/View/MapView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// MapView.swift
// Home
//
// Created by 윤동주 on 11/28/23.
//

import Foundation
import UIKit
import MapKit

class MapView: UIView {

// MARK: - Properties

let centerbutton = UIButton()
let map = MKMapView()

// MARK: - Initializer

override init(frame: CGRect) {
super.init(frame: frame)

self.addSubview(map)
self.addSubview(centerbutton)
configureLayout()
}

required init?(coder: NSCoder) {
fatalError()
}

// MARK: - UI Configuration

func configureLayout() {

centerbutton.setTitle("시작하기", for: .normal)
centerbutton.backgroundColor = .darkGray
centerbutton.setTitleColor(.yellow, for: .normal)
centerbutton.layer.cornerRadius = 12
}

}
152 changes: 152 additions & 0 deletions iOS/Features/Home/Sources/NavigateMap/View/NavigateMapButtonView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
//
// NavigateMapButtonView.swift
// Home
//
// Created by 윤동주 on 11/22/23.
//

import UIKit

enum ButtonImage: String {
case setting = "gearshape.fill",
map = "map.fill",
location = "mappin"
}

/// HomeMap 내의 버튼들을 감싸는 View
final class NavigateMapButtonView: UIView {

// MARK: - Properties

private var buttonStackView: ButtonStackView = {
let view = ButtonStackView()
return view
}()

// Button별 기능 주입
var settingButtonAction: (() -> Void)? {
didSet {
buttonStackView.settingButtonAction = settingButtonAction
}
}

var mapButtonAction: (() -> Void)? {
didSet {
buttonStackView.mapButtonAction = mapButtonAction
}
}

var locationButtonAction: (() -> Void)? {
didSet {
buttonStackView.locationButtonAction = locationButtonAction
}
}

// MARK: - Life Cycle

override init(frame: CGRect) {
super.init(frame: frame)
configureStyle()
configureLayout()
}

required init(coder: NSCoder) {
fatalError("MusicSpot은 code-based로만 작업 중입니다.")
}

// MARK: - Functions

private func configureStyle() {
backgroundColor = .lightGray
layer.cornerRadius = 8
}

private func configureLayout() {
addSubview(buttonStackView)
buttonStackView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
buttonStackView.topAnchor.constraint(equalTo: topAnchor, constant: 16),
buttonStackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 12),
buttonStackView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -12),
buttonStackView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -16)
])
}

}

/// HomeMap 내 3개 버튼 StackView
class ButtonStackView: UIStackView {

// MARK: - Properties

var settingButtonAction: (() -> Void)?
var mapButtonAction: (() -> Void)?
var locationButtonAction: (() -> Void)?

// MARK: - Life Cycle

override init(frame: CGRect) {
super.init(frame: frame)
configureLayout()
}

required init(coder: NSCoder) {
fatalError("MusicSpot은 code-based로만 작업 중입니다.")
}

// MARK: - Functions

private func configureLayout() {
axis = .vertical
spacing = 24
alignment = .fill
distribution = .fillEqually
translatesAutoresizingMaskIntoConstraints = false

let settingButton = self.createButton(image: ButtonImage.setting)
settingButton.addTarget(self, action: #selector(settingButtondidTap), for: .touchUpInside)
let mapButton = self.createButton(image: ButtonImage.map)
mapButton.addTarget(self, action: #selector(mapButtondidTap), for: .touchUpInside)
let locationButton = self.createButton(image: ButtonImage.location)
locationButton.addTarget(self, action: #selector(locationButtondidTap), for: .touchUpInside)

addArrangedSubview(settingButton)
addArrangedSubview(mapButton)
addArrangedSubview(locationButton)
}

private func createButton(image: ButtonImage) -> UIButton {
let button = UIButton()
button.translatesAutoresizingMaskIntoConstraints = false

if #available(iOS 13.0, *) {
let symbolImage = UIImage(systemName: image.rawValue)
button.setImage(symbolImage, for: .normal)
} else {
// Fallback on earlier versions
}
button.imageView?.tintColor = .black

button.layer.borderColor = UIColor.black.cgColor
button.widthAnchor.constraint(equalToConstant: 24).isActive = true
button.heightAnchor.constraint(equalToConstant: 24).isActive = true
button.translatesAutoresizingMaskIntoConstraints = false

return button
}

// MARK: - Object Functions

@objc private func settingButtondidTap() {
settingButtonAction?()
}

@objc private func mapButtondidTap() {
mapButtonAction?()
}

@objc private func locationButtondidTap() {
locationButtonAction?()
}

}
Loading

0 comments on commit 700d0fc

Please sign in to comment.