#100DaysOfCode - Antique
Listed below are my entries to #100DaysOfCode
Day 1: Distance between two CLLocation objects.
The code below is written in Swift and as of Xcode 11.5 and iOS 13.5.x is still correct.
func distance(me: CLLocation, other: CLLocation) -> Double {
return me.distance(from: other) / 1000 // km
}Day 2: Generating a random password
The code below is written in Python and as of Python 3.8.x is still correct.
def generatePassword():
lowercase = "abcdefghijklmnopqrstuvwxyz"
uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
numbers = "1234567890"
special = "!@#$%^&*()[]{}-_=+|;:'""',.<>/?"
password_length = input("Enter desired password length:\n")
length = int(password_length)
allow_special = input("Allow special characters? (Y/N)\n")
allow_special_chars = str(allow_special)
password = ""
for char in range(length):
if allow_special_chars.upper() == "N":
password += random.choice(lowercase + uppercase + numbers)
else:
password += random.choice(lowercase + uppercase + numbers + special)
print(password)
# usage: generatePassword()Day 3: Tweet a Reddit post with a specific flair
The code below is written in Python and as of Python 3.8.x is still correct.
Day 4: Corners as round as Kim's...
The code below is written in Swift and as of Xcode 11.5 and iOS 13.5.x is still correct.
Day 5: Cutting a transparent hole in a UIVisualEffectView
The code below is written in Objective-C and as of Xcode 11.5 and iOS 13.5.x is still correct.
Day 6: Logging NSString objects to a file
The code below is written in Objective-C and as of Xcode 11.5 and iOS 13.5.x is still correct.
Day 7: Using MPMusicPlayerController methods
The code below is written in Objective-C and as of Xcode 11.5 and iOS 13.5.x is still correct.
Day 8: Writing an API wrapper for weatherstack.com
The code below is written in Objective-C and as of Xcode 11.5 and iOS 13.5.x is still correct.
Day 9: Convert NSTimeInterval to NSString
The code below is written in Objective-C and as of Xcode 11.5 and iOS 13.5.x is still correct.
Day 10: Convert NSDate to NSString and vice versa
The code below is written in Objective-C and as of Xcode 11.5 and iOS 13.5.x is still correct.
Day 11: Achieving different blurs in Logos
The code below is written in Objective-C (Logos) and as of iOS 13.5.x is still correct.
Some methods may no longer work in newer iOS versions, if this is the case ensure you remove them. The class itself does still work.
Day 12: NSFileManager and its many uses
The code below is written in Swift and as of Xcode 11.5 and iOS 13.5.x is still correct.
Day 13: Displaying a window above SpringBoard (iOS 13 and below).
The code below is written in Objective-C and as of iOS 13.5.x is still correct.
Day 14: Compressing and decompressing data
The code below is written in Swift and as of iOS 13.5.x is still correct.
Day 15: Getting an iOS device's UDID (Jailbroken)
The code below is written in Objective-C and as of iOS 12.x is still correct.
Last updated
Was this helpful?