Skip to content

[swift-4.0-branch][overlay] Add back INSetProfileInCarIntent.defaultProfile for compatibliity #11176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions stdlib/public/SDK/Intents/INSetProfileInCarIntent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,17 @@ extension INSetProfileInCarIntent {
}
}

@available(iOS 11.0, *)
public final var isDefaultProfile: Bool? {
@available(iOS 10.0, *)
public var isDefaultProfile: Bool? {
return __defaultProfile?.boolValue
}

@available(swift, deprecated: 3.2, obsoleted: 4.0,
message: "Please use isDefaultProfile instead")
public var defaultProfile: Int? {
return __defaultProfile?.intValue
}

@available(iOS 10.0, *)
public final var profileNumber: Int? {
return __profileNumber?.intValue
Expand Down
11 changes: 11 additions & 0 deletions test/stdlib/Intents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ if #available(iOS 11.0, *) {
expectUnreachable()
}
}

IntentsTestSuite.test("INSetProfileInCarIntent/defaultProfile availability/\(swiftVersion)") {
func f(profile: INSetProfileInCarIntent) {
var isDefaultProfile = profile.isDefaultProfile
expectType(Bool?.self, &isDefaultProfile)
#if !swift(>=4)
var defaultProfile = profile.defaultProfile
expectType(Int?.self, &defaultProfile)
#endif
}
}
}
#endif

Expand Down