-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #372 from boostcampwm2023/iOS/task/SwiftUI-Components
[iOS] MSButton SwiftUI 포팅
- Loading branch information
Showing
108 changed files
with
416 additions
and
172 deletions.
There are no files selected for viewing
This file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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
File renamed without changes.
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// Bundle+.swift | ||
// MSDesignSystem | ||
// | ||
// Created by 이창준 on 2024.02.19. | ||
// | ||
|
||
import Foundation | ||
|
||
public class MSBundle { | ||
public static let bundle = Bundle(for: MSBundle.self) | ||
} | ||
|
||
extension Bundle { | ||
|
||
#if SWIFT_PACKAGE | ||
public static var msDesignSystem: Bundle { | ||
return .module | ||
} | ||
#else | ||
public static var msDesignSystem: Bundle { | ||
return Bundle(for: MSBundle.self) | ||
} | ||
#endif | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
iOS/MSFusion/Sources/MSDesignSystem/Color/MSColor+SwiftUI.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// MSColor+SwiftUI.swift | ||
// MSDesignSystem | ||
// | ||
// Created by 이창준 on 2024.02.19. | ||
// | ||
|
||
import SwiftUI | ||
|
||
extension Color { | ||
|
||
public static func msColor(_ color: MSColor) -> Color { | ||
return Color(color.rawValue, bundle: .msDesignSystem) | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
iOS/MSFusion/Sources/MSDesignSystem/Color/MSColor+UIKit.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// MSColor+UIKit.swift | ||
// MSDesignSystem | ||
// | ||
// Created by 이창준 on 2024.02.19. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIColor { | ||
|
||
public static func msColor(_ color: MSColor) -> UIColor { | ||
return UIColor(named: color.rawValue, in: .msDesignSystem, compatibleWith: .current)! | ||
} | ||
|
||
} |
This file contains 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
25 changes: 25 additions & 0 deletions
25
iOS/MSFusion/Sources/MSDesignSystem/Font/MSFont+SwiftUI.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// MSFont+SwiftUI.swift | ||
// MSDesignSystem | ||
// | ||
// Created by 이창준 on 2024.02.19. | ||
// | ||
|
||
import SwiftUI | ||
|
||
extension MSFont { | ||
|
||
fileprivate func font() -> Font? { | ||
let details = self.fontDetails | ||
return Font.custom(details.fontName, size: details.size) | ||
} | ||
|
||
} | ||
|
||
public extension Font { | ||
|
||
static func msFont(_ font: MSFont) -> Font? { | ||
return font.font() | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
iOS/MSFusion/Sources/MSDesignSystem/Font/MSFont+UIKit.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// MSFont+UIKit.swift | ||
// MSDesignSystem | ||
// | ||
// Created by 이창준 on 2024.02.19. | ||
// | ||
|
||
import UIKit | ||
|
||
extension MSFont { | ||
|
||
fileprivate func font() -> UIFont? { | ||
let details = self.fontDetails | ||
return UIFont(name: details.fontName, size: details.size) | ||
} | ||
|
||
} | ||
|
||
public extension UIFont { | ||
|
||
static func msFont(_ font: MSFont) -> UIFont? { | ||
return font.font() | ||
} | ||
|
||
} | ||
|
Oops, something went wrong.