English 中文(简体)
如何在游乐场添加和输入源材料
原标题:How to add AND USE source file(s) in iOS playground
  • 时间:2023-12-14 02:43:49
  •  标签:
  • swift
问题回答

Hope to avoid other newbie one morning

In main

import UserModule
hello()
hello2()

在共同居住地点

public func hello(){
   print("hello world1")
}

In the hello2.swift

public func hello2(){
   print(" hello world -2-")
}

进口是进口模块的一般途径(包装也似乎如此),是你想要在其他地方使用这些功能的关键,因此,你必须公布。

———-

Seems only you can have UserModule and hence the main is complete.

You can add Swift files and the name and content need not aligned. It will check all inside and include them. And if you duplicate definition it will warn you. If you miss or misspelt there will be a red dot.

“和”之间也存在细微差别。

良好日子。





相关问题
SwiftUI: How do I position a button x points above a sheet?

I am trying to recreate a Maps-style UI with a persistent bottom sheet and controls fixed above. Apple Maps UI with controls above ☝️ Example here, the "Look Around" binoculars button and ...

BraintreeDropIn deprecated functions error

I m getting this error on the latest release of BraintreeDropIn, I really don t get it since based on the patch notes, this should ve been addressed already, I have already tried cleaning derived data,...

how to limit zoom level in map swift ui?

how to limit zoom level in map swift ui i have map and need to make zoom level limited Map(coordinateRegion: $region,annotationItems: viewModel.nearbyGyms) { item in ...

UIImageView - How to get the file name of the image assigned?

Is it possible to read the name of an UIImageView s UIImage that s presently stored in the UIImageView? I was hoping you could do something kind of like this, but haven t figured it out. NSString *...

热门标签