Skip to content

Commit 631dc2c

Browse files
author
Max Moiseev
committed
"[overlay] Add back INSetProfileInCarIntent.defaultProfile for compatibliity
<rdar://problem/33457609> (cherry picked from commit 936a79cbf2eee87f03000ad570b1db6db1e10d10)
1 parent 9049eb1 commit 631dc2c

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

stdlib/public/SDK/Intents/INSetProfileInCarIntent.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,17 @@ extension INSetProfileInCarIntent {
123123
}
124124
}
125125

126-
@available(iOS 11.0, *)
127-
public final var isDefaultProfile: Bool? {
126+
@available(iOS 10.0, *)
127+
public var isDefaultProfile: Bool? {
128128
return __defaultProfile?.boolValue
129129
}
130130

131+
@available(swift, deprecated: 3.2, obsoleted: 4.0,
132+
message: "Please use isDefaultProfile instead")
133+
public var defaultProfile: Int? {
134+
return __defaultProfile?.intValue
135+
}
136+
131137
@available(iOS 10.0, *)
132138
public final var profileNumber: Int? {
133139
return __profileNumber?.intValue

test/stdlib/Intents.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ if #available(iOS 11.0, *) {
4141
expectUnreachable()
4242
}
4343
}
44+
45+
IntentsTestSuite.test("INSetProfileInCarIntent/defaultProfile availability/\(swiftVersion)") {
46+
func f(profile: INSetProfileInCarIntent) {
47+
var isDefaultProfile = profile.isDefaultProfile
48+
expectType(Bool?.self, &isDefaultProfile)
49+
#if !swift(>=4)
50+
var defaultProfile = profile.defaultProfile
51+
expectType(Int?.self, &defaultProfile)
52+
#endif
53+
}
54+
}
4455
}
4556
#endif
4657

0 commit comments

Comments
 (0)