Selecting provisioning profile
This commit is contained in:
parent
7e500cb37d
commit
6dcd8eb07a
@ -7,6 +7,7 @@
|
|||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
63B2CF622A16641500B80D2F /* FormButtonItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63B2CF612A16641500B80D2F /* FormButtonItem.swift */; };
|
||||||
7A064BE429DE107000C5D978 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A064BE329DE107000C5D978 /* Category.swift */; };
|
7A064BE429DE107000C5D978 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A064BE329DE107000C5D978 /* Category.swift */; };
|
||||||
7A064BE929DE18C700C5D978 /* SignInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A064BE829DE18C700C5D978 /* SignInfoView.swift */; };
|
7A064BE929DE18C700C5D978 /* SignInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A064BE829DE18C700C5D978 /* SignInfoView.swift */; };
|
||||||
7A064BEB29DF5BB800C5D978 /* AppPackage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A064BEA29DF5BB800C5D978 /* AppPackage.swift */; };
|
7A064BEB29DF5BB800C5D978 /* AppPackage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A064BEA29DF5BB800C5D978 /* AppPackage.swift */; };
|
||||||
@ -29,6 +30,7 @@
|
|||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
|
63B2CF612A16641500B80D2F /* FormButtonItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormButtonItem.swift; sourceTree = "<group>"; };
|
||||||
7A064BE329DE107000C5D978 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = "<group>"; };
|
7A064BE329DE107000C5D978 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = "<group>"; };
|
||||||
7A064BE829DE18C700C5D978 /* SignInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInfoView.swift; sourceTree = "<group>"; };
|
7A064BE829DE18C700C5D978 /* SignInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInfoView.swift; sourceTree = "<group>"; };
|
||||||
7A064BEA29DF5BB800C5D978 /* AppPackage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppPackage.swift; sourceTree = "<group>"; };
|
7A064BEA29DF5BB800C5D978 /* AppPackage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppPackage.swift; sourceTree = "<group>"; };
|
||||||
@ -80,6 +82,7 @@
|
|||||||
7A064BE829DE18C700C5D978 /* SignInfoView.swift */,
|
7A064BE829DE18C700C5D978 /* SignInfoView.swift */,
|
||||||
7AF0C53A29F72151008D4084 /* PlistView.swift */,
|
7AF0C53A29F72151008D4084 /* PlistView.swift */,
|
||||||
7A9478022A0984D200EC7329 /* FormPickerItem.swift */,
|
7A9478022A0984D200EC7329 /* FormPickerItem.swift */,
|
||||||
|
63B2CF612A16641500B80D2F /* FormButtonItem.swift */,
|
||||||
);
|
);
|
||||||
path = Views;
|
path = Views;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -228,6 +231,7 @@
|
|||||||
7AF0C53B29F72151008D4084 /* PlistView.swift in Sources */,
|
7AF0C53B29F72151008D4084 /* PlistView.swift in Sources */,
|
||||||
7AF0C51C29EF43CD008D4084 /* TreeItem.swift in Sources */,
|
7AF0C51C29EF43CD008D4084 /* TreeItem.swift in Sources */,
|
||||||
7AF0C51829EDCF59008D4084 /* URL+ExtendedAttributes.swift in Sources */,
|
7AF0C51829EDCF59008D4084 /* URL+ExtendedAttributes.swift in Sources */,
|
||||||
|
63B2CF622A16641500B80D2F /* FormButtonItem.swift in Sources */,
|
||||||
7A064BEB29DF5BB800C5D978 /* AppPackage.swift in Sources */,
|
7A064BEB29DF5BB800C5D978 /* AppPackage.swift in Sources */,
|
||||||
7A064BE929DE18C700C5D978 /* SignInfoView.swift in Sources */,
|
7A064BE929DE18C700C5D978 /* SignInfoView.swift in Sources */,
|
||||||
7AF0C54229FFBDB0008D4084 /* SignViewModel.swift in Sources */,
|
7AF0C54229FFBDB0008D4084 /* SignViewModel.swift in Sources */,
|
||||||
|
|||||||
23
reSign/Views/FormButtonItem.swift
Normal file
23
reSign/Views/FormButtonItem.swift
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
//
|
||||||
|
// FormButtonItem.swift
|
||||||
|
// reSign
|
||||||
|
//
|
||||||
|
// Created by Мустафаев Селим Мустафаевич on 18.05.2023.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct FormButtonItem: View {
|
||||||
|
|
||||||
|
let name: String
|
||||||
|
let buttonName: String
|
||||||
|
let onClick: () -> Void
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
HStack {
|
||||||
|
Text(name)
|
||||||
|
Spacer()
|
||||||
|
Button(buttonName, action: onClick)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,6 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
import UniformTypeIdentifiers
|
||||||
|
|
||||||
struct SignView: View {
|
struct SignView: View {
|
||||||
|
|
||||||
@ -19,10 +20,31 @@ struct SignView: View {
|
|||||||
FormPickerItem(name: "Signing Identity",
|
FormPickerItem(name: "Signing Identity",
|
||||||
options: viewModel.signingIdentities,
|
options: viewModel.signingIdentities,
|
||||||
selectedItem: $viewModel.selectedIdentity)
|
selectedItem: $viewModel.selectedIdentity)
|
||||||
|
|
||||||
|
if let profile = viewModel.provisioningProfileUrl {
|
||||||
|
FormTextItem(name: "Provisioning profile",
|
||||||
|
value: profile.path())
|
||||||
|
} else {
|
||||||
|
FormButtonItem(name: "Provisioning profile",
|
||||||
|
buttonName: "Open",
|
||||||
|
onClick: openProvisioningProfile)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.formStyle(.grouped)
|
.formStyle(.grouped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func openProvisioningProfile() {
|
||||||
|
|
||||||
|
let panel = NSOpenPanel()
|
||||||
|
panel.title = "Select provisioning profile"
|
||||||
|
panel.allowsMultipleSelection = false
|
||||||
|
panel.canChooseDirectories = false
|
||||||
|
panel.allowedContentTypes = [UTType("provisionprofile")].compactMap { $0 }
|
||||||
|
if panel.runModal() == .OK {
|
||||||
|
viewModel.provisioningProfileUrl = panel.url
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SignView_Previews: PreviewProvider {
|
struct SignView_Previews: PreviewProvider {
|
||||||
|
|||||||
@ -11,6 +11,7 @@ class SignViewModel: ObservableObject {
|
|||||||
|
|
||||||
@Published var signingIdentities: [String] = []
|
@Published var signingIdentities: [String] = []
|
||||||
@Published var selectedIdentity: String = ""
|
@Published var selectedIdentity: String = ""
|
||||||
|
@Published var provisioningProfileUrl: URL?
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
updateSigningIdentities()
|
updateSigningIdentities()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user