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
| // fetch api making a GET request for Podcasts from Apple Search API | |
| // Asynchronous request so we need to use Promises to listen for completions of task | |
| // filter() is used to get only Swift Podcast related to "Technology" included as part of the genres array | |
| fetch('https://itunes.apple.com/search?media=podcast&limit=200&term=swift') | |
| .then((response) => response.json()) | |
| .then((jsonData) => { | |
| const resultCount = jsonData['resultCount'] | |
| const results = jsonData['results'] | |
| const filteredPodcasts = results.filter((podcast) => (podcast.genres.includes('Technology'))) | |
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
| import React from 'react'; | |
| // import third party libraries | |
| import { createStackNavigator } from 'react-navigation' | |
| // import screens | |
| import MainScreen from './screens/MainScreen' | |
| import DetailScreen from './screens/DetailScreen' | |
| const RootStack = createStackNavigator({ |
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
| <Image | |
| source={ | |
| this.state.isLoaded | |
| ? | |
| {uri:this.state.imageURL} | |
| : | |
| require('../assets/placeholder-image.png') | |
| } | |
| style={styles.detailImage} | |
| /> |
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
| const TabStack = createBottomTabNavigator( | |
| { | |
| Search: HomeNavStack, | |
| Favorites: FavoritesNavStack, | |
| }, | |
| { | |
| navigationOptions: ({ navigation }) => ({ | |
| tabBarIcon: ({ focused, tintColor }) => { | |
| const { routeName } = navigation.state; | |
| let iconName; |
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
| func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? { | |
| if annotation is MKUserLocation { | |
| return nil | |
| } | |
| var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: "PlaceAnnotationView") as? MKMarkerAnnotationView | |
| if annotationView == nil { | |
| annotationView = MKMarkerAnnotationView(annotation: annotation, reuseIdentifier: "PlaceAnnotationView") | |
| annotationView?.canShowCallout = true | |
| } else { | |
| annotationView?.annotation = annotation |
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
| // | |
| // ViewController.swift | |
| // KeyboardHandling | |
| // | |
| // Created by Alex Paul on 1/29/19. | |
| // Copyright © 2019 Alex Paul. All rights reserved. | |
| // | |
| import UIKit |
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
| import UIKit | |
| class ViewController: UIViewController { | |
| @IBOutlet weak var nameLabel: UILabel! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| let text = "stockholm, sweden" |
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
| import Foundation | |
| class ApplicationInfo { | |
| class func getVersionBuildNumber() -> String { | |
| guard let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString"), | |
| let build = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") | |
| else { | |
| fatalError("no version info") | |
| } | |
| return "\(version) (\(build))" |
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
| // print(AVSpeechSynthesisVoice.speechVoices()) | |
| [[AVSpeechSynthesisVoice 0x283654fe0] Language: ar-SA, Name: Maged, Quality: Default [com.apple.ttsbundle.Maged-compact], [AVSpeechSynthesisVoice 0x283655560] Language: cs-CZ, Name: Zuzana, Quality: Default [com.apple.ttsbundle.Zuzana-compact], [AVSpeechSynthesisVoice 0x2836552e0] Language: da-DK, Name: Sara, Quality: Default [com.apple.ttsbundle.Sara-compact], [AVSpeechSynthesisVoice 0x283654c60] Language: de-DE, Name: Anna, Quality: Default [com.apple.ttsbundle.Anna-compact], [AVSpeechSynthesisVoice 0x2836550a0] Language: el-GR, Name: Melina, Quality: Default [com.apple.ttsbundle.Melina-compact], [AVSpeechSynthesisVoice 0x283654ea0] Language: en-AU, Name: Karen, Quality: Default [com.apple.ttsbundle.Karen-compact], [AVSpeechSynthesisVoice 0x283654d20] Language: en-GB, Name: Daniel, Quality: Default [com.apple.ttsbundle.Daniel-compact], [AVSpeechSynthesisVoice 0x283655120] Language: en-IE, Name: Moira, Quality: Default [com.apple.ttsbundle.Moira-compact], [AVS |