Swiftpack.co - Package - Changemin/CMOneBorderBox
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.

Project logo

😜 CMOneBorderBox 😜

License Release


Simple and well-designed Box View Modifier for SwiftUI

🏁 Getting Started

Requirements

  • Xcode 11+
  • SwiftUI
  • iOS 14+
  • macOS 10.15+

Installaion

Swift Package Manager(SPM)

File ➜ Swift Packages ➜ Add Package Dependancy..
.package(url: "https://github.com/CM-Material/CMBorderBox", from: "1.0.0")

🎈Usage

CMBorderBox(edge: Edge.Set, color: Color, width: CGFloat, cornerRadius: CGFloat)
// or
someView.CMBorderBox()
  • edge : where to put the bordr
  • color : accent color of the border
  • width : Width of the border
  • cornerRadius : Corner radius of the box.

Example

👶 Simple

import CMOneBorderBox

struct ContentView: View {
    var body: some View {
        Text("Hello, World!").CMOneBorderBox()
    }
}

Result

🎨 Accent Color

import CMOneBorderBox

struct ContentView: View {
    var body: some View {
        Text("Hello, World!").CMOneBorderBox(color: Color.orange)
    }
}

Result

🧰 Custom Usage

import CMOneBorderBox

struct ContentView: View {
    var body: some View {
        Text("Hello, World!").CMOneBorderBox(edge: .top, color: Color.red, width: 5, cornerRadius: 0)
    }
}

Result

📜 License

CMOneBorderBox is available under the MIT license. See the LICENSE file for more info.

✍️ Author

Github

link
Stars: 0

Releases

Version 1.0.0 - 2021-01-11T23:59:28

First Release