• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • WordPress
    • WordPress Website Design Process
    • WordPress Tutorials
    • WPplaces – Managed WordPress Hosting
    • Website Design Terms of Service
  • Content Production
  • IT Services
    • Remote Support
  • Open Source
  • Apple
  • SpaceX
  • Starlink
  • Tesla

KennethJackson.Tech

Web and iOS Developer - Systems Integrator and Administrator

  • Facebook
  • Twitter
  • YouTube
  • GitHub
  • Home
  • Kenneth Jackson
  • Showcase
  • Testimonials
  • Contact
  • Inventory
  • My Account
    • Cart
    • Client Portal
    • Payments
You are here: Home / Archives for Apple / Swift

Swift

Swift Intermediate – FinalExam1.1

December 12, 2018


https://github.com/ConnectionsDigital/FinalExam1.1
0 forks.
0 stars.
0 open issues.
Recent commits:

  • Initial Commit, Kenneth Jackson
  • Initial Commit, Kenneth Jackson

Filed Under: Swift Tagged With: Amarillo, Swift 4.2, Texas

Intermediate Swift – BMI

November 20, 2018

BMI Calculator Exercise
https://github.com/ConnectionsDigital/BMI
0 forks.
0 stars.
0 open issues.
Recent commits:

  • BMI Calculator Exercise, Kenneth Jackson
  • Initial Commit, Kenneth Jackson

Filed Under: Swift Tagged With: Amarillo, Swift 4.2, Texas

Intermediate Swift – Chapter 2.3 Structures

November 5, 2018

import UIKit
import Foundation
//Structures

struct Person {
    var name: String
    func sayHello() {
        print("Hello, there! My name is \(name)")
    }
}

let firstPerson = Person(name: "Kenneth")
print(firstPerson.name)
firstPerson.sayHello()

let person = Person(name: "Zane")
print(person.name)
person.sayHello()

//Instances

//Does not match text example
struct Shirt {
    var size: String
    var color1: String
}

let myShirt = Shirt(size: "xl", color1: "blue")
//let youShirt = Shirt(size: .m, color: .red)

print(myShirt.size)

struct Color {
    var blue: String
    var black: UIColor
    var green: UIColor
}

struct Direction {
    // TODO add stuff
}

struct Car {
    var make: String
    var year: Int
    var color: String
    var topSpeed: Int

    func startEngine() {
        "..."
    }
    func drive() {}
    func park() {}
    func steer(direction: Direction) {}
}

let firstCar = Car(make: "Honda", year: 2010, color: "blue", topSpeed: 120)
let secondCar = Car(make: "Ford", year: 2013, color: "black", topSpeed: 125)

firstCar.startEngine()
firstCar.drive()

struct Odometer {
    var count: Int = 0
}

let odometer = Odometer(count: 27000)
print(odometer.count)

Filed Under: Swift Tagged With: Amarillo, Swift 4.2, Texas

Intermediate Swift – Chapter 2.2 Functions

November 4, 2018

import UIKit

func displayPi() {
    print("3.1415926535")
}

displayPi()

//Parameters

func triple(value: Int) {
    let result = value * 3
    print("If you multiply \(value) by 3, you'll get \(result).")
}

triple(value: 10)

func multiply(firstNumber: Int, secondNumber: Int) {
    let result = firstNumber * secondNumber
    print("The result is \(result).")
}

multiply(firstNumber: 7, secondNumber: 8)

//Argument Labels

func sayHello(to firstPerson: String, and SecondPerson: String) {
    print("Hello, \(firstPerson) and \(SecondPerson).")
}

sayHello(to: "Jancy", and: "Yvonne")

//Default Parameters

func display(teamName: String, score: Int = 0) {
    print("\(teamName): \(score)")
}

display(teamName: "Wombats", score: 100)
display(teamName: "Warriors")

//Return Values

func multiply1(firstNumber: Int, secondNumber: Int) -> Int {
    let result = firstNumber * secondNumber
    return result
}

print(multiply1(firstNumber: 7, secondNumber: 8))

let myResult = multiply1(firstNumber: 5, secondNumber: 5)

print("5 * 5 is \(myResult)")

print("5 * 2 is \(multiply1(firstNumber: 5, secondNumber: 2))")

Filed Under: Swift Tagged With: Amarillo, Swift 4.2, Texas

Intermediate Swift – Chapter 2.1 Strings

November 4, 2018

import UIKit

let joke = """
    Q: Why did the chicken cross the road?
    A: To get to the other side!
    """

print(joke)

let greeting = "It is traditional in programming to print \"Hello World\"."

print(greeting)

var myString = ""

if myString.isEmpty {
    print("The string is empty.")
}

myString

let string1 = "Hello"
let string2 = ", world!"
let myString1 = string1 + string2

print(myString1)

var myString2 = "Hello"
myString2 = myString2 + ", world!"
myString2 += " Hello!"

print(myString2)


//String Interpolation

let name = "Kenneth"
let age = 53
print("\(name) is \(age) years old.") // Kenneth is 53 years old.

let a = 4
let b = 5
print("If a is \(a) and b is \(b), then a + b equals \(a+b)")

//String Equality and Comparison

let month = "January"
let otheMonth = "January"

let lowercasedMonth = "january"

if month == otheMonth {
    print("They are he same")
}

if month != lowercasedMonth {
    print("They are not the same.")
}

let name1 = "Johnny Appleseed"
if name1.lowercased() == "joHnny aPPleseeD".lowercased() {
    print("The two names are equal.")
}

let greeting1 = "Hello, world!"

print(greeting1.hasPrefix("Hello"))
print(greeting1.hasSuffix("world!"))
print(greeting1.hasSuffix("World!"))

let greeting2 = "Hi Jancy, my name is Kenneth."

    if greeting2.contains("my name is") {
        
        print("Making an introduction")
}

//Counting characters
let count = name.count
print(count)

let newPassword = "1234"

if newPassword.count < 8 {
    print("The password is too short. Passwords must have at least 8 characters.")
}

//Switch Statements

let someCharacter: Character = "e"
switch someCharacter {
case "a", "e", "i", "o", "u":
    print("\(someCharacter) is a vowel")
default:
    print("\(someCharacter) is not a vowel")
}

Filed Under: Swift Tagged With: Amarillo, Strings, Swift 4.2, Texas, X-Code 10

Intermediate Swift – Light Project

October 31, 2018

App Development with Swift – Chapter 1 – Guided Project – Light. From the Apple Everyone Can Code series available in the Books app on Mac for free.
https://github.com/ConnectionsDigital/Light
0 forks.
0 stars.
0 open issues.
Recent commits:

  • Initial Commit, Kenneth Jackson

Filed Under: Swift Tagged With: Amarillo, Swift 4.2, Texas

Primary Sidebar

Recent Posts

  • LiDAR Test Post March 1, 2021
  • High Flight – Pilot Officer John Gillespie Magee Jr. December 11, 2020
  • John Lennon – October 9, 1940 – December 8, 1980 December 8, 2020
  • Remembering Pearl Harbor December 7, 2020
  • Apple Event – One More Thing – Apple Silicon MacBook Pro, MacBook Air, and Mac mini November 10, 2020
  • Training Day – CoreML, CreateML and Object Detection November 8, 2020
  • Time for Holiday Marketing Campaigns November 6, 2020
  • Workflow – Think Different November 4, 2020
  • Workflow – Donut-shaped C Code November 2, 2020
  • Workflow – iPhone 12 Review – Marques Brownlee November 1, 2020

Categories

  • Apple
    • Augmented Reality
    • Events
    • iPhone 12
    • iPhone 6
    • iPhone 6 Plus
    • Mac
    • Machine Learning
    • Swift
  • Best Practices
  • Client Work
  • Design
  • eCommerce
  • Electronics
  • Email List Management
  • Events
  • Facebook
  • Galleries
  • Google
  • History
  • Latest News
  • Local Search
  • Made In Amarillo
  • Microsoft
  • My Gear
  • NGINX
  • One More Thing
  • Pay-Per-Click (PPC)
  • Photography
  • Projects
    • Christine
  • Rants
  • Recipes
  • Search Engine Optimization (SEO)
  • SpaceX
  • Tesla
  • The Humor File
  • Twitter
  • WooCommerce
  • WordPress
  • Workflow
  • Yahoo
  • YouTube

Subscribe to KennethJackson.Tech

Kenneth Jackson

(806) 374-2323
Please leave a voice or text message.

Contact Kenneth

Footer

Follow Me

  • Facebook
  • Twitter
  • YouTube
  • GitHub
  • Discord
  • Contact Us

Administrative

  • Payments
  • Advertisements
  • Privacy Policy
  • Terms of Service
  • Terms and Conditions
  • Website Design Terms of Service

My Work

  • WPplaces Managed WordPress
  • SpaceX Status Report
  • AmaKit – Swift Developer Group

Copyright © Kenneth Jackson

Designed by Kenneth Jackson in Amarillo, Texas

Powered by WPplaces