Skip to content

Commit

Permalink
Added macOS support
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmaddux committed Feb 4, 2020
1 parent 1981fd1 commit 2681164
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 27 deletions.
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import PackageDescription
let package = Package(
name: "FASwiftUI",
platforms: [
.iOS(.v13)
.iOS(.v13),
.macOS(.v10_15)
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct ContentView: View {

![Regualr Icon Screenshot](https://raw.githubusercontent.com/mattmaddux/FASwiftUI/master/icon-red.png)

Have the user select an icon with an easy string binding
Have the user select an icon with an easy string binding (not available on macOS)

```swift
import SwiftUI
Expand Down
29 changes: 4 additions & 25 deletions Sources/FASwiftUI/FAPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import SwiftUI
import QGrid

#if os(iOS)

struct FASearchBar: View {

@Environment(\.colorScheme) var colorScheme: ColorScheme
Expand Down Expand Up @@ -49,14 +51,6 @@ struct FAPickerCell: View {
.frame(width: 55, height: 55)
}
}
// Button(action: {
// self.selected = self.icon
// }, label: {
// FAText(icon: icon, size: 35)
// .foregroundColor(colorScheme == .light ? Color.black : Color.white)
// .frame(width: 55, height: 55)
// })
// .background(selected == icon ? (colorScheme == .light ? Color.black.opacity(0.2) : Color.white.opacity(0.2)) : Color.clear)
.cornerRadius(5)
}
}
Expand Down Expand Up @@ -85,8 +79,6 @@ public struct FAPicker: View {
hSpacing: 10,
vPadding: 10,
hPadding: 10) { icon in
// Text("Hello")
// FAPickerCell(icon: icon, selected: self.$selected)
FAPickerCell(icon: icon, action: {
self.selected = icon.id
self.showing = false
Expand All @@ -107,22 +99,9 @@ public struct FAPicker: View {
}
}
.navigationBarTitle("Icon Search", displayMode: .inline)
// .navigationBarItems(leading:
// Button(action: {
// self.selected = self.initialSelection
// self.showing = false
// }) {
// Text("Cancel")
// },
// trailing:
// Button(action: {
// print("Done")
// }) {
// Text("Done")
// .disabled(self.selected == nil)
// }
// )
}
}

}

#endif

0 comments on commit 2681164

Please sign in to comment.