This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The table views in this app actually don't make use of tableView(_:heightForRowAt:). These table views set the table views' | |
// rowHeight and estimatedRowHeight properties to UITableViewAutomaticDimension and 110, respectively, and they make use | |
// of a series of constraints to automatically set each cells' row height. | |
// Use tableView(_:heightForRowAt:) to set the height for specific table view cells. | |
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | |
// Set the row height for the first (zeroth) cell in all section(s) to 100, and set all other cells to 50. | |
// You can also set the row height for all cells in a section by accessing indexPath.section. | |
if indexPath.row == 0 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using touch gestures to interact with your Augmented Reality objects actually doesn't involve more ARKit code! Rather, | |
// you'll have to implement some new SCNKit code and play with a UITapGestureRecognizer from good ol' UIKit. Here we will | |
// create a Super Mario box, and it will pop up as if you were Mario jumping underneath it! | |
// If you're jumping straight into this view controller, you might need to update your info.plist (Information Property | |
// List) file first. Add the key "Privacy - Camera Usage Description" with the corresponding value "This application will | |
// use your camera for Augmented Reality", or some similarly descriptive note. | |
// Let's get started! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adding a second object to your Augmented Reality space is not much different from adding the first, so we will change | |
// things up here a bit. Here we will create a sphere in addition to a box and we will give our objects some style. | |
// If you haven't already, you need to add a key-value pair to your application's Info.plist (Information Property List) file. | |
// Add the key "Privacy - Camera Usage Description" with the corresponding value "This application will use your camera for | |
// Augmented Reality", or some similarly descriptive note. | |
// Let's get started! | |
// You'll need to import SceneKit to create and edit your objects and ARKit to place it in your augmented reality space. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creating a 3D text object with ARKit isn't overwhelming. It might not be immediately obvious, but these objects could | |
// be quite valuable moving forward. Imagine dropping a 3D advertisement in someone's augmented reality universe... | |
// We'll get started in a sec, but first you need to add a key-value pair to your application's Info.plist (Information | |
// Property List) file. Add the key "Privacy - Camera Usage Description" with the corresponding value "This application | |
// will use your camera for Augmented Reality", or some similarly descriptive note. | |
// Let's get started! | |
// You'll need to import SceneKit to create your object and ARKit to place it in your augmented reality space. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creating a simple Augmented Reality object with ARKit and SceneKit is surprisingly easy! But before you get started, you | |
// need to add a key-value pair to your application's Info.plist (Information Property List) file. Add the key "Privacy - | |
// Camera Usage Description" with the corresponding value "This application will use your camera for Augmented Reality", or | |
// some similarly descriptive note. | |
// Let's get started! | |
// You'll need to import SceneKit to create your object and ARKit to place it in your augmented reality space. | |
import UIKit | |
import SceneKit |
NewerOlder