腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
搜索
关闭
文章
问答
(146)
视频
开发者手册
清单
用户
专栏
沙龙
全部问答
原创问答
Stack Exchange问答
更多筛选
回答情况:
全部
有回答
回答已采纳
提问时间:
不限
一周内
一月内
三月内
一年内
问题标签:
未找到与 相关的标签
筛选
重置
2
回答
如何使IndexPath
rawRepresentable
?
IndexPath { case selectShopImageButton = [0,1]但是编译器说indexPath不是
rawRepresentable
: 枚举大小写的原始值必须是文字。我怎样才能使indexPath
rawRepresentable
?目前的代码是这样工作的,我想对其进行改进。
浏览 0
修改于2021-10-30
得票数 2
回答已采纳
1
回答
Objective-C枚举符合
RawRepresentable
关于这一点的任何经验,例如,我有以下用objc编写的枚举 Type1,} Type; typealias RawValue = UInt32当我试图遵循
RawRepresentable
.The时,编译器崩溃了,我唯一能想象的就是
RawRepresentable
只适用于
浏览 14
提问于2019-12-02
得票数 2
回答已采纳
2
回答
在
RawRepresentable
上实现UnitMass
我使用JSONEncoder/JSONDecoder实现了它: public init?return "{}" return result}extension UnitMass:
RawRepresentable
浏览 6
提问于2021-04-24
得票数 1
回答已采纳
2
回答
从
RawRepresentable
获取AnyIterator的泛型数组
所以我做了: return tempArray但是,我知道这个错误: 参数类型'T.RawValue‘不符合预期类型'
RawRepresentable
浏览 1
修改于2020-06-20
得票数 0
回答已采纳
1
回答
通用
RawRepresentable
协议属性
我正在寻找一种创建通用协议属性的方法,每个Struct都可以设置自己的单元枚举,以便进行比较和格式化: var measurementType : SOMETHING<
RawRepresentable
浏览 0
提问于2017-03-31
得票数 0
1
回答
测试是否符合
RawRepresentable
协议并转换为to协议
forKey: storageKey) } case left = 0} 不幸的是,我既找不到测试T是否符合
RawRepresentable
协议的魔术咒语,也不能将T转换为
RawRep
浏览 13
提问于2020-06-20
得票数 1
回答已采纳
1
回答
结构不符合
RawRepresentable
协议?
var all: GATToIPPermissions { get {}}我得到的错误是Type GATToIPPermissions does not conform to protocol
RawRepresentable
浏览 2
修改于2018-12-17
得票数 0
1
回答
如果value为`
RawRepresentable
`,如何从`Any`中提取`rawValue`
RawRepresentable
)?.rawValue } 我不介意提取的RawValue需要是静态类型... func extractRawValue<T:
RawRepresentable
, U>(fromPossibleRawRepresentable
浏览 17
提问于2019-04-02
得票数 1
3
回答
与
RawRepresentable
的一致性
thursday default : return nil }并得到一个错误,即工作日不符合
RawRepresentable
我所做的,创建了一个类似的工作示例(以了解问题所在),而且我仍然希望使用带有可故障初始化器的枚举来遵从
RawRepresentable
。问题是如何使用带有枚举的可故障抑制器,并与
RawRepresentable
保持一致。这不是家庭作业,但这些都是问题对我自己学习的限制,我对结果很感兴趣。
浏览 0
修改于2019-04-03
得票数 10
回答已采纳
1
回答
协议'
RawRepresentable
‘要求'init(rawValue:)’在iOS 13.0.0及更高版本中可用
我目前正在构建一个框架,只想让SwiftUI Color符合iOS 14的
RawRepresentable
协议。我有以下代码:extension Color:
RawRepresentable
{ }但是,这会导致两个类似的错误: Protocol '
RawRepresentable
' requires 'init(rawValue:)' to be availablein iOS 13.0.
浏览 1
提问于2021-03-16
得票数 0
2
回答
如果-让任何到
RawRepresentable
<String>
让我们假设如下:let possibleEnum: Any = MyEnum.value在不知道枚举类型名称的情况下实现stringFromPossibleEnum的最佳选择是什么?// how should this be implemented without
浏览 3
修改于2017-04-27
得票数 3
回答已采纳
1
回答
将Any转换为
RawRepresentable
where RawValue ==字符串
= ["foo": Foo.bar]因为
RawRepresentable
是一个通用协议,所以我想我也做不到或如何访问原始值(作为Any?)来自一个可能是
RawRepresentable
的对象?
浏览 2
修改于2020-04-15
得票数 0
1
回答
可见字符串枚举但不包括
RawRepresentable
我想使用在目标C和Swift中都可见的枚举,但不符合
RawRepresentable
协议。函数,但我发现enumType自动符合 public struct myEnum : Hashable, Equatable,
RawRepresentable
{ public init(rawValue
浏览 1
提问于2019-04-04
得票数 2
回答已采纳
3
回答
带有可选RawValue的
RawRepresentable
初始化
我正在尝试为
RawRepresentable
创建一个带有可选参数的通用的失败初始化器,基本上就是这个extension
RawRepresentable
浏览 0
修改于2017-02-22
得票数 2
1
回答
编写接受由
RawRepresentable
生成的任何值的泛型函数的问题
我正在尝试编写一个函数,该函数接受由
RawRepresentable
生成的任何CustomStringConvertible值。我试着写了这个: case a = "someString" func myFunction<R:
RawRepresentable
>(val:
浏览 1
提问于2019-10-04
得票数 0
回答已采纳
1
回答
如何使用组合类型CustomStringConvertible和
RawRepresentable
指定函数参数的类型?
我试过这个:这将导致以下三个错误:pr
浏览 4
提问于2020-03-27
得票数 1
回答已采纳
1
回答
如何创建处理
RawRepresentable
值的自定义集合下标
where Value ==
RawRepresentable
{ return self.elements[index as!rawValue}协议'
RawRepresentable
‘只能用作泛型约束,因为它具有自或关联的类型要求 成员'rawValue‘不能用于协议类型’
RawRepresentable
浏览 1
提问于2019-09-24
得票数 0
回答已采纳
5
回答
输入“Error”不符合“
RawRepresentable
”协议
将我的操场代码改为Swift 3,Xcode建议更改 case NotFound至 case NotFound但现在我得到了标题错误,我不知道如何使枚举符合该协议。
浏览 5
修改于2017-02-19
得票数 12
回答已采纳
2
回答
SWIFT2.1 ErrorType不符合协议
RawRepresentable
does not conform to expected type 'ErrorType' Type 'UserServicesError' does not conform to protocol '
RawRepresentable
浏览 3
修改于2017-02-19
得票数 1
回答已采纳
2
回答
具有符合CaseIterable、
RawRepresentable
的关联值的枚举
我正在尝试使具有关联值的枚举符合CaseIterable、
RawRepresentable
。在使用rawValue进行初始化时,我可以为关联值设置一些默认值。enum GenresAssociated: CaseIterable,
RawRepresentable
, Equatable { case
浏览 36
修改于2019-03-18
得票数 13
第 2 页
第 3 页
第 4 页
第 5 页
第 6 页
第 7 页
第 8 页
点击加载更多
领券