UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Project 1 - Assign custom class to View controller

Forums > 100 Days of Swift

Hi !

Thanks a lot for material for studying Swift!

1) I have trouble specifying custom class for Table View Controller. Class which is created in ViewController.swift does not appear in "Custom class -> Class". Have tried to save/restart project. Class:

import UIKit

class ViewController: UIViewController {
    var pictures = [String]()

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.

        let fm = FileManager.default
        let path = Bundle.main.resourcePath!
        let items = try! fm.contentsOfDirectory(atPath: path)

        for item in items {
            if item.hasPrefix("nssl") {
                pictures.append(item)
            }
        }

        print(pictures)
    }
}

2) How could i get invite into Slack workspace ?

Thanks!

3      

So what i did for 1) is I changed UIViewController to UITableViewController dont know if that wont trigged any issues later, but now able to select custom class for my tableViewController

4      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.