我正在开发一个通用的 iOS 应用程序。我通常在模拟器和设备上测试它。我还希望能够使用该应用程序的生产版本,以便我可以作为“普通”用户使用发布版本。
但是,当我从 Xcode 构建并运行该应用程序时,该应用程序的 App Store 安装副本将替换为该应用程序的开发版本。
是否可以在 iOS 设备上同时提供应用程序的开发版本和生产版本(App Store 托管)?
自从新的 Swift 版本以来,当我保存数据时,键盘似乎留下了空白。
我的看法
import SwiftUI
struct AddUpdateUrl: View {
@Environment(\.presentationMode) private var presentationMode: Binding<PresentationMode>
@EnvironmentObject var controller: PlacesViewController
@Binding var place: Place
@State var url = ""
var updateMode = false
var body: some View {
VStack {
Text("Website")
.font(.callout)
TextField("", text: $url)
.keyboardType(.URL)
.border(/*@START_MENU_TOKEN@*/Color.black/*@END_MENU_TOKEN@*/, width: 1)
}
.navigationBarItems(
trailing: Button(action: {save()}) {Text("Save")}.disabled(url.isEmpty)
)
.resignKeyboardOnDragGesture()
}
private func save() {
if !url.isEmpty {
place.url = url
if updateMode {
controller.update(place: place)
}
}
presentationMode.wrappedValue.dismiss()
}
}
Run Code Online (Sandbox Code Playgroud)
单击保存按钮后 …
我有这个属性:
move.patternfile.include = *1a.txt,*2a.txt
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用Apache commons configuration2将其放入列表中.
我的代码是:
Configurations configs = new Configurations();
AbstractConfiguration config = configs.properties(new File(fileName));
config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
Run Code Online (Sandbox Code Playgroud)
我可以阅读所有其他属性,但我想要的仍然是1个大小的列表.
这是检索值的命令:
List<String> linclude = configuration.getList(String.class, "patternfile.include");
Run Code Online (Sandbox Code Playgroud)
你能帮帮忙吗?
我正在用 Swift 为 macOS 编写一个叠加图像的应用程序。它工作得很好,但当我做很多次时,记忆就会飞速增长。
我尝试创建一个小项目来读取一张图像,并将其写入 1000 次。图像为15K。该程序需要 2.7 Gb 内存。包含 1000 张图像的实际输出文件夹为 14Mb。
我使用 DispatchQueue.global 让 UI 自由显示操作编号。
如果你有任何想法;)
谢谢,尼古拉斯
这里是代码:
import SwiftUI
struct ContentView: View {
@State private var presentImageImporter = false
@State private var runningComputation = 1
@State private var inputImage: NSImage?
var body: some View {
VStack {
Button("Image") {
presentImageImporter = true
}.fileImporter(isPresented: $presentImageImporter, allowedContentTypes: [.png, .jpeg]) { result in
switch result {
case .success(let url):
if url.startAccessingSecurityScopedResource() {
inputImage = NSImage(byReferencing: url)
url.stopAccessingSecurityScopedResource()
} …Run Code Online (Sandbox Code Playgroud)