Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An example of using the CarPlay framework in iOS 12 and later.

License

NotificationsYou must be signed in to change notification settings

hansemannn/iOS12-CarPlay-Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

An example of using the CarPlay framework in iOS 12 and later.

Summary

This sample project uses theCarPlay framework to start a simple navigation sessionfrom your existing project. It utilizes theCPApplicationDelegate to connect to yourcar,CPInterfaceController to attach your view controller andCPMapTemplate to showand example template as part of the "root template" of the controller.

Notes

Some general hints I have noticed so far:

  • CarPlay works primarily in "templates", not "views" or "controllers". It means that youcannot design your CarPlay screen like you would design your iOS app, but you need to provideinformation that is then displayed in the related template.
  • The connection is done via theCPApplicationDelegate delegate that inherits from theUIApplicationDelegate, so you usually handle it as part of your main app-delegate class.
  • Once connected, you can push and pop templates like you would do with view controllers
  • Data can be used by shared frameworks, networking or general persistence layer. In thisexample, I simply persist an encoded dictionary of latitude and longitude pairs in theUserDefaults and grab it for my CarPlay connection once ready.

More?

Let me know if you have further questions! As of for now, this is a tiny example to get yourhead around the whole framework, but it can be extended to show other template types likelists, grids and UI elements like alerts and notifications.

Author

Hans Knöchel (@hansemannnn /Web)

License

MIT

Contributing

Code contributions are greatly appreciated, please submit a newPull-Request!

About

An example of using the CarPlay framework in iOS 12 and later.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp