An immersive iOS story creation and reading app powered by AI, offering interactive storytelling experiences through advanced natural language processing and dynamic narrative generation.
An immersive iOS story creation and reading app powered by AI, offering interactive storytelling experiences through advanced natural language processing and dynamic narrative generation.
# Podfile
pod 'Alamofire', '~> 5.8.0'
pod 'SwiftyJSON', '~> 5.0.0'
pod 'Realm', '~> 10.45.0'
pod 'Lottie', '~> 4.3.0'
pod 'SwiftLint', '~> 0.52.0'
GEMINI_API_KEY=your_api_key
ENVIRONMENT=development|staging|production
DEBUG_LEVEL=verbose|info|warning|error
FEATURE_FLAGS={"newReader":true,"aiGeneration":true}
# Clone the repository
git clone https://github.com/yourusername/storytime-2.0.git
# Navigate to project directory
cd storytime-2.0
# Install dependencies
pod install
# Open workspace
open StoryTime.xcworkspace
Configuration.plist
in the project root// Example ViewModel Structure
class StoryViewModel: ObservableObject {
@Published var stories: [Story] = []
@Published var isLoading: Bool = false
private let storyService: StoryService
init(storyService: StoryService = StoryService()) {
self.storyService = storyService
}
func fetchStories() async {
isLoading = true
defer { isLoading = false }
do {
stories = try await storyService.fetchStories()
} catch {
// Error handling
}
}
}
graph TD
A[View] --> B[ViewModel]
B --> C[Service Layer]
C --> D[Local Storage]
C --> E[API Client]
E --> F[Gemini AI API]
D --> G[CoreData]
struct StoryTimeColors {
static let primary = Color("PrimaryBlue")
static let secondary = Color("SecondaryGreen")
static let accent = Color("AccentOrange")
static let background = Color("BackgroundGray")
static let text = Color("TextColor")
}
struct StoryTimeFonts {
static let title = Font.custom("Merriweather-Bold", size: 24)
static let body = Font.custom("OpenSans-Regular", size: 16)
static let caption = Font.custom("OpenSans-Light", size: 14)
}
class GeminiService {
private let apiKey: String
private let baseURL = "https://api.gemini.ai/v1"
init() {
guard let apiKey = Bundle.main.infoDictionary?["GEMINI_API_KEY"] as? String else {
fatalError("Gemini API Key not found")
}
self.apiKey = apiKey
}
func generateStory(prompt: String) async throws -> Story {
// AI story generation implementation
}
}
Operation | Target Time | Current Average |
---|---|---|
App Launch | < 2s | 1.8s |
Story Load | < 1s | 0.7s |
AI Generation | < 5s | 4.2s |
Save Story | < 0.5s | 0.3s |
// Example style guide
struct ExampleView: View {
// MARK: - Properties
@State private var isLoading: Bool = false
// MARK: - Body
var body: some View {
VStack {
if isLoading {
ProgressView()
} else {
ContentView()
}
}
}
// MARK: - Private Methods
private func loadContent() {
// Implementation
}
}
# Run tests
xcodebuild test -workspace StoryTime.xcworkspace -scheme StoryTime -destination 'platform=iOS Simulator,name=iPhone 15 Pro'
This project is licensed under the MIT License - see the LICENSE.md file for details.