I will show you all the source code of released iOS application!
Introduction
This time, I thought about publishing the source code of the application for the following reasons.
- I want many people to see the application I made.
- I want to hear opinions of various people.
- I would like to help those who make apps by sharing code.
I hope this article will be useful to everyone π
Introduction of the application
Innovy (Innovy).
It is a news application for 20s to 30s (mainly men) who are setting up antennas for gathering information on latest services and technologies.
β» I made the name that imagined an innovator (innovator).
You can see latest news by genre and user's reaction.
Moreover, because there is a news read-out function, you can also check news while walking.
App URL:https://itunes.apple.com/us/app/Innovy/id1319179144
screenshot
β News list screen
You can check various genres of news on the top page of the application.
Tap on the news to change the genre with the detail screen, horizontal swipe.
β‘ News list screen (press long news)
After long press of the news, start reading aloud from the place where the news was selected with "tap from this position" tap.
β’ News detail screen (reading articles)
You can check the details of the news.
From this screen you can check tweets about news clips and news on display.
β£ Tweet list screen
You can check tweets about selected news from the list.
You can tweet by pressing tweet button.
β€ Article search screen
You can search past news.
β₯ Setting screen
You can check the weather forecast of the current location and change the settings of the application.
Launch public source code and applications
First of all, I access the following URL.
https://github.com/RyutaMiyamoto/Innovy
Clone or download
βDownload ZIP
to download the project.
Please unzip the downloaded zip file.
Install the library using the following cocoaPods.
Please refer to another article how to install cocoaPods.
After installing cocoaPods open the terminal, go to the Innovy-master folder, enter the pod install
command and wait until the library installation is over.
After installing the library, open the Innovy - master folder and open likeNews.xcworkspace
.
Recommended environment: XCode 9.3
After opening XCode, select the appropriate terminal with iOS Simulators
and press theRun button
.
Successful when simulator & application starts.
Of course, if you set Provisioning Profile, it is also possible to operate in real machine.
Firebase plist, API key for API with limit of number of times etc. are masked, so some are not displayed.
If you contact us separately, we will pass items that are masked π
- However, I will limit it to those who are clear on their identity (on Facebook etc.).
Architecture introduction
Innovy adopts MVVM (Model-View-ViewModel) as the architectural pattern?
For example, when the user performs the operation of reacquiring the latest news on the news list screen (pulls the screen upward), it moves as follows.
- Consider
NewsListViewController
in code asView
,NewsListViewModel
asViewModel
andNewsListModel
asModel
.
β . View
detects? Update operation by user
β‘. View
requests update process toViewModel
β’ ViewModel
askedModel
to acquire news list
β£. Model
uses the news list acquisition API to acquire the latest news
β€. Model
notifiesViewModel
of completion of news acquisition
β₯. Create data for View
display based on the news listViewModel
obtained from Model
β¦. ViewModel
notifiesView
of completion of data creation
β§. View
updates screen based onViewModel
information
So the latest news information is reflected in the application π
Introduction of library used in application
R.swift
Since it is possible to acquire the image file name and the Storyboard name as properties, it prevents errors due to typing errors.
Image file name, alert message ?, xib name etc used everywhere.
Alamofire
A library for facilitating HTTP communication.
Everyone is using it for iOS application development that communicates, is not it?
Used in the API communication part.
SDWebImage
Just specifying a URL for UIImageView will display the image, loading display, cache it will cache.
Used in the display portion of the article image.
Unbox
A library that parses Json.
Used in the place to retrieve Json acquired by API for use inside the application.
Realm
Application version database.
The data access syntax is very easy to understand.
Used for storing article information.
CTFeedback
A library that makes it easy to create an inquiry screen.
Used on the inquiry screen.
SVProgressHUD
A library for displaying indicators representing processing in front of the screen.
Used while acquiring article information.
HockeySDK
A library that collects crash reports when crashing applications.
Set at startup.
Firebase
Application general search library such as application usage survey, crash report viewing, push notification?
Set at startup.
NendSDK_iOS
A library for displaying advertisements.
Used when displaying articles.
Introduction to API
Article information acquisition API (self-made) (likeNews/getNews.php)
API for retrieving article information?
Used when displaying the list.
Genre information acquisition API (homebrew) (likeNews/getGenre.php)
API for getting genre information?
Genres include "startup", "service", "design" and others.
Used at startup.
Article article score addition API (homebrew) (likeNews/updateNewsScore.php)
API to add the number of times you saw the article details.
Tap any article from the article list and use it at the timing of opening the article details.
By this, when you display the article you can display "other people β people are paying attention to this article!"?
Tweet Information Acquisition API
API to acquire tweet information from Twitter to acquire
Article detail screen? When you tap the tweet button at the bottom, a tweet list is displayed, but it is used when acquiring the list.
Weather Information Acquisition API
API for getting weather information.
By specifying latitude and longitude, weather information of the place can be acquired.
Used when displaying weather information displayed on the setting screen.
Location Information Retrieval API
? API for obtaining location information.
If you specify latitude and longitude, you can obtain the address of that place in Japanese.
Since weather information API can only obtain addresses in English, we will separately obtain addresses using this API.
Used with weather information API.
At the end
How was that.
Read this article and open your iOS application
Original Article:
https://qiita.com/ryupaka/items/ea272c843d3ebf3b245b
Top comments (1)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.